201044 default
authorhgs
Thu, 04 Nov 2010 11:16:56 +0200
changeset 71 60b4b6493d7b
201044
doc/run_doxygen.bat
doc/videoplayer_doxyfile
filedetails/filedetailsdialog/bwinscw/MPFileDetailsDialogu.def
filedetails/filedetailsdialog/data/MPFileDetails.rss
filedetails/filedetailsdialog/eabi/MPFileDetailsDialogu.def
filedetails/filedetailsdialog/group/MPFileDlg.mmp
filedetails/filedetailsdialog/group/bld.inf
filedetails/filedetailsdialog/inc/MPFileDetailsDialog.inl
filedetails/filedetailsdialog/inc/MediaPlayerDrmHelper.h
filedetails/filedetailsdialog/inc/MediaPlayerPrivateCRKeys.h
filedetails/filedetailsdialog/inc/MediaPlayerVariant.hrh
filedetails/filedetailsdialog/inc/mppopuplist.h
filedetails/filedetailsdialog/loc/filedetailsdialog.loc
filedetails/filedetailsdialog/rom/filedetailsdialog.iby
filedetails/filedetailsdialog/rom/filedetailsrsc.iby
filedetails/filedetailsdialog/src/MPFileDetails.cpp
filedetails/filedetailsdialog/src/MPFileDetailsDialog.cpp
filedetails/filedetailsdialog/src/MediaPlayerDrmHelper.cpp
filedetails/filedetailsdialog/src/mppopuplist.cpp
filedetails/filedetailsplugin/data/filedetailsplugin.rss
filedetails/filedetailsplugin/group/bld.inf
filedetails/filedetailsplugin/group/filedetailsplugin.mmp
filedetails/filedetailsplugin/inc/filedetailsplugin.h
filedetails/filedetailsplugin/inc/filedetailsplugin.hrh
filedetails/filedetailsplugin/rom/filedetailsplugin.iby
filedetails/filedetailsplugin/src/filedetailsimplementationproxy.cpp
filedetails/filedetailsplugin/src/filedetailsplugin.cpp
group/bld.inf
inc/IptvDebug.h
inc/icons_vcx_base.mk
inc/mpxvideo_debug.h
inc/mpxvideoplayercustomviewmsgconsts.h
inc/videoplayerpskeys.h
layers.sysdef.xml
mediasettings/feedsettingsplugin/data/vcxnssettingsplugin.rss
mediasettings/feedsettingsplugin/group/bld.inf
mediasettings/feedsettingsplugin/group/vcxnssettingsplugin.mmp
mediasettings/feedsettingsplugin/inc/vcxnssettingsplugin.h
mediasettings/feedsettingsplugin/inc/vcxnssettingsplugin.hrh
mediasettings/feedsettingsplugin/rom/feedsettingsplugin.iby
mediasettings/feedsettingsplugin/src/vcxnssettingsplugin.cpp
mediasettings/feedsettingsplugin/src/vcxnssettingspluginproxy.cpp
mediasettings/feedsettingsviews/BWINS/vcxnssettingsviewu.def
mediasettings/feedsettingsviews/EABI/vcxnssettingsviewu.def
mediasettings/feedsettingsviews/group/bld.inf
mediasettings/feedsettingsviews/group/vcxnssettingsview.mmp
mediasettings/feedsettingsviews/inc/feedsettingsview.h
mediasettings/feedsettingsviews/inc/feedsettingsview.hrh
mediasettings/feedsettingsviews/inc/feedsettingsview.rh
mediasettings/feedsettingsviews/inc/feedsettingsviewaddoreditservice.h
mediasettings/feedsettingsviews/inc/feedsettingsviewaddservicelistbox.h
mediasettings/feedsettingsviews/inc/feedsettingsviewcontainer.h
mediasettings/feedsettingsviews/inc/feedsettingsviewremoveservicequerydialog.h
mediasettings/feedsettingsviews/inc/feedsettingsviewserviceselection.h
mediasettings/feedsettingsviews/rom/feedsettingsviews.iby
mediasettings/feedsettingsviews/rom/feedsettingsviewsresources.iby
mediasettings/feedsettingsviews/rss/vcxnssettingsview.rss
mediasettings/feedsettingsviews/src/feedsettingsview.cpp
mediasettings/feedsettingsviews/src/feedsettingsviewaddoreditservice.cpp
mediasettings/feedsettingsviews/src/feedsettingsviewaddservicelistbox.cpp
mediasettings/feedsettingsviews/src/feedsettingsviewcontainer.cpp
mediasettings/feedsettingsviews/src/feedsettingsviewremoveservicequerydialog.cpp
mediasettings/feedsettingsviews/src/feedsettingsviewserviceselection.cpp
mediasettings/group/bld.inf
mediasettings/gsvideoplugin/data/10275068.rss
mediasettings/gsvideoplugin/group/bld.inf
mediasettings/gsvideoplugin/group/gsvideoplugin.mmp
mediasettings/gsvideoplugin/inc/GSMediaPlayerStreamingView.h
mediasettings/gsvideoplugin/inc/GSMediaPlayerVideoView.h
mediasettings/gsvideoplugin/inc/GSVideoPlugin.h
mediasettings/gsvideoplugin/rom/gsvideoplugin.iby
mediasettings/gsvideoplugin/rom/gsvideopluginresources.iby
mediasettings/gsvideoplugin/src/GSMediaPlayerStreamingView.cpp
mediasettings/gsvideoplugin/src/GSMediaPlayerVideoView.cpp
mediasettings/gsvideoplugin/src/GSVideoPlugin.cpp
mediasettings/gsvideoplugin/src/GSVideoPluginImplementationTable.cpp
mediasettings/mediasettingsapp/aif/MediaSettingsaif.rss
mediasettings/mediasettingsapp/data/101F85CB.rss
mediasettings/mediasettingsapp/data/101F85E5.rss
mediasettings/mediasettingsapp/data/MediaSettings.rss
mediasettings/mediasettingsapp/data/MediaSettings_reg.rss
mediasettings/mediasettingsapp/group/bld.inf
mediasettings/mediasettingsapp/group/iconlist.txt
mediasettings/mediasettingsapp/group/icons.mk
mediasettings/mediasettingsapp/group/icons_dc.mk
mediasettings/mediasettingsapp/group/mediasettingsapp.mmp
mediasettings/mediasettingsapp/inc/MPSettingsAdvancedBwContainer.h
mediasettings/mediasettingsapp/inc/MPSettingsAdvancedBwSettingItem.h
mediasettings/mediasettingsapp/inc/MPSettingsAdvancedBwSettingItemList.h
mediasettings/mediasettingsapp/inc/MPSettingsAdvancedBwView.h
mediasettings/mediasettingsapp/inc/MPSettingsApp.h
mediasettings/mediasettingsapp/inc/MPSettingsAppUi.h
mediasettings/mediasettingsapp/inc/MPSettingsConstants.h
mediasettings/mediasettingsapp/inc/MPSettingsDocument.h
mediasettings/mediasettingsapp/inc/MPSettingsMainContainer.h
mediasettings/mediasettingsapp/inc/MPSettingsMainView.h
mediasettings/mediasettingsapp/inc/MPSettingsNaviPaneController.h
mediasettings/mediasettingsapp/inc/MPSettingsSliderSettingItem.h
mediasettings/mediasettingsapp/inc/MPSettingsStreamingContainer.h
mediasettings/mediasettingsapp/inc/MPSettingsStreamingSettingItemList.h
mediasettings/mediasettingsapp/inc/MPSettingsStreamingView.h
mediasettings/mediasettingsapp/inc/MPSettingsUDPPortSettingItem.h
mediasettings/mediasettingsapp/inc/MPSettingsVideoContainer.h
mediasettings/mediasettingsapp/inc/MPSettingsVideoSettingItemList.h
mediasettings/mediasettingsapp/inc/MPSettingsVideoView.h
mediasettings/mediasettingsapp/inc/mediasettings.hrh
mediasettings/mediasettingsapp/loc/mediasettings.loc
mediasettings/mediasettingsapp/rom/mediasettings.iby
mediasettings/mediasettingsapp/rom/mediasettingsresources.iby
mediasettings/mediasettingsapp/src/MPSettingsAdvancedBwContainer.cpp
mediasettings/mediasettingsapp/src/MPSettingsAdvancedBwSettingItem.cpp
mediasettings/mediasettingsapp/src/MPSettingsAdvancedBwSettingItemList.cpp
mediasettings/mediasettingsapp/src/MPSettingsAdvancedBwView.cpp
mediasettings/mediasettingsapp/src/MPSettingsApp.cpp
mediasettings/mediasettingsapp/src/MPSettingsAppUi.cpp
mediasettings/mediasettingsapp/src/MPSettingsDocument.cpp
mediasettings/mediasettingsapp/src/MPSettingsMainContainer.cpp
mediasettings/mediasettingsapp/src/MPSettingsMainView.cpp
mediasettings/mediasettingsapp/src/MPSettingsSliderSettingItem.cpp
mediasettings/mediasettingsapp/src/MPSettingsStreamingContainer.cpp
mediasettings/mediasettingsapp/src/MPSettingsStreamingSettingItemList.cpp
mediasettings/mediasettingsapp/src/MPSettingsStreamingView.cpp
mediasettings/mediasettingsapp/src/MPSettingsUDPPortSettingItem.cpp
mediasettings/mediasettingsapp/src/MPSettingsVideoContainer.cpp
mediasettings/mediasettingsapp/src/MPSettingsVideoSettingItemList.cpp
mediasettings/mediasettingsapp/src/MPSettingsVideoView.cpp
mediasettings/mediasettingsengine/conf/mediasettings.confml
mediasettings/mediasettingsengine/conf/mediasettings_101F880B.crml
mediasettings/mediasettingsengine/data/101F857B.rss
mediasettings/mediasettingsengine/data/MPSettingsROPModel.rss
mediasettings/mediasettingsengine/group/MPSettROPModel.mmp
mediasettings/mediasettingsengine/group/bld.inf
mediasettings/mediasettingsengine/inc/MPSettEngPluginImplementationUIDs.hrh
mediasettings/mediasettingsengine/inc/MPSettEngPluginInterfaceUIDs.hrh
mediasettings/mediasettingsengine/inc/MPSettingsModelForROP.h
mediasettings/mediasettingsengine/inc/MPSettingsROPModel.rh
mediasettings/mediasettingsengine/inc/MPSettingsROPSettings.hrh
mediasettings/mediasettingsengine/inc/MPSettingsRopConfigParser.h
mediasettings/mediasettingsengine/inc/MediaPlayerInternalCRKeys.h
mediasettings/mediasettingsengine/inc/MediaPlayerPrivateCRKeys.h
mediasettings/mediasettingsengine/inc/MediaPlayerVariant.hrh
mediasettings/mediasettingsengine/rom/mpsettropmodel.iby
mediasettings/mediasettingsengine/rom/mpsettropmodelrsc.iby
mediasettings/mediasettingsengine/src/MPSettingsModelForROP.cpp
mediasettings/mediasettingsengine/src/MPSettingsModelForRopImplementationProxy.cpp
mediasettings/mediasettingsengine/src/MPSettingsRopConfigParser.cpp
mediasettings/mediasettingsengine/tsrc/mediasettingsenginetest/Bwins/mpxmediasettingsenginetestu.def
mediasettings/mediasettingsengine/tsrc/mediasettingsenginetest/EABI/mpxmediasettingsenginetestu.def
mediasettings/mediasettingsengine/tsrc/mediasettingsenginetest/conf/atsconf.txt
mediasettings/mediasettingsengine/tsrc/mediasettingsenginetest/conf/mpxmediasettingsenginetest.cfg
mediasettings/mediasettingsengine/tsrc/mediasettingsenginetest/custom/postrun_custom.xml
mediasettings/mediasettingsengine/tsrc/mediasettingsenginetest/custom/prerun_custom.xml
mediasettings/mediasettingsengine/tsrc/mediasettingsenginetest/group/bld.inf
mediasettings/mediasettingsengine/tsrc/mediasettingsenginetest/group/mpxmediasettingsenginetest.mmp
mediasettings/mediasettingsengine/tsrc/mediasettingsenginetest/group/mpxmediasettingsenginetest.pkg
mediasettings/mediasettingsengine/tsrc/mediasettingsenginetest/inc/mpxmediasettingsenginetest.h
mediasettings/mediasettingsengine/tsrc/mediasettingsenginetest/init/TestFramework.ini
mediasettings/mediasettingsengine/tsrc/mediasettingsenginetest/src/mpxmediasettingsenginetest.cpp
mediasettings/mediasettingsengine/tsrc/mediasettingsenginetest/src/mpxmediasettingsenginetestBlocks.cpp
mediasettings/mpsettbase/bmarm/MPSETTBASEU.DEF
mediasettings/mpsettbase/bwins/MPSETTBASEU.DEF
mediasettings/mpsettbase/bwinscw/MPSETTBASEU.DEF
mediasettings/mpsettbase/eabi/MPSettBaseU.DEF
mediasettings/mpsettbase/group/bld.inf
mediasettings/mpsettbase/group/mpsettbase.mmp
mediasettings/mpsettbase/inc/MPSettPluginViewInterfaceUID.hrh
mediasettings/mpsettbase/inc/MPSettingsBaseContainer.h
mediasettings/mpsettbase/inc/MPSettingsBaseView.h
mediasettings/mpsettbase/inc/MPSettingsPluginView.h
mediasettings/mpsettbase/rom/mediasettingsbase.iby
mediasettings/mpsettbase/src/MPSettingsBaseContainer.cpp
mediasettings/mpsettbase/src/MPSettingsBaseView.cpp
mediasettings/mpsettbase/src/MPSettingsPluginView.cpp
mediasettings/videoplayersettingsengine/bwins/vcxnssettingsengineu.def
mediasettings/videoplayersettingsengine/eabi/vcxnssettingsengineu.def
mediasettings/videoplayersettingsengine/group/bld.inf
mediasettings/videoplayersettingsengine/group/videoplayersettingsengine.mmp
mediasettings/videoplayersettingsengine/inc/mvideosettingsdrivemonitorobserver.h
mediasettings/videoplayersettingsengine/inc/tvideosettingsdriveinfo.h
mediasettings/videoplayersettingsengine/inc/tvideosettingsdrivemonitorevent.h
mediasettings/videoplayersettingsengine/inc/videoplayercenrepkeys.h
mediasettings/videoplayersettingsengine/inc/videoplayersettingsengine.h
mediasettings/videoplayersettingsengine/inc/videoplayersettingsengine.pan
mediasettings/videoplayersettingsengine/inc/videosettingsdrivemonitor.h
mediasettings/videoplayersettingsengine/rom/videoplayersettingsengine.iby
mediasettings/videoplayersettingsengine/src/videoplayersettingsengine.cpp
mediasettings/videoplayersettingsengine/src/videosettingsdriveinfo.cpp
mediasettings/videoplayersettingsengine/src/videosettingsdrivemonitor.cpp
mediasettings/videoplayersettingsengine/src/videosettingsdrivemonitorevent.cpp
mediasettings/videoplayersettingsengine/tsrc/vpsettingsenginetest/Bwins/vcxnssettingsenginetestu.def
mediasettings/videoplayersettingsengine/tsrc/vpsettingsenginetest/EABI/vcxnssettingsenginetestu.def
mediasettings/videoplayersettingsengine/tsrc/vpsettingsenginetest/conf/atsconf.txt
mediasettings/videoplayersettingsengine/tsrc/vpsettingsenginetest/conf/vcxnssettingsenginetest.cfg
mediasettings/videoplayersettingsengine/tsrc/vpsettingsenginetest/custom/postrun_custom.xml
mediasettings/videoplayersettingsengine/tsrc/vpsettingsenginetest/custom/prerun_custom.xml
mediasettings/videoplayersettingsengine/tsrc/vpsettingsenginetest/group/bld.inf
mediasettings/videoplayersettingsengine/tsrc/vpsettingsenginetest/group/vcxnssettingsenginetest.mmp
mediasettings/videoplayersettingsengine/tsrc/vpsettingsenginetest/group/vcxnssettingsenginetest.pkg
mediasettings/videoplayersettingsengine/tsrc/vpsettingsenginetest/inc/vcxnssettingsenginetest.h
mediasettings/videoplayersettingsengine/tsrc/vpsettingsenginetest/init/TestFramework.ini
mediasettings/videoplayersettingsengine/tsrc/vpsettingsenginetest/src/vcxnssettingsenginetest.cpp
mediasettings/videoplayersettingsengine/tsrc/vpsettingsenginetest/src/vcxnssettingsenginetestBlocks.cpp
package_definition.xml
package_map.xml
sysdef_1_4_0.dtd
tsrc/VCXTestCommon/BWINS/VCXTestCommonu.def
tsrc/VCXTestCommon/EABI/VCXTestCommonu.def
tsrc/VCXTestCommon/conf/VCXTestCommon.cfg
tsrc/VCXTestCommon/group/VCXTestCommon.mmp
tsrc/VCXTestCommon/group/VCXTestCommon.pkg
tsrc/VCXTestCommon/group/bld.inf
tsrc/VCXTestCommon/inc/CIptvTestActiveWait.h
tsrc/VCXTestCommon/inc/CIptvTestEvent.h
tsrc/VCXTestCommon/inc/CIptvTestEventWaiter.h
tsrc/VCXTestCommon/inc/CIptvTestMobilecrashWatcher.h
tsrc/VCXTestCommon/inc/CIptvTestTimer.h
tsrc/VCXTestCommon/inc/CIptvTestVerifyData.h
tsrc/VCXTestCommon/inc/CIptvTestVideoCreator.h
tsrc/VCXTestCommon/inc/IptvTestDownloadManager.h
tsrc/VCXTestCommon/inc/IptvTestUtilALR.h
tsrc/VCXTestCommon/inc/MIptvTestEventWaiterObserver.h
tsrc/VCXTestCommon/inc/MIptvTestTimerObserver.h
tsrc/VCXTestCommon/inc/MTestUtilConnectionObserver.h
tsrc/VCXTestCommon/inc/MTestUtilDownloadObserver.h
tsrc/VCXTestCommon/inc/TestUtilConnection.h
tsrc/VCXTestCommon/inc/TestUtilConnectionWaiter.h
tsrc/VCXTestCommon/inc/VCXTestCommon.h
tsrc/VCXTestCommon/inc/VCXTestConstants.h
tsrc/VCXTestCommon/inc/VCXTestLog.h
tsrc/VCXTestCommon/inc/VCXTestMessageWait.h
tsrc/VCXTestCommon/inc/VCXTestPSObserver.h
tsrc/VCXTestCommon/inc/VCXTestPSSubscriber.h
tsrc/VCXTestCommon/inc/VCXTestStatsKeeper.h
tsrc/VCXTestCommon/inc/VCXTestTimerWait.h
tsrc/VCXTestCommon/init/TestFramework.ini
tsrc/VCXTestCommon/src/CIptvTestActiveWait.cpp
tsrc/VCXTestCommon/src/CIptvTestEvent.cpp
tsrc/VCXTestCommon/src/CIptvTestEventWaiter.cpp
tsrc/VCXTestCommon/src/CIptvTestMobilecrashWatcher.cpp
tsrc/VCXTestCommon/src/CIptvTestTimer.cpp
tsrc/VCXTestCommon/src/CIptvTestVerifyData.cpp
tsrc/VCXTestCommon/src/CIptvTestVideoCreator.cpp
tsrc/VCXTestCommon/src/IptvTestDownloadManager.cpp
tsrc/VCXTestCommon/src/IptvTestUtilALR.cpp
tsrc/VCXTestCommon/src/TestUtilConnection.cpp
tsrc/VCXTestCommon/src/TestUtilConnectionWaiter.cpp
tsrc/VCXTestCommon/src/VCXTestCommon.cpp
tsrc/VCXTestCommon/src/VCXTestMessageWait.cpp
tsrc/VCXTestCommon/src/VCXTestPSSubscriber.cpp
tsrc/VCXTestCommon/src/VCXTestStatsKeeper.cpp
tsrc/VCXTestCommon/src/VCXTestTimerWait.cpp
tsrc/VCXTestMyVideosCollectionClient/BWINS/VCXTestMyVideosCollectionClientu.def
tsrc/VCXTestMyVideosCollectionClient/EABI/VCXTestMyVideosCollectionClientu.def
tsrc/VCXTestMyVideosCollectionClient/conf/VCXTestMyVideosCollectionClient.cfg
tsrc/VCXTestMyVideosCollectionClient/group/VCXTestMyVideosCollectionClient.mmp
tsrc/VCXTestMyVideosCollectionClient/group/VCXTestMyVideosCollectionClient.pkg
tsrc/VCXTestMyVideosCollectionClient/group/bld.inf
tsrc/VCXTestMyVideosCollectionClient/inc/VCXTestMyVideosCollectionClient.h
tsrc/VCXTestMyVideosCollectionClient/inc/VCXTestMyVideosObserver.h
tsrc/VCXTestMyVideosCollectionClient/init/TestFramework.ini
tsrc/VCXTestMyVideosCollectionClient/src/VCXTestMyVideosCollectionClient.cpp
tsrc/VCXTestUtilModule/Bwins/VCXTestUtilModuleu.def
tsrc/VCXTestUtilModule/EABI/VCXTestUtilModuleu.def
tsrc/VCXTestUtilModule/conf/VCXTestUtilModule.cfg
tsrc/VCXTestUtilModule/group/VCXTestUtilModule.mmp
tsrc/VCXTestUtilModule/group/VCXTestUtilModule.pkg
tsrc/VCXTestUtilModule/group/bld.inf
tsrc/VCXTestUtilModule/inc/IptvTestUtilModule.h
tsrc/VCXTestUtilModule/init/TestFramework.ini
tsrc/VCXTestUtilModule/src/IptvTestUtilModule.cpp
tsrc/VCXTestUtilModule/src/IptvTestUtilModuleBlocks.cpp
tsrc/conf/ats_apitests.txt
tsrc/conf/ats_moduletests.txt
tsrc/group/bld.inf
tsrc/testing/inc/mpxlog.h
tsrc/testing/inc/mpxvideo_debug.h
tsrc/testing/ini/01-unit/TestFramework.ini
tsrc/testing/ini/02-settings/TestFramework.ini
tsrc/testing/ini/03-mv/TestFramework.ini
tsrc/testing/ini/04-connutil/TestFramework.ini
tsrc/testing/ini/05-startup/TestFramework.ini
tsrc/testing/ini/06-details/TestFramework.ini
tsrc/testing/sis/fusion_engine_tests.pkg
tsrc/testing/sis/fusion_unit_tests.pkg
tsrc/testing/sis/make_engine_test_sis.cmd
tsrc/testing/tools/backslashest2forward.pl
tsrc/testing/tools/builder.pl
tsrc/testing/tools/copylogheaders.cmd
tsrc/testing/tools/copylogsfromdirs.pl
tsrc/testing/tools/genATSdrop.pl
tsrc/testing/tools/genCfgs.pl
tsrc/testing/tools/genVideoFeed.pl
tsrc/testing/tools/genreruncfgs.pl
tsrc/testing/tools/notifydrop_local.cmd
tsrc/testing/tools/notifydrop_network.cmd
tsrc/testing/tools/rerunsubs.pl
tsrc/testing/tools/s60poliisi.pl
tsrc/testing/tools/selgesubdirs.pl
tsrc/testing/tools/setversion.pl
tsrc/testing/tools/siscreator.pl
tsrc/testing/tools/test_build.cmd
tsrc/testing/tools/test_clean.cmd
tsrc/testing/tools/testdoc.pl
tsrc/testing/tools/tsrpkgtool.pl
tsrc/testing/tools/updateHeliumCfgs.pl
tsrc/testing/tools/utils.pl
tsrc/testing/tools/wshTestRun_local.vbs
tsrc/testing/tools/wshTestRun_network.vbs
videocollection/group/bld.inf
videocollection/hgmyvideos/BWINS/vcxhgmyvideosu.def
videocollection/hgmyvideos/EABI/vcxhgmyvideosu.def
videocollection/hgmyvideos/conf/hgmyvideos.confml
videocollection/hgmyvideos/conf/hgmyvideos_20021191.crml
videocollection/hgmyvideos/data/vcxhgmyvideos.rss
videocollection/hgmyvideos/data/vcxhgmyvideosdrm.rss
videocollection/hgmyvideos/group/bld.inf
videocollection/hgmyvideos/group/vcxhgmyvideos.mmp
videocollection/hgmyvideos/inc/CIptvDriveMonitor.h
videocollection/hgmyvideos/inc/CIptvResourceLoader.h
videocollection/hgmyvideos/inc/MIptvDriveMonitorObserver.h
videocollection/hgmyvideos/inc/TIptvDriveInfo.h
videocollection/hgmyvideos/inc/TIptvDriveMonitorEvent.h
videocollection/hgmyvideos/inc/vcxhgmyvideos.hrh
videocollection/hgmyvideos/inc/vcxhgmyvideosaiwmenuhandler.h
videocollection/hgmyvideos/inc/vcxhgmyvideoscategorylistimpl.h
videocollection/hgmyvideos/inc/vcxhgmyvideoscategorymodelhandler.h
videocollection/hgmyvideos/inc/vcxhgmyvideoscategorymodelobserver.h
videocollection/hgmyvideos/inc/vcxhgmyvideoscenrepkeys.h
videocollection/hgmyvideos/inc/vcxhgmyvideoscollectionclient.h
videocollection/hgmyvideos/inc/vcxhgmyvideosdownloadclient.h
videocollection/hgmyvideos/inc/vcxhgmyvideosfulldrminfo.h
videocollection/hgmyvideos/inc/vcxhgmyvideosindicatorhelper.h
videocollection/hgmyvideos/inc/vcxhgmyvideoslistbase.h
videocollection/hgmyvideos/inc/vcxhgmyvideosmainview.h
videocollection/hgmyvideos/inc/vcxhgmyvideosmainviewcontainer.h
videocollection/hgmyvideos/inc/vcxhgmyvideosmemorystatus.h
videocollection/hgmyvideos/inc/vcxhgmyvideosmodel.h
videocollection/hgmyvideos/inc/vcxhgmyvideospanics.h
videocollection/hgmyvideos/inc/vcxhgmyvideosthumbnailmanager.h
videocollection/hgmyvideos/inc/vcxhgmyvideosupnpinterface.h
videocollection/hgmyvideos/inc/vcxhgmyvideosvideocopier.h
videocollection/hgmyvideos/inc/vcxhgmyvideosvideodata.h
videocollection/hgmyvideos/inc/vcxhgmyvideosvideodataupdater.h
videocollection/hgmyvideos/inc/vcxhgmyvideosvideodetailsdialog.h
videocollection/hgmyvideos/inc/vcxhgmyvideosvideolist.h
videocollection/hgmyvideos/inc/vcxhgmyvideosvideolistimpl.h
videocollection/hgmyvideos/inc/vcxhgmyvideosvideolistitem.h
videocollection/hgmyvideos/inc/vcxhgmyvideosvideomodelhandler.h
videocollection/hgmyvideos/inc/vcxhgmyvideosvideomodelobserver.h
videocollection/hgmyvideos/install/hgmyvideosview.pkg
videocollection/hgmyvideos/install/hgmyvideosview.sisx
videocollection/hgmyvideos/install/make_sisx.bat
videocollection/hgmyvideos/rom/hgmyvideos.iby
videocollection/hgmyvideos/rom/hgmyvideosrsc.iby
videocollection/hgmyvideos/src/CIptvDriveMonitor.cpp
videocollection/hgmyvideos/src/CIptvResourceLoader.cpp
videocollection/hgmyvideos/src/TIptvDriveInfo.cpp
videocollection/hgmyvideos/src/TIptvDriveMonitorEvent.cpp
videocollection/hgmyvideos/src/vcxhgmyvideosaiwmenuhandler.cpp
videocollection/hgmyvideos/src/vcxhgmyvideoscategorylistimpl.cpp
videocollection/hgmyvideos/src/vcxhgmyvideoscategorymodelhandler.cpp
videocollection/hgmyvideos/src/vcxhgmyvideoscollectionclient.cpp
videocollection/hgmyvideos/src/vcxhgmyvideosdownloadclient.cpp
videocollection/hgmyvideos/src/vcxhgmyvideosfulldrminfo.cpp
videocollection/hgmyvideos/src/vcxhgmyvideosindicatorhelper.cpp
videocollection/hgmyvideos/src/vcxhgmyvideoslistbase.cpp
videocollection/hgmyvideos/src/vcxhgmyvideosmainview.cpp
videocollection/hgmyvideos/src/vcxhgmyvideosmainviewcontainer.cpp
videocollection/hgmyvideos/src/vcxhgmyvideosmemorystatus.cpp
videocollection/hgmyvideos/src/vcxhgmyvideosmodel.cpp
videocollection/hgmyvideos/src/vcxhgmyvideosthumbnailmanager.cpp
videocollection/hgmyvideos/src/vcxhgmyvideosupnpinterface.cpp
videocollection/hgmyvideos/src/vcxhgmyvideosvideocopier.cpp
videocollection/hgmyvideos/src/vcxhgmyvideosvideodata.cpp
videocollection/hgmyvideos/src/vcxhgmyvideosvideodataupdater.cpp
videocollection/hgmyvideos/src/vcxhgmyvideosvideodetailsdialog.cpp
videocollection/hgmyvideos/src/vcxhgmyvideosvideolist.cpp
videocollection/hgmyvideos/src/vcxhgmyvideosvideolistimpl.cpp
videocollection/hgmyvideos/src/vcxhgmyvideosvideolistitem.cpp
videocollection/hgmyvideos/src/vcxhgmyvideosvideomodelhandler.cpp
videocollection/hgmyvideos/tsrc/ut_vcxhgmyvideosmainview/Bwins/VcxHgMyVideosMainViewTestU.DEF
videocollection/hgmyvideos/tsrc/ut_vcxhgmyvideosmainview/EABI/VcxHgMyVideosMainViewTestU.def
videocollection/hgmyvideos/tsrc/ut_vcxhgmyvideosmainview/conf/ui_VcxHgMyVideosMainViewTest.cfg
videocollection/hgmyvideos/tsrc/ut_vcxhgmyvideosmainview/group/ABLD.BAT
videocollection/hgmyvideos/tsrc/ut_vcxhgmyvideosmainview/group/VcxHgMyVideosMainViewTest.mmp
videocollection/hgmyvideos/tsrc/ut_vcxhgmyvideosmainview/group/VcxHgMyVideosMainViewTest.pkg
videocollection/hgmyvideos/tsrc/ut_vcxhgmyvideosmainview/group/bld.inf
videocollection/hgmyvideos/tsrc/ut_vcxhgmyvideosmainview/inc/VcxHgMyVideosMainViewTest.h
videocollection/hgmyvideos/tsrc/ut_vcxhgmyvideosmainview/init/testframework.ini
videocollection/hgmyvideos/tsrc/ut_vcxhgmyvideosmainview/sis/make_ut_vcxhgmyvideosmainview.bat
videocollection/hgmyvideos/tsrc/ut_vcxhgmyvideosmainview/sis/ut_vcxhgmyvideosmainview.pkg
videocollection/hgmyvideos/tsrc/ut_vcxhgmyvideosmainview/src/VcxHgMyVideosMainViewTest.cpp
videocollection/hgmyvideos/tsrc/ut_vcxhgmyvideosmainview/src/VcxHgMyVideosMainViewTestBlocks.cpp
videocollection/hgmyvideos/tsrc/ut_vcxhgmyvideosmainview/src/vcxhgmyvideoscategorylistimpl_stub.cpp
videocollection/hgmyvideos/tsrc/ut_vcxhgmyvideosmainview/src/vcxhgmyvideoslistbase_stub.cpp
videocollection/hgmyvideos/tsrc/ut_vcxhgmyvideosmainview/src/vcxhgmyvideosmainviewcontainer_stub.cpp
videocollection/hgmyvideos/tsrc/ut_vcxhgmyvideosmainview/src/vcxhgmyvideosmemorystatus_stub.cpp
videocollection/hgmyvideos/tsrc/ut_vcxhgmyvideosmainview/src/vcxhgmyvideosmodel_stub.cpp
videocollection/hgmyvideos/tsrc/ut_vcxhgmyvideosmainview/src/vcxhgmyvideosupnpinterface_stub.cpp
videocollection/hgmyvideos/tsrc/ut_vcxhgmyvideosmainview/src/vcxhgmyvideosvideodetailsdialog_stub.cpp
videocollection/hgmyvideos/tsrc/ut_vcxhgmyvideosmainview/src/vcxhgmyvideosvideolistimpl_stub.cpp
videocollection/hgmyvideos/tsrc/ut_vcxhgmyvideosmainview/src/vcxhgmyvideosvideomodelhandler_stub.cpp
videocollection/hgmyvideosplugin/group/bld.inf
videocollection/hgmyvideosplugin/group/vcxhgmyvideosplugin.mmp
videocollection/hgmyvideosplugin/inc/vcxhgmyvideosplugin.h
videocollection/hgmyvideosplugin/inc/vcxhgmyvideosplugin.hrh
videocollection/hgmyvideosplugin/rom/hgmyvideosplugin.iby
videocollection/hgmyvideosplugin/rss/vcxhgmyvideosplugin.rss
videocollection/hgmyvideosplugin/src/vcxhgmyvideosplugin.cpp
videocollection/hgmyvideosplugin/src/vcxhgmyvideospluginproxy.cpp
videocollection/mpxmyvideoscollection/conf/videoscollection.confml
videocollection/mpxmyvideoscollection/conf/videoscollection_2001B2A9.crml
videocollection/mpxmyvideoscollection/data/vcxmyvideoscollectionplugin.RSS
videocollection/mpxmyvideoscollection/group/bld.inf
videocollection/mpxmyvideoscollection/group/vcxmyvideoscollectionplugin.mmp
videocollection/mpxmyvideoscollection/inc/vcxmyvideosactivetask.h
videocollection/mpxmyvideoscollection/inc/vcxmyvideosalbum.h
videocollection/mpxmyvideoscollection/inc/vcxmyvideosalbums.h
videocollection/mpxmyvideoscollection/inc/vcxmyvideosasyncfilecopy.h
videocollection/mpxmyvideoscollection/inc/vcxmyvideosasyncfileoperations.h
videocollection/mpxmyvideoscollection/inc/vcxmyvideoscategories.h
videocollection/mpxmyvideoscollection/inc/vcxmyvideoscollection.hrh
videocollection/mpxmyvideoscollection/inc/vcxmyvideoscollectionplugin.h
videocollection/mpxmyvideoscollection/inc/vcxmyvideoscollectionutil.h
videocollection/mpxmyvideoscollection/inc/vcxmyvideosdriveinfo.h
videocollection/mpxmyvideoscollection/inc/vcxmyvideosdrivemonitor.h
videocollection/mpxmyvideoscollection/inc/vcxmyvideosdrivemonitorevent.h
videocollection/mpxmyvideoscollection/inc/vcxmyvideosmdsalbums.h
videocollection/mpxmyvideoscollection/inc/vcxmyvideosmdscmdqueue.h
videocollection/mpxmyvideoscollection/inc/vcxmyvideosmdsdb.h
videocollection/mpxmyvideoscollection/inc/vcxmyvideosmessagelist.h
videocollection/mpxmyvideoscollection/inc/vcxmyvideosopenhandler.h
videocollection/mpxmyvideoscollection/inc/vcxmyvideosvideocache.h
videocollection/mpxmyvideoscollection/rom/mpxmyvideoscollection.iby
videocollection/mpxmyvideoscollection/src/vcxmyvideosactivetask.cpp
videocollection/mpxmyvideoscollection/src/vcxmyvideosalbum.cpp
videocollection/mpxmyvideoscollection/src/vcxmyvideosalbums.cpp
videocollection/mpxmyvideoscollection/src/vcxmyvideosasyncfilecopy.cpp
videocollection/mpxmyvideoscollection/src/vcxmyvideosasyncfileoperations.cpp
videocollection/mpxmyvideoscollection/src/vcxmyvideoscategories.cpp
videocollection/mpxmyvideoscollection/src/vcxmyvideoscollectionplugin.cpp
videocollection/mpxmyvideoscollection/src/vcxmyvideoscollectionpluginproxy.cpp
videocollection/mpxmyvideoscollection/src/vcxmyvideoscollectionutil.cpp
videocollection/mpxmyvideoscollection/src/vcxmyvideosdriveinfo.cpp
videocollection/mpxmyvideoscollection/src/vcxmyvideosdrivemonitor.cpp
videocollection/mpxmyvideoscollection/src/vcxmyvideosdrivemonitorevent.cpp
videocollection/mpxmyvideoscollection/src/vcxmyvideosmdsalbums.cpp
videocollection/mpxmyvideoscollection/src/vcxmyvideosmdscmdqueue.cpp
videocollection/mpxmyvideoscollection/src/vcxmyvideosmdsdb.cpp
videocollection/mpxmyvideoscollection/src/vcxmyvideosmessagelist.cpp
videocollection/mpxmyvideoscollection/src/vcxmyvideosopenhandler.cpp
videocollection/mpxmyvideoscollection/src/vcxmyvideosvideocache.cpp
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/Bwins/VCXMyVideosCollectionPluginTestu.def
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/EABI/VCXMyVideosCollectionPluginTestu.def
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXConsts.inc
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXDrives.inc
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXErrors.inc
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXMyVideosCollectionPluginTestAttributes.cfg
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXMyVideosCollectionPluginTestBigFiles.cfg
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXMyVideosCollectionPluginTestDelete.cfg
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXMyVideosCollectionPluginTestDownload.cfg
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXMyVideosCollectionPluginTestDownload2.cfg
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXMyVideosCollectionPluginTestFullMemory.cfg
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXMyVideosCollectionPluginTestHelium.cfg
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXMyVideosCollectionPluginTestLists.cfg
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXMyVideosCollectionPluginTestMediator.cfg
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXMyVideosCollectionPluginTestMoveCopy.cfg
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXMyVideosCollectionPluginTestMultiDrives.cfg
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXMyVideosCollectionPluginTestMultipleDls.cfg
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXMyVideosCollectionPluginTestRobustness.cfg
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXMyVideosCollectionPluginTestSideload.cfg
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXMyVideosCollectionPluginTestSorting.cfg
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/atsconf.txt
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/vcxmvcollectionplugintest.inc
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/custom/postrun_custom.xml
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/custom/prerun_custom.xml
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/data/cccccc00.cre
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/data/mmc/video_3gp.3gp
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/data/mmc/video_3gp2.3g2
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/data/mmc/video_applempeg.mp4
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/data/mmc/video_avi.avi
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/data/mmc/video_aviac3.avi
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/data/mmc/video_mp2.mp2
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/data/mmc/video_mp3.mp3
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/data/mmc/video_mpeg1.mpg
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/data/mmc/video_mpeg2.mpg
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/data/mmc/video_mpeg4.mp4
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/data/mmc/video_mpegavc.mp4
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/data/mmc/video_quicktime.mov
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/data/mmc/video_realvideo.rm
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/data/mmc/video_supervideocd.mpg
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/data/mmc/video_wmv.dat
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/group/VCXMyVideosCollectionPluginTest.mmp
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/group/VCXMyVideosCollectionPluginTest.pkg
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/group/VCXMyVideosCollectionPluginTest_udeb.pkg
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/group/bld.inf
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/inc/MVCXMyVideosCollectionPluginTesterObserver.h
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/inc/VCXMyVideosCollectionPluginTest.h
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/inc/VCXMyVideosCollectionPluginTester.h
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/inc/VCXMyVideosTestCommon.h
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/inc/VCXMyVideosTestDlWatcher.h
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/inc/VCXMyVideosTestServiceEmu.h
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/inc/VCXMyVideosTestTransactions.h
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/inc/VCXTestMdsDbModifier.h
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/init/All/TestFramework.ini
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/init/TestFramework.ini
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/mediatorevents/Bwins/MediatorEventVerifierU.DEF
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/mediatorevents/EABI/MediatorEventVerifierU.def
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/mediatorevents/group/MediatorEventVerifier.mmp
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/mediatorevents/group/bld.inf
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/mediatorevents/inc/MediatorEventVerifier.h
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/mediatorevents/inc/VCXMediatorEventWatcher.h
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/mediatorevents/src/MediatorEventVerifier.cpp
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/mediatorevents/src/MediatorEventVerifierBlocks.cpp
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/mediatorevents/src/VCXMediatorEventWatcher.cpp
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/src/VCXMyVideosCollectionPluginTest.cpp
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/src/VCXMyVideosCollectionPluginTestBlocks.cpp
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/src/VCXMyVideosCollectionPluginTester.cpp
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/src/VCXMyVideosTestDlWatcher.cpp
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/src/VCXMyVideosTestServiceEmu.cpp
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/src/VCXMyVideosTestTransactions.cpp
videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/src/VCXTestMdsDbModifier.cpp
videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/bwins/ut_collectionplugintestu.def
videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/conf/ut_collectionplugintest.cfg
videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/eabi/ut_collectionplugintestu.def
videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/group/bld.inf
videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/group/ut_collectionplugintest.mmp
videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/group/ut_collectionplugintest.pkg
videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/mpxlog.h
videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/ut_collectionplugintest.h
videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/vcxmyvideosactivetask.h
videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/vcxmyvideosalbum.h
videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/vcxmyvideosalbums.h
videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/vcxmyvideosasyncfileoperations_stub.h
videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/vcxmyvideoscategories_stub.h
videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/vcxmyvideoscollectionutil.h
videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/vcxmyvideosmdsalbums.h
videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/vcxmyvideosmdsdb_stub.h
videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/vcxmyvideosmessagelist_stub.h
videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/vcxmyvideosopenhandler_stub.h
videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/vcxmyvideosvideocache_stub.h
videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/init/testframework.ini
videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/ut_collectionplugintest.cpp
videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/ut_collectionplugintestBlocks.cpp
videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/vcxmyvideosactivetask_stub.cpp
videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/vcxmyvideosalbum_stub.cpp
videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/vcxmyvideosalbums_stub.cpp
videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/vcxmyvideosasyncfileoperations_stub.cpp
videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/vcxmyvideoscategories_stub.cpp
videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/vcxmyvideoscollectionutil_stub.cpp
videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/vcxmyvideosmdsalbums_stub.cpp
videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/vcxmyvideosmdsdb_stub.cpp
videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/vcxmyvideosmessagelist_stub.cpp
videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/vcxmyvideosopenhandler_stub.cpp
videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/vcxmyvideosvideocache_stub.cpp
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideoscollectionutiltest/Bmarm/VcxMyVideosCollectionUtilTestU.DEF
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideoscollectionutiltest/Bwins/VcxMyVideosCollectionUtilTestU.DEF
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideoscollectionutiltest/conf/VcxMyVideosCollectionUtilTest.cfg
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideoscollectionutiltest/data/mmc/file.txt
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideoscollectionutiltest/eabi/VcxMyVideosCollectionUtilTestu.def
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideoscollectionutiltest/group/VcxMyVideosCollectionUtilTest.mmp
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideoscollectionutiltest/group/VcxMyVideosCollectionUtilTest.pkg
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideoscollectionutiltest/group/VcxMyVideosCollectionUtilTest_DoxyFile.txt
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideoscollectionutiltest/group/bld.inf
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideoscollectionutiltest/group/make_vcxmyvideoscollectionutiltest_sisx.bat
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideoscollectionutiltest/inc/VcxMyVideosCollectionUtilTest.h
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideoscollectionutiltest/init/testframework.ini
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideoscollectionutiltest/src/VcxMyVideosCollectionUtilTest.cpp
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideoscollectionutiltest/src/VcxMyVideosCollectionUtilTestBlocks.cpp
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/Bwins/VcxMyVideosMdsDbTestU.DEF
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/conf/VcxMyVideosMdsDbTest.cfg
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/eabi/VcxMyVideosMdsDbTestu.def
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/group/VcxMyVideosMdsDbTest.mmp
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/group/VcxMyVideosMdsDbTest.pkg
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/group/bld.inf
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/inc/VcxMyVideosMdsDbTest.h
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/inc/mdeinstanceitem.h
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/inc/mdeitem.h
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/inc/mdenamespacedef.h
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/inc/mdeobject.h
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/inc/mdeobjectdef.h
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/inc/mdeobjectquery.h
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/inc/mdeorderrule.h
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/inc/mdeproperty.h
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/inc/mdepropertydef.h
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/inc/mdequery.h
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/inc/mdesession.h
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/inc/mdesessionimpl.h
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/inc/mpxmedia.h
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/inc/myvideostesttrap.h
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/inc/vcxmyvideosalbum.h
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/inc/vcxmyvideoscollectionutil.h
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/inc/vcxmyvideosmdsalbums.h
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/inc/vcxmyvideosmdscmdqueue.h
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/init/testframework.ini
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/src/VcxMyVideosMdsDbTest.cpp
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/src/VcxMyVideosMdsDbTestBlocks.cpp
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/src/mdeinstanceitem.cpp
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/src/mdeitem.cpp
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/src/mdenamespacedef.cpp
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/src/mdeobject.cpp
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/src/mdeobjectdef.cpp
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/src/mdeobjectquery.cpp
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/src/mdeorderrule.cpp
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/src/mdeproperty.cpp
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/src/mdepropertydef.cpp
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/src/mdequery.cpp
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/src/mdesession.cpp
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/src/mdesessionimpl.cpp
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/src/vcxmyvideoscollectionutil.cpp
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/src/vcxmyvideosmdsalbums.cpp
videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/src/vcxmyvideosmdscmdqueue.cpp
videocollection/myvideosindicatorplugin/data/myvideosindicatorplugin.rss
videocollection/myvideosindicatorplugin/group/bld.inf
videocollection/myvideosindicatorplugin/group/myvideosindicatorplugin.mmp
videocollection/myvideosindicatorplugin/inc/myvideosindicatorplugin.h
videocollection/myvideosindicatorplugin/inc/myvideosindicatorplugin.hrh
videocollection/myvideosindicatorplugin/rom/myvideosindicatorplugin.iby
videocollection/myvideosindicatorplugin/src/myvideosindicatorplugin.cpp
videocollection/myvideosindicatorplugin/src/myvideosindicatorpluginproxy.cpp
videofeeds/group/bld.inf
videofeeds/vccommon/conf/System_Definition.xml
videofeeds/vccommon/conf/copy_loc_files.cmd
videofeeds/vccommon/conf/system_definition_full.xml
videofeeds/vccommon/conf/videocenter.confml
videofeeds/vccommon/conf/videocenter_102750E2.crml
videofeeds/vccommon/conf/videocenteralr.confml
videofeeds/vccommon/conf/videocenteralr_2000B438.crml
videofeeds/vccommon/data/backup_registration_eng.xml
videofeeds/vccommon/data/backup_registration_scheduler.xml
videofeeds/vccommon/data/cenrep/backup_registration_eng.xml
videofeeds/vccommon/data/cenrep/keys_videocenter.xls
videofeeds/vccommon/data/cenrep/keys_videocenter4.xls
videofeeds/vccommon/data/iptvvodui.ini
videofeeds/vccommon/data/livetv_provisioningfile.vcfg
videofeeds/vccommon/data/services_rom.xml
videofeeds/vccommon/data/services_rom_dvbh.xml
videofeeds/vccommon/data/services_sis.xml
videofeeds/vccommon/data/services_sis_dvbh.xml
videofeeds/vccommon/group/bld.inf
videofeeds/vccommon/help/data/xhtml.zip
videofeeds/vccommon/help/group/bld.inf
videofeeds/vccommon/help/inc/iptv.hlp.hrh
videofeeds/vccommon/help/rom/videocenterhelps_variant.iby
videofeeds/vccommon/icons/break_logo.mif
videofeeds/vccommon/icons/google_logo.mif
videofeeds/vccommon/icons/logo_karpat.mif
videofeeds/vccommon/icons/logo_media_charger.mif
videofeeds/vccommon/icons/logo_mobiletv.mif
videofeeds/vccommon/icons/logo_nokrock_1.mif
videofeeds/vccommon/icons/logo_nseries.jpg
videofeeds/vccommon/icons/logo_nseries_studio.mif
videofeeds/vccommon/icons/logo_nseries_studio_1.mif
videofeeds/vccommon/icons/logo_promo_videos.mif
videofeeds/vccommon/icons/logo_promo_videos_1.mif
videofeeds/vccommon/icons/logo_summer_party_2006_1.mif
videofeeds/vccommon/icons/logo_yle_24.mif
videofeeds/vccommon/icons/oululogo.mif
videofeeds/vccommon/icons/oululogo_1.mif
videofeeds/vccommon/icons/qgn_iptv_video_store_list.jpg
videofeeds/vccommon/icons/qgn_prop_iptv_add_services.mif
videofeeds/vccommon/icons/reuters_logo.mif
videofeeds/vccommon/icons/rocketboom_logo.mif
videofeeds/vccommon/icons/siemens.gif
videofeeds/vccommon/icons/thomson_logo.mif
videofeeds/vccommon/icons/videocenter_prog_clip.jpg
videofeeds/vccommon/loc/ipvideo.loc
videofeeds/vccommon/loc/locfiles.zip
videofeeds/vccommon/rom/IpVideoCustom.iby
videofeeds/vccommon/sis/Videocenter_Rel6.pkg
videofeeds/vccommon/sis/Videocenter_Rel6_for_5_1.pkg
videofeeds/vccommon/sis/bld.inf
videofeeds/vccommon/sis/cenrep.pkg
videofeeds/vccommon/sis/cenrep_alr.pkg
videofeeds/vccommon/sis/cenrep_rel6.pkg
videofeeds/vccommon/sis/cenrep_rel6_for_5_1.pkg
videofeeds/vccommon/sis/dll_versio_nro.pl
videofeeds/vccommon/sis/make_Rel6_sisx.bat
videofeeds/vccommon/sis/make_Rel6_sisx_for_5_1.bat
videofeeds/vccommon/sis/make_nfp1_sisx.bat
videofeeds/vccommon/sis/sis.mk
videoplayback/group/bld.inf
videoplayback/inc/mpxcommonvideoplaybackview.hrh
videoplayback/inc/mpxhelixplaybackplugindefs.h
videoplayback/inc/mpxvideobaseplaybackview.h
videoplayback/inc/mpxvideopdlplaybackview.h
videoplayback/inc/mpxvideoplaybackcontainer.h
videoplayback/inc/mpxvideoplaybackcontrol.h
videoplayback/inc/mpxvideoplaybackcontrol.hrh
videoplayback/inc/mpxvideoplaybackcontrolscontroller.h
videoplayback/inc/mpxvideoplaybackdisplayhandler.h
videoplayback/inc/mpxvideoplaybackmediadetailsviewer.h
videoplayback/inc/mpxvideoplaybackuids.hrh
videoplayback/inc/mpxvideoplaybackuserinputhandler.h
videoplayback/inc/mpxvideoplaybackview.h
videoplayback/inc/mpxvideoplaybackviewfiledetails.h
videoplayback/inc/mpxvideoregion.h
videoplayback/inc/mpxvideoregion.inl
videoplayback/videohelix/conf/mpxvideopbplugins.confml
videoplayback/videohelix/conf/mpxvideopbplugins_101f880a.crml
videoplayback/videohelix/data/10282550.rss
videoplayback/videohelix/group/bld.inf
videoplayback/videohelix/group/mpxvideohelixplayback.mmp
videoplayback/videohelix/inc/mpxcalldetector.h
videoplayback/videohelix/inc/mpxvideoaccessoryobserver.h
videoplayback/videohelix/inc/mpxvideoconnectionutility.h
videoplayback/videohelix/inc/mpxvideodlmgrif.h
videoplayback/videohelix/inc/mpxvideodrmhelper.h
videoplayback/videohelix/inc/mpxvideofiledetails.h
videoplayback/videohelix/inc/mpxvideohelixplayback.h
videoplayback/videohelix/inc/mpxvideoplaybackcontroller.h
videoplayback/videohelix/inc/mpxvideoplaybackmode.h
videoplayback/videohelix/inc/mpxvideoplaybackstate.h
videoplayback/videohelix/inc/mpxvideoplayerutility.h
videoplayback/videohelix/inc/mpxvideoposterframesetter.h
videoplayback/videohelix/inc/mpxvideoprivatecrkeys.h
videoplayback/videohelix/inc/mpxvideoseeker.h
videoplayback/videohelix/rom/mpxvideohelixplugin.iby
videoplayback/videohelix/src/mpxcalldetector.cpp
videoplayback/videohelix/src/mpxvideoaccessoryobserver.cpp
videoplayback/videohelix/src/mpxvideoconnectionutility.cpp
videoplayback/videohelix/src/mpxvideodlmgrif.cpp
videoplayback/videohelix/src/mpxvideodrmhelper.cpp
videoplayback/videohelix/src/mpxvideofiledetails.cpp
videoplayback/videohelix/src/mpxvideohelixplayback.cpp
videoplayback/videohelix/src/mpxvideohelixplaybackproxy.cpp
videoplayback/videohelix/src/mpxvideoplaybackcontroller.cpp
videoplayback/videohelix/src/mpxvideoplaybackmode.cpp
videoplayback/videohelix/src/mpxvideoplaybackstate.cpp
videoplayback/videohelix/src/mpxvideoplayerutility.cpp
videoplayback/videohelix/src/mpxvideoposterframesetter.cpp
videoplayback/videohelix/src/mpxvideoseeker.cpp
videoplayback/videohelix/tsrc/ut_videohelixtest/bwins/videohelixtestu.def
videoplayback/videohelix/tsrc/ut_videohelixtest/conf/videohelixtest.cfg
videoplayback/videohelix/tsrc/ut_videohelixtest/data/mmc/dcf.odf
videoplayback/videohelix/tsrc/ut_videohelixtest/data/mmc/sdp_test.sdp
videoplayback/videohelix/tsrc/ut_videohelixtest/data/mmc/vhpp_test.3gp
videoplayback/videohelix/tsrc/ut_videohelixtest/eabi/videohelixtestu.def
videoplayback/videohelix/tsrc/ut_videohelixtest/group/bld.inf
videoplayback/videohelix/tsrc/ut_videohelixtest/group/videohelixtest.mmp
videoplayback/videohelix/tsrc/ut_videohelixtest/group/videohelixtest.pkg
videoplayback/videohelix/tsrc/ut_videohelixtest/inc/dlmgr_stub.h
videoplayback/videohelix/tsrc/ut_videohelixtest/inc/mpxvideoaccessoryobserver_stub.h
videoplayback/videohelix/tsrc/ut_videohelixtest/inc/mpxvideoplayerutility_stub.h
videoplayback/videohelix/tsrc/ut_videohelixtest/inc/mpxvideoregion.h
videoplayback/videohelix/tsrc/ut_videohelixtest/inc/stifutilities.h
videoplayback/videohelix/tsrc/ut_videohelixtest/inc/timeoutcontroller.h
videoplayback/videohelix/tsrc/ut_videohelixtest/inc/tnmgr_stub.h
videoplayback/videohelix/tsrc/ut_videohelixtest/inc/videohelixtest.h
videoplayback/videohelix/tsrc/ut_videohelixtest/init/testframework.ini
videoplayback/videohelix/tsrc/ut_videohelixtest/src/dlmgr_stub.cpp
videoplayback/videohelix/tsrc/ut_videohelixtest/src/mediarecognizer_stub.cpp
videoplayback/videohelix/tsrc/ut_videohelixtest/src/mpxvideoaccessoryobserver_stub.cpp
videoplayback/videohelix/tsrc/ut_videohelixtest/src/mpxvideodrmhelper_stub.cpp
videoplayback/videohelix/tsrc/ut_videohelixtest/src/mpxvideoplayerutility_stub.cpp
videoplayback/videohelix/tsrc/ut_videohelixtest/src/mpxvideoregion.cpp
videoplayback/videohelix/tsrc/ut_videohelixtest/src/rconnection_stub.cpp
videoplayback/videohelix/tsrc/ut_videohelixtest/src/stifutilities.cpp
videoplayback/videohelix/tsrc/ut_videohelixtest/src/timeoutcontroller.cpp
videoplayback/videohelix/tsrc/ut_videohelixtest/src/tnmgr_stub.cpp
videoplayback/videohelix/tsrc/ut_videohelixtest/src/videohelixtest.cpp
videoplayback/videohelix/tsrc/ut_videohelixtest/src/videohelixtestbody.cpp
videoplayback/videopdlplaybackviewplugin/data/2001e5a7.rss
videoplayback/videopdlplaybackviewplugin/group/bld.inf
videoplayback/videopdlplaybackviewplugin/group/mpxvideopdlplaybackviewplugin.mmp
videoplayback/videopdlplaybackviewplugin/inc/mpxvideopdlplaybackviewplugin.h
videoplayback/videopdlplaybackviewplugin/rom/mpxvideopdlplaybackviewplugin.iby
videoplayback/videopdlplaybackviewplugin/src/mpxvideopdlplaybackviewplugin.cpp
videoplayback/videopdlplaybackviewplugin/src/mpxvideopdlplaybackviewpluginproxy.cpp
videoplayback/videoplaybackcontrols/bwins/mpxvideoplaybackcontrolsu.def
videoplayback/videoplaybackcontrols/data/mpxvideoplaybackcontrols.rss
videoplayback/videoplaybackcontrols/eabi/mpxvideoplaybackcontrolsu.def
videoplayback/videoplaybackcontrols/group/bld.inf
videoplayback/videoplaybackcontrols/group/iconlist.txt
videoplayback/videoplaybackcontrols/group/icons/qgn_graf_realplayer_splash_01.svg
videoplayback/videoplaybackcontrols/group/icons/qgn_graf_realplayer_splash_02.svg
videoplayback/videoplaybackcontrols/group/icons/qgn_graf_realplayer_splash_03.svg
videoplayback/videoplaybackcontrols/group/icons/qgn_graf_realplayer_splash_04.svg
videoplayback/videoplaybackcontrols/group/icons/qgn_graf_realplayer_splash_05.svg
videoplayback/videoplaybackcontrols/group/icons/qgn_graf_realplayer_splash_06.svg
videoplayback/videoplaybackcontrols/group/icons/qgn_graf_realplayer_splash_07.svg
videoplayback/videoplaybackcontrols/group/icons/qgn_graf_realplayer_splash_08.svg
videoplayback/videoplaybackcontrols/group/icons/qgn_graf_realplayer_splash_09.svg
videoplayback/videoplaybackcontrols/group/icons/qgn_graf_realplayer_splash_10.svg
videoplayback/videoplaybackcontrols/group/icons/qgn_graf_realplayer_splash_11.svg
videoplayback/videoplaybackcontrols/group/icons/qgn_graf_realplayer_splash_12.svg
videoplayback/videoplaybackcontrols/group/icons/qgn_graf_realplayer_splash_13.svg
videoplayback/videoplaybackcontrols/group/icons/qgn_graf_realplayer_splash_14.svg
videoplayback/videoplaybackcontrols/group/icons/qgn_graf_realplayer_splash_15.svg
videoplayback/videoplaybackcontrols/group/icons/qgn_graf_realplayer_splash_16.svg
videoplayback/videoplaybackcontrols/group/icons/qgn_graf_realplayer_splash_17.svg
videoplayback/videoplaybackcontrols/group/icons/qgn_indi_mp_ratio_orig.svg
videoplayback/videoplaybackcontrols/group/icons/qgn_indi_mp_ratio_stretch.svg
videoplayback/videoplaybackcontrols/group/icons/qgn_indi_mp_ratio_zoom.svg
videoplayback/videoplaybackcontrols/group/mpxvideoplaybackcontrols.mmp
videoplayback/videoplaybackcontrols/inc/mpxvideoplaybackaspectratioicon.h
videoplayback/videoplaybackcontrols/inc/mpxvideoplaybackbrandinganimation.h
videoplayback/videoplaybackcontrols/inc/mpxvideoplaybackbutton.h
videoplayback/videoplaybackcontrols/inc/mpxvideoplaybackbuttonbar.h
videoplayback/videoplaybackcontrols/inc/mpxvideoplaybackcontrolconfiguration.h
videoplayback/videoplaybackcontrols/inc/mpxvideoplaybackcontrolpdl.h
videoplayback/videoplaybackcontrols/inc/mpxvideoplaybackcontrolpolicy.h
videoplayback/videoplaybackcontrols/inc/mpxvideoplaybackprogressbar.h
videoplayback/videoplaybackcontrols/inc/mpxvideoplaybackvolumebar.h
videoplayback/videoplaybackcontrols/loc/mpxvideoplaybackcontrols.loc
videoplayback/videoplaybackcontrols/rom/mpxvideoplaybackcontrols.iby
videoplayback/videoplaybackcontrols/rom/mpxvideoplaybackcontrolsrsc.iby
videoplayback/videoplaybackcontrols/src/mpxvideoplaybackaspectratioicon.cpp
videoplayback/videoplaybackcontrols/src/mpxvideoplaybackbrandinganimation.cpp
videoplayback/videoplaybackcontrols/src/mpxvideoplaybackbutton.cpp
videoplayback/videoplaybackcontrols/src/mpxvideoplaybackbuttonbar.cpp
videoplayback/videoplaybackcontrols/src/mpxvideoplaybackcontrol.cpp
videoplayback/videoplaybackcontrols/src/mpxvideoplaybackcontrolconfiguration.cpp
videoplayback/videoplaybackcontrols/src/mpxvideoplaybackcontrolpdl.cpp
videoplayback/videoplaybackcontrols/src/mpxvideoplaybackcontrolpolicy.cpp
videoplayback/videoplaybackcontrols/src/mpxvideoplaybackcontrolscontroller.cpp
videoplayback/videoplaybackcontrols/src/mpxvideoplaybackmediadetailsviewer.cpp
videoplayback/videoplaybackcontrols/src/mpxvideoplaybackprogressbar.cpp
videoplayback/videoplaybackcontrols/src/mpxvideoplaybackvolumebar.cpp
videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/bwins/ui_videoplaybackcontrolstestu.def
videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/conf/ui_videoplaybackcontrolstest.cfg
videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/data/mmc/TestClipWithLongNameToTestScrollingInMediaDetailsViewer.3gp
videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/data/mmc/test.3gp
videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/data/mmc/test.rm
videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/eabi/ui_videoplaybackcontrolstestu.def
videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/group/bld.inf
videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/group/videoplaybackcontrolstest.mmp
videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/group/videoplaybackcontrolstest.pkg
videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/inc/mpxvpbc_stub.h
videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/inc/mpxvpbuih_stub.h
videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/inc/videoplaybackcontrolstest.h
videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/init/testframework.ini
videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/src/mpxvpbc_stub.cpp
videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/src/mpxvpbuih_stub.cpp
videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/src/mpxvpbvfd_stub.cpp
videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/src/videoplaybackcontrolstest.cpp
videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/src/videoplaybackcontrolstestblocks.cpp
videoplayback/videoplaybackviewplugin/data/200159ac.rss
videoplayback/videoplaybackviewplugin/group/bld.inf
videoplayback/videoplaybackviewplugin/group/mpxvideoplaybackviewplugin.mmp
videoplayback/videoplaybackviewplugin/inc/mpxvideoplaybackviewplugin.h
videoplayback/videoplaybackviewplugin/rom/mpxvideoplaybackviewplugin.iby
videoplayback/videoplaybackviewplugin/src/mpxvideoplaybackviewplugin.cpp
videoplayback/videoplaybackviewplugin/src/mpxvideoplaybackviewpluginproxy.cpp
videoplayback/videoplaybackviews/bwins/mpxvideoplaybackviewsu.def
videoplayback/videoplaybackviews/data/mpxvideoplaybackviews.rss
videoplayback/videoplaybackviews/eabi/mpxvideoplaybackviewsu.def
videoplayback/videoplaybackviews/group/bld.inf
videoplayback/videoplaybackviews/group/mpxvideoplaybackviews.mmp
videoplayback/videoplaybackviews/loc/mpxvideoplaybackviews.loc
videoplayback/videoplaybackviews/rom/mpxvideoplaybackviews.iby
videoplayback/videoplaybackviews/rom/mpxvideoplaybackviewsrsc.iby
videoplayback/videoplaybackviews/src/mpxvideobaseplaybackview.cpp
videoplayback/videoplaybackviews/src/mpxvideopdlplaybackview.cpp
videoplayback/videoplaybackviews/src/mpxvideoplaybackcontainer.cpp
videoplayback/videoplaybackviews/src/mpxvideoplaybackdisplayhandler.cpp
videoplayback/videoplaybackviews/src/mpxvideoplaybackuserinputhandler.cpp
videoplayback/videoplaybackviews/src/mpxvideoplaybackview.cpp
videoplayback/videoplaybackviews/src/mpxvideoplaybackviewfiledetails.cpp
videoplayback/videoplaybackviews/tsrc/ut_userinputhandlertest/bwins/ui_userinputhandlertestu.def
videoplayback/videoplaybackviews/tsrc/ut_userinputhandlertest/conf/ui_userinputhandlertest.cfg
videoplayback/videoplaybackviews/tsrc/ut_userinputhandlertest/eabi/ui_userinputhandlertestu.def
videoplayback/videoplaybackviews/tsrc/ut_userinputhandlertest/group/bld.inf
videoplayback/videoplaybackviews/tsrc/ut_userinputhandlertest/group/userinputhandlertest.mmp
videoplayback/videoplaybackviews/tsrc/ut_userinputhandlertest/group/userinputhandlertest.pkg
videoplayback/videoplaybackviews/tsrc/ut_userinputhandlertest/inc/hal_stub.h
videoplayback/videoplaybackviews/tsrc/ut_userinputhandlertest/inc/userinputhandlertest.h
videoplayback/videoplaybackviews/tsrc/ut_userinputhandlertest/inc/videoplaybackcontainer_stub.h
videoplayback/videoplaybackviews/tsrc/ut_userinputhandlertest/inc/videoplaybackcontrol_stub.h
videoplayback/videoplaybackviews/tsrc/ut_userinputhandlertest/init/testframework.ini
videoplayback/videoplaybackviews/tsrc/ut_userinputhandlertest/src/hal_stub.cpp
videoplayback/videoplaybackviews/tsrc/ut_userinputhandlertest/src/userinputhandlertest.cpp
videoplayback/videoplaybackviews/tsrc/ut_userinputhandlertest/src/userinputhandlertestBlocks.cpp
videoplayback/videoplaybackviews/tsrc/ut_userinputhandlertest/src/videoplaybackcontainer_stub.cpp
videoplayback/videoplaybackviews/tsrc/ut_userinputhandlertest/src/videoplaybackcontrol_stub.cpp
videoplayer_plat/group/bld.inf
videoplayer_plat/video_player_file_details_dialog_api/group/bld.inf
videoplayer_plat/video_player_file_details_dialog_api/inc/MPFileDetails.h
videoplayer_plat/video_player_file_details_dialog_api/inc/MPFileDetailsDialog.h
videoplayer_plat/video_player_file_details_dialog_api/inc/filedetailspluginif.h
videoplayer_plat/video_player_file_details_dialog_api/inc/filedetailspluginif.hrh
videoplayer_plat/video_player_file_details_dialog_api/inc/filedetailspluginif.inl
videoplayer_plat/video_player_file_details_dialog_api/inc/mpxfiledetailscntlpluginif.h
videoplayer_plat/video_player_file_details_dialog_api/inc/mpxfiledetailscntlpluginif.inl
videoplayer_plat/video_player_file_details_dialog_api/media_player_file_details_dialog_api.metaxml
videoplayer_plat/video_player_file_details_dialog_api/tsrc/Bmarm/ui_FileDetailsDialogtestU.DEF
videoplayer_plat/video_player_file_details_dialog_api/tsrc/Bwins/ui_FileDetailsDialogtestU.DEF
videoplayer_plat/video_player_file_details_dialog_api/tsrc/EABI/ui_FileDetailsDialogtestU.def
videoplayer_plat/video_player_file_details_dialog_api/tsrc/conf/atsconf.txt
videoplayer_plat/video_player_file_details_dialog_api/tsrc/conf/ui_FileDetailsDialogtest.cfg
videoplayer_plat/video_player_file_details_dialog_api/tsrc/conf/ui_FileDetailsDialogtestManual.cfg
videoplayer_plat/video_player_file_details_dialog_api/tsrc/custom/postrun_custom.xml
videoplayer_plat/video_player_file_details_dialog_api/tsrc/custom/prerun_custom.xml
videoplayer_plat/video_player_file_details_dialog_api/tsrc/data/mmc/RAM-1kB.ram
videoplayer_plat/video_player_file_details_dialog_api/tsrc/data/mmc/american_wedding.ram
videoplayer_plat/video_player_file_details_dialog_api/tsrc/data/mmc/beer440503.wmv
videoplayer_plat/video_player_file_details_dialog_api/tsrc/data/mmc/mpxtest1.mp3
videoplayer_plat/video_player_file_details_dialog_api/tsrc/data/mmc/video_18kb.3gp
videoplayer_plat/video_player_file_details_dialog_api/tsrc/group/bld.inf
videoplayer_plat/video_player_file_details_dialog_api/tsrc/group/ui_FileDetailsDialogtest.mmp
videoplayer_plat/video_player_file_details_dialog_api/tsrc/group/ui_FileDetailsDialogtest.pkg
videoplayer_plat/video_player_file_details_dialog_api/tsrc/inc/EdwinTestControl.h
videoplayer_plat/video_player_file_details_dialog_api/tsrc/inc/VcxTestControlEventQueue.h
videoplayer_plat/video_player_file_details_dialog_api/tsrc/inc/VcxTestTimer.h
videoplayer_plat/video_player_file_details_dialog_api/tsrc/inc/ui_FileDetailsDialogtest.h
videoplayer_plat/video_player_file_details_dialog_api/tsrc/init/TestFramework.ini
videoplayer_plat/video_player_file_details_dialog_api/tsrc/init/manual/TestFramework.ini
videoplayer_plat/video_player_file_details_dialog_api/tsrc/src/EdwinTestControl.cpp
videoplayer_plat/video_player_file_details_dialog_api/tsrc/src/VcxTestControlEventQueue.cpp
videoplayer_plat/video_player_file_details_dialog_api/tsrc/src/VcxTestTimer.cpp
videoplayer_plat/video_player_file_details_dialog_api/tsrc/src/ui_FileDetailsDialogtest.cpp
videoplayer_plat/video_player_file_details_dialog_api/tsrc/src/ui_FileDetailsDialogtestBlocks.cpp
videoplayer_plat/videocollection_api/group/bld.inf
videoplayer_plat/videocollection_api/inc/myvideosindicator.h
videoplayer_plat/videocollection_api/inc/myvideosindicator.hrh
videoplayer_plat/videocollection_api/inc/myvideosindicator.inl
videoplayer_plat/videocollection_api/videocollection_api.metaxml
videoplayer_plat/videoplayer_startup_api/group/bld.inf
videoplayer_plat/videoplayer_startup_api/inc/videoplayeractivationmessage.h
videoplayer_plat/videoplayer_startup_api/inc/videoplayercustommessage.h
videoplayer_plat/videoplayer_startup_api/tsrc/Bmarm/VideoPlayerStartupApiTestU.DEF
videoplayer_plat/videoplayer_startup_api/tsrc/Bwins/VideoPlayerStartupApiTestU.DEF
videoplayer_plat/videoplayer_startup_api/tsrc/EABI/VideoPlayerStartupApiTestU.def
videoplayer_plat/videoplayer_startup_api/tsrc/conf/atsconf.txt
videoplayer_plat/videoplayer_startup_api/tsrc/conf/ui_VideoPlayerStartupApiTest.cfg
videoplayer_plat/videoplayer_startup_api/tsrc/conf/ui_VideoPlayerStartupApiTest2.cfg
videoplayer_plat/videoplayer_startup_api/tsrc/custom/postrun_custom.xml
videoplayer_plat/videoplayer_startup_api/tsrc/custom/prerun_custom.xml
videoplayer_plat/videoplayer_startup_api/tsrc/data/c/prettyfu_startup.3gp
videoplayer_plat/videoplayer_startup_api/tsrc/group/VideoPlayerStartupApiTest.mmp
videoplayer_plat/videoplayer_startup_api/tsrc/group/VideoPlayerStartupApiTest.pkg
videoplayer_plat/videoplayer_startup_api/tsrc/group/bld.inf
videoplayer_plat/videoplayer_startup_api/tsrc/inc/VideoPlayerStartupApiTest.h
videoplayer_plat/videoplayer_startup_api/tsrc/init/TestFramework.ini
videoplayer_plat/videoplayer_startup_api/tsrc/src/VideoPlayerStartupApiTest.cpp
videoplayer_plat/videoplayer_startup_api/tsrc/src/VideoPlayerStartupApiTestBlocks.cpp
videoplayer_plat/videoplayer_startup_api/videoplayer_startup_api.metaxml
videoplayerapp/group/bld.inf
videoplayerapp/lwplayer/data/lwplayer.rss
videoplayerapp/lwplayer/data/lwplayer_reg.rss
videoplayerapp/lwplayer/group/bld.inf
videoplayerapp/lwplayer/group/lwplayer.mmp
videoplayerapp/lwplayer/inc/lwplayerapp.h
videoplayerapp/lwplayer/inc/lwplayerappui.h
videoplayerapp/lwplayer/inc/lwplayerdocument.h
videoplayerapp/lwplayer/inc/lwpuids.hrh
videoplayerapp/lwplayer/loc/lwplayer.loc
videoplayerapp/lwplayer/rom/lwplayer.iby
videoplayerapp/lwplayer/rom/lwplayerresources.iby
videoplayerapp/lwplayer/src/lwplayerapp.cpp
videoplayerapp/lwplayer/src/lwplayerappui.cpp
videoplayerapp/lwplayer/src/lwplayerdocument.cpp
videoplayerapp/mpxvideoplayer/data/mpxvideoplayer.rss
videoplayerapp/mpxvideoplayer/data/mpxvideoplayer_reg.rss
videoplayerapp/mpxvideoplayer/group/bld.inf
videoplayerapp/mpxvideoplayer/group/mpxvideoplayer.mmp
videoplayerapp/mpxvideoplayer/inc/mpxvideoembeddedpdlhandler.h
videoplayerapp/mpxvideoplayer/inc/mpxvideoplayeraiwparamextractor.h
videoplayerapp/mpxvideoplayer/inc/mpxvideoplayerapplication.h
videoplayerapp/mpxvideoplayer/inc/mpxvideoplayerappui.h
videoplayerapp/mpxvideoplayer/inc/mpxvideoplayerappuiengine.h
videoplayerapp/mpxvideoplayer/inc/mpxvideoplayerconstants.h
videoplayerapp/mpxvideoplayer/inc/mpxvideoplayerdocument.h
videoplayerapp/mpxvideoplayer/inc/mpxvideoplayeriadupdate.h
videoplayerapp/mpxvideoplayer/inc/mpxvideoplayerlogger.h
videoplayerapp/mpxvideoplayer/loc/mpxvideoplayer.loc
videoplayerapp/mpxvideoplayer/rom/mpxvideoplayer.iby
videoplayerapp/mpxvideoplayer/rom/mpxvideoplayerresources.iby
videoplayerapp/mpxvideoplayer/rom/mpxvideoplayervariant.iby
videoplayerapp/mpxvideoplayer/sis/VideoPlayer.pkg
videoplayerapp/mpxvideoplayer/sis/VideoPlayer_stub.pkg
videoplayerapp/mpxvideoplayer/sis/cenrep.pkg
videoplayerapp/mpxvideoplayer/sis/depends.xml
videoplayerapp/mpxvideoplayer/sis/make_videoplayer_sisx.bat
videoplayerapp/mpxvideoplayer/src/mpxvideoembeddedpdlhandler.cpp
videoplayerapp/mpxvideoplayer/src/mpxvideoplayerapplication.cpp
videoplayerapp/mpxvideoplayer/src/mpxvideoplayerappui.cpp
videoplayerapp/mpxvideoplayer/src/mpxvideoplayerappuiengine.cpp
videoplayerapp/mpxvideoplayer/src/mpxvideoplayerdocument.cpp
videoplayerapp/mpxvideoplayer/src/mpxvideoplayeriadupdate.cpp
videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/bwins/mpxvideoplayertestu.def
videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/conf/mpxvideoplayertest.cfg
videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/data/mmc/local.3gp
videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/data/mmc/local1.3gp
videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/data/mmc/sdp_test.sdp
videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/data/mmc/test_local.ram
videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/data/mmc/test_local_hw.ram
videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/data/mmc/test_multilink_v2.asx
videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/data/mmc/test_multilocal.ram
videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/data/mmc/test_multilocal_hw.ram
videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/data/mmc/test_seekSingle_v3.asx
videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/data/mmc/test_streaming.ram
videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/eabi/mpxvideoplayertestu.def
videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/group/bld.inf
videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/group/mpxvideoplayertest.mmp
videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/group/mpxvideoplayertest.pkg
videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/group/mpxvideoplayertest_stif_readme.txt
videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/inc/mpxcollectionuihelperimp_stub.h
videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/inc/mpxcollectionutilityimp_stub.h
videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/inc/mpxplaybackutilityimp_stub.h
videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/inc/mpxvideoplayer_appuienginetester.h
videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/inc/mpxvideoplayerappui_stub.h
videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/inc/mpxvideoplayeriadupdate_stub.h
videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/inc/mpxvideoplayertest.h
videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/inc/mpxviewutilityimp_stub.h
videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/inc/stifutilities.h
videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/inc/timeoutcontroller.h
videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/init/testframework.ini
videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/src/coneutils_stub.cpp
videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/src/mpxcollectionuihelper_stub.cpp
videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/src/mpxcollectionutility_stub.cpp
videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/src/mpxcollectionutilityimp_stub.cpp
videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/src/mpxplaybackutilityimp_stub.cpp
videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/src/mpxvideoplayer_appuienginetester.cpp
videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/src/mpxvideoplayerappui_stub.cpp
videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/src/mpxvideoplayeriadupdate_stub.cpp
videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/src/mpxvideoplayertest.cpp
videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/src/mpxvideoplayertestblocks.cpp
videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/src/mpxviewutilityimp_stub.cpp
videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/src/stifutilities.cpp
videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/src/timeoutcontroller.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/run_doxygen.bat	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,19 @@
+@rem
+@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+@rem All rights reserved.
+@rem This component and the accompanying materials are made available
+@rem under the terms of "Eclipse Public License v1.0"
+@rem which accompanies this distribution, and is available
+@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+@rem
+@rem Initial Contributors:
+@rem Nokia Corporation - initial contribution.
+@rem
+@rem Contributors:
+@rem
+@rem Description: Script file for videoplayer document generation
+@rem
+
+@echo off
+
+doxygen videoplayer_doxyfile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/videoplayer_doxyfile	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,1648 @@
+#
+# 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:   Base makefile for the specific icon makefiles.
+#
+#
+
+# Doxyfile 1.7.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+#       TAG = value [value, ...]
+# For lists items can also be appended using:
+#       TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING      = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME           = "Videoplayer package"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER         =
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY       =
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS         = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
+# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
+# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
+# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak,
+# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
+
+OUTPUT_LANGUAGE        = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC      = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF           = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF       =
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC    = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB  = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES        = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH        =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH    =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES            = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF      = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF           = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS           = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES  = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE               = 8
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES                =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C  = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA   = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN   = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL   = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it
+# parses. With this tag you can assign which parser to use for a given extension.
+# Doxygen has a built-in mapping, but you can override or extend it using this
+# tag. The format is ext=language, where ext is a file extension, and language
+# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C,
+# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make
+# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
+# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions
+# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
+
+EXTENSION_MAPPING      =
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT    = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT        = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT            = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen to replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT   = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC   = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING            = YES
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT   = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penality.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will rougly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE      = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL            = NO
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE        = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC         = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES  = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS  = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES   = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS     = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES     = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS  = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS      = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS          = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES       = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES       = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES     = YES
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
+# will list include files with double quotes in the documentation
+# rather than with sharp brackets.
+
+FORCE_LOCAL_INCLUDES   = NO
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO            = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS       = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS        = NO
+
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
+# will sort the (brief and detailed) documentation of class members so that
+# constructors and destructors are listed first. If set to NO (the default)
+# the constructors will appear in the respective orders defined by
+# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
+# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
+# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES       = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME     = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST      = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST      = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST       = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS       =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES  = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES        = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES       = NO
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES             = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page.
+# This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES        = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER    =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
+# by doxygen. The layout file controls the global structure of the generated
+# output files in an output format independent way. The create the layout file
+# that represents doxygen's defaults, run doxygen with the -l option.
+# You can optionally specify a file name after the option, if omitted
+# DoxygenLayout.xml will be used as the name of the layout file.
+
+LAYOUT_FILE            =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET                  = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS               = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED   = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR      = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC       = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT            = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE           =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT                  = ..
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING         = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+
+FILE_PATTERNS          =
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE              = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE                =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS       = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS      = moc_* */videofeeds/* */doc/* */tsrc/* */internal/* *.s60
+
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS        =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH           =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS       =
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE      = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH             =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output.
+# If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER           =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis.
+# Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match.
+# The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS        =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES    = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER         = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES         = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS    = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION    = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code.
+# Otherwise they will link to the documentation.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS              = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS       = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX     = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX    = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX          =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML          = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT            = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION    = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER            =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER            =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET        =
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
+# Doxygen will adjust the colors in the stylesheet and background images
+# according to this color. Hue is specified as an angle on a colorwheel,
+# see http://en.wikipedia.org/wiki/Hue for more information.
+# For instance the value 0 represents red, 60 is yellow, 120 is green,
+# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
+# The allowed range is 0 to 359.
+
+HTML_COLORSTYLE_HUE    = 220
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
+# the colors in the HTML output. For a value of 0 the output will use
+# grayscales only. A value of 255 will produce the most vivid colors.
+
+HTML_COLORSTYLE_SAT    = 100
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
+# the luminance component of the colors in the HTML output. Values below
+# 100 gradually make the output lighter, whereas values above 100 make
+# the output darker. The value divided by 100 is the actual gamma applied,
+# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
+# and 100 does not change the gamma.
+
+HTML_COLORSTYLE_GAMMA  = 80
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting
+# this to NO can help when comparing the output of multiple runs.
+
+HTML_TIMESTAMP         = YES
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS     = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS  = NO
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
+# for more information.
+
+GENERATE_DOCSET        = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME        = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID       = org.doxygen.Project
+
+# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify
+# the documentation publisher. This should be a reverse domain-name style
+# string, e.g. com.mycompany.MyDocSet.documentation.
+
+DOCSET_PUBLISHER_ID    = org.doxygen.Publisher
+
+# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
+
+DOCSET_PUBLISHER_NAME  = Publisher
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP      = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE               =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION           =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI           = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING     =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC             = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND             = NO
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
+# that can be used as input for Qt's qhelpgenerator to generate a
+# Qt Compressed Help (.qch) of the generated HTML documentation.
+
+GENERATE_QHP           = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE               =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#namespace
+
+QHP_NAMESPACE          = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#virtual-folders
+
+QHP_VIRTUAL_FOLDER     = doc
+
+# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
+# add. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#custom-filters
+
+QHP_CUST_FILTER_NAME   =
+
+# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">
+# Qt Help Project / Custom Filters</a>.
+
+QHP_CUST_FILTER_ATTRS  =
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
+# project's
+# filter section matches.
+# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">
+# Qt Help Project / Filter Attributes</a>.
+
+QHP_SECT_FILTER_ATTRS  =
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file.
+
+QHG_LOCATION           =
+
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
+#  will be generated, which together with the HTML files, form an Eclipse help
+# plugin. To install this plugin and make it available under the help contents
+# menu in Eclipse, the contents of the directory containing the HTML and XML
+# files needs to be copied into the plugins directory of eclipse. The name of
+# the directory within the plugins directory should be the same as
+# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
+# the help appears.
+
+GENERATE_ECLIPSEHELP   = NO
+
+# A unique identifier for the eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have
+# this name.
+
+ECLIPSE_DOC_ID         = org.doxygen.Project
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX          = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE   = 4
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to YES, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
+# Windows users are probably better off using the HTML help feature.
+
+GENERATE_TREEVIEW      = NO
+
+# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list.
+
+USE_INLINE_TREES       = NO
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH         = 250
+
+# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open
+# links to external symbols imported via tag files in a separate window.
+
+EXT_LINKS_IN_WINDOW    = NO
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE       = 10
+
+# Use the FORMULA_TRANPARENT tag to determine whether or not the images
+# generated for formulas are transparent PNGs. Transparent PNGs are
+# not supported properly for IE 6.0, but are supported on all modern browsers.
+# Note that when changing this option you need to delete any form_*.png files
+# in the HTML output before the changes have effect.
+
+FORMULA_TRANSPARENT    = YES
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box
+# for the HTML output. The underlying search engine uses javascript
+# and DHTML and should work on any modern browser. Note that when using
+# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
+# (GENERATE_DOCSET) there is already a search function so this one should
+# typically be disabled. For large projects the javascript based search engine
+# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
+
+SEARCHENGINE           = YES
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+# implemented using a PHP enabled web server instead of at the web client
+# using Javascript. Doxygen will generate the search PHP script and index
+# file to put on the web server. The advantage of the server
+# based approach is that it scales better to large projects and allows
+# full text search. The disadvances is that it is more difficult to setup
+# and does not have live searching capabilities.
+
+SERVER_BASED_SEARCH    = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX         = YES
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT           = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+# Note that when enabling USE_PDFLATEX this option is only used for
+# generating bitmaps for formulas in the HTML output, but not in the
+# Makefile that is written to the output directory.
+
+LATEX_CMD_NAME         = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME     = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX          = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE             = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES         =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER           =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS         = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX           = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE        = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES     = NO
+
+# If LATEX_SOURCE_CODE is set to YES then doxygen will include
+# source code with syntax highlighting in the LaTeX output.
+# Note that which sources are shown also depends on other settings
+# such as SOURCE_BROWSER.
+
+LATEX_SOURCE_CODE      = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF           = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT             = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF            = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS         = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE    =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE    =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN           = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT             = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION          = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS              = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML           = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT             = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA             =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD                =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING     = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF   = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD       = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX          = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader.
+# This is useful
+# if you want to understand what is going on.
+# On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY         = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING   = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION        = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF     = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES        = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH           =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS  =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED             =
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED      =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS   = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+#
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+#
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES               =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE       =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS           = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS        = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH              = C:\Apps\actperl\bin
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS         = YES
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH            =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS   = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT               = NO
+
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
+# allowed to run in parallel. When set to 0 (the default) doxygen will
+# base this on the number of processors available in the system. You can set it
+# explicitly to a value larger than 0 to get control over the balance
+# between CPU load and processing speed.
+
+DOT_NUM_THREADS        = 0
+
+# By default doxygen will write a font called FreeSans.ttf to the output
+# directory and reference it in all dot files that doxygen generates. This
+# font does not include all possible unicode characters however, so when you need
+# these (or just want a differently looking font) you can specify the font name
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
+
+DOT_FONTNAME           = FreeSans.ttf
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE           = 10
+
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
+
+DOT_FONTPATH           =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH            = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH    = YES
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS           = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK               = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS     = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH          = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH      = YES
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH             = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH           = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY    = YES
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH        = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT       = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH               =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS           =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES    = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH    = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT        = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS      = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND        = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP            = YES
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filedetails/filedetailsdialog/bwinscw/MPFileDetailsDialogu.def	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,8 @@
+EXPORTS
+	??1CMPFileDetailsDialog@@UAE@XZ @ 1 NONAME ; CMPFileDetailsDialog::~CMPFileDetailsDialog(void)
+	?ExecuteLD@CMPFileDetailsDialog@@QAEXABVTDesC16@@@Z @ 2 NONAME ; void CMPFileDetailsDialog::ExecuteLD(class TDesC16 const &)
+	?ExecuteLD@CMPFileDetailsDialog@@QAEXPAVCMPFileDetails@@@Z @ 3 NONAME ; void CMPFileDetailsDialog::ExecuteLD(class CMPFileDetails *)
+	?NewL@CMPFileDetailsDialog@@SAPAV1@XZ @ 4 NONAME ; class CMPFileDetailsDialog * CMPFileDetailsDialog::NewL(void)
+	??0CMPFileDetails@@QAE@XZ @ 5 NONAME ; CMPFileDetails::CMPFileDetails(void)
+	??1CMPFileDetails@@UAE@XZ @ 6 NONAME ; CMPFileDetails::~CMPFileDetails(void)
+	?Close@CMPFileDetailsDialog@@QAEXXZ @ 7 NONAME ; void CMPFileDetailsDialog::Close(void)
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filedetails/filedetailsdialog/data/MPFileDetails.rss	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,613 @@
+/*
+* Copyright (c) 2002 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:   Resource file for MPFileDetailsDialog.dll.*
+*/
+
+
+// Version : %version: 7 %
+
+
+
+
+//  RESOURCE IDENTIFIER
+NAME    MPFI
+
+//  INCLUDES
+#include <eikon.rh>
+#include <avkon.loc>
+#include <avkon.hrh>
+#include <AiwCommon.rh>
+#include <AiwCdmaCommands.hrh>
+#include <filedetailsdialog.loc>
+
+
+//  RESOURCE DEFINITIONS 
+
+RESOURCE RSS_SIGNATURE { }
+
+RESOURCE TBUF { buf="MPFileDlg"; }
+
+// ---------------------------------------------------
+//
+//    r_mp_file_details_row_format
+//
+// ---------------------------------------------------
+//
+RESOURCE TBUF r_mp_file_details_row_format
+    {
+    buf = "%0U\t%1U"; 
+    }
+
+// ---------------------------------------------------
+// 
+//    r_mp_file_details
+//
+// ---------------------------------------------------
+//
+RESOURCE TBUF r_mp_file_details
+    {
+    buf = qtn_mp_fd_headings;
+    }
+
+// ---------------------------------------------------
+//
+//    r_mp_file_format_heading
+//
+// ---------------------------------------------------
+//
+RESOURCE TBUF r_mp_file_format_heading
+    {
+    buf = qtn_mp_details_format;
+    }
+
+// ---------------------------------------------------
+//
+//    r_mp_file_resolution_heading
+//
+// ---------------------------------------------------
+//
+RESOURCE TBUF r_mp_file_resolution_heading
+    {
+    buf = qtn_mp_details_resolution;
+    }
+
+// ---------------------------------------------------
+//
+//    r_mp_file_resolution
+//
+// ---------------------------------------------------
+//
+RESOURCE TBUF r_mp_file_resolution
+    {
+    buf = qtn_mp_times_indic;
+    }
+
+// ---------------------------------------------------
+//
+//    r_mp_file_bitrate_heading
+//
+// ---------------------------------------------------
+//
+RESOURCE TBUF r_mp_file_bitrate_heading
+    {
+    buf = qtn_mp_details_bitrate;
+    }
+
+// ---------------------------------------------------
+//
+//    r_mp_file_bitrate
+//
+// ---------------------------------------------------
+//
+RESOURCE TBUF r_mp_file_bitrate
+    {
+    buf = qtn_mp_bitrate_kbps;
+    }
+
+// ---------------------------------------------------
+//
+//    r_mp_file_samplerate_heading
+//
+// ---------------------------------------------------
+//
+RESOURCE TBUF r_mp_file_samplerate_heading
+    {
+    buf = qtn_mp_details_samplerate;
+    }
+
+// ---------------------------------------------------
+//
+//    r_mp_file_samplerate
+//
+// ---------------------------------------------------
+//
+RESOURCE TBUF r_mp_file_samplerate
+    {
+    buf = qtn_mp_samplerate_hz;
+    }
+
+// ---------------------------------------------------
+//
+//    r_mp_file_duration_heading
+//
+// ---------------------------------------------------
+//
+RESOURCE TBUF r_mp_file_duration_heading
+    {
+    buf = qtn_mp_details_duration;
+    }
+
+// ---------------------------------------------------
+//
+//    r_mp_file_size_heading
+//
+// ---------------------------------------------------
+//
+RESOURCE TBUF r_mp_file_size_heading
+    {
+    buf = qtn_mp_details_size;
+    }
+
+// ---------------------------------------------------
+//
+//    r_mp_file_size_kb
+//
+// ---------------------------------------------------
+//
+RESOURCE TBUF r_mp_file_size_kb
+    {
+    buf = qtn_mp_size_kb;
+    }
+
+// ---------------------------------------------------
+//
+//    r_mp_file_size_mb
+//
+// ---------------------------------------------------
+//
+RESOURCE TBUF r_mp_file_size_mb
+    {
+    buf = qtn_mp_size_mb;
+    }
+
+// ---------------------------------------------------
+//
+//    r_mp_file_date_heading
+//
+// ---------------------------------------------------
+//
+RESOURCE TBUF r_mp_file_date_heading
+    {
+    buf = qtn_mp_details_date;
+    }
+
+// ---------------------------------------------------
+//
+//    r_mp_file_time_heading
+//
+// ---------------------------------------------------
+//
+RESOURCE TBUF r_mp_file_time_heading
+    {
+    buf = qtn_mp_details_time;
+    }
+
+// ---------------------------------------------------
+//
+//    r_mp_file_copyright_heading
+//
+// ---------------------------------------------------
+//
+RESOURCE TBUF r_mp_file_copyright_heading
+    {
+    buf = qtn_mp_details_copyright;
+    }
+
+// ---------------------------------------------------
+//
+//    r_mp_file_artist_original_heading
+//
+// ---------------------------------------------------
+//
+RESOURCE TBUF r_mp_file_artist_original_heading
+    {
+    buf = qtn_mp_details_artist_original;
+    }
+
+// ---------------------------------------------------
+//
+//    r_mp_file_album_track_heading
+//
+// ---------------------------------------------------
+//
+RESOURCE TBUF r_mp_file_album_track_heading
+    {
+    buf = qtn_mp_details_album_track;
+    }
+
+// ---------------------------------------------------
+//
+//    r_mp_file_genre_heading
+//
+// ---------------------------------------------------
+//
+RESOURCE TBUF r_mp_file_genre_heading
+    {
+    buf = qtn_mp_details_genre;
+    }
+
+// ---------------------------------------------------
+//
+//    r_mp_file_composer_heading
+//
+// ---------------------------------------------------
+//
+RESOURCE TBUF r_mp_file_composer_heading
+    {
+    buf = qtn_mp_details_composer;
+    }
+
+// ---------------------------------------------------
+//
+//    r_mp_file_info_url_heading
+//
+// ---------------------------------------------------
+//
+RESOURCE TBUF r_mp_file_info_url_heading
+    {
+    buf = qtn_mp_details_url;
+    }
+
+// ---------------------------------------------------
+//
+//    r_mp_file_comment_heading
+//
+// ---------------------------------------------------
+//
+RESOURCE TBUF r_mp_file_comment_heading
+    {
+    buf = qtn_mp_details_comment;
+    }
+
+// ---------------------------------------------------
+//
+//    r_mp_file_url_heading
+//
+// ---------------------------------------------------
+//
+RESOURCE TBUF r_mp_file_url_heading
+    {
+    buf = qtn_mp_filedetails_url;
+    }
+
+// ---------------------------------------------------
+// 
+//    r_mp_file_title_heading
+//
+// ---------------------------------------------------
+//
+RESOURCE TBUF r_mp_file_title_heading
+    {
+    buf = qtn_mp_fd_title;
+    }
+
+// ---------------------------------------------------
+// 
+//    r_mp_file_name_heading
+//
+// ---------------------------------------------------
+//
+RESOURCE TBUF r_mp_file_name_heading
+    {
+    buf = qtn_mp_fd_filename;
+    }
+
+// ---------------------------------------------------
+//
+//    r_mp_file_artist_heading
+//
+// ---------------------------------------------------
+//
+RESOURCE TBUF r_mp_file_artist_heading
+    {
+    buf = qtn_mp_details_artist;
+    }
+
+// ---------------------------------------------------
+//
+//    r_mp_file_album_heading
+//
+// ---------------------------------------------------
+//
+RESOURCE TBUF r_mp_file_album_heading
+    {
+    buf = qtn_mp_details_album;
+    }
+
+// ---------------------------------------------------
+//
+//    r_mp_file_year_heading
+//
+// ---------------------------------------------------
+//
+RESOURCE TBUF r_mp_file_year_heading
+    {
+    buf = qtn_mp_details_year;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_qtn_mp_file_upload_status
+// Video upload status heading text.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_qtn_mp_file_upload_status 
+    { 
+    buf = qtn_mp_details_upload_status; 
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_qtn_mp_video_uploaded
+// uploaded text (yes).
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_qtn_mp_video_uploaded 
+    { 
+    buf = qtn_mp_details_upload_status_yes; 
+    }
+
+//
+// -----------------------------------------------------------------------------
+//
+// r_qtn_mp_video_not_uploaded
+// not uploaded text.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_qtn_mp_video_not_uploaded 
+    { 
+    buf = qtn_mp_details_upload_status_no; 
+    }
+
+// ---------------------------------------------------
+//
+//    r_mp_file_provider_heading
+//
+// ---------------------------------------------------
+//
+RESOURCE TBUF r_mp_file_provider_heading
+    {
+    buf = qtn_mp_details_provider;
+    }
+
+// ---------------------------------------------------
+//
+//    r_mp_file_description_heading
+//
+// ---------------------------------------------------
+//
+RESOURCE TBUF r_mp_file_description_heading
+    {
+    buf = qtn_mp_details_description;
+    }
+
+// ---------------------------------------------------
+//
+//    r_mp_file_license_heading
+//
+// ---------------------------------------------------
+//
+RESOURCE TBUF r_qtn_mp_drm_license_heading
+    {
+    buf = qtn_mp_drm_license;
+    }
+
+// ---------------------------------------------------
+//
+//    r_qtn_mp_drm_details_view
+//
+// ---------------------------------------------------
+//
+RESOURCE TBUF r_qtn_mp_drm_details_view
+    {
+    buf = qtn_mp_drm_details_view;
+    }
+
+//----------------------------------------------------
+//
+//    r_mp_drm_file_details_softkeys_ok_view__ok
+//	  
+//	  LSK(ok) MSK(ok) RSK(view)
+//    
+//----------------------------------------------------
+//
+RESOURCE CBA r_mp_drm_file_details_softkeys_ok_view__ok
+    {
+    buttons =
+        {
+        CBA_BUTTON {id=EAknSoftkeyOk; txt=text_softkey_ok; },
+        CBA_BUTTON {id=EAknSoftkeyView; txt=text_softkey_view; },
+        CBA_BUTTON {id=EAknSoftkeyOk; txt=text_softkey_ok; }
+        };
+    }
+
+// ********** GENRE STRINGS ********** 
+
+//----------------------------------------------------
+//   
+//    r_mp_genre_strings
+//
+//----------------------------------------------------
+//
+RESOURCE ARRAY r_mp_genre_strings
+    {
+    items =
+        {
+        LBUF {txt = mp_metadata_genre_blues;},
+        LBUF {txt = mp_metadata_genre_classic_rock;},
+        LBUF {txt = mp_metadata_genre_country;},
+        LBUF {txt = mp_metadata_genre_dance;},
+        LBUF {txt = mp_metadata_genre_disco;},
+        LBUF {txt = mp_metadata_genre_funk;},
+        LBUF {txt = mp_metadata_genre_grunge;},
+        LBUF {txt = mp_metadata_genre_hiphop;},
+        LBUF {txt = mp_metadata_genre_jazz;},
+        LBUF {txt = mp_metadata_genre_metal;},
+        LBUF {txt = mp_metadata_genre_new_age;},
+        LBUF {txt = mp_metadata_genre_oldies;},
+        LBUF {txt = mp_metadata_genre_other;},
+        LBUF {txt = mp_metadata_genre_pop;},
+        LBUF {txt = mp_metadata_genre_r_b;},
+        LBUF {txt = mp_metadata_genre_rap;},
+        LBUF {txt = mp_metadata_genre_reggae;},
+        LBUF {txt = mp_metadata_genre_rock;},
+        LBUF {txt = mp_metadata_genre_techno;},
+        LBUF {txt = mp_metadata_genre_industrial;},
+        LBUF {txt = mp_metadata_genre_alternative;},
+        LBUF {txt = mp_metadata_genre_ska;},
+        LBUF {txt = mp_metadata_genre_death_metal;},
+        LBUF {txt = mp_metadata_genre_pranks;},
+        LBUF {txt = mp_metadata_genre_soundtrack;},
+        LBUF {txt = mp_metadata_genre_euro_techno;},
+        LBUF {txt = mp_metadata_genre_ambient;},
+        LBUF {txt = mp_metadata_genre_trip_hop;},
+        LBUF {txt = mp_metadata_genre_vocal;},
+        LBUF {txt = mp_metadata_genre_jazz_funk;},
+        LBUF {txt = mp_metadata_genre_fusion;},
+        LBUF {txt = mp_metadata_genre_trance;},
+        LBUF {txt = mp_metadata_genre_classical;},
+        LBUF {txt = mp_metadata_genre_instrumental;},
+        LBUF {txt = mp_metadata_genre_acid;},
+        LBUF {txt = mp_metadata_genre_house;},
+        LBUF {txt = mp_metadata_genre_game;},
+        LBUF {txt = mp_metadata_genre_sound_clip;},
+        LBUF {txt = mp_metadata_genre_gospel;},
+        LBUF {txt = mp_metadata_genre_noise;},
+        LBUF {txt = mp_metadata_genre_alternrock;},
+        LBUF {txt = mp_metadata_genre_bass;},
+        LBUF {txt = mp_metadata_genre_soul;},
+        LBUF {txt = mp_metadata_genre_punk;},
+        LBUF {txt = mp_metadata_genre_space;},
+        LBUF {txt = mp_metadata_genre_meditative;},
+        LBUF {txt = mp_metadata_genre_instrumental_pop;},
+        LBUF {txt = mp_metadata_genre_instrumental_rock;},
+        LBUF {txt = mp_metadata_genre_ethnic;},
+        LBUF {txt = mp_metadata_genre_gothic;},
+        LBUF {txt = mp_metadata_genre_darkwave;},
+        LBUF {txt = mp_metadata_genre_techno_industrial;},
+        LBUF {txt = mp_metadata_genre_electronic;},
+        LBUF {txt = mp_metadata_genre_pop_folk;},
+        LBUF {txt = mp_metadata_genre_eurodance;},
+        LBUF {txt = mp_metadata_genre_dream;},
+        LBUF {txt = mp_metadata_genre_southern_rock;},
+        LBUF {txt = mp_metadata_genre_comedy;},
+        LBUF {txt = mp_metadata_genre_cult;},
+        LBUF {txt = mp_metadata_genre_gangsta;},
+        LBUF {txt = mp_metadata_genre_top_40;},
+        LBUF {txt = mp_metadata_genre_christian_rap;},
+        LBUF {txt = mp_metadata_genre_pop_funk;},
+        LBUF {txt = mp_metadata_genre_jungle;},
+        LBUF {txt = mp_metadata_genre_native_american;},
+        LBUF {txt = mp_metadata_genre_cabaret;},
+        LBUF {txt = mp_metadata_genre_new_wave;},
+        LBUF {txt = mp_metadata_genre_psychadelic;},
+        LBUF {txt = mp_metadata_genre_rave;},
+        LBUF {txt = mp_metadata_genre_showtunes;},
+        LBUF {txt = mp_metadata_genre_trailer;},
+        LBUF {txt = mp_metadata_genre_lofi;},
+        LBUF {txt = mp_metadata_genre_tribal;},
+        LBUF {txt = mp_metadata_genre_acid_punk;},
+        LBUF {txt = mp_metadata_genre_acid_jazz;},
+        LBUF {txt = mp_metadata_genre_polka;},
+        LBUF {txt = mp_metadata_genre_retro;},
+        LBUF {txt = mp_metadata_genre_musical;},
+        LBUF {txt = mp_metadata_genre_rock_roll;},
+        LBUF {txt = mp_metadata_genre_hard_rock;},
+        LBUF {txt = mp_metadata_genre_folk;},
+        LBUF {txt = mp_metadata_genre_folk_rock;},
+        LBUF {txt = mp_metadata_genre_national_folk;},
+        LBUF {txt = mp_metadata_genre_swing;},
+        LBUF {txt = mp_metadata_genre_fast_fusion;},
+        LBUF {txt = mp_metadata_genre_bebob;},
+        LBUF {txt = mp_metadata_genre_latin;},
+        LBUF {txt = mp_metadata_genre_revival;},
+        LBUF {txt = mp_metadata_genre_celtic;},
+        LBUF {txt = mp_metadata_genre_bluegrass;},
+        LBUF {txt = mp_metadata_genre_avantgarde;},
+        LBUF {txt = mp_metadata_genre_gothic_rock;},
+        LBUF {txt = mp_metadata_genre_progressive_rock;},
+        LBUF {txt = mp_metadata_genre_psychedelic_rock;},
+        LBUF {txt = mp_metadata_genre_symphonic_rock;},
+        LBUF {txt = mp_metadata_genre_slow_rock;},
+        LBUF {txt = mp_metadata_genre_big_band;},
+        LBUF {txt = mp_metadata_genre_chorus;},
+        LBUF {txt = mp_metadata_genre_easy_listening;},
+        LBUF {txt = mp_metadata_genre_acoustic;},
+        LBUF {txt = mp_metadata_genre_humour;},
+        LBUF {txt = mp_metadata_genre_speech;},
+        LBUF {txt = mp_metadata_genre_chanson;},
+        LBUF {txt = mp_metadata_genre_opera;},
+        LBUF {txt = mp_metadata_genre_chamber_music;},
+        LBUF {txt = mp_metadata_genre_sonata;},
+        LBUF {txt = mp_metadata_genre_symphony;},
+        LBUF {txt = mp_metadata_genre_booty_bass;},
+        LBUF {txt = mp_metadata_genre_primus;},
+        LBUF {txt = mp_metadata_genre_porn_groove;},
+        LBUF {txt = mp_metadata_genre_satire;},
+        LBUF {txt = mp_metadata_genre_slow_jam;},
+        LBUF {txt = mp_metadata_genre_club;},
+        LBUF {txt = mp_metadata_genre_tango;},
+        LBUF {txt = mp_metadata_genre_samba;},
+        LBUF {txt = mp_metadata_genre_folklore;},
+        LBUF {txt = mp_metadata_genre_ballad;},
+        LBUF {txt = mp_metadata_genre_power_ballad;},
+        LBUF {txt = mp_metadata_genre_rhythmic_soul;},
+        LBUF {txt = mp_metadata_genre_freestyle;},
+        LBUF {txt = mp_metadata_genre_duet;},
+        LBUF {txt = mp_metadata_genre_punk_rock;},
+        LBUF {txt = mp_metadata_genre_drum_solo;},
+        LBUF {txt = mp_metadata_genre_a_capella;},
+        LBUF {txt = mp_metadata_genre_euro_house;},
+        LBUF {txt = mp_metadata_genre_dance_hall;},
+        LBUF {txt = mp_metadata_genre_goa;},
+        LBUF {txt = mp_metadata_genre_drum_bass;},
+        LBUF {txt = mp_metadata_genre_club_house;},
+        LBUF {txt = mp_metadata_genre_hardcore;},
+        LBUF {txt = mp_metadata_genre_terror;},
+        LBUF {txt = mp_metadata_genre_indie;},
+        LBUF {txt = mp_metadata_genre_britpop;},
+        LBUF {txt = mp_metadata_genre_neger_punk;},
+        LBUF {txt = mp_metadata_genre_polsk_punk;},
+        LBUF {txt = mp_metadata_genre_beat;},
+        LBUF {txt = mp_metadata_genre_christian_gangsta;},
+        LBUF {txt = mp_metadata_genre_heavy_metal;},
+        LBUF {txt = mp_metadata_genre_black_metal;},
+        LBUF {txt = mp_metadata_genre_crossover;},
+        LBUF {txt = mp_metadata_genre_contemporary_c;},
+        LBUF {txt = mp_metadata_genre_christian_rock;},
+        LBUF {txt = mp_metadata_genre_merengue;},
+        LBUF {txt = mp_metadata_genre_salsa;},
+        LBUF {txt = mp_metadata_genre_thrash_metal;},
+        LBUF {txt = mp_metadata_genre_anime;},
+        LBUF {txt = mp_metadata_genre_jpop;},
+        LBUF {txt = mp_metadata_genre_synthpop;},
+        LBUF {txt = mp_metadata_genre_unknown;}
+        };
+    }
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filedetails/filedetailsdialog/eabi/MPFileDetailsDialogu.def	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,18 @@
+EXPORTS
+	_ZN20CMPFileDetailsDialog4NewLEv @ 1 NONAME
+	_ZN20CMPFileDetailsDialog9ExecuteLDEP14CMPFileDetails @ 2 NONAME
+	_ZN20CMPFileDetailsDialog9ExecuteLDERK7TDesC16 @ 3 NONAME
+	_ZN20CMPFileDetailsDialogD0Ev @ 4 NONAME
+	_ZN20CMPFileDetailsDialogD1Ev @ 5 NONAME
+	_ZN20CMPFileDetailsDialogD2Ev @ 6 NONAME
+	_ZTI18CMPDummyController @ 7 NONAME ; #<TI>#
+	_ZTI20CMPFileDetailsDialog @ 8 NONAME ; #<TI>#
+	_ZTV18CMPDummyController @ 9 NONAME ; #<VT>#
+	_ZTV20CMPFileDetailsDialog @ 10 NONAME ; #<VT>#
+	_ZN14CMPFileDetailsC1Ev @ 11 NONAME
+	_ZN14CMPFileDetailsC2Ev @ 12 NONAME
+	_ZN14CMPFileDetailsD0Ev @ 13 NONAME
+	_ZN14CMPFileDetailsD1Ev @ 14 NONAME
+	_ZN14CMPFileDetailsD2Ev @ 15 NONAME
+	_ZN20CMPFileDetailsDialog5CloseEv @ 16 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filedetails/filedetailsdialog/group/MPFileDlg.mmp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,92 @@
+/*
+* Copyright (c) 2002 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:   Makefile for file details dialog.*
+*/
+
+
+// Version : %version: 12 %
+
+
+
+//#include <bldvariant.hrh>
+#include <platform_paths.hrh>
+#include <data_caging_paths.hrh>
+
+TARGET      mpfiledetailsdialog.dll
+TARGETTYPE  dll
+UID         0x1000006C 0x101F8511
+
+START RESOURCE  ../data/MPFileDetails.rss
+TARGETPATH      APP_RESOURCE_DIR
+TARGET          mpfiledetails.rsc
+HEADER
+LANGUAGE_IDS
+END // RESOURCE
+
+#if defined(ARMCC)
+deffile ../eabi/ 
+#elif defined( WINSCW )
+deffile ../bwinscw/ 
+#elif defined( WINS )
+deffile ../bwins/ 
+#else
+deffile ../bmarm/ 
+#endif
+
+VENDORID    VID_DEFAULT
+
+SOURCEPATH   ../src
+SOURCE       mppopuplist.cpp
+SOURCE       MPFileDetailsDialog.cpp
+SOURCE       MPFileDetails.cpp
+SOURCE       MediaPlayerDrmHelper.cpp
+
+USERINCLUDE  ../inc
+USERINCLUDE  ../../../inc
+
+APP_LAYER_SYSTEMINCLUDE
+
+
+CAPABILITY CAP_GENERAL_DLL
+
+LIBRARY cone.lib
+LIBRARY euser.lib
+LIBRARY eikcoctl.lib
+LIBRARY avkon.lib
+LIBRARY bafl.lib
+LIBRARY flogger.lib
+LIBRARY eikcore.lib
+LIBRARY centralrepository.lib
+LIBRARY efsrv.lib
+LIBRARY playbackhelper.lib
+LIBRARY commonengine.lib
+LIBRARY featmgr.lib
+LIBRARY servicehandler.lib
+LIBRARY mmfcontrollerframework.lib
+LIBRARY mediaclientaudio.lib
+LIBRARY mediaclientvideo.lib
+LIBRARY metadatautility.lib
+LIBRARY caf.lib
+LIBRARY drmutility.lib
+
+
+
+LIBRARY drmcommon.lib
+LIBRARY drmhelper.lib
+LIBRARY drmuihandling.lib
+#ifdef __WINDOWS_MEDIA
+LIBRARY     asxparser.lib         
+#endif
+
+//end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filedetails/filedetailsdialog/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 2002-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:   This file provides the information required for building the*
+*/
+
+
+// Version : %version: 5 %
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+//
+//  Export the loc and iby files for S60 5.0
+//
+../loc/filedetailsdialog.loc    APP_LAYER_LOC_EXPORT_PATH( filedetailsdialog.loc )
+../rom/filedetailsdialog.iby    CORE_APP_LAYER_IBY_EXPORT_PATH( filedetailsdialog.iby )
+../rom/filedetailsrsc.iby       LANGUAGE_APP_LAYER_IBY_EXPORT_PATH( filedetailsrsc.iby )
+
+PRJ_MMPFILES
+MPFileDlg.mmp
+
+PRJ_EXTENSIONS
+
+PRJ_TESTMMPFILES
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filedetails/filedetailsdialog/inc/MPFileDetailsDialog.inl	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2004 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:   Inline methods for media file details dialog.*
+*/
+
+
+// Version : %version: 2 %
+
+
+
+// INCLUDE FILES
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// Return client window handle
+// ---------------------------------------------------------
+//
+inline RWindow& CMPDummyController::GetClientWindow()
+    {
+    return Window();
+    }
+
+// ---------------------------------------------------------
+// Return client WsSession
+// ---------------------------------------------------------
+//
+inline RWsSession& CMPDummyController::GetClientWsSession()
+    {
+    return ControlEnv()->WsSession();
+    }
+
+// ---------------------------------------------------------
+// Return client ScreenDevice
+// ---------------------------------------------------------
+//
+inline CWsScreenDevice& CMPDummyController::GetScreenDevice()
+    {
+    return *(ControlEnv()->ScreenDevice());
+    }
+
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filedetails/filedetailsdialog/inc/MediaPlayerDrmHelper.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,174 @@
+/*
+* Copyright (c) 2004 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:   DRM helper for Media files.*
+*/
+
+
+
+#ifndef MEDIAPLAYERDRMHELPER_H
+#define MEDIAPLAYERDRMHELPER_H
+
+// INCLUDES
+#include <e32std.h>
+#include <MPFileDetails.h>  
+
+// FORWARD DECLARATIONS
+class CDRMHelper;
+class CDRMHelperRightsConstraints;
+class MDesCArray;
+class CCoeEnv;
+class CMPFileDetails;
+namespace DRM
+{
+class CDrmUtility;	
+class CDrmUiHandling;
+}
+
+// CONSTANTS
+const TInt KMediaPlayerRightsAboutToExpire = -40000;
+
+// CLASS DECLARATION
+
+/**
+*  DRM helper for Media files.
+*
+*  @lib MPFileDetailsDialog.lib
+*  @since 3.2
+*/
+NONSHARABLE_CLASS( CMediaPlayerDrmHelper ) : public CBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor called by CMPVideoPlayerUIController class
+        * @param aDrmHelper Pointer to CDRMHelper class. Ownership is not transferred.
+        */
+        static CMediaPlayerDrmHelper* NewL(CDRMHelper* aDrmHelper, CMPVideoPlayerUIController* aUIController);
+
+        /**
+        * Two-phased constructor called by CMPFileDetailsDialog class or MediaPlayerUtility class
+        * @param aDrmHelper Pointer to CDRMHelper class. Ownership is not transferred.
+        */
+        static CMediaPlayerDrmHelper* NewL(CDRMHelper* aDrmHelper );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CMediaPlayerDrmHelper();
+
+    public: // New functions
+
+        /**
+        * Loads usage rights information for a particular media file using
+        * CDRMHelper. The loaded constraint is DRMCommon::EPlay.
+        * @since 3.2
+        * @param aFileName File path, which usage rights info is loaded.
+        */
+        void LoadDrmUsageRightsInfoL(const TDesC& aFileName);
+
+        /**
+        * Loads usage rights information for a particular media file using
+        * CDRMHelper. The loaded constraint is DRMCommon::EPlay.
+        * @since 3.2
+        * @param aFile File handle, which usage rights info is loaded.
+        */
+        void LoadDrmUsageRightsInfoL(
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+                                     RFile64& aFile);
+#else
+                                     RFile& aFile);
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+        /**
+        * Gets usage rigths status.
+        * @since 3.2
+        * @param aStatus:
+        *           EMediaPlayerDrmFull:        Full rights
+        *           EMediaPlayerDrmMissing:     Rights missing
+        *           EMediaPlayerDrmRestricted:  Restricted rights
+        *           EMediaPlayerDrmExpired:     Expired rights (could be also future rights)
+        *           EMediaPlayerDrmPreview:     Preview rights
+        */
+        void GetDrmUsageRightsStatus(TMediaPlayerRightsStatus& aStatus);
+
+        /**
+        * Gets start time of time based rights.
+        * @since 3.2
+        * @param aStartTime Start time.
+        * @return Error code:
+        *           KErrNone:       Start time returned.
+        *           KErrNotFound:   Object doesn't have time based rights.
+        *           KErrNotReady:   Usage rights info not loaded.
+        */
+        TInt GetDrmStartTime(TTime& aStartTime);
+
+        /**
+        * Get pointer to DRMHelper object (as given in constructor).
+        * @since 3.2
+        * @return Pointer to DRMHelper. Ownership not transferred.
+        */
+        CDRMHelper* DrmHelper(); 
+
+        /**
+        * Creates a file handle to the file passed in the aName parameter.
+        * @param aHandle      Handle to a file
+        * @param aName        Name of the file
+        * @param aFileMode    Mode to open file handle in
+        */
+        static void CreateFileHandleLC(
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+                                       RFile64& aHandle, 
+#else
+                                       RFile& aHandle, 
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+                                       const TDesC& aName, 
+									   TUint aFileMode);
+
+    private: // Private contructors
+
+        /**
+        * C++ default constructor.
+        */
+        CMediaPlayerDrmHelper(CDRMHelper* aDrmHelper, CMPVideoPlayerUIController* aUIController);
+
+        /**
+        * C++ default constructor.
+        */
+        CMediaPlayerDrmHelper(CDRMHelper* aDrmHelper );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+    private:    // Data
+
+        CDRMHelper* iDrmHelper;
+        HBufC* iFileName;
+        CDRMHelperRightsConstraints* iRightsConstraints;
+        CCoeEnv* iEnv;
+        DRM::CDrmUtility* iDrmUtility;  // not owned
+        DRM::CDrmUiHandling* iDrmUiHandling;
+        TBool iOMAProtected; // ETrue if protected content is OMA, EFalse if it is WMDRM
+
+        TBool iProtected;
+        TBool iExpired;
+        TBool iDrmSendingAllowed;
+        HBufC8* iInfoUrl;
+        HBufC8* iPreviewUri;
+    };
+
+#endif      // MEDIAPLAYERDRMHELPER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filedetails/filedetailsdialog/inc/MediaPlayerPrivateCRKeys.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2004 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:   Media Player internal CenRep keys.*
+*/
+
+
+// Version : %version: 2 %
+
+
+
+#ifndef MEDIAPLAYERPRIVATECRKEYS_H
+#define MEDIAPLAYERPRIVATECRKEYS_H
+
+//#include "MediaPlayerInternalCRKeys.h"
+
+// Media Player Features API
+
+const TUid KCRUidMediaPlayerFeatures = {0x101F880B};
+
+const TUint32 KMPLocalVariation = 0x00000001;
+
+#endif      // MEDIAPLAYERPRIVATECRKEYS_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filedetails/filedetailsdialog/inc/MediaPlayerVariant.hrh	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,73 @@
+/*
+* Copyright (c) 2004 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: 
+*
+*/
+
+
+// Version : %version: 2 %
+
+
+
+#ifndef MEDIAPLAYERVARIANT_HRH
+#define MEDIAPLAYERVARIANT_HRH
+
+// KMediaPlayerMixerSupport and KMediaPlayerChangeRTForAll 
+// moved to the MusicPlayer
+//
+
+// Feature to enable Video contrast setting in Media Settings.
+#define KMediaPlayerVideoContrast       0x01
+
+// Feature to enable IPv6 access point support in Media Settings
+// (Default access point).
+#define KMediaPlayerIPv6Support         0x02
+
+// Feature to hide various streaming functionalities for CR 409-372
+#define KMediaPlayerHideStreamingFunctionality   0x04
+
+// Feature to disable Save Prompt when Back softkey is pressed
+#define KMediaPlayerDisableSavePrompt   0x08
+
+// Feature to disable data transmission totally, 
+// when the streaming is in stopped state. 
+#define KMediaPlayerCloseData           0x10        
+     
+// Feature to immediately return to calling application after streaming clip ends
+#define KMediaPlayerReturnFocusBackToCallingApp   0x20
+
+// Feature to enable marquee (scrolling) text in media player details dialog.
+// If enabled, the item in dialog can be selected and the selected item starts
+// scrolling if the item text cannot be displayed as whole on the screen.
+#define KMediaPlayerMarqueeDetails      0x40
+
+// Feature to enable marquee (scrolling) text for artist name label in 
+// Music Player. When enabled and if the artist name is too long to fit into 
+// space reserved for it, the label starts scrolling. Scrolling is associated 
+// to player state, when playing is started the label starts scrolling and if 
+// the playing is stopped the scrolling stops, too.
+#define KMediaPlayerMarqueeArtistName   0x80
+
+// Feature to enable Rocker Keys
+#define KMediaPlayerRockerKeys	0x100
+
+//Allow to add, edit url
+#define MEDIAPLAYER_UI_Enhancements_P2
+
+// Feature to use MP volume control instead of avkon volume control
+#define KMEDIAPLAYERVOLUMECONTROL
+
+#define _THUMBNAIL_SUPPORT
+
+#endif // MEDIAPLAYERVARIANT_HRH
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filedetails/filedetailsdialog/inc/mppopuplist.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,147 @@
+/*
+* 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: 
+*
+*/
+
+
+// Version : %version: 8 %
+
+
+
+#ifndef __CMPPopupList_H__
+#define __CMPPopupList_H__
+
+//  INCLUDES
+#include <aknPopup.h>   // CAknPopupList
+#include <eiklbx.h>
+#include <f32file.h>
+
+
+// FORWARD DECLARATIONS
+class CEikListBox;
+
+
+// CLASS DECLARATION
+
+NONSHARABLE_CLASS( CMPPopupList ): public CAknPopupList
+    {
+    public:  // Constructors and destructor
+
+        /**
+         * Two-phased constructor.
+         */
+        static CMPPopupList* NewL( CEikListBox* aListBox, 
+                                   const TDesC& aFilePath,
+                                   TBool aDrmProtected,
+                                   TBool aReadingDCFOnly );
+
+        /**
+         * Two-phased constructor.
+         */
+        static CMPPopupList* NewL( CEikListBox* aListBox,
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+                                   RFile64& aFile,
+#else
+                                   RFile& aFile,
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+                                   TBool aDrmProtected,
+                                   TBool aReadingDCFOnly );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CMPPopupList();
+
+    public: // From CAknPopupList
+    	
+		/**
+		 * Processes events from the softkeys. 
+		 * @param aCommandId Event Id from the soft-key.
+		 */
+        void ProcessCommandL(TInt aCommandId);    
+    	   	
+		/**
+		 * Handle key press events 
+		 */
+        void HandleListBoxEventL( CEikListBox* aListBox, 
+                                  TListBoxEvent aEventType );
+
+        /**
+         * Handle key press events 
+         */
+        TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent,
+                                     TEventCode aType);
+
+    public: // new
+
+        /**
+         * Re-construct DRM softkeys for playlist
+         * @since 9.1
+         */
+        void ReConstructDrmSoftkeysL( TBool aDrmProtected );
+        
+    private:
+    	
+        /**
+         * Construct
+         * @since 9.1
+         */
+        void ConstructL( CEikListBox* aListBox, 
+					     const TDesC& aFilePath,
+					     TBool aDrmProtected,
+					     TBool aReadingDCFOnly );
+
+        /**
+         * Construct
+         * @since 9.1
+         */
+        void ConstructL( CEikListBox* aListBox,
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+                         RFile64& aFile,
+#else
+                         RFile& aFile,
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+                         TBool aDrmProtected,
+                         TBool aReadingDCFOnly );
+
+        /**
+         * Launch Details View of DRM component 
+         * @since 9.1
+         */
+        void LaunchDrmInfoL();
+            	
+        /**
+         * Update softkeys according to DRM or non-DRM status
+         * @since 9.1
+         */
+        void UpdateSoftkeysL(); 
+                
+    private: // data
+    	
+		HBufC* iFilePath;
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+        RFile64 iFileHandle;
+#else
+        RFile iFileHandle;
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+		TBool iDrmProtected;
+		TBool iReadingDCFOnly;
+		CEikListBox* iListBox; // not own
+
+    };
+
+#endif // __CMPPopupList_H__
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filedetails/filedetailsdialog/loc/filedetailsdialog.loc	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,297 @@
+/*
+* Copyright (c) 2002 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:   Localisation strings for Media Player app.*
+*/
+
+
+// Version : %version: 7 %
+
+
+
+// LOCALISATION STRINGS
+
+// *******************
+// File Details Dialog
+// *******************
+
+//d:File Details heading
+//d: Ui Spec sec 12 File Details (p70)
+//l:heading_pane_t1
+//r:5.0
+#define qtn_mp_fd_headings "File Details:"
+
+//d:Heading item text for the file details popup listbox.
+//d:Clip title.
+//d: Ui Spec sec 12 File Details (p70)
+//l:list_double_pane_t1_cp2
+//r:5.0
+#define qtn_mp_fd_title "Title"
+
+//d:Heading item text for the file details popup listbox.
+//d:Clip's filename.
+//d: Ui Spec sec 12 File Details (p70)
+//l:list_double_pane_t1_cp2
+//r:5.0
+#define qtn_mp_fd_filename "Filename"
+
+//d:Heading item text for the file details popup listbox.
+//d:Clip's url adress.
+//d: Ui Spec sec 12 File Details (p71)
+//l:list_double_pane_t1_cp2
+//r:5.0
+#define qtn_mp_filedetails_url "Url"
+
+//d:Heading item text for the file details popup listbox.
+//d:Clip format.
+//d: Ui Spec sec 12 File Details (p70)
+//l:list_double_pane_t1_cp2
+//r:5.0
+#define qtn_mp_details_format "Format"
+
+//d:Heading item text for the file details popup listbox.
+//d:Clip resolution.
+//d: Ui Spec sec 12 File Details (p71)
+//l:list_double_pane_t1_cp2
+//r:5.0
+#define qtn_mp_details_resolution "Resolution"
+
+//d:Video clip resolution
+//d:%0N is width of the video clip in pixels
+//d:%1N is height of the video clip in pixels
+//d: Ui Spec sec 12 File Details (p71)
+//l:list_double_pane_t2_cp2
+//r:5.0
+#define qtn_mp_times_indic "%0N x %1N"
+
+//d:Heading item text for the file details popup listbox.
+//d:Clip duration.
+//d: Ui Spec sec 12 File Details (p71)
+//l:list_double_pane_t1_cp2
+//r:5.0
+#define qtn_mp_details_duration "Duration"
+
+//d:Heading item text for the file details popup listbox.
+//d:Clip bitrate.
+//d: Ui Spec sec 12 File Details (p71)
+//l:list_double_pane_t1_cp2
+//r:5.0
+#define qtn_mp_details_bitrate "Bitrate"
+
+//d:Clip bitrate
+//d:%N is the bitrate of the video clip
+//d: Ui Spec sec 12 File Details (p71)
+//l:list_double_pane_t2_cp2
+//r:5.0
+#define qtn_mp_bitrate_kbps "%N kbps"
+
+//d:Heading item text for the file details popup listbox.
+//d:Clip samplerate.
+//d: Ui Spec sec 12 File Details (p71)
+//l:list_double_pane_t1_cp2
+//r:5.0
+#define qtn_mp_details_samplerate "Sampling rate"
+
+//d:Clip samplerate
+//d:%N is the samplerate of the audio clip
+//d: Ui Spec sec 12 File Details (p71)
+//l:list_double_pane_t2_cp2
+//r:5.0
+#define qtn_mp_samplerate_hz "%N Hz"
+
+
+//d:Heading item text for the file details popup listbox.
+//d:Clip size.
+//d: Ui Spec sec 12 File Details (p71)
+//l:list_double_pane_t1_cp2
+//r:5.0
+#define qtn_mp_details_size "Size"
+
+//d:Clips size in kB
+//d:%U is size of the clip in kilobytes, %U lenght is 1-6.
+//d: Ui Spec sec 12 File Details (p71)
+//l:list_double_pane_t2_cp2
+//r:5.0
+#define qtn_mp_size_kb "%U kB"
+
+//d:Clips size in MB
+//d:%U is size of the clip in megabytes, %U lenght is 1-6.
+//d: Ui Spec sec 12 File Details (p71)
+//l:list_double_pane_t2_cp2
+//r:5.0
+#define qtn_mp_size_mb "%U MB"
+
+//d:Heading item text for the file details popup listbox.
+//d:Clip creation date.
+//d: Ui Spec sec 12 File Details (p71)
+//l:list_double_pane_t1_cp2
+//r:5.0
+#define qtn_mp_details_date "Date"
+
+//d:Heading item text for the file details popup listbox.
+//d:Clip creation time.
+//d: Ui Spec sec 12 File Details (p71)
+//l:list_double_pane_t1_cp2
+//r:5.0
+#define qtn_mp_details_time "Time"
+
+//d:Heading item text for the file details popup listbox.
+//d:Artist.
+//d: Ui Spec sec 12 File Details (p70)
+//l:list_double_pane_t1_cp2
+//r:5.0
+#define qtn_mp_details_artist "Artist"
+
+//d:Heading item text for the file details popup listbox.
+//d:Album.
+//d: Ui Spec sec 12 File Details (p70)
+//l:list_double_pane_t1_cp2
+//r:5.0
+#define qtn_mp_details_album "Album"
+
+//d:Heading item text for the file details popup listbox.
+//d:Year.
+//d: Ui Spec sec 12 File Details (p71)
+//l:list_double_pane_t1_cp2
+//r:5.0
+#define qtn_mp_details_year "Year"
+
+//d:Heading item text for the file details popup listbox.
+//d:Clip copyright.
+//d: Ui Spec sec 12 File Details (p71)
+//l:list_double_pane_t1_cp2
+//r:5.0
+#define qtn_mp_details_copyright "Copyright"
+
+//d:Heading item text for the file details popup listbox.
+//d:Original artist of the track.
+//d: Ui Spec sec 12 File Details (p70)
+//l:list_double_pane_t1_cp2
+//w:
+//r:5.0
+//
+#define qtn_mp_details_artist_original  "Original artist"
+
+//d:Heading item text for the file details popup listbox.
+//d:Album track number for the track.
+//d: Ui Spec sec 12 File Details (p70)
+//l:list_double_pane_t1_cp2
+//w:
+//r:5.0
+//
+#define qtn_mp_details_album_track      "Album track number"
+
+//d:Heading item text for the file details popup listbox.
+//d:Genre information for the song.
+//d:Note that the genre field value itself cannot be localized and
+//d:is typically in english.
+//d: Ui Spec sec 12 File Details (p70)
+//l:list_double_pane_t1_cp2
+//w:
+//r:5.0
+//
+#define qtn_mp_details_genre            "Genre"
+
+//d:Heading item text for the file details popup listbox.
+//d:Composer of the song.
+//d: Ui Spec sec 12 File Details (p70)
+//l:list_double_pane_t1_cp2
+//w:
+//r:5.0
+//
+#define qtn_mp_details_composer         "Composer"
+
+//d:Heading item text for the file details popup listbox.
+//d:URL address from which more information about the track can be found.
+//d: Ui Spec sec 12 File Details (p71)
+//l:list_double_pane_t1_cp2
+//w:
+//r:5.0
+//
+#define qtn_mp_details_url              "URL"
+
+
+//d:Heading item text for the file details popup listbox.
+//d:Comment for the track.
+//d: Ui Spec sec 12 File Details (p71)
+//l:list_double_pane_t1_cp2
+//w:
+//r:5.0
+//
+#define qtn_mp_details_comment          "Comment"
+
+//d:Heading item text for the file details popup listbox.
+//d: Upload Status
+//d: UI Spec sec 12 File Details (p71) 
+//l:list_double_pane_t1_cp2
+//r:5.0
+#define qtn_mp_details_upload_status "Uploaded"
+
+//d:Heading item text for the file details popup listbox.
+//d: Upload Status
+//d: UI Spec sec 12 File Details (p71)
+//l:list_double_pane_t1_cp2
+//r:5.0
+#define qtn_mp_details_upload_status_yes "Yes"
+
+//d:Heading item text for the file details popup listbox.
+//d: Upload Status
+//d: UI Spec sec 12 File Details (p71)
+//l:list_double_pane_t1_cp2
+//r:5.0
+#define qtn_mp_details_upload_status_no "No"
+
+//d:Heading item text for the file details popup listbox.
+//d:Provider of the song.
+//d: Ui Spec sec 12 File Details (p70)
+//l:list_double_pane_t1_cp2
+//w:
+//r:5.0
+//
+#define qtn_mp_details_provider "Provider"
+
+//d:Heading item text for the file details popup listbox.
+//d:Description of the video.
+//d: Ui Spec sec 12 File Details (p71)
+//l:list_double_pane_t1_cp2
+//w:
+//r:5.0
+//
+#define qtn_mp_details_description "Description"
+
+//d:First line for first entry of Details View listbox
+//d:It indicates the current status of DRM license
+//d:Second line is qtn_mp_drm_details_view
+//d: Ui Spec sec 12.1 DRM related file details (p72)
+//l:list_double_pane_t1_cp2
+//w:
+//r:5.2
+//
+#define qtn_mp_drm_license        "License"
+
+//d:Second line for first entry of Details View listbox
+//d: Ui Spec sec 12.1 DRM related file details (p72)
+//l:list_double_pane_t2_cp2
+//w:
+//r:5.2
+//
+#define qtn_mp_drm_details_view   "For details click 'View'"
+
+//d: Heading item text for the details popup listbox
+//d: Clip audio track type
+//d: Ui Spec sec 12 File Details (p71)
+//l:list_double_pane_t1_cp2
+//r:5.2
+//
+#define qtn_mp_details_audio "Audio"
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filedetails/filedetailsdialog/rom/filedetailsdialog.iby	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,28 @@
+/*
+* 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 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:   IBY for filedetailsdialog.dll*
+*/
+
+
+// Version : %version: 2 %
+
+
+#ifndef __FILEDETAILSDIALOG_IBY__
+#define __FILEDETAILSDIALOG_IBY__
+
+#include <data_caging_paths_for_iby.hrh>
+
+file=ABI_DIR\BUILD_DIR\MPFileDetailsDialog.dll          SHARED_LIB_DIR\MPFileDetailsDialog.dll
+
+#endif //__FILEDETAILSDIALOG_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filedetails/filedetailsdialog/rom/filedetailsrsc.iby	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,28 @@
+/*
+* 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 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:   IBY for filedetailsdialog.dll*
+*/
+
+
+// Version : %version: 3 %
+
+
+#ifndef __FILEDETAILSRSC_IBY__
+#define __FILEDETAILSRSC_IBY__
+
+#include <data_caging_paths_for_iby.hrh>
+
+S60_APP_RESOURCE(MPFileDetails)
+
+#endif //__FILEDETAILSRSC_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filedetails/filedetailsdialog/src/MPFileDetails.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2002 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:   Container class for file details*
+*/
+
+
+// Version : %version: 9 %
+
+
+// INCLUDE FILES
+#include "MPFileDetails.h"
+#include <featmgr.h>
+#include "mpxvideo_debug.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CMPFileDetails::CMPFileDetails
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CMPFileDetails::CMPFileDetails()
+    : iSeekable( ETrue ), iDRMExpireConstraint( EMediaPlayerNone ), iDRMhasInfoURL(EFalse)
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetails::CMPFileDetails()"));
+}
+
+// -----------------------------------------------------------------------------
+// CMPFileDetails::~CMPFileDetails
+// Destructor
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CMPFileDetails::~CMPFileDetails()
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetails::~CMPFileDetails()"));
+
+    delete iTitle;
+    delete iFileName;
+    delete iFilePath;
+    delete iUrl;
+    delete iFormat;
+    delete iCopyright;
+    delete iArtist;
+    delete iAlbum;
+    delete iYear;
+
+    // ID3v2
+    delete iOriginalArtist;
+    delete iAlbumTrack;
+    delete iGenre;
+    delete iComposer;
+    delete iAudioFileWebPage;
+    delete iComment;
+    delete iProvider;
+    delete iDescription;
+
+    // For X-pcs meta data
+    delete iArtistXpcs;
+    delete iTitleXpcs;
+    delete iAlbumXpcs;
+    delete iInfoXpcs;
+
+    //DRM
+    if (iDRMInfoURL && iDRMhasInfoURL)
+        delete iDRMInfoURL; //DRM2
+
+    if (iDetailsFileHandle.SubSessionHandle())
+        iDetailsFileHandle.Close();
+}
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filedetails/filedetailsdialog/src/MPFileDetailsDialog.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,1841 @@
+/*
+* Copyright (c) 2002 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 of the CMPFileDetailsDialog.*
+*/
+
+
+// Version : %version: 22 %
+
+// INCLUDE FILES
+#include <aknlists.h>
+#include <bautils.h>
+#include <StringLoader.h>
+#include <e32base.h>
+#include <utf.h>
+#include <mmf/common/mmferrors.h>
+#include <DRMHelper.h>
+#include <aknclearer.h>
+#include <e32math.h> //for size rounding
+
+#include <MPFileDetails.rsg>
+#include "mpxvideo_debug.h"
+
+#include <AiwServiceHandler.h>
+#include <AiwCdmaCommands.hrh>
+#include <featmgr.h>
+#include <data_caging_path_literals.hrh> // KDC_RESOURCE_FILES_DIR
+#include <centralrepository.h>
+#include "MediaPlayerVariant.hrh"
+#include <MetaDataUtility.h>
+#include <MetaDataFieldContainer.h>
+#include <caf/content.h>
+#include <Oma2Agent.h>
+
+#include "MediaPlayerPrivateCRKeys.h"
+#include "MPFileDetailsDialog.h"
+#include "mppopuplist.h"
+#include <mediarecognizer.h>
+#include <streaminglinkmodel.h>
+#include "MPFileDetails.h"
+#include "MediaPlayerDrmHelper.h"
+
+//
+//  Inline methods
+//
+#include "MPFileDetailsDialog.inl"
+
+//#include "MPAppConsts.h"
+
+#include <drmutility.h>
+
+#ifdef __WINDOWS_MEDIA
+#include <asxparser.h>
+#endif
+
+// CONSTANTS
+_LIT(KResourceFile,"z:MPFileDetails.rsc");
+
+const TInt KOneKilobyte = 1;
+const TInt KFileSizeOneKilobyte = 1024;
+const TInt KThousandNotKilobyte = 1000;
+const TInt KOneSecond(1000000);
+const TInt KOneHourInSeconds(3600);
+const TInt KMaxTimeLength = 36;
+const TInt KMaxFilePathLength = 2048;
+
+// For meta data
+_LIT( KMPTitle, "Title" );
+_LIT( KMPArtist, "Artist" );
+_LIT( KMPAuthor, "Author" );
+_LIT( KMPCopyright, "Copyright" );
+_LIT( KMPAbstract, "Abstract" );
+
+_LIT( KExt3gpp,     "3gp" );
+_LIT( KExtMp4,      "mp4" );
+_LIT( KExtM4a,      "m4a" );
+
+_LIT(KDetaMime3gpp,  "audio/3gpp");
+_LIT(KDetaMime3gpp2, "audio/3gpp2");
+_LIT(KDetaMimeMp4,   "audio/mp4");
+
+_LIT(KFormat,"MimeType");
+_LIT(KMPX,   "x");
+
+
+// ================= OTHER EXPORTED FUNCTIONS ==============
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::CMPFileDetailsDialog
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CMPFileDetailsDialog::CMPFileDetailsDialog()
+    : iResourceFileOffset(0)
+    , iResult( KErrNone )
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::CMPFileDetailsDialog()"));
+}
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CMPFileDetailsDialog::ConstructL()
+{
+
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::ConstructL()"));
+
+    LoadResourcesL();
+    iListBox = new (ELeave) CAknDoublePopupMenuStyleListBox();
+    iGenres = CCoeEnv::Static()->ReadDesCArrayResourceL( R_MP_GENRE_STRINGS );
+
+}
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CMPFileDetailsDialog* CMPFileDetailsDialog::NewL()
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog* CMPFileDetailsDialog::NewL()"));
+
+    CMPFileDetailsDialog* self = new( ELeave ) CMPFileDetailsDialog();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+}
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::~CMPFileDetailsDialog
+// Destructor
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CMPFileDetailsDialog::~CMPFileDetailsDialog()
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::~CMPFileDetailsDialog()"));
+    if( iPopupList )
+        {
+        iPopupList->CancelPopup();
+        }
+    delete iPopupList;  // cause removal from control stack
+    delete iListBox;
+    delete iGenres;
+    UnLoadResources();
+}
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::ExecuteLD
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CMPFileDetailsDialog::ExecuteLD(const TDesC& aFileName)
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::ExecuteLD()"));
+
+    CleanupStack::PushL( this );
+    CMPFileDetails* fileDetails = new (ELeave) CMPFileDetails();
+    CleanupStack::PushL( fileDetails );
+
+	//
+	// Obtain file path first so it can be used later
+	//
+    fileDetails->iFilePath = aFileName.AllocL();
+
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+    RFile64 fileHandle;
+#else
+    RFile fileHandle;
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+    TUint fileMode = EFileShareReadersOrWriters | EFileStream | EFileRead;
+    RFs fs = CEikonEnv::Static()->FsSession();
+
+    User::LeaveIfError(fileHandle.Open(fs, aFileName, fileMode));
+    CleanupClosePushL(fileHandle);
+
+    DRM::CDrmUtility* drmUtil = DRM::CDrmUtility::NewLC();
+
+    TRAP_IGNORE( fileDetails->iDrmProtected =
+        drmUtil->IsProtectedL(fileHandle) );
+
+    CleanupStack::PopAndDestroy(2); // fileHandle, drmUtil
+
+    if ( fileDetails->iDrmProtected )
+        {
+        //
+		// All DRM rights are handled & displayed by DRM component.
+        // MP only needs to display DCF header info (Title, Provider, Description).
+        //
+        FetchDCFHeaderDataL(aFileName, fileDetails);
+        }
+
+    // recognize file and get format
+    CMediaRecognizer* recognizer = CMediaRecognizer::NewL();
+    CleanupStack::PushL(recognizer);
+    CMediaRecognizer::TMediaType mediaType =
+                recognizer->IdentifyMediaTypeL( aFileName, ETrue );
+    // mime type not shown for playlists and ram files
+    if ( mediaType != CMediaRecognizer::ELocalRamFile &&
+         mediaType != CMediaRecognizer::ELocalAsxFile &&
+         mediaType != CMediaRecognizer::ELocalAudioPlaylist )
+        {
+        fileDetails->iFormat = recognizer->MimeTypeL( aFileName ).AllocL();
+        }
+    CleanupStack::PopAndDestroy();  // recognizer
+
+    // filename
+    TParse parse;
+    parse.Set(aFileName,NULL,NULL);
+    fileDetails->iFileName = parse.Name().AllocL();
+
+    switch (mediaType)
+        {
+        case CMediaRecognizer::ELocalVideoFile:
+            {
+#ifdef SYMBIAN_BUILD_GCE
+            CVideoPlayerUtility2* videoPlayer = CVideoPlayerUtility2::NewL(*this,
+                EMdaPriorityNormal,EMdaPriorityPreferenceNone );
+#else
+            CMPDummyController* dummy = CMPDummyController::NewLC();
+            TRect tmp;
+            CVideoPlayerUtility* videoPlayer = CVideoPlayerUtility::NewL(*this,
+                            EMdaPriorityNormal,EMdaPriorityPreferenceNone,
+                            dummy->GetClientWsSession(),dummy->GetScreenDevice(),
+                            dummy->GetClientWindow(),tmp,tmp);
+#endif // SYMBIAN_BUILD_GCE
+            CleanupStack::PushL(videoPlayer);
+            // open
+            videoPlayer->OpenFileL(aFileName);
+            // wait open to complete
+            iWait.Start();
+
+            if (iResult && iResult != KErrMMPartialPlayback)
+                {
+#ifdef SYMBIAN_BUILD_GCE
+                CleanupStack::PopAndDestroy(1); // videoPlayer
+#else
+                CleanupStack::PopAndDestroy(2); // dummy and videoPlayer
+#endif //SYMBIAN_BUILD_GCE
+                break;
+                }
+            // prepare
+            videoPlayer->Prepare();
+            // wait prepare to complete
+            iWait.Start();
+
+            if (iResult && iResult != KErrMMPartialPlayback)
+                {
+#ifdef SYMBIAN_BUILD_GCE
+                CleanupStack::PopAndDestroy(1); // videoPlayer
+#else
+                CleanupStack::PopAndDestroy(2); // dummy and videoPlayer
+#endif //SYMBIAN_BUILD_GCE
+                break;
+                }
+            // get video file details
+            // duration
+            fileDetails->iDurationInSeconds =
+                    videoPlayer->DurationL().Int64() / KOneSecond;
+            // resolution
+            TSize size;
+            videoPlayer->VideoFrameSizeL(size);
+            fileDetails->iResolutionHeight = size.iHeight;
+            fileDetails->iResolutionWidth = size.iWidth;
+            // bitrate
+            fileDetails->iBitrate = videoPlayer->VideoBitRateL() +
+                                    videoPlayer->AudioBitRateL();
+
+            // video track
+            fileDetails->iVideoTrack = videoPlayer->VideoBitRateL();
+
+            TPtrC8 videoFormat = videoPlayer->VideoFormatMimeType();
+
+            delete fileDetails->iFormat;
+            fileDetails->iFormat = NULL;
+
+            if ( videoFormat.Length())
+            {
+                HBufC* videoFormat16 = HBufC::NewLC(videoFormat.Length());
+                TPtr videoFormatDes16(videoFormat16->Des());
+                videoFormatDes16.Copy(videoFormat);
+
+                fileDetails->iFormat = videoFormatDes16.AllocL();
+                CleanupStack::PopAndDestroy();   //videoFormat16
+            }
+
+            // copyright & title & format
+            TInt metaCount = videoPlayer->NumberOfMetaDataEntriesL();
+            CMMFMetaDataEntry* metaData;
+            for (TInt i = 0; i < metaCount; i++)
+                {
+                metaData = videoPlayer->MetaDataEntryL(i);
+                if (!metaData->Name().CompareF(KMPCopyright))
+                    {
+                    fileDetails->iCopyright = metaData->Value().AllocL();
+                    }
+                else if (!metaData->Name().CompareF(KMPArtist) || !metaData->Name().Compare(KMPAuthor))
+                    {
+                    fileDetails->iArtist = metaData->Value().AllocL();
+                    }
+                else if (!metaData->Name().CompareF(KMPTitle))
+                    {
+                    fileDetails->iTitle = metaData->Value().AllocL();
+                    }
+                else if (!metaData->Name().CompareF(KMPAbstract))
+                     {
+                          fileDetails->iDescription = metaData->Value().AllocL();
+                     }
+                else if (!(metaData->Name().CompareF(KFormat) || fileDetails->iFormat))
+                     {
+                          fileDetails->iFormat = metaData->Value().AllocL();
+                     }
+                delete metaData;
+                }
+#ifdef SYMBIAN_BUILD_GCE
+            CleanupStack::PopAndDestroy(1); // videoPlayer
+#else
+            CleanupStack::PopAndDestroy(2); // dummy and videoPlayer
+#endif //SYMBIAN_BUILD_GCE
+            }
+            break;
+        case CMediaRecognizer::ELocalRamFile:
+            {
+            // get first link
+            CStreamingLinkModel* linkModel = CStreamingLinkModel::NewL();
+            CleanupStack::PushL(linkModel);
+            User::LeaveIfError(linkModel->OpenLinkFileL( aFileName, EFalse ));
+            fileDetails->iUrl = HBufC::NewL(linkModel->MaxLinkLength());
+            TPtr filePtr = fileDetails->iUrl->Des();
+            TBool dummy;
+            linkModel->GetNextLinkL(filePtr,dummy);
+            CleanupStack::PopAndDestroy(); // linkModel
+            }
+            break;
+        case CMediaRecognizer::ELocalAsxFile:
+            {
+#ifdef __WINDOWS_MEDIA
+			CAsxParser* asxParser = NULL;
+			TRAPD(err, asxParser = CAsxParser::NewL( aFileName ));
+			CleanupStack::PushL( asxParser );
+
+			if ( !err && asxParser && asxParser->FileVersion() > 0 )
+				{
+				TUint asxUrlCount = 0;
+				TPtrC8 urlPtr;
+
+				asxParser->GetUrlCount(asxUrlCount);
+				if ( asxUrlCount )
+					{
+					// get first link
+					asxParser->GetUrl(1,urlPtr);
+					fileDetails->iUrl = HBufC::NewL(urlPtr.Length());
+					TPtr filePtr = fileDetails->iUrl->Des();
+					asxParser->PrintUrl(urlPtr,filePtr);
+					}
+				}
+			CleanupStack::PopAndDestroy();  // asxparser
+#endif
+            }
+            break;
+        case CMediaRecognizer::ELocalAudioFile:
+            {
+            FetchMetaDataL( aFileName, fileDetails );
+            }
+            break;
+        default:
+            break;
+        }
+
+
+    if (mediaType != CMediaRecognizer::ELocalRamFile &&
+		mediaType != CMediaRecognizer::ELocalAsxFile )
+        {
+        RFs fs = CEikonEnv::Static()->FsSession();
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+        RFile64 file; 
+#else
+        RFile file;
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+        TInt error = file.Open(fs, aFileName, EFileRead | EFileShareReadersOnly);
+        if (error)
+            {
+            // Try different sharing method if the first one failed.
+            error = file.Open(fs, aFileName, EFileRead | EFileShareAny);
+            }
+
+        if (!error)
+            {
+            // Set item size, ignore error code
+            if (mediaType != CMediaRecognizer::ELocalAudioPlaylist)
+                {
+                file.Size(fileDetails->iSize);
+                }
+            // Set modification date & time, ignore error code
+            file.Modified(fileDetails->iTime);
+            file.Close();
+            }
+        }
+
+    // Show File Details in differend ExecuteLD
+    ExecuteLD( fileDetails );
+    CleanupStack::PopAndDestroy(); // fileDetails
+    CleanupStack::Pop(); // this
+}
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::ExecuteLD
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CMPFileDetailsDialog::ExecuteLD(CMPFileDetails* aFileDetails)
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::ExecuteLD()"));
+
+    if ( aFileDetails->iDrmProtected && aFileDetails->iFilePath )
+    {
+        // drm data
+        FetchDrmDataL( *aFileDetails->iFilePath, aFileDetails );
+    }
+
+
+    if ( iPopupList )
+    {
+        iPopupList->CancelPopup();
+        iPopupList = NULL;
+    }
+
+    //
+    //  use Media Player's own PopupList, not Avkon's PopupList
+    //
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+    TInt64 size(0);
+#else
+    TInt size(0);
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+    TInt error(0);
+    TInt handleExists(0);
+    if (  aFileDetails->iDetailsFileHandle.SubSessionHandle() )
+    {
+        error = aFileDetails->iDetailsFileHandle.Size( size );
+    }
+
+    handleExists =(!error && size )? ETrue:EFalse;
+
+    if( handleExists )
+    {
+        iPopupList = CMPPopupList::NewL( iListBox,
+                                         aFileDetails->iDetailsFileHandle,
+                                         aFileDetails->iDrmProtected,
+                                         aFileDetails->iReadingDCFOnly );
+    }
+    else
+    {
+        //
+        //  file path is not available when this ExecuteLD(aFileDetails) method is
+        //	launched by MP Video View for streaming link. Hence, this value is set
+        //  to Null in such case.
+        //
+        HBufC* temp = HBufC::NewL(KMaxFilePathLength);
+        CleanupStack::PushL( temp );
+        TPtr filePathPtr = temp->Des();
+
+        if ( aFileDetails->iFilePath )
+        {
+            filePathPtr.Append( aFileDetails->iFilePath->Des() );
+        }
+        else
+        {
+            filePathPtr.Append( KNullDesC() );
+        }
+
+        //
+        //  use Media Player's own PopupList, not Avkon's PopupList
+        //
+        iPopupList = CMPPopupList::NewL( iListBox,
+                                     filePathPtr,
+                                     aFileDetails->iDrmProtected,
+                                     aFileDetails->iReadingDCFOnly );
+
+        CleanupStack::PopAndDestroy( temp );
+    }
+
+    TRAPD( err,
+    {
+        iListBox->ConstructL(iPopupList, CEikListBox::EDisableHighlight );
+        iListBox->ItemDrawer()->ColumnData()->EnableMarqueeL( ETrue );
+
+        iListBox->CreateScrollBarFrameL(ETrue);
+        iListBox->ScrollBarFrame()->
+            SetScrollBarVisibilityL( CEikScrollBarFrame::EOff,
+                                     CEikScrollBarFrame::EAuto );
+
+        SetTitleL(iPopupList);
+        FillListBoxL(aFileDetails);
+
+        iPopupList->ExecuteLD();
+        iPopupList = NULL;
+    } );//TRAP
+
+	//explicitly cancel the Popup if it's not terminated properly
+    if ( err && iPopupList )
+    {
+        iPopupList->CancelPopup();
+    }
+
+    delete this;
+    
+    if ( KLeaveExit == err )
+        {
+        User::Leave( err );
+        }
+}
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::UnLoadResourceFile
+// -----------------------------------------------------------------------------
+//
+void CMPFileDetailsDialog::UnLoadResources()
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::UnLoadResources()"));
+
+    if (iResourceFileOffset > 0)
+        {
+        CCoeEnv::Static()->DeleteResourceFile(iResourceFileOffset);
+        iResourceFileOffset = 0;
+        }
+}
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::LoadResourceFileL
+// -----------------------------------------------------------------------------
+//
+void CMPFileDetailsDialog::LoadResourcesL()
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::LoadResourcesL()"));
+
+    if (iResourceFileOffset == 0)
+        {
+        CCoeEnv* enviro = CCoeEnv::Static();
+        TFileName resourceFile;
+
+        //
+        // Get the path & file name with the drive not specified
+        //
+        _LIT(KMPTempFile,"MPFileDetails.rsc");
+        TParse parse;
+        parse.Set(KMPTempFile, &KDC_APP_RESOURCE_DIR, NULL);
+        TPtrC rscFile = parse.FullName();
+
+        //
+        // This is done to ensure upgraded file is used first.
+        // If no upgraded file is found, default file in Z: drive will be used.
+        //
+        TFindFile find( CCoeEnv::Static()->FsSession() );
+        TInt err = find.FindByDir( rscFile, KNullDesC );
+        MPX_DEBUG(_L("CMPFileDetailsDialog::LoadResourcesL() : err(%d)"),err );
+
+        if ( err )
+        {
+            parse.Set(KResourceFile, &KDC_APP_RESOURCE_DIR, NULL);
+            TPtrC defaultRscFile = parse.FullName();
+            resourceFile.Append( defaultRscFile );
+            MPX_DEBUG(_L("CMPFileDetailsDialog::LoadResourcesL() : defaultRsc(%S)"),&resourceFile );
+        }
+        else
+        {
+            resourceFile.Append( find.File() );
+            MPX_DEBUG(_L("CMPFileDetailsDialog::LoadResourcesL() : upgradeRsc(%S)"),&resourceFile );
+        }
+
+        BaflUtils::NearestLanguageFile( enviro->FsSession(), resourceFile );
+        iResourceFileOffset = enviro->AddResourceFileL( resourceFile );
+        }
+}
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::SetTitleL
+// -----------------------------------------------------------------------------
+//
+void CMPFileDetailsDialog::SetTitleL(CAknPopupList* aPopupList)
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::SetTitleL()"));
+
+    HBufC* title = StringLoader::LoadLC(R_MP_FILE_DETAILS);
+    aPopupList->SetTitleL(*title);
+    CleanupStack::PopAndDestroy(); //title
+}
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::FillListBoxL
+// -----------------------------------------------------------------------------
+//
+void CMPFileDetailsDialog::FillListBoxL(CMPFileDetails* aFileDetails)
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::FillListBoxL()"));
+
+    CDesCArray* itemArray =
+        static_cast<CDesCArray*>( iListBox->Model()->ItemTextArray() );
+
+    TBool drmProtected = aFileDetails->iDrmProtected;
+
+    // re-evaluate drm protection
+    // for playlists it may be inaccurate
+    if ( ! drmProtected )
+    {
+        if ( aFileDetails->iDetailsFileHandle.SubSessionHandle() )
+        {
+            CContent* content = CContent::NewL( aFileDetails->iDetailsFileHandle );
+            content->GetAttribute( EIsProtected, drmProtected );
+            delete content;
+        }
+        else if (aFileDetails->iFilePath != NULL)
+        {
+            CContent* content = CContent::NewL( aFileDetails->iFilePath->Des() );
+            content->GetAttribute( EIsProtected, drmProtected );
+            delete content;
+        }
+
+        //
+        // since 'aFileDetails->iDrmProtected' is EFalse earlier
+        // and now it becomes ETrue after the re-evaluation,
+        // the related softkeys need to be re-initalized here
+        //
+        if ( drmProtected )
+        {
+            iPopupList->ReConstructDrmSoftkeysL(drmProtected);
+        }
+    }
+
+    // if content is drm protected, fetch the drm data
+    if ( drmProtected && aFileDetails->iFilePath )
+    {
+		FetchDrmDataL( *aFileDetails->iFilePath, aFileDetails );
+    }
+
+    if ( drmProtected && ! aFileDetails->iReadingDCFOnly )
+    {
+        //
+        // All DRM rights & constraints are handled & displayed by DRM component.
+        // So, MP only needs to display the Heading here.
+        //
+
+		//
+		// According to UI Spec, DRM info is always the 1st entry of the Details dlg.
+		// The softkeys of the Details pop-up (CMPPopupList) are constructed based
+        // on this info. Hence, if the order entry of DRM is changed, softkeys in
+        // CMPPopupList need to be updated accordingly.
+		//
+        DisplayDrmHeadingInfoL( itemArray );
+    }
+
+    MakeTitleItemL(itemArray,aFileDetails);
+    MakeArtistItemL(itemArray,aFileDetails);
+    MakeOriginalArtistItemL(itemArray,aFileDetails);
+    MakeAlbumItemL(itemArray,aFileDetails);
+    MakeAlbumTrackItemL(itemArray,aFileDetails);
+    MakeGenreItemL(itemArray,aFileDetails);
+    MakeComposerItemL(itemArray,aFileDetails);
+    MakeProviderItemL(itemArray,aFileDetails);
+    MakeFormatItemL(itemArray,aFileDetails);
+    MakeResolutionItemL(itemArray,aFileDetails);
+    MakeDurationItemL(itemArray,aFileDetails);
+    MakeBitrateItemL(itemArray,aFileDetails);
+    MakeSamplerateItemL(itemArray,aFileDetails);
+    MakeSizeItemL(itemArray,aFileDetails);
+    MakeDateItemL(itemArray,aFileDetails);
+    MakeTimeItemL(itemArray,aFileDetails);
+
+    if ( FeatureManager::FeatureSupported( KFeatureIdLightSurf ) )
+    {
+        MakeUploadStatusL( itemArray, aFileDetails );
+    }
+
+    MakeYearItemL(itemArray,aFileDetails);
+    MakeDescriptionItemL(itemArray,aFileDetails);
+    MakeCommentItemL(itemArray,aFileDetails);
+    MakeUrlItemL(itemArray,aFileDetails);
+    MakeAudioFileWebPageItemL(itemArray,aFileDetails);
+    MakeCopyrightItemL(itemArray,aFileDetails);
+
+    iListBox->HandleItemAdditionL();
+    iListBox->SetCurrentItemIndex(0);
+}
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::AddItemToListBoxL
+// -----------------------------------------------------------------------------
+//
+void CMPFileDetailsDialog::AddItemToListBoxL(const TDesC& aHeading,
+                                             const TDesC& aValue,
+                                             CDesCArray* aItemArray)
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::AddItemToListBoxL()"));
+
+    CDesCArrayFlat* items = new (ELeave) CDesCArrayFlat(2);
+    CleanupStack::PushL(items);
+    items->AppendL(aHeading); //First string (heading)
+
+    //remove tabs from aValue
+    HBufC* aValueBuf = aValue.AllocLC();
+    TPtr aValuePtr = aValueBuf->Des();
+
+    // remove EndOfString character
+    if (aValuePtr.Length() > 0)
+        {
+        TChar c = aValuePtr[aValuePtr.Length()-1];
+        if (c.Eos())
+            {
+            aValuePtr.Delete(aValuePtr.Length()-1,aValuePtr.Length());
+            }
+        }
+
+    for( TInt i = 0; i < aValuePtr.Length(); i++ )
+        {
+        if( aValuePtr[i] == '\t' )
+            {
+            aValuePtr[i] = ' ';
+            }
+        }
+    items->AppendL(aValuePtr);   //Second string (value)
+    CleanupStack::PopAndDestroy( aValueBuf );  //aValueBuf
+
+    HBufC* headingAndValue =
+            StringLoader::LoadLC( R_MP_FILE_DETAILS_ROW_FORMAT, *items );
+    aItemArray->AppendL(*headingAndValue);
+    CleanupStack::PopAndDestroy(2); // items & headingAndValue
+}
+
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::MakeTitleItemL
+// -----------------------------------------------------------------------------
+//
+void CMPFileDetailsDialog::MakeTitleItemL( CDesCArray* aItemArray,
+                                           CMPFileDetails* aFileDetails)
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::MakeTitleItemL()"));
+
+    if (aFileDetails->iTitle)
+        {
+        HBufC* heading = StringLoader::LoadLC(R_MP_FILE_TITLE_HEADING);
+        AddItemToListBoxL(*heading,*aFileDetails->iTitle,aItemArray);
+        CleanupStack::PopAndDestroy(); // heading
+        return;
+        }
+
+    if (aFileDetails->iFileName)
+        {
+        HBufC* heading = StringLoader::LoadLC(R_MP_FILE_NAME_HEADING);
+        AddItemToListBoxL(*heading,*aFileDetails->iFileName,aItemArray);
+        CleanupStack::PopAndDestroy(); // heading
+        }
+}
+
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::MakeUrlItemL
+// -----------------------------------------------------------------------------
+//
+void CMPFileDetailsDialog::MakeUrlItemL( CDesCArray* aItemArray,
+                                         CMPFileDetails* aFileDetails)
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::MakeUrlItemL()"));
+
+    if (aFileDetails->iUrl)
+        {
+        HBufC* heading = StringLoader::LoadLC(R_MP_FILE_URL_HEADING);
+        AddItemToListBoxL(*heading,*aFileDetails->iUrl,aItemArray);
+        CleanupStack::PopAndDestroy(); // heading
+        }
+}
+
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::MakeFormatItemL
+// -----------------------------------------------------------------------------
+//
+void CMPFileDetailsDialog::MakeFormatItemL(CDesCArray* aItemArray,
+                                           CMPFileDetails* aFileDetails)
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::MakeFormatItemL()"));
+
+    if (aFileDetails->iFormat)
+        {
+        HBufC* heading = StringLoader::LoadLC(R_MP_FILE_FORMAT_HEADING);
+        AddItemToListBoxL(*heading,*aFileDetails->iFormat,aItemArray);
+        CleanupStack::PopAndDestroy(); // heading
+        }
+}
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::MakeResolutionItemL
+// -----------------------------------------------------------------------------
+//
+void CMPFileDetailsDialog::MakeResolutionItemL(CDesCArray* aItemArray,
+                                               CMPFileDetails* aFileDetails)
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::MakeResolutionItemL()"));
+
+    if (aFileDetails->iResolutionWidth && aFileDetails->iResolutionHeight)
+        {
+        HBufC* heading = StringLoader::LoadLC(R_MP_FILE_RESOLUTION_HEADING);
+        CArrayFix<TInt>* items = new (ELeave) CArrayFixFlat<TInt>(2);
+        CleanupStack::PushL(items);
+        items->AppendL(aFileDetails->iResolutionWidth);
+        items->AppendL(aFileDetails->iResolutionHeight);
+        HBufC* value = StringLoader::LoadLC(R_MP_FILE_RESOLUTION,*items);
+        TPtr text = value->Des();
+        TInt index = text.FindC(KMPX);
+        LanguageSpecificNumberConversion( text );
+        text.Replace(index,1,KMPX);
+        AddItemToListBoxL(*heading,*value,aItemArray);
+        CleanupStack::PopAndDestroy(3); // heading,items,value
+        }
+}
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::MakeDurationItemL
+// -----------------------------------------------------------------------------
+//
+void CMPFileDetailsDialog::MakeDurationItemL(CDesCArray* aItemArray,
+                                             CMPFileDetails* aFileDetails)
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::MakeDurationItemL()"));
+
+    TInt64 duration = aFileDetails->iDurationInSeconds;
+    if (duration > 0)
+        {
+        HBufC* dateFormatString;
+        if (duration < KOneHourInSeconds)
+            {
+            // Read time format string from AVKON resource
+            dateFormatString = StringLoader::LoadLC(R_QTN_TIME_DURAT_MIN_SEC);
+            }
+        else
+            {
+            // Read time format string from AVKON resource
+            dateFormatString = StringLoader::LoadLC(R_QTN_TIME_DURAT_LONG);
+            }
+        TBuf<16> dur;
+        TTime durTime = TTime(duration*KOneSecond);
+        durTime.FormatL(dur, *dateFormatString);
+        LanguageSpecificNumberConversion( dur );
+        HBufC* heading = StringLoader::LoadLC(R_MP_FILE_DURATION_HEADING);
+        AddItemToListBoxL(*heading,dur,aItemArray);
+        CleanupStack::PopAndDestroy(2); // heading & dateFormatString
+        }
+}
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::MakeBitrateItemL
+// -----------------------------------------------------------------------------
+//
+void CMPFileDetailsDialog::MakeBitrateItemL(CDesCArray* aItemArray,
+                                            CMPFileDetails* aFileDetails)
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::MakeBitrateItemL()"));
+
+    if (aFileDetails->iBitrate > 0)
+        {
+        HBufC* heading = StringLoader::LoadLC(R_MP_FILE_BITRATE_HEADING);
+        HBufC* value = StringLoader::LoadLC(
+              R_MP_FILE_BITRATE,aFileDetails->iBitrate / KThousandNotKilobyte );
+        TPtr text = value->Des();
+        LanguageSpecificNumberConversion( text );
+        AddItemToListBoxL(*heading,*value,aItemArray);
+        CleanupStack::PopAndDestroy(2); // heading & value
+        }
+}
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::MakeSamplerateItemL
+// -----------------------------------------------------------------------------
+//
+void CMPFileDetailsDialog::MakeSamplerateItemL(CDesCArray* aItemArray,
+                                               CMPFileDetails* aFileDetails)
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::MakeSamplerateItemL()"));
+
+    if (aFileDetails->iSamplerate > 0)
+        {
+        HBufC* heading = StringLoader::LoadLC(R_MP_FILE_SAMPLERATE_HEADING);
+        HBufC* value = StringLoader::LoadLC(
+              R_MP_FILE_SAMPLERATE,aFileDetails->iSamplerate);
+        TPtr text = value->Des();
+        LanguageSpecificNumberConversion( text );
+        AddItemToListBoxL(*heading,*value,aItemArray);
+        CleanupStack::PopAndDestroy(2); // heading & value
+        }
+}
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::MakeSizeItemL
+// -----------------------------------------------------------------------------
+//
+void CMPFileDetailsDialog::MakeSizeItemL(CDesCArray* aItemArray,
+                                         CMPFileDetails* aFileDetails)
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::MakeSizeItemL()"));
+
+    if (aFileDetails->iSize)
+    {
+        TRealFormat format = TRealFormat(KMaxFileName,2);
+        TBuf<KMaxFileName> sizeString;
+        HBufC* value;
+        HBufC* heading = StringLoader::LoadLC(R_MP_FILE_SIZE_HEADING);
+        TReal size = aFileDetails->iSize;
+        TReal truncsize;
+        size = size/KFileSizeOneKilobyte;
+        // Show kilobytes with 3 digits. If more digits needed,
+        // show size in megabytes. Only round up if showing kB
+        if ( size < KThousandNotKilobyte )
+        {
+            if (size > KOneKilobyte) // CR rounding only if size between 1kB and 1MB
+            { // rounding for Gallery/Messaging display equivalency
+                const TReal tempsize = size; // need const
+                TInt err = Math::Int(truncsize, tempsize);
+                if (err == KErrNone) // need to catch error after convert to Tint
+                {
+                    if ((size > truncsize) && (size < truncsize + 1))
+                    {
+                        size =  truncsize +1;
+                    }
+                // else do nothing, size will be used
+                } // if conversion failed, keep it TReal
+            }
+            sizeString.Num(size,format);
+            switch (sizeString.Length())
+            {
+                case 6:
+                    sizeString = sizeString.Left(3);
+                    break;
+                case 5:
+                    sizeString = sizeString.Left(4);
+                    break;
+                default:
+                    break;
+            }
+            value = StringLoader::LoadLC(R_MP_FILE_SIZE_KB,sizeString);
+        }
+        else
+        {
+            size = size/KFileSizeOneKilobyte;
+            sizeString.Num(size,format);
+            switch (sizeString.Length())
+            {
+                case 6:
+                    sizeString = sizeString.Left(3);
+                    break;
+                case 5:
+                    sizeString = sizeString.Left(4);
+                    break;
+                default:
+                    break;
+            }
+            value = StringLoader::LoadLC(R_MP_FILE_SIZE_MB,sizeString);
+        }
+        TPtr text = value->Des();
+        LanguageSpecificNumberConversion( text );
+        AddItemToListBoxL(*heading,*value,aItemArray);
+        CleanupStack::PopAndDestroy(2); // heading & value
+    }
+}
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::MakeDateItemL
+// -----------------------------------------------------------------------------
+//
+void CMPFileDetailsDialog::MakeDateItemL(CDesCArray* aItemArray,
+                                         CMPFileDetails* aFileDetails)
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::MakeDateItemL()"));
+
+    if (aFileDetails->iTime > TTime(0))
+        {
+        HBufC* heading = StringLoader::LoadLC(R_MP_FILE_DATE_HEADING);
+        HBufC* dateFormatString =
+                StringLoader::LoadLC( R_QTN_DATE_USUAL_WITH_ZERO );
+        TBuf<KMaxTimeLength> date;
+        TTime localDate = aFileDetails->iTime;
+        localDate.FormatL(date,*dateFormatString);
+        LanguageSpecificNumberConversion( date );
+        AddItemToListBoxL(*heading,date,aItemArray);
+        CleanupStack::PopAndDestroy(2); // heading & dateFormatString
+        }
+}
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::MakeTimeItemL
+// -----------------------------------------------------------------------------
+//
+void CMPFileDetailsDialog::MakeTimeItemL(CDesCArray* aItemArray,
+                                         CMPFileDetails* aFileDetails)
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::MakeTimeItemL()"));
+
+    if (aFileDetails->iTime > TTime(0))
+        {
+        HBufC* heading = StringLoader::LoadLC( R_MP_FILE_TIME_HEADING );
+        HBufC* timeFormatString =
+                StringLoader::LoadLC( R_QTN_TIME_USUAL_WITH_ZERO );
+        TBuf<32> time;
+        TTime localTime = aFileDetails->iTime;
+        localTime.FormatL(time,*timeFormatString);
+        LanguageSpecificNumberConversion( time );
+        AddItemToListBoxL(*heading,time,aItemArray);
+        CleanupStack::PopAndDestroy(2); // heading & timeFormatString
+        }
+}
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::MakeUploadStatusL
+// -----------------------------------------------------------------------------
+//
+
+void CMPFileDetailsDialog::MakeUploadStatusL(CDesCArray* aItemArray,
+                                             CMPFileDetails* aFileDetails)
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::MakeUploadStatusL()"));
+
+    if(aFileDetails->iVideoTrack)
+        {
+        HBufC* heading = StringLoader::LoadLC( R_QTN_MP_FILE_UPLOAD_STATUS );
+
+        CAiwServiceHandler* AIWServiceHandler = CAiwServiceHandler::NewLC();
+
+        // AIW generic input param list
+        CAiwGenericParamList& mpBaseInputParamsList =
+                                AIWServiceHandler->InParamListL();
+        // Aiw generic output param list
+        CAiwGenericParamList& mpBaseOutputParamsList =
+                                AIWServiceHandler->OutParamListL();
+
+        //assign the file name
+        TAiwVariant fileNameVariant( aFileDetails->iFileName );
+        TAiwGenericParam fileNameParam( EGenericParamFile, fileNameVariant );
+        mpBaseInputParamsList.AppendL( fileNameParam );  //file name
+
+        // Execute the AIW service command
+        AIWServiceHandler->ExecuteServiceCmdL( KAIWCmdAmsExtendedLightSurfData,
+                                            mpBaseInputParamsList,
+                                            mpBaseOutputParamsList );
+
+        HBufC* str;
+        str = StringLoader::LoadLC(R_QTN_MP_VIDEO_NOT_UPLOADED );
+        //if file is uploaded, then only provider will add the result
+        //to the output param list
+        if ( mpBaseOutputParamsList.Count() > 0)
+            {
+            TInt Index = 0;
+            //check for file type
+            const TAiwGenericParam* uploadParam =
+                            mpBaseOutputParamsList.FindFirst( Index,
+                EGenericParamCharSet, EVariantTypeDesC );
+            if(uploadParam != NULL )
+                {
+                CleanupStack::PopAndDestroy();
+                str = StringLoader::LoadLC(R_QTN_MP_VIDEO_UPLOADED );
+                }
+            }
+
+        AddItemToListBoxL(*heading,*str,aItemArray);
+        CleanupStack::PopAndDestroy(3); // heading, str & AIWServiceHandler
+        }
+}
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::MakeCopyrightItemL
+// -----------------------------------------------------------------------------
+//
+void CMPFileDetailsDialog::MakeCopyrightItemL(CDesCArray* aItemArray,
+                                              CMPFileDetails* aFileDetails)
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::MakeCopyrightItemL()"));
+
+    if (aFileDetails->iCopyright)
+        {
+        HBufC* heading = StringLoader::LoadLC(R_MP_FILE_COPYRIGHT_HEADING);
+        TPtr text = aFileDetails->iCopyright->Des();
+        LanguageSpecificNumberConversion( text );
+        AddItemToListBoxL(*heading,*aFileDetails->iCopyright,aItemArray);
+        CleanupStack::PopAndDestroy(); // heading
+        }
+}
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::MakeOriginalArtistItemL
+// -----------------------------------------------------------------------------
+//
+void CMPFileDetailsDialog::MakeOriginalArtistItemL(CDesCArray* aItemArray,
+                                                   CMPFileDetails* aFileDetails)
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::MakeOriginalArtistItemL()"));
+
+    if (aFileDetails->iOriginalArtist)
+        {
+        HBufC* heading = StringLoader::LoadLC(R_MP_FILE_ARTIST_ORIGINAL_HEADING);
+        TPtr text = aFileDetails->iOriginalArtist->Des();
+        LanguageSpecificNumberConversion( text );
+        AddItemToListBoxL(*heading,*aFileDetails->iOriginalArtist,aItemArray);
+        CleanupStack::PopAndDestroy(); // heading
+        }
+}
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::MakeAlbumTrackItemL
+// -----------------------------------------------------------------------------
+//
+void CMPFileDetailsDialog::MakeAlbumTrackItemL(CDesCArray* aItemArray,
+                                               CMPFileDetails* aFileDetails)
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::MakeAlbumTrackItemL()"));
+
+    if (aFileDetails->iAlbumTrack)
+        {
+        HBufC* heading = StringLoader::LoadLC(R_MP_FILE_ALBUM_TRACK_HEADING);
+        TPtr text = aFileDetails->iAlbumTrack->Des();
+        LanguageSpecificNumberConversion( text );
+        AddItemToListBoxL(*heading,*aFileDetails->iAlbumTrack,aItemArray);
+        CleanupStack::PopAndDestroy(); // heading
+        }
+}
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::MakeGenreItemL
+// -----------------------------------------------------------------------------
+//
+void CMPFileDetailsDialog::MakeGenreItemL(CDesCArray* aItemArray,
+                                          CMPFileDetails* aFileDetails)
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::MakeGenreItemL()"));
+    if (aFileDetails->iGenre)
+        {
+        HBufC* heading = StringLoader::LoadLC(R_MP_FILE_GENRE_HEADING);
+        TPtr text = aFileDetails->iGenre->Des();
+
+        LanguageSpecificNumberConversion( text );
+        AddItemToListBoxL(*heading,*aFileDetails->iGenre,aItemArray);
+
+        CleanupStack::PopAndDestroy(); // heading
+        }
+}
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::MakeComposerItemL
+// -----------------------------------------------------------------------------
+//
+void CMPFileDetailsDialog::MakeComposerItemL(CDesCArray* aItemArray,
+                                             CMPFileDetails* aFileDetails)
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::MakeComposerItemL()"));
+
+    if (aFileDetails->iComposer)
+        {
+        HBufC* heading = StringLoader::LoadLC(R_MP_FILE_COMPOSER_HEADING);
+        TPtr text = aFileDetails->iComposer->Des();
+        LanguageSpecificNumberConversion( text );
+        AddItemToListBoxL(*heading,*aFileDetails->iComposer,aItemArray);
+        CleanupStack::PopAndDestroy(); // heading
+        }
+}
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::MakeAudioFileWebPageItemL
+// -----------------------------------------------------------------------------
+//
+void CMPFileDetailsDialog::MakeAudioFileWebPageItemL(
+        CDesCArray* aItemArray,
+        CMPFileDetails* aFileDetails )
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::MakeAudioFileWebPageItemL()"));
+
+    if (aFileDetails->iAudioFileWebPage)
+        {
+        HBufC* heading = StringLoader::LoadLC(R_MP_FILE_INFO_URL_HEADING);
+        TPtr text = aFileDetails->iAudioFileWebPage->Des();
+        LanguageSpecificNumberConversion( text );
+        AddItemToListBoxL(*heading,*aFileDetails->iAudioFileWebPage,aItemArray);
+        CleanupStack::PopAndDestroy(); // heading
+        }
+}
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::MakeCommentItemL
+// -----------------------------------------------------------------------------
+//
+void CMPFileDetailsDialog::MakeCommentItemL(CDesCArray* aItemArray,
+                                            CMPFileDetails* aFileDetails)
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::MakeCommentItemL()"));
+
+    if (aFileDetails->iComment)
+        {
+        HBufC* heading = StringLoader::LoadLC(R_MP_FILE_COMMENT_HEADING);
+        TPtr text = aFileDetails->iComment->Des();
+        LanguageSpecificNumberConversion( text );
+        AddItemToListBoxL(*heading,*aFileDetails->iComment,aItemArray);
+        CleanupStack::PopAndDestroy(); // heading
+        }
+}
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::MakeArtistItemL
+// -----------------------------------------------------------------------------
+//
+void CMPFileDetailsDialog::MakeArtistItemL(CDesCArray* aItemArray,
+                                           CMPFileDetails* aFileDetails)
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::MakeArtistItemL()"));
+
+    if (aFileDetails->iArtist)
+        {
+        HBufC* heading = StringLoader::LoadLC(R_MP_FILE_ARTIST_HEADING);
+        AddItemToListBoxL(*heading,*aFileDetails->iArtist,aItemArray);
+        CleanupStack::PopAndDestroy(); // heading
+        }
+}
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::MakeAlbumItemL
+// -----------------------------------------------------------------------------
+//
+void CMPFileDetailsDialog::MakeAlbumItemL(CDesCArray* aItemArray,
+                                          CMPFileDetails* aFileDetails)
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::MakeAlbumItemL()"));
+
+    if (aFileDetails->iAlbum)
+        {
+        HBufC* heading = StringLoader::LoadLC(R_MP_FILE_ALBUM_HEADING);
+        AddItemToListBoxL(*heading,*aFileDetails->iAlbum,aItemArray);
+        CleanupStack::PopAndDestroy(); // heading
+        }
+}
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::MakeYearItemL
+// -----------------------------------------------------------------------------
+//
+void CMPFileDetailsDialog::MakeYearItemL(CDesCArray* aItemArray,
+                                         CMPFileDetails* aFileDetails)
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::MakeYearItemL()"));
+
+    if (aFileDetails->iYear)
+        {
+        HBufC* heading = StringLoader::LoadLC(R_MP_FILE_YEAR_HEADING);
+        TPtr text = aFileDetails->iYear->Des();
+        LanguageSpecificNumberConversion( text );
+        AddItemToListBoxL(*heading,*aFileDetails->iYear,aItemArray);
+        CleanupStack::PopAndDestroy(); // heading
+        }
+}
+
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::DisplayDrmHeadingInfoL
+// -----------------------------------------------------------------------------
+//
+void CMPFileDetailsDialog::DisplayDrmHeadingInfoL(CDesCArray* aItemArray)
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::DisplayDrmHeadingInfoL()"));
+
+    //
+    // All DRM rights & constraints are handled & displayed by DRM component.
+    // So, MP only needs to display the Heading here.
+    //
+
+	//
+	// License
+	//   For details click 'View'
+	//
+    HBufC* heading = StringLoader::LoadLC(R_QTN_MP_DRM_LICENSE_HEADING);
+    HBufC* value = StringLoader::LoadLC(R_QTN_MP_DRM_DETAILS_VIEW);
+    AddItemToListBoxL(*heading,*value,aItemArray);
+    CleanupStack::PopAndDestroy(2); // heading && value
+}
+
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::LanguageSpecificNumberConversion
+// -----------------------------------------------------------------------------
+//
+void CMPFileDetailsDialog::LanguageSpecificNumberConversion( TDes& aText ) const
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::LanguageSpecificNumberConversion()"));
+
+    if ( AknTextUtils::DigitModeQuery( AknTextUtils::EDigitModeShownToUser ) )
+        {
+        AknTextUtils::DisplayTextLanguageSpecificNumberConversion( aText );
+        }
+}
+
+// Dummy implementations for audio callback
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::MapcInitComplete
+// -----------------------------------------------------------------------------
+//
+void CMPFileDetailsDialog::MapcInitComplete(
+        TInt aError,
+        const TTimeIntervalMicroSeconds& /*aDuration*/)
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::MapcInitComplete()"));
+
+    // Open completed, resume ExecuteLD(const TDesC& aFileName)
+    iResult = aError;
+    if ( iWait.IsStarted() )
+        {
+        iWait.AsyncStop();
+        }
+}
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::MapcPlayComplete
+// -----------------------------------------------------------------------------
+//
+void CMPFileDetailsDialog::MapcPlayComplete(TInt /*aError*/)
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::MapcPlayComplete()"));
+}
+
+
+// Dummy implementations for video callback
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::MvpuoOpenComplete
+// -----------------------------------------------------------------------------
+//
+void CMPFileDetailsDialog::MvpuoOpenComplete(TInt aError)
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::MvpuoOpenComplete()"));
+
+    // Open completed, resume ExecuteLD(const TDesC& aFileName)
+    iResult = aError;
+    if ( iWait.IsStarted() )
+        {
+        iWait.AsyncStop();
+        }
+}
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::MvpuoFrameReady
+// -----------------------------------------------------------------------------
+//
+void CMPFileDetailsDialog::MvpuoFrameReady( CFbsBitmap& /*aFrame*/,
+                                            TInt /*aError*/ )
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::MvpuoFrameReady()"));
+}
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::MvpuoPlayComplete
+// -----------------------------------------------------------------------------
+//
+void CMPFileDetailsDialog::MvpuoPlayComplete(TInt /*aError*/)
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::MvpuoPlayComplete()"));
+}
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::MvpuoPrepareComplete
+// -----------------------------------------------------------------------------
+//
+void CMPFileDetailsDialog::MvpuoPrepareComplete(TInt aError)
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::MvpuoPrepareComplete()"));
+
+    // Prepare completed, resume ExecuteLD(const TDesC& aFileName)
+    iResult = aError;
+    if ( iWait.IsStarted() )
+        {
+        iWait.AsyncStop();
+        }
+}
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::MvpuoEvent
+// -----------------------------------------------------------------------------
+//
+void CMPFileDetailsDialog::MvpuoEvent(const TMMFEvent& /*aEvent*/)
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::MvpuoEvent()"));
+}
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::FetchMetaDataL
+// -----------------------------------------------------------------------------
+//
+void CMPFileDetailsDialog::FetchMetaDataL( const TDesC& aFileName,
+                                           CMPFileDetails* aFileDetails )
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::FetchMetaDataL()"));
+
+    CMdaAudioPlayerUtility* audioPlayer = CMdaAudioPlayerUtility::NewL(*this);
+    CleanupStack::PushL( audioPlayer );
+    // Open audio player with the file.
+    audioPlayer->OpenFileL( aFileName );
+    // Wait open to complete. Active Scheduler is resumed, when the player is
+    // initialized. See CMPFileDetailsDialog::MapcInitComplete.
+    iWait.Start();
+
+    // iResult is updated according to error code in MapcInitComplete
+    if ( iResult )
+        {
+        // Get metadata
+        if( aFileDetails->iDrmProtected )
+            {
+            switch( aFileDetails->iDRMRightsStatus )
+                {
+                case EMediaPlayerFull:
+                case EMediaPlayerRestricted:
+                case KMediaPlayerWmdrmValid:
+                    {
+                    FetchAdditionalMetaDataL( aFileName, aFileDetails );
+                    break;
+                    }
+                case EMediaPlayerMissing:
+                case EMediaPlayerExpired:
+                case EMediaPlayerPreview:
+                case KMediaPlayerWmdrmExpired:
+                    {
+                    FetchDCFHeaderDataL( aFileName, aFileDetails );
+                    break;
+                    }
+                default:
+                    {
+                    // nothing to do
+                    break;
+                    }
+                }
+            }
+        else
+            {
+            FetchAdditionalMetaDataL( aFileName, aFileDetails );
+            }
+        CleanupStack::PopAndDestroy(); // audioPlayer
+        return;
+        }
+
+    // get audio file details
+    aFileDetails->iDurationInSeconds =
+            audioPlayer->Duration().Int64() / KOneSecond;
+
+    // Bitrate
+    TPckgBuf<TMMFAudioConfig> data;
+    const TMMFMessageDestinationPckg destinationPckg(
+            KUidInterfaceMMFAudioController );
+    TInt err = audioPlayer->CustomCommandSync( destinationPckg,
+                                           EMMFAudioControllerGetSourceBitRate,
+                                           KNullDesC8, KNullDesC8, data );
+    if ( !err )
+        {
+        aFileDetails->iBitrate = data().iSampleRate;
+        }
+
+    // Samplerate
+    err = audioPlayer->CustomCommandSync( destinationPckg,
+                                        EMMFAudioControllerGetSourceSampleRate,
+                                        KNullDesC8, KNullDesC8, data );
+    if ( !err )
+        {
+        aFileDetails->iSamplerate = data().iSampleRate;
+        }
+
+    CleanupStack::PopAndDestroy(); // audioPlayer
+
+    // get metadata
+    FetchAdditionalMetaDataL( aFileName, aFileDetails );
+}
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::FetchDrmDataL
+// -----------------------------------------------------------------------------
+//
+void CMPFileDetailsDialog::FetchDrmDataL( const TDesC& aFileName,
+                                          CMPFileDetails* aFileDetails )
+{
+        MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::FetchDrmDataL()"));
+
+    //
+    // Only 'aFileDetails->iDRMRightsStatus' is still needed to display additional meta data.
+    // Those additional meta data are obtained in FetchAdditionalMetaDataL() method.
+    // All other DRM related info (expire constraints, counts, valid from/until, etc.)
+    // are obtained and displayed by DRM Details component.
+    //
+    CDRMHelper* drmHelper = CDRMHelper::NewLC(*CCoeEnv::Static());
+    CMediaPlayerDrmHelper* mediaDrmHelper = CMediaPlayerDrmHelper::NewL(drmHelper);
+    CleanupStack::PushL(mediaDrmHelper);
+
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+    TInt64 size(0);
+#else
+    TInt size(0);
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+    TInt err(0);
+
+    if ( aFileDetails->iDetailsFileHandle.SubSessionHandle() )
+        err = aFileDetails->iDetailsFileHandle.Size( size );
+
+    if (!err && size )
+        mediaDrmHelper->LoadDrmUsageRightsInfoL(aFileDetails->iDetailsFileHandle);
+    else
+        {
+        RFs fs = CEikonEnv::Static()->FsSession();
+        TInt error = aFileDetails->iDetailsFileHandle.Open(fs, aFileName, EFileRead | EFileShareReadersOnly);
+        if (error)
+            error = aFileDetails->iDetailsFileHandle.Open(fs, aFileName, EFileRead | EFileShareAny);
+
+        if (!error)
+            mediaDrmHelper->LoadDrmUsageRightsInfoL(aFileDetails->iDetailsFileHandle);
+        else
+            mediaDrmHelper->LoadDrmUsageRightsInfoL(aFileName);
+        }
+
+    mediaDrmHelper->GetDrmUsageRightsStatus(aFileDetails->iDRMRightsStatus);
+
+    // cleanup
+    CleanupStack::PopAndDestroy(2); // drmHelper, mediaDrmHelper
+}
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::MakeProviderItemL
+// -----------------------------------------------------------------------------
+//
+void CMPFileDetailsDialog::MakeProviderItemL( CDesCArray* aItemArray,
+                                              CMPFileDetails* aFileDetails )
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::MakeProviderItemL()"));
+
+    if (aFileDetails->iProvider)
+        {
+        HBufC* heading = StringLoader::LoadLC(R_MP_FILE_PROVIDER_HEADING);
+        AddItemToListBoxL(*heading,*aFileDetails->iProvider,aItemArray);
+        CleanupStack::PopAndDestroy(); // heading
+        }
+}
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::MakeDescriptionItemL
+// -----------------------------------------------------------------------------
+//
+void CMPFileDetailsDialog::MakeDescriptionItemL( CDesCArray* aItemArray,
+                                                 CMPFileDetails* aFileDetails )
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::MakeDescriptionItemL()"));
+
+    if (aFileDetails->iDescription)
+        {
+        HBufC* heading = StringLoader::LoadLC(R_MP_FILE_DESCRIPTION_HEADING);
+        AddItemToListBoxL(*heading,*aFileDetails->iDescription,aItemArray);
+        CleanupStack::PopAndDestroy(); // heading
+        }
+}
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::FetchAdditionalMetaDataL
+// -----------------------------------------------------------------------------
+//
+void CMPFileDetailsDialog::FetchAdditionalMetaDataL( const TDesC& aFileName,
+                                                     CMPFileDetails* aFileDetails )
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::FetchAdditionalMetaDataL()"));
+
+    CMetaDataUtility *metaDataUtility = CMetaDataUtility::NewL();
+    CleanupStack::PushL( metaDataUtility );
+    TRAPD( err, metaDataUtility->OpenFileL( aFileName ) );
+    if( err == KErrNone ) // leaves if file in use
+        {
+        TInt count = metaDataUtility->MetaDataCount();
+        for(TInt i = 0; i < count; i++)
+            {
+            TMetaDataFieldId fieldId;
+            TPtrC field = metaDataUtility->MetaDataFieldsL().At( i, fieldId );
+            if( field != KNullDesC )
+                {
+                switch( fieldId )
+                    {
+                    case EMetaDataSongTitle:
+                        {
+                        SetFileDetailL( aFileDetails->iTitle, field );
+                        break;
+                        }
+                    case EMetaDataArtist:
+                        {
+                        SetFileDetailL( aFileDetails->iArtist, field );
+                        break;
+                        }
+                    case EMetaDataAlbum:
+                        {
+                        SetFileDetailL( aFileDetails->iAlbum, field );
+                        break;
+                        }
+                    case EMetaDataYear:
+                        {
+                        SetFileDetailL( aFileDetails->iYear, field );
+                        break;
+                        }
+                    case EMetaDataCopyright:
+                        {
+                        SetFileDetailL( aFileDetails->iCopyright, field );
+                        break;
+                        }
+                    case EMetaDataOriginalArtist:
+                        {
+                        SetFileDetailL( aFileDetails->iOriginalArtist, field );
+                        break;
+                        }
+                    case EMetaDataAlbumTrack:
+                        {
+                        SetFileDetailL( aFileDetails->iAlbumTrack, field );
+                        break;
+                        }
+                    case EMetaDataGenre:
+                        {
+                        SetFileDetailL( aFileDetails->iGenre, field );
+                        break;
+                        }
+                    case EMetaDataComposer:
+                        {
+                        SetFileDetailL( aFileDetails->iComposer, field );
+                        break;
+                        }
+                    case EMetaDataUserUrl:
+                    case EMetaDataUrl:     // (L616) fallthrough
+                        {
+                        SetFileDetailL( aFileDetails->iAudioFileWebPage, field );
+                        break;
+                        }
+                    case EMetaDataComment:
+                        {
+                        SetFileDetailL( aFileDetails->iComment, field );
+                        break;
+                        }
+                    default:
+                        {
+                        // nothing to do
+                        break;
+                        }
+                    }
+                }
+            }
+        }
+    CleanupStack::PopAndDestroy(); // metaDataUtility
+}
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::FetchDCFHeaderDataL
+// -----------------------------------------------------------------------------
+//
+void CMPFileDetailsDialog::FetchDCFHeaderDataL( const TDesC& aFileName,
+                                                CMPFileDetails* aFileDetails )
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::FetchDCFHeaderDataL()"));
+
+    TBuf <256> headerValue;
+    TInt err( KErrNone );
+    CContent* content = CContent::NewLC( aFileName );
+
+    // Content-Name
+    err = content->GetStringAttribute(ETitle, headerValue);
+    if( err == KErrNone )
+        {
+        SetFileDetailL( aFileDetails->iTitle, headerValue );
+        }
+
+    // Content-Vendor
+    err = content->GetStringAttribute(EContentVendor, headerValue);
+    if( err == KErrNone )
+        {
+        SetFileDetailL( aFileDetails->iProvider, headerValue );
+        }
+
+    // Content-Description
+    err = content->GetStringAttribute(EDescription, headerValue);
+    if( err == KErrNone )
+        {
+        SetFileDetailL( aFileDetails->iDescription, headerValue );
+        }
+
+    // clean up
+    CleanupStack::PopAndDestroy(); // content
+}
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::Is3gpFile
+// -----------------------------------------------------------------------------
+//
+TBool CMPFileDetailsDialog::Is3gpFile( const TDesC& aFileName,
+                                       CMPFileDetails* aFileDetails )
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::Is3gpFile()"));
+
+    TBool retVal( EFalse );
+    // File extension
+    if( aFileName.FindF( KExt3gpp ) != KErrNotFound ||
+        aFileName.FindF( KExtMp4 )  != KErrNotFound ||
+        aFileName.FindF( KExtM4a )  != KErrNotFound )
+        {
+        retVal = ETrue;
+        }
+
+    // Mimetype
+    if( !retVal && aFileDetails->iFormat )
+        {
+        TPtrC mime = aFileDetails->iFormat->Des();
+        if (mime == KDetaMime3gpp  ||
+            mime == KDetaMime3gpp2 ||
+            mime == KDetaMimeMp4)
+            {
+            retVal = ETrue;
+            }
+        }
+
+    return retVal;
+}
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::SetFileDetailL
+// -----------------------------------------------------------------------------
+//
+void CMPFileDetailsDialog::SetFileDetailL( HBufC*& aBuf, const TDesC& aDetail )
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::SetFileDetailL()"));
+
+    if( !aBuf && aDetail.Length() )
+        {
+        aBuf = aDetail.AllocL();
+        }
+}
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::SetFileDetailL
+// -----------------------------------------------------------------------------
+//
+void CMPFileDetailsDialog::SetFileDetailL( HBufC*& aBuf, const TDesC8& aDetail )
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::SetFileDetailL()"));
+
+    if( !aBuf && aDetail.Length())
+        {
+        aBuf = HBufC::NewL( aDetail.Length() );
+        aBuf->Des().Copy( aDetail );
+        }
+}
+
+// CMPFileDetailsDialog::Close
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CMPFileDetailsDialog::Close()
+{
+    MPX_ENTER_EXIT(_L("CMPFileDetailsDialog::Close()"));
+
+    if ( iPopupList )
+    {
+       iPopupList->CancelPopup();
+    }
+}
+
+// ============================ CMPDummyController ============================
+
+// -----------------------------------------------------------------------------
+// CMPDummyController::CMPDummyController
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CMPDummyController::CMPDummyController()
+{
+    MPX_ENTER_EXIT(_L("CMPDummyController::CMPDummyController()"));
+}
+
+// -----------------------------------------------------------------------------
+// CMPFileDetailsDialog::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CMPDummyController::ConstructL()
+{
+    MPX_ENTER_EXIT(_L("CMPDummyController::ConstructL()"));
+
+    CreateWindowL();
+    SetExtent(TPoint(), TSize());
+    ActivateL();
+    SetPointerCapture(ETrue);
+    ClaimPointerGrab(ETrue);
+}
+
+// -----------------------------------------------------------------------------
+// CMPDummyController::NewLC()
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CMPDummyController* CMPDummyController::NewLC()
+{
+    MPX_ENTER_EXIT(_L("CMPDummyController::NewLC()"));
+
+    CMPDummyController* self= new (ELeave) CMPDummyController();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+}
+
+// -----------------------------------------------------------------------------
+// CMPDummyController::~CMPDummyController
+// Destructor
+// -----------------------------------------------------------------------------
+//
+CMPDummyController::~CMPDummyController()
+{
+    MPX_ENTER_EXIT(_L("CMPDummyController::~CMPDummyController()"));
+
+    if (iCoeEnv && iEikonEnv->EikAppUi())
+        iEikonEnv->EikAppUi()->RemoveFromStack(this);
+}
+
+// -----------------------------------------------------------------------------
+// CMPDummyController::OfferKeyEventL
+// Absorbs all the key presses
+// -----------------------------------------------------------------------------
+//
+TKeyResponse CMPDummyController::OfferKeyEventL(
+        const TKeyEvent& /*aKeyEvent*/, TEventCode /*aType*/ )
+{
+    MPX_ENTER_EXIT(_L("CMPDummyController::OfferKeyEventL()"));
+    return EKeyWasConsumed;
+}
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filedetails/filedetailsdialog/src/MediaPlayerDrmHelper.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,410 @@
+/*
+* Copyright (c) 2002-2006 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:   DRM helper for Media files.*
+*/
+
+
+
+// INCLUDE FILES
+#include    <DRMHelper.h>
+#include    <bamdesca.h>
+#include    <bautils.h>
+#include    <coemain.h>
+#include    <StringLoader.h>
+#include    <aknnotewrappers.h>
+#include    <data_caging_path_literals.hrh>
+
+#include    "MediaPlayerDrmHelper.h"
+#include    <MPFileDetails.h>
+
+#include    <drmuihandling.h>
+#include    <drmautomatedusage.h>
+#include    <Oma2Agent.h>
+
+#include    "mpxvideo_debug.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CMediaPlayerDrmHelper::CMediaPlayerDrmHelper(aDrmHelper,aUIController)
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CMediaPlayerDrmHelper::CMediaPlayerDrmHelper(
+                          CDRMHelper* aDrmHelper,
+                          CMPVideoPlayerUIController* /*aUIController*/ )
+    : iDrmHelper(aDrmHelper)
+    , iEnv(CCoeEnv::Static())
+{
+    MPX_ENTER_EXIT(_L("CMediaPlayerDrmHelper::CMediaPlayerDrmHelper()"));
+}
+
+// -----------------------------------------------------------------------------
+// CMediaPlayerDrmHelper::CMediaPlayerDrmHelper(aDrmHelper)
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CMediaPlayerDrmHelper::CMediaPlayerDrmHelper( CDRMHelper* aDrmHelper )
+    : iDrmHelper(aDrmHelper)
+    , iEnv( CCoeEnv::Static() )
+{
+    MPX_ENTER_EXIT(_L("CMediaPlayerDrmHelper::CMediaPlayerDrmHelper()"));
+}
+
+// -----------------------------------------------------------------------------
+// CMediaPlayerDrmHelper::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CMediaPlayerDrmHelper::ConstructL()
+{
+    MPX_ENTER_EXIT(_L("CMediaPlayerDrmHelper::ConstructL()"));
+    iDrmUiHandling = DRM::CDrmUiHandling::NewL(iEnv);
+    iDrmUtility = &iDrmUiHandling->GetUtility();
+}
+
+// -----------------------------------------------------------------------------
+// CMediaPlayerDrmHelper::NewL(aDrmHelper,aUIController)
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CMediaPlayerDrmHelper*
+CMediaPlayerDrmHelper::NewL( CDRMHelper* aDrmHelper,
+                             CMPVideoPlayerUIController* aUIController )
+{
+    MPX_ENTER_EXIT(_L("CMediaPlayerDrmHelper::NewL()"));
+
+    CMediaPlayerDrmHelper* self =
+        new (ELeave) CMediaPlayerDrmHelper(aDrmHelper,aUIController);
+
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+
+    return self;
+}
+
+// -----------------------------------------------------------------------------
+// CMediaPlayerDrmHelper::NewL(aDrmHelper,aUIController)
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CMediaPlayerDrmHelper* CMediaPlayerDrmHelper::NewL( CDRMHelper* aDrmHelper )
+{
+    MPX_ENTER_EXIT(_L("CMediaPlayerDrmHelper::NewL()"));
+
+    CMediaPlayerDrmHelper* self =
+        new (ELeave) CMediaPlayerDrmHelper(aDrmHelper);
+
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+
+    return self;
+}
+
+// -----------------------------------------------------------------------------
+// CMediaPlayerDrmHelper::~CMediaPlayerDrmHelper
+// Destructor
+// -----------------------------------------------------------------------------
+//
+CMediaPlayerDrmHelper::~CMediaPlayerDrmHelper()
+{
+    MPX_ENTER_EXIT(_L("CMediaPlayerDrmHelper::~CMediaPlayerDrmHelper()"));
+
+    delete iInfoUrl;
+    delete iFileName;
+    delete iPreviewUri;
+    delete iRightsConstraints;
+    delete iDrmUiHandling;
+}
+
+// -----------------------------------------------------------------------------
+// CMediaPlayerDrmHelper::LoadDrmUsageRightsInfoL
+// -----------------------------------------------------------------------------
+//
+void
+CMediaPlayerDrmHelper::LoadDrmUsageRightsInfoL( const TDesC& aFileName )
+{
+    MPX_ENTER_EXIT(_L("CMediaPlayerDrmHelper::LoadDrmUsageRightsInfoL()"));
+
+
+    if ( BaflUtils::FileExists(iEnv->FsSession(), aFileName) )
+    {
+        iExpired = EFalse;
+        delete iInfoUrl;
+        iInfoUrl = NULL;
+        delete iPreviewUri;
+        iPreviewUri = NULL;
+        delete iRightsConstraints;
+        iRightsConstraints = NULL;
+        delete iFileName;
+        iFileName = NULL;
+
+        iFileName = aFileName.AllocL();
+
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+        RFile64 fileHandle;
+#else
+        RFile fileHandle;
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+        TUint fileMode = EFileShareReadersOrWriters |
+                         EFileStream |
+                         EFileRead;
+
+        CreateFileHandleLC( fileHandle, *iFileName, fileMode );
+        LoadDrmUsageRightsInfoL( fileHandle );
+        CleanupStack::PopAndDestroy(); // fileHandle
+    }
+    else
+    {
+        User::Leave(KErrNotFound);
+    }
+}
+
+// -----------------------------------------------------------------------------
+// CMediaPlayerDrmHelper::GetDrmUsageRightsStatus
+// -----------------------------------------------------------------------------
+//
+void
+CMediaPlayerDrmHelper::GetDrmUsageRightsStatus(TMediaPlayerRightsStatus& aStatus)
+{
+    MPX_ENTER_EXIT(_L("CMediaPlayerDrmHelper::GetDrmUsageRightsStatus()"));
+
+    if ( ! iProtected )
+    {
+        aStatus = EMediaPlayerFull;
+    }
+    // This check ensures that the non-OMA DRM is assigned the correct status.
+    // If content is not OMA DRM then currently the only other choice is WM DRM.
+    else if ( iProtected && ! iOMAProtected )
+    {
+        if ( iExpired )
+        {
+            aStatus = KMediaPlayerWmdrmExpired;
+        }
+        else
+        {
+            aStatus = KMediaPlayerWmdrmValid;
+        }
+    }
+    else if ( iExpired )
+    {
+        aStatus = EMediaPlayerExpired;
+    }
+    else if ( iRightsConstraints )
+    {
+        if ( iRightsConstraints->IsPreview() )
+        {
+            aStatus = EMediaPlayerPreview;
+        }
+        else if ( iRightsConstraints->FullRights() )
+        {
+            aStatus = EMediaPlayerFull;
+        }
+        else
+        {
+            TTime time;
+            TTime startTime;
+
+            time.HomeTime();
+            TInt error = GetDrmStartTime(startTime);
+
+            // Check that usage time has already started
+            if (!error && time < startTime)
+            {
+                aStatus = EMediaPlayerExpired;
+            }
+            else
+            {
+                aStatus = EMediaPlayerRestricted;
+            }
+        }
+    }
+    else
+    {
+        aStatus = EMediaPlayerMissing;
+    }
+
+    MPX_DEBUG(_L(
+        "CMediaPlayerDrmHelper::GetDrmUsageRightsStatus() ret %d"),
+        aStatus);
+}
+
+// -----------------------------------------------------------------------------
+// CMediaPlayerDrmHelper::GetDrmStartTime
+// -----------------------------------------------------------------------------
+//
+TInt CMediaPlayerDrmHelper::GetDrmStartTime(TTime& aStartTime)
+{
+    MPX_ENTER_EXIT(_L("CMediaPlayerDrmHelper::GetDrmStartTime()"));
+
+    TInt error = KErrNone;
+
+    if (!iProtected || !iOMAProtected)
+    {
+        error = KErrNotFound;
+    }
+    else if (iRightsConstraints)
+    {
+        TRAP(error, iRightsConstraints->GetStartTimeL(aStartTime));
+    }
+    else
+    {
+        error = KErrNotReady;
+    }
+
+    return error;
+}
+
+// -----------------------------------------------------------------------------
+// CMediaPlayerDrmHelper::DrmHelper
+// -----------------------------------------------------------------------------
+//
+CDRMHelper* CMediaPlayerDrmHelper::DrmHelper()
+{
+    MPX_ENTER_EXIT(_L("CMediaPlayerDrmHelper::DrmHelper()"));
+    return iDrmHelper;
+}
+
+// -----------------------------------------------------------------------------
+// CMediaPlayerDrmHelper::LoadDrmUsageRightsInfoL
+// -----------------------------------------------------------------------------
+//
+void CMediaPlayerDrmHelper::LoadDrmUsageRightsInfoL( 
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+                                                     RFile64& aFile )
+#else
+                                                     RFile& aFile )
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+{
+   MPX_ENTER_EXIT(_L("CMediaPlayerDrmHelper::LoadDrmUsageRightsInfoL()"));
+
+    iExpired = EFalse;
+    delete iInfoUrl;
+    iInfoUrl = NULL;
+    delete iPreviewUri;
+    iPreviewUri = NULL;
+    delete iRightsConstraints;
+    iRightsConstraints = NULL;
+    delete iFileName;
+    iFileName = NULL;
+
+    //
+    //  Get the agent information and protection status
+    //
+    TPtrC agentId;
+    DRM::TDrmProtectionStatus protectionStatus;
+    iDrmUtility->GetDrmInfoL( aFile, agentId, protectionStatus );
+    iProtected = ( protectionStatus == DRM::EUProtected );
+    iOMAProtected = ( agentId.Match(KOmaDrm2AgentName) != KErrNotFound );
+
+    // Check to make sure that DRM helper is accessed only for OMA DRM
+    if ( iProtected && iOMAProtected )
+    {
+        CDRMHelperRightsConstraints* ignore1 = NULL;
+        CDRMHelperRightsConstraints* ignore2 = NULL;
+        CDRMHelperRightsConstraints* ignore3 = NULL;
+
+        // No replacement for this currently available via DRM Utility
+        TRAPD( error, iDrmHelper->GetRightsDetailsL( aFile,
+                                                     ContentAccess::EPlay,
+                                                     iExpired,
+                                                     iDrmSendingAllowed,
+                                                     iRightsConstraints,
+                                                     ignore1,
+                                                     ignore2,
+                                                     ignore3 ) );
+
+        // Delete ignored constraints
+        delete ignore1;
+        ignore1 = NULL;
+        delete ignore2;
+        ignore2 = NULL;
+        delete ignore3;
+        ignore3 = NULL;
+
+        if ( error == KErrCANoPermission )
+        {
+            iExpired = ETrue;
+        }
+        else if (error != KErrCANoRights)
+        {
+            User::LeaveIfError( error );
+        }
+    }
+    // get the attributes for protected WMDRM content
+    else if ( iProtected && ! iOMAProtected )
+    {
+        CContent* content = CContent::NewLC(aFile);
+
+        TInt value;
+        TInt err;
+
+        err = content->GetAttribute( ECanPlay, value );
+
+        if ( err == KErrNone )
+        {
+            iExpired = ( ! value );
+            MPX_DEBUG(_L("   iExpired = %d"), iExpired);
+        }
+        else
+        {
+        MPX_DEBUG(_L("   ECanPlay failed"));
+        }
+
+        err = content->GetAttribute( EIsForwardable, value );
+
+        if ( err == KErrNone )
+        {
+            iDrmSendingAllowed = value;
+            MPX_DEBUG(_L("   iDrmSendingAllowed = %d"), iDrmSendingAllowed);
+        }
+        else
+        {
+        MPX_DEBUG(_L("   EIsForwardable failed"));
+        }
+
+        CleanupStack::PopAndDestroy( content );
+    }
+    else
+    {
+        iExpired = EFalse;
+        iDrmSendingAllowed = ETrue;
+    }
+}
+
+// -----------------------------------------------------------------------------
+// CMediaPlayerDrmHelper::CreateFileHandleLC
+// -----------------------------------------------------------------------------
+//
+void CMediaPlayerDrmHelper::CreateFileHandleLC( 
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+                                                RFile64& aHandle,
+#else
+                                                RFile& aHandle,
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+                                                const TDesC& aName,
+                                                TUint aFileMode )
+{
+    // Get the file server session
+    RFs fs = CEikonEnv::Static()->FsSession();
+    User::LeaveIfError(aHandle.Open(fs, aName, aFileMode));
+    CleanupClosePushL(aHandle);
+}
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filedetails/filedetailsdialog/src/mppopuplist.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,330 @@
+/*
+* 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:   CMPPopupList.cpp*
+*/
+
+
+// Version : %version: 15 %
+
+#include <aknpopuplayout.h>
+#include <eiklbx.h>
+#include <MPFileDetails.rsg>
+#include "mppopuplist.h"
+#include "mpxvideo_debug.h"
+
+
+#include <drmuihandling.h>
+#include <drmutility.h>
+#include <drmerrorhandling.h>
+using namespace DRM;
+
+
+// -----------------------------------------------------------------------------
+// CMPPopupList::NewL()
+// -----------------------------------------------------------------------------
+//
+CMPPopupList* CMPPopupList::NewL( CEikListBox* aListBox,
+                                  const TDesC& aFilePath,
+                                  TBool aDrmProtected,
+                                  TBool aReadingDCFOnly )
+{
+    MPX_ENTER_EXIT(_L("CMPPopupList::NewL()"));
+
+    CMPPopupList* self= new (ELeave) CMPPopupList();
+    CleanupStack::PushL(self);
+    self->ConstructL( aListBox, aFilePath, aDrmProtected, aReadingDCFOnly );
+    CleanupStack::Pop(self);
+    return self;
+}
+
+// -----------------------------------------------------------------------------
+// CMPPopupList::NewL()
+// -----------------------------------------------------------------------------
+//
+CMPPopupList* CMPPopupList::NewL( CEikListBox* aListBox,
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+                                  RFile64& aFile,
+#else
+                                  RFile& aFile,
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+                                  TBool aDrmProtected,
+                                  TBool aReadingDCFOnly )
+{
+    MPX_DEBUG(_L("CMPPopupList::NewL (%d)"),aDrmProtected);
+
+    CMPPopupList* self= new (ELeave) CMPPopupList();
+    CleanupStack::PushL(self);
+    self->ConstructL( aListBox, aFile, aDrmProtected, aReadingDCFOnly );
+    CleanupStack::Pop(self);
+    return self;
+}
+
+// -----------------------------------------------------------------------------
+// CMPPopupList::ConstructL()
+// -----------------------------------------------------------------------------
+//
+void CMPPopupList::ConstructL( CEikListBox* aListBox,
+							   const TDesC& aFilePath,
+							   TBool aDrmProtected,
+							   TBool aReadingDCFOnly )
+{
+    MPX_ENTER_EXIT(_L("CMPPopupList::ConstructL()"));
+
+    iFilePath = aFilePath.AllocL();
+    iDrmProtected = aDrmProtected;
+    iReadingDCFOnly = aReadingDCFOnly;
+    iListBox = aListBox;
+    TInt cbaResource;
+
+    //
+	// Construct the softkeys corresponding to Drm or non-Drm status
+	//
+    if ( iDrmProtected && !iReadingDCFOnly )
+    {
+		cbaResource = R_MP_DRM_FILE_DETAILS_SOFTKEYS_OK_VIEW__OK;
+	}
+	else
+	{
+		cbaResource = R_AVKON_SOFTKEYS_OK_EMPTY__OK;
+	}
+
+	//
+	// let base class construct the pop-up list
+	//
+    CAknPopupList::ConstructL( aListBox, cbaResource, AknPopupLayouts::EMenuDoubleWindow );
+}
+
+// CMPPopupList::ConstructL()
+// -----------------------------------------------------------------------------
+//
+void CMPPopupList::ConstructL( CEikListBox* aListBox,
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+                               RFile64& aFile,
+#else
+                               RFile& aFile,
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+                               TBool aDrmProtected,
+                               TBool aReadingDCFOnly )
+{
+    MPX_ENTER_EXIT(_L("CMPPopupList::ConstructL()"));
+
+    User::LeaveIfError( iFileHandle.Duplicate( aFile ) );
+
+    iDrmProtected = aDrmProtected;
+    iReadingDCFOnly = aReadingDCFOnly;
+    iListBox = aListBox;
+    TInt cbaResource;
+
+    //
+    // Construct the softkeys corresponding to Drm or non-Drm status
+    //
+    if ( iDrmProtected && !iReadingDCFOnly )
+    {
+        cbaResource = R_MP_DRM_FILE_DETAILS_SOFTKEYS_OK_VIEW__OK;
+    }
+    else
+    {
+        cbaResource = R_AVKON_SOFTKEYS_OK_EMPTY__OK;
+    }
+
+    //
+    // let base class construct the pop-up list
+    //
+    CAknPopupList::ConstructL( aListBox, cbaResource, AknPopupLayouts::EMenuDoubleWindow );
+}
+
+// -----------------------------------------------------------------------------
+// CMPPopupList::~CMPPopupList
+// -----------------------------------------------------------------------------
+//
+CMPPopupList::~CMPPopupList()
+{
+MPX_ENTER_EXIT(_L("CMPPopupList::~CMPPopupList()"));
+
+    if( iFileHandle.SubSessionHandle() )
+    {
+        iFileHandle.Close();
+    }
+
+    if( iFilePath )
+    {
+        delete iFilePath;
+    }
+}
+
+// -----------------------------------------------------------------------------
+// CMPPopupList::HandleListBoxEventL
+// -----------------------------------------------------------------------------
+//
+void CMPPopupList::HandleListBoxEventL( CEikListBox*  /* aListBox   */ ,
+                                        TListBoxEvent /* aEventType */ )
+{
+MPX_ENTER_EXIT(_L("CMPPopupList::HandleListBoxEventL()"));
+
+    //
+	// Do nothing except update softkeys according to DRM or non-DRM status
+    //
+    UpdateSoftkeysL();
+}
+
+// -----------------------------------------------------------------------------
+// CMPPopupList::UpdateSoftkeysL
+// -----------------------------------------------------------------------------
+//
+void CMPPopupList::UpdateSoftkeysL()
+{
+  MPX_ENTER_EXIT(_L("CMPPopupList::UpdateSoftkeysL()"));
+
+    if ( iDrmProtected &&
+		 !iReadingDCFOnly )
+    {
+        //
+        // When item focus in pop-up details dlg is on Drm item (i.e. License),
+        // LSK is 'Ok' and RSK is 'View'
+        //
+        ButtonGroupContainer()->SetCommandSetL(R_MP_DRM_FILE_DETAILS_SOFTKEYS_OK_VIEW__OK);
+    }
+    else
+    {
+        //
+        // When item focus in pop-up details dlg is on all other non-Drm items (i.e. Title),
+        // LSK is 'Ok' and RSK is empty
+        //
+        ButtonGroupContainer()->SetCommandSetL(R_AVKON_SOFTKEYS_OK_EMPTY__OK);
+    }
+}
+
+// -----------------------------------------------------------------------------
+// CMPPopupList::LaunchDrmInfoL
+// -----------------------------------------------------------------------------
+//
+void CMPPopupList::LaunchDrmInfoL()
+{
+    MPX_ENTER_EXIT(_L("CMPPopupList::LaunchDrmInfoL()"));
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+    TInt64 size(0);
+#else
+    TInt size(0);
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+    TInt err(0);
+    TInt handleExists(0);
+
+    if ( iFileHandle.SubSessionHandle() )
+    {
+        err = iFileHandle.Size( size );
+    }
+
+    handleExists =(!err && size )? ETrue:EFalse;
+
+    if(!handleExists)
+    {
+        TUint fileMode = EFileShareReadersOrWriters | EFileStream | EFileRead;
+        RFs fs = CEikonEnv::Static()->FsSession();
+
+        User::LeaveIfError(iFileHandle.Open(fs, iFilePath->Des() , fileMode));
+    }
+
+    if ( iDrmProtected && ( handleExists || iFilePath ) )
+    {
+        CDrmUiHandling* drmUiHandler = CDrmUiHandling::NewLC();
+        TRAPD( err, drmUiHandler->ShowDetailsViewL(iFileHandle) );
+
+        if( err != KErrNone )
+        {
+            drmUiHandler->GetErrorHandler().HandleErrorL( iFileHandle,
+                                                          ContentAccess::EPlay,
+                                                          err,
+                                                          NULL);
+        }
+        CleanupStack::PopAndDestroy(1); //  drmUiHandler
+    }
+}
+
+// -----------------------------------------------------------------------------
+// CMPPopupList::ProcessCommandL
+// -----------------------------------------------------------------------------
+//
+void CMPPopupList::ProcessCommandL(TInt aCommandId)
+{
+	MPX_ENTER_EXIT(_L("CMPPopupList::ProcessCommandL()"));
+
+	//
+    // Respond to softkey events.
+	// MP Popup only handles the 'View' softkey event,
+	// all other softkey events are handled by Avkon Pop-up
+	//
+	switch (aCommandId)
+	{
+		case EAknSoftkeyView:
+            LaunchDrmInfoL();
+		    break;
+		default:
+			CAknPopupList::ProcessCommandL(aCommandId);
+			break;
+	}
+}
+
+// -----------------------------------------------------------------------------
+// CMPPopupList::OfferKeyEventL
+// -----------------------------------------------------------------------------
+//
+TKeyResponse CMPPopupList::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
+{
+	MPX_ENTER_EXIT(_L("CMPPopupList::OfferKeyEventL()"));
+
+    TKeyResponse ret = EKeyWasNotConsumed;
+
+    if(aKeyEvent.iCode == EKeyEscape)
+    {
+        CancelPopup();
+    }
+    else
+    {
+        // 
+        // pass all remaining events to the list box class
+        //
+        ret = iListBox->OfferKeyEventL(aKeyEvent, aType);
+        
+        //
+        // Update softkeys according to DRM or non-DRM status
+        //
+        UpdateSoftkeysL();
+    }	
+
+    return ret;
+}
+
+// -----------------------------------------------------------------------------
+// CMPPopupList::ReConstructDrmSoftkeysL
+// -----------------------------------------------------------------------------
+//
+void CMPPopupList::ReConstructDrmSoftkeysL( TBool aDrmProtected )
+{
+    MPX_ENTER_EXIT(_L("CMPPopupList::ReConstructDrmSoftkeysL()"));
+
+    //
+    // This method is needed to re-evaluate DRM protection since it may
+    // be inaccurate for playlist during construction time.
+    // Hence, the related softkeys need to be re-constructed here.
+    //
+
+    iDrmProtected = aDrmProtected;
+
+    if ( iDrmProtected && !iReadingDCFOnly )
+    {
+        ButtonGroupContainer()->SetCommandSetL(R_MP_DRM_FILE_DETAILS_SOFTKEYS_OK_VIEW__OK);
+    }
+}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filedetails/filedetailsplugin/data/filedetailsplugin.rss	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,45 @@
+/*
+* 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 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:   Resource file for file details plugin
+*
+*/
+
+
+#include <ecom/registryinfo.rh>
+#include <filedetailspluginif.hrh>
+#include "filedetailsplugin.hrh"
+
+RESOURCE REGISTRY_INFO registry_info
+    {
+    dll_uid = KFileDetailsPluginDllUid;    
+
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            interface_uid = KFileDetailsPluginInterfaceUid;
+            implementations = 
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = KFileDetailsPluginImplementationUid;
+                    version_no         = 1;
+                    display_name       = "";
+                    default_data       = "";
+                    opaque_data        = "";
+                    }
+                };
+            }
+        };
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filedetails/filedetailsplugin/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,28 @@
+/*
+* 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 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:
+*
+*/
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/filedetailsplugin.iby  CORE_APP_LAYER_IBY_EXPORT_PATH(filedetailsplugin.iby)
+
+PRJ_MMPFILES
+filedetailsplugin.mmp
+
+PRJ_TESTMMPFILES
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filedetails/filedetailsplugin/group/filedetailsplugin.mmp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,49 @@
+/*
+* 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 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:   This is a project specification file for filedetailsplugin
+*
+*/
+
+
+
+#include <platform_paths.hrh>
+#include <bldvariant.hrh>
+#include "../inc/filedetailsplugin.hrh"
+
+TARGET          filedetailsplugin.dll
+TARGETTYPE      PLUGIN
+UID             0x10009D8D KFileDetailsPluginDllUid
+CAPABILITY      CAP_ECOM_PLUGIN DRM
+
+USERINCLUDE     ../inc
+
+APP_LAYER_SYSTEMINCLUDE 
+
+SOURCEPATH      ../src
+SOURCE          filedetailsimplementationproxy.cpp
+SOURCE          filedetailsplugin.cpp
+
+SOURCEPATH      ../data
+START RESOURCE  filedetailsplugin.rss
+END
+
+LIBRARY         ecom.lib
+LIBRARY         euser.lib
+LIBRARY         efsrv.lib
+LIBRARY         bafl.lib
+LIBRARY         flogger.lib
+LIBRARY         estor.lib
+LIBRARY         mpxcommon.lib
+LIBRARY         mpfiledetailsdialog.lib
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filedetails/filedetailsplugin/inc/filedetailsplugin.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,63 @@
+/*
+* 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 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 FILEDETAILSPLUGIN_H
+#define FILEDETAILSPLUGIN_H
+
+// INCLUDES
+#include <e32std.h>
+#include <filedetailspluginif.h>
+
+
+// CLASS DECLARATION    
+/**
+*  Implementation of the file details plugin
+*
+*/
+NONSHARABLE_CLASS( CFileDetailsPlugin ) : public CFileDetailsPluginIF 
+    {
+    public:// Constructors and destructor
+
+        /**
+        * Two-phased constructor.        
+        */
+        static CFileDetailsPlugin* NewL();
+        
+        /**
+        * C+ destructor
+        */
+        virtual ~CFileDetailsPlugin();        
+   
+    public: // From CFileDetailsPluginIF
+
+        /**
+           * Shows file details based on given mpx media
+           * @param    aDetails  Already constructed details to be shown    
+           * @return   None
+           */  
+        void ShowFileDetailsL( const CMPXMedia& aMedia );
+
+    private:// Constructors and destructor
+
+        /**
+        * C++ constructor
+        */
+        CFileDetailsPlugin();
+        
+    };
+
+#endif // FILEDETAILSPLUGIN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filedetails/filedetailsplugin/inc/filedetailsplugin.hrh	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,30 @@
+/*
+* 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 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: File details plug-in constants.
+*/
+
+#ifndef FILEDETAILSPLUGIN_HRH
+#define FILEDETAILSPLUGIN_HRH
+
+/**
+ * Plugin implementation UID
+ */
+#define KFileDetailsPluginImplementationUid 0x20029FCB
+
+/**
+ * Plugin DLL UID
+ */
+#define KFileDetailsPluginDllUid 0x2002A509
+
+#endif // FILEDETAILSPLUGIN_HRH
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filedetails/filedetailsplugin/rom/filedetailsplugin.iby	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,28 @@
+/*
+* 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 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:  IBY for filedetailsplugin.dll
+*
+*/
+
+// Version : %version: 1 %
+
+
+#ifndef FILEDETAILSPLUGIN_IBY
+#define FILEDETAILSPLUGIN_IBY
+
+#include <data_caging_paths_for_iby.hrh>
+
+ECOM_PLUGIN( filedetailsplugin.dll, filedetailsplugin.rsc )
+
+#endif // FILEDETAILSPLUGIN_IBY
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filedetails/filedetailsplugin/src/filedetailsimplementationproxy.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,46 @@
+/*
+* 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 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:   ECOM plugin implementation proxy*
+*/
+
+
+// INCLUDE FILES
+#include <ecom/implementationproxy.h>
+#include "filedetailsplugin.h"
+#include "filedetailsplugin.hrh"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// The list of implementations
+// ---------------------------------------------------------------------------
+//
+const TImplementationProxy ImplementationTable[] = 
+    { 
+    IMPLEMENTATION_PROXY_ENTRY( 
+        KFileDetailsPluginImplementationUid, 
+        CFileDetailsPlugin::NewL ) 
+    };
+
+// ---------------------------------------------------------------------------
+// The proxy of implementations
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(
+    TInt& aTableCount )
+    {
+    aTableCount = 
+        sizeof( ImplementationTable ) / sizeof( TImplementationProxy );
+    return ImplementationTable;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filedetails/filedetailsplugin/src/filedetailsplugin.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,149 @@
+/*
+* 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 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 of file details plugin*
+*/
+#include <MPFileDetailsDialog.h>
+#include <MPFileDetails.h>
+#include "filedetailsplugin.h"
+#include <mpxmediageneraldefs.h>
+#include <mpxmediageneralextdefs.h>
+#include <mpxmedia.h>
+#include <mpxmediavideodefs.h>
+#include <vcxmyvideosdefs.h>
+
+const TInt KThousandNotKilobyte = 1000;
+
+// -----------------------------------------------------------------------------
+// CFileDetailsPlugin::NewL
+//
+// -----------------------------------------------------------------------------
+//
+CFileDetailsPlugin* CFileDetailsPlugin::NewL()
+    {
+    CFileDetailsPlugin* self =
+            new (ELeave) CFileDetailsPlugin();
+
+    return self;        
+    }
+
+// -----------------------------------------------------------------------------
+// CFileDetailsPlugin::CFileDetailsPlugin
+//
+// -----------------------------------------------------------------------------
+//
+CFileDetailsPlugin::CFileDetailsPlugin()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CFileDetailsPlugin::~CFileDetailsPlugin
+//
+// -----------------------------------------------------------------------------
+//  
+CFileDetailsPlugin::~CFileDetailsPlugin()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CFileDetailsPlugin::~CFileDetailsPlugin
+//
+// -----------------------------------------------------------------------------
+//  
+void CFileDetailsPlugin::ShowFileDetailsL( const CMPXMedia& aMedia )
+    {  
+    CMPFileDetails* details = new (ELeave) CMPFileDetails();
+    CleanupStack::PushL( details );
+    
+    //File path    
+    if ( aMedia.IsSupported( KMPXMediaGeneralUri ) )
+        {
+        details->iFilePath = aMedia.ValueText( KMPXMediaGeneralUri ).AllocL();                
+        }
+    
+    //Name    
+    if ( aMedia.IsSupported( KMPXMediaGeneralTitle ) )
+        {
+        details->iTitle = aMedia.ValueText( KMPXMediaGeneralTitle ).AllocL();                
+        }
+    else if ( details->iFilePath )
+        {
+        details->iTitle = details->iFilePath->AllocLC();
+        }
+        
+    //Duration
+    if ( aMedia.IsSupported( KVcxMediaMyVideosDuration ) )
+        {
+        TReal32 length = *(aMedia.Value<TReal32>( KVcxMediaMyVideosDuration ));
+        if ( length > 0 )
+            {
+            details->iDurationInSeconds = static_cast<TUint>( length );                
+            }   
+        }
+    
+    //File size
+    if ( aMedia.IsSupported( KMPXMediaGeneralExtSizeInt64 ) )
+       {
+       details->iSize = *(aMedia.Value<TInt64>( KMPXMediaGeneralExtSizeInt64 ));           
+       }
+    
+    //Copyright
+    if ( aMedia.IsSupported( KMPXMediaGeneralCopyright ) )
+        {
+        details->iCopyright = aMedia.ValueText( KMPXMediaGeneralCopyright ).AllocL();        
+        }
+    
+    //MIME
+    if ( aMedia.IsSupported( KMPXMediaGeneralMimeType ) )
+        {
+        details->iFormat = aMedia.ValueText( KMPXMediaGeneralMimeType ).AllocL();        
+        }
+    
+    // File creation date
+    if ( aMedia.IsSupported( KMPXMediaGeneralDate ) )
+        {        
+        details->iTime = *aMedia.Value<TTime>( KMPXMediaGeneralDate ) ;                
+        }
+    
+    // Bit rate
+    if ( aMedia.IsSupported( KMPXMediaVideoBitRate ) )
+        {    
+        // Multiplied by 1k as the value provided by MDS is kbps and file
+        // details dialog assumes it get bps        
+        details->iBitrate = *aMedia.Value<TUint16>( KMPXMediaVideoBitRate ) * KThousandNotKilobyte ;                
+        }
+    
+    // Height
+    if ( aMedia.IsSupported( KMPXMediaVideoHeight ) )
+        { 
+        details->iResolutionHeight = *aMedia.Value<TUint16>( KMPXMediaVideoHeight );                
+        }
+    
+    // Width
+    if ( aMedia.IsSupported( KMPXMediaVideoWidth ) )
+        {
+        details->iResolutionWidth = *aMedia.Value<TUint16>( KMPXMediaVideoWidth );                
+        }
+    
+    //Artist    
+   if ( aMedia.IsSupported( KMPXMediaVideoArtist ) )
+       {
+       details->iArtist = aMedia.ValueText( KMPXMediaVideoArtist ).AllocL();                
+       } 
+
+    // Show details dialog
+    CMPFileDetailsDialog* detailsDialog = CMPFileDetailsDialog::NewL(); 
+    detailsDialog->ExecuteLD( details );
+
+    CleanupStack::PopAndDestroy( details );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,75 @@
+/*
+* 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 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:   Build information file for project video.*
+*/
+
+
+// Version : %version: 31 %
+
+
+#include <bldvariant.hrh>
+#include <platform_paths.hrh> // for conf file export macros
+
+/**
+ * VideoCenter domain api
+ */
+#include "../videoplayer_plat/group/bld.inf"
+
+/**
+ * Videofeeds
+ */
+#include "../videofeeds/group/bld.inf"
+
+/**
+ * My Videos as MPX plugin and view or as separate app and view
+ */
+#include "../videocollection/group/bld.inf"
+
+/**
+ * Mediasettings
+ */
+#include "../mediasettings/group/bld.inf"
+
+/* 
+*  Projects for playback views/plugins
+*/
+
+/**
+ * File details plugin
+ */
+#include "../filedetails/filedetailsplugin/group/bld.inf"
+
+
+/**
+ * File details dialog
+ */
+#include "../filedetails/filedetailsdialog/group/bld.inf"
+
+
+/*
+ *  video player app collection
+ */
+#include "../videoplayerapp/group/bld.inf"
+
+/*
+ *  mpx video playback plugins collection
+ */
+#include "../videoplayback/group/bld.inf"
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/IptvDebug.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,306 @@
+/*
+* Copyright (c) 2004-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:    Helper class for serial or file tracing of Video Center.*
+*/
+
+
+
+
+#ifndef IPTVDEBUG_H
+#define IPTVDEBUG_H
+
+#include <flogger.h>
+
+// Define logging level here
+
+// Minimum log output
+#define IPTV_HIGH_LEVEL_TRACES
+
+// Medium log output
+#define IPTV_MIDDLE_LEVEL_TRACES
+
+// Maximum log output
+#define IPTV_LOW_LEVEL_TRACES
+
+
+/*
+-----------------------------------------------------------------------------
+
+	LOGGING MACROs
+
+	USE THESE MACROS IN YOUR CODE
+
+	Usage:
+	
+	Example: IPTVLOGSTRING_HIGH_LEVEL ("Test");
+	Example: IPTVLOGSTRING2_HIGH_LEVEL ("Test %d", aValue);
+	Example: IPTVLOGSTRING3_HIGH_LEVEL ("Test %d %d", aValue1, aValue2);
+	Example: IPTVLOGSTRING4_HIGH_LEVEL ("Test %d %d %d", aValue1, aValue2, aValue3);
+
+	Example: IPTV_LOG_STR_DESC_HIGH_LEVEL (own_desc);
+	Example: IPTV_LOG_STR_DESC2_HIGH_LEVEL (own_desc, aValue));
+	Example: IPTV_LOG_STR_DESC3_HIGH_LEVEL (own_desc, aValue, aValue2);
+	Example: IPTV_LOG_STR_DESC4_HIGH_LEVEL (own_desc, aValue, aValue2, aValue3);
+
+-----------------------------------------------------------------------------
+*/
+
+
+#ifdef IPTV_HIGH_LEVEL_TRACES
+
+#define IPTVLOGTEXT_HIGH_LEVEL(AAAA)   IPTV_LOGTEXT(AAAA)
+#define IPTVLOGSTRING_HIGH_LEVEL(AAAA) 	IPTV_LOGSTRING(AAAA) 
+#define IPTVLOGSTRING2_HIGH_LEVEL(AAAA,BBBB) 	IPTV_LOGSTRING2(AAAA,BBBB) 
+#define IPTVLOGSTRING3_HIGH_LEVEL(AAAA,BBBB,CCCC)   IPTV_LOGSTRING3(AAAA,BBBB,CCCC) 
+#define IPTVLOGSTRING4_HIGH_LEVEL(AAAA,BBBB,CCCC,DDDD)   IPTV_LOGSTRING4(AAAA,BBBB,CCCC,DDDD) 
+
+#define IPTV_LOG_STR_DESC_HIGH_LEVEL(AAAA) 	IPTV_LOG_STR_DESC(AAAA) 
+#define IPTV_LOG_STR_DESC2_HIGH_LEVEL(AAAA,BBBB) 	IPTV_LOG_STR_DESC2(AAAA,BBBB) 
+#define IPTV_LOG_STR_DESC3_HIGH_LEVEL(AAAA,BBBB,CCCC)   IPTV_LOG_STR_DESC3(AAAA,BBBB,CCCC) 
+#define IPTV_LOG_STR_DESC4_HIGH_LEVEL(AAAA,BBBB,CCCC,DDDD)   IPTV_LOG_STR_DESC4(AAAA,BBBB,CCCC,DDDD) 
+
+#else
+
+#define IPTVLOGTEXT_HIGH_LEVEL(AAAA)
+#define IPTVLOGSTRING_HIGH_LEVEL(AAAA)
+#define IPTVLOGSTRING2_HIGH_LEVEL(AAAA,BBBB)
+#define IPTVLOGSTRING3_HIGH_LEVEL(AAAA,BBBB,CCCC)
+#define IPTVLOGSTRING4_HIGH_LEVEL(AAAA,BBBB,CCCC,DDDD)
+
+#define IPTV_LOG_STR_DESC_HIGH_LEVEL(AAAA)
+#define IPTV_LOG_STR_DESC2_HIGH_LEVEL(AAAA,BBBB)
+#define IPTV_LOG_STR_DESC3_HIGH_LEVEL(AAAA,BBBB,CCCC)
+#define IPTV_LOG_STR_DESC4_HIGH_LEVEL(AAAA,BBBB,CCCC,DDDD)
+
+#endif
+
+
+#ifdef IPTV_MIDDLE_LEVEL_TRACES
+#define TFLOGTEXT_MIDDLE_LEVEL(AAAA) IPTV_LOGTEXT(AAAA)
+#define IPTVLOGSTRING_MIDDLE_LEVEL(AAAA) IPTV_LOGSTRING(AAAA)
+#define IPTVLOGSTRING2_MIDDLE_LEVEL(AAAA,BBBB) IPTV_LOGSTRING2(AAAA,BBBB)
+#define IPTVLOGSTRING3_MIDDLE_LEVEL(AAAA,BBBB,CCCC) IPTV_LOGSTRING3(AAAA,BBBB,CCCC)
+#define IPTVLOGSTRING4_MIDDLE_LEVEL(AAAA,BBBB,CCCC,DDDD) IPTV_LOGSTRING4(AAAA,BBBB,CCCC,DDDD)
+
+#define IPTV_LOG_STR_DESC_MIDDLE_LEVEL(AAAA) 	IPTV_LOG_STR_DESC(AAAA) 
+#define IPTV_LOG_STR_DESC2_MIDDLE_LEVEL(AAAA,BBBB) 	IPTV_LOG_STR_DESC2(AAAA,BBBB) 
+#define IPTV_LOG_STR_DESC3_MIDDLE_LEVEL(AAAA,BBBB,CCCC)   IPTV_LOG_STR_DESC3(AAAA,BBBB,CCCC) 
+#define IPTV_LOG_STR_DESC4_MIDDLE_LEVEL(AAAA,BBBB,CCCC,DDDD)   IPTV_LOG_STR_DESC4(AAAA,BBBB,CCCC,DDDD) 
+
+#else
+
+#define TFLOGTEXT_MIDDLE_LEVEL(AAAA)
+#define IPTVLOGSTRING_MIDDLE_LEVEL(AAAA)
+#define IPTVLOGSTRING2_MIDDLE_LEVEL(AAAA,BBBB)
+#define IPTVLOGSTRING3_MIDDLE_LEVEL(AAAA,BBBB,CCCC)
+#define IPTVLOGSTRING4_MIDDLE_LEVEL(AAAA,BBBB,CCCC,DDDD)
+
+#define IPTV_LOG_STR_DESC_MIDDLE_LEVEL(AAAA)
+#define IPTV_LOG_STR_DESC2_MIDDLE_LEVEL(AAAA,BBBB)
+#define IPTV_LOG_STR_DESC3_MIDDLE_LEVEL(AAAA,BBBB,CCCC)
+#define IPTV_LOG_STR_DESC4_MIDDLE_LEVEL(AAAA,BBBB,CCCC,DDDD)
+
+#endif
+	    
+
+#ifdef IPTV_LOW_LEVEL_TRACES
+
+#define IPTVLOGTEXT_LOW_LEVEL(AAAA)    IPTV_LOGTEXT(AAAA)
+#define IPTVLOGSTRING_LOW_LEVEL(AAAA)    IPTV_LOGSTRING(AAAA)
+#define IPTVLOGSTRING2_LOW_LEVEL(AAAA,BBBB)    IPTV_LOGSTRING2(AAAA,BBBB)
+#define IPTVLOGSTRING3_LOW_LEVEL(AAAA,BBBB,CCCC)    IPTV_LOGSTRING3(AAAA,BBBB,CCCC)
+#define IPTVLOGSTRING4_LOW_LEVEL(AAAA,BBBB,CCCC,DDDD)    IPTV_LOGSTRING4(AAAA,BBBB,CCCC,DDDD)
+
+#define IPTV_LOG_STR_DESC_LOW_LEVEL(AAAA) 	IPTV_LOG_STR_DESC(AAAA) 
+#define IPTV_LOG_STR_DESC2_LOW_LEVEL(AAAA,BBBB) 	IPTV_LOG_STR_DESC2(AAAA,BBBB) 
+#define IPTV_LOG_STR_DESC3_LOW_LEVEL(AAAA,BBBB,CCCC)   IPTV_LOG_STR_DESC3(AAAA,BBBB,CCCC) 
+#define IPTV_LOG_STR_DESC4_LOW_LEVEL(AAAA,BBBB,CCCC,DDDD)   IPTV_LOG_STR_DESC4(AAAA,BBBB,CCCC,DDDD) 
+
+#else
+
+#define IPTVLOGTEXT_LOW_LEVEL(AAAA)
+#define IPTVLOGSTRING_LOW_LEVEL(AAAA)
+#define IPTVLOGSTRING2_LOW_LEVEL(AAAA,BBBB)
+#define IPTVLOGSTRING3_LOW_LEVEL(AAAA,BBBB,CCCC)
+#define IPTVLOGSTRING4_LOW_LEVEL(AAAA,BBBB,CCCC,DDDD)
+
+#define IPTV_LOG_STR_DESC_LOW_LEVEL(AAAA)
+#define IPTV_LOG_STR_DESC2_LOW_LEVEL(AAAA,BBBB)
+#define IPTV_LOG_STR_DESC3_LOW_LEVEL(AAAA,BBBB,CCCC)
+#define IPTV_LOG_STR_DESC4_LOW_LEVEL(AAAA,BBBB,CCCC,DDDD)
+
+#endif
+
+
+/* 
+-----------------------------------------------------------------------------
+
+	LOG SELECTION
+
+-----------------------------------------------------------------------------
+*/
+
+
+// 0 = No logging, 
+// 1 = Flogger, 
+// 2 = RDebug
+
+
+#ifndef _DEBUG
+
+// UREL BUILD:
+#define IPTV_LOGGING_METHOD  0   // No logging in UREL builds
+
+#else // urel
+
+
+#ifdef __WINSCW__
+
+// WINSCW BUILD:
+#define IPTV_LOGGING_METHOD  2  // RDebug is default with emulator
+
+#else
+
+// ARMV5 BUILD:
+#define IPTV_LOGGING_METHOD  2  // RDebug is default with target device
+
+#endif
+
+
+#endif // _DEBUG
+
+
+/* 
+-----------------------------------------------------------------------------
+
+	LOG SETTINGS
+
+-----------------------------------------------------------------------------
+*/
+
+#if IPTV_LOGGING_METHOD == 1      // Flogger
+
+#include <flogger.h>
+_LIT(KIPTVLogFolder,"IPTV");
+_LIT(KIPTVLogFile,"IPTVLOG.TXT");
+
+#elif IPTV_LOGGING_METHOD == 2    // RDebug
+
+#include <e32svr.h>
+
+#endif
+
+
+
+
+
+#if IPTV_LOGGING_METHOD == 1      // Flogger
+
+
+#define IPTV_LOGTEXT(AAA)                RFileLogger::Write(KIPTVLogFolder(),KIPTVLogFile(),EFileLoggingModeAppend, AAA)
+
+#define IPTV_LOG_STR_DESC(AAA)                RFileLogger::Write(KIPTVLogFolder(),KIPTVLogFile(),EFileLoggingModeAppend, AAA)
+#define IPTV_LOG_STR_DESC2(AAA,BBB)         /*lint -e{717}*/ do { RFileLogger::WriteFormat(KIPTVLogFolder(),KIPTVLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(AAA()),BBB); } while ( EFalse )
+#define IPTV_LOG_STR_DESC3(AAA,BBB,CCC)     /*lint -e{717}*/ do { RFileLogger::WriteFormat(KIPTVLogFolder(),KIPTVLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(AAA()),BBB,CCC); } while ( EFalse )
+#define IPTV_LOG_STR_DESC4(AAA,BBB,CCC,DDD) /*lint -e{717}*/ do { RFileLogger::WriteFormat(KIPTVLogFolder(),KIPTVLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(AAA()),BBB,CCC,DDD); } while ( EFalse )
+
+#define IPTV_LOGSTRING(AAA)                 /*lint -e{717}*/ do { _LIT(tempIPTVLogDes,AAA); RFileLogger::Write(KIPTVLogFolder(),KIPTVLogFile(),EFileLoggingModeAppend,tempIPTVLogDes()); } while ( EFalse )
+#define IPTV_LOGSTRING2(AAA,BBB)            /*lint -e{717}*/ do { _LIT(tempIPTVLogDes,AAA); RFileLogger::WriteFormat(KIPTVLogFolder(),KIPTVLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempIPTVLogDes()),BBB); } while ( EFalse )
+#define IPTV_LOGSTRING3(AAA,BBB,CCC)        /*lint -e{717}*/ do { _LIT(tempIPTVLogDes,AAA); RFileLogger::WriteFormat(KIPTVLogFolder(),KIPTVLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempIPTVLogDes()),BBB,CCC); } while ( EFalse )
+#define IPTV_LOGSTRING4(AAA,BBB,CCC,DDD)    /*lint -e{717}*/ do { _LIT(tempIPTVLogDes,AAA); RFileLogger::WriteFormat(KIPTVLogFolder(),KIPTVLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempIPTVLogDes()),BBB,CCC,DDD); } while ( EFalse )
+
+// Time stamp
+_LIT(KIptvLogTimeFormatString, "IPTV TIMESTAMP: %H:%T:%S:%*C3");
+#define IPTV_LOGSTRING_TIMESTAMP { \
+                                 TTime logTime; \
+                                 logTime.HomeTime(); \
+                                 TBuf<256> logBuffer; \
+                                 logTime.FormatL(logBuffer, KIptvLogTimeFormatString); \
+                                 RFileLogger::Write(KIPTVLogFolder(), KIPTVLogFile(), EFileLoggingModeAppend, logBuffer); \
+                                 }
+
+// Memory stamp
+_LIT(KIptvLogMemoryStampString, "IPTV MEMORYSTAMP: %d KB");
+#define IPTV_LOGSTRING_MEMORYSTAMP { \
+                                   User::CompressAllHeaps(); \
+                                   TMemoryInfoV1Buf logMemory; \
+                                   UserHal::MemoryInfo(logMemory); \
+                                   TInt logMemoryInt = (TInt)(logMemory().iFreeRamInBytes); \
+                                   TBuf<256> logMemoryStr; \
+                                   logMemoryStr.Format(KIptvLogMemoryStampString, (logMemoryInt / 1024) ); \
+                                   RFileLogger::Write(KIPTVLogFolder(), KIPTVLogFile(), EFileLoggingModeAppend, logMemoryStr); \
+                                   }
+
+
+#elif IPTV_LOGGING_METHOD == 2    // RDebug
+
+
+#define IPTV_LOGTEXT(AAA)                    RDebug::Print(AAA)
+
+#define IPTV_LOG_STR_DESC(AAA)               RDebug::Print(AAA)
+#define IPTV_LOG_STR_DESC2(AAA,BBB)       	 /*lint -e{717}*/ do {  RDebug::Print(AAA, BBB); } while ( EFalse )
+#define IPTV_LOG_STR_DESC3(AAA,BBB,CCC)      /*lint -e{717}*/ do {  RDebug::Print(AAA, BBB, CCC); } while ( EFalse )
+#define IPTV_LOG_STR_DESC4(AAA,BBB,CCC,DDD)  /*lint -e{717}*/ do {  RDebug::Print(AAA, BBB, CCC, DDD); } while ( EFalse )
+
+#define IPTV_LOGSTRING(AAA)                  /*lint -e{717}*/ do { _LIT(tempIPTVLogDes,AAA); RDebug::Print(tempIPTVLogDes); } while ( EFalse )
+#define IPTV_LOGSTRING2(AAA,BBB)             /*lint -e{717}*/ do { _LIT(tempIPTVLogDes,AAA); RDebug::Print(tempIPTVLogDes, BBB); } while ( EFalse )
+#define IPTV_LOGSTRING3(AAA,BBB,CCC)         /*lint -e{717}*/ do { _LIT(tempIPTVLogDes,AAA); RDebug::Print(tempIPTVLogDes, BBB, CCC); } while ( EFalse )
+#define IPTV_LOGSTRING4(AAA,BBB,CCC,DDD)     /*lint -e{717}*/ do { _LIT(tempIPTVLogDes,AAA); RDebug::Print(tempIPTVLogDes, BBB, CCC, DDD); } while ( EFalse )
+
+// Time stamp
+_LIT(KIptvLogTimeFormatString, "IPTV TIMESTAMP: %H:%T:%S:%*C3");
+#define IPTV_LOGSTRING_TIMESTAMP { \
+                                 TTime logTime; \
+                                 logTime.HomeTime(); \
+                                 TBuf<256> logBuffer; \
+                                 logTime.FormatL(logBuffer, KIptvLogTimeFormatString); \
+                                 RDebug::Print(logBuffer); \
+                                 }
+
+// Memory stamp
+_LIT(KIptvLogMemoryStampString, "IPTV MEMORYSTAMP: %d KB");
+#define IPTV_LOGSTRING_MEMORYSTAMP { \
+                                   User::CompressAllHeaps(); \
+                                   TMemoryInfoV1Buf logMemory; \
+                                   UserHal::MemoryInfo(logMemory); \
+                                   TInt logMemoryInt = (TInt)(logMemory().iFreeRamInBytes); \
+                                   TBuf<256> logMemoryStr; \
+                                   logMemoryStr.Format(KIptvLogMemoryStampString, (logMemoryInt / 1024) ); \
+                                   RDebug::Print(logMemoryStr); \
+                                   }
+
+
+#else	// TF_LOGGING_METHOD == 0 or invalid
+
+
+#define IPTV_LOGSTRING(AAA)              
+#define IPTV_LOGSTRING2(AAA,BBB)         
+#define IPTV_LOGSTRING3(AAA,BBB,CCC)     
+#define IPTV_LOGSTRING4(AAA,BBB,CCC,DDD) 
+
+#define IPTV_LOGTEXT(AAA)                
+
+#define IPTV_LOG_STR_DESC(AAA)              
+#define IPTV_LOG_STR_DESC2(AAA,BBB)         
+#define IPTV_LOG_STR_DESC3(AAA,BBB,CCC)     
+#define IPTV_LOG_STR_DESC4(AAA,BBB,CCC,DDD) 
+
+#define IPTV_LOGSTRING_TIMESTAMP
+#define IPTV_LOGSTRING_MEMORYSTAMP
+
+
+#endif // TF_LOGGING_METHOD
+
+
+#endif // IPTVDEBUG_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/icons_vcx_base.mk	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,84 @@
+#
+# 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:   Base makefile for the specific icon makefiles.
+#
+#
+
+ifeq (WINSCW,$(findstring WINSCW, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\Z
+else
+ZDIR=\epoc32\data\z
+endif
+
+# ----------------------------------------------------------------------------
+# NOTE: This does not work unless, the ICONTARGETNAME and ICONS variables are 
+# defined. ICONTARGETNAME contains the target filename without path. ICONS 
+# contain the list of icon files, that are feeded to MifConv. Additionally if
+# needed you can define variable HEADERNAME that contains the name of the .mbg
+# header file without path.
+# ----------------------------------------------------------------------------
+
+TARGETDIR?=$(ZDIR)\resource\apps
+ICONTARGETFILENAME?=$(TARGETDIR)\$(ICONTARGETNAME)
+
+HEADERDIR=\epoc32\include
+
+ifdef HEADERNAME
+HEADERCOMMAND=/h$(HEADERDIR)\$(HEADERNAME)
+else
+HEADERCOMMAND=
+HEADERNAME=$(addsuffix .mbg, $(basename $(ICONTARGETNAME)))
+endif
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+#-----------------------------------------------------------------------------
+# NOTE: CLEAN target needs to do nothing, as the files echoed in RELEASABLES
+# get deleted automatically.
+#-----------------------------------------------------------------------------
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+# ----------------------------------------------------------------------------
+# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by
+# MifConv if the mask detph is defined.
+#
+# NOTE 2: Usually, source paths should not be included in the bitmap
+# definitions. MifConv searches for the icons in all icon directories in a
+# predefined order, which is currently \s60\icons, \s60\bitmaps2.
+# The directory \s60\icons is included in the search only if the feature flag
+# __SCALABLE_ICONS is defined.
+# ----------------------------------------------------------------------------
+
+RESOURCE : $(ICONTARGETFILENAME)
+    $(ICONTARGETFILENAME) : $(filter-out /c%,$(ICONS)) 
+	mifconv $(ICONTARGETFILENAME) $(HEADERCOMMAND) $(ICONS)
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(HEADERDIR)\$(HEADERNAME)&& \
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/mpxvideo_debug.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,164 @@
+/*
+* 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:   Debug print macros*
+*/
+
+
+// Version : %version: ou1cpsw#4.1.1 %
+
+
+
+
+#ifndef __MPXVIDEO_DEBUG_H__
+#define __MPXVIDEO_DEBUG_H__
+
+// INCLUDES
+#include <e32std.h>
+#include <e32svr.h>
+#include <e32des16.h>
+#include <e32property.h>
+#include <flogger.h>
+#include <e32def.h>
+
+
+
+// #define _MPX_FILE_LOGGING_
+
+#ifndef _DEBUG
+    #define FU_DEBUG
+#else
+    #ifdef _MPX_FILE_LOGGING_
+        #define FU_DEBUG MPXDebug::FileLog
+    #else        
+        #define FU_DEBUG RDebug::Print
+    #endif
+#endif 
+
+
+class MPXDebug
+{
+    public:
+        inline static void FileLog( TRefByValue<const TDesC16> aFmt, ... )
+        {
+            VA_LIST list;
+            VA_START(list,aFmt);
+            RFileLogger::WriteFormat( _L("Fusion"), 
+                                      _L("fusion.log"),
+                                      EFileLoggingModeAppend,
+                                      aFmt,
+                                      list );
+        }
+};
+
+
+
+// MACROS
+#ifdef _DEBUG
+    #define MPX_DEBUG             TFusionLog::FusionLog
+    #define MPX_ENTER_EXIT        TEnterExitLog _s
+#else
+    #define MPX_DEBUG
+    #define MPX_ENTER_EXIT
+#endif
+
+
+class TFusionLog : public TDes16Overflow
+{
+    public:
+        
+        inline static void FusionLog( TRefByValue<const TDesC16> aFmt, ... )
+        {
+            TBuf< 512 > buffer;
+            
+            VA_LIST list;
+            VA_START( list, aFmt );
+            buffer.AppendFormatList( aFmt, list );
+            VA_END(list);
+            
+            FU_DEBUG(_L("#Fu# %S"), &buffer );
+        }
+};
+
+class TEnterExitLog : public TDes16Overflow
+{
+    public:
+        
+        void Overflow(TDes16& /*aDes*/)
+        {
+            FU_DEBUG(_L("%S Logging Overflow"), &iFunctionName);
+        }
+
+        TEnterExitLog( TRefByValue<const TDesC> aFunctionName,
+                       TRefByValue<const TDesC> aFmt, ... )
+        {
+            iFunctionName = HBufC::New( TDesC(aFunctionName).Length() );
+            
+            if ( iFunctionName )
+            {
+                iFunctionName->Des().Copy(aFunctionName);
+            }
+            
+            TBuf< 512 > buffer;
+            
+            VA_LIST list;
+            VA_START( list, aFmt );
+            buffer.AppendFormatList( aFmt, list, this );
+            VA_END(list);
+            
+            FU_DEBUG(_L("#Fu# --> %S %S"), iFunctionName, &buffer );
+        }
+        
+        TEnterExitLog( TRefByValue<const TDesC> aFunctionName )
+        {
+            iFunctionName = HBufC::New( TDesC(aFunctionName).Length() );
+            
+            if ( iFunctionName )
+            {
+                iFunctionName->Des().Copy(aFunctionName);
+            }
+            
+            FU_DEBUG(_L("#Fu# --> %S"), iFunctionName );
+        }
+        
+        ~TEnterExitLog()
+        {
+            FU_DEBUG(_L("#Fu# <-- %S"), iFunctionName );
+            delete iFunctionName;
+        }
+        
+    private:
+        HBufC*    iFunctionName;
+};
+
+_LIT(_KMPXErrorInfo, "#Fu# MPXVideo Error : error %d file %s line %d");
+
+#define MPX_S(a) _S(a)
+
+#define MPX_ERROR_LOG(aErr) \
+    {\
+        if (aErr) \
+            FU_DEBUG(_KMPXErrorInfo, aErr, MPX_S(__FILE__), __LINE__);\
+    }
+
+#ifdef _DEBUG
+    #define MPX_TRAP(_r, _s) TRAP(_r,_s);MPX_ERROR_LOG(_r);
+    #define MPX_TRAPD(_r, _s) TRAPD(_r,_s);MPX_ERROR_LOG(_r);
+#else // _DEBUG
+    #define MPX_TRAP(_r, _s) TRAP(_r,_s);(_r=_r);
+    #define MPX_TRAPD(_r, _s) TRAPD(_r,_s);(_r=_r);
+#endif // _DEBUG
+
+#endif  // __MPXVIDEO_DEBUG_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/mpxvideoplayercustomviewmsgconsts.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,37 @@
+/*
+* 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 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:  Constant header for feeds view messages*
+*/
+
+
+// Version : %version: da1mmcf#4 %
+
+
+#ifndef __MPXVIDEOPLAYERCUSTOMVIEWMSGCONSTS_H__
+#define __MPXVIDEOPLAYERCUSTOMVIEWMSGCONSTS_H__
+
+/**
+* Constants for Media Player application's custom
+* feeds view message commands.
+*/
+
+const TInt KVcxCustomViewMessageCmd = 0x200211F9;
+
+const TInt KVcxCustomViewMessagePtr = 0x200211F9;
+
+const TInt KMpxVideoPlaybackPdlReloading = 0x20024339;
+
+const TInt KMpxVideoPlaybackPdlReloadComplete = 0x2002433A;
+
+#endif // __MPXVIDEOPLAYERCUSTOMVIEWMSGCONSTS_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/videoplayerpskeys.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,33 @@
+/*
+* 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:   Definitions for PS keys*
+*/
+
+
+// Version : %version:  2 %
+
+#ifndef VIDEOPLAYERPSKEYS_H_
+#define VIDEOPLAYERPSKEYS_H_
+
+/**
+*  RProperty category UID for videoplayer application
+*/
+const TUid KVideoPlayerRPropertyCategory = { 0x200159B2 };
+
+/**
+*  RProperty key for storing WgId of stand alone videoplayer application.
+*/
+const TInt KVideoPlayerRPropertyWGIdKey = 0x1;
+
+#endif /* VIDEOPLAYERPSKEYS_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/layers.sysdef.xml	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,52 @@
+<?xml version="1.0"?>
+<!DOCTYPE SystemDefinition SYSTEM "sysdef_1_4_0.dtd" [
+  <!ENTITY layer_real_source_path "sf/app/videoplayer" >
+]>
+
+<SystemDefinition name="video" schema="1.4.0">
+  <systemModel>
+    <layer name="app_layer">
+      <module name="videoplayer">
+        <unit unitID="vado.videoplayer" mrp="" bldFile="&layer_real_source_path;/group" name="videoplayer" />
+      </module>
+    </layer>
+    
+	<layer name="api_test_layer">
+		<module name="video_player_file_details_dialog_api_tsrc">
+			<unit unitID="vado.video_player_file_details_dialog_api_test" name="video_player_file_details_dialog_api_tsrc" bldFile="&layer_real_source_path;/videoplayer_plat/video_player_file_details_dialog_api/tsrc/group" mrp=""/>
+		</module>
+		<module name="videoplayer_startup_api_tsrc">
+			<unit unitID="vado.videoplayer_startup_api_test" name="videoplayer_startup_api_tsrc" bldFile="&layer_real_source_path;/videoplayer_plat/videoplayer_startup_api/tsrc/group" mrp=""/>
+		</module>		
+	</layer>
+
+	<layer name="unit_test_layer">
+		
+		<module name="videoplayer_tsrc">
+			<unit unitID="vado.videohelix_test" name="videohelix_tsrc" bldFile="&layer_real_source_path;/videoplayback/videohelix/tsrc/ut_videohelixtest/group" mrp=""/>
+			<unit unitID="vado.videoplaybackcontrols_test" name="videoplaybackcontrols_tsrc" bldFile="&layer_real_source_path;/videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/group" mrp=""/>
+			<unit unitID="vado.userinputhandler_test" name="userinputhandler_tsrc" bldFile="&layer_real_source_path;/videoplayback/videoplaybackviews/tsrc/ut_userinputhandlertest/group" mrp=""/>
+			<unit unitID="vado.mpxvideoplayer_test" name="mpxvideoplayer_tsrc" bldFile="&layer_real_source_path;/videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/group" mrp=""/>
+		</module>
+
+		<module name="mpxmyvideoscollection_tsrc">
+			<unit unitID="vado.mvcollection_tests_dependency1" name="mvcollection_tests_dependency1" bldFile="&layer_real_source_path;/tsrc/VCXTestCommon/group" mrp=""/>
+			<unit unitID="vado.mvcollection_tests_dependency2" name="mvcollection_tests_dependency2" bldFile="&layer_real_source_path;/tsrc/VCXTestUtilModule/group" mrp=""/>
+			<unit unitID="vado.mvcollection_tests_dependency3" name="mvcollection_tests_dependency3" bldFile="&layer_real_source_path;/tsrc/VCXTestMyVideosCollectionClient/group" mrp=""/>
+
+			<unit unitID="vado.mpxmyvideoscollection_test" name="mpxmyvideoscollection_tsrc" bldFile="&layer_real_source_path;/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/group" mrp=""/>
+		</module>
+		
+		<module name="other_tsrc">
+			<unit unitID="vado.other_tests_dependency1" name="other_tests_dependency1" bldFile="&layer_real_source_path;/tsrc/VCXTestCommon/group" mrp=""/>
+			<unit unitID="vado.other_tests_dependency2" name="other_tests_dependency2" bldFile="&layer_real_source_path;/tsrc/VCXTestUtilModule/group" mrp=""/>
+			<unit unitID="vado.other_tests_dependency3" name="other_tests_dependency3" bldFile="&layer_real_source_path;/tsrc/VCXTestMyVideosCollectionClient/group" mrp=""/>
+
+			<unit unitID="vado.mediasettingsengine_test" name="mediasettingsengine_tsrc" bldFile="&layer_real_source_path;/mediasettings/mediasettingsengine/tsrc/mediasettingsenginetest/group" mrp=""/>
+			<unit unitID="vado.vpsettingsenginetest_test" name="vpsettingsenginetest_tsrc" bldFile="&layer_real_source_path;/mediasettings/videoplayersettingsengine/tsrc/vpsettingsenginetest/group" mrp=""/>
+		</module>
+		
+	</layer>  
+	
+  </systemModel>
+</SystemDefinition>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/feedsettingsplugin/data/vcxnssettingsplugin.rss	Thu Nov 04 11:16:56 2010 +0200
@@ -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 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:    Resource definitions for project vcxnssettingsplugin*
+*/
+
+
+
+
+// INCLUDES
+#include <ecom/registryinfo.rh>
+#include <mpxviewplugin.hrh>
+
+#include "vcxnssettingsplugin.hrh"
+
+// RESOURCE DEFINITIONS 
+
+/**
+ * The opaque_data syntax is made up of three parts: 
+ * a list of Uids for resolving the view plugin, feature flags, priority.
+ * 
+ * <p>uid1;uid2;uid3</p>
+ *  uid*: uid of the supported Playback/Collection plugin.
+ *  E.g. if the view plugin supports Local Playback plugin, the list of
+ *  uids will be: 0x101FFC06
+ *
+ * <t>uid</t>
+ *  uid: plugin type uid.
+ *  E.g. if the view plugin supports playback type, uid will be: 0x101FFCA0
+ *
+ * <f>flags</f> [optional]
+ *  flags: sum of the required feature flags that listed in mpxviewplugin.hrh. 
+ *  E.g. if the view plugin needs to be pre-loaded and it's user-selectable,
+ *  then flags = KMPXVpFeaturePreLoaded + KMPXVpFeatureUserSelectable = 0x0003.
+ *
+ * <i>priority</i> [optional]
+ *  priority: a value of type TMPXViewPluginPriorities. This value determines
+ *  which view plugin will be resolved when several plugins can support the 
+ *  same set of Uids. 
+ *  Default value of this field is EMPXViewPluginPriorityNormal.
+ */
+RESOURCE REGISTRY_INFO theInfo
+    {
+    dll_uid = 0x20016BA6; //Settings plugin dll uid
+
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            interface_uid = KMPXViewPluginInterfaceUid;
+            implementations = 
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = KVcxNsSettingsPluginImplementationId;
+                    version_no = 1;
+                    display_name = "vcxnssettings";
+                    default_data = "";
+                    opaque_data = "<p></p>"
+                                  "<t>0x2001B2A7</t>"
+                                  "<f>0x0</f>"
+                                  "<i>"EMPXViewPluginPriorityLowest"</i>";
+                    }
+                };
+            }
+        };
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/feedsettingsplugin/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,29 @@
+/*
+* 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:    Build information file for project vcxnssettingsplugin*
+*/
+
+
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/feedsettingsplugin.iby	CORE_APP_LAYER_IBY_EXPORT_PATH( feedsettingsplugin.iby )
+
+
+PRJ_MMPFILES
+vcxnssettingsplugin.mmp
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/feedsettingsplugin/group/vcxnssettingsplugin.mmp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,54 @@
+/*
+* 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:    Project definition file for vod plug-in*
+*/
+
+
+
+
+#include <data_caging_paths.hrh>
+#include <bldvariant.hrh>
+#include <platform_paths.hrh>
+
+TARGET                  vcxnssettingsplugin.dll
+TARGETTYPE              PLUGIN
+UID                     0x10009D8D 0x20016BA6
+
+CAPABILITY              CAP_ECOM_PLUGIN -AllFiles
+VENDORID                VID_DEFAULT
+
+SOURCEPATH              ../src
+SOURCE                  vcxnssettingsplugin.cpp
+SOURCE                  vcxnssettingspluginproxy.cpp
+
+
+START RESOURCE ../data/vcxnssettingsplugin.rss
+TARGET vcxnssettingsplugin.rsc
+END
+
+
+USERINCLUDE             ../inc
+USERINCLUDE             ../../feedsettingsviews/inc
+
+APP_LAYER_SYSTEMINCLUDE
+ 
+
+LIBRARY         euser.lib
+LIBRARY         apparc.lib
+LIBRARY         cone.lib
+LIBRARY         eikcore.lib 
+LIBRARY         avkon.lib
+LIBRARY         ecom.lib
+LIBRARY         mpxviewplugin.lib
+LIBRARY         vcxnssettingsview.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/feedsettingsplugin/inc/vcxnssettingsplugin.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,73 @@
+/*
+* 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:    NSeries settings plugin definition*
+*/
+
+
+
+
+#ifndef VCXNSSETTINGSPLUGIN_H
+#define VCXNSSETTINGSPLUGIN_H
+
+// INCLUDES
+#include <mpxaknviewplugin.h>
+
+// CLASS DECLARATION
+
+/**
+ *  Settings view plugin definition.
+ *
+ *  @lib vcxnssettingsplugin.lib
+ *  @since S60 v5.0
+ */
+NONSHARABLE_CLASS( CVcxNsSettingsPlugin ) : public CMPXAknViewPlugin
+    {
+public:
+
+    /**
+     * Two-phased constructor.
+     *
+     * @since 3.0
+     * @return Pointer to newly created object.
+     */
+    static CVcxNsSettingsPlugin* NewL();
+
+    /**
+     * Destructor.
+     */
+    virtual ~CVcxNsSettingsPlugin();
+
+private:
+
+    /**
+     * From CMPXAknViewPlugin. Construct Avkon view.
+     *
+     * @return Pointer to a created Avkon view.
+     */
+    CAknView* ConstructViewLC();
+
+private:
+
+    /**
+     * C++ default constructor.
+     */
+    CVcxNsSettingsPlugin();
+
+    /**
+     * Symbian 2nd phase constructor
+     */
+    void ConstructL();
+    };
+
+#endif // VCXNSSETTINGSPLUGIN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/feedsettingsplugin/inc/vcxnssettingsplugin.hrh	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,29 @@
+/*
+* 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:    Resource headers for project vcxnssettingsplugin*
+*/
+
+
+
+
+#ifndef VCXSETTINGSPLUGIN_HRH
+#define VCXSETTINGSPLUGIN_HRH
+
+/** Settings view plugin implementation ID */
+#define KVcxNsSettingsPluginImplementationId 0x2001B2A6
+
+/** Settings MPX view type ID */
+#define KVcxNsSettingsPluginSettingsViewTypeId 0x2001B2A7
+
+#endif //VCXSETTINGSUIPLUGIN_HRH
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/feedsettingsplugin/rom/feedsettingsplugin.iby	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2005 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:   feedsettingsplugin ROM resources.*
+*/
+
+
+// Version : %version:  2 %
+
+
+#ifndef __FEEDSETTINGPLUGIN_IBY__
+#define __FEEDSETTINGPLUGIN_IBY__
+
+ECOM_PLUGIN( vcxnssettingsplugin.dll, vcxnssettingsplugin.rsc )
+
+#endif // __FEEDSETTINGPLUGIN_IBY__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/feedsettingsplugin/src/vcxnssettingsplugin.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,75 @@
+/*
+* 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:    NSeries VOD UI plugin implementation*
+*/
+
+
+
+// INCLUDE FILES
+#include "feedsettingsview.h"
+#include "vcxnssettingsplugin.h"
+#include <mpxviewutility.h>
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// C++ default constructor
+// ---------------------------------------------------------------------------
+//
+CVcxNsSettingsPlugin::CVcxNsSettingsPlugin()
+    {
+    // No impl
+    }
+
+// ---------------------------------------------------------------------------
+// Symbian 2nd phase constructor
+// ---------------------------------------------------------------------------
+//
+void CVcxNsSettingsPlugin::ConstructL()
+    {
+    // No impl
+    }
+
+// ---------------------------------------------------------------------------
+// Two-phased constructor.
+// ---------------------------------------------------------------------------
+//
+CVcxNsSettingsPlugin* CVcxNsSettingsPlugin::NewL( )
+    {
+    CVcxNsSettingsPlugin* self = 
+        new ( ELeave ) CVcxNsSettingsPlugin();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CVcxNsSettingsPlugin::~CVcxNsSettingsPlugin()
+    {
+    // No impl
+    }
+
+// ---------------------------------------------------------------------------
+// From CMPXAknViewPlugin
+// Construct Avkon view.
+// ---------------------------------------------------------------------------
+//
+CAknView* CVcxNsSettingsPlugin::ConstructViewLC()
+    {
+    return CVcxNsSettingsView::NewLC();
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/feedsettingsplugin/src/vcxnssettingspluginproxy.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,49 @@
+/*
+* 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:    ECOM plugin implementation proxy*
+*/
+
+
+
+
+// INCLUDE FILES
+#include <ecom/implementationproxy.h>
+
+#include "vcxnssettingsplugin.h"
+#include "vcxnssettingsplugin.hrh"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// The list of implementations
+// ---------------------------------------------------------------------------
+//
+const TImplementationProxy ImplementationTable[] = 
+    { 
+    IMPLEMENTATION_PROXY_ENTRY( 
+        KVcxNsSettingsPluginImplementationId, 
+        CVcxNsSettingsPlugin::NewL ) 
+    };
+
+// ---------------------------------------------------------------------------
+// The proxy of implementations
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(
+    TInt& aTableCount )
+    {
+    aTableCount = 
+        sizeof( ImplementationTable ) / sizeof( TImplementationProxy );
+    return ImplementationTable;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/feedsettingsviews/BWINS/vcxnssettingsviewu.def	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,15 @@
+EXPORTS
+	??0CVcxNsSettingsView@@IAE@VTUid@@@Z @ 1 NONAME ; CVcxNsSettingsView::CVcxNsSettingsView(class TUid)
+	??1CVcxNsSettingsView@@UAE@XZ @ 2 NONAME ; CVcxNsSettingsView::~CVcxNsSettingsView(void)
+	?ConstructL@CVcxNsSettingsView@@IAEXXZ @ 3 NONAME ABSENT ; void CVcxNsSettingsView::ConstructL(void)
+	?DoActivateL@CVcxNsSettingsView@@MAEXABVTVwsViewId@@VTUid@@ABVTDesC8@@@Z @ 4 NONAME ; void CVcxNsSettingsView::DoActivateL(class TVwsViewId const &, class TUid, class TDesC8 const &)
+	?DoDeactivate@CVcxNsSettingsView@@MAEXXZ @ 5 NONAME ; void CVcxNsSettingsView::DoDeactivate(void)
+	?DynInitMenuPaneL@CVcxNsSettingsView@@MAEXHPAVCEikMenuPane@@@Z @ 6 NONAME ; void CVcxNsSettingsView::DynInitMenuPaneL(int, class CEikMenuPane *)
+	?HandleClientRectChange@CVcxNsSettingsView@@QAEXXZ @ 7 NONAME ; void CVcxNsSettingsView::HandleClientRectChange(void)
+	?HandleCommandL@CVcxNsSettingsView@@UAEXH@Z @ 8 NONAME ; void CVcxNsSettingsView::HandleCommandL(int)
+	?HandleStatusPaneSizeChange@CVcxNsSettingsView@@MAEXXZ @ 9 NONAME ; void CVcxNsSettingsView::HandleStatusPaneSizeChange(void)
+	?NewL@CVcxNsSettingsView@@SAPAV1@XZ @ 10 NONAME ; class CVcxNsSettingsView * CVcxNsSettingsView::NewL(void)
+	?NewLC@CVcxNsSettingsView@@SAPAV1@XZ @ 11 NONAME ABSENT ; class CVcxNsSettingsView * CVcxNsSettingsView::NewLC(void)
+	?ConstructL@CVcxNsSettingsView@@IAEXPAV?$CArrayPtrFlat@VMGSTabbedView@@@@@Z @ 12 NONAME ; void CVcxNsSettingsView::ConstructL(class CArrayPtrFlat<class MGSTabbedView> *)
+	?NewLC@CVcxNsSettingsView@@SAPAV1@PAV?$CArrayPtrFlat@VMGSTabbedView@@@@@Z @ 13 NONAME ; class CVcxNsSettingsView * CVcxNsSettingsView::NewLC(class CArrayPtrFlat<class MGSTabbedView> *)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/feedsettingsviews/EABI/vcxnssettingsviewu.def	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,18 @@
+EXPORTS
+	_ZN18CVcxNsSettingsView10ConstructLEP13CArrayPtrFlatI13MGSTabbedViewE @ 1 NONAME
+	_ZN18CVcxNsSettingsView11DoActivateLERK10TVwsViewId4TUidRK6TDesC8 @ 2 NONAME
+	_ZN18CVcxNsSettingsView12DoDeactivateEv @ 3 NONAME
+	_ZN18CVcxNsSettingsView14HandleCommandLEi @ 4 NONAME
+	_ZN18CVcxNsSettingsView16DynInitMenuPaneLEiP12CEikMenuPane @ 5 NONAME
+	_ZN18CVcxNsSettingsView26HandleStatusPaneSizeChangeEv @ 6 NONAME
+	_ZN18CVcxNsSettingsView4NewLEv @ 7 NONAME
+	_ZN18CVcxNsSettingsView5NewLCEP13CArrayPtrFlatI13MGSTabbedViewE @ 8 NONAME
+	_ZN18CVcxNsSettingsViewC1E4TUid @ 9 NONAME
+	_ZN18CVcxNsSettingsViewC2E4TUid @ 10 NONAME
+	_ZN18CVcxNsSettingsViewD0Ev @ 11 NONAME
+	_ZN18CVcxNsSettingsViewD1Ev @ 12 NONAME
+	_ZN18CVcxNsSettingsViewD2Ev @ 13 NONAME
+	_ZTI18CVcxNsSettingsView @ 14 NONAME ; #<TI>#
+	_ZTV18CVcxNsSettingsView @ 15 NONAME ; #<VT>#
+	_ZThn12_N18CVcxNsSettingsView16DynInitMenuPaneLEiP12CEikMenuPane @ 16 NONAME ; #<thunk>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/feedsettingsviews/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2007-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:    Build information file for video center settings view*
+*/
+
+
+
+
+PRJ_PLATFORMS
+
+WINSCW ARMV5
+
+PRJ_EXPORTS
+
+../rom/feedsettingsviews.iby                    CORE_APP_LAYER_IBY_EXPORT_PATH(feedsettingsviews.iby)
+../rom/feedsettingsviewsresources.iby           LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(feedsettingsviewsresources.iby)
+
+PRJ_MMPFILES
+
+vcxnssettingsview.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/feedsettingsviews/group/vcxnssettingsview.mmp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,99 @@
+/*
+* 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:    Project definition file for project vcsettingsview*
+*/
+
+
+
+
+#include <platform_paths.hrh>
+#include <data_caging_paths.hrh>
+#include <bldvariant.hrh>
+
+//OPTION ARMCC --asm --interleave
+ALWAYS_BUILD_AS_ARM
+
+TARGET          vcxnssettingsview.dll
+TARGETTYPE      dll
+
+UID             0x1000008d 0x20016B99
+
+VENDORID        VID_DEFAULT
+CAPABILITY      CAP_GENERAL_DLL
+
+SOURCEPATH      ../src
+
+SOURCE          feedsettingsview.cpp
+SOURCE          feedsettingsviewcontainer.cpp
+SOURCE          feedsettingsviewserviceselection.cpp 
+SOURCE          feedsettingsviewaddservicelistbox.cpp 
+SOURCE          feedsettingsviewaddoreditservice.cpp
+SOURCE          feedsettingsviewremoveservicequerydialog.cpp 
+
+START RESOURCE ../rss/vcxnssettingsview.rss
+HEADER
+TARGETPATH APP_RESOURCE_DIR
+LANGUAGE_IDS 
+END
+
+USERINCLUDE     .
+USERINCLUDE     ../inc
+
+USERINCLUDE   ../../videoplayersettingsengine/inc
+USERINCLUDE   ../../gsvideoplugin/inc
+USERINCLUDE   ../../mediasettingsapp/inc
+USERINCLUDE   ../../../videofeeds/vccommon/conf/
+USERINCLUDE   ../../../videofeeds/utils/inc
+USERINCLUDE   ../../../videofeeds/clientapi/inc
+USERINCLUDE   ../../../videofeeds/vcnsuiengine/inc
+USERINCLUDE   ../../../videofeeds/server/IptvNetworkSelection/inc
+USERINCLUDE   ../../../videofeeds/server/IptvScheduledDownload/inc
+
+APP_LAYER_SYSTEMINCLUDE
+
+LIBRARY         cseschedulerclient.lib
+
+LIBRARY        avkon.lib
+LIBRARY        bafl.lib
+LIBRARY        cmmanager.lib
+LIBRARY        commondialogs.lib
+LIBRARY        commonengine.lib
+LIBRARY        cone.lib
+LIBRARY        efsrv.lib
+LIBRARY        eikcore.lib
+LIBRARY        eikctl.lib
+LIBRARY        eikcoctl.lib 
+LIBRARY        eikdlg.lib 
+LIBRARY        euser.lib
+LIBRARY        flogger.lib
+LIBRARY        gsecomplugin.lib
+LIBRARY        iptvclientapi.lib
+LIBRARY        iptvutil.lib
+LIBRARY        mpxviewutility.lib
+LIBRARY        vcxnsuiengine.lib
+LIBRARY        vcxnssettingsengine.lib
+LIBRARY        inetprotutil.lib // for UriParser
+LIBRARY        browserlauncher.lib // Browser
+LIBRARY        apparc.lib
+LIBRARY        vcxconnectionutility.lib
+LIBRARY        centralrepository.lib
+LIBRARY        sisregistryclient.lib
+LIBRARY        aknskinsrv.lib        // for enhanced skinning
+LIBRARY        aknskins.lib          // for enhanced skinning
+LIBRARY        gsframework.lib       // CGSTabHelper
+LIBRARY        hlplch.lib            // for "Help" options menu
+LIBRARY        featmgr.lib           // Feature manager 
+
+// For RAPTOR compliancy
+LIBRARY        ecom.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/feedsettingsviews/inc/feedsettingsview.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,329 @@
+/*
+* Copyright (c) 2007-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:    CVcxNsSettingsView view class definitions.*
+*/
+
+
+
+
+#ifndef VCXNSSETTINGSVIEW_H
+#define VCXNSSETTINGSVIEW_H
+
+// INCLUDES
+#include <akncontext.h>
+#include <AknsUtils.h>
+#include <gsplugininterface.h>
+#include <gstabbedview.h>
+
+#include "feedsettingsview.hrh"
+
+// FORWARD DECLARATIONS
+class CVcxNsSettingsViewContainer;
+class CIptvResourceLoader;
+class CVcxNsSettingsEngine;
+class CVcxNsServiceSettings;
+class MMPXViewUtility;
+
+class MGSTabbedView;
+class CGSTabHelper;
+class CAknNavigationDecorator;
+class MMPSettingsNaviPaneController;
+
+// CONSTS
+const TInt32 KVcxNsSettingsViewUid = 0x20016B99;
+
+// CLASS DECLARATION
+
+/**
+ *  CVcxNsSettingsView view class definitions.
+ *
+ *  @lib vcsettingsview.lib
+ *  @since S60 5.0
+ */
+class CVcxNsSettingsView  : public CGSPluginInterface, 
+                            public MGSTabbedView
+    {
+public:
+    
+    /**
+     * Two-phased constructor.
+     */
+    IMPORT_C static CVcxNsSettingsView* NewL( );
+    
+    /**
+     * Two-phased constructor.
+     */
+    IMPORT_C static CVcxNsSettingsView* NewLC( CArrayPtrFlat<MGSTabbedView>* aTabViewArray = NULL);
+
+    /**
+     * Destructor.
+     */
+    IMPORT_C virtual ~CVcxNsSettingsView( );
+
+protected:
+    /**
+     * Constructor.
+     */
+    IMPORT_C CVcxNsSettingsView( const TUid aViewId = TUid::Uid( KVcxNsSettingsViewUid ) );
+
+    /**
+     * EPOC default constructor.
+     */
+    IMPORT_C void ConstructL( CArrayPtrFlat<MGSTabbedView>* aTabViewArray );
+    
+public:
+
+    /**
+    * MGSTabbedView
+    */       
+    CGulIcon* CreateTabIconL();
+    
+    /**
+     * From CAknView.
+     */
+    TUid Id( ) const;
+
+    /**
+     * From CAknView.
+     *
+     * @param aCommand Command for view.
+     */
+    IMPORT_C void HandleCommandL(TInt aCommand);
+
+    /**
+     * Handles client rectangle changes.
+     */
+    IMPORT_C void HandleClientRectChange();
+
+    /**
+     * Handles routed key events. Other components might route their key events
+     * here because this view has overall control of the Settings UI.
+     */
+    TKeyResponse RoutedKeyEventL(const TKeyEvent &aKeyEvent, TEventCode aType );
+
+    /**
+     * Returns the button group container. Can be used for changing softkeys.
+     *
+     * @return Button group container.
+     */
+    CEikButtonGroupContainer* GetButtonGroupContainer( );
+
+    /**
+     * Sets "service subscription" mode on. When Settings UI is activated
+     * in this mode, it goes directly to service subscriptions view.
+     */
+    void SetServiceSubscriptionMode();
+
+    /**
+     * Sets "Vodcast add feed subscription" mode on. When this is activated
+     * it goes directly Add feed and returns to Vodcast view.
+     */
+    void SetVodcastAddFeedMode();
+
+    /**
+     * Checks if Settings UI is currently being displayed.
+     *
+     * @return ETrue if Settings UI is active.
+     */
+    TBool IsSettingsViewActive();
+
+    /**
+     * From CGSPluginInterface
+     * GetCaptionL
+     * Dummy implementation, implemented in settings plugin.
+     */
+    virtual void GetCaptionL( TDes& /*aCaption*/ ) const {};
+
+    /**
+     * Is the view launhed from general settings framework?
+     * @return Is it launched from gs fw.
+     */
+    TBool LaunchedFromGsFw( );
+   
+    /**
+     * Returns pointer to container
+     * 
+     * @return Pointer to container.
+     */
+    CVcxNsSettingsViewContainer* Container();
+
+    /**
+     * Sets navi pane.
+     * 
+     * @param aDisableNaviPane  If ETrue navi pane is disabled.
+     */
+    void SetNaviPaneL( TBool aDisableNaviPane = EFalse );
+    
+protected:
+
+    /**
+     * Handles activation message.
+     * 
+     * @param aCustomMessage    Custom message
+     */
+    void HandleActivationMessageL( const TDesC8& aCustomMessage );
+    
+    /**
+     * Handle Back command.
+     */
+    void HandleBackCommandL();
+    
+    /**
+     * Handle Back command service selection.
+     */
+    void HandleBackCommandForServiceSelectionL();
+    
+    /**
+     *  Handle Back command for add service view
+     */
+    void HandleBackCommandForAddServiceL();
+    
+    /**
+     * Handle Add/Edit VoD service command.
+     * 
+     * @param aIsAdding EFalse for edit, ETrue for add.
+     */
+    void HandleVodAddOrEditCommandL( TBool aIsAdding );
+
+    /**
+     * Saves service selection.
+     * 
+     */
+    void SaveServiceSelectionL();
+    
+    /**
+     * From CAknView
+     * Called when view is activated.
+     * @param aPrevViewId
+     * @param aCustomMessageId
+     * @param aCustomMessage
+     */
+    IMPORT_C virtual void DoActivateL( const TVwsViewId& aPrevViewId,
+                                       TUid aCustomMessageId, 
+                                       const TDesC8& aCustomMessage );
+
+    /**
+     * From CAknView 
+     * Called when view is deactivated.
+     */
+    IMPORT_C virtual void DoDeactivate();
+
+    /**
+     * Adjusts the visible items in menu pane accordding to Settings UI state.
+     *
+     * @param aResourceId Resource ID identifying the menu pane to initialise.
+     * @param aMenuPane   The in-memory representation of the menu pane.
+     */
+    void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane );
+
+    /**
+     * Handles status pane size changes.
+     */
+    IMPORT_C void HandleStatusPaneSizeChange();
+    
+    /**
+    * Locates the mif file searching from y: to a: and then z: last
+	*
+    * @param aFileName Full path to mif file.
+    */
+    void LocateMifFileL( TFileName& aFileName );
+
+private:
+
+    /**
+     * This view's ID
+     */
+    TUid iViewId;
+    
+    /**
+     * Settings control container
+     */
+    CVcxNsSettingsViewContainer* iContainer;
+    
+    /**
+     * Resource loader
+     */
+    CIptvResourceLoader* iResourceLoader;
+
+    /**
+     * Previously active view's ID
+     */
+    TVwsViewId iPrevViewId;
+
+    /**
+     * Status pane layout from previously active view.
+     */
+    TInt iPrevStatusPaneLayout;
+
+    /**
+     * iFs
+     */
+    RFs iFs;
+    
+    /**
+     * Settings engine
+     */
+    CVcxNsSettingsEngine* iSettingsEngine;
+
+    /**
+     * UI engine's service setting if.
+     */
+    CVcxNsServiceSettings* iServiceSettings;
+    
+    /**
+     * Is settings activated in ServiceSubscriptionMode
+     */
+    TBool iServiceSubscriptionMode;
+    
+    /**
+     * Is settings activated in VodcastAddFeedMode
+     */
+    TBool iVodcastAddFeedMode;
+
+    /**
+     * Is settings activated from GSVideoPlugin
+     */
+    TBool iGSVideoPluginMode;
+    
+    /**
+    * Mpx view Utility
+    */
+    MMPXViewUtility* iViewUtility;
+
+    /**
+    * General Settings tab helper
+    */
+    CGSTabHelper* iTabHelper;
+    
+    /**
+     * Navi pane context.
+     * Not own.
+     */
+    CAknNavigationDecorator* iNaviPaneContext;
+        
+    /**
+     * Navi pane controller.
+     * Not own.
+     */
+    MMPSettingsNaviPaneController* iNaviCntrl;
+    
+    /*
+     * View array.
+     * Not own.
+     */
+    CArrayPtrFlat<MGSTabbedView>* iViewArray; 
+        
+    };
+
+#endif // VCXNSSETTINGSVIEW_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/feedsettingsviews/inc/feedsettingsview.hrh	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,105 @@
+/*
+* Copyright (c) 2007-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:    Resource header file for settings view.*
+*/
+
+
+
+
+#ifndef VCXNSSETTINGSVIEW_HRH
+#define VCXNSSETTINGSVIEW_HRH
+
+// DATA TYPES
+
+// Dialog page ids.
+
+enum TVcxNsSettingsViewDlgPages 
+	{
+	EVcSettingsViewFirstPage = 1
+	};
+
+// Dialog line ids.
+
+enum TVcxNsSettingsViewDlgLineId 
+	{
+	EVcSettingsViewDlgLabel = 1,
+	EVcSettingsViewDlgCtrlIdApplications,
+	EVcSettingsViewDlgCtrlIdViews
+	};
+
+enum TVcxNsSettingsViewSoftkeys
+    {
+    EVcSettingsViewSoftkeyOptions = 1,
+    EVcSettingsViewSoftkeyDone,
+    EVcSettingsViewSoftkeySelect,
+    EVcSettingsViewSoftkeyBack,
+    EVcSettingsViewSoftkeyMove,
+    EVcSettingsViewSoftkeyOk,
+    EVcSettingsViewSoftkeyExit,
+    EVcSettingsViewSoftkeyCancel,
+    EVcSettingsViewSoftkeyMSKPlay,
+    EVcSettingsViewSoftkeyMSKMenu,
+    EVcSettingsViewSoftkeyMSKOpen,
+    EVcSettingsViewSoftkeyMSKDoNothing,
+    EVcSettingsViewSoftkeySettingsApMskMark,
+    EVcSettingsViewSoftkeySettingsApMskUnmark,
+    EVcSettingsViewSoftkeySettingsApLskOptions
+    };
+
+enum TVcxNsSettingsViewCmd
+    {
+    // Setting items
+    EVcSettingsViewCmdOpen = 30,
+    EVcSettingsViewCmdChange,
+    // Video service selection.
+    EVcSettingsServiceCmdMark,
+    EVcSettingsServiceCmdUnmark,
+    EVcSettingsServiceCmdSelect,
+    // Video service selection: Vod
+    EVcSettingsServiceCmdVodDetails,
+    EVcSettingsServiceCmdVodEdit,
+    EVcSettingsServiceCmdVodRemove,
+    EVcSettingsServiceCmdVodAdd,
+    // Video service selection: Vodcast
+    EVcSettingsServiceCmdVodcastDetails,
+    EVcSettingsServiceCmdVodcastEdit,
+    EVcSettingsServiceCmdVodcastRemove,
+    EVcSettingsServiceCmdVodcastAdd,
+    // Video service selection: Web link
+    EVcSettingsServiceCmdWebLinkDetails,
+    EVcSettingsServiceCmdWebLinkRemove,
+    // Add service
+    EVcSettingsViewAddServiceCmdChange,
+    // Common
+    EVcSettingsViewCmdHelp,
+    EVcSettingsViewCmdExit
+    };
+
+enum TVcxNsSettingsViewAddServiceListItems
+    {
+    EVcSettingsViewAddServiceServiceNameItem = 1,
+    EVcSettingsViewAddServiceAddressItem,
+    EVcSettingsViewAddServiceServiceTypeItem,
+    EVcSettingsViewAddServiceUserNameItem,
+    EVcSettingsViewAddServicePasswordItem
+    };
+
+enum
+    {
+    EVcConnectionSettingUsedSnapIdItem = 1,
+    EVcConnectionSettingAllowUseGprsItem,
+    EVcConnectionSettingAllowRoamingItem
+    };
+
+#endif	// VCXNSSETTINGSVIEW_HRH
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/feedsettingsviews/inc/feedsettingsview.rh	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,44 @@
+/*
+* 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:    Resource headers for Video Center / Settings view*
+*/
+
+
+
+
+#ifndef VCXNSSETTINGSVIEW_RH
+#define VCXNSSETTINGSVIEW_RH
+
+// -----------------------------------------------------------------------------
+// VIEW_LIST
+// ?description
+// -----------------------------------------------------------------------------
+//
+STRUCT VIEW_LIST
+    {
+    WORD command;
+    STRUCT items[];
+    }
+
+// -----------------------------------------------------------------------------
+// VIEW_LINK
+// ?description
+// -----------------------------------------------------------------------------
+//
+STRUCT VIEW_LINK
+    {
+    LTEXT txt;
+    LLINK link = 0;
+    }
+#endif // VCXNSSETTINGSVIEW_RH
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/feedsettingsviews/inc/feedsettingsviewaddoreditservice.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,146 @@
+/*
+* Copyright (c) 2006-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:    Class for "Add/edit service list" in Settings UI.*
+*/
+
+
+
+
+#ifndef VCXNSSETTINGSVIEWADDOREDITSERVICE_H
+#define VCXNSSETTINGSVIEWADDOREDITSERVICE_H
+
+// INCLUDES
+#include "feedsettingsviewcontainer.h"
+
+// CLASS DECLARATION
+/**
+ * Class for "Add/edit service list" in Settings UI.
+ *
+ *  @lib vcsettingsview.lib
+ *  @since S60 3.2
+ */
+NONSHARABLE_CLASS( CVcxNsSettingsViewAddOrEditService ) : public CBase
+    {
+public: // Constructors and desctructor.
+
+    /**
+     * Dynamic construction.
+     *
+     * @param aParent      Pointer to parent container.
+     * @param aServiceSettings Reference to Service Settings in UI Engine.
+     * @return New class object.
+     */
+    static CVcxNsSettingsViewAddOrEditService* NewL(
+            CVcxNsSettingsViewContainer* aParent,
+            CVcxNsServiceSettings& aServiceSettings );
+
+    /**
+     * Destructor.
+     */
+    virtual ~CVcxNsSettingsViewAddOrEditService();
+
+public:
+
+    /**
+     * Activates "add/edit service list".
+     */
+    void ActivateL();
+
+    /**
+     * Deactivates "add/edit service list".
+     */
+    void Deactivate();
+
+    /**
+     * Loads data to "add/edit service list".
+     *
+     * @param aAdding      ETrue if adding a service, EFalse if editing.
+     * @param aServiceType Type of service as CIptvService::TServiceType enumeration.
+     */
+    void LoadL( TBool aAdding, CIptvService::TServiceType aServiceType );
+
+    /**
+     * Saves data in "add/edit service list".
+     */
+    void SaveL();
+
+    /**
+     * Returns pointer to "add/edit service" listbox. No ownership transfer.
+     *
+     * @return Pointer to listbox.
+     */
+    CVcxNsSettingsViewAddServiceListbox* ListBox();
+
+private:
+
+    /** 
+     * Constructor.
+     *
+     * @param aParent      Pointer to parent container.
+     * @param aServiceSettings Reference to Service Settings in UI Engine.
+     */
+    CVcxNsSettingsViewAddOrEditService(
+            CVcxNsSettingsViewContainer* aParent,
+            CVcxNsServiceSettings& aServiceSettings );
+
+    /**
+     * EPOC constructor.
+     */
+    void ConstructL();
+
+private: // Data
+
+    /**
+     * Parent control container
+     */
+    CVcxNsSettingsViewContainer* iParent;
+    
+    /**
+     * UI engine's application settings provider
+     */   
+    CVcxNsServiceSettings& iServiceSettings;
+    
+    /**
+     * List box control
+     */    
+    CVcxNsSettingsViewAddServiceListbox* iListbox;
+
+    /**
+     * Service type
+     */
+    CIptvService::TServiceType iServiceType;
+    
+    /**
+     * Service name
+     */
+    TBuf<KIptvSmServicesDbNameMaxLength> iAddServiceName;
+    
+    /**
+     * Service address
+     */
+    TBuf<KIptvSmServicesDbAddressMaxLength> iAddServiceAddress;
+    
+    /**
+     * Service's old address
+     */
+    TBuf<KIptvSmServicesDbAddressMaxLength> iPreviousAddress;
+
+    /**
+     * Service plugin type
+     */
+    TInt iAddServicePluginType;
+
+    };
+
+#endif // VCXNSSETTINGSVIEWADDOREDITSERVICE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/feedsettingsviews/inc/feedsettingsviewaddservicelistbox.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,162 @@
+/*
+* Copyright (c) 2002-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:    Class for Add Service list in Settings UI.*
+*/
+
+
+
+
+#ifndef VCXNSSETTINGSVIEWADDSERVICELISTBOX_H
+#define VCXNSSETTINGSVIEWADDSERVICELISTBOX_H
+
+// INCLUDES
+#include <aknsettingitemlist.h>
+
+// FORWARD DECLARATIONS
+class CVcxNsSettingsViewContainer;
+
+// CLASS DECLARATION
+
+/**
+ * The settings list for "add/edit service list". Used by class 
+ * CVcSettingsViewAddOrEditService. Part of Settings UI.
+ *
+ *  @lib vcsettingsview.lib
+ *  @since S60 3.2
+ */
+NONSHARABLE_CLASS( CVcxNsSettingsViewAddServiceListbox ) : public CAknSettingItemList
+    {
+public:
+
+    /**
+     * Constructor.
+     *
+     * @param aParent      Parent container.
+     * @param aServiceName Reference to data member where service name is stored.
+     * @param aAddress     Reference to data member where service address is stored.
+     * @param aPluginType  Reference to data member where service type is stored.
+     */
+    CVcxNsSettingsViewAddServiceListbox(CVcxNsSettingsViewContainer* aParent,
+            TDes& aServiceName,
+            TDes& aAddress,
+            TInt& aPluginType );
+
+    /**
+     * Updates the internal references to data.
+     * Set input data to variables before calling this method.
+     *
+     * @param aAdding      ETrue if adding a service, EFalse if editing.
+     * @param aServiceName Reference to data member where service name is stored.
+     * @param aAddress     Reference to data member where service address is stored.
+     * @param aServiceType Service type.
+     * @param aPluginType  Reference to data member where plugin type is stored.
+     */
+    void LoadAddServiceInformationL(TBool aAdding,
+            TDes& aServiceName,
+            TDes& aAddress,
+            CIptvService::TServiceType aServiceType, 
+            TInt& aPluginType );
+
+    /*
+     * Copies data from UI (this list) to referenced data variables.
+     */
+    void SaveAddServiceInformationL();
+
+    /**
+     * Is list shown for adding new item or for editing old.
+     *
+     * @return ETrue if adding a service, EFalse if editing.
+     */
+    TBool IsAdding();
+
+    /**
+     * Creates SettingItem. Overridden from CAknSettingItemList
+     *
+     * @param identifier Index numbre of the setting item to create.
+     * @return pointer to new CAknSettingItem object.
+     */
+    CAknSettingItem* CreateSettingItemL(TInt identifier);
+
+    /**
+     * Opens editor for current setting item.
+     */
+    void EditCurrentItemL();
+
+public:
+    /**
+     * From CCoeControl. 
+     */
+    TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent,TEventCode aType );
+
+    /**
+     * Event handling section, from MEikListBoxObserver.
+     */
+    void HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aListBoxEvent );
+
+private:
+
+    /**
+     * From CCoeControl. Called by framework when the size is changed.
+     */
+    void SizeChanged();
+
+private: // Data
+
+    /**
+     * Parent control container
+     */
+    CVcxNsSettingsViewContainer* iParent;
+
+    /**
+     * ServiceName setting item
+     */
+    CAknTextSettingItem* iServiceNameItem;
+    
+    /**
+     * Address setting item
+     */
+    CAknTextSettingItem* iAddressItem;
+
+    /**
+     * Service type
+     */
+    CIptvService::TServiceType iServiceType;
+    
+    /**
+     * Plugin type item
+     */
+    CAknEnumeratedTextPopupSettingItem* iPluginTypeItem;
+
+    /**
+     * Is adding ongoing
+     */
+    TBool iAdding;
+    
+    /**
+     * Service Name
+     */
+    TDes& iServiceName;
+    
+    /**
+     * Address
+     */
+    TDes& iAddress;
+
+    /**
+     * Service plugin type
+     */
+    TInt& iServicePluginType;
+    };
+
+#endif // VCXNSSETTINGSVIEWADDSERVICELISTBOX_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/feedsettingsviews/inc/feedsettingsviewcontainer.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,366 @@
+/*
+* 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:    Container class for Setting view.*
+*/
+
+
+
+
+#ifndef VCSETTINGSVIEWSETTINGSVIEWCONTAINER_H
+#define VCSETTINGSVIEWSETTINGSVIEWCONTAINER_H
+
+// INCLUDES
+#include <coecntrl.h>
+#include <eikfrlb.h>
+#include <AknIconArray.h> 
+
+#include "CIptvService.h"
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+class CVcxNsSettingsView;
+class CVcxNsSettingsViewSettingsListbox;
+class CAknSingleGraphicStyleListBox;
+class CVcxNsSettingsViewAddServiceListbox;
+class CAknSingleNumberStyleListBox;
+class CVcxNsSettingsEngine;
+class CVcxNsSettingsViewSettingItem;
+class CVcxNsSettingsViewServiceType;
+class CVcxNsSettingsViewServiceSelection;
+class CVcxNsSettingsViewAddOrEditService;
+class CVcSettingsViewChangePriority;
+class CVcxNsServiceSettings;
+
+class CAknViewAppUi;
+
+enum TSettingsViewActiveList
+    {
+    /*
+    ESettingItem = 1,
+    EConnectionSettings,
+    EServiceType,
+    */
+    EServiceSelection = 1,
+    EAddService
+    };
+
+// CLASS DECLARATION
+
+/**
+ * Container class for Setting view.
+ *
+ *  @lib vcsettingsview.lib
+ *  @since S60 3.2
+ */
+NONSHARABLE_CLASS( CVcxNsSettingsViewContainer ) : public CCoeControl, public MEikListBoxObserver
+    {
+public: // Enumerations.
+
+    enum TMenuItemType
+        {
+        EGeneral = 1,
+        EConst,
+        EConstAndInfo,
+        EEditable
+        };
+
+public: // Construction and destruction.
+
+    /**
+     * @param aAppUi       Reference to application's App Ui.
+     * @param aAppSettings Reference to UI Engine's AppSettings.
+     * @param aParentView  Pointer to parent view.
+     * @param aFs          Reference to RFs session.
+     */
+    CVcxNsSettingsViewContainer( CAknViewAppUi& aAppUi,
+                                 CVcxNsSettingsEngine& aAppSettings,
+            CVcxNsServiceSettings& aServiceSettings,
+                                 CVcxNsSettingsView* aParentView,
+                                 RFs& aFs);
+
+    /**
+     * @param aRect Frame rectangle for container.
+     */
+    void ConstructL(const TRect& aRect);
+
+    ~CVcxNsSettingsViewContainer();
+
+    /**
+     * From CCoeControl
+     * Called by framework when help is launched. Returns currently
+     * active view's help content.
+     * @param aContext On return, help context.
+     */
+    void GetHelpContext( TCoeHelpContext& aContext ) const;
+
+public:
+
+    /**
+     * Returns pointer to App Ui.
+     *
+     * @return Pointer to App Ui.
+     */
+    CAknViewAppUi* AppUi();
+
+    /**
+     * Returns pointer to Settings view.
+     *
+     * @return Pointer to Settings view.
+     */
+    CVcxNsSettingsView* SettingsView();
+
+    /**
+     * Returns pointer to Service Selection.
+     *
+     * @return Pointer to Service Selection.
+     */
+    CVcxNsSettingsViewServiceSelection* ServiceSelection();
+
+    /**
+     * Switches "service selection list" visible.
+     */
+    void SwitchToServiceSelectionListL();
+
+    /**
+     * Switches "service selection list" of type Vod visible.
+     *
+     * @param aServiceType Type of service
+     */
+    void SwitchToServiceSelectionListL( CIptvService::TServiceType aServiceType );
+
+    /**
+     * Closes "service selection list".
+     */
+    void FinishServiceSelectionList();
+
+    /**
+     * Sets title for this view.
+     *
+     * @param aResourceId   Title resource id.
+     */
+    void SetTitleL( TInt aResourceId );
+    
+    /**
+     * Switches "add/edit service list" visible.
+     */
+    void SwitchToAddOrEditServiceListL();
+
+    /**
+     * Returns type of currently active list.
+     *
+     * @return One of TSettingsViewActiveList enumerations.
+     */
+    TSettingsViewActiveList GetActiveList()
+        {return(iActiveList);}
+
+    /**
+     * Deletes currently active video service.
+     * Functional only in "service selection list".
+     */
+    void DeleteVideoServiceL();
+
+    /**
+     * Returns current service type of "service selection list".
+     *
+     * @return Service type as CIptvService::TServiceType enumeration.
+     */
+    CIptvService::TServiceType GetServiceSelectionServiceType();
+
+    /**
+     * Loads/updates data to "add/edit service list".
+     *
+     * @param aAdding ETrue if list will be used for adding,
+     *                EFalse if it will be used for editing.
+     */
+    void LoadAddServiceInformationL(TBool aAdding);
+
+    /**
+     * Saves data from "add/edit service list".
+     */
+    void SaveAddServiceInformationL();
+
+    /**
+     * Saves data (=selections) from "service selection list".
+     */
+    void SaveServiceSelectionInformationL();
+
+    /**
+     * Opens current setting item for editing.
+     *
+     * @param aCalledFromMenu ETrue if edit request comes from menu.
+     */
+    void EditCurrentSettingItemListItemL(TBool aCalledFromMenu);
+
+    /**
+     * Opens dialog with video service details.
+     * Functional only in "service selection list".
+     */
+    void ShowVideoServiceDetailsL();
+
+    /**
+     * Handles mark commands received from menu.
+     * Functional only in "service selection list".
+     *
+     * @param aCommand Mark command.
+     */
+    void HandleMarkCommandL(TInt aCommand);
+
+    /**
+     * Key event handler. 
+     * Note: Changed to public for key routing.
+     */
+    TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
+    
+    /**
+     * Returns true if "mark" menu item can be shown for current list item.
+     * Functional only in "service selection list".
+     *
+     * @return ETrue if "mark" menu item can be shown.
+     */
+    TBool ShowMarkForCurrentListItemL();
+
+    /**
+     * Returns true if "unmark" menu item can be shown for current list item.
+     * Functional only in "service selection list".
+     *
+     * @return ETrue if "unmark" menu item can be shown.
+     */
+    TBool ShowUnmarkForCurrentListItemL();
+
+    /**
+     * Returns true if menu item of given type can be shown for current list item.
+     * Functional only in "service selection list".
+     *
+     * @param aMenuItemType Menu item type as TMenuItemType enumeration.
+     * @return ETrue if given menu item can be shown.
+     */
+    TBool ShowMenuItemForCurrentListItemL(TMenuItemType aMenuItemType);
+
+    /**
+     * Load Vodcast data to "Add feed" view. Used when add feed called directly 
+     * from Vodcast view.
+     */
+    void LoadAddVodCastFeedL();
+
+    /**
+     * From MEikListBoxObserver
+     * Event message handler to be used for the service type, 
+     * selection and add/edit Listboxes.
+     *
+     * @param *aListBox not used in this context
+     * @param aEventType A code for the event.
+     */
+    void HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aEventType);
+    
+private:
+
+    /**
+     * Returns true if current list item is marked.
+     * Functional only in "service selection list".
+     */
+    TBool IsCurrentListItemMarked();
+
+    /**
+     * From CoeControl. Called when container size changes.
+     */
+    void SizeChanged();
+
+    /**
+     * From CoeControl. Returns count of controls in container.
+     */
+    TInt CountComponentControls() const;
+
+    /**
+     * From CCoeControl. Returns a specific control in container.
+     */
+    CCoeControl* ComponentControl(TInt aIndex) const;
+
+    /**
+     * From CCoeControl. Handle global resource change.
+     */
+    void HandleResourceChange(TInt aType);
+
+    /**
+     * From CCoeControl. Draws container.
+     */
+    void Draw(const TRect& aRect) const;
+
+    /**
+     * 
+     */
+    TInt TitleResourceId();    
+    
+public:
+    /**
+     * Zeroes interal msk tracker. DOES NOT ACTUALLY CLEAR MSK!
+     */
+    void ClearMsk();
+
+    /**
+     * Check if the msk need update and updates if needed
+     */
+    void CheckMsk();
+
+private: // Data
+
+    /**
+     * App UI
+     */
+    CAknViewAppUi& iAppUi;
+    
+    /**
+     * reference to Settings engine
+     */
+    CVcxNsSettingsEngine& iAppSettings;
+
+    /**
+     * UI engine's service settings provider
+     */
+    CVcxNsServiceSettings& iServiceSettings;
+    
+    /**
+     * Parent View
+     */
+    CVcxNsSettingsView* iParentView;
+
+    /**
+     * iFs
+     */
+    RFs& iFs;
+    
+    /**
+     * Currently active setting item list
+     */
+    TSettingsViewActiveList iActiveList;
+    
+    /**
+     * Current MSK resource id
+     */
+    TInt iCurrentMskResource;
+    
+    /**
+     * Service selection setting item
+     */
+    CVcxNsSettingsViewServiceSelection* iServiceSelection;
+    
+    /**
+     * Add or edit service setting item
+     */
+    CVcxNsSettingsViewAddOrEditService* iAddOrEditService;
+
+    };
+
+#endif // VCSETTINGSVIEWSETTINGSVIEWCONTAINER_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/feedsettingsviews/inc/feedsettingsviewremoveservicequerydialog.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,84 @@
+/*
+* Copyright (c) 2006-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:    Query dialog class*
+*/
+
+
+
+
+#ifndef CIPTVREMOVESERVICEQUERYDIALOG_H
+#define CIPTVREMOVESERVICEQUERYDIALOG_H
+
+// INCLUDES
+#include <e32std.h>
+#include <aknmessagequerydialog.h> 
+
+/**
+ *  Class for service remoce confirmation query
+ *
+ *  @lib vcsettingsview.lib
+ *  @since S60 3.2
+ */
+
+// CLASS DECLARATION
+NONSHARABLE_CLASS( CVcxNsSettingsViewRemoveServiceQueryDialog ) : public CAknMessageQueryDialog
+    {
+    
+public:
+
+    /**
+     * @param aMessageText Message text inside query.
+     */
+    static CVcxNsSettingsViewRemoveServiceQueryDialog* NewL( const TDesC& aMessageText );
+
+    virtual ~CVcxNsSettingsViewRemoveServiceQueryDialog();
+
+private: // New functions           
+
+    CVcxNsSettingsViewRemoveServiceQueryDialog( );
+
+    /**
+     * @param aMessageText Message text inside query.
+     */
+    void ConstructL( const TDesC& aMessageText );
+
+    /**
+     * From @ CCoeControl.
+     * Handles key events.
+     */
+    TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode );
+
+    /**
+     * From CAknQueryDialog
+     * Called to confirm that's OK to exit.
+     */
+    TBool OkToExitL( TInt aButtonId );
+
+    /**
+     * From CAknQueryDialog
+     * Called by OfferkeyEventL(), gives a change to dismiss the query even with
+     * keys different than Enter of Ok.
+     * @param aMessageText Message text inside query.
+     */
+    TBool NeedToDismissQueryL(const TKeyEvent& aKeyEvent);
+
+    /**
+     * From CAknQueryDialog
+     * Acts on the menu selection if menu is showing.
+     */
+    void ProcessCommandL( TInt aCommandId );
+     
+    };
+
+#endif  // CIPTVREMOVESERVICEQUERYDIALOG_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/feedsettingsviews/inc/feedsettingsviewserviceselection.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,251 @@
+/*
+* Copyright (c) 2006-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:    Class for "service selection list" in Settings UI.*
+*/
+
+
+
+#ifndef VCXNSSETTINGSVIEWSERVICESELECTION_H
+#define VCXNSSETTINGSVIEWSERVICESELECTION_H
+
+// INCLUDES
+#include <AknServerApp.h>
+#include "feedsettingsviewcontainer.h"
+#include "CIptvService.h"
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+class CAknDoubleStyleListBox;
+class CIptvService;
+class CVcxConnectionUtility;
+class CBrowserLauncher;
+
+class CIptvLiveUIScheduledProgram;
+
+// CLASS DECLARATION
+
+/**
+ * Class for "service selection list" in Settings UI.
+ *
+ *  @lib vcsettingsview.lib
+ *  @since S60 3.2
+ */
+NONSHARABLE_CLASS( CVcxNsSettingsViewServiceSelection ) : public CBase,
+                                                          public MAknServerAppExitObserver
+    {
+public: // Constructors and desctructor.
+
+    /**
+     * @param aParent      Pointer to parent container.
+     * @param aServiceSettings Reference to Service Settings in UI Engine.
+     */
+    static CVcxNsSettingsViewServiceSelection* NewL(CVcxNsSettingsViewContainer* aParent,
+            CVcxNsServiceSettings& aServiceSettings);
+
+    virtual ~CVcxNsSettingsViewServiceSelection();
+
+    /**
+     * Checks if msk needs tp be updated and does so if it is needed
+     */
+    void CheckMsk( );
+    
+protected: //From MAknServerAppExitObserver
+
+    /**
+     * Handle the exit of a connected server app.
+     * This implementation provides Series 60 default behavior
+     * for handling of the EAknCmdExit exit code. Derived classes
+     * should base-call this implementation if they override this
+     * function.
+     * @param aReason The reason that the server application exited.
+     * This will either be an error code, or the command id that caused
+     * the server app to exit.
+     * ( empty implementation here )
+     */
+     void HandleServerAppExit( TInt /*aReason*/) { ; }
+
+private:
+    /**
+     * Returns true if currently active list item is marked.
+     *
+     * @return ETrue if currently active list item is marked.
+     */
+    TBool IsCurrentListItemMarked();
+
+public:
+
+    /**
+     * Activates "service selection list".
+     */
+    void ActivateL();
+
+    /**
+     * Deactivates "service selection list".
+     */
+    void Deactivate();
+
+    /**
+     * Sets service type used in "service selection list".
+     *
+     * @param aServiceType Service type as CIptvService::TServiceType 
+     *                     enumeration.
+     */
+    void SetServiceType(CIptvService::TServiceType aServiceType);
+
+    /**
+     * Returns service type in use.
+     *
+     * @return Service type as CIptvService::TServiceType enumeration.
+     */
+    CIptvService::TServiceType GetServiceType();
+
+    /**
+     * Returns true if currently active service is read-only.
+     *
+     * @return ETrue if currently active service is read-only.
+     */
+    TBool IsCurrentServiceReadOnlyL();
+
+    /**
+     * Returns currently active service. Ownership of object is given
+     * to caller.
+     *
+     * @return Pointer to currently active service.
+     */
+    CIptvService* GetCurrentServiceL();
+
+    /**
+     * Deletes currently active service.
+     */
+    void DeleteCurrentServiceL();
+
+    /**
+     * Loads data to "service selection list".
+     */
+    void LoadL();
+
+    /**
+     * Saves data in "service selection list".
+     */
+    void SaveL();
+
+    /**
+     * Returns pointer to "service selection item" listbox. No ownership transfer.
+     *
+     * @return Pointer to listbox.
+     */
+    CAknSingleGraphicStyleListBox* ListBox();
+
+    /**
+     * Shows message query dialog for managing an account before removing service
+     *
+     * @return Dialog's result, what user has replied to query.
+     */
+    TInt ShowAccountMgmtDialogL();
+
+    /**
+     * Used as a callback function in message query.
+     * @return System-wide error code.
+     */
+    static TInt ShowLinkL( TAny* ptr );
+
+    /**
+     * Opens account management Url with embedded browser.
+     */ 
+    void OpenEmbeddedBrowserL( const TDesC& aUri );
+    
+private: // New methods.
+
+    /**
+     * Gets current service id.
+     *
+     * @param aServiceId service id
+     */
+    void GetServiceIdL( TUint32& aServiceId );
+
+    /**
+     * Removes commands from CBA
+     * @param aCba Button group container
+     */
+    void RemoveCommandsFromCba( CEikButtonGroupContainer& aCba );
+
+private: // Construction.
+
+    /**
+     * @param aParent      Pointer to parent container.
+     * @param aServiceSettings Reference to Service Settings in UI Engine.
+     */
+    CVcxNsSettingsViewServiceSelection(CVcxNsSettingsViewContainer* aParent,
+            CVcxNsServiceSettings& aServiceSettings);
+
+    void ConstructL();
+
+private: // Data
+
+    /**
+     * Parent control container
+     */
+    CVcxNsSettingsViewContainer* iParent;
+    
+    /**
+     * UI engine's application settings provider
+     */
+    CVcxNsServiceSettings& iServiceSettings;
+    
+    /**
+     * List box control
+     */
+    CAknSingleGraphicStyleListBox* iListbox;
+
+    /**
+     * Is own command set used
+     */ 
+    TBool iOwnButtons;
+
+    /**
+     * Service array
+     */
+    CDesC8ArraySeg* iServicesArray;
+
+    /**
+     * Service array for vod casts
+     */
+    CDesC8ArraySeg* iServicesArrayVodCast;
+      
+    /**
+     * Service type
+     */
+    CIptvService::TServiceType iServiceType;
+    
+    /**
+     * Current Msk resource id.
+     */
+    TInt iCurrentMskResource;
+    
+    /*
+    * Launcher that handles opening of web link in embedded browser
+    * Own.
+    */
+    CBrowserLauncher* iLauncher;
+
+    /**
+     * Connection utility.
+     * Not own.
+     */
+    CVcxConnectionUtility* iConnUtil;
+    
+    };
+
+#endif // VCXNSSETTINGSVIEWSERVICESELECTION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/feedsettingsviews/rom/feedsettingsviews.iby	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2005 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:   feedsettingsviews ROM*
+*/
+
+
+// Version : %version: 2 %
+
+#ifndef __FEEDSETTINGSVIEWS_IBY__
+#define __FEEDSETTINGSVIEWS_IBY__
+
+#include <data_caging_paths_for_iby.hrh>
+
+file=ABI_DIR\BUILD_DIR\vcxnssettingsview.dll	SHARED_LIB_DIR\vcxnssettingsview.dll
+
+#endif //__FEEDSETTINGSVIEWS_IBY__
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/feedsettingsviews/rom/feedsettingsviewsresources.iby	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2005 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:   feedsettingsviews ROM*
+*/
+
+
+// Version : %version: 3 %
+
+#ifndef __FEEDSETTINGSVIEWSRESOURCES_IBY__
+#define __FEEDSETTINGSVIEWSRESOURCES_IBY__
+
+#include <data_caging_paths_for_iby.hrh>
+
+data=DATAZ_\APP_RESOURCE_DIR\vcxnssettingsview.rsc 	APP_RESOURCE_DIR\vcxnssettingsview.rsc
+
+#endif // __FEEDSETTINGSVIEWSRESOURCES_IBY__
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/feedsettingsviews/rss/vcxnssettingsview.rss	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,820 @@
+/*
+* Copyright (c) 2007-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:    Resource definitions for Video Center Settings view*
+*/
+
+
+
+
+//  RESOURCE IDENTIFIER
+NAME	IPST // 4 letter ID
+
+//  INCLUDES
+
+#include <avkon.rh>
+#include <avkon.rsg>
+#include <eikon.rh>
+#include <eikon.rsg>
+#include <avkon.loc>
+#include <avkon.hrh>
+#include <avkon.mbg>
+#include <AvkonIcons.hrh>   // AVKON_ICON_FILE( Path to avkon.mbm file )
+#include <appinfo.rh>
+#include <data_caging_paths_strings.hrh>
+#include <bldvariant.hrh>
+
+#ifdef RD_MULTIPLE_DRIVE_ENABLERS
+#include <CommonDialogs.hrh> // Enumerations
+#include <CommonDialogs.rh>  // Resource structures
+#endif // RD_MULTIPLE_DRIVE_ENABLERS
+
+#include <ipvideo.loc>
+
+#include "feedsettingsview.hrh"
+#include "feedsettingsview.rh"
+
+#define POPFIELD_TEXT_WIDTH  8
+
+//  RESOURCE DEFINITIONS 
+
+RESOURCE RSS_SIGNATURE { }
+
+RESOURCE TBUF { buf = "vcnssettingsview"; }
+
+// -----------------------------------------------------------------------------
+//   
+// r_vcsettingsview_settingsview
+// Defines my app settings view.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_vcsettingsview_settingsview
+    {
+    menubar = r_vcsettingsview_settingsview_menubar;
+    cba = r_vcsettingsview_settingsview_buttons_msk;
+    }
+
+// -----------------------------------------------------------------------------
+//   
+// r_vcsettingsview_settingsview_menubar
+// Menu title definition.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_vcsettingsview_settingsview_menubar
+    {
+    titles =
+        {
+        MENU_TITLE 
+            { 
+            menu_pane = r_vcsettingsview_settingsview_menu; 
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//   
+// r_vcsettingsview_settingsview_menu
+// "Options" menu definition
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_vcsettingsview_settingsview_menu 
+    {
+    items =
+        {
+        //
+        // For settings view: Open, Change.
+        //
+        MENU_ITEM
+            { 
+            command = EVcSettingsViewCmdOpen; 
+            txt = qtn_iptv_open_service_selection_setting;
+            flags = EEikMenuItemAction;
+            },
+        MENU_ITEM 
+            { 
+            command = EVcSettingsViewCmdChange; 
+            txt = qtn_iptv_change_setting;
+            flags = EEikMenuItemAction;
+            },  
+        //
+        // Common parts of video service selection.
+        //
+        MENU_ITEM 
+            { 
+            command = EVcSettingsServiceCmdMark; 
+            txt = qtn_iptv_mark_service;
+            flags = EEikMenuItemAction;
+            },
+        MENU_ITEM 
+            { 
+            command = EVcSettingsServiceCmdUnmark; 
+            txt = qtn_iptv_unmark_service;
+            flags = EEikMenuItemAction;
+            },
+        //
+        // Video service selection: Vod service selection
+        // Video service details, Edit video service, Remove video service, Add video service
+        //                    
+        MENU_ITEM 
+            { 
+            command = EVcSettingsServiceCmdVodDetails; 
+            txt = qtn_iptv_feed_details;
+            flags = EEikMenuItemSpecific;
+            },
+        MENU_ITEM 
+            { 
+            command = EVcSettingsServiceCmdVodEdit; 
+            txt = qtn_iptv_edit_feed;
+            flags = EEikMenuItemSpecific;
+            },
+        MENU_ITEM 
+            { 
+            command = EVcSettingsServiceCmdVodRemove; 
+            txt = qtn_iptv_remove_feed;
+            flags = EEikMenuItemSpecific;
+            },
+        MENU_ITEM 
+            { 
+            command = EVcSettingsServiceCmdVodAdd; 
+            txt = qtn_iptv_add_feed;
+            },
+        //
+        // Video service selection: Vodcast service selection
+        // Feed details, Edit feed, Remove feed, Add feed
+        //
+        MENU_ITEM 
+            { 
+            command = EVcSettingsServiceCmdVodcastDetails; 
+            txt = qtn_iptv_feed_details;
+            flags = EEikMenuItemSpecific;
+            },
+        MENU_ITEM 
+            { 
+            command = EVcSettingsServiceCmdVodcastEdit; 
+            txt = qtn_iptv_edit_feed;
+            flags = EEikMenuItemSpecific;
+            },
+        MENU_ITEM 
+            { 
+            command = EVcSettingsServiceCmdVodcastRemove; 
+            txt = qtn_iptv_remove_feed;
+            flags = EEikMenuItemSpecific;
+            },
+        MENU_ITEM 
+            { 
+            command = EVcSettingsServiceCmdVodcastAdd; 
+            txt = qtn_iptv_add_feed;
+            },
+        //
+        // Video service selection: Web link service selection
+        // Web link details, Remove web link
+        //
+        MENU_ITEM 
+            {
+            command = EVcSettingsServiceCmdWebLinkDetails; 
+            txt = qtn_iptv_web_link_details;
+            flags = EEikMenuItemSpecific;
+            },
+        MENU_ITEM 
+            {
+            command = EVcSettingsServiceCmdWebLinkRemove; 
+            txt = qtn_iptv_remove_web_link;
+            flags = EEikMenuItemSpecific;
+            },
+        //
+        // For Add service view: Change.
+        //
+        MENU_ITEM
+            {
+            command = EVcSettingsViewAddServiceCmdChange;
+            txt = qtn_iptv_change_setting;
+            flags = EEikMenuItemAction;
+            },
+        //
+        // Common: Help, Exit
+        //
+        MENU_ITEM 
+            { 
+            command = EVcSettingsViewCmdHelp; 
+            txt = qtn_options_help;
+            },
+        MENU_ITEM 
+            { 
+            command = EVcSettingsViewCmdExit; 
+            txt = qtn_options_exit; 
+            }
+        };
+    }
+
+//----------------------------------------------------------------------------
+// r_vcsettingsview_addservice_list
+// Add/Edit service: Setting item list
+//----------------------------------------------------------------------------
+//
+RESOURCE AVKON_SETTING_ITEM_LIST r_vcsettingsview_addservice_list
+    {
+    items =
+        {
+        AVKON_SETTING_ITEM
+            {
+            identifier = EVcSettingsViewAddServiceServiceNameItem;
+            setting_page_resource = r_vcsettingsview_addservice_servicename_page;
+            name = qtn_iptv_service_name;
+            },        
+        AVKON_SETTING_ITEM
+            {
+            identifier = EVcSettingsViewAddServiceAddressItem;
+            setting_page_resource = r_vcsettingsview_addservice_address_page;
+            name = qtn_iptv_service_address;
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+// r_vcsettingsview_addservice_servicename_page
+// Add/Edit service: Name page
+// -----------------------------------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_vcsettingsview_addservice_servicename_page
+    {
+    type = EEikCtEdwin;
+    editor_resource_id = r_vcsettingsview_addservice_servicename_editor;
+    }
+
+// -----------------------------------------------------------------------------
+// r_vcsettingsview_addservice_address_page
+// Add/Edit service: Address page
+// -----------------------------------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_vcsettingsview_addservice_address_page
+    {
+    type = EEikCtEdwin;
+    editor_resource_id = r_vcsettingsview_addservice_address_editor;
+    }
+
+// -----------------------------------------------------------------------------
+// r_vcsettingsview_addservice_servicename_editor
+// Add/Edit service: Name editor
+// -----------------------------------------------------------------------------
+//
+RESOURCE EDWIN r_vcsettingsview_addservice_servicename_editor
+    {
+    maxlength = 80;
+    lines = 3;
+    allowed_input_modes = EAknEditorTextInputMode | EAknEditorNumericInputMode; 
+    default_input_mode = EAknEditorTextInputMode;
+    flags = EEikEdwinAutoSelection | EAknEditorLowerCase | EEikEdwinNoLineOrParaBreaks;
+    }
+
+// -----------------------------------------------------------------------------
+// r_vcsettingsview_addservice_address_editor
+// Add/Edit service: Address editor
+// -----------------------------------------------------------------------------
+//
+RESOURCE EDWIN r_vcsettingsview_addservice_address_editor
+    {
+    maxlength = 255;
+    lines = 3;
+    special_character_table = R_AVKON_URL_SPECIAL_CHARACTER_TABLE_DIALOG;
+    allowed_input_modes = EAknEditorTextInputMode | EAknEditorNumericInputMode; 
+    default_input_mode = EAknEditorTextInputMode;
+    default_case = EAknEditorLowerCase;
+    flags = EEikEdwinAutoSelection | EAknEditorLowerCase | EEikEdwinNoLineOrParaBreaks;
+    }
+    
+// -----------------------------------------------------------------------------
+// r_vcsettingsview_servicedetails_query
+// Service details dialog
+// -----------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_vcsettingsview_servicedetails_query
+    {
+    flags = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_OK_EMPTY;
+    items =
+        {
+        DLG_LINE 
+            {
+            type = EAknCtPopupHeadingPane;
+            id = EAknMessageQueryHeaderId;
+            control = AVKON_HEADING
+                {
+                label = qtn_iptv_details_header;
+                headinglayout = R_AVKON_WML_SIGN_QUERY_HEADING_PANE;
+                };
+            },
+        DLG_LINE
+            {
+            type = EAknCtMessageQuery;
+            id = EAknMessageQueryContentId;
+            control = AVKON_MESSAGE_QUERY
+                {
+                };
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+// r_vcsettingsview_softkeys_remove_cancel
+// CBA buttons for r_vcsettingsview_remove_service_query
+//
+// ---------------------------------------------------------
+//
+RESOURCE CBA r_vcsettingsview_softkeys_remove_cancel
+    {
+    buttons =
+        {
+        CBA_BUTTON 
+            {
+            id = EAknSoftkeyOk; 
+            txt = qtn_iptv_remove_softkey;
+            },
+        AVKON_CBA_BUTTON
+            {
+            id = EAknSoftkeyCancel;
+            txt = text_softkey_cancel;
+            }
+        };
+    }
+
+//------------------------------------------------------------------------------
+//
+//    r_vcsettingsview_remove_service_query
+//
+//------------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_vcsettingsview_remove_service_query
+    {
+    flags = EGeneralQueryFlags | EEikDialogFlagNoBorder | EEikDialogFlagNoShadow;
+    buttons = r_vcsettingsview_softkeys_remove_cancel;
+    items =
+        {
+        DLG_LINE 
+            {
+            type = EAknCtPopupHeadingPane;
+            id = EAknMessageQueryHeaderId;
+            control = AVKON_HEADING
+                {
+                label = qtn_iptv_remove_service_header;
+                headinglayout = R_AVKON_WML_SIGN_QUERY_HEADING_PANE;
+                };
+            },
+        DLG_LINE
+            {
+            type = EAknCtMessageQuery;
+            id = EAknMessageQueryContentId;
+            control = AVKON_MESSAGE_QUERY
+                {
+                };
+            }
+        };
+    }
+
+// ----------------------------------------------------------------------------
+// r_vcsettingsview_remove_service_with_account
+// ----------------------------------------------------------------------------
+//    
+RESOURCE TBUF r_vcsettingsview_remove_service_with_account
+    {
+    buf = qtn_iptv_remove_service_with_account;
+    }
+    
+// ----------------------------------------------------------------------------
+// r_vcsettingsview_link_account
+// ----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcsettingsview_link_account
+    {
+    buf = qtn_iptv_link_account;
+    }
+
+// -----------------------------------------------------------------------------
+// r_vcsettingsview_delete_confirmation_query
+// -----------------------------------------------------------------------------
+//    
+RESOURCE DIALOG r_vcsettingsview_delete_confirmation_query
+	{
+	flags = EGeneralQueryFlags;
+	buttons = R_AVKON_SOFTKEYS_YES_NO;
+	items =
+		{
+		DLG_LINE
+			{
+			type = EAknCtQuery;
+			id = EGeneralQuery;
+			control = AVKON_CONFIRMATION_QUERY 
+				{ 
+				layout = EConfirmationLayout;
+				};
+			}
+		};
+	}  
+
+// -----------------------------------------------------------------------------
+// r_vcsettingsview_confirmation_query
+// Confirmation query with OK softkey
+// -----------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_vcsettingsview_confirmation_query
+    {
+    flags = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_OK_EMPTY;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtQuery;
+            id = EGeneralQuery;
+            control= AVKON_CONFIRMATION_QUERY 
+                { 
+                layout = EConfirmationLayout;
+                bmpfile= AVKON_BITMAP_FILE;
+                bmpid= EMbmAvkonQgn_note_error;
+                bmpmask= EMbmAvkonQgn_note_error_mask;
+                };
+            }
+        };
+    }
+
+//----------------------------------------------------------------------------
+//
+// VIDEO SERVICE SELECTION LIST BOX
+//
+//----------------------------------------------------------------------------
+//
+RESOURCE LISTBOX r_vcsettingsview_serviceselection_list
+    {
+    flags = EAknListBoxMultiselectionList;    
+    }
+
+// ---------------------------------------------------------
+//
+//    r_checkbox_icons
+//    Array for check box icons.
+//
+// ---------------------------------------------------------
+//
+RESOURCE AKN_ICON_ARRAY r_iptv_checkbox_icons
+    {
+    bmpfile = AVKON_ICON_FILE;
+    icons =
+	    {
+	    AKN_ICON
+    	    {
+    	    iconId = EMbmAvkonQgn_indi_checkbox_on;
+    	    maskId = EMbmAvkonQgn_indi_checkbox_on_mask;
+    	    },
+    	AKN_ICON
+    	    {
+    	    iconId = EMbmAvkonQgn_indi_checkbox_off;
+    	    maskId = EMbmAvkonQgn_indi_checkbox_off_mask;
+    	    }
+    	};
+    }
+
+// ---------------------------------------------------------
+// r_vcsettingsview_settingview_servicetype_softkeys
+// Settings UI, Service Type list softkeys.
+// ---------------------------------------------------------
+//
+RESOURCE CBA r_vcsettingsview_settingview_servicetype_softkeys
+    {
+    buttons =
+        {
+        CBA_BUTTON{id=EVcSettingsViewSoftkeySelect; txt=text_softkey_select; },
+        CBA_BUTTON{id=EVcSettingsViewSoftkeyBack; txt=text_softkey_back; },
+        CBA_BUTTON{id=EVcSettingsViewSoftkeySelect; txt=text_softkey_select; }
+        };
+    }
+
+// ---------------------------------------------------------
+// r_vcsettingsview_settingview_setting_subset_softkeys
+// Settings UI, Service Selection list softkeys.
+// ---------------------------------------------------------
+//
+RESOURCE CBA r_vcsettingsview_settingview_setting_subset_softkeys
+    {
+    buttons =
+        {
+        CBA_BUTTON{id=EAknSoftkeyOptions; txt=text_softkey_option; },
+        CBA_BUTTON{id=EVcSettingsViewSoftkeyDone; txt=text_softkey_done; }
+        };
+    }
+
+// ---------------------------------------------------------
+// r_vcsettingsview_settingview_changepriority_moving_softkeys
+// Settings UI, Change priority list softkeys when moving.
+// ---------------------------------------------------------
+//
+RESOURCE CBA r_vcsettingsview_settingview_changepriority_moving_softkeys
+    {
+    buttons =
+        {
+        CBA_BUTTON{id=EVcSettingsViewSoftkeyOk; txt=text_softkey_ok; },
+        CBA_BUTTON{id=EVcSettingsViewSoftkeyCancel; txt=text_softkey_cancel; },
+        CBA_BUTTON{id=EVcSettingsViewSoftkeyOk; txt=""; }
+        };
+    }
+
+// ----------------------------------------------------------------------------
+// r_vcsettingsview_changepriority_list
+// ----------------------------------------------------------------------------
+//
+RESOURCE LISTBOX r_vcsettingsview_changepriority_list
+    {
+    flags = EAknListBoxSelectionList | EAknListBoxMarkableList;
+    }
+
+// ----------------------------------------------------------------------------
+// r_iptv_title
+// ----------------------------------------------------------------------------
+//
+RESOURCE TITLE_PANE r_iptv_title
+    {
+    txt = qtn_vcx_title_suite;
+    }
+
+// ----------------------------------------------------------------------------
+// r_iptv_title_pane_settings_title
+// ----------------------------------------------------------------------------
+//
+RESOURCE TITLE_PANE r_iptv_title_pane_settings_title
+    {
+    txt = qtn_iptv_settings_title;
+    }
+
+// ----------------------------------------------------------------------------
+// r_iptv_service_selection_title
+// ----------------------------------------------------------------------------
+//
+RESOURCE TITLE_PANE r_iptv_service_selection_title
+    {
+    txt = qtn_iptv_service_selection_title;    
+    }
+
+// ----------------------------------------------------------------------------
+// r_iptv_new_service_default
+// "Default" Default text for a name of new service.
+// ----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_iptv_new_service_default
+    {
+    buf = qtn_iptv_new_service_default;
+    }
+
+// ----------------------------------------------------------------------------
+// r_iptv_remove_service_confirmation
+// "Remove video service %U?"
+// ----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_iptv_remove_service_confirmation
+    {
+    buf = qtn_iptv_remove_service_confirmation;
+    }
+
+// -----------------------------------------------------------------------------  
+// r_iptv_conf_deactivate_reminders
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_iptv_conf_deactivate_reminders
+    {
+    buf = qtn_iptv_conf_deactivate_reminders;
+    }
+
+// ----------------------------------------------------------------------------
+// r_iptv_remove_feed_confirmation
+// "Remove feed %U?"
+// ----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_iptv_remove_feed_confirmation
+    {
+    buf = qtn_iptv_remove_feed_confirmation;
+    }
+
+// ----------------------------------------------------------------------------
+// r_iptv_remove_web_link_confirmation
+// "Remove web link %U?"
+// ----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_iptv_remove_web_link_confirmation
+    {
+    buf = qtn_iptv_remove_web_link_confirmation;
+    }
+
+// ----------------------------------------------------------------------------
+// r_iptv_no_video_services
+// "No services"
+// ----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_iptv_no_video_services
+    {
+    buf = qtn_iptv_no_video_services;
+    }
+
+// ----------------------------------------------------------------------------
+// r_iptv_no_feeds_selected
+// "No feeds"
+// ----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_iptv_no_feeds_selected
+    {
+    buf = qtn_iptv_no_feeds_selected;
+    }
+
+// ----------------------------------------------------------------------------
+// r_iptv_no_web_links
+// "No links"
+// ----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_iptv_no_web_links
+    {
+    buf = qtn_iptv_no_web_links;
+    }
+
+// ----------------------------------------------------------------------------
+// r_iptv_query_common_conf_delete
+// "Delete? nnnnn"
+// ----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_iptv_query_common_conf_delete
+    {
+    buf = qtn_query_common_conf_delete;
+    }
+    
+// ----------------------------------------------------------------------------
+// r_iptv_user_defined_service
+// "User defined service"
+// ----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_iptv_user_defined_service
+    {
+    buf = qtn_iptv_user_defined_service;
+    }
+
+// ----------------------------------------------------------------------------
+// r_iptv_new_service_main
+// "Add services"
+// NOTE Replaces provisioned "Add service" text
+// ----------------------------------------------------------------------------
+//	
+RESOURCE TBUF r_iptv_new_service_main
+    {
+    buf = qtn_iptv_new_service_main;
+    }
+        
+// ----------------------------------------------------------------------------
+// r_iptv_video_directory_list
+// "Service directory"
+// NOTE Replaces provisioned "Service directory" text
+// ----------------------------------------------------------------------------
+//	
+RESOURCE TBUF r_iptv_video_directory_list
+    {
+    buf = qtn_vcx_ns_list_video_directory;
+    }
+
+//----------------------------------------------------
+//
+// r_vcsettingsview_msk_button_open
+//
+//----------------------------------------------------
+//
+RESOURCE CBA_BUTTON r_vcsettingsview_msk_button_open
+    {
+    id = EAknSoftkeyOpen;
+    txt = qtn_msk_open;
+    }
+
+//----------------------------------------------------
+//
+// r_vcsettingsview_msk_button_play
+//
+//----------------------------------------------------
+//
+RESOURCE CBA_BUTTON r_vcsettingsview_msk_button_play
+    {
+    id = EVcSettingsViewSoftkeyMSKPlay;
+    txt = qtn_msk_play;
+    }
+
+//----------------------------------------------------
+//
+// r_vcsettingsview_msk_empty
+//
+//----------------------------------------------------
+//
+RESOURCE CBA_BUTTON r_vcsettingsview_msk_empty
+    {
+    id = EVcSettingsViewSoftkeyMSKDoNothing;
+    txt = " ";
+    }
+
+//----------------------------------------------------
+//
+// r_vcsettingsview_msk_button_change
+//
+//----------------------------------------------------
+//
+RESOURCE CBA_BUTTON r_vcsettingsview_msk_button_change
+    {
+    id = EAknSoftkeyChange;
+    txt = qtn_msk_change;
+    }
+
+//----------------------------------------------------
+//
+// r_vcsettingsview_service_selection_msk_button_unmark
+//
+//----------------------------------------------------
+//
+RESOURCE CBA_BUTTON r_vcsettingsview_service_selection_msk_button_unmark
+    {
+    id = EVcSettingsServiceCmdUnmark;
+    txt = qtn_msk_unmark;
+    }
+
+//----------------------------------------------------
+//
+// r_vcsettingsview_service_selection_msk_button_mark
+//
+//----------------------------------------------------
+//
+RESOURCE CBA_BUTTON r_vcsettingsview_service_selection_msk_button_mark
+    {
+    id = EVcSettingsServiceCmdMark;
+    txt = qtn_msk_mark;
+    }
+
+//----------------------------------------------------
+//
+// r_vcsettingsview_service_selection_msk_button_select
+//
+//----------------------------------------------------
+//
+RESOURCE CBA_BUTTON r_vcsettingsview_service_selection_msk_button_select
+    {
+    id = EVcSettingsServiceCmdSelect;
+    txt = qtn_msk_select;
+    }
+      
+//----------------------------------------------------
+//
+//    r_vcsettingsview_settingsview_buttons_msk
+//
+//----------------------------------------------------
+//
+RESOURCE CBA r_vcsettingsview_settingsview_buttons_msk
+    {
+    buttons =
+        {
+        CBA_BUTTON{id=EAknSoftkeyOptions;            txt = text_softkey_option; },
+        CBA_BUTTON{id=EAknSoftkeyBack;               txt = text_softkey_back; },
+        CBA_BUTTON{id=EAknSoftkeyOpen;               txt = text_softkey_open; }
+        };
+    }    
+
+// ----------------------------------------------------------------------------
+// r_vcsettings_title_pane_settings_title
+// ----------------------------------------------------------------------------
+//
+RESOURCE TITLE_PANE r_vcsettings_title_pane_settings_title
+    {
+    txt = qtn_iptv_settings_title;
+    }
+
+//----------------------------------------------------------------------------
+//
+// R_VCSETTINGS_GENERALSETTINGS_VIDEOCENTER_CAPTION
+//
+//----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcsettings_generalsettings_videocenter_caption
+    {
+    buf = qtn_vcx_title_suite;
+    }
+
+//----------------------------------------------------
+//   
+//    r_mpsett_feeds_view_title
+//    Feeds view's title.
+//
+//----------------------------------------------------
+//-
+RESOURCE TITLE_PANE r_mpsett_feeds_view_title
+    {
+    txt = qtn_iptv_service_selection_setting;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/feedsettingsviews/src/feedsettingsview.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,854 @@
+/*
+* Copyright (c) 2007-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:    CVcSettingsView view class definitions.*
+*/
+
+
+
+// INCLUDE FILES
+#include <aknViewAppUi.h>
+#include <akntitle.h>
+#include <AknUtils.h>
+#include <avkon.hrh>
+#include <AknGlobalNote.h>
+#include <AknIconUtils.h> 
+#include <StringLoader.h>
+#include <akntitle.h>
+#include <barsread.h>
+#include <mpxviewutility.h>
+#include <featmgr.h>
+#include <hlplch.h>
+
+#include <gstabhelper.h>
+#include <videoplayeractivationmessage.h>
+
+#include "IptvDebug.h"
+#include <vcxnssettingsview.rsg>
+#include "CIptvResourceLoader.h"
+#include "vcxnsservicesettings.h"
+#include "feedsettingsview.h"
+#include "feedsettingsviewcontainer.h"
+
+#include "videoplayersettingsengine.h"
+
+#include <mediasettings.mbg>
+#include "GSVideoPlugin.h"
+
+#include "MPSettingsNaviPaneController.h"
+#include "MPSettingsAppUi.h"
+#include "MPSettingsConstants.h" 
+
+// Consts
+_LIT( KVcSettingsViewResource, "\\resource\\apps\\vcxnssettingsview." );
+_LIT( KMSettingsFile, "mediasettings.mif" );
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsView::NewL()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CVcxNsSettingsView* CVcxNsSettingsView::NewL( )
+    {
+    CVcxNsSettingsView* self = CVcxNsSettingsView::NewLC( );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsView::NewLC()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CVcxNsSettingsView* CVcxNsSettingsView::NewLC( 
+        CArrayPtrFlat<MGSTabbedView>* aTabViewArray )
+    {
+    CVcxNsSettingsView* self = new (ELeave) CVcxNsSettingsView( );
+    CleanupStack::PushL( self );
+
+    self->ConstructL( aTabViewArray );
+    return self;
+    }
+
+// ---------------------------------------------------------
+// CVcxNsSettingsView::~CVcxNsSettingsView()
+// ---------------------------------------------------------
+//
+EXPORT_C CVcxNsSettingsView::~CVcxNsSettingsView()
+    {
+    iFs.Close();
+
+    if ( iContainer )
+        {
+        AppUi()->RemoveFromStack( iContainer );
+        delete iContainer;
+        }
+    
+    delete iTabHelper;
+    delete iResourceLoader;
+    delete iSettingsEngine;
+    delete iServiceSettings;
+    
+    if ( iViewUtility )
+        {
+        iViewUtility->Close();
+        }
+    }
+
+// ---------------------------------------------------------
+// CVcxNsSettingsView::CVcxNsSettingsView()
+// ---------------------------------------------------------
+//
+EXPORT_C CVcxNsSettingsView::CVcxNsSettingsView( const TUid aViewId )
+  : iViewId( aViewId ),
+    iServiceSubscriptionMode( EFalse ),
+    iVodcastAddFeedMode( EFalse ),
+    iGSVideoPluginMode( EFalse )
+    {
+    }
+
+// ---------------------------------------------------------
+// CVcxNsSettingsView::ConstructL()
+// ---------------------------------------------------------
+//
+EXPORT_C void CVcxNsSettingsView::ConstructL( 
+        CArrayPtrFlat<MGSTabbedView>* aTabViewArray )
+    {
+    if ( aTabViewArray )
+        {
+        aTabViewArray->AppendL(this);
+        iGSVideoPluginMode = ETrue;
+        iViewArray = aTabViewArray;
+        }
+    
+    if ( iGSVideoPluginMode )
+        {
+        iTabHelper = CGSTabHelper::NewL();
+        }
+    
+    // Resources must be loaded before base construct.
+    iResourceLoader = CIptvResourceLoader::NewL( *iCoeEnv );
+    iResourceLoader->AddResourceL( KVcSettingsViewResource );
+
+    BaseConstructL( R_VCSETTINGSVIEW_SETTINGSVIEW );
+
+    User::LeaveIfError( iFs.Connect() );
+    
+    iSettingsEngine = CVcxNsSettingsEngine::NewL( );
+    iServiceSettings = CVcxNsServiceSettings::NewL();
+    iViewUtility = MMPXViewUtility::UtilityL();
+    }
+
+// ---------------------------------------------------------
+// TUid CVcxNsSettingsView::Id()
+// Return id of this view instance
+// ---------------------------------------------------------
+//
+TUid CVcxNsSettingsView::Id() const
+    {
+    //return iViewId;
+    return KMPSettFeedsViewId;
+    }
+
+// ---------------------------------------------------------
+// CCVcxNsSettingsView::IsSettingsViewActive()
+// ---------------------------------------------------------
+//
+TBool CVcxNsSettingsView::IsSettingsViewActive()
+    {
+    return iContainer != NULL;
+    }
+
+// ---------------------------------------------------------
+// CCVcxNsSettingsView::HandleCommandL()
+// Command handler
+// ---------------------------------------------------------
+//
+EXPORT_C void CVcxNsSettingsView::HandleCommandL(TInt aCommand)
+    {
+    IPTVLOGSTRING2_LOW_LEVEL( 
+        "Settings view ## CVcxNsSettingsView::HandleCommandL(%d)", aCommand );
+
+    switch ( aCommand )
+        {
+        // Settings view
+        case EAknSoftkeyOpen:
+        case EVcSettingsViewCmdOpen:
+            break;
+
+        case EVcSettingsServiceCmdSelect:
+            if (iContainer)
+                {
+                iContainer->SaveServiceSelectionInformationL();
+                }
+            break;
+
+        // Video service selection view
+        case EVcSettingsServiceCmdMark:
+        case EVcSettingsServiceCmdUnmark:
+            if ( iContainer )
+                {
+                iContainer->HandleMarkCommandL( aCommand );
+                }
+            break;
+
+        case EVcSettingsServiceCmdVodDetails:
+        case EVcSettingsServiceCmdVodcastDetails:
+        case EVcSettingsServiceCmdWebLinkDetails:
+            if (iContainer)
+                {
+                iContainer->ShowVideoServiceDetailsL();
+                }        
+            break;
+
+        case EVcSettingsServiceCmdVodEdit:
+        case EVcSettingsServiceCmdVodcastEdit:
+            HandleVodAddOrEditCommandL( EFalse );
+            break;
+
+        case EVcSettingsServiceCmdVodRemove:
+        case EVcSettingsServiceCmdVodcastRemove:
+        case EVcSettingsServiceCmdWebLinkRemove:
+            if (iContainer)
+                {
+                iContainer->DeleteVideoServiceL();
+                }
+            break;
+
+        case EVcSettingsServiceCmdVodAdd:
+        case EVcSettingsServiceCmdVodcastAdd:
+            HandleVodAddOrEditCommandL( ETrue );
+            break;
+
+        // Add/Edit service view
+        case EVcSettingsViewAddServiceCmdChange:
+        case EAknSoftkeyChange:
+            if (iContainer)
+                {
+                iContainer->EditCurrentSettingItemListItemL(ETrue);
+                }
+            break;
+
+        // Common
+        case EVcSettingsViewCmdHelp:
+            {
+            if( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+                {
+                HlpLauncher::LaunchHelpApplicationL( iEikonEnv->WsSession(), 
+                                                     AppUi()->AppHelpContextL() );
+                }
+            }
+            break;
+
+        case EVcSettingsViewCmdExit:
+            {
+            if ( iContainer )
+                {
+                iContainer->SaveServiceSelectionInformationL();
+                }
+            AppUi()->HandleCommandL( EEikCmdExit );
+            }
+            break;
+
+        // Softkeys
+        case EAknSoftkeyExit:
+            {
+            AppUi()->HandleCommandL( EEikCmdExit );
+            }
+            break;
+
+        case EAknSoftkeyBack:
+            {
+            HandleBackCommandL();
+            }
+            break;   
+                    
+        case EVcSettingsViewSoftkeyBack:
+            break;
+
+        case EVcSettingsViewSoftkeyMove:
+        case EVcSettingsViewSoftkeyOk:
+        case EVcSettingsViewSoftkeyCancel:
+            break;
+
+        default:
+            AppUi()->HandleCommandL( aCommand );
+            break;
+        }
+
+    if ( iContainer )
+        {
+        iContainer->CheckMsk();
+        }
+    }
+    
+ // ---------------------------------------------------------
+// CVcxNsSettingsView::SetServiceSubscriptionMode()
+// ---------------------------------------------------------   
+void CVcxNsSettingsView::SetServiceSubscriptionMode()
+    {
+    iServiceSubscriptionMode = ETrue;
+    }
+    
+// ---------------------------------------------------------
+// CVcxNsSettingsView::SetVodcastAddFeedMode()
+// ---------------------------------------------------------
+//
+void CVcxNsSettingsView::SetVodcastAddFeedMode()
+    {
+    iVodcastAddFeedMode = ETrue;
+    }
+
+// ---------------------------------------------------------
+// CVcxNsSettingsView::HandleClientRectChange()
+// ---------------------------------------------------------
+//
+void CVcxNsSettingsView::HandleClientRectChange()
+    {
+    if ( iContainer )
+        {
+        iContainer->SetRect( ClientRect() );
+        }
+    }
+
+// ---------------------------------------------------------
+// CVcxNsSettingsView::GetButtonGroupContainer()
+// ---------------------------------------------------------
+//
+CEikButtonGroupContainer* CVcxNsSettingsView::GetButtonGroupContainer()
+    {
+    return Cba();
+    }
+
+// ---------------------------------------------------------
+// CVcxNsSettingsView::DoActivateL
+// Activation of this view instance.
+// ---------------------------------------------------------
+//
+EXPORT_C void CVcxNsSettingsView::DoActivateL( 
+        const TVwsViewId& aPrevViewId, 
+        TUid /*aCustomMessageId*/, 
+        const TDesC8& aCustomMessage )
+    {
+    IPTVLOGSTRING_LOW_LEVEL("Settings view ## CVcxNsSettingsView::DoActivateL()");
+
+    HandleActivationMessageL( aCustomMessage );
+
+    if ( !iGSVideoPluginMode && !iServiceSubscriptionMode && !iVodcastAddFeedMode  )
+        {
+        iNaviCntrl = static_cast<CMPSettingsAppUi*>(AppUi());
+        iNaviPaneContext = iNaviCntrl->MPTabGroup();
+        }
+    
+    // Set correct navi pane
+    SetNaviPaneL();
+    
+    iPrevViewId = aPrevViewId; // Save the previous view id 
+
+    if ( !iContainer )
+        {
+        
+        iContainer = new (ELeave) CVcxNsSettingsViewContainer( 
+                                                  *AppUi(), 
+                                                  *iSettingsEngine, 
+                                                  *iServiceSettings,
+                                                  this, 
+                                                  iFs );
+        
+        iContainer->SetMopParent( this );
+        iContainer->ConstructL( ClientRect() );
+
+        AppUi()->AddToStackL(*this, iContainer);
+        }
+
+    if ( iServiceSubscriptionMode )
+        {
+        iContainer->SwitchToServiceSelectionListL( CIptvService::EVod );
+        }
+    else if ( iVodcastAddFeedMode )
+        {
+        iContainer->LoadAddVodCastFeedL();
+        iContainer->SwitchToAddOrEditServiceListL();
+        }
+    
+   
+    if ( iServiceSubscriptionMode || iVodcastAddFeedMode )
+        {
+        // If we come directly from Video Feeds, status pane has flat layout
+        iPrevStatusPaneLayout = StatusPane()->CurrentLayoutResId();
+        if ( iPrevStatusPaneLayout != R_AVKON_STATUS_PANE_LAYOUT_USUAL
+                && iPrevStatusPaneLayout != R_AVKON_STATUS_PANE_LAYOUT_USUAL_EXT )
+            {
+            StatusPane()->SwitchLayoutL( R_AVKON_STATUS_PANE_LAYOUT_USUAL );        
+            }
+        }
+    iContainer->MakeVisible( ETrue );
+
+    CEikButtonGroupContainer* cba = Cba();
+    if ( cba )
+        {
+        cba->DrawDeferred();
+        }
+    
+    if ( iGSVideoPluginMode )
+        {
+        CGSVideoPlugin* parent = 
+            static_cast<CGSVideoPlugin*> ( AppUi()->View( KGSVideoPluginUid ) );
+
+        if ( parent )
+            {
+            iTabHelper->CreateTabGroupL( Id(), 
+                        static_cast<CArrayPtrFlat<MGSTabbedView> *> (iViewArray) ); 
+            }
+        }
+    iContainer->CheckMsk();
+    }
+
+// ---------------------------------------------------------
+// CVcxNsSettingsView::DoDeactivate()
+// Deactivation of this view instance.
+// ---------------------------------------------------------
+//
+EXPORT_C void CVcxNsSettingsView::DoDeactivate()
+    {
+    if ( !iServiceSubscriptionMode )
+        {
+        // Save service selection when switching to another tab.
+        TRAP_IGNORE( SaveServiceSelectionL() );
+        }
+        
+    // Must restore status pane layout if going back to Video Feeds.
+    // statuspane layout switch uses fonts, this makes sure that 
+    // the fonts are still available in environment. This can happen
+    // in cases where environment is already destroyed when this
+    // is entered.
+    if ( ( iServiceSubscriptionMode || iVodcastAddFeedMode ) && iPrevStatusPaneLayout )            
+        {
+        if ( iPrevStatusPaneLayout != StatusPane()->CurrentLayoutResId() &&
+                iCoeEnv->NormalFont() )
+            {
+            TRAP_IGNORE( StatusPane()->SwitchLayoutL( iPrevStatusPaneLayout ) )
+            }
+        }
+    
+    if ( iContainer )
+        {
+        AppUi()->RemoveFromStack( iContainer );
+
+        delete iContainer;
+        iContainer = NULL;
+        }
+    
+    if ( iTabHelper )
+        {
+        iTabHelper->RemoveTabGroup();
+        }
+    }
+
+// ---------------------------------------------------------
+// CVcxNsSettingsView::RoutedKeyEventL
+// ---------------------------------------------------------
+//
+TKeyResponse CVcxNsSettingsView::RoutedKeyEventL( const TKeyEvent &aKeyEvent,
+                                                  TEventCode aType )
+    {
+    if (iContainer)
+        {
+        return iContainer->OfferKeyEventL(aKeyEvent, aType);
+        }
+    return EKeyWasConsumed;
+    }
+
+// ------------------------------------------------------------------------------
+// CVcxNsSettingsView::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane)
+// This function is called by the EIKON framework just before it displays
+// a menu pane. Menu is adjusted according to Settings UI state.
+// ------------------------------------------------------------------------------
+//
+EXPORT_C void CVcxNsSettingsView::DynInitMenuPaneL( TInt aResourceId,
+                                                    CEikMenuPane* aMenuPane )
+    {
+    if ( !iContainer )
+        {
+        // This cleans up the code layout,
+        // no need to check this later
+        return;
+        }
+    
+    switch ( aResourceId )
+        {
+        case R_VCSETTINGSVIEW_SETTINGSVIEW_MENU:
+            {
+            switch ( iContainer->GetActiveList() )
+                {
+                case EServiceSelection:
+                    {
+                    aMenuPane->SetItemDimmed( EVcSettingsViewCmdOpen, ETrue );
+                    aMenuPane->SetItemDimmed( EVcSettingsViewCmdChange, ETrue );
+                                           
+                    aMenuPane->SetItemDimmed(
+                        EVcSettingsServiceCmdMark, 
+                        !iContainer->ShowMarkForCurrentListItemL() );
+                    aMenuPane->SetItemDimmed(
+                        EVcSettingsServiceCmdUnmark, 
+                        !iContainer->ShowUnmarkForCurrentListItemL() );
+                    
+                    switch ( iContainer->GetServiceSelectionServiceType() )
+                        {
+                        case CIptvService::EVod:
+                            {
+                            aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodDetails, 
+                                !iContainer->ShowMenuItemForCurrentListItemL(
+                                     CVcxNsSettingsViewContainer::EConstAndInfo ) );
+                            aMenuPane->SetItemDimmed(EVcSettingsServiceCmdVodEdit,
+                                !iContainer->ShowMenuItemForCurrentListItemL( 
+                                    CVcxNsSettingsViewContainer::EEditable ));
+                            aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodRemove, 
+                                !iContainer->ShowMenuItemForCurrentListItemL(
+                                     CVcxNsSettingsViewContainer::EEditable ) );
+                            aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodAdd, EFalse );
+                            aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodcastDetails, ETrue );
+                            aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodcastEdit, ETrue );
+                            aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodcastRemove, ETrue );
+                            aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodcastAdd, ETrue );
+                            aMenuPane->SetItemDimmed( EVcSettingsServiceCmdWebLinkDetails, ETrue );
+                            aMenuPane->SetItemDimmed( EVcSettingsServiceCmdWebLinkRemove, ETrue );
+                            }
+                            break;
+
+                        case CIptvService::EVodCast:
+                            {
+                            aMenuPane->SetItemDimmed(EVcSettingsServiceCmdVodcastDetails,
+                                !iContainer->ShowMenuItemForCurrentListItemL( 
+                                     CVcxNsSettingsViewContainer::EConstAndInfo ));
+                            aMenuPane->SetItemDimmed(EVcSettingsServiceCmdVodcastEdit,
+                                !iContainer->ShowMenuItemForCurrentListItemL( 
+                                     CVcxNsSettingsViewContainer::EEditable ));
+                            aMenuPane->SetItemDimmed(EVcSettingsServiceCmdVodcastRemove,
+                                !iContainer->ShowMenuItemForCurrentListItemL( 
+                                     CVcxNsSettingsViewContainer::EEditable ));
+                            aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodcastAdd, EFalse );
+                            aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodDetails, ETrue );
+                            aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodEdit, ETrue );
+                            aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodRemove, ETrue );
+                            aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodAdd, ETrue );
+                            aMenuPane->SetItemDimmed( EVcSettingsServiceCmdWebLinkDetails, ETrue );
+                            aMenuPane->SetItemDimmed( EVcSettingsServiceCmdWebLinkRemove, ETrue );
+                            }
+                            break;
+
+                        case CIptvService::EBrowser:
+                            {
+                            aMenuPane->SetItemDimmed(EVcSettingsServiceCmdWebLinkDetails, 
+                                                     !iContainer->ShowMenuItemForCurrentListItemL(
+                                                         CVcxNsSettingsViewContainer::EConstAndInfo));
+                            aMenuPane->SetItemDimmed(EVcSettingsServiceCmdWebLinkRemove, 
+                                                     !iContainer->ShowMenuItemForCurrentListItemL(
+                                                         CVcxNsSettingsViewContainer::EEditable));
+                            aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodDetails, ETrue );
+                            aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodEdit, ETrue );
+                            aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodRemove, ETrue );
+                            aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodAdd, ETrue );
+                            aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodcastDetails, ETrue );
+                            aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodcastEdit, ETrue );
+                            aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodcastRemove, ETrue );
+                            aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodcastAdd, ETrue );
+                            }
+                            break;
+                        
+                        default:
+                            break;
+                        }
+
+                    aMenuPane->SetItemDimmed(EVcSettingsViewAddServiceCmdChange, ETrue);
+
+                    aMenuPane->SetItemDimmed(EVcSettingsViewCmdHelp, EFalse);
+                    aMenuPane->SetItemDimmed(EVcSettingsViewCmdExit, EFalse);
+                    }
+                    break;
+                    
+                case EAddService:
+                    {
+                    aMenuPane->SetItemDimmed( EVcSettingsViewCmdOpen, ETrue );
+                    aMenuPane->SetItemDimmed( EVcSettingsViewCmdChange, ETrue );
+                    aMenuPane->SetItemDimmed( EVcSettingsServiceCmdMark, ETrue );
+                    aMenuPane->SetItemDimmed( EVcSettingsServiceCmdUnmark, ETrue );
+                    aMenuPane->SetItemDimmed( EVcSettingsServiceCmdMark, ETrue );
+                    aMenuPane->SetItemDimmed( EVcSettingsServiceCmdUnmark, ETrue );
+                    aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodDetails, ETrue );
+                    aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodEdit, ETrue );
+                    aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodRemove, ETrue );
+                    aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodAdd, ETrue );
+                    aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodcastDetails, ETrue );
+                    aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodcastEdit, ETrue );
+                    aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodcastRemove, ETrue );
+                    aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodcastAdd, ETrue );
+                    aMenuPane->SetItemDimmed( EVcSettingsServiceCmdWebLinkDetails, ETrue );
+                    aMenuPane->SetItemDimmed( EVcSettingsServiceCmdWebLinkRemove, ETrue );
+                    aMenuPane->SetItemDimmed( EVcSettingsViewAddServiceCmdChange, EFalse );
+                    aMenuPane->SetItemDimmed( EVcSettingsViewCmdHelp, EFalse );
+                    aMenuPane->SetItemDimmed( EVcSettingsViewCmdExit, EFalse );
+                    }
+                    break;
+                }
+            }
+            break;
+
+        default:
+            break;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsView::HandleStatusPaneSizeChange
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVcxNsSettingsView::HandleStatusPaneSizeChange()
+    {
+    if ( iContainer )
+        {
+        iContainer->SetRect( ClientRect() );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsView::LaunchedFromGsFw
+// -----------------------------------------------------------------------------
+//
+TBool CVcxNsSettingsView::LaunchedFromGsFw()
+    {
+    //return Id().iUid == KVcxNsGeneralSettingsPluginUid ? ETrue : EFalse;
+    return EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsView::Container
+// -----------------------------------------------------------------------------
+//
+CVcxNsSettingsViewContainer* CVcxNsSettingsView::Container()
+    {
+    return iContainer;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsView::CreateTabIconL
+// -----------------------------------------------------------------------------
+//
+CGulIcon* CVcxNsSettingsView::CreateTabIconL()
+    {
+    CGulIcon* icon = NULL;
+    TFileName fileName;
+    LocateMifFileL( fileName );
+
+    icon = AknsUtils::CreateGulIconL(
+        AknsUtils::SkinInstance(), 
+        KAknsIIDDefault, 
+        fileName,
+        EMbmMediasettingsQgn_prop_set_mp_video_tab3,
+        EMbmMediasettingsQgn_prop_set_mp_video_tab3_mask );
+
+    return icon;
+    }       
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsView::LocateMifFileL
+// -----------------------------------------------------------------------------
+//
+void CVcxNsSettingsView::LocateMifFileL( TFileName& aFileName )
+    {
+    // Get the path & file name with the drive not specified.
+    TParse parse;
+    parse.Set( KMSettingsFile, &KDC_APP_BITMAP_DIR, NULL );
+    TPtrC mifFile = parse.FullName();
+   
+    // This is done to ensure upgraded file is used first.
+    TFindFile find( iCoeEnv->FsSession() );
+    TInt err = find.FindByDir( mifFile, KNullDesC );
+    
+    if ( err )
+        {
+        User::Leave( KErrNotFound );
+        }
+    else
+        {
+        aFileName.Append( find.File() );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxNsSettingsView::SetNaviPaneL
+// ---------------------------------------------------------------------------
+//
+void CVcxNsSettingsView::SetNaviPaneL( TBool aDisableNaviPane )
+    {
+    if ( !iGSVideoPluginMode && !iServiceSubscriptionMode && !iVodcastAddFeedMode )
+        {
+        if ( iNaviPaneContext && !aDisableNaviPane )
+            {
+            iNaviCntrl->NaviContainer()->PushL( *iNaviPaneContext );
+            if ( iNaviPaneContext == iNaviCntrl->MPTabGroup() )
+                {
+                iNaviCntrl->UpdateTabIndex();
+                }
+            }
+        else 
+            {
+            iNaviCntrl->NaviContainer()->PushDefaultL();
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxNsSettingsView::HandleActivationMessageL
+// ---------------------------------------------------------------------------
+//
+void CVcxNsSettingsView::HandleActivationMessageL( const TDesC8& aCustomMessage )
+    {
+    if ( aCustomMessage.Length() == sizeof( TVideoPlayerActivationMessage ) )
+        {
+        TVideoPlayerActivationMessage params;
+        TPckg<TVideoPlayerActivationMessage> paramsPckg( params );
+        paramsPckg.Copy( aCustomMessage );
+        
+        if ( params.iMsgType == 
+            TVideoPlayerActivationMessage::EOpenVCSettingsFeedSubscriptions )
+            {
+            SetServiceSubscriptionMode();
+            }
+        else if ( params.iMsgType == 
+            TVideoPlayerActivationMessage::EOpenVCSettingsAddFeed )
+            {
+            SetVodcastAddFeedMode();
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxNsSettingsView::HandleBackCommandL
+// ---------------------------------------------------------------------------
+//
+void CVcxNsSettingsView::HandleBackCommandL()
+    {
+    if ( iContainer )
+        {
+        switch ( iContainer->GetActiveList() )
+            {
+            case EServiceSelection:
+                {
+                HandleBackCommandForServiceSelectionL();
+                }
+                break;
+                
+            case EAddService:
+                {
+                HandleBackCommandForAddServiceL();
+                }
+                break;
+
+            default:
+                break;
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxNsSettingsView::HandleBackCommandForServiceSelectionL
+// ---------------------------------------------------------------------------
+//
+void CVcxNsSettingsView::HandleBackCommandForServiceSelectionL()
+    {
+    if ( iContainer )
+        {
+        if ( !iServiceSubscriptionMode )
+            {
+            // Normal case, Video player settings main view.
+            iContainer->SaveServiceSelectionInformationL();
+            
+            if ( !iGSVideoPluginMode )
+                {
+                // Activate settings main view
+                AppUi()->ActivateLocalViewL( KMPSettMainViewId );
+                }
+            else 
+                {
+                AppUi()->ActivateLocalViewL( KGSVideoPluginUid );
+                }
+            }
+        else
+            {
+            // In Vodcast "feed subscription" mode we switch
+            // right back to Vodcast when user closes this view.
+    
+            iContainer->SaveServiceSelectionInformationL();
+            iContainer->FinishServiceSelectionList();
+
+            iViewUtility->ActivatePreviousViewL();
+            iServiceSubscriptionMode = EFalse;
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxNsSettingsView::SaveServiceSelectionL()
+// ---------------------------------------------------------------------------
+//
+void CVcxNsSettingsView::SaveServiceSelectionL()
+    {
+    if ( iContainer )
+        {
+        iContainer->SaveServiceSelectionInformationL();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxNsSettingsView::HandleBackCommandForAddServiceL
+// ---------------------------------------------------------------------------
+//
+void CVcxNsSettingsView::HandleBackCommandForAddServiceL()
+    {
+    if ( iContainer )
+        {
+        if( !iVodcastAddFeedMode )
+            {
+            //Save new service and switch to service selection view.
+            iContainer->SaveAddServiceInformationL();
+            iContainer->SwitchToServiceSelectionListL();
+            SetNaviPaneL();
+            }
+        else
+            {
+            // Save new service and switch back to VOD.
+            iContainer->SaveAddServiceInformationL();
+            iContainer->FinishServiceSelectionList();
+
+           iViewUtility->ActivatePreviousViewL();
+            iVodcastAddFeedMode = EFalse;
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxNsSettingsView::HandleVodAddOrEditCommand
+// ---------------------------------------------------------------------------
+//
+void CVcxNsSettingsView::HandleVodAddOrEditCommandL( TBool aIsAdding )
+    {
+    if ( iContainer )
+        {
+        iContainer->SaveServiceSelectionInformationL();
+        iContainer->LoadAddServiceInformationL( aIsAdding ); // EFalse=Edit, ETrue=Add
+        SetNaviPaneL( ETrue );
+        iContainer->SwitchToAddOrEditServiceListL();
+        }        
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/feedsettingsviews/src/feedsettingsviewaddoreditservice.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,274 @@
+/*
+* Copyright (c) 2006-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:    Class for "Add/edit service list" in Settings UI.*
+*/
+
+
+
+
+// INCLUDE FILES
+#include <aknlists.h>
+#include <akntitle.h>
+#include <aknPopup.h>
+#include <aknViewAppUi.h>
+#include <barsread.h>
+#include <commdb.h>
+#include <StringLoader.h>
+
+#include "IptvEngineUids.h"
+#include <vcxnssettingsview.rsg>
+#include "vcxnsservicesettings.h"
+
+#include "CIptvService.h"
+#include "feedsettingsview.h"
+#include "feedsettingsviewaddoreditservice.h"
+#include "feedsettingsviewaddservicelistbox.h"
+#include "feedsettingsviewserviceselection.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsViewAddOrEditService::CVcxNsSettingsViewAddOrEditService()
+// -----------------------------------------------------------------------------
+//
+CVcxNsSettingsViewAddOrEditService::CVcxNsSettingsViewAddOrEditService( 
+    CVcxNsSettingsViewContainer* aParent,
+    CVcxNsServiceSettings& aServiceSettings )
+ :  iParent( aParent ),
+    iServiceSettings( aServiceSettings ),
+    iServiceType( ( CIptvService::TServiceType ) 0 )
+    {
+    __ASSERT_DEBUG(iParent, User::Panic(KNullDesC, KErrBadHandle));
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsViewAddOrEditService::NewL()
+// -----------------------------------------------------------------------------
+//
+CVcxNsSettingsViewAddOrEditService* CVcxNsSettingsViewAddOrEditService::NewL(
+    CVcxNsSettingsViewContainer* aParent,
+    CVcxNsServiceSettings& aServiceSettings )
+    {
+    CVcxNsSettingsViewAddOrEditService* self = new ( ELeave ) 
+        CVcxNsSettingsViewAddOrEditService( aParent, aServiceSettings );
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsViewAddOrEditService::ConstructL()
+// -----------------------------------------------------------------------------
+//
+void CVcxNsSettingsViewAddOrEditService::ConstructL()
+    {
+    iListbox = new (ELeave) CVcxNsSettingsViewAddServiceListbox(
+            iParent, 
+            iAddServiceName, 
+            iAddServiceAddress,
+            iAddServicePluginType );
+
+    iListbox->SetContainerWindowL( *iParent );
+    iListbox->ConstructFromResourceL( R_VCSETTINGSVIEW_ADDSERVICE_LIST );
+    iListbox->SetRect(iParent->Rect());
+    iListbox->ListBox()->ActivateL();
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsViewAddOrEditService::~CVcxNsSettingsViewAddOrEditService()
+// -----------------------------------------------------------------------------
+//
+CVcxNsSettingsViewAddOrEditService::~CVcxNsSettingsViewAddOrEditService()
+    {
+    delete iListbox;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsViewAddOrEditService::ActivateL()
+// -----------------------------------------------------------------------------
+//
+void CVcxNsSettingsViewAddOrEditService::ActivateL()
+    {
+	
+	iParent->SetTitleL( R_IPTV_TITLE_PANE_SETTINGS_TITLE );
+	
+    iListbox->ListBox()->ScrollBarFrame()->SetScrollBarVisibilityL(
+                                               CEikScrollBarFrame::EOff,
+                                               CEikScrollBarFrame::EAuto );
+    iListbox->MakeVisible(ETrue);
+    iListbox->DrawNow();
+    iListbox->ListBox()->UpdateScrollBarsL();
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsViewAddOrEditService::Deactivate()
+// -----------------------------------------------------------------------------
+//
+void CVcxNsSettingsViewAddOrEditService::Deactivate()
+    {
+    TRAP_IGNORE( iListbox->ListBox()->ScrollBarFrame()->SetScrollBarVisibilityL(
+                 CEikScrollBarFrame::EOff, CEikScrollBarFrame::EOff) );
+
+    iListbox->MakeVisible(EFalse);
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsViewAddOrEditService::LoadL()
+// -----------------------------------------------------------------------------
+//
+void CVcxNsSettingsViewAddOrEditService::LoadL(
+    TBool aAdding, 
+    CIptvService::TServiceType aServiceType )
+    {
+    // The "add/edit service list" is used for both adding a new service and
+    // for editing an existing service. In both cases, the list just
+    // needs to be initialized with references to correct data items.
+
+    iServiceType = aServiceType;
+
+    if (aAdding) // Adding a new service.
+        {
+        HBufC* defaultName = StringLoader::LoadLC(R_IPTV_NEW_SERVICE_DEFAULT);
+        iAddServiceName = *defaultName;
+        iAddServiceAddress.Zero();
+        CleanupStack::PopAndDestroy(defaultName);
+
+        iListbox->LoadAddServiceInformationL(aAdding, 
+                                            iAddServiceName, 
+                                            iAddServiceAddress,
+                                            iServiceType,
+                                            iAddServicePluginType);
+        }
+    else // Editing an existing service.
+        {
+        CIptvService* iptvService = iParent->ServiceSelection()->GetCurrentServiceL();
+
+        if (iptvService)
+            {
+            iAddServiceName       = iptvService->GetName();
+            iAddServiceAddress    = iptvService->GetAddress();
+            iPreviousAddress      = iAddServiceAddress;
+            iAddServicePluginType = 0;
+
+            delete iptvService;
+            iptvService = NULL;
+
+            iListbox->LoadAddServiceInformationL(aAdding,
+                                                 iAddServiceName,
+                                                 iAddServiceAddress,
+                                                 iServiceType,
+                                                 iAddServicePluginType);
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsViewAddOrEditService::SaveL()
+// -----------------------------------------------------------------------------
+//
+void CVcxNsSettingsViewAddOrEditService::SaveL()
+    {
+    iListbox->SaveAddServiceInformationL();
+
+    TUid epgUid;
+    TUid iptvUid;
+    TUid vodUid;
+
+    switch (iServiceType)
+        {
+        case CIptvService::ELiveTv:
+            break;
+
+        case CIptvService::EVodCast: // fall through
+        case CIptvService::EVod:
+            {
+            epgUid.iUid  = KIptvRssPluginImplementationUid;
+            iptvUid.iUid = 0x00000000;
+            vodUid.iUid  = IPTV_HTTP_VOD_DOWNLOAD_PLUGIN_IMPLEMENTATION_UID;
+            }
+            break;
+        
+        default:
+            {
+            epgUid.iUid  = KIptvRssPluginImplementationUid;
+            iptvUid.iUid = 0x00000000;
+            vodUid.iUid  = IPTV_HTTP_VOD_DOWNLOAD_PLUGIN_IMPLEMENTATION_UID;
+            }
+            break;
+        }
+
+    if (iListbox->IsAdding()) // Adding a new service.
+        {
+        CIptvIapList* iapList = CIptvIapList::NewL();
+        CleanupStack::PushL(iapList);
+
+        // Get IAP list for the new service.        
+        iServiceSettings.GetIapListForNewServiceL(*iapList);
+        // User defined services have special description until updated from EPG.
+        HBufC* description = StringLoader::LoadLC(R_IPTV_USER_DEFINED_SERVICE);
+
+        iServiceSettings.AddServiceL(iAddServiceName,
+                                 iAddServiceAddress,
+                                 *description,
+                                 *iapList,
+                                 iServiceType,
+                                 epgUid,
+                                 iptvUid,
+                                 vodUid);
+
+        CleanupStack::PopAndDestroy(description);
+        CleanupStack::PopAndDestroy(iapList);
+        }
+    else // Editing an existing service.
+        {
+        CIptvService* iptvService = iParent->ServiceSelection()->GetCurrentServiceL();
+        
+        if (iptvService)
+            {
+            CleanupStack::PushL(iptvService);
+
+            iptvService->SetName(iAddServiceName);
+            iptvService->SetAddress(iAddServiceAddress);
+            iptvService->SetEpgPluginUid(epgUid);
+            iptvService->SetVodPluginUid(vodUid);
+            iptvService->SetIptvPluginUid(iptvUid);
+            
+            if ( iPreviousAddress.Length() > 0 )
+                {
+                if ( iPreviousAddress.Compare( iAddServiceAddress ) != 0 )
+                    {
+                    // Address has been modified
+                    }
+                }
+            iPreviousAddress.Zero();
+
+            // Update the information of service.                
+            iServiceSettings.UpdateServiceL(*iptvService);
+
+            CleanupStack::PopAndDestroy(iptvService);
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsViewAddOrEditService::ListBox()
+// -----------------------------------------------------------------------------
+//
+CVcxNsSettingsViewAddServiceListbox* CVcxNsSettingsViewAddOrEditService::ListBox()
+    {
+    __ASSERT_DEBUG(iListbox, User::Panic(KNullDesC, KErrBadHandle));
+
+    return iListbox;    
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/feedsettingsviews/src/feedsettingsviewaddservicelistbox.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,212 @@
+/*
+* Copyright (c) 2006-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:    Class for "Add service list" in Settings UI.*
+*/
+
+
+
+
+// INCLUDE FILES
+#include <akntextsettingpage.h>
+#include <aknViewAppUi.h>
+
+#include "CIptvService.h"
+#include "feedsettingsviewaddservicelistbox.h"
+#include "feedsettingsviewcontainer.h"
+#include "feedsettingsview.hrh"
+
+// CONSTANTS
+_LIT(KCompulsoryChar, "*");
+
+// ========================= MEMBER FUNCTIONS ==================================
+
+// ------------------------------------------------------------------------------
+// CVcSettingsViewAddServiceListbox::CVcSettingsViewAddServiceListbox()
+// ------------------------------------------------------------------------------
+//
+CVcxNsSettingsViewAddServiceListbox::CVcxNsSettingsViewAddServiceListbox(
+                                               CVcxNsSettingsViewContainer* aParent,
+                                               TDes& aServiceName,
+                                               TDes& aAddress,
+                                               TInt& aPluginType )
+  : iParent(aParent),
+    iAdding(ETrue),
+    iServiceName(aServiceName),
+    iAddress(aAddress),
+    iServicePluginType(aPluginType)
+    {
+    __ASSERT_DEBUG(iParent, User::Panic(KNullDesC, KErrBadHandle));
+    }
+
+// ----------------------------------------------------------------------------
+// CVcSettingsViewAddServiceListbox::CreateSettingItemL()
+// ----------------------------------------------------------------------------
+//
+CAknSettingItem* CVcxNsSettingsViewAddServiceListbox::CreateSettingItemL( 
+                                                             TInt aIdentifier )
+    {
+    switch (aIdentifier)
+        {
+        case EVcSettingsViewAddServiceServiceNameItem:
+            {
+            iServiceNameItem = new (ELeave) CAknTextSettingItem( aIdentifier,
+                                                                 iServiceName );
+            return iServiceNameItem;
+            }
+
+        case EVcSettingsViewAddServiceAddressItem:
+            {
+            iAddressItem = new (ELeave) CAknTextSettingItem(aIdentifier, iAddress);
+            iAddressItem->SetCompulsoryIndTextL(KCompulsoryChar);
+            return iAddressItem;
+            }
+
+        case EVcSettingsViewAddServiceServiceTypeItem:
+            {
+            iPluginTypeItem = 
+                new (ELeave) CAknEnumeratedTextPopupSettingItem( aIdentifier, 
+                                                                 iServicePluginType );
+            return iPluginTypeItem;
+            }
+
+        default:
+            {
+            return NULL;
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// CVcSettingsViewAddServiceListbox::EditCurrentItemL()
+// ---------------------------------------------------------
+//
+void CVcxNsSettingsViewAddServiceListbox::EditCurrentItemL()
+    {
+    TInt itemIndex = ListBox()->CurrentItemIndex();
+
+    if (itemIndex >= 0)
+        {
+        iParent->AppUi()->SetOrientationL( 
+                              CAknAppUiBase::EAppUiOrientationUnspecified );
+
+        EditItemL(itemIndex, EFalse);
+        }
+    }
+
+// ---------------------------------------------------------
+// CVcSettingsViewAddServiceListbox::LoadAddServiceInformationL()
+// iAppSettings -> UI
+// ---------------------------------------------------------
+//
+void CVcxNsSettingsViewAddServiceListbox::LoadAddServiceInformationL(
+                                           TBool aAdding,
+                                           TDes& aServiceName,
+                                           TDes& aAddress,
+                                           CIptvService::TServiceType aServiceType,
+                                           TInt& aPluginType )
+    {
+    iAdding            = aAdding;
+    iServiceName       = aServiceName;
+    iAddress           = aAddress;
+    iServiceType       = aServiceType;
+    iServicePluginType = aPluginType;
+
+    LoadSettingsL();
+
+    if (iPluginTypeItem)
+        {
+        if (aServiceType != CIptvService::ELiveTv)
+            {
+            iPluginTypeItem->SetHidden(ETrue);
+            }
+        else
+            {
+            iPluginTypeItem->SetHidden(EFalse);
+            }
+        HandleChangeInItemArrayOrVisibilityL();    
+        iPluginTypeItem->UpdateListBoxTextL();
+        }
+
+    if (iServiceNameItem && iAddressItem)
+        {
+        iServiceNameItem->UpdateListBoxTextL();
+        iAddressItem->SetCompulsoryIndTextL(KCompulsoryChar);
+        iAddressItem->UpdateListBoxTextL();
+        }
+    }
+
+// ---------------------------------------------------------
+// CVcSettingsViewAddServiceListbox::SaveAddServiceInformationL()
+// UI -> iAppSettings
+// ---------------------------------------------------------
+//
+void CVcxNsSettingsViewAddServiceListbox::SaveAddServiceInformationL()
+    {
+    StoreSettingsL();
+    }
+
+// ---------------------------------------------------------
+// CVcSettingsViewAddServiceListbox::IsAdding()
+// ---------------------------------------------------------
+//
+TBool CVcxNsSettingsViewAddServiceListbox::IsAdding()
+    {
+    return iAdding;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcSettingsViewAddServiceListbox::SizeChanged()
+// -----------------------------------------------------------------------------
+//
+void CVcxNsSettingsViewAddServiceListbox::SizeChanged()
+    {
+    CAknSettingItemList::SizeChanged();
+
+    if (ListBox()) 
+        {
+        ListBox()->SetRect(Rect());
+        }
+    }
+// -----------------------------------------------------------------------------
+// CVcSettingsViewAddServiceListbox::OfferKeyEventL()
+// -----------------------------------------------------------------------------
+//
+TKeyResponse CVcxNsSettingsViewAddServiceListbox::OfferKeyEventL( 
+        const TKeyEvent& aKeyEvent,
+        TEventCode aType )
+    {
+    return CAknSettingItemList::OfferKeyEventL(aKeyEvent, aType);
+    }
+
+
+// --------------------------------------------------------------------------
+// CMPSettingsVideoSettingItemList::HandleListBoxEventL()
+// --------------------------------------------------------------------------
+//
+void CVcxNsSettingsViewAddServiceListbox::HandleListBoxEventL(
+        CEikListBox* aListBox,
+        TListBoxEvent aListBoxEvent )
+    {
+    if ( aListBoxEvent == EEventEnterKeyPressed   ||
+         aListBoxEvent == EEventItemSingleClicked ||
+         aListBoxEvent == EEventItemDoubleClicked  )
+        {
+        CAknSettingItemList::HandleListBoxEventL( aListBox, aListBoxEvent );
+        if ( iParent )
+		    {
+		    iParent->DrawDeferred();
+		    }	
+        }
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/feedsettingsviews/src/feedsettingsviewcontainer.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,711 @@
+/*
+* Copyright (c) 2007-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:    Container class for Setting view.*
+*/
+
+
+
+
+// INCLUDE FILES
+#include <eikenv.h>
+#include <eikapp.h>
+#include <aknlists.h>
+#include <barsread.h>
+#include <AknIconArray.h>
+#include <eikclbd.h>
+#include <akntitle.h>
+#include <aknmessagequerydialog.h>
+#include <aknViewAppUi.h>
+#include <aknsettingitemlist.h>
+
+#include "IptvDebug.h"
+#include <vcxnssettingsview.rsg>
+#include "vcxnsservicesettings.h"
+
+#include "videoplayersettingsengine.h"
+#include "CIptvUtil.h"
+#include <csxhelp/iptv.hlp.hrh>
+#include "feedsettingsview.hrh"
+#include "feedsettingsview.h"
+#include "feedsettingsviewcontainer.h"
+#include "feedsettingsviewaddservicelistbox.h"
+#include "feedsettingsviewserviceselection.h"
+#include "feedsettingsviewaddoreditservice.h"
+#include "MPSettingsConstants.h" 
+
+const TInt KIptvMskPosition = 3;
+ 
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CVcSettingsViewContainer::CVcSettingsViewContainer()
+// ---------------------------------------------------------
+//
+CVcxNsSettingsViewContainer::CVcxNsSettingsViewContainer( CAknViewAppUi& aAppUi,
+                                                          CVcxNsSettingsEngine& aAppSettings,
+                                                          CVcxNsServiceSettings& aServiceSettings,
+                                                          CVcxNsSettingsView* aParentView,
+                                                          RFs& aFs)
+  : iAppUi(aAppUi),
+    iAppSettings(aAppSettings),
+    iServiceSettings(aServiceSettings),
+    iParentView(aParentView),
+    iFs(aFs),
+    iActiveList((TSettingsViewActiveList)0)
+    {
+    __ASSERT_DEBUG(iParentView, User::Panic(KNullDesC, KErrBadHandle));
+    }
+
+// ---------------------------------------------------------
+// CVcSettingsViewContainer::ConstructL()
+// ---------------------------------------------------------
+//
+void CVcxNsSettingsViewContainer::ConstructL(const TRect& aRect)
+    {
+    CreateWindowL();
+
+    // Service selection list
+    iServiceSelection = CVcxNsSettingsViewServiceSelection::NewL(this, iServiceSettings );
+
+    // Add service list
+    iAddOrEditService = CVcxNsSettingsViewAddOrEditService::NewL(this, iServiceSettings );
+    
+    SetRect(aRect);
+    
+    SwitchToServiceSelectionListL();
+    ActivateL();
+    }
+
+
+// ---------------------------------------------------------
+// CVcSettingsViewContainer::SetTitleL()
+// ---------------------------------------------------------
+//
+void CVcxNsSettingsViewContainer::SetTitleL( TInt aResourceId )
+    {
+    CEikStatusPane* sp = static_cast<CAknAppUi*>(iCoeEnv->AppUi())->StatusPane();
+
+    CAknTitlePane* title = 
+        static_cast<CAknTitlePane*>(sp->ControlL(TUid::Uid(EEikStatusPaneUidTitle)));
+
+    TResourceReader rReader;
+    iCoeEnv->CreateResourceReaderLC(rReader, aResourceId );
+    title->SetFromResourceL(rReader);
+    CleanupStack::PopAndDestroy(); //rReader
+    }
+
+// ----------------------------------------------------
+// CVcSettingsViewContainer::~CVcSettingsViewContainer()
+// ----------------------------------------------------
+//
+CVcxNsSettingsViewContainer::~CVcxNsSettingsViewContainer()
+    {
+    delete iServiceSelection;
+    delete iAddOrEditService;
+    }
+
+// ---------------------------------------------------------
+// CVcSettingsViewContainer::AppUi()
+// ---------------------------------------------------------
+//
+CAknViewAppUi* CVcxNsSettingsViewContainer::AppUi()
+    {
+    return &iAppUi;
+    }
+
+// ---------------------------------------------------------
+// CVcSettingsViewContainer::SettingsView()
+// ---------------------------------------------------------
+//
+CVcxNsSettingsView* CVcxNsSettingsViewContainer::SettingsView()
+    {
+    return iParentView;
+    }
+   
+// ---------------------------------------------------------
+// CVcSettingsViewContainer::SettingsView()
+// ---------------------------------------------------------
+//    
+CVcxNsSettingsViewServiceSelection* CVcxNsSettingsViewContainer::ServiceSelection()
+    {
+    return iServiceSelection;
+    }
+
+// ---------------------------------------------------------
+// CVcSettingsViewContainer::SwitchToServiceSelectionListL()
+// ---------------------------------------------------------
+//
+void CVcxNsSettingsViewContainer::SwitchToServiceSelectionListL()
+    {
+    iAddOrEditService->Deactivate();
+
+    iServiceSelection->LoadL();
+    iServiceSelection->ActivateL();
+
+    iActiveList = EServiceSelection;
+    DrawNow();    
+    }
+
+// ---------------------------------------------------------
+// CVcSettingsViewContainer::SwitchToServiceSelectionListL()
+// Special handler for direct activation of service subscriptions.
+// ---------------------------------------------------------
+//
+void CVcxNsSettingsViewContainer::SwitchToServiceSelectionListL( 
+        CIptvService::TServiceType aServiceType )
+    {
+    iAddOrEditService->Deactivate();
+
+    iServiceSelection->SetServiceType( aServiceType );
+    iServiceSelection->LoadL();
+    iServiceSelection->ActivateL();
+    iServiceSelection->CheckMsk( );
+
+    iActiveList = EServiceSelection;
+    DrawNow();    
+    }
+    
+// ---------------------------------------------------------
+// CVcSettingsViewContainer::FinishServiceSelectionList()
+// Special handler for closing service subscriptions.
+// ---------------------------------------------------------
+//
+void CVcxNsSettingsViewContainer::FinishServiceSelectionList()
+    {
+    iServiceSelection->Deactivate();
+    }
+
+// ---------------------------------------------------------
+// CVcSettingsViewContainer::SwitchToAddOrEditServiceListL()
+// ---------------------------------------------------------
+//
+void CVcxNsSettingsViewContainer::SwitchToAddOrEditServiceListL()
+    {
+    iServiceSelection->Deactivate();
+    iAddOrEditService->ActivateL();    
+    
+    iActiveList = EAddService;
+    DrawNow();    
+    }
+    
+// ---------------------------------------------------------
+// CVcSettingsViewContainer::EditCurrentSettingItemListItemL()
+// ---------------------------------------------------------
+//
+void CVcxNsSettingsViewContainer::EditCurrentSettingItemListItemL( 
+        TBool aCalledFromMenu )
+    {
+    if (iActiveList == EAddService)
+        {
+        iAddOrEditService->ListBox()->EditCurrentItemL();
+        }
+
+    if ( !aCalledFromMenu )
+        {
+        // Fixes not updating toggled setting items
+        ComponentControl( 0 )->DrawDeferred();
+        }
+    }
+
+// ---------------------------------------------------------
+// CVcSettingsViewContainer::ShowVideoServiceDetailsL()
+// ---------------------------------------------------------
+//
+void CVcxNsSettingsViewContainer::ShowVideoServiceDetailsL()
+    {
+    if ( iActiveList == EServiceSelection )
+        {
+        CIptvService* iptvService = iServiceSelection->GetCurrentServiceL();
+        
+        if ( iptvService )
+            {
+            CleanupStack::PushL(iptvService);
+            CAknMessageQueryDialog* dlg = new (ELeave) CAknMessageQueryDialog();
+            TDes16& desc = iptvService->GetDesc();
+            dlg->SetMessageText(desc);
+            CleanupStack::PopAndDestroy(iptvService);
+
+            dlg->ExecuteLD(R_VCSETTINGSVIEW_SERVICEDETAILS_QUERY);
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// CVcSettingsViewContainer::GetServiceSelectionServiceType()
+// ---------------------------------------------------------
+//    
+CIptvService::TServiceType CVcxNsSettingsViewContainer::GetServiceSelectionServiceType()
+    {
+    return iServiceSelection->GetServiceType();
+    }
+
+// ---------------------------------------------------------
+// CVcSettingsViewContainer::LoadAddServiceInformationL()
+// iAppSettings -> UI
+// ---------------------------------------------------------
+//
+void CVcxNsSettingsViewContainer::LoadAddServiceInformationL(TBool aAdding)
+    {
+    iAddOrEditService->LoadL(aAdding, iServiceSelection->GetServiceType());
+    }
+
+// ---------------------------------------------------------
+// CVcSettingsViewContainer::SaveServiceSelectionInformationL()
+// UI -> iAppSettings
+// ---------------------------------------------------------
+//
+void CVcxNsSettingsViewContainer::SaveServiceSelectionInformationL()
+    {
+    iServiceSelection->SaveL();
+    }
+
+// ---------------------------------------------------------
+// CVcSettingsViewContainer::SaveAddServiceInformationL()
+// UI -> iAppSettings
+// ---------------------------------------------------------
+//
+void CVcxNsSettingsViewContainer::SaveAddServiceInformationL()
+    {
+    iAddOrEditService->SaveL();
+    }
+
+// ---------------------------------------------------------
+// CVcSettingsViewContainer::HandleMarkCommandL()
+// ---------------------------------------------------------
+//
+void CVcxNsSettingsViewContainer::HandleMarkCommandL( TInt aCommand )
+    {
+    switch ( aCommand )
+        {
+        case EVcSettingsServiceCmdMark:
+            {
+            AknSelectionService::HandleMarkableListProcessCommandL(
+                                     EAknCmdMark, 
+                                     iServiceSelection->ListBox() );
+            }
+            break;
+
+        case EVcSettingsServiceCmdUnmark:
+            {
+            AknSelectionService::HandleMarkableListProcessCommandL(
+                                     EAknCmdUnmark, 
+                                     iServiceSelection->ListBox() );
+            }
+            break;
+        
+        default:
+            break;
+        }
+    }
+
+
+
+// ---------------------------------------------------------
+// CVcSettingsViewContainer::DeleteVideoServiceL()
+// ---------------------------------------------------------
+//
+void CVcxNsSettingsViewContainer::DeleteVideoServiceL()
+    {
+    if (iActiveList == EServiceSelection)
+        {    
+        iServiceSelection->DeleteCurrentServiceL();
+        }
+    }
+
+// ---------------------------------------------------------
+// CVcSettingsViewContainer::ShowMarkForCurrentListItemL()
+// ---------------------------------------------------------
+//
+TBool CVcxNsSettingsViewContainer::ShowMarkForCurrentListItemL()
+    {
+    return ((!IsCurrentListItemMarked()) && ShowMenuItemForCurrentListItemL(EConst));
+    }
+
+// ---------------------------------------------------------
+// CVcSettingsViewContainer::ShowUnmarkForCurrentListItemL()
+// ---------------------------------------------------------
+//
+TBool CVcxNsSettingsViewContainer::ShowUnmarkForCurrentListItemL()
+    {
+    return (IsCurrentListItemMarked() && ShowMenuItemForCurrentListItemL(EConst));
+    }
+
+// ---------------------------------------------------------
+// CVcSettingsViewContainer::IsCurrentListItemMarked()
+// ---------------------------------------------------------
+//
+TBool CVcxNsSettingsViewContainer::IsCurrentListItemMarked()
+    {
+    const CListBoxView::CSelectionIndexArray* indices = NULL;
+    TInt                                      index   = KErrNotFound;
+
+    if (iActiveList == EServiceSelection)
+        {
+        indices = iServiceSelection->ListBox()->SelectionIndexes();
+        index   = iServiceSelection->ListBox()->CurrentItemIndex();
+
+        for (TInt i = 0; i < indices->Count(); i++)
+            {
+            if (((*indices)[i]) == index)
+                {
+                return ETrue;
+                }
+            }
+        }
+
+    return EFalse;    
+    }
+
+// ---------------------------------------------------------
+// CVcSettingsViewContainer::ShowMenuItemForCurrentListItemL()
+// TMenuItemType: EGeneral, EConst, EConstAndInfo, EEditable
+// ---------------------------------------------------------
+//
+TBool CVcxNsSettingsViewContainer::ShowMenuItemForCurrentListItemL(
+                                    TMenuItemType aMenuItemType)
+    {
+    if (iActiveList == EServiceSelection)
+        {
+        if (iServiceSelection->ListBox()->CurrentItemIndex() >= 0)
+            {
+            switch (aMenuItemType)
+                {
+                case EGeneral:
+                case EConst:
+                default:
+                    // No special checks.
+                    break;
+
+                case EConstAndInfo:
+                    // For const items where info is needed, 
+                    // we check that info is available.
+                    {
+                    CIptvService* iptvService = 
+                        iServiceSelection->GetCurrentServiceL();
+
+                    if (iptvService)
+                        {
+                        CleanupStack::PushL(iptvService);
+                        TInt descLength = iptvService->GetDesc().Length();
+                        CleanupStack::PopAndDestroy(iptvService);
+                        
+                        return descLength > 0;
+                        }                    
+                    }
+                    break;
+
+                case EEditable:
+                    // For editable items, we need to check 
+                    // that service is not read only.
+                    {
+                    if (iServiceSelection->IsCurrentServiceReadOnlyL())
+                        {
+                        return EFalse;
+                        }                    
+                    }
+                    break;
+                }
+
+            return ETrue;
+            }
+        }
+
+    return EFalse;     
+    }
+
+// ---------------------------------------------------------
+// CVcSettingsViewContainer::SizeChanged()
+// ---------------------------------------------------------
+//
+void CVcxNsSettingsViewContainer::SizeChanged()
+    {
+    if (/*iSettingItem && iServiceType && */ iServiceSelection && iAddOrEditService )
+        {
+        iServiceSelection->ListBox()->SetRect(Rect());
+        iAddOrEditService->ListBox()->SetRect(Rect());
+        }
+    }
+
+// ---------------------------------------------------------
+// CVcSettingsViewContainer::CountComponentControls()
+// ---------------------------------------------------------
+//
+TInt CVcxNsSettingsViewContainer::CountComponentControls() const
+    {
+    // iSettingItemList, iServiceType, iServiceSelection, 
+    // iAddOrEditService or iChangePriorityList.
+    return 1;
+    }
+
+// ---------------------------------------------------------
+// CVcSettingsViewContainer::ComponentControl()
+// ---------------------------------------------------------
+//
+CCoeControl* CVcxNsSettingsViewContainer::ComponentControl(TInt aIndex) const
+    {
+    switch (aIndex)
+        {
+        case 0:
+            {
+            if (iActiveList == EServiceSelection)
+                {
+                return iServiceSelection->ListBox();
+                }
+            else if (iActiveList == EAddService)
+                {
+                return iAddOrEditService->ListBox();
+                }
+            else
+                {
+                return NULL;    
+                }
+            }
+        default:
+            {
+            return NULL;
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// CVcSettingsViewContainer::Draw()
+// ---------------------------------------------------------
+//
+void CVcxNsSettingsViewContainer::Draw(const TRect& /*aRect*/) const
+    {
+    }
+
+// ---------------------------------------------------------
+// CVcSettingsViewContainer::HandleResourceChange()
+// ---------------------------------------------------------
+//
+void CVcxNsSettingsViewContainer::HandleResourceChange( TInt aType )
+    {
+    CCoeControl::HandleResourceChange(aType);
+
+    iServiceSelection->ListBox()->HandleResourceChange( aType );
+    iAddOrEditService->ListBox()->HandleResourceChange( aType );
+
+    if( aType == KEikDynamicLayoutVariantSwitch )
+        {
+        TRect rect;
+
+        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, rect);
+        SetRect(rect);
+        }
+    }
+
+// ---------------------------------------------------------
+// CVcSettingsViewContainer::OfferKeyEventL()
+// ---------------------------------------------------------
+//
+TKeyResponse CVcxNsSettingsViewContainer::OfferKeyEventL( 
+        const TKeyEvent& aKeyEvent,
+        TEventCode aType )
+    {
+    
+    if ( aKeyEvent.iCode == EKeyLeftArrow ||
+         aKeyEvent.iCode == EKeyRightArrow)
+         {
+         return EKeyWasNotConsumed;
+         }
+    
+    if ( iActiveList == EServiceSelection &&
+         aType == EEventKey &&
+         aKeyEvent.iCode == EKeyOK && 
+         iServiceSelection )
+        {
+        SaveServiceSelectionInformationL();
+        return iServiceSelection->ListBox()->OfferKeyEventL( aKeyEvent, aType );
+        }
+
+    if ( aType == EEventKeyUp )
+        {        
+        CheckMsk();
+        }
+
+    if ( iActiveList == EServiceSelection && iServiceSelection )
+        {
+        if ( aKeyEvent.iScanCode == EStdKeyBackspace &&  aType == EEventKeyDown )
+            {
+            if ( ! iServiceSelection->IsCurrentServiceReadOnlyL() )
+                DeleteVideoServiceL();
+            return EKeyWasConsumed;
+            }
+        
+        return iServiceSelection->ListBox()->OfferKeyEventL( aKeyEvent, aType );
+        }
+    else if ( iActiveList == EAddService && iAddOrEditService )
+        {
+        return iAddOrEditService->ListBox()->OfferKeyEventL( aKeyEvent, aType );
+        }
+
+    return EKeyWasNotConsumed;
+    }
+
+// ---------------------------------------------------------
+// CVcSettingsViewContainer::GetHelpContext()
+// ---------------------------------------------------------
+//
+void CVcxNsSettingsViewContainer::GetHelpContext( TCoeHelpContext& aContext ) const
+    {
+    aContext.iMajor = KIptvHelpContextUid;
+
+    switch ( iActiveList )
+        {
+        case EServiceSelection:
+            {
+            if ( iServiceSelection->GetServiceType() == CIptvService::EVodCast )
+                {
+                IPTVLOGSTRING_LOW_LEVEL(
+                    "Settings view ## CVcSettingsViewContainer::GetHelpContext()\
+                     KIPTV_HLP_SERVICE_SEL_VODCAST");
+                aContext.iContext = KIPTV_HLP_SERVICE_SEL_VODCAST;
+                }
+            else if ( iServiceSelection->GetServiceType() == CIptvService::EVod )
+                {
+                IPTVLOGSTRING_LOW_LEVEL(
+                    "Settings view ## CVcSettingsViewContainer::GetHelpContext()\
+                     KIPTV_HLP_SERVICE_SEL_VODCAST");
+                aContext.iContext = KIPTV_HLP_SERVICE_SEL_VODCAST;
+                }
+            else if ( iServiceSelection->GetServiceType() == CIptvService::EBrowser )
+                {
+                IPTVLOGSTRING_LOW_LEVEL(
+                    "Settings view ## CVcSettingsViewContainer::GetHelpContext()\
+                     KIPTV_HLP_SERVICE_SELECTION_WEB");
+                aContext.iContext = KIPTV_HLP_SERVICE_SELECTION_WEB;
+                }
+            }
+            break;
+
+        case EAddService:
+            {
+            IPTVLOGSTRING_LOW_LEVEL(
+                "Settings view ## CVcSettingsViewContainer::GetHelpContext()\
+                 KIPTV_HLP_ADD_SERVICE");
+            aContext.iContext = KIPTV_HLP_ADD_SERVICE;
+            }
+            break;
+
+        default:
+            {
+            IPTVLOGSTRING_LOW_LEVEL(
+                "Settings view ## CVcSettingsViewContainer::GetHelpContext()\
+                KIPTV_HLP_SETTINGS(3)");
+            aContext.iContext = KIPTV_HLP_SETTINGS;
+            }
+            break;
+        }
+    }
+    
+// ---------------------------------------------------------
+// CVcSettingsViewContainer::LoadAddVodCastFeedL()
+// ---------------------------------------------------------
+//    
+void CVcxNsSettingsViewContainer::LoadAddVodCastFeedL()
+    {
+    TBool adding( ETrue );
+    iAddOrEditService->LoadL( adding, CIptvService::EVodCast );                         
+    }
+
+// ---------------------------------------------------------
+// CVcxNsSettingsViewContainer::HandleListBoxEventL
+// ---------------------------------------------------------
+//
+void CVcxNsSettingsViewContainer::HandleListBoxEventL( 
+        CEikListBox* /*aListBox*/, TListBoxEvent aEventType )
+    {
+    if ( aEventType == EEventEnterKeyPressed   ||
+         aEventType == EEventItemSingleClicked ||
+         aEventType == EEventItemDoubleClicked  )
+        {
+        switch ( iActiveList )
+            {
+            case EServiceSelection:
+                // decide wether to handle select, mark or unmark cmd
+                if( IsCurrentListItemMarked() )
+                    {
+                    // item already marked, unmark
+                    HandleMarkCommandL( EVcSettingsServiceCmdUnmark );
+                    break;
+                    }
+                else
+                    {
+                    // item unmarked, mark it
+                    HandleMarkCommandL( EVcSettingsServiceCmdMark );
+                    break;
+                    }                
+            default:
+                break;
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// CVcSettingsViewContainer::ClearMsk()
+// ---------------------------------------------------------
+//    
+void CVcxNsSettingsViewContainer::ClearMsk()
+    {
+    iCurrentMskResource = 0;                      
+    }
+
+// ---------------------------------------------------------
+// CVcSettingsViewContainer::CheckMsk()
+// ---------------------------------------------------------
+//    
+void CVcxNsSettingsViewContainer::CheckMsk()
+    {
+    if ( iActiveList == EAddService   )
+        {            
+        TInt resourceId( 0 );
+        
+        if ( ! iParentView ||
+             ! iParentView->GetButtonGroupContainer() )
+            {
+            return;
+            }
+
+        resourceId = R_VCSETTINGSVIEW_MSK_BUTTON_CHANGE;
+            
+        if ( resourceId != iCurrentMskResource )
+            {
+            iCurrentMskResource = resourceId;
+            
+            CEikButtonGroupContainer* cba = iParentView->GetButtonGroupContainer();
+
+            TRAPD( err, cba->SetCommandL( KIptvMskPosition, iCurrentMskResource ) );
+            if ( err == KErrNone )
+                {                            
+                cba->DrawDeferred();            
+                }
+            }
+        }
+    else if ( iActiveList == EServiceSelection && iServiceSelection)
+        {
+        iServiceSelection->CheckMsk();
+        }
+    }
+
+// ---------------------------------------------------------
+// CVcxNsSettingsViewContainer::TitleResourceId
+// ---------------------------------------------------------
+//
+TInt CVcxNsSettingsViewContainer::TitleResourceId()
+    {
+    return R_MPSETT_FEEDS_VIEW_TITLE;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/feedsettingsviews/src/feedsettingsviewremoveservicequerydialog.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,136 @@
+/*
+* Copyright (c) 2006-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:    Remove service query dialog.*
+*/
+
+
+
+
+// INCLUDE FILES
+#include <e32base.h>
+#include "IptvDebug.h"
+#include "feedsettingsviewremoveservicequerydialog.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+// ---------------------------------------------------------
+// CVcSettingsViewRemoveServiceQueryDialog::CVcSettingsViewRemoveServiceQueryDialog
+// C++ default constructor
+// ---------------------------------------------------------
+//
+CVcxNsSettingsViewRemoveServiceQueryDialog::CVcxNsSettingsViewRemoveServiceQueryDialog( )  
+    {
+    IPTVLOGSTRING_LOW_LEVEL(
+    "CVcSettingsViewRemoveServiceQueryDialog::CVcSettingsViewRemoveServiceQueryDialog");
+    }
+
+// ---------------------------------------------------------
+// CVcSettingsViewRemoveServiceQueryDialog::ConstructL
+// Symbian 2nd phase constructor can leave.
+// ---------------------------------------------------------
+//
+void CVcxNsSettingsViewRemoveServiceQueryDialog::ConstructL( const TDesC& aMessageText )
+    {    
+    IPTVLOGSTRING_LOW_LEVEL("CVcSettingsViewRemoveServiceQueryDialog::ConstructL");
+    SetMessageTextL( aMessageText );        
+    }
+
+// ---------------------------------------------------------
+// CVcSettingsViewRemoveServiceQueryDialog::NewL
+// Two-phased constructor.
+// ---------------------------------------------------------
+//
+CVcxNsSettingsViewRemoveServiceQueryDialog* CVcxNsSettingsViewRemoveServiceQueryDialog::NewL( 
+                                                            const TDesC& aMessageText )
+    {
+    IPTVLOGSTRING_LOW_LEVEL("CVcSettingsViewRemoveServiceQueryDialog::NewL");        
+
+    CVcxNsSettingsViewRemoveServiceQueryDialog* self = 
+    new(ELeave) CVcxNsSettingsViewRemoveServiceQueryDialog(  );
+    CleanupStack::PushL(self);
+    self->ConstructL(aMessageText);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// ---------------------------------------------------------
+// CVcSettingsViewRemoveServiceQueryDialog::~CVcSettingsViewRemoveServiceQueryDialog
+// Destructor
+// -----------------------------------------------------------------------------
+//
+CVcxNsSettingsViewRemoveServiceQueryDialog::~CVcxNsSettingsViewRemoveServiceQueryDialog()
+    {
+    IPTVLOGSTRING_LOW_LEVEL(
+    "CVcSettingsViewRemoveServiceQueryDialog::~CVcSettingsViewRemoveServiceQueryDialog");                
+    }
+    
+// ---------------------------------------------------------
+// CVcSettingsViewRemoveServiceQueryDialog::~CVcSettingsViewRemoveServiceQueryDialog
+// Destructor
+// -----------------------------------------------------------------------------
+//
+TKeyResponse CVcxNsSettingsViewRemoveServiceQueryDialog::OfferKeyEventL(
+                                                        const TKeyEvent& aKeyEvent, 
+                                                        TEventCode aCode )
+    {
+    IPTVLOGSTRING2_LOW_LEVEL(
+        "CVcSettingsViewRemoveServiceQueryDialog::OfferKeyEventL aKeyEvent.iCode: %d",
+        aKeyEvent.iCode);
+    IPTVLOGSTRING2_LOW_LEVEL(
+        "CVcSettingsViewRemoveServiceQueryDialog::OfferKeyEventL aKeyEvent.iScanCode: %d",
+        aKeyEvent.iScanCode);
+    IPTVLOGSTRING2_LOW_LEVEL(
+        "CVcSettingsViewRemoveServiceQueryDialog::OfferKeyEventL aCode: %d", aCode);
+    
+    return CAknMessageQueryDialog::OfferKeyEventL( aKeyEvent, aCode );       
+    }
+
+// ---------------------------------------------------------
+// CVcSettingsViewRemoveServiceQueryDialog::OkToExitL
+// -----------------------------------------------------------------------------
+//
+TBool CVcxNsSettingsViewRemoveServiceQueryDialog::OkToExitL( TInt /*aButtonId*/ )
+    {
+    IPTVLOGSTRING_LOW_LEVEL(
+       "CVcSettingsViewRemoveServiceQueryDialog::OkToExitL() returning ETrue.");
+    return ETrue;
+    }    
+
+// ---------------------------------------------------------
+// CVcSettingsViewRemoveServiceQueryDialog::OkToExitL
+// -----------------------------------------------------------------------------
+// 
+TBool CVcxNsSettingsViewRemoveServiceQueryDialog::NeedToDismissQueryL( const TKeyEvent& aKeyEvent )
+    {
+    IPTVLOGSTRING2_LOW_LEVEL(
+        "CVcSettingsViewRemoveServiceQueryDialog::NeedToDismissQueryL aKeyEvent.iCode: %d",
+        aKeyEvent.iCode );
+    IPTVLOGSTRING2_LOW_LEVEL(
+        "CVcSettingsViewRemoveServiceQueryDialog::NeedToDismissQueryL aKeyEvent.iScanCode: %d",
+        aKeyEvent.iScanCode );    
+    return CAknMessageQueryDialog::NeedToDismissQueryL( aKeyEvent );
+    }
+
+
+// ---------------------------------------------------------
+// CVcxNsSettingsViewRemoveServiceQueryDialog::ProcessCommandL
+// -----------------------------------------------------------------------------
+// 
+void CVcxNsSettingsViewRemoveServiceQueryDialog::ProcessCommandL( TInt aCommandId )    
+    {
+    IPTVLOGSTRING2_LOW_LEVEL(
+        "CVcSettingsViewRemoveServiceQueryDialog::ProcessCommandL aCommandId %d", 
+        aCommandId );
+    
+    CAknMessageQueryDialog::ProcessCommandL( aCommandId );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/feedsettingsviews/src/feedsettingsviewserviceselection.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,809 @@
+/*
+* Copyright (c) 2006 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 for "service selection list" in Settings UI.*
+*/
+
+
+
+// INCLUDE FILES
+#include <aknlists.h>
+#include <StringLoader.h>
+#include <akntitle.h>
+#include <eikclbd.h>
+#include <barsread.h>
+#include <aknViewAppUi.h>
+#include <browserlauncher.h>
+#include <browseroverriddensettings.h>
+#include <uriutils.h>
+#include "IptvDebug.h"
+#include <AknQueryDialog.h>
+#include <ipvideo/vcxconnectionutility.h>
+#include <vcxnssettingsview.rsg>
+#include "vcxnsservicesettings.h"
+
+#include "CIptvService.h"
+#include "feedsettingsviewremoveservicequerydialog.h"
+#include "feedsettingsview.h"
+#include "feedsettingsviewserviceselection.h"
+#include "iptvlocalisationliterals.h"
+
+// CONSTANTS
+/* Parameter for embedded browser launch */
+_LIT(KUrlLaunchParameter, "4 ");
+_LIT(KServicesListItemFormat, "1\t%S");
+_LIT( KLinkTagOpen, "<AknMessageQuery Link>" );
+_LIT( KLinkTagClose, "</AknMessageQuery Link>" );
+_LIT( KNextLine, "\n" );
+
+const TInt KServicesListItemMaxLength = KIptvSmServicesDbNameMaxLength + 5;
+const TInt KIptvMskPosition = 3;
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CVcSettingsViewServiceSelection::CVcSettingsViewServiceSelection()
+// -----------------------------------------------------------------------------
+//
+CVcxNsSettingsViewServiceSelection::CVcxNsSettingsViewServiceSelection(
+        CVcxNsSettingsViewContainer* aParent,
+        CVcxNsServiceSettings& aServiceSettings )
+ :  iParent(aParent),
+    iServiceSettings(aServiceSettings),
+    iOwnButtons(EFalse),    
+    iServiceType((CIptvService::TServiceType)0)
+    {
+    __ASSERT_DEBUG(iParent, User::Panic(KNullDesC, KErrBadHandle));
+    }
+
+// -----------------------------------------------------------------------------
+// CVcSettingsViewServiceSelection::NewL()
+// -----------------------------------------------------------------------------
+//
+CVcxNsSettingsViewServiceSelection* CVcxNsSettingsViewServiceSelection::NewL(
+        CVcxNsSettingsViewContainer* aParent,
+        CVcxNsServiceSettings& aServiceSettings )
+    {
+    CVcxNsSettingsViewServiceSelection* self = 
+        new (ELeave) CVcxNsSettingsViewServiceSelection(aParent, aServiceSettings);
+
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcSettingsViewServiceSelection::ConstructL()
+// -----------------------------------------------------------------------------
+//
+void CVcxNsSettingsViewServiceSelection::ConstructL()
+    {
+    TResourceReader reader;
+    iListbox = new (ELeave) CAknSingleGraphicStyleListBox();
+    iParent->ControlEnv()->CreateResourceReaderLC( reader, 
+                                 R_VCSETTINGSVIEW_SERVICESELECTION_LIST );
+    iListbox->SetContainerWindowL(*iParent);
+    iListbox->SetListBoxObserver(iParent);
+    iListbox->ConstructFromResourceL(reader);
+    CleanupStack::PopAndDestroy(); // reader
+    const TInt KGranularity( 4 );
+    CAknIconArray* icons = new (ELeave) CAknIconArray( KGranularity );
+    CleanupStack::PushL(icons);
+    icons->ConstructFromResourceL(R_IPTV_CHECKBOX_ICONS);
+    CleanupStack::Pop(icons);
+    iListbox->ItemDrawer()->ColumnData()->SetIconArray(icons);
+    CTextListBoxModel* model = iListbox->Model();
+    model->SetOwnershipType(ELbmOwnsItemArray);
+    
+    iListbox->CreateScrollBarFrameL(ETrue);
+    iListbox->SetMopParent(iParent);    
+    }
+
+// -----------------------------------------------------------------------------
+// CVcSettingsViewServiceSelection::~CVcSettingsViewServiceSelection()
+// -----------------------------------------------------------------------------
+//
+CVcxNsSettingsViewServiceSelection::~CVcxNsSettingsViewServiceSelection()
+    {
+    if ( iOwnButtons && iParent )
+        {
+        CEikButtonGroupContainer* cba = iParent->SettingsView()->GetButtonGroupContainer();
+        if ( cba )
+            {
+            RemoveCommandsFromCba( *cba );
+            }
+        }
+
+    delete iListbox;
+    delete iServicesArray;
+    delete iServicesArrayVodCast;
+    delete iLauncher;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcSettingsViewServiceSelection::ActivateL()
+// -----------------------------------------------------------------------------
+//
+void CVcxNsSettingsViewServiceSelection::ActivateL()
+    {
+    // Force MSK refresh after every activation
+    iCurrentMskResource = KErrNotFound;
+
+    if (iServicesArray)
+        {
+        if (iServicesArray->Count() > 0)
+            {
+            iListbox->SetCurrentItemIndex(0);
+            }
+        }
+
+    iParent->SetTitleL( R_MPSETT_FEEDS_VIEW_TITLE );
+    
+    iListbox->ScrollBarFrame()->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, 
+                                                         CEikScrollBarFrame::EAuto );
+    iListbox->MakeVisible(ETrue);
+    iListbox->DrawNow();
+
+    iListbox->UpdateScrollBarsL();
+    }
+
+// -----------------------------------------------------------------------------
+// CVcSettingsViewServiceSelection::Deactivate()
+// -----------------------------------------------------------------------------
+//
+void CVcxNsSettingsViewServiceSelection::Deactivate()
+    {
+    if (iOwnButtons)
+        {
+        CEikButtonGroupContainer* cba = iParent->SettingsView()->GetButtonGroupContainer();
+        if ( cba )
+            {
+            RemoveCommandsFromCba( *cba );
+            cba->DrawNow();
+            }
+        iOwnButtons = EFalse;
+        }
+
+    TRAP_IGNORE(iListbox->ScrollBarFrame()->SetScrollBarVisibilityL(
+                CEikScrollBarFrame::EOff, CEikScrollBarFrame::EOff));
+
+    // Clear msk value so that when we return 
+    // to original menu we can set the correct msk.
+    iParent->ClearMsk();    
+
+    iListbox->MakeVisible(EFalse);
+    }
+
+// -----------------------------------------------------------------------------
+// CVcSettingsViewServiceSelection::SetServiceType()
+// -----------------------------------------------------------------------------
+//
+void CVcxNsSettingsViewServiceSelection::SetServiceType(
+                                         CIptvService::TServiceType aServiceType )
+    {
+    iServiceType = aServiceType;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcSettingsViewServiceSelection::GetServiceType()
+// -----------------------------------------------------------------------------
+//
+CIptvService::TServiceType CVcxNsSettingsViewServiceSelection::GetServiceType()
+    {
+    return iServiceType;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcSettingsViewServiceSelection::GetCurrentServiceL()
+// -----------------------------------------------------------------------------
+//
+CIptvService* CVcxNsSettingsViewServiceSelection::GetCurrentServiceL()
+    {
+    TInt index = iListbox->CurrentItemIndex();
+
+    if (index != KErrNotFound)
+        {
+        CIptvService* iptvService = CIptvService::NewL();
+        CleanupStack::PushL(iptvService);
+        iptvService->SetL(iServicesArray->MdcaPoint(index));
+        CleanupStack::Pop(iptvService);
+        return iptvService;
+        }
+    else
+        {
+        return NULL;    
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcSettingsViewServiceSelection::IsCurrentServiceReadOnlyL()
+// -----------------------------------------------------------------------------
+//
+TBool CVcxNsSettingsViewServiceSelection::IsCurrentServiceReadOnlyL()
+    {
+    CIptvService* service  = GetCurrentServiceL();
+    TBool toReturn ( EFalse );
+    
+    if (service)
+        {
+        CleanupStack::PushL(service);
+        
+        TUint32 flags = service->GetFlags();
+        
+        if (flags & CIptvService::EReadOnly)
+            {
+            toReturn = ETrue;
+            }
+
+        CleanupStack::PopAndDestroy(service);        
+        }
+
+    return toReturn;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcSettingsViewServiceSelection::ShowAccountMgmtDialogL
+//
+// -----------------------------------------------------------------------------
+//
+TInt CVcxNsSettingsViewServiceSelection::ShowAccountMgmtDialogL()
+    {
+    TInt result(0);
+    
+    //Get texts for the message query
+    HBufC* removeServiceText = 
+        StringLoader::LoadLC( R_VCSETTINGSVIEW_REMOVE_SERVICE_WITH_ACCOUNT );
+    HBufC* link = StringLoader::LoadLC( R_VCSETTINGSVIEW_LINK_ACCOUNT );
+    HBufC* accMgmtLink = link->ReAllocL( link->Length() +
+                                         KLinkTagOpen().Length() + 
+                                         KLinkTagClose().Length() );
+    
+    CleanupStack::Pop( link );
+    link = accMgmtLink;
+    CleanupStack::PushL( link );
+    
+    link->Des().Insert(0, KLinkTagOpen);
+    link->Des().Append( KLinkTagClose );   
+
+    HBufC* msgText = HBufC::NewLC( removeServiceText->Length() + 
+                                   link->Length() + 
+                                   KNextLine().Length() );
+                             
+                                        
+    TPtr ptr( msgText->Des() );   
+    ptr += *removeServiceText;        
+    ptr += KNextLine;
+    ptr += *link;
+
+    TCallBack accMgmtCallback( ShowLinkL, this );
+        
+    // Create and show the message query dialog
+    CVcxNsSettingsViewRemoveServiceQueryDialog* dlg =
+      CVcxNsSettingsViewRemoveServiceQueryDialog::NewL( *msgText );
+    
+    // PrepareLC pushes *this to cleanup stack.
+    dlg->PrepareLC( R_VCSETTINGSVIEW_REMOVE_SERVICE_QUERY );
+    dlg->ButtonGroupContainer().SetCommandSetL( 
+                                     R_VCSETTINGSVIEW_SOFTKEYS_REMOVE_CANCEL );
+    dlg->SetLink( accMgmtCallback );
+    
+    result = dlg->RunLD();
+    
+    CleanupStack::PopAndDestroy( msgText ); // message, this
+    CleanupStack::PopAndDestroy( link );
+    CleanupStack::PopAndDestroy( removeServiceText );
+    
+    return result;    
+    }
+
+// -----------------------------------------------------------------------------
+// CVcSettingsViewServiceSelection::ShowLinkL
+// Used as a callback function in message query.
+// -----------------------------------------------------------------------------
+//
+TInt CVcxNsSettingsViewServiceSelection::ShowLinkL( TAny* ptr )
+    {
+    TInt error(KErrNone);
+    
+    CVcxNsSettingsViewServiceSelection* serviceSelection = 
+        static_cast<CVcxNsSettingsViewServiceSelection*>(ptr);
+    TInt index = serviceSelection->ListBox()->CurrentItemIndex();
+    TBuf<KIptvSmServicesDbAccountManagementUrlMaxLength> accMgmtUri;
+    if ( index >= 0 )
+        {
+        // Get some basic data about the service.
+        CIptvService* iptvService = CIptvService::NewL();
+        CleanupStack::PushL(iptvService);
+        iptvService->SetL(serviceSelection->iServicesArray->MdcaPoint(index));
+        accMgmtUri  = iptvService->GetAccountManagementUrl();
+        CleanupStack::PopAndDestroy(iptvService);
+        
+        if ( accMgmtUri.Length() > 0 )
+            {
+            serviceSelection->OpenEmbeddedBrowserL( accMgmtUri );
+            }
+        }
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcSettingsViewServiceSelection::DeleteCurrentServiceL()
+// -----------------------------------------------------------------------------
+//
+void CVcxNsSettingsViewServiceSelection::DeleteCurrentServiceL()
+    {
+    TInt index = iListbox->CurrentItemIndex();
+
+    if (index >= 0)
+        {
+        TBuf<KIptvSmServicesDbNameMaxLength> name;
+        TBuf<KIptvSmServicesDbAccountManagementUrlMaxLength> accMgmtUri;
+        CAknQueryDialog*                   dlg    = NULL;
+        HBufC*                             text   = NULL;
+        TUint32                            itemId = 0;
+        TInt                               result = 0;
+
+        // Get some basic data about the service.
+        CIptvService* iptvService = CIptvService::NewL();
+        CleanupStack::PushL(iptvService);
+        iptvService->SetL(iServicesArray->MdcaPoint(index));
+        itemId      = iptvService->GetId();
+        name        = iptvService->GetName();
+        accMgmtUri  = iptvService->GetAccountManagementUrl();
+        CleanupStack::PopAndDestroy(iptvService);
+
+        // Display confirmation query.
+        switch ( iServiceType )
+            {
+            case CIptvService::EVod:
+            case CIptvService::EServiceGroup:
+            case CIptvService::ELiveTv:
+                {
+                if ( accMgmtUri.Length() > 0 )
+                    {
+                    result= ShowAccountMgmtDialogL();    
+                    break;
+                    }
+                else
+                    {
+                    text = StringLoader::LoadLC( R_IPTV_REMOVE_SERVICE_CONFIRMATION,
+                                                 name );
+                    break;
+                    }
+                }
+            case CIptvService::EVodCast:
+                {
+                // "Remove feed %U?"
+                text = StringLoader::LoadLC(R_IPTV_REMOVE_FEED_CONFIRMATION,
+                                            name );
+                break;
+                }
+
+            case CIptvService::EBrowser:
+                {
+                text = StringLoader::LoadLC(R_IPTV_REMOVE_WEB_LINK_CONFIRMATION,
+                                            name );
+                break;
+                }
+            default:
+                break;    
+            }
+        if (text)
+            {
+            dlg    = CAknQueryDialog::NewL();
+            result = dlg->ExecuteLD(R_VCSETTINGSVIEW_DELETE_CONFIRMATION_QUERY, *text);
+            CleanupStack::PopAndDestroy(text);
+            }
+
+        if (result == EAknSoftkeyYes || result == EAknSoftkeyOk)
+            {
+                
+            // Create copy of currently selected items.
+            const CListBoxView::CSelectionIndexArray* indices = 
+                                                iListbox->SelectionIndexes();
+            RArray<TInt> copyIndices;
+            CleanupClosePushL(copyIndices);
+            TInt err( KErrNone );
+            for (TInt i = 0; i < indices->Count(); i++)
+                {
+                err = copyIndices.InsertInOrder((*indices)[i]);
+                if ( err != KErrNone )
+                    {
+                    IPTVLOGSTRING2_LOW_LEVEL( 
+                        "CVcSettingsViewServiceSelection::DeleteCurrentServiceL:\
+                        InsertInOrder failed: %d", err );
+                    
+                    if ( err != KErrAlreadyExists )
+                        {
+                        User::Leave( err );
+                        }
+                    }
+                }
+
+            // Remove the item from listbox.
+            CTextListBoxModel* model = iListbox->Model();
+            CDesCArray* array = STATIC_CAST(CDesCArray*, model->ItemTextArray());
+            array->Delete(index);
+
+            // Remove the item from DB.
+            iServiceSettings.DeleteServiceL(itemId);
+
+            // Remove the item from iServicesArray-list.
+            iServicesArray->Delete(index);
+
+            AknListBoxUtils::HandleItemRemovalAndPositionHighlightL( iListbox, 
+                                                                     index, 
+                                                                     ETrue );
+
+            // Mark the items that were marked before deletion.
+            for (TInt j = 0; j < copyIndices.Count(); j++)
+                {
+                if (copyIndices[j] < index)
+                    {
+                    iListbox->View()->SelectItemL(copyIndices[j]);
+                    }
+                else if (copyIndices[j] > index)
+                    {
+                    iListbox->View()->SelectItemL(copyIndices[j] - 1);
+                    }
+                }
+            CleanupStack::PopAndDestroy( &copyIndices );
+            iListbox->DrawNow();
+            iParent->DrawNow();            
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcSettingsViewServiceSelection::LoadL()
+// -----------------------------------------------------------------------------
+//
+void CVcxNsSettingsViewServiceSelection::LoadL()
+    {
+    IPTVLOGSTRING_LOW_LEVEL(
+        "Settings view ## CVcSettingsViewServiceSelection::LoadL() - Enter");
+
+    TBuf<KServicesListItemMaxLength> item;
+
+    delete iServicesArray;
+    iServicesArray = NULL;
+    iServicesArray = iServiceSettings.GetServicesByTypeL(iServiceType);
+    
+    CTextListBoxModel* model = iListbox->Model();
+    CDesCArray* array = STATIC_CAST(CDesCArray*, model->ItemTextArray());
+    array->Reset();    
+    
+    if (iServicesArray)
+        {
+        CIptvService*  iptvService = CIptvService::NewL();
+        CleanupStack::PushL(iptvService);
+
+        // remove services that are inside a servicegroup from the list.
+        TInt i = 0;
+        while ( i < iServicesArray->MdcaCount() )
+            {
+            iptvService->SetL(iServicesArray->MdcaPoint(i));
+
+            TUint32 flags = iptvService->GetFlags();
+            if ( flags & CIptvService::EGroupedService )
+                {
+                iServicesArray->Delete( i );
+                }
+            else
+                {
+                i++;
+                }
+            }
+        
+        // Note: Item order of our iServicesArray-list matches order of 
+        // iServiceSelectionList-listbox.
+
+        for (TInt i = 0; i < iServicesArray->MdcaCount(); i++)
+            {
+            iptvService->SetL(iServicesArray->MdcaPoint(i));
+            
+            if ( iptvService->GetName().Match( KQtnIptvNewServiceMain ) == 0 )
+                {
+                // "qtn_iptv_new_service_main" is replaced to localised text.
+                HBufC* addServicesLocalised = 
+                                StringLoader::LoadLC( R_IPTV_NEW_SERVICE_MAIN );
+                item.Format( KServicesListItemFormat, addServicesLocalised );
+                CleanupStack::PopAndDestroy( addServicesLocalised );
+                }
+            else if ( iptvService->GetName().Match( KQtnIptvVideoDirectoryList ) == 0 )
+                {
+                // "qtn_iptv_video_directory_list" is replaced to localised text.
+                HBufC* videoDirectoryLocalised = 
+                            StringLoader::LoadLC( R_IPTV_VIDEO_DIRECTORY_LIST );
+                item.Format( KServicesListItemFormat, videoDirectoryLocalised );
+                CleanupStack::PopAndDestroy( videoDirectoryLocalised );
+                }
+            else 
+                {
+                TPtrC16 name( iptvService->GetName() );
+                item.Format( KServicesListItemFormat, &name );
+                }
+        
+            array->AppendL( item );
+
+            TUint32 flags = iptvService->GetFlags();
+            if (flags & CIptvService::ESelected)
+                {
+                iListbox->View()->SelectItemL(i);
+                }
+            else
+                {
+                iListbox->View()->DeselectItem(i);
+                }
+            }
+           
+        CleanupStack::PopAndDestroy(iptvService);
+        }
+
+    // Update empty text.
+    HBufC* emptyText = NULL;
+    switch (iServiceType)
+        {
+        case CIptvService::EVod:
+        case CIptvService::EServiceGroup:
+        case CIptvService::ELiveTv:
+            {
+            // "No services."
+            emptyText = StringLoader::LoadLC(R_IPTV_NO_VIDEO_SERVICES);
+            break;
+            }
+        case CIptvService::EVodCast:
+            {
+            // "No feeds."
+            emptyText = StringLoader::LoadLC(R_IPTV_NO_FEEDS_SELECTED);
+            break;
+            }
+        case CIptvService::EBrowser:
+            {
+            // "No links."
+            emptyText = StringLoader::LoadLC(R_IPTV_NO_WEB_LINKS);
+            break;
+            }
+        default:
+            break;    
+        }
+    if (emptyText)
+        {
+        iListbox->View()->SetListEmptyTextL(*emptyText);
+        CleanupStack::PopAndDestroy(emptyText);    
+        }
+
+    iListbox->HandleItemAdditionL();
+    iListbox->DrawNow();
+    iParent->DrawNow();
+
+    IPTVLOGSTRING_LOW_LEVEL(
+        "Settings view ## CVcSettingsViewServiceSelection::LoadL() - Exit");
+    }
+
+// -----------------------------------------------------------------------------
+// CVcSettingsViewServiceSelection::SaveL()
+// -----------------------------------------------------------------------------
+//
+void CVcxNsSettingsViewServiceSelection::SaveL()
+    {
+    const CListBoxView::CSelectionIndexArray* indices = iListbox->SelectionIndexes();
+    CTextListBoxModel*                        model   = iListbox->Model();
+
+    // We go through each item in list. Those that are in indices
+    // list are updated as selected, and those that are not are
+    // updated as not selected.
+    for (TInt i = 0; i < model->NumberOfItems(); i++)
+        {
+        TBool bSelected ( EFalse );
+        
+        for (TInt j = 0; j < indices->Count(); j++)
+            {
+            // Check if currently processed item is selected.
+            if (i == ((*indices)[j]))
+                {
+                bSelected = ETrue;
+                break;
+                }
+            }
+
+        // Update the information for currently processed item.
+        CIptvService* iptvService = CIptvService::NewL();
+        CleanupStack::PushL(iptvService);
+        iptvService->SetL(iServicesArray->MdcaPoint(i));
+        
+        TUint32 flags    = iptvService->GetFlags();
+        TUint32 oldFlags = flags;
+        
+        if (bSelected)
+            {
+            flags |= CIptvService::ESelected;                
+            }
+        else
+            {
+            flags &= ~CIptvService::ESelected;
+            }
+
+        if (flags != oldFlags)
+            {
+            iptvService->SetFlags(flags);
+            iServiceSettings.UpdateServiceL(*iptvService);
+            }
+
+        CleanupStack::PopAndDestroy(iptvService);
+        }
+    }
+    
+// -----------------------------------------------------------------------------
+// CVcSettingsViewServiceSelection::ListBox()
+// -----------------------------------------------------------------------------
+//
+CAknSingleGraphicStyleListBox* CVcxNsSettingsViewServiceSelection::ListBox()
+    {
+    __ASSERT_DEBUG(iListbox, User::Panic(KNullDesC, KErrBadHandle));
+
+    return iListbox;
+    }    
+
+// -----------------------------------------------------------------------------
+// CVcSettingsViewServiceSelection::GetServiceIdL
+// -----------------------------------------------------------------------------
+//
+void CVcxNsSettingsViewServiceSelection::GetServiceIdL( 
+    TUint32& aServiceId )
+    {
+    TInt currentItem = iListbox->CurrentItemIndex();
+
+    // Make sure that view is not empty.
+    if ( currentItem >= 0 && currentItem < iServicesArray->Count() )
+        {
+        CIptvService* iptvService = CIptvService::NewL();
+        CleanupStack::PushL( iptvService );
+        
+        iptvService->SetL( iServicesArray->MdcaPoint( currentItem ) );
+        aServiceId = iptvService->GetId();
+        
+        CleanupStack::PopAndDestroy( iptvService );
+        }
+    }
+    
+// -----------------------------------------------------------------------------
+// CVcSettingsViewServiceSelection::CheckMsk()
+// -----------------------------------------------------------------------------
+//
+void CVcxNsSettingsViewServiceSelection::CheckMsk( )
+    {
+    TInt resourceId( 0 );
+    
+    if ( ! iParent ||
+         ! iParent->SettingsView() ||
+         ! iParent->SettingsView()->GetButtonGroupContainer() )
+        {
+        return;
+        }
+    
+    if ( !iListbox || !iListbox->Model() ||
+         iListbox->Model()->NumberOfItems() < 1 )
+        {
+        resourceId = R_VCSETTINGSVIEW_MSK_EMPTY;
+        }
+    else if ( IsCurrentListItemMarked() )
+        {
+        resourceId = R_VCSETTINGSVIEW_SERVICE_SELECTION_MSK_BUTTON_UNMARK;
+        }
+    else
+        {
+        resourceId = R_VCSETTINGSVIEW_SERVICE_SELECTION_MSK_BUTTON_MARK;
+        }
+
+    if ( resourceId )
+        {
+        iCurrentMskResource = resourceId;
+
+        CEikButtonGroupContainer* cba =
+                        iParent->SettingsView()->GetButtonGroupContainer();
+
+        TRAPD( err, cba->SetCommandL( KIptvMskPosition, iCurrentMskResource ) );
+        if ( err == KErrNone )
+            {                            
+            cba->DrawDeferred();            
+            }
+        }
+    }
+    
+// ---------------------------------------------------------
+// CVcSettingsViewServiceSelection::IsCurrentListItemMarked()
+// ---------------------------------------------------------
+//
+TBool CVcxNsSettingsViewServiceSelection::IsCurrentListItemMarked()
+    {	
+	TInt currentIndex = iListbox->View()->CurrentItemIndex();
+	if ( currentIndex >= 0 )
+	    {
+	    return iListbox->View()->ItemIsSelected( currentIndex );
+	    }
+	else
+	    {
+	    return EFalse;
+	    }
+    }
+
+// -----------------------------------------------------------------------------
+// Open browser in embedded mode with specified uri
+// -----------------------------------------------------------------------------
+//
+void CVcxNsSettingsViewServiceSelection::OpenEmbeddedBrowserL( const TDesC& aUri )
+    {
+    if ( aUri.Length() > 0 )
+        {
+        CUri8* inetUri = NULL;
+        inetUri = UriUtils::CreateUriL( aUri );
+        CleanupStack::PushL( inetUri );
+
+        HBufC8* parameter = HBufC8::NewLC( inetUri->Uri().UriDes().Length() ); 
+        parameter->Des().Format( _L8( "%S" ), &inetUri->Uri().UriDes() );
+
+        HBufC* parsed = HBufC::NewLC( parameter->Length() );                 
+        parsed->Des().Copy(*parameter);
+                         
+        if ( !iLauncher )
+            {
+            iLauncher = CBrowserLauncher::NewL();
+            } 
+
+        HBufC* urlToLaunch = HBufC::NewLC( 
+            parsed->Length() + KUrlLaunchParameter.iTypeLength );
+        urlToLaunch->Des().Append( KUrlLaunchParameter );
+        urlToLaunch->Des().Append( *parsed );
+        
+#if defined(__WINSCW__)
+        //custom ap overriden settings cannot be used in emulator environment
+        iLauncher->LaunchBrowserEmbeddedL( *urlToLaunch, NULL, this );
+#else
+        iConnUtil = CVcxConnectionUtility::InstanceL();
+        TUint32 iap( 0 );
+        User::LeaveIfError( iConnUtil->GetIap( iap, ETrue ) );
+
+        TBrowserOverriddenSettings overriddenSettings;
+        overriddenSettings.SetBrowserSetting( EBrowserOverSettingsCustomAp, iap );
+                
+        iLauncher->LaunchBrowserEmbeddedL( *urlToLaunch, NULL, this, &overriddenSettings );
+#endif
+
+        CleanupStack::PopAndDestroy( urlToLaunch );
+        CleanupStack::PopAndDestroy( parsed );
+        CleanupStack::PopAndDestroy( parameter );
+        CleanupStack::PopAndDestroy( inetUri );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+void CVcxNsSettingsViewServiceSelection::RemoveCommandsFromCba( CEikButtonGroupContainer& aCba )
+    {
+    TInt nPos1 = aCba.PositionById( EAknSoftkeyOptions );
+    if ( nPos1 != KErrNotFound )
+        {
+        aCba.RemoveCommandObserver( nPos1 ); 
+        aCba.RemoveCommandFromStack( nPos1, EAknSoftkeyOptions );
+        }
+    TInt nPos2 = aCba.PositionById( EVcSettingsViewSoftkeyDone );
+    if ( nPos2 != KErrNotFound )
+        {
+        aCba.RemoveCommandObserver( nPos2 );
+        aCba.RemoveCommandFromStack( nPos2, EVcSettingsViewSoftkeyDone );
+        }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,34 @@
+/*
+* 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 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:  This file provides the information required for building the*
+*/
+
+
+// Version : %version: 10 %
+
+#include <platform_paths.hrh>
+
+#include "../videoplayersettingsengine/group/bld.inf"
+#include "../mediasettingsengine/group/bld.inf"
+#include "../mpsettbase/group/bld.inf"
+#include "../mediasettingsapp/group/bld.inf"
+#include "../gsvideoplugin/group/bld.inf"
+
+PRJ_PLATFORMS
+DEFAULT
+
+
+PRJ_EXPORTS
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/gsvideoplugin/data/10275068.rss	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,46 @@
+/*
+* 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 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:  ECOM plugin resource file for Video plugin.*
+*/
+
+
+// Version : %version: 3 %
+
+
+#include <registryinfo.rh>
+
+RESOURCE REGISTRY_INFO theInfo
+	{
+	dll_uid     = 0x10275068; 
+	interfaces  = 
+		{
+		INTERFACE_INFO
+			{
+			interface_uid   = 0x10207236; // UID for CGSPluginInterface 
+			implementations = 
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid  = 0x10275069; 
+					version_no          = 1;
+					display_name        = "GS Video Plugin"; // Plugin debug name
+					default_data        = "0x10207239"; // Parent UID (VideoPlugin is under "Application setting")
+					opaque_data         = "4"; // Order number
+					}
+				};
+			}
+			
+		};
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/gsvideoplugin/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,36 @@
+/*
+* 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 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:  Build information file for GS Video plugin.*
+*/
+
+
+// Version : %version:  2 %
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+
+PRJ_EXPORTS
+//
+//  Export the loc, stub sis iby files for S60 5.0
+//
+../rom/gsvideoplugin.iby             CORE_APP_LAYER_IBY_EXPORT_PATH(gsvideoplugin.iby)
+../rom/gsvideopluginresources.iby    LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(gsvideopluginresources.iby)
+
+PRJ_MMPFILES
+../group/gsvideoplugin.mmp
+
+PRJ_TESTMMPFILES
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/gsvideoplugin/group/gsvideoplugin.mmp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,147 @@
+/*
+* Copyright (c) 2005 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:   GSVideoPlugin Project specification file.*
+*/
+
+
+// Version : %version: 5 %
+
+
+
+#include <platform_paths.hrh>
+#include <data_caging_paths.hrh>    // For RESOURCE_FILES_DIR
+#include <bldvariant.hrh>
+
+CAPABILITY          CAP_ECOM_PLUGIN
+TARGET              gsvideoplugin.dll
+TARGETTYPE          PLUGIN
+UID                 0x10009D8D 0x10275068
+
+VENDORID            VID_DEFAULT
+//VERSION             11.6
+
+//********* UIDs *************
+//0x10275068     //DLL UID
+//0x10275069     //Impl1. UID
+//****************************
+
+
+SOURCEPATH      ../src
+SOURCE          GSVideoPlugin.cpp
+SOURCE          GSVideoPluginImplementationTable.cpp
+SOURCE          GSMediaPlayerVideoView.cpp
+SOURCE          GSMediaPlayerStreamingView.cpp
+
+SOURCEPATH      ../../mediasettingsapp/src  
+SOURCE          MPSettingsMainContainer.cpp
+SOURCE          MPSettingsMainView.cpp
+SOURCE          MPSettingsVideoSettingItemList.cpp
+SOURCE          MPSettingsVideoContainer.cpp
+SOURCE          MPSettingsStreamingContainer.cpp
+SOURCE          MPSettingsStreamingSettingItemList.cpp
+SOURCE          MPSettingsSliderSettingItem.cpp
+SOURCE          MPSettingsUDPPortSettingItem.cpp
+SOURCE          MPSettingsAdvancedBwContainer.cpp
+SOURCE          MPSettingsAdvancedBwSettingItemList.cpp
+SOURCE          MPSettingsAdvancedBwSettingItem.cpp
+SOURCE          MPSettingsAdvancedBwView.cpp
+
+SOURCEPATH      ../../mediasettingsengine/src  
+SOURCE          MPSettingsModelForROP.cpp
+SOURCE          MPSettingsRopConfigParser.cpp
+
+SOURCEPATH      ../src
+
+//User include paths
+
+USERINCLUDE     .
+USERINCLUDE     ../inc
+USERINCLUDE     ../data
+USERINCLUDE     ../../mpsettbase/inc
+USERINCLUDE     ../../mediasettingsapp/inc
+USERINCLUDE     ../../videoplayersettingsengine/inc
+USERINCLUDE     ../../mediasettingsengine/inc
+USERINCLUDE     ../../mediasettingsengine/data
+
+
+//System include paths
+APP_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   /epoc32/include/ecom
+SYSTEMINCLUDE   /epoc32/include/cshelp
+
+//ECOM resource definition
+//***********ECOM resource definition******************
+//--Ecom resource TARGET name must be same as DLL name,
+//--otherwise Ecom won't recognise it. 
+//*****************************************************
+START RESOURCE  ../data/10275068.rss
+TARGET          gsvideoplugin.rsc
+END
+
+//Gs Video Plugin resources
+START RESOURCE  ../../mediasettingsapp/data/MediaSettings.rss
+TARGETPATH      RESOURCE_FILES_DIR
+HEADER
+LANGUAGE_IDS
+END
+
+LIBRARY   euser.lib
+LIBRARY   ecom.lib
+LIBRARY   efsrv.lib
+LIBRARY   avkon.lib
+LIBRARY   bafl.lib 
+LIBRARY   cone.lib 
+LIBRARY   eikcoctl.lib 
+LIBRARY   eikcore.lib 
+LIBRARY   etelmm.lib            // security, network, call
+LIBRARY   gslistbox.lib         // For CGSListBoxItemTextArray
+LIBRARY   commonengine.lib      // For RConeResourceLoader
+LIBRARY   featmgr.lib           // Feature manager 
+LIBRARY   commsdat.lib          
+LIBRARY   gsframework.lib       // For base classes
+LIBRARY   centralrepository.lib 
+LIBRARY   aknskinsrv.lib        // for enhanced skinning
+LIBRARY   aknskins.lib          // for enhanced skinning
+LIBRARY   egul.lib
+LIBRARY   mmfcontrollerframework.lib //for RMMFController
+LIBRARY   charconv.lib
+LIBRARY   apparc.lib
+LIBRARY   mpsettbase.lib
+LIBRARY   mpsettengine.lib
+LIBRARY   eikctl.lib
+LIBRARY   mediaclientvideo.lib
+LIBRARY   estor.lib //RWriteStream
+LIBRARY   esock.lib
+LIBRARY   gsecomplugin.lib
+LIBRARY   vcxnssettingsengine.lib
+LIBRARY	  commondialogs.lib
+LIBRARY	  cmmanager.lib
+
+#ifndef RD_STARTUP_CHANGE
+LIBRARY   sysutil.lib           // Shutdown::Restart
+#endif //RD_STARTUP_CHANGE
+
+LIBRARY   aknnotify.lib         // for CAknGlobalNote.h
+LIBRARY   hlplch.lib            // for "Help" options menu
+LIBRARY   eikdlg.lib            // eikon dialogs
+
+LIBRARY   flogger.lib // For GSLogger
+
+SOURCEPATH      ../data
+DOCUMENT        10275068.rss
+SOURCEPATH      ../../mediasettingsapp/data
+DOCUMENT        MediaSettings.rss
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/gsvideoplugin/inc/GSMediaPlayerStreamingView.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,166 @@
+/*
+* Copyright (c) 2002 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:   Declares view for GSVideoPlugin application.*
+*/
+
+
+// Version : %version: 4 %
+
+
+
+#ifndef GSMEDIAPLAYERSTREAMINGVIEW_H
+#define GSMEDIAPLAYERSTREAMINGVIEW_H
+
+// INCLUDES
+#include <aknview.h>
+#include <eiklbo.h>
+#include <gstabbedview.h>
+
+// CLASS DECLARATION
+class CMPSettingsModelForROP;
+class CMPSettingsBaseContainer;
+class MGSTabbedView;
+class CGSTabHelper;
+
+/**
+*  CGSMediaPlayerStreamingView class.
+* 
+*  @since 3.1
+*/
+class CGSMediaPlayerStreamingView : public CAknView,
+                                    public MGSTabbedView    
+{
+    public: // Constructors and destructor
+    
+        enum KGSViewPanicCodes
+            {
+            EGSViewPanicNullPtr = 1
+            };
+            
+        /**
+        * Two-phased constructor.
+        */
+        static CGSMediaPlayerStreamingView* NewLC(CMPSettingsModelForROP* aModel, CArrayPtrFlat<MGSTabbedView>* aTabViewArray );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CGSMediaPlayerStreamingView();
+
+        /** 
+        * Handle screen size change.
+        * @since 3.1
+        */
+        void HandleClientRectChange();
+        
+        /**
+        * Creates new icon for tab. Ownership is transferred to client.
+        * @since 3.1
+        */         
+        CGulIcon* CreateTabIconL();
+
+        /**
+        * This function is used to set the current item in the listbox.
+        * @since 2.0
+        * @param aIndex Current item.
+        */
+        void SetCurrentItem(TInt aIndex);
+        
+    private: // Functions from base classes
+        /**
+        * From CAknView returns UID of view
+        * @return TUid uid of the view
+        */
+        TUid Id() const;
+
+        /**
+        * From CAknView Handle commands
+        * @param aCommand command to be handled
+        */
+        void HandleCommandL( TInt aCommand );
+
+        /**
+        * From CAknView Activate this view
+        * @param aPrevViewId 
+        * @param aCustomMessageId 
+        * @param aCustomMessage 
+        */
+        void DoActivateL( const TVwsViewId& aPrevViewId,
+                          TUid aCustomMessageId,
+                          const TDesC8& aCustomMessage );
+
+        /**
+        * From CAknView Deactivate this view
+        */
+        void DoDeactivate();       
+
+        /**
+        * From MEikMenuObserver Dynamically customize menu items
+        * @param aResourceId Menu pane resource ID
+        * @param aMenuPane Menu pane pointer
+        */
+        void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
+        
+        /**
+        * Creates new container.
+        * @since 3.1
+        */
+        void NewContainerL();
+        
+        /**
+        * Get CMPSettingsBaseContainer's container.
+        * @since 3.1
+        */
+        CMPSettingsBaseContainer* Container(); 
+               
+        /**
+        * Creates new container.
+        * @since 3.1
+        */
+        void CreateContainerL();       
+
+    protected:
+
+        /**
+        * Called at the end of DoActivateL.
+        * @since 2.0
+        */
+        void DynInitContainerL();
+        
+    private:
+        /**
+        * C++ default constructor.
+        */
+        CGSMediaPlayerStreamingView( CMPSettingsModelForROP* aModel, 
+		                             CArrayPtrFlat<MGSTabbedView>* aTabViewArray);
+
+        /**
+        * Symbian OS 2nd phase constructor.
+        * @since 2.1
+        */
+        void ConstructL( CArrayPtrFlat<MGSTabbedView>* aTabViewArray );
+        
+    private: // Data
+        
+        CMPSettingsModelForROP* iModel;
+        CMPSettingsBaseContainer* iContainer; // owned
+        CGSTabHelper* iTabHelper; // owned
+
+        TInt iCurrentItem;
+        TInt iTopItemIndex;
+    };
+
+#endif //GSMEDIAPLAYERSTREAMINGVIEW_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/gsvideoplugin/inc/GSMediaPlayerVideoView.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,170 @@
+/*
+* Copyright (c) 2002 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:   Declares view for GSVideoPlugin application.*
+*/
+
+
+// Version : %version: 3 %
+
+
+
+#ifndef GSMEDIAPLAYERSVIDEOVIEW_H
+#define GSMEDIAPLAYERSVIDEOVIEW_H
+
+// INCLUDES
+#include <aknview.h>
+#include <eiklbo.h>
+#include <gstabbedview.h>
+
+// FORWARD DECLARATIONS
+class CMPSettingsModelForROP;
+class CMPSettingsBaseContainer;
+class MGSTabbedView;
+class CGSTabHelper;
+
+// CLASS DECLARATION
+
+/**
+*  CGSMediaPlayerVideoView class.
+* 
+*  @since 3.1
+*/
+class CGSMediaPlayerVideoView : public CAknView,
+                                public MGSTabbedView
+    {
+    public: // Constructors and destructor
+
+        enum KGSViewPanicCodes
+            {
+            EGSViewPanicNullPtr = 1
+            };
+            
+        /**
+        * Two-phased constructor.
+        */
+        static CGSMediaPlayerVideoView* NewLC(CMPSettingsModelForROP* aModel, CArrayPtrFlat<MGSTabbedView>* aTabViewArray );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CGSMediaPlayerVideoView();
+
+        /**
+        * From CEikAppUi
+        * Handle skin change event.
+        * @since 3.1
+        */
+        void HandleClientRectChange();
+        
+        /**
+        * Creates new icon for tab. Ownership is transferred to client.
+        * @since 3.1
+        */       
+        CGulIcon* CreateTabIconL();
+        
+        /**
+        * From CCoeControl
+        * Handle skin change event.
+        */
+        void HandleResourceChange( TInt aType );
+        
+        /**
+        * This function is used to set the current item in the listbox.
+        * @since 2.0
+        * @param aIndex Current item.
+        */
+        void SetCurrentItem(TInt aIndex);
+        
+    private: // Functions from base classes
+        
+        /**
+        * From CAknView
+        */
+        TUid Id() const;
+
+        /**
+        * From MEikMenuObserver
+        */
+        void HandleCommandL(TInt aCommand);
+
+        /**
+        * From CAknView Activate this view
+        * @param aPrevViewId 
+        * @param aCustomMessageId 
+        * @param aCustomMessage 
+        */
+        void DoActivateL( const TVwsViewId& aPrevViewId,
+                          TUid aCustomMessageId,
+                          const TDesC8& aCustomMessage );                          
+
+        /**
+        * From MEikMenuObserver Dynamically customize menu items
+        * @param aResourceId Menu pane resource ID
+        * @param aMenuPane Menu pane pointer
+        */
+        void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
+
+        /**
+        * From CAknView Deactivate this view
+        */
+        void DoDeactivate();       
+        /**
+        * Creates new container.
+        * @since 3.1
+        */
+        void NewContainerL();
+        
+        /**
+        * Get CMPSettingsBaseContainer's container.
+        * @since 3.1
+        */       
+        CMPSettingsBaseContainer* Container();
+                
+        /**
+        * Creates new container.
+        * @since 3.1
+        */   
+        void CreateContainerL();     
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CGSMediaPlayerVideoView(CMPSettingsModelForROP* aModel, CArrayPtrFlat<MGSTabbedView>* aTabViewArray);
+
+        /**
+        * Symbian 2nd phase constructor.
+        */
+        void ConstructL(CArrayPtrFlat<MGSTabbedView>* aTabViewArray);
+
+        /**
+        * Called at the end of DoActivateL.
+        * @since 3.1
+        */
+        void DynInitContainerL();
+                
+    private: //data
+
+        CMPSettingsModelForROP* iModel;
+        CMPSettingsBaseContainer* iContainer;
+        CGSTabHelper* iTabHelper;
+
+        TInt iCurrentItem;
+        TInt iTopItemIndex;
+    };
+
+#endif      // GSMEDIAPLAYERSVIDEOVIEW_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/gsvideoplugin/inc/GSVideoPlugin.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,256 @@
+/*
+* Copyright (c) 2005 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 Plugin sub-menu in General Settings.*
+*/
+
+
+// Version : %version: 7 %
+
+
+
+#ifndef CGSVIDEOPLUGIN_H
+#define CGSVIDEOPLUGIN_H
+
+// INCLUDES
+#include <gsplugininterface.h>
+#include <aknview.h>
+#include <ConeResLoader.h>
+#include <gsfwviewuids.h>
+
+// Move to CPP file
+#include <gsbaseview.h>
+
+// FORWARD DECLARATIONS
+class CAknNavigationDecorator;
+class CMPSettingsMainView;
+class CAknViewAppUi;
+class CMPSettingsBaseContainer;
+class CMPSettingsMainContainer;
+class CAknView;
+class CGulIcon;
+class CGSTabHelper;
+class CMPSettingsModelForROP;
+   
+class MGSTabbedView;
+
+// Constants
+_LIT( KGSVideoPluginResourceFileName, "z:mediasettings.rsc" );
+_LIT( KGSVideoPluginIconFileName, "\\resource\\apps\\mediasettings.mif");
+_LIT( KGSDoActivateError, "DoActivateL" );
+
+enum KGSMediaSettingsListViewIndex
+    {
+    EGSMediaSettingsVideoIndex = 0,
+    EGSMediaSettingsStreamingIndex = 1
+    };
+
+
+// CLASS DECLARATION
+/**
+*  CGSVideoPlugin class 
+*/
+class CGSVideoPlugin : public CGSBaseView
+    {
+    public: // Constructor and destructor
+
+        enum KGSViewPanicCodes
+            {
+            EGSViewPanicNullPtr = 1
+            };
+            
+        /* Symbian OS two-phase Constructor 
+        *
+        * @return pointer to CGSVideoPlugin object
+        */
+        static CGSVideoPlugin* NewL( /* TAny* aInitParams */);
+
+        /**
+        * Destructor.
+        */
+        ~CGSVideoPlugin();
+
+    public: // Functions from base classes
+        
+        /**
+        * From CAknView, returns the views id.
+        *
+        * @return Returns id of the view.
+        */
+        TUid Id() const;
+
+        /**
+        * From MEikCommandObserver, handles the menu based commands.
+        *
+        * @param aCommand identifies the given command.
+        */
+        void HandleCommandL( TInt aCommand );
+       
+        /**
+        * Updates specific value to container 
+        * @param aListItem item index to update
+        * @param aNewValue new value for the setting
+        */
+        void UpdateListBoxL( const TInt& aListItem, TInt aNewValue );
+
+        /**
+        * See base class.
+        */
+        void ResetSelectedItemIndex();
+
+        /**
+        * See base class.
+        */
+        void SetCurrentItem( TInt aIndex );
+
+        /**
+        * Checks if video contrast item should be visible.
+        * 
+        * @return ETrue if video contrast is supported
+        */
+        TBool VideoContrastIsSupportedL();
+        
+    public: // From CGSPluginInterface - See CGSPluginInterface header file.
+    
+        /**
+        * Method for getting caption of this plugin. This should be the
+        * localized name of the settings view to be shown in parent view.
+        * @param aCaption pointer to Caption variable
+        * @since 3.1
+        */
+        void GetCaptionL( TDes& aCaption ) const;
+
+        /**
+        * Creates a new icon of desired type. Override this to provide custom
+        * icons. Othervise default icon is used. Ownership of the created icon
+        * is transferred to the caller.
+        *
+        * Icon type UIDs (use these defined constants):
+        * KGSIconTypeLbxItem  -   ListBox item icon.
+        * KGSIconTypeTab      -   Tab icon.
+        *
+        * @param aIconType UID Icon type UID of the icon to be created.
+        * @return Pointer of the icon. NOTE: Ownership of this icon is
+        *         transferred to the caller.
+        * @since 3.1
+        */
+        CGulIcon* CreateIconL( const TUid aIconType );
+
+         /**
+        * Method for reading the ID of the plugin provider category. See
+        * TGSPluginProviderCategory. PluginProviderCategory can be used for
+        * sorting plugins.
+        *
+        * Default value is EGSPluginProvider3rdParty. Override this function
+        * to change the category.
+        *
+        * @return Plugin provider category ID defined by
+        *         TGSPluginProviderCategory
+        * @since 3.1
+        */        
+        TInt PluginProviderCategory() const;
+
+        /**
+        * From CEikAppUi
+        * Handle skin change event.
+        * @since 3.1
+        */
+        void HandleClientRectChange();      
+        
+        /**
+        * From MGSTabbedView
+        * @return Reference to owned tabbed views which should be included in 
+        *         the sub-view's tab group.
+        * @since 3.1
+        */
+        CArrayPtrFlat<MGSTabbedView>* TabbedViews(); 
+
+        /**
+        * From MEikMenuObserver Dynamically customize menu items
+        * @param aResourceId Menu pane resource ID
+        * @param aMenuPane Menu pane pointer
+        */
+        void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); 
+
+        
+    public:
+    
+        /**
+        * Get CGSVideoPlugin's container.
+        */
+        CMPSettingsMainContainer* Container();       
+
+        void CreateContainerL();
+        
+        /**
+        * Search drives to locate Resource and Bitmap files
+        * @since 3.2
+        */
+        void LocateFilePathL( TFileName& aFileName, TBool aBitmapFile = ETrue );
+      
+     protected: // from CGSBaseView
+
+        void NewContainerL();
+        
+        void HandleListBoxSelectionL();
+     
+    protected: // from CAknView
+    
+        void DoActivateL( const TVwsViewId& aPrevViewId,
+                          TUid /* aCustomMessageId */,
+                          const TDesC8& /* aCustomMessage */);
+
+        void DoDeactivate();
+    
+    protected: //new
+
+        /**
+        * Symbian OS default constructor. 
+        */
+        void ConstructL();
+        
+        /**
+        * C++ Constructor 
+        */
+        CGSVideoPlugin();
+
+    private:
+
+        void CreateLocalViewsL();
+
+               
+    private:
+    
+        // resource loader
+        RConeResourceLoader iResources;
+             
+        CArrayFix<TUid>*             iViewIds;
+        CMPSettingsMainView*      iMainView;                   
+        CMPSettingsModelForROP*         iModel;
+        CMPSettingsBaseContainer* iContainer;
+        RImplInfoPtrArray       iImplInfoArray;
+        TBool   iConstructAsGsPlugin;
+        CArrayPtrFlat<MGSTabbedView>* iViewArray; 
+        TVwsViewId iPrevViewId; // Previous view. 
+        
+        /**
+         * Video view availability status.
+         */
+        TBool iVideoViewAvailable;
+    
+    };
+
+
+#endif //CGSVIDEOPLUGIN_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/gsvideoplugin/rom/gsvideoplugin.iby	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2005 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:   GSRopPlugin ROM resources.*
+*/
+
+
+// Version : %version: 2 %
+
+
+#ifndef GSROPPLUGIN_IBY
+#define GSROPPLUGIN_IBY
+
+ECOM_PLUGIN( gsvideoplugin.dll,10275068.rsc )
+
+#endif // GSROPPLUGIN_IBY
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/gsvideoplugin/rom/gsvideopluginresources.iby	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2005 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:   GSRopPlugin ROM resources.*
+*/
+
+
+// Version : %version: 2 %
+
+
+#ifndef GSROPPLUGINRESOURCES_IBY
+#define GSROPPLUGINRESOURCES_IBY
+
+#include <data_caging_paths_for_iby.hrh>
+
+data=DATAZ_\RESOURCE_FILES_DIR\mediasettings.rsc     RESOURCE_FILES_DIR\mediasettings.rsc
+
+#endif // GSROPPLUGINRESOURCES_IBY
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/gsvideoplugin/src/GSMediaPlayerStreamingView.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,365 @@
+/*
+* Copyright (c) 2002 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:   View class for Streaming list view.*
+*/
+
+
+// Version : %version: 10 %
+
+
+
+// INCLUDE FILES
+#include    <avkon.hrh>
+#include    <aknViewAppUi.h>
+#include    <eikmenup.h>
+#include    <featmgr.h>
+#include    <akntabgrp.h>
+#include    <barsread.h>
+#include    <MediaSettings.rsg>
+#include    <calslbs.h>
+#include    <gstabhelper.h>
+#include    <hlplch.h>             // For HlpLauncher
+#include    "mediasettings.hrh"
+#include    "GSVideoPlugin.h"
+#include    <mediasettings.mbg>
+#include    "GSMediaPlayerStreamingView.h"
+#include    "MPSettingsStreamingContainer.h"
+#include    "MPSettingsConstants.h" 
+#include    "MPSettingsBaseView.h"
+#include	"mpxlog.h"
+
+class CMPSettingsModelForROP;
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CGSMediaPlayerStreamingView::CGSMediaPlayerStreamingView
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CGSMediaPlayerStreamingView::CGSMediaPlayerStreamingView(
+        CMPSettingsModelForROP* aModel, 
+        CArrayPtrFlat<MGSTabbedView>* /* aTabViewArray */ ) 
+	: iModel( aModel)
+    {
+    MPX_FUNC("#MS# CGSMediaPlayerStreamingView::CGSMediaPlayerStreamingView()");
+    }
+
+// ---------------------------------------------------------
+// CGSMediaPlayerStreamingView::ConstructL(const TRect& aRect)
+// Symbian OS two-phased constructor
+// ---------------------------------------------------------
+//
+void CGSMediaPlayerStreamingView::ConstructL(CArrayPtrFlat<MGSTabbedView>* aTabViewArray)
+    {
+    MPX_FUNC("#MS# CGSMediaPlayerStreamingView::ConstructL()");
+    if ( aTabViewArray )
+        {
+        iTabHelper = CGSTabHelper::NewL();
+        aTabViewArray->AppendL(this);
+        }
+    BaseConstructL( R_GS_MPSETT_STREAMING_VIEW );
+    }
+
+// -----------------------------------------------------------------------------
+// CGSMediaPlayerStreamingView::NewLC
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CGSMediaPlayerStreamingView* CGSMediaPlayerStreamingView::NewLC(
+        CMPSettingsModelForROP* aModel, 
+        CArrayPtrFlat<MGSTabbedView>* aTabViewArray )
+    {
+    MPX_FUNC("#MS# CGSMediaPlayerStreamingView::NewLC()");
+    CGSMediaPlayerStreamingView* self = new(ELeave) CGSMediaPlayerStreamingView(aModel,aTabViewArray);
+
+    CleanupStack::PushL(self);
+    self->ConstructL( aTabViewArray );
+
+    return self;
+    }
+
+// ---------------------------------------------------------
+// CGSMediaPlayerStreamingView::~CGSMediaPlayerStreamingView
+// Destructor
+// ---------------------------------------------------------
+//
+CGSMediaPlayerStreamingView::~CGSMediaPlayerStreamingView()
+    {
+    MPX_FUNC("#MS# CGSMediaPlayerStreamingView::~CGSMediaPlayerStreamingView()");
+    if ( iContainer )
+        {
+        AppUi()->RemoveFromStack( iContainer );
+        delete iContainer;
+        }
+    delete iTabHelper;    
+}
+
+// ---------------------------------------------------------
+// TUid CGSMediaPlayerStreamingView::Id
+// ---------------------------------------------------------
+//
+TUid CGSMediaPlayerStreamingView::Id() const
+    {
+    MPX_FUNC("#MS# CGSMediaPlayerStreamingView::Id()");
+    return KMPSettStreamingViewId;
+    }
+
+// ---------------------------------------------------------
+// CGSMediaPlayerStreamingView::HandleCommandL
+// ---------------------------------------------------------
+//
+void CGSMediaPlayerStreamingView::HandleCommandL(TInt aCommand)
+    {   
+    MPX_DEBUG2(_L("#MS# CGSMediaPlayerStreamingView::HandleCommandL(%d)"),aCommand);
+    CGSVideoPlugin* parent =
+        static_cast<CGSVideoPlugin*> (
+            AppUi()->View( KGSVideoPluginUid ) );
+
+    switch (aCommand)
+        {
+        case EMPSettCmdOpen:
+            break;
+        case EAknSoftkeyBack:
+			{
+            if ( iTabHelper )
+                {
+                parent->SetCurrentItem(EGSMediaSettingsStreamingIndex);
+                parent->ResetSelectedItemIndex();
+                AppUi()->ActivateLocalViewL(KGSVideoPluginUid);
+                }
+            else    
+                {
+				// If there's no TabHelper, we have just streaming view and
+				// should exit MediaSettings.
+                AppUi()->ActivateLocalViewL( KGSAppsPluginUid );
+                }
+            }
+			break;
+        case EMPSettCmdAdvancedSett:
+            AppUi()->ActivateLocalViewL( KMPSettAdvancedBwViewId );
+            break;            
+        case EMPSettCmdHelp:
+            if( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+                {
+                HlpLauncher::LaunchHelpApplicationL(iEikonEnv->WsSession(), AppUi()->AppHelpContextL() );
+                }
+            break;
+        default:
+            AppUi()->HandleCommandL(aCommand);
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CGSMediaPlayerStreamingView::DoActivateL
+// Activate this view
+// ---------------------------------------------------------------------------
+//
+void CGSMediaPlayerStreamingView::DoActivateL( 
+        const TVwsViewId& /* aPrevViewId */,
+        TUid /*aCustomMessageId*/,
+        const TDesC8& /*aCustomMessage*/ )
+    { 
+    MPX_FUNC("#MS# CGSMediaPlayerStreamingView::DoActivateL()");
+    if( iContainer )
+        {
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        iContainer = NULL;
+        }
+
+    CreateContainerL();
+    AppUi()->AddToViewStackL( *this, iContainer );
+
+    CGSVideoPlugin* parent = 
+        static_cast<CGSVideoPlugin*> ( 
+            AppUi()->View( KGSVideoPluginUid ) );
+    
+    if( parent && iTabHelper )
+        {
+        iTabHelper->CreateTabGroupL( Id(), 
+                static_cast<CArrayPtrFlat<MGSTabbedView> *> (parent->TabbedViews() ) ); 
+        } 
+    iContainer->SetRect( ClientRect() );   
+    iContainer->ActivateL();   
+
+    DynInitContainerL();
+    }
+
+// ---------------------------------------------------------------------------
+// CGSMediaPlayerStreamingView::DoDeactivate
+// Deactivate this view
+// ---------------------------------------------------------------------------
+//
+void CGSMediaPlayerStreamingView::DoDeactivate()
+    {
+    MPX_FUNC("#MS# CGSMediaPlayerStreamingView::DoDeactivate()");
+    if ( iContainer )
+        {        
+        CEikTextListBox* listbox = iContainer->ListBox();
+        if (listbox)
+            {
+            iCurrentItem = listbox->CurrentItemIndex();
+            iTopItemIndex = listbox->TopItemIndex();
+            } 
+        
+        AppUi()->RemoveFromStack( iContainer );
+        delete iContainer;
+        iContainer = NULL;
+        if ( iTabHelper )
+            {
+            iTabHelper->RemoveTabGroup();
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CGSMediaPlayerStreamingView::Container
+// Returns network container item
+// ---------------------------------------------------------------------------
+//
+CMPSettingsBaseContainer* CGSMediaPlayerStreamingView::Container()
+    {
+    MPX_FUNC("#MS# CGSMediaPlayerStreamingView::Container()");
+    return static_cast <CMPSettingsStreamingContainer*> ( iContainer );
+    }
+
+// ---------------------------------------------------------------------------
+// CGSMediaPlayerStreamingView::DynInitMenuPaneL
+// Before showing a options menu
+// ---------------------------------------------------------------------------
+//
+void CGSMediaPlayerStreamingView::DynInitMenuPaneL( TInt aResourceId, 
+                                                    CEikMenuPane* aMenuPane)
+    {
+    MPX_DEBUG2(_L("#MS# CGSMediaPlayerStreamingView::DynInitMenuPaneL(0x%X)"),aResourceId);
+    if ( aResourceId == R_MPSETT_APP_MENU )
+        {
+        // Help should be displayed only if the feature is supported according
+        // to Feature Manager
+        if (!FeatureManager::FeatureSupported(KFeatureIdHelp))
+            {
+            aMenuPane->SetItemDimmed(EMPSettCmdHelp, ETrue);
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CGSMediaPlayerStreamingView::NewContainerL()
+// Creates new iContainer.
+// ---------------------------------------------------------------------------
+void CGSMediaPlayerStreamingView::NewContainerL()
+    {
+    MPX_FUNC("#MS# CGSMediaPlayerStreamingView::NewContainerL()");
+    iContainer = new (ELeave) CMPSettingsStreamingContainer(iModel);
+    }
+
+// -----------------------------------------------------------------------------
+// CGSMediaPlayerStreamingView::HandleClientRectChange
+// Handle screen size change.
+// -----------------------------------------------------------------------------
+//
+void CGSMediaPlayerStreamingView::HandleClientRectChange()
+    {
+    MPX_FUNC("#MS# CGSMediaPlayerStreamingView::HandleClientRectChange()");
+    if ( iContainer )
+        {
+        iContainer->SetRect( ClientRect() );
+        } 
+    }
+
+// ---------------------------------------------------------------------------
+// CGSMediaPlayerStreamingView::DynInitContainerL
+// ---------------------------------------------------------------------------
+//
+void CGSMediaPlayerStreamingView::DynInitContainerL()
+    {
+    MPX_FUNC("#MS# CGSMediaPlayerStreamingView::DynInitContainerL()");
+    CEikTextListBox* listbox = iContainer->ListBox();
+
+    listbox->SetTopItemIndex(iTopItemIndex);
+
+    if (iCurrentItem >= 0 && iCurrentItem < listbox->Model()->NumberOfItems()) // magic
+        {
+        listbox->SetCurrentItemIndexAndDraw(iCurrentItem);
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// CGSMediaPlayerStreamingView::CreateContainerL()
+// Creates new iContainer.
+// ---------------------------------------------------------------------------
+//
+void CGSMediaPlayerStreamingView::CreateContainerL()
+    {
+    MPX_FUNC("#MS# CGSMediaPlayerStreamingView::CreateContainerL()");
+    NewContainerL();
+    __ASSERT_DEBUG( 
+        iContainer, User::Panic( KGSDoActivateError, EGSViewPanicNullPtr ) );
+    iContainer->SetMopParent( this );
+
+    //TRAPD( error, iContainer->ConstructL() );
+    TRAPD( error, iContainer->ConstructL( ClientRect() ) );
+
+    if ( error )
+        {
+        delete iContainer;
+        iContainer = NULL;
+        User::Leave( error );
+        }
+    }
+        
+// ---------------------------------------------------------------------------
+// CGSMediaPlayerStreamingView::CreateTabIconL()
+// Creates tab icon for this view.
+// ---------------------------------------------------------------------------
+//    
+CGulIcon* CGSMediaPlayerStreamingView::CreateTabIconL()
+    {
+    MPX_FUNC("#MS# CGSMediaPlayerStreamingView::CreateTabIconL()");
+    CGulIcon* icon;
+    TFileName fileName;
+
+    CGSVideoPlugin* parent = 
+        static_cast<CGSVideoPlugin*> ( 
+            AppUi()->View( KGSVideoPluginUid ) );
+    
+    if( parent )
+        {
+        parent->LocateFilePathL( fileName );    
+        }
+    
+    icon = AknsUtils::CreateGulIconL(
+        AknsUtils::SkinInstance(), 
+        KAknsIIDDefault, 
+        fileName,
+        EMbmMediasettingsQgn_prop_set_mp_stream_tab2,
+        EMbmMediasettingsQgn_prop_set_mp_stream_tab2_mask );
+
+    return icon;
+    } 
+    
+// ---------------------------------------------------------------------------
+// CGSMediaPlayerStreamingView::HandleClientRectChange
+// ---------------------------------------------------------------------------
+//
+void CGSMediaPlayerStreamingView::SetCurrentItem(TInt aIndex)
+    {
+    MPX_DEBUG2(_L("#MS# CGSMediaPlayerStreamingView::SetCurrentItem(%d)"),aIndex);
+    iCurrentItem = aIndex;
+    }      
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/gsvideoplugin/src/GSMediaPlayerVideoView.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,363 @@
+/*
+* Copyright (c) 2002 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:   View class for Video settings list view.*
+*/
+
+
+// Version : %version: 9 %
+
+
+
+// INCLUDE FILES
+#include    <avkon.hrh>
+#include    <aknViewAppUi.h>
+#include    <akntabgrp.h>
+#include    <akntitle.h>  // CAknTitlePane
+#include    <featmgr.h>
+#include    <eikmenup.h>
+#include    <barsread.h>
+#include    <eiktxlbm.h>
+#include    <MediaSettings.rsg>
+#include    <gstabhelper.h>
+#include    <hlplch.h>             // For HlpLauncher
+
+#include    "GSVideoPlugin.h"
+#include    "mediasettings.hrh"
+#include    <mediasettings.mbg>
+#include    "GSMediaPlayerVideoView.h"
+#include    "MPSettingsVideoContainer.h"
+#include    "MPSettingsConstants.h" 
+#include    "MPSettingsModelForROP.h"
+#include    "mpxlog.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CGSMediaPlayerVideoView::CGSMediaPlayerVideoView
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CGSMediaPlayerVideoView::CGSMediaPlayerVideoView( 
+        CMPSettingsModelForROP* aModel, 
+        CArrayPtrFlat<MGSTabbedView>* /* aTabViewArray */ ) 
+    : iModel( aModel)
+    {
+    MPX_FUNC("#MS# CGSMediaPlayerVideoView::CGSMediaPlayerVideoView()");
+    }
+
+// ---------------------------------------------------------
+// CGSMediaPlayerVideoView::ConstructL(const TRect& aRect)
+// Symbian OS two-phased constructor
+// ---------------------------------------------------------
+//
+void CGSMediaPlayerVideoView::ConstructL(CArrayPtrFlat<MGSTabbedView>* aTabViewArray)
+    {
+    MPX_FUNC("#MS# CGSMediaPlayerVideoView::ConstructL()");
+    iTabHelper = CGSTabHelper::NewL();
+    aTabViewArray->AppendL(this);
+    BaseConstructL(R_GS_MPSETT_VIDEO_VIEW);
+    }
+
+// -----------------------------------------------------------------------------
+// CGSMediaPlayerVideoView::NewLC
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CGSMediaPlayerVideoView* CGSMediaPlayerVideoView::NewLC( 
+        CMPSettingsModelForROP* aModel, 
+        CArrayPtrFlat<MGSTabbedView>* aTabViewArray )
+    {
+    MPX_FUNC("#MS# CGSMediaPlayerVideoView::NewLC()");
+    CGSMediaPlayerVideoView* self = 
+        new(ELeave) CGSMediaPlayerVideoView( aModel, aTabViewArray );
+    
+    CleanupStack::PushL(self);
+    self->ConstructL( aTabViewArray );    
+
+    return self;
+    }
+
+// ---------------------------------------------------------
+// CGSMediaPlayerVideoView::~CGSMediaPlayerVideoView()
+// Destructor
+// ---------------------------------------------------------
+//
+CGSMediaPlayerVideoView::~CGSMediaPlayerVideoView()
+    {
+    MPX_FUNC("#MS# CGSMediaPlayerVideoView::~CGSMediaPlayerVideoView()");
+    if ( iContainer )
+        {
+        AppUi()->RemoveFromStack( iContainer );
+        delete iContainer;
+        }
+    delete iTabHelper;
+    }
+
+// ---------------------------------------------------------
+// TUid CGSMediaPlayerVideoView::Id
+// ---------------------------------------------------------
+//
+TUid CGSMediaPlayerVideoView::Id() const
+    {
+    MPX_FUNC("#MS# CGSMediaPlayerVideoView::Id()");
+    return KMPSettVideoViewId;
+    }
+
+// ---------------------------------------------------------
+// CGSMediaPlayerVideoView::HandleCommandL
+// ---------------------------------------------------------
+//
+void CGSMediaPlayerVideoView::HandleCommandL( TInt aCommand )
+    {   
+    MPX_DEBUG2(_L("#MS# CGSMediaPlayerVideoView::HandleCommandL(%d)"),aCommand);
+    CGSVideoPlugin* parent =
+        static_cast<CGSVideoPlugin*> (
+            AppUi()->View( KGSVideoPluginUid ) );
+    switch ( aCommand )
+        {
+        case EMPSettCmdChange:
+            {
+            static_cast<CMPSettingsVideoContainer*>(iContainer)->EditCurrentItemFromMenuL(ETrue);
+            break;
+            }
+            
+        case EMPMiddleSoftKeyChange:
+            {
+            static_cast<CMPSettingsVideoContainer*>(iContainer)->EditCurrentItemFromMenuL(EFalse);
+            break;
+            }
+            
+        case EAknSoftkeyBack:
+            {
+            parent->SetCurrentItem(EGSMediaSettingsVideoIndex);
+            parent->ResetSelectedItemIndex();
+            AppUi()->ActivateLocalViewL(KGSVideoPluginUid);
+            break;
+            }
+            
+        case EMPSettCmdHelp:
+            {
+            if( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+                {
+                HlpLauncher::LaunchHelpApplicationL( iEikonEnv->WsSession(), 
+                                                     AppUi()->AppHelpContextL() );
+                }
+            break;
+            }
+            
+        default:
+            {
+            AppUi()->HandleCommandL(aCommand);
+            break;
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CGSMediaPlayerVideoView::DoActivateL
+// Activate this view
+// ---------------------------------------------------------------------------
+//
+void CGSMediaPlayerVideoView::DoActivateL( const TVwsViewId& /* aPrevViewId */,
+                                          TUid /*aCustomMessageId*/,
+                                          const TDesC8& /*aCustomMessage*/ )
+    { 
+    MPX_FUNC("#MS# CGSMediaPlayerVideoView::DoActivateL()");
+    if( iContainer )
+        {
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        iContainer = NULL;
+        }
+
+    CreateContainerL();
+    AppUi()->AddToViewStackL( *this, iContainer );
+   
+    CGSVideoPlugin* parent = 
+        static_cast<CGSVideoPlugin*> ( 
+            AppUi()->View( KGSVideoPluginUid ) );
+        
+    if( parent )
+        {
+        iTabHelper->CreateTabGroupL( Id(), 
+            static_cast<CArrayPtrFlat<MGSTabbedView> *> (parent->TabbedViews() ) ); 
+        } 
+    iContainer->SetRect( ClientRect() );   
+    iContainer->ActivateL();   
+    
+    DynInitContainerL();
+    }
+
+// ---------------------------------------------------------------------------
+// CGSMediaPlayerVideoView::DoDeactivate
+// Deactivate this view
+// ---------------------------------------------------------------------------
+//
+void CGSMediaPlayerVideoView::DoDeactivate()
+    {
+    MPX_FUNC("#MS# CGSMediaPlayerVideoView::DoDeactivate()");
+    if ( iContainer )
+        {        
+        CEikTextListBox* listbox = iContainer->ListBox();
+        if (listbox)
+            {
+            iCurrentItem = listbox->CurrentItemIndex();
+            iTopItemIndex = listbox->TopItemIndex();
+            } 
+            
+        AppUi()->RemoveFromStack( iContainer );
+        delete iContainer;
+        iContainer = NULL;
+        iTabHelper->RemoveTabGroup();
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// CGSMediaPlayerVideoView::Container
+// Returns network container item
+// ---------------------------------------------------------------------------
+//
+CMPSettingsBaseContainer* CGSMediaPlayerVideoView::Container()
+    {
+    MPX_FUNC("#MS# CGSMediaPlayerVideoView::Container()");
+    return static_cast <CMPSettingsVideoContainer*> ( iContainer );
+    }
+
+// ---------------------------------------------------------------------------
+// CGSMediaPlayerVideoView::DynInitMenuPaneL
+// Before showing a options menu
+// ---------------------------------------------------------------------------
+//
+void CGSMediaPlayerVideoView::DynInitMenuPaneL( TInt aResourceId, 
+                                                CEikMenuPane* aMenuPane)
+    {
+    MPX_DEBUG2(_L("#MS# CGSMediaPlayerVideoView::DynInitMenuPaneL(0x%X)"),aResourceId);
+    if ( aResourceId == R_MPSETT_APP_MENU )
+        {
+        // Help should be displayed only if the feature is supported according
+        // to Feature Manager
+        if ( !FeatureManager::FeatureSupported(KFeatureIdHelp) )
+            {
+            aMenuPane->SetItemDimmed(EMPSettCmdHelp, ETrue);
+            }
+        
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CGSMediaPlayerVideoView::NewContainerL()
+// Creates new iContainer.
+// ---------------------------------------------------------------------------
+void CGSMediaPlayerVideoView::NewContainerL()
+    {
+    MPX_FUNC("#MS# CGSMediaPlayerVideoView::NewContainerL()");
+    iContainer = new (ELeave) CMPSettingsVideoContainer(iModel);
+    }
+
+// -----------------------------------------------------------------------------
+// CGSMediaPlayerVideoView::HandleClientRectChange
+// Handle screen size change.
+// -----------------------------------------------------------------------------
+//
+void CGSMediaPlayerVideoView::HandleClientRectChange()
+    {
+    MPX_FUNC("#MS# CGSMediaPlayerVideoView::HandleClientRectChange()");
+    if ( iContainer )
+        {
+        iContainer->SetRect( ClientRect() );
+        } 
+    }
+
+// ---------------------------------------------------------------------------
+// CGSMediaPlayerVideoView::CreateContainerL()
+// Creates new iContainer.
+// ---------------------------------------------------------------------------
+//
+void CGSMediaPlayerVideoView::CreateContainerL()
+    {        
+    MPX_FUNC("#MS# CGSMediaPlayerVideoView::CreateContainerL()");
+    NewContainerL();
+    __ASSERT_DEBUG( 
+        iContainer, User::Panic( KGSDoActivateError, EGSViewPanicNullPtr ) );
+    iContainer->SetMopParent( this );
+
+    TRAPD( error, iContainer->ConstructL( ClientRect() ) );
+    if ( error )
+        {
+        delete iContainer;
+        iContainer = NULL;
+        User::Leave( error );
+        }
+    }  
+    
+// ---------------------------------------------------------------------------
+// CGSMediaPlayerVideoView::CreateTabIconL()
+// Creates icon for tab.
+// ---------------------------------------------------------------------------
+//    
+CGulIcon* CGSMediaPlayerVideoView::CreateTabIconL()
+    {
+    MPX_FUNC("#MS# CGSMediaPlayerVideoView::CreateTabIconL()");
+    CGulIcon* icon;
+    TFileName fileName;
+
+    CGSVideoPlugin* parent = 
+        static_cast<CGSVideoPlugin*> ( 
+            AppUi()->View( KGSVideoPluginUid ) );
+    
+    if( parent )
+        {
+        parent->LocateFilePathL( fileName );    
+        } 
+    
+    icon = AknsUtils::CreateGulIconL(
+        AknsUtils::SkinInstance(), 
+        KAknsIIDDefault, 
+        fileName,
+        EMbmMediasettingsQgn_prop_set_mp_video_tab2,
+        EMbmMediasettingsQgn_prop_set_mp_video_tab2_mask );
+
+    return icon;
+    }       
+        
+// ---------------------------------------------------------------------------
+// CGSMediaPlayerVideoView::DynInitContainerL
+// ---------------------------------------------------------------------------
+//
+void CGSMediaPlayerVideoView::DynInitContainerL()
+    {
+    MPX_FUNC("#MS# CGSMediaPlayerVideoView::DynInitContainerL()");
+    CEikTextListBox* listbox = iContainer->ListBox();
+
+    listbox->SetTopItemIndex(iTopItemIndex);
+
+    if ( iCurrentItem >= 0 && 
+         iCurrentItem < listbox->Model()->NumberOfItems()) // magic
+        {
+        listbox->SetCurrentItemIndexAndDraw(iCurrentItem);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CGSMediaPlayerVideoView::HandleClientRectChange
+// ---------------------------------------------------------------------------
+//
+void CGSMediaPlayerVideoView::SetCurrentItem(TInt aIndex)
+    {
+    MPX_DEBUG2(_L("#MS# CGSMediaPlayerVideoView::SetCurrentItem(%d)"),aIndex);
+    iCurrentItem = aIndex;
+    }   
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/gsvideoplugin/src/GSVideoPlugin.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,613 @@
+/*
+* Copyright (c) 2005 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:   GSVideoPlugin.cpp*
+*/
+
+
+// Version : %version: 10 %
+
+
+
+// INCLUDES
+#include "MPSettingsModelForROP.h"
+#include "GSVideoPlugin.h"
+#include "MPSettingsConstants.h"
+#include "MPSettingsMainView.h"
+#include "MPSettingsPluginView.h"
+#include "MPSettingsAdvancedBwView.h"
+#include "MPSettingsMainContainer.h" 
+#include "MPSettingsStreamingContainer.h" 
+#include "mediasettings.hrh"
+#include "gstabhelper.h"
+#include "GSMediaPlayerVideoView.h"
+#include "GSMediaPlayerStreamingView.h"
+#include "mpxlog.h"
+
+#include <coeaui.h>
+#include <hlplch.h>             // For HlpLauncher
+#include <aknview.h>
+#include <aknViewAppUi.h>
+#include <featmgr.h>
+#include <StringLoader.h>     //for StringLoader
+#include <gsprivatepluginproviderids.h>
+#include <gsmainview.h>
+#include <mediasettings.mbg>
+#include <MediaSettings.rsg>
+#include <eiktxlbm.h>
+#include <eikmenup.h> 
+
+#include <centralrepository.h>
+#include "MediaPlayerPrivateCRKeys.h"
+#include "MediaPlayerVariant.hrh" 
+
+// CONSTANTS
+const TInt KGSRopSettViewIdArrayGranularity = 2;
+const TInt KGSRopSettTopItemIndex = 0;
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ---------------------------------------------------------------------------
+// CGSVideoPlugin::CGSVideoPlugin()
+// Constructor
+//
+// ---------------------------------------------------------------------------
+//
+CGSVideoPlugin::CGSVideoPlugin() 
+    : iResources( *iCoeEnv ), iConstructAsGsPlugin(ETrue)
+    {
+    MPX_FUNC("#MS# CGSVideoPlugin::CGSVideoPlugin()");
+    }
+
+// ---------------------------------------------------------------------------
+// CGSVideoPlugin::~CGSVideoPlugin()
+//  
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CGSVideoPlugin::~CGSVideoPlugin()
+    {
+    MPX_FUNC("#MS# CGSVideoPlugin::~CGSVideoPlugin()");
+    FeatureManager::UnInitializeLib();
+    iImplInfoArray.ResetAndDestroy();   
+    
+    iResources.Close();
+    
+    if ( iViewIds )
+        {
+        delete iViewIds;
+        }
+    
+    if ( iModel )
+        {
+        delete iModel;
+        iModel = NULL;
+        }
+
+    if ( iViewArray ) 
+        {
+        iViewArray->Reset();
+        delete iViewArray;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CGSVideoPlugin::ConstructL(const TRect& aRect)
+// Symbian OS two-phased constructor
+//
+// ---------------------------------------------------------------------------
+//
+void CGSVideoPlugin::ConstructL()
+    {
+    MPX_FUNC("#MS# CGSVideoPlugin::ConstructL()");
+    FeatureManager::InitializeLibL();
+
+    iVideoViewAvailable = VideoContrastIsSupportedL();
+    if ( iVideoViewAvailable )
+        {
+        iViewArray = new (ELeave) CArrayPtrFlat<MGSTabbedView>( KGSRopSettViewIdArrayGranularity ); 
+        }
+    TFileName fileName;
+    LocateFilePathL( fileName, EFalse );    
+    OpenLocalizedResourceFileL( fileName, iResources );
+    
+    TInt ctorResource = ( iVideoViewAvailable ? R_GS_MEDIASETTING_VIEW :
+                                                R_GS_MPSETT_STREAMING_VIEW );
+    
+    BaseConstructL( ctorResource );
+    }
+   
+// ---------------------------------------------------------------------------
+// CGSVideoPlugin::NewL()
+// Static constructor
+//  
+// ---------------------------------------------------------------------------
+//
+CGSVideoPlugin* CGSVideoPlugin::NewL( /* TAny* aInitParams */)
+    {
+    MPX_FUNC("#MS# CGSVideoPlugin::NewL()");
+    CGSVideoPlugin* self = new( ELeave ) CGSVideoPlugin();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self; 
+    }
+
+// ---------------------------------------------------------------------------
+// CGSVideoPlugin::Id
+// 
+// Returns own view ID.
+// ---------------------------------------------------------------------------
+//
+TUid CGSVideoPlugin::Id() const
+    {
+    MPX_FUNC("#MS# CGSVideoPlugin::Id()");
+    return KGSVideoPluginUid;
+    }
+
+// ---------------------------------------------------------------------------
+// CGSVideoPlugin::HandleClientRectChange
+// 
+// Handle changes to rect().
+// ---------------------------------------------------------------------------
+//
+void CGSVideoPlugin::HandleClientRectChange()
+    {
+    MPX_FUNC("#MS# CGSVideoPlugin::HandleClientRectChange()");
+    if ( iContainer )
+        {
+        iContainer->SetRect( ClientRect() );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CGSVideoPlugin::DoActivateL
+// 
+// First method called by the Avkon framwork to invoke a view.
+// ---------------------------------------------------------------------------
+//
+void CGSVideoPlugin::DoActivateL( const TVwsViewId& aPrevViewId,
+                                TUid /* aCustomMessageId */,
+                                const TDesC8& /* aCustomMessage */)
+    {
+    MPX_FUNC("#MS# CGSVideoPlugin::DoActivateL()");
+    iPrevViewId = aPrevViewId;
+    if( iContainer )
+        {
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+
+        delete iContainer;
+        iContainer = NULL;
+        }
+
+    if (!iViewIds)
+        {
+        CreateLocalViewsL();        
+        }
+    CreateContainerL();
+    AppUi()->AddToViewStackL( *this, iContainer );
+    if ( iVideoViewAvailable )
+        {
+        iContainer->ListBox()->SetListBoxObserver( this ) ;
+        }
+    ResetSelectedItemIndex();
+    }
+
+// ---------------------------------------------------------------------------
+// CGSVideoPlugin::DoDeactivate
+// 
+// Called by the Avkon view framework when closing.
+// ---------------------------------------------------------------------------
+//
+void CGSVideoPlugin::DoDeactivate()
+    {
+    MPX_FUNC("#MS# CGSVideoPlugin::DoDeactivate()");
+    if ( iContainer )
+        {
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        iContainer = NULL;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CGSVideoPlugin::HandleCommandL
+// 
+// Handle user menu actions in this view.
+// ---------------------------------------------------------------------------
+//
+void CGSVideoPlugin::HandleCommandL( TInt aCommand )
+    {
+    MPX_FUNC("#MS# CGSVideoPlugin::HandleCommandL()");
+    switch ( aCommand )
+        {
+        case EMPSettCmdOpen:
+            break;          
+        case EAknSoftkeyBack:
+            SetCurrentItem(EGSMediaSettingsVideoIndex);
+            AppUi()->ActivateLocalViewL( KGSAppsPluginUid );
+            break;
+        case EMPSettCmdAdvancedSett:
+            AppUi()->ActivateLocalViewL( KMPSettAdvancedBwViewId );
+            break;                    
+        case EMPSettCmdHelp:
+            {
+            if( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+                {
+                HlpLauncher::LaunchHelpApplicationL(
+                    iEikonEnv->WsSession(), AppUi()->AppHelpContextL() );
+                }
+            break;
+            }
+        default:
+            AppUi()->HandleCommandL( aCommand );
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CGSVideoPlugin::GetCaption
+// 
+// Return application/view caption.
+// ---------------------------------------------------------------------------
+//
+void CGSVideoPlugin::GetCaptionL( TDes& aCaption ) const
+    {
+    MPX_FUNC("#MS# CGSVideoPlugin::GetCaptionL()");
+    // the resource file is already opened.
+    HBufC* result = StringLoader::LoadL( R_GS_MEDIASETTING_VIEW_CAPTION );
+    
+    aCaption.Copy( *result );
+    delete result;
+    }
+  
+// ---------------------------------------------------------------------------
+// CGSVideoPlugin::PluginProviderCategory
+// 
+// A means to identify the location of this plug-in in the framework.
+// ---------------------------------------------------------------------------
+//
+TInt CGSVideoPlugin::PluginProviderCategory() const
+    {
+    MPX_FUNC("#MS# CGSVideoPlugin::PluginProviderCategory()");
+    //To identify internal plug-ins.
+    return KGSPluginProviderInternal;
+    }
+  
+// ========================= From CGSBaseView ==================
+
+
+// ---------------------------------------------------------------------------
+// CGSVideoPlugin::NewContainerL
+// 
+// Creates new iContainer.
+// ---------------------------------------------------------------------------
+//
+void CGSVideoPlugin::NewContainerL()
+    {
+    MPX_FUNC("#MS# CGSVideoPlugin::NewContainerL()");
+    if ( iVideoViewAvailable )
+        {
+        iContainer = new( ELeave ) CMPSettingsMainContainer;
+        }
+    else    
+        {
+        iContainer = new( ELeave ) CMPSettingsStreamingContainer( iModel );
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// CGSVideoPlugin::HandleListBoxSelectionL
+// 
+// Handle any user actions while in the list view.
+// ---------------------------------------------------------------------------
+void CGSVideoPlugin::HandleListBoxSelectionL() 
+    {
+    MPX_FUNC("#MS# CGSVideoPlugin::HandleListBoxSelectionL()");
+    iCurrentItem = iContainer->ListBox()->CurrentItemIndex();
+    iTopItemIndex = iContainer->ListBox()->TopItemIndex();
+    
+    CGSMediaPlayerVideoView* videoView = NULL;
+    CGSMediaPlayerStreamingView* streamingView = NULL;
+
+    TInt count = iViewIds->Count();
+
+    for (TInt i = 0; i < count; i++)
+        {
+        if (i == 0) //first item of the list is Video view
+            {
+            videoView = static_cast<CGSMediaPlayerVideoView*>(AppUi()->View(iViewIds->At(i)));
+            videoView->SetCurrentItem(KGSRopSettTopItemIndex);        
+            }
+        else if (i == 1) //second item of the list is Streaming view
+            {
+            streamingView = static_cast<CGSMediaPlayerStreamingView*>(AppUi()->View(iViewIds->At(i)));
+            streamingView->SetCurrentItem(KGSRopSettTopItemIndex);        
+            }
+        }
+         
+    AppUi()->ActivateLocalViewL(iViewIds->At(iCurrentItem));
+    }
+
+// ---------------------------------------------------------------------------
+// CGSVideoPlugin::Container
+// 
+// Return handle to container class.
+// ---------------------------------------------------------------------------
+//
+CMPSettingsMainContainer* CGSVideoPlugin::Container()
+    {
+    MPX_FUNC("#MS# CGSVideoPlugin::Container()");
+    return static_cast<CMPSettingsMainContainer*>( iContainer );
+    }
+
+// ---------------------------------------------------------------------------
+// CGSVideoPlugin::CreateContainerL()
+// 
+// 
+// ---------------------------------------------------------------------------
+//
+void CGSVideoPlugin::CreateContainerL()
+    {
+    MPX_FUNC("#MS# CGSVideoPlugin::CreateContainerL()");
+    NewContainerL();
+    __ASSERT_DEBUG( 
+        iContainer, User::Panic( KGSDoActivateError, EGSViewPanicNullPtr ) );
+    iContainer->SetMopParent( this );
+
+    TRAPD( error, iContainer->ConstructL( ClientRect() ) );
+
+    if ( error )
+        {
+        delete iContainer;
+        iContainer = NULL;
+        User::Leave( error );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CGSVideoPlugin::CreateLocalViews()
+// 
+// 
+// ---------------------------------------------------------------------------
+//
+void CGSVideoPlugin::CreateLocalViewsL()
+    {
+    MPX_FUNC("#MS# CGSVideoPlugin::CreateLocalViewsL()");
+    // model creation
+    iModel = CMPSettingsModelForROP::NewL();
+
+    // Create vector which contains view id's for all setting folders. 
+    iViewIds = new(ELeave) CArrayFixFlat<TUid>( KGSRopSettViewIdArrayGranularity );
+    if ( iVideoViewAvailable )
+        {
+        iViewIds->AppendL( KMPSettVideoViewId );
+        }
+    iViewIds->AppendL( KMPSettStreamingViewId );
+  
+    CAknView* view;  
+
+    if ( iVideoViewAvailable )
+        {
+        view = CMPSettingsMainView::NewLC(iViewIds,iModel,iConstructAsGsPlugin); 
+        AppUi()->AddViewL(view);      // transfer ownership to CAknViewAppUi
+        CleanupStack::Pop();    // view
+
+        // iMainView is not owned, i.e. it is not deleted in the destructor ->
+        // main view cannot be directly creted to iMainView, as it's against the coding
+        // conventions to place class' pointers to cleanup stack => static_cast.
+        iMainView = static_cast<CMPSettingsMainView*>(view);
+        
+        view = CGSMediaPlayerVideoView::NewLC(iModel,iViewArray);
+        AppUi()->AddViewL(view);      // transfer ownership to CAknViewAppUi
+        CleanupStack::Pop();    // view
+        }
+        
+    view = CGSMediaPlayerStreamingView::NewLC(iModel,iViewArray);
+    AppUi()->AddViewL(view);      // transfer ownership to CAknViewAppUi
+    CleanupStack::Pop();    // view 
+
+    view = CMPSettingsAdvancedBwView::NewLC(iModel,iConstructAsGsPlugin);
+    AppUi()->AddViewL(view);      // transfer ownership to CAknViewAppUi
+    CleanupStack::Pop();    // view 
+    
+    // Construct plug-in views (if any exists)
+    CMPSettingsPluginView::ListImplementationsL(iImplInfoArray);
+    TInt count = iImplInfoArray.Count();
+
+    if (count > 0)
+        {
+        CMPSettingsPluginView* pluginView = NULL;
+
+        for (TInt ii(0); ii < count; ++ii)
+            {
+            TUid uid = iImplInfoArray[ii]->ImplementationUid();
+            pluginView = CMPSettingsPluginView::NewL(uid);
+            CleanupStack::PushL(pluginView);
+            AppUi()->AddViewL(pluginView);
+            CleanupStack::Pop();    // pluginView
+
+            if (pluginView->OpenedFromMainView())
+                {
+                iViewIds->AppendL(pluginView->Id());
+                }
+            }
+        // Sort UID array to rising order
+        TKeyArrayFix sortKey(0, ECmpTUint);
+        User::LeaveIfError(iViewIds->Sort(sortKey));
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CGSVideoPlugin::CreateIconL
+// 
+// Return the icon, if has one.
+// ---------------------------------------------------------------------------
+//
+CGulIcon* CGSVideoPlugin::CreateIconL( const TUid aIconType )
+    {
+    MPX_FUNC("#MS# CGSVideoPlugin::CreateIconL()");
+    //EMbm<Mbm_file_name><Bitmap_name>
+    CGulIcon* icon;
+    
+    TFileName fileName;
+    LocateFilePathL( fileName );    
+    
+    if( aIconType == KGSIconTypeLbxItem )
+        {
+        icon = AknsUtils::CreateGulIconL(
+        AknsUtils::SkinInstance(), 
+        KAknsIIDDefault, 
+        fileName,
+        EMbmMediasettingsQgn_menu_video,
+        EMbmMediasettingsQgn_menu_video_mask );
+        }
+    else
+        {
+        icon = CGSPluginInterface::CreateIconL( aIconType );
+        }
+
+    return icon;
+    }
+  
+// ---------------------------------------------------------------------------
+// CGSVideoPlugin::TabbedViews()
+// Returns pointer to tabbed views of application.
+// ---------------------------------------------------------------------------
+//
+CArrayPtrFlat<MGSTabbedView>* CGSVideoPlugin::TabbedViews()
+    {
+    MPX_FUNC("#MS# CGSVideoPlugin::TabbedViews()");
+    return iViewArray;
+    }
+    
+// -----------------------------------------------------------------------------
+// CGSVideoPlugin::ResetSelectedItemIndex()
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSVideoPlugin::ResetSelectedItemIndex()
+    {
+    MPX_FUNC("#MS# CGSVideoPlugin::ResetSelectedItemIndex()");
+    if( iContainer )
+        {
+        iContainer->SetSelectedItem( iCurrentItem );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CGSVideoPlugin::SetCurrentItem
+//
+//
+// ---------------------------------------------------------------------------
+void CGSVideoPlugin::SetCurrentItem( TInt aIndex )
+    {
+    MPX_FUNC("#MS# CGSVideoPlugin::SetCurrentItem()");
+    iCurrentItem = aIndex;
+    }
+
+// ---------------------------------------------------------------------------
+// CGSVideoPlugin::DynInitMenuPaneL
+// Before showing a options menu
+// ---------------------------------------------------------------------------
+void CGSVideoPlugin::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
+    {
+    MPX_FUNC("#MS# CGSVideoPlugin::DynInitMenuPaneL()");
+    if ( aResourceId == R_MPSETT_APP_MENU )
+        {
+        // Help should be displayed only if the feature is supported according
+        // to Feature Manager
+        if (!FeatureManager::FeatureSupported(KFeatureIdHelp))
+            {
+            aMenuPane->SetItemDimmed(EMPSettCmdHelp, ETrue);
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CGSVideoPlugin::LocateFilePathL
+// -----------------------------------------------------------------------------
+//
+void CGSVideoPlugin::LocateFilePathL( TFileName& aFileName, TBool aBitmapFile )
+    {
+    _LIT( KGSResourceFileName, "mediasettings.rsc" );
+    _LIT( KGSIconFileName, "mediasettings.mif");
+    
+    TParse parse;
+    TFileName temp;
+                
+    if ( aBitmapFile )  // Mbm file
+        {
+        temp.Append(KGSIconFileName);
+        }
+    else                // Rsc file
+        {
+        temp.Append(KGSResourceFileName);
+        }
+        
+    parse.Set( temp, &KDC_APP_RESOURCE_DIR, NULL );
+    TPtrC iconFile = parse.FullName();
+        
+    // This is done to ensure upgraded file is used first. 
+    // If no upgraded file is found, default file in Z: drive will be used.
+    TFindFile find( CCoeEnv::Static()->FsSession() );
+    TInt err = find.FindByDir( iconFile, KNullDesC );
+        
+    if ( err )
+        {
+        if ( aBitmapFile )
+            {
+            aFileName.Append( KGSVideoPluginIconFileName );    
+            }
+        else
+            {
+            aFileName.Append( KGSVideoPluginResourceFileName );     
+            }
+        }
+    else
+        {
+        if ( aBitmapFile ) 
+            {
+            // this Mbm file has the whole path including the drive
+            aFileName.Append( find.File() );    
+            }
+        else               
+            {
+            // General Settings base class would only take in this format <drive>:<rsc_file_name>
+            // So, the file name is returned in that particular format
+            TFileName tempFile;
+            tempFile.Append( find.File() );    // this rsc file has the whole path including the drive
+            aFileName.Append( tempFile[0] );   // append drive letter
+            aFileName.Append( tempFile[1] );   // append delimiter
+            aFileName.Append( KGSResourceFileName ); // append rsc_file_name
+            }
+        }
+        MPX_DEBUG3(_L("#MS# CGSVideoPlugin::LocateFilePathL(%d,%S)"),aBitmapFile,&aFileName);
+    }   
+
+// -----------------------------------------------------------------------------
+// CGSVideoPlugin::VideoContrastIsSupportedL
+// -----------------------------------------------------------------------------
+//
+TBool CGSVideoPlugin::VideoContrastIsSupportedL()
+    {
+    TInt flags;
+    CRepository* repository = CRepository::NewL( KCRUidMediaPlayerFeatures );
+    repository->Get( KMPLocalVariation, flags );
+    delete repository;
+
+    return ( flags & KMediaPlayerVideoContrast );
+    }
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/gsvideoplugin/src/GSVideoPluginImplementationTable.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2005 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:  ECOM proxy table for this plugin*
+*/
+
+
+// Version : %version: 2 %
+
+
+
+// System includes
+#include <e32std.h>
+#include <implementationproxy.h>
+
+// User includes
+#include "GSVideoPlugin.h"
+
+// Constants
+const TImplementationProxy KGSVideoPluginImplementationTable[] = 
+	{
+	IMPLEMENTATION_PROXY_ENTRY( 0x10275069,	CGSVideoPlugin::NewL )
+	};
+
+
+// ---------------------------------------------------------------------------
+// ImplementationGroupProxy
+// 
+// Gate/factory function
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy( 
+                                                  TInt& aTableCount )
+	{
+	aTableCount = sizeof( KGSVideoPluginImplementationTable ) 
+        / sizeof( TImplementationProxy );
+	return KGSVideoPluginImplementationTable;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/aif/MediaSettingsaif.rss	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2002 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:   RSS for creating the aif file for MediaSettings.*
+*/
+
+
+// Version : %version: 2 %
+
+
+
+#include <aiftool.rh>
+
+RESOURCE AIF_DATA
+    {
+    app_uid = 0x10005A3F;
+    hidden = KAppIsHidden;
+    embeddability = KAppEmbeddableOnly;
+    newfile = KAppDoesNotSupportNewFile;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/data/101F85CB.rss	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2002 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:   ECOM DLL interface & implementation description resource for*
+*/
+
+
+// Version : %version: 2 %
+
+
+
+//  INCLUDES
+#include <RegistryInfo.rh>
+
+#include "ProvisioningUIDs.h"
+
+//  RESOURCE DEFINITIONS 
+// -----------------------------------------------------------------------------
+//   
+// theInfo
+// ECOM DLL interface & implementation description resource.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE REGISTRY_INFO theInfo
+    {
+    dll_uid = 0x101F85CB;
+    interfaces =
+        {
+        INTERFACE_INFO
+            {
+            interface_uid = KProvisioningAdapterInterface;
+            implementations =
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x101F85CC;
+                    version_no = 1;
+                    display_name = "Implements a WAP Streaming Provisioning Adapter";
+                    default_data = "";
+                    opaque_data = "10"; // Adapter priority
+                    }
+                };
+            }
+        };
+    }
+            
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/data/101F85E5.rss	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2002 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:   ECOM DLL interface & implementation description resource for*
+*/
+
+
+// Version : %version: 2 %
+
+
+
+//  INCLUDES
+#include    <RegistryInfo.rh>
+
+#include    "MPSettPluginViewInterfaceUID.hrh"
+#include    "MPSettPluginViewImplementationUIDs.hrh"
+
+//  RESOURCE DEFINITIONS 
+// -----------------------------------------------------------------------------
+//   
+// theInfo
+// ECOM DLL interface & implementation description resource.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE REGISTRY_INFO theInfo
+    {
+    dll_uid = KMPSettAudioViewDllUid;
+    interfaces =
+        {
+        INTERFACE_INFO
+            {
+            interface_uid = KMPSettPluginViewInterfaceUid;
+            implementations =
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = KMPSettAudioViewImplUid;
+                    version_no = 1;
+                    display_name = "Media Player audio plugin settings view";
+                    default_data = "";
+                    opaque_data = "";
+                    }
+                };
+            }
+        };
+    }
+            
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/data/MediaSettings.rss	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,1325 @@
+/*
+* Copyright (c) 2002 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:   This file contains all the resources for the MediaSettings.*
+*/
+
+
+// Version : %version: 17 %
+
+
+
+//  RESOURCE IDENTIFIER
+NAME    MPSE // 4 letter ID
+
+//  INCLUDES
+
+#include    <eikon.rh>
+#include    <avkon.rsg>
+#include    <avkon.rh>
+#include    <mediasettings.mbg>
+#include    <avkon.loc>
+#include    <appinfo.rh>
+#include    <data_caging_paths_strings.hrh>
+
+#include    <ipvideo.loc>
+#include    <mediasettings.loc>
+
+#include    "mediasettings.hrh"
+
+#ifdef RD_MULTIPLE_DRIVE_ENABLERS
+#include <CommonDialogs.hrh> // Enumerations
+#include <CommonDialogs.rh>  // Resource structures
+#endif // RD_MULTIPLE_DRIVE_ENABLERS
+
+//  CONSTANTS  
+
+// Icons file path
+#define KMPSettingIconsFilePath APP_BITMAP_DIR"\\mediasettings.mif"
+
+// On/Off setting values:
+#define KMPSettingValueOn   1
+#define KMPSettingValueOff  0
+
+// Auto disconnect time
+#define KMPSettingValueUnlimited    0
+#define KMPSettingValueUserDefined  1      
+
+
+//  RESOURCE DEFINITIONS 
+
+//----------------------------------------------------
+//   
+//    RSS_SIGNATURE
+//
+//----------------------------------------------------
+//
+RESOURCE RSS_SIGNATURE
+    {
+    }
+
+//----------------------------------------------------
+//   
+//    TBUF
+//    Name of the application.
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF
+    {
+    buf = "MediaSettings";
+    }
+
+//----------------------------------------------------
+//   
+//    EIK_APP_INFO
+//
+//----------------------------------------------------
+//
+RESOURCE EIK_APP_INFO
+    {
+    status_pane = r_mp_settings_status_pane;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_mp_settings_localisable_app_info
+// Localisable application info resource definition
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE LOCALISABLE_APP_INFO r_mp_settings_localisable_app_info
+    {
+    short_caption = qtn_mp_settings_short_caption;
+    caption_and_icon = 
+    CAPTION_AND_ICON_INFO
+        {
+        caption = qtn_mp_settings_caption;
+        number_of_icons = 1;
+        icon_file = KMPSettingIconsFilePath;
+        };
+    }
+
+//----------------------------------------------------
+//   
+//    r_mp_settings_status_pane
+//    Status pane for main view.
+//
+//----------------------------------------------------
+//
+RESOURCE STATUS_PANE_APP_MODEL r_mp_settings_status_pane
+    {
+    layout = R_AVKON_STATUS_PANE_LAYOUT_USUAL;
+    panes =
+        {
+        SPANE_PANE
+            {
+            id = EEikStatusPaneUidTitle;
+            type = EAknCtTitlePane;
+            resource = r_mpsett_main_view_title;
+            }
+        };
+    }
+
+
+// *** Common resources ***
+
+// ---------------------------------------------------
+//
+//    r_mpsett_icon_mbm_file
+//    Path to mpsettings.mbm file
+//
+// ---------------------------------------------------
+//
+RESOURCE TBUF r_mpsett_icon_mbm_file
+    {
+    buf = KMPSettingIconsFilePath;
+    }
+
+
+// ** MENU PANES **
+
+//----------------------------------------------------
+//   
+//    r_mpsett_app_menu
+//    Options menu pane containing common items.
+//
+//----------------------------------------------------
+//
+RESOURCE MENU_PANE r_mpsett_app_menu
+    {
+    items =
+        {
+        MENU_ITEM
+            {
+            command = EMPSettCmdHelp;
+            txt = qtn_options_help;
+            },
+        MENU_ITEM
+            {
+            command = EAknCmdExit;
+            txt = qtn_options_exit;
+            }
+        };
+    }
+
+//----------------------------------------------------
+//   
+//    r_mpsett_open_menu
+//    Options menu pane containing Open item.
+//
+//----------------------------------------------------
+//
+RESOURCE MENU_PANE r_mpsett_open_menu
+    {
+    items =
+        {
+        MENU_ITEM
+            {
+            command = EMPSettCmdOpen;
+            txt = qtn_options_open;
+            flags = EEikMenuItemAction;
+            }
+        };
+    }
+
+//----------------------------------------------------
+//   
+//    r_mpsett_change_menu
+//    Options menu pane containing Change item.
+//
+//----------------------------------------------------
+//
+RESOURCE MENU_PANE r_mpsett_change_menu
+    {
+    items =
+        {
+        MENU_ITEM
+            {
+            command = EMPSettCmdChange;
+            txt = qtn_options_change;
+            flags = EEikMenuItemAction;
+            }
+        };
+    }
+
+//----------------------------------------------------
+//   
+//    r_mpsett_advanced_sett_menu
+//    Options menu pane containing Advanced settings item.
+//
+//----------------------------------------------------
+//
+RESOURCE MENU_PANE r_mpsett_advanced_sett_menu
+    {
+    items =
+        {
+        MENU_ITEM
+            {
+            command = EMPSettCmdAdvancedSett;
+            txt = qtn_mp_option_adv_settings;
+            }
+        };
+    }
+
+//----------------------------------------------------
+//   
+//    r_mpsett_app_and_open_menubar
+//    Options menu containing Open and common items.
+//
+//----------------------------------------------------
+//
+RESOURCE MENU_BAR r_mpsett_app_and_open_menubar
+    {
+    titles =
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_mpsett_app_menu;
+            },
+        MENU_TITLE
+            {
+            menu_pane = r_mpsett_open_menu;
+            }
+        };
+    }
+
+//----------------------------------------------------
+//   
+//    r_mpsett_app_and_change_menubar
+//    Options menu containing Change and common items.
+//
+//----------------------------------------------------
+//
+RESOURCE MENU_BAR r_mpsett_app_and_change_menubar
+    {
+    titles =
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_mpsett_app_menu;
+            },
+        MENU_TITLE
+            {
+            menu_pane = r_mpsett_change_menu;
+            }
+        };
+    }
+
+//----------------------------------------------------
+//   
+//    r_mpsett_app_and_adv_sett_menubar
+//    Options menu containing Change, Advanced, and common items.
+//
+//----------------------------------------------------
+//
+RESOURCE MENU_BAR r_mpsett_app_and_adv_sett_menubar
+    {
+    titles =
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_mpsett_app_menu;
+            },
+#ifndef __PROTOCOL_CDMA
+        MENU_TITLE
+            {
+            menu_pane = r_mpsett_advanced_sett_menu;
+            },
+#endif
+        MENU_TITLE
+            {
+            menu_pane = r_mpsett_change_menu;
+            }
+        };
+    }
+
+
+// ** POPUP SETTING LIST **
+
+//----------------------------------------------------
+//    
+//  r_mpsett_popup_setting_list    
+//
+//----------------------------------------------------
+//
+RESOURCE POPUP_SETTING_LIST r_mpsett_popup_setting_list
+    {
+    }
+
+
+// *** View resources ***
+
+// ** MAIN view **
+
+//----------------------------------------------------
+//   
+//    r_mpsett_main_view_title
+//    Main view's title.
+//
+//----------------------------------------------------
+//-
+RESOURCE TITLE_PANE r_mpsett_main_view_title
+    {
+    txt = qtn_mp_title_settings;
+    }
+
+
+//----------------------------------------------------
+//   
+//    r_mpsett_main_lbx_resource
+//    Main view's listbox resource.
+//
+//----------------------------------------------------
+//
+RESOURCE LISTBOX r_mpsett_main_lbx_resource
+    {
+    array_id = r_mpsett_main_lbx;
+    flags = EEikListBoxMultipleSelection;
+    }
+            
+//----------------------------------------------------
+//    
+//  r_mpsett_main_lbx    
+//  Main view's listbox.
+//
+//----------------------------------------------------
+//
+RESOURCE ARRAY r_mpsett_main_lbx
+    {
+    items =
+        {
+
+        LBUF
+            {
+            txt = "0\t"qtn_mp_settings_video;
+            },
+        LBUF
+            {
+            txt = "1\t"qtn_mp_settings_streaming;
+            }
+
+        };  
+    }
+
+//----------------------------------------------------
+//   
+//    r_mpsett_main_view
+//    Main view's Options menu and cba.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_mpsett_main_view
+    {
+    menubar = r_mpsett_app_and_open_menubar;  
+    cba = R_AVKON_SOFTKEYS_SELECTION_LIST;    
+    }
+
+// ** VIDEO view **
+
+//----------------------------------------------------
+//   
+//    r_mpsett_video_view_title
+//    Video view's title.
+//
+//----------------------------------------------------
+//-
+RESOURCE TITLE_PANE r_mpsett_video_view_title
+    {
+    txt = qtn_mp_title_sett_video;
+    }
+
+//----------------------------------------------------
+//   
+//    r_mpsett_video_view
+//    Video view's Options menu and cba.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_mpsett_video_view
+    {
+    menubar = r_mpsett_app_and_change_menubar;  
+    cba = R_AVKON_SOFTKEYS_SELECTION_LIST;    
+    }
+
+//----------------------------------------------------
+//
+//    r_gs_mpsett_video_view
+//    Video view's Options menu and cba.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_gs_mpsett_video_view
+    {
+    menubar = r_mpsett_app_and_change_menubar;
+    cba = r_mediasetting_softkeys_options_back_change;
+    }
+
+//----------------------------------------------------
+//
+//    r_mediasetting_softkeys_options_back_change
+//    Text association with MSK ( CHANGE )
+//
+//----------------------------------------------------
+//
+RESOURCE CBA r_mediasetting_softkeys_options_back_change
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id=EAknSoftkeyOptions;
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON
+            {
+            id=EAknSoftkeyBack;
+            txt = text_softkey_back;
+            },
+        CBA_BUTTON
+            {
+        id=EMPMiddleSoftKeyChange;
+            txt = qtn_msk_change;
+            }
+        };
+    }
+
+// ** STREAMING view **
+
+//----------------------------------------------------
+//   
+//    r_mpsett_streaming_view_title
+//    Streaming view's title.
+//
+//----------------------------------------------------
+//-
+RESOURCE TITLE_PANE r_mpsett_streaming_view_title
+    {
+    txt = qtn_mp_title_sett_stream;
+    }
+
+//----------------------------------------------------
+//
+//    r_gs_mpsett_streaming_view
+//    Streaming view's Options menu and cba.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_gs_mpsett_streaming_view
+    {
+    menubar = r_mpsett_app_and_adv_sett_menubar;
+    cba=r_mediasetting_softkeys_options_back_open;
+    }
+
+//----------------------------------------------------
+//
+//    r_mpsett_streaming_view
+//    Streaming view's Options menu and cba.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_mpsett_streaming_view
+    {
+    menubar = r_mpsett_app_and_adv_sett_menubar;  
+    cba = R_AVKON_SOFTKEYS_SELECTION_LIST;    
+    }
+
+// * PROXY view *
+
+//----------------------------------------------------
+//   
+//    r_mpsett_proxy_view_title
+//    Proxy view's title.
+//
+//----------------------------------------------------
+//-
+RESOURCE TITLE_PANE r_mpsett_proxy_view_title
+    {
+    txt = qtn_mp_sett_stream_title_proxy;
+    }
+
+// * NETWORK view *
+
+//----------------------------------------------------
+//   
+//    r_mpsett_network_view_title
+//    Network view's title.
+//
+//----------------------------------------------------
+//-
+RESOURCE TITLE_PANE r_mpsett_network_view_title
+    {
+    txt = qtn_mp_sett_stream_title_net;
+    }
+
+// * ADVANCED bw view *
+
+//----------------------------------------------------
+//   
+//    r_mpsett_advanced_bw_view_title
+//    Network view's title.
+//
+//----------------------------------------------------
+//-
+RESOURCE TITLE_PANE r_mpsett_advanced_bw_view_title
+    {
+    txt = qtn_mp_sett_stream_title_net;
+    }
+
+//----------------------------------------------------
+//   
+//    r_mpsett_advanced_bw_view
+//    Network view's Options menu and cba.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_mpsett_advanced_bw_view
+    {
+    menubar = r_mpsett_app_and_change_menubar;  
+    cba = R_AVKON_SOFTKEYS_SELECTION_LIST;    
+    }
+
+
+// *** SETTING ITEM LIST ***
+
+// ** VIDEO setting item list **
+
+//----------------------------------------------------
+//    
+//  r_mpsett_video_setting_item_list    
+//  Video setting list view's item list.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_SETTING_ITEM_LIST r_mpsett_video_setting_item_list
+    {
+    flags = EAknSettingItemIncludeHiddenInOrdinal;
+    items = 
+        {
+        AVKON_SETTING_ITEM
+            {
+            identifier = EMPSettVideoContrastSettingId;
+            name = qtn_mp_setting_video_contrast;
+            setting_page_resource = r_mpsett_video_contrast_setting_page;
+            }
+        };
+    }
+
+// * CONTRAST *
+
+//----------------------------------------------------
+//    
+//  r_mpsett_video_contrast_setting_page    
+//  Setting page resource for Video contrast setting.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_mpsett_video_contrast_setting_page
+    { 
+    number = EAknSettingPageNoOrdinalDisplayed;
+    label = qtn_mp_setting_video_contrast;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; //MSK
+    type = EAknCtSlider;
+    editor_resource_id = r_mpsett_contrast_slider;
+    }
+
+//----------------------------------------------------
+//    
+//  r_mpsett_contrast_slider    
+//  Slider resource for Video contrast setting page.
+//
+//----------------------------------------------------
+//
+RESOURCE SLIDER r_mpsett_contrast_slider 
+    {
+    layout = EAknSettingsItemSliderLayout;
+    minvalue = 0;
+    maxvalue = 100;
+    step = 5;
+    valuetype = EAknSliderValuePercentage;
+    minlabel = qtn_vid_contrast_light;
+    maxlabel = qtn_vid_contrast_dark;
+    }
+
+//----------------------------------------------------
+//    
+//  r_mpsett_contrast_slider_list_value  
+//  Text resource for Video contrast setting's current value.
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_mpsett_contrast_slider_list_value
+    {
+    buf = qtn_mp_contrast_value;
+    }
+
+
+// * DEFAULT VIEW *
+
+//----------------------------------------------------
+//    
+//  r_mpsett_default_view_setting_page    
+//  Setting page resource for Default View setting.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_mpsett_default_view_setting_page
+    {
+    number = EAknSettingPageNoOrdinalDisplayed; 
+    label = qtn_mp_setting_default_playback;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; //MSK
+    type = EAknCtPopupSettingList;
+    editor_resource_id = r_mpsett_default_view_on_off_popup_setting_list;
+    }
+
+//----------------------------------------------------
+//    
+//  r_mpsett_default_view_on_off_popup_setting_list    
+//
+//----------------------------------------------------
+//
+RESOURCE POPUP_SETTING_LIST r_mpsett_default_view_on_off_popup_setting_list
+    {
+    }
+
+// ** STREAMING setting item list **
+
+//----------------------------------------------------
+//    
+//  r_mpsett_streaming_setting_item_list  
+//  Proxy setting list view's item list.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_SETTING_ITEM_LIST r_mpsett_streaming_setting_item_list
+    {
+    items = 
+        {
+#ifndef __PROTOCOL_CDMA                
+        AVKON_SETTING_ITEM
+            {
+            identifier = EMPSettDefaultAPSettingId;
+            name = qtn_mp_setting_default_ap;
+            },
+        AVKON_SETTING_ITEM
+            {
+            identifier = EMPSettMinUDPPortSettingId;
+            name = qtn_mp_setting_min_udp_port;
+            setting_page_resource = r_mpsett_min_udp_port_setting_page;         
+            },
+        AVKON_SETTING_ITEM
+            {
+            identifier = EMPSettMaxUDPPortSettingId;
+            name = qtn_mp_setting_max_udp_port;
+            setting_page_resource = r_mpsett_max_udp_port_setting_page;         
+            },
+#endif            
+        AVKON_SETTING_ITEM
+            {
+            identifier = EMPSettProxyModeSettingId;
+            name = qtn_mp_setting_proxy;
+            setting_page_resource = r_mpsett_proxy_mode_setting_page;
+            associated_resource = r_mpsett_proxy_mode_setting_texts;
+            },
+        AVKON_SETTING_ITEM
+            {
+            identifier = EMPSettProxyHostSettingId;
+            name = qtn_mp_setting_proxy_host;
+            setting_page_resource = r_mpsett_proxy_host_setting_page;
+            empty_item_text = qtn_selec_sett_val_field_none;
+            },
+        AVKON_SETTING_ITEM
+            {
+            identifier = EMPSettProxyPortSettingId;
+            name = qtn_mp_setting_proxy_port;
+            setting_page_resource = r_mpsett_proxy_port_setting_page;           
+            }
+        };
+    }
+
+// * PROXY mode *
+
+//----------------------------------------------------
+//    
+//  r_mpsett_proxy_mode_setting_page    
+//  Setting page for Proxy mode setting.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_mpsett_proxy_mode_setting_page
+    {
+    number = EAknSettingPageNoOrdinalDisplayed; 
+    label = qtn_mp_setting_proxy;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; //MSK
+    type = EAknCtPopupSettingList;
+    editor_resource_id = r_mpsett_popup_setting_list;
+    }
+
+//----------------------------------------------------
+//    
+//  r_mpsett_proxy_mode_setting_texts    
+//  Setting text resource for Proxy mode setting.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_POPUP_SETTING_TEXTS r_mpsett_proxy_mode_setting_texts
+    {
+    setting_texts_resource = r_mpsett_proxy_mode_texts;
+    }
+
+//----------------------------------------------------
+//    
+//  r_mpsett_proxy_mode_texts    
+//  Setting texts for Proxy mode setting.
+//
+//----------------------------------------------------
+//
+RESOURCE ARRAY r_mpsett_proxy_mode_texts
+    {
+    items =
+        {
+        AVKON_ENUMERATED_TEXT
+            {
+            value = KMPSettingValueOn; 
+            text = qtn_mp_sett_proxy_enabled;
+            },
+        AVKON_ENUMERATED_TEXT
+            {
+            value = KMPSettingValueOff;
+            text = qtn_mp_sett_proxy_disabled;
+            }
+        };
+    }
+
+// * PROXY HOSTNAME *
+
+//----------------------------------------------------
+//    
+//  r_mpsett_proxy_host_setting_page    
+//  Setting page for Proxy host name setting.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_mpsett_proxy_host_setting_page
+    {   
+    label= qtn_mp_setting_proxy_host;
+    type = EEikCtEdwin;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; //MSK
+    editor_resource_id = r_mpsett_proxy_host_edwin;
+    }
+
+//----------------------------------------------------
+//    
+//  r_mpsett_proxy_host_edwin    
+//  Text editor for Proxy host name setting page.
+//
+//----------------------------------------------------
+//
+RESOURCE EDWIN r_mpsett_proxy_host_edwin 
+    {
+    flags = KMultiLineExpandingEditorFlags;
+    lines = 0;
+    maxlength = 1000;
+    default_case = EAknEditorLowerCase;
+    avkon_flags = EAknEditorFlagLatinInputModesOnly;
+    special_character_table = R_AVKON_URL_SPECIAL_CHARACTER_TABLE_DIALOG;
+    }
+
+// * PROXY PORT *
+
+//----------------------------------------------------
+//    
+//  r_mpsett_proxy_port_setting_page    
+//  Setting page for Proxy port setting.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_mpsett_proxy_port_setting_page
+    { 
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; //MSK
+    type = EAknCtIntegerEdwin;
+    editor_resource_id= r_mpsett_proxy_port_edwin;
+    }
+
+//----------------------------------------------------
+//    
+//  r_mpsett_proxy_port_edwin    
+//  Integer editor for Proxy port setting page.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_INTEGER_EDWIN r_mpsett_proxy_port_edwin 
+    {
+    min = 0;
+    max = 65535;
+    maxlength = 5;
+    }
+
+// * UDP PORT RANGE *
+
+//----------------------------------------------------
+//    
+//  r_mpsett_min_udp_port_setting_page    
+//  Setting page for Min UDP port setting.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_mpsett_min_udp_port_setting_page
+    {
+    label = qtn_mp_setting_min_udp_port; 
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; //MSK
+    type = EAknCtIntegerEdwin;
+    editor_resource_id= r_mpsett_udp_port_edwin;
+    }
+
+//----------------------------------------------------
+//    
+//  r_mpsett_max_udp_port_setting_page    
+//  Setting page for Min UDP port setting.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_mpsett_max_udp_port_setting_page
+    {
+    label = qtn_mp_setting_max_udp_port; 
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; //MSK
+    type = EAknCtIntegerEdwin;
+    editor_resource_id= r_mpsett_udp_port_edwin;
+    }
+
+//----------------------------------------------------
+//    
+//  r_mpsett_udp_port_edwin    
+//  Integer editor for UDP port setting page.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_INTEGER_EDWIN r_mpsett_udp_port_edwin 
+    {
+    min = 1024; //magic
+    max = 65535; //magic
+    maxlength = 5;
+    }
+
+
+// ** BEARER specific bandwidth setting item list **
+
+//----------------------------------------------------
+//    
+//  r_mpsett_advancedbw_setting_item_list    
+//  Advanced bandwidth setting list view's item list.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_SETTING_ITEM_LIST r_mpsett_bearer_bw_setting_item_list
+    {
+    items = 
+        {
+        AVKON_SETTING_ITEM
+            {
+            identifier = EMPSettGPRSBwSettingId;
+            name = qtn_mp_gprs_bandwidth;
+            setting_page_resource = r_mpsett_gprs_bandw_setting_page;
+            },
+        AVKON_SETTING_ITEM
+            {
+            identifier = EMPSettEGPRSBwSettingId;
+            name = qtn_mp_egprs_bandwidth;
+            setting_page_resource = r_mpsett_egprs_bandw_setting_page;
+            },
+        AVKON_SETTING_ITEM
+            {
+            identifier = EMPSettWCDMABwSettingId;
+            name = qtn_mp_wcdma_bandwidth;
+            setting_page_resource = r_mpsett_wcdma_bandw_setting_page;
+            },
+        AVKON_SETTING_ITEM
+            {
+            identifier = EMPSettWLANBwSettingId;
+            name = qtn_mp_wlan_bandwidth;
+            setting_page_resource = r_mpsett_wlan_bandw_setting_page;
+            },
+        AVKON_SETTING_ITEM
+            {
+            identifier = EMPSettHSDPABwSettingId;
+            name = qtn_mp_hsdpa_bandwidth;
+            setting_page_resource = r_mpsett_hsdpa_bandw_setting_page;
+            }
+        };
+    }
+
+// * GPRS BANDWIDTH *
+
+//----------------------------------------------------
+//    
+//  r_mpsett_gprs_bandw_setting_page    
+//  Setting page for Maximum bandwidth setting.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_mpsett_gprs_bandw_setting_page
+    {
+    number = EAknSettingPageNoOrdinalDisplayed; 
+    label = qtn_mp_gprs_bandwidth;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; //MSK
+    type = EAknCtPopupSettingList;
+    editor_resource_id = r_mpsett_popup_setting_list;
+    }
+
+//----------------------------------------------------
+//    
+//  r_mpsett_gprs_bw_query    
+//
+//----------------------------------------------------
+//
+RESOURCE DIALOG r_mpsett_gprs_bw_query
+    {
+    flags = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_OK_CANCEL__OK; //MSK
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtQuery;
+            id = EGeneralQuery;
+            control = AVKON_DATA_QUERY 
+                { 
+                layout = EFloatingPointLayout;
+                label = qtn_mp_header_bw;
+                control = FLPTED
+                    {
+                    maxlength = 9;
+                    };
+                };
+            }
+        };
+    }
+
+// * EGPRS BANDWIDTH *
+
+//----------------------------------------------------
+//    
+//  r_mpsett_egprs_bandw_setting_page    
+//  Setting page for Maximum bandwidth setting.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_mpsett_egprs_bandw_setting_page
+    {
+    number = EAknSettingPageNoOrdinalDisplayed; 
+    label = qtn_mp_egprs_bandwidth;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; //MSK
+    type = EAknCtPopupSettingList;
+    editor_resource_id = r_mpsett_popup_setting_list;
+    }
+
+//----------------------------------------------------
+//    
+//  r_mpsett_egprs_bw_query    
+//
+//----------------------------------------------------
+//
+RESOURCE DIALOG r_mpsett_egprs_bw_query
+    {
+    flags = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_OK_CANCEL__OK; //MSK
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtQuery;
+            id = EGeneralQuery;
+            control = AVKON_DATA_QUERY 
+                { 
+                layout = EFloatingPointLayout;
+                label = qtn_mp_header_bw;
+                control = FLPTED
+                    {
+                    maxlength = 9;
+                    };
+                };
+            }
+        };
+    }
+
+// * WCDMA BANDWIDTH *
+
+//----------------------------------------------------
+//    
+//  r_mpsett_wcdma_bandw_setting_page    
+//  Setting page for Maximum bandwidth setting.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_mpsett_wcdma_bandw_setting_page
+    {
+    number = EAknSettingPageNoOrdinalDisplayed; 
+    label = qtn_mp_wcdma_bandwidth;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; //MSK
+    type = EAknCtPopupSettingList;
+    editor_resource_id = r_mpsett_popup_setting_list;
+    }
+
+//----------------------------------------------------
+//    
+//  r_mpsett_wcdma_bw_query    
+//
+//----------------------------------------------------
+//
+RESOURCE DIALOG r_mpsett_wcdma_bw_query
+    {
+    flags = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_OK_CANCEL__OK; //MSK
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtQuery;
+            id = EGeneralQuery;
+            control = AVKON_DATA_QUERY 
+                { 
+                layout = EFloatingPointLayout;
+                label = qtn_mp_header_bw;
+                control = FLPTED
+                    {
+                    maxlength = 9;
+                    };
+                };
+            }
+        };
+    }
+
+
+
+// * WLAN BANDWIDTH *
+
+//----------------------------------------------------
+//    
+//  r_mpsett_wlan_bandw_setting_page    
+//  Setting page for Maximum bandwidth setting.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_mpsett_wlan_bandw_setting_page
+    {
+    number = EAknSettingPageNoOrdinalDisplayed; 
+    label = qtn_mp_wlan_bandwidth;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; //MSK
+    type = EAknCtPopupSettingList;
+    editor_resource_id = r_mpsett_popup_setting_list;
+    }
+
+//----------------------------------------------------
+//    
+//  r_mpsett_wlan_bw_query    
+//
+//----------------------------------------------------
+//
+RESOURCE DIALOG r_mpsett_wlan_bw_query
+    {
+    flags = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_OK_CANCEL__OK; //MSK
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtQuery;
+            id = EGeneralQuery;
+            control = AVKON_DATA_QUERY 
+                { 
+                layout = EFloatingPointLayout;
+                label = qtn_mp_header_bw;
+                control = FLPTED
+                    {
+                    maxlength = 9;
+                    };
+                };
+            }
+        };
+    }
+
+// * HSDPA BANDWIDTH *
+//----------------------------------------------------
+//    
+//  r_mpsett_hsdpa_bandw_setting_page    
+//  Setting page for Maximum bandwidth setting.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_mpsett_hsdpa_bandw_setting_page
+    {
+    number = EAknSettingPageNoOrdinalDisplayed; 
+    label = qtn_mp_hsdpa_bandwidth;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; //MSK
+    type = EAknCtPopupSettingList;
+    editor_resource_id = r_mpsett_popup_setting_list;
+    }
+
+//----------------------------------------------------
+//    
+//  r_mpsett_hsdpa_bw_query    
+//
+//----------------------------------------------------
+//
+RESOURCE DIALOG r_mpsett_hsdpa_bw_query
+    {
+    flags = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_OK_CANCEL__OK; //MSK
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtQuery;
+            id = EGeneralQuery;
+            control = AVKON_DATA_QUERY 
+                { 
+                layout = EFloatingPointLayout;
+                label = qtn_mp_header_bw;
+                control = FLPTED
+                    {
+                    maxlength = 9;
+                    };
+                };
+            }
+        };
+    }
+
+// * COMMON for bearer specific bw setting items *
+
+//----------------------------------------------------
+//    
+//  r_mpsett_advanced_bw_value  
+//  Setting text resource for advanced bandwidth
+//  setting value.
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_mpsett_advanced_bw_value
+    {
+    buf = qtn_mp_bw_sett_value;
+    }
+
+
+//----------------------------------------------------
+//    
+//  r_mpsett_advanced_bw_value_mbit  
+//  Setting text resource for advanced bandwidth
+//  setting value.
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_mpsett_advanced_bw_value_mbit
+    {
+    buf = qtn_mp_bw_sett_value_mbit;
+    }
+
+//----------------------------------------------------
+//    
+//  r_mpsett_user_defined
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_mpsett_user_defined
+    {
+    buf = qtn_mp_sett_autodiscon_user;
+    }
+
+
+// *** PLUGIN VIEWS ***
+
+// *** GSVideoPlugin ***
+//----------------------------------------------------
+//   
+//    r_gs_mediasetting_view
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_gs_mediasetting_view
+    {
+    menubar= r_gs_menubar_mediasetting_dummy_view;  
+    cba=r_mediasetting_softkeys_options_back_open;
+    }
+
+//----------------------------------------------------
+//
+//    r_mediasetting_softkeys_options_back_open
+//    Text association with MSK ( OPEN )
+//
+//----------------------------------------------------
+//
+RESOURCE CBA r_mediasetting_softkeys_options_back_open
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id=EAknSoftkeyOptions;
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON
+            {
+            id=EAknSoftkeyBack;
+            txt = text_softkey_back;
+            },
+        CBA_BUTTON
+            {
+            id=EMPSettCmdOpen;
+            txt = qtn_msk_open;
+            }
+        };
+    }
+
+//----------------------------------------------------
+//   
+//  r_gs_menubar_mediasetting_dummy_view
+//  MediaSetting view dummy sub-menubar - needed as a base for other
+//  menubars.
+//----------------------------------------------------
+//
+RESOURCE MENU_BAR r_gs_menubar_mediasetting_dummy_view
+    {
+    titles =
+        {
+        MENU_TITLE { menu_pane=r_mpsett_app_menu;},
+        MENU_TITLE { menu_pane=r_mpsett_open_menu;}
+        };
+    }
+
+//----------------------------------------------------
+//  r_gs_mediasetting_view_caption 
+// 
+// MediaSetting view caption for plugin
+//----------------------------------------------------
+//
+RESOURCE TBUF r_gs_mediasetting_view_caption
+    {
+    buf = qtn_set_folder_media_player;
+    }
+
+// MSK Handling
+
+// -----------------------------------------------------------------------------
+//
+//    r_mediasetting_msk_open
+//    Middle softkey label: open.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_mediasetting_msk_open
+    {
+    buf = qtn_msk_open;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_mediasetting_msk_select
+//    Middle softkey label: select.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_mediasetting_msk_select
+    {
+    buf = qtn_msk_select;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_mediasetting_msk_change
+//    Middle softkey label: change.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_mediasetting_msk_change
+    {
+    buf = qtn_msk_change;
+    }
+
+//----------------------------------------------------
+//   
+//    r_mpsett_app_and_change_menubar
+//    Options menu containing Change and common items.
+//
+//----------------------------------------------------
+//
+RESOURCE MENU_BAR r_mpsett_feeds_menubar
+    {
+    titles =
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_mpsett_app_menu;
+            }
+        };
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/data/MediaSettings_reg.rss	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,38 @@
+/*
+* Copyright (c) 2004 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:   MediaSettings_reg.rss*
+*/
+
+
+// Version : %version: 8 %
+
+
+
+#include <appinfo.rh>
+#include <data_caging_paths_strings.hrh>
+#include <MediaSettings.rsg>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x10005A3F 
+
+RESOURCE APP_REGISTRATION_INFO
+    {
+    app_file = "MediaSettings";
+    localisable_resource_file = APP_RESOURCE_DIR"\\MediaSettings";
+    localisable_resource_id = R_MP_SETTINGS_LOCALISABLE_APP_INFO;
+    hidden = KAppIsHidden;
+    embeddability = KAppEmbeddable;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,46 @@
+/*
+* 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 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:  Build information file for MediaSettings application.*
+*/
+
+
+// Version : %version:  11 %
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+
+PRJ_EXPORTS
+//
+//  Export the loc, stub sis iby files for S60 5.0
+//
+../loc/mediasettings.loc             APP_LAYER_LOC_EXPORT_PATH(mediasettings.loc)
+../rom/mediasettings.iby             CORE_APP_LAYER_IBY_EXPORT_PATH(mediasettings.iby)
+../rom/mediasettingsresources.iby    LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(mediasettingsresources.iby)
+
+PRJ_EXTENSIONS
+START EXTENSION s60/mifconv
+OPTION TARGETFILE mediasettings.mif
+OPTION HEADERFILE mediasettings.mbg
+OPTION SOURCEFILE iconlist.txt
+END
+
+
+PRJ_MMPFILES
+
+mediasettingsapp.mmp
+
+PRJ_TESTMMPFILES
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/group/iconlist.txt	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,10 @@
+-c8,8 qgn_menu_video
+-c8,8 qgn_prop_set_service
+-c8,8 qgn_prop_set_apps_mp
+-c8,8 qgn_prop_set_mp_video_sub
+-c8,8 qgn_prop_set_mp_stream_sub
+-c8,8 qgn_prop_set_mp_audio_sub
+-c8,1 qgn_prop_set_mp_video_tab2
+-c8,1 qgn_prop_set_mp_audio_tab3
+-c8,1 qgn_prop_set_mp_stream_tab2
+-c8,1 qgn_prop_set_mp_video_tab3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/group/icons.mk	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,64 @@
+#
+# Copyright (c) 2003 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: 
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\Z
+else
+ZDIR=\epoc32\data\z
+endif
+
+
+TARGETDIR=$(ZDIR)\SYSTEM\APPS\MEDIASETTINGS
+HEADERDIR=\epoc32\include
+ICONTARGETFILENAME=$(TARGETDIR)\mediasettings.mif
+HEADERFILENAME=$(HEADERDIR)\mediasettings.mbg
+
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) \
+	   /c8,8 qgn_menu_video.svg\
+	   /c8,8 qgn_prop_set_apps_mp.bmp\
+           /c8,8 qgn_prop_set_mp_video_sub.bmp \
+           /c8,8 qgn_prop_set_mp_stream_sub.bmp \
+           /c8,8 qgn_prop_set_mp_audio_sub.bmp \
+           /c8,1 qgn_prop_set_mp_video_tab2.bmp \
+           /c8,1 qgn_prop_set_mp_audio_tab3.bmp \
+           /c8,1 qgn_prop_set_mp_stream_tab2.bmp \
+           /c8,1 qgn_prop_set_mp_video_tab3.bmp
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(HEADERFILENAME)&& \
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/group/icons_dc.mk	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,67 @@
+#
+# Copyright (c) 2003 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: 
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\Z
+else
+ZDIR=\epoc32\data\z
+endif
+
+
+TARGETDIR=$(ZDIR)\RESOURCE\APPS
+HEADERDIR=\epoc32\include
+ICONTARGETFILENAME=$(TARGETDIR)\mediasettings.mif
+HEADERFILENAME=$(HEADERDIR)\mediasettings.mbg
+
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : 
+	del $(ICONTARGETFILENAME)
+	del $(HEADERFILENAME)
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+
+RESOURCE : 
+	mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) \
+	   /c8,8 qgn_menu_video.svg\
+	   /c8,8 qgn_prop_set_service.svg\
+	   /c8,8 qgn_prop_set_apps_mp.bmp\
+           /c8,8 qgn_prop_set_mp_video_sub.bmp \
+           /c8,8 qgn_prop_set_mp_stream_sub.bmp \
+           /c8,8 qgn_prop_set_mp_audio_sub.bmp \
+           /c8,1 qgn_prop_set_mp_video_tab2.bmp \
+           /c8,1 qgn_prop_set_mp_audio_tab3.bmp \
+           /c8,1 qgn_prop_set_mp_stream_tab2.bmp \
+           /c8,1 qgn_prop_set_mp_video_tab3.bmp
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(HEADERFILENAME)&& \
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/group/mediasettingsapp.mmp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,99 @@
+/*
+* Copyright (c) 2002 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:   Makefile for Media Settings app.*
+*/
+
+
+// Version : %version: 8 %
+
+
+
+#include <platform_paths.hrh>
+#include <data_caging_paths.hrh>
+#include <bldvariant.hrh>
+
+TARGET          mediasettings.exe
+TARGETTYPE      exe
+UID             0x100039CE 0x10005A3F
+EPOCSTACKSIZE   0x5000
+
+VENDORID        VID_DEFAULT
+
+SOURCEPATH      ../src
+SOURCE          MPSettingsApp.cpp 
+SOURCE          MPSettingsAppUi.cpp
+SOURCE          MPSettingsDocument.cpp
+SOURCE          MPSettingsMainContainer.cpp
+SOURCE          MPSettingsMainView.cpp
+SOURCE          MPSettingsVideoSettingItemList.cpp
+SOURCE          MPSettingsVideoContainer.cpp
+SOURCE          MPSettingsVideoView.cpp
+SOURCE          MPSettingsStreamingView.cpp
+SOURCE          MPSettingsStreamingContainer.cpp
+SOURCE          MPSettingsStreamingSettingItemList.cpp
+SOURCE          MPSettingsSliderSettingItem.cpp
+SOURCE          MPSettingsUDPPortSettingItem.cpp
+SOURCE          MPSettingsAdvancedBwContainer.cpp
+SOURCE          MPSettingsAdvancedBwSettingItemList.cpp
+SOURCE          MPSettingsAdvancedBwSettingItem.cpp
+SOURCE          MPSettingsAdvancedBwView.cpp
+
+START RESOURCE  ../data/MediaSettings.rss
+TARGETPATH      APP_RESOURCE_DIR
+TARGET          mediasettings.rsc
+HEADER
+LANGUAGE_IDS
+END
+
+START RESOURCE  ../data/MediaSettings_reg.rss
+DEPENDS mediasettings.rsg
+TARGETPATH      /private/10003a3f/apps
+END
+
+USERINCLUDE     .
+USERINCLUDE     ../inc
+USERINCLUDE     ../../mpsettbase/inc
+USERINCLUDE     ../../videoplayersettingsengine/inc
+USERINCLUDE     ../../mediasettingsengine/inc
+
+APP_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   /epoc32/include/ecom
+
+CAPABILITY      CAP_APPLICATION
+
+LIBRARY         euser.lib
+LIBRARY         efsrv.lib
+LIBRARY         apparc.lib
+LIBRARY         cone.lib
+LIBRARY         bafl.lib
+LIBRARY         eikcore.lib
+LIBRARY         eikcoctl.lib
+LIBRARY         eikctl.lib
+LIBRARY         avkon.lib
+LIBRARY         commonengine.lib
+LIBRARY         ecom.lib
+LIBRARY         hlplch.lib
+LIBRARY         featmgr.lib
+LIBRARY         aknskins.lib
+LIBRARY         egul.lib
+LIBRARY         centralrepository.lib 
+LIBRARY         mpsettbase.lib
+LIBRARY         mpsettengine.lib
+LIBRARY         flogger.lib
+LIBRARY         vcxnssettingsengine.lib
+LIBRARY         commondialogs.lib
+LIBRARY	        cmmanager.lib
+LIBRARY         commsdat.lib
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/inc/MPSettingsAdvancedBwContainer.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,94 @@
+/*
+* Copyright (c) 2002 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:   Declares container control for application.*
+*/
+
+
+// Version : %version: 2 %
+
+
+
+#ifndef MPSETTINGSADVANCEDBWCONTAINER_H
+#define MPSETTINGSADVANCEDBWCONTAINER_H
+
+// INCLUDES
+#include    "MPSettingsBaseContainer.h"
+   
+// FORWARD DECLARATIONS
+class CMPSettingsAdvancedBwSettingItemList;
+class CMPSettingsModelForROP;   
+
+// CLASS DECLARATION
+
+/**
+*  CMPSettingsAdvancedBwContainer container control class.
+*  
+*  @lib MediaSettings.app
+*  @since 2.1
+*/
+class CMPSettingsAdvancedBwContainer : public CMPSettingsBaseContainer
+    {
+    public: // Constructors and destructor
+        
+        /**
+        * C++ default constructor.
+        */
+        CMPSettingsAdvancedBwContainer(CMPSettingsModelForROP* aModel);
+
+        /**
+        * Destructor.
+        */
+        virtual ~CMPSettingsAdvancedBwContainer();
+
+    public: // New
+
+        /**
+        * Edits current setting item.
+        * @since 2.1
+        */
+        void EditCurrentItemFromMenuL();
+
+    public: // Functions from base classes
+            
+        /**
+        * From CoeControl
+        */
+        void GetHelpContext(TCoeHelpContext& aContext) const;
+		void FocusChanged(TDrawNow /*aDrawNow*/); 	
+  		void SizeChanged();
+  		void HandleResourceChange(TInt aType);
+
+    protected: // Functions from base classes 
+
+        /**
+        * From CMPSettingsBaseContainer
+        */
+        void ConstructComponentControlsL();
+
+    private:  // Functions from base classes
+
+        /**
+        * From CMPSettingsBaseContainer
+        */
+        TInt TitleResourceId();
+
+    private:
+        CMPSettingsAdvancedBwSettingItemList* iSettingList;
+        CMPSettingsModelForROP* iModel;
+      
+    };
+
+#endif // MPSETTINGSADVANCEDBWCONTAINER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/inc/MPSettingsAdvancedBwSettingItem.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,122 @@
+/*
+* Copyright (c) 2002 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:   CAknSettingItemList compliant setting item class for Advanced bandwidth settings.*
+*/
+
+
+// Version : %version: 5 %
+
+
+
+
+#ifndef CMPSETTADVANCEDBWSETTINGSITEM_H
+#define CMPSETTADVANCEDBWSETTINGSITEM_H
+
+//  INCLUDES
+#include    <aknsettingitemlist.h>
+
+// FORWARD DECLARATIONS
+class CEikonEnv;
+
+// CLASS DECLARATION
+
+/**
+* CMPSettingsAdvancedBwSettingItem class derived from 
+* CAknEnumeratedTextPopupSettingItem.
+*  CAknSettingItemList compliant setting item class for
+*  Advanced bandwidth settings.
+*
+*  @lib MediaSettings.app
+*  @since 2.1
+*/
+class CMPSettingsAdvancedBwSettingItem : public CAknEnumeratedTextPopupSettingItem
+    {
+    public:
+
+        /**
+        * C++ default constructor.
+        * @param aIdentifier Setting item id.
+        * @param aValueArray Array containing fixed bw values for the list.
+        * @param aValue Reference to current bw value in bits per sec.
+        * @param aListValue Reference to Setting page's list value.
+        * @param aQueryRes Bw query resource.
+        */
+        CMPSettingsAdvancedBwSettingItem(TInt aIdentifier,
+                                         RArray<TInt>& aValueArray,
+                                         TInt& aValue,
+                                         TInt& aListValue,
+                                         TInt aQueryRes);
+
+        /**
+        * Destructor.
+        */       
+        virtual ~CMPSettingsAdvancedBwSettingItem();
+
+    public: // From base classes
+
+        /**
+        * From MAknSettingPageObserver
+        * @param aSettingPage Pointer to setting page which has caused this callback.
+        * @param aEventType Occurred setting page event type.
+        */
+        void HandleSettingPageEventL(CAknSettingPage* aSettingPage,
+                                     TAknSettingPageEvent aEventType );
+
+        /**
+        * From CAknSliderSettingItem
+        * @return Setting item text (current value).
+        */
+        const TDesC& SettingTextL();
+
+        /**
+        * From CAknSliderSettingItem
+        * This launches the setting page for popup list setting page 
+        * @param aCalledFromMenu - ignored in this class
+        */
+        void EditItemL(TBool aCalledFromMenu);
+
+    private: // From base classes
+
+        /**
+        * From CAknSettingItem
+        */
+        void CompleteConstructionL();
+
+    private:  // New
+
+        /**
+        * Displays bandwidth number query.
+        * 
+        * @param aMin   Minimum allowed value (bps)
+        * @param aMax   Maximum allowed value (bps)
+        */
+        void ShowAdvancedBwQueryL( TInt aMin, TInt aMax );
+
+        /**
+        * Creates setting value text from aValue.
+        */
+        HBufC* CreateValueTextL(TInt aValue);
+
+    private:    // Data
+        HBufC* iSettingText;
+        RArray<TInt>& iValueArray;
+        TInt& iValue;
+        TInt iQueryRes;
+
+        CArrayPtr<CAknEnumeratedText>* iEnumTextArray;
+    };
+
+#endif      // CMPSETTADVANCEDBWSETTINGSITEM_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/inc/MPSettingsAdvancedBwSettingItemList.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,145 @@
+/*
+* Copyright (c) 2002 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:   Setting item list class for Advanced bandwidth setting list view.*
+*/
+
+
+// Version : %version: 3 %
+
+
+
+
+#ifndef MPSETTINGSADVANCEDBWSETTINGITEMLIST_H
+#define MPSETTINGSADVANCEDBWSETTINGITEMLIST_H
+
+//  INCLUDES
+#include    <aknsettingitemlist.h>
+
+// FORWARD DECLARATIONS
+class CMPSettingsModelForROP;
+
+// CLASS DECLARATION
+
+/**
+*  CMPSettingsAdvancedBwSettingItemList
+*  Setting item list class for Advanced bandwidth setting list view.
+*
+*  @lib MediaSettings.app
+*  @since 2.1
+*/
+class CMPSettingsAdvancedBwSettingItemList : public CAknSettingItemList
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * C++ default constructor.
+        */
+        CMPSettingsAdvancedBwSettingItemList(CMPSettingsModelForROP* aModel);
+
+	    /**
+	    * 2nd-stage construction from resource id
+	    */
+	    void ConstructFromResourceL(TInt aResourceId);
+
+        /**
+        * From CCoeControl, 2nd-stage construction from constructed resource reader
+        */
+        void ConstructFromResourceL(TResourceReader& aReader);
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CMPSettingsAdvancedBwSettingItemList();
+
+    public:     // Functions from base classes
+
+        /**
+        * From CAknSettingItemList
+        * @param aIndex Current item's (Visible) index in the list
+        * @param aCalledFromMenu True if function was called from Options menu.
+        */
+        void EditItemL(TInt aIndex, TBool aCalledFromMenu);
+
+    protected:  // Functions from base classes
+        
+        /**
+        * From CAknSettingItemList
+        * Framework method to create a setting item based upon the user id aSettingId. The 
+        * client code decides what type to contruct.  new (ELeave) must then be used and the resulting 
+        * pointer returned. Ownership is thereafter base class's responsiblity.
+        *
+        * @param aSettingId ID to use to determine the type of the setting item
+        * @return a constructed (not 2nd-stage constructed) setting item.
+        */
+        CAknSettingItem* CreateSettingItemL(TInt aSettingId);
+
+    private: //New
+
+        /**
+        * Loads all setting values.
+        * @since 2.1
+        */
+        void LoadAllL();       
+
+        /**
+        * Loads a specific setting value.
+        * @since 2.1
+        * @param aSettingId ID of the setting to be loaded.
+        */
+        void LoadSettingL(TInt aSettingId);
+
+        /**
+        * Stores a specific setting value.
+        * @since 2.1
+        * @param aSettingId ID of the setting to be stored.
+        */
+        void StoreSettingL(TInt aSettingId);
+
+        /**
+        * Searches aValue from aArray. If aValue is found, aListValue is its index
+        * in aArray. Otherwise aListValue is aArray's count.
+        */
+        void CalculateListPosition(TInt aValue, TInt& aListValue, RArray<TInt>& aArray);
+
+    private:
+        CMPSettingsModelForROP* iModel;
+
+        RArray<TInt> iGRPSSustainPresets;
+        RArray<TInt> iEGRPSSustainPresets;
+        RArray<TInt> iWCDMASustainPresets;
+        RArray<TInt> iWLANSustainPresets;
+        RArray<TInt> iHSDPASustainPresets;
+        
+        RArray<TInt> iGRPSMaxPresets;
+        RArray<TInt> iEGRPSMaxPresets;
+        RArray<TInt> iWCDMAMaxPresets;
+        RArray<TInt> iWLANMaxPresets;
+        RArray<TInt> iHSDPAMaxPresets;
+        
+        TInt iGPRSListValue;
+        TInt iGPRSBw;
+        TInt iEGPRSListValue;
+        TInt iEGPRSBw;
+        TInt iWCDMAListValue;
+        TInt iWCDMABw;
+        TInt iWLANListValue;
+        TInt iWLANBw;
+        TInt iHSDPAListValue;
+        TInt iHSDPABw;
+        
+    };
+
+#endif      // MPSETTINGSADVANCEDBWSETTINGITEMLIST_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/inc/MPSettingsAdvancedBwView.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,98 @@
+/*
+* Copyright (c) 2002 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:   Declares view for application.*
+*/
+
+
+// Version : %version: 2 %
+
+
+
+#ifndef MPSETTINGSADVANCEDBWVIEW_H
+#define MPSETTINGSADVANCEDBWVIEW_H
+
+// INCLUDES
+#include    "MPSettingsBaseView.h"
+
+// CLASS DECLARATION
+class CMPSettingsModelForROP;
+
+/**
+*  CMPSettingsAdvancedBwView view class.
+* 
+*  @lib MediaSettings.app
+*  @since 2.1
+*/
+class CMPSettingsAdvancedBwView : public CMPSettingsBaseView
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CMPSettingsAdvancedBwView* NewLC(CMPSettingsModelForROP* aModel, TBool iConstructAsGsPlugin);
+
+        /**
+        * Destructor.
+        */
+        virtual ~CMPSettingsAdvancedBwView();
+
+    public: // Functions from base classes
+        
+        /**
+        * From CAknView
+        */
+        TUid Id() const;
+
+        /**
+        * From MEikMenuObserver
+        */
+        void HandleCommandL(TInt aCommand);
+
+        /**
+        * Sets Navipane text
+        * @since 3.1
+        */
+        void SetNaviPaneL();
+        
+    protected: // From CMPSettingsBaseView
+
+        /**
+        * Creates new view specific container class.
+        * @return void
+        */
+        CMPSettingsBaseContainer* NewContainerL();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CMPSettingsAdvancedBwView(CMPSettingsModelForROP* aModel, TBool iConstructAsGsPlugin);
+
+        /**
+        * Symbian 2nd phase constructor.
+        */
+        void ConstructL();
+
+    private: //Data
+    
+        CMPSettingsModelForROP* iModel;
+        TBool   iGsPlugin;
+
+    };
+
+#endif      // MPSETTINGSADVANCEDBWVIEW_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/inc/MPSettingsApp.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2002 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:   Declares main application class.*
+*/
+
+
+// Version : %version: 2 %
+
+
+
+#ifndef MPSETTINGSAPP_H
+#define MPSETTINGSAPP_H
+
+// INCLUDES
+#include    <aknapp.h>
+
+// CONSTANTS
+// UID of the application
+const TUid KUidMediaSettings = {0x10005A3F};
+
+// CLASS DECLARATION
+
+/**
+* CMPSettingsApp application class.
+* Provides factory to create concrete document object.
+* 
+*  @lib MediaSettings.app
+*  @since 2.0
+*/
+class CMPSettingsApp : public CAknApplication
+    {
+    private:
+
+        /**
+        * From CApaApplication, creates CMPSettingsDocument document object.
+        * @return A pointer to the created document object.
+        */
+        CApaDocument* CreateDocumentL();
+        
+        /**
+        * From CApaApplication, returns application's UID (KUidMediaSettings).
+        * @return The value of KUidMediaSettings.
+        */
+        TUid AppDllUid() const;
+    };
+
+#endif
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/inc/MPSettingsAppUi.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,203 @@
+/*
+* Copyright (c) 2002 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:   Declares UI class for application.*
+*/
+
+
+// Version : %version: 6 %
+
+
+
+#ifndef MPSETTINGSAPPUI_H
+#define MPSETTINGSAPPUI_H
+
+// INCLUDES
+#include    <eikapp.h>
+#include    <eikdoc.h>
+#include    <e32std.h>
+#include    <coeccntx.h>
+#include    <aknViewAppUi.h>
+#include    <akntabgrp.h>
+#include    <aknnavide.h>
+#include    <AknTabObserver.h>
+
+
+#include    "MPSettingsNaviPaneController.h"
+
+// FORWARD DECLARATIONS
+class CAknNavigationDecorator;
+class CMPSettingsMainView;
+
+// CLASS DECLARATION
+class CMPSettingsModel;
+class CMPMediaPlayerSettings;
+class CMPSettingsModelForROP;
+
+/**
+* Application UI class.
+* Provides support for the following features:
+* - EIKON control architecture
+* - view architecture
+* - status pane
+* 
+*  @lib MediaSettings.app
+*  @since 2.0
+*/
+class CMPSettingsAppUi : public CAknViewAppUi,
+                         public MAknTabObserver,
+                         public MMPSettingsNaviPaneController
+    {
+    public: // // Constructors and destructor
+
+        /*
+        * C++ constructor.
+        */
+        CMPSettingsAppUi();
+
+        /**
+        * Symbian OS 2nd phase constructor.
+        */      
+        void ConstructL();
+
+        /**
+        * Destructor.
+        */      
+        virtual ~CMPSettingsAppUi();
+        
+    public: // Functions from base classes
+
+        /**
+        * From CEikAppUi, takes care of command handling.
+        * @param aCommand command to be handled
+        */
+        void HandleCommandL(TInt aCommand);
+
+        /**
+        * From CEikAppUi, takes care of resource handling.
+        * @param aType resource to be handled
+        */
+        void HandleResourceChangeL( TInt aType );
+
+        /**
+        * From MAknTabObserver, takes care of tab handling.
+        * @param aIndex tab to be handled
+        */
+        void TabChangedL(TInt aIndex); 
+
+        /**
+        * From MMPSettingsNaviPaneController, returns pointer
+        * to MP's Navi pane object.
+        * @return CAknNavigationControlContainer.
+        */
+        CAknNavigationControlContainer* NaviContainer() const;
+    
+        /**
+        * From MMPSettingsNaviPaneController, returns pointer
+        * to MP's tab group object.
+        * @return CAknNavigationDecorator.
+        */
+        CAknNavigationDecorator* MPTabGroup() const;
+
+        /**
+        * From MMPSettingsNaviPaneController, updates tab group
+        * according to active view.
+        */
+        void UpdateTabIndex();
+
+        /**
+        * Activates view.
+		* @param aViewId View Id
+        */
+        void ActivateLocalViewL( TUid aViewId );
+        
+    private:
+
+        /**
+        * From MEikMenuObserver, dynamically initialises menu pane.
+        * @param aResourceId Resource ID identifying the menu pane
+        *   to initialise.
+        * @param aMenuPane Pointer to the menu pane.
+        */
+        void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane);
+
+            /**
+        * From CEikAppUi, handles key events.
+        * @param aKeyEvent Event to handled.
+        * @param aType Type of the key event. 
+        * @return Response code (EKeyWasConsumed, EKeyWasNotConsumed). 
+        */
+        TKeyResponse HandleKeyEventL(
+            const TKeyEvent& aKeyEvent,TEventCode aType);
+
+    private: // new functions
+
+        /**
+        * Create tab to tabgroup with possibly skinned icon (with mask)
+        * @param aID       Skin ID for the icon
+        * @param aMbmFile  Full path to MBM file which contains the default icon
+        * @param aBitmapId Id for the default icon in the MBM file
+        * @param aMaskId   Id for the default icon mask in the MBM file
+        * @param aTabId    Id for tab
+        */
+        void AddTabSettingsL(
+            const TAknsItemID& aID,
+            const TDesC& aMbmFile,
+            TInt aBitmapId,
+            TInt aMaskId,
+            TInt aTabId );
+
+        /**
+        * Create navigation pane tabgroup 
+        */
+        void AddTabSettingsGroupL();
+
+        /**
+         * Check whether or not the Contrast settings item should be drawn
+		 * @return ETrue, if contrast item should be visible.
+         */
+        TBool VideoContrastIsSupportedL();        
+        
+    private: //Data
+
+        /**
+         * Navi pane. Not own.
+         */
+        CAknNavigationControlContainer* iNaviPane;
+        
+        /**
+         * Tab group. Not own.
+         */
+        CAknTabGroup*                   iTabGroup; 
+
+        /**
+         * Decorated tab group. Own.
+         */
+        CAknNavigationDecorator*        iDecoratedTabGroup;
+
+        CArrayFix<TUid>*                iViewIds;
+        CMPSettingsMainView*            iMainView;
+        RImplInfoPtrArray               iImplInfoArray;
+
+        CMPSettingsModel*               iModel;
+        CMPSettingsModelForROP*         iRopModel;
+		
+		/**
+		 * Video view availability status.
+		 */
+		TBool iVideoViewAvailable;
+    };
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/inc/MPSettingsConstants.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2002 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:   MediaSetting constants.*
+*/
+
+
+// Version : %version: 4 %
+
+
+
+
+#ifndef MPSETTINGSCONSTANTS_H
+#define MPSETTINGSCONSTANTS_H
+
+// CONSTANTS
+
+// UIDs of views
+
+// Main view
+const TUid KMPSettMainViewId = {1};
+
+// UIDs for views, which are opened from Main view.
+// The UID values have to be in the same order as
+// the views appear in Main view's list, i.e. the
+// first item has to have smallest UID and so forth.
+const TUid KMPSettVideoViewId = {2};
+const TUid KMPSettAudioViewId = {3};
+const TUid KMPSettStreamingViewId = {4};
+
+// UIDs for subviews
+const TUid KMPSettProxyViewId = {11};
+const TUid KMPSettNetworkViewId = {12};
+const TUid KMPSettAdvancedBwViewId = {13};
+
+// App uid for help context
+const TUid KIptvHelpContextUid = {0x102750E2};
+const TUid KGSVideoPluginUid = {0x10275069}; 
+
+// Middle Softkey control ID.
+const TInt KMediaSettingsMSKControlID = 3;
+
+#endif      // MPSETTINGSCONSTANTS_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/inc/MPSettingsDocument.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,93 @@
+/*
+* Copyright (c) 2002 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:   Document class required by AVKON application framework.*
+*/
+
+
+// Version : %version: 5 %
+
+
+
+#ifndef MPSETTINGSDOCUMENT_H
+#define MPSETTINGSDOCUMENT_H
+
+// INCLUDES
+#include    <AknDoc.h>
+   
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+class  CEikAppUi;
+class CMPSettingsModel;
+class CMPMediaPlayerSettings;
+
+// CLASS DECLARATION
+
+/**
+*  CMPSettingsDocument application class.
+*
+*  @lib MediaSettings.app
+*  @since 2.0
+*/
+class CMPSettingsDocument : public CAknDocument
+    {
+    public: // Constructors and destructor
+        /**
+        * Two-phased constructor.
+        */
+        static CMPSettingsDocument* NewL(CEikApplication& aApp);
+
+        /**
+        * Destructor.
+        */
+        virtual ~CMPSettingsDocument();
+
+    public: // New functions
+
+        /**
+        * Returns a MMF controller specific settings model.
+        * @since 2.0
+        * @return MMF controller specific settings model.
+        */
+        CMPSettingsModel* SettingsModel();
+ 
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CMPSettingsDocument(CEikApplication& aApp);
+
+        /**
+        * Symbian 2nd phase constructor.
+        */
+        void ConstructL();
+
+    private:
+
+        /**
+        * From CEikDocument, create CMPSettingsAppUi "App UI" object.
+        */
+        CEikAppUi* CreateAppUiL();
+
+    private: // Data
+        CMPSettingsModel* iRopSettingsModel;
+ 
+     };
+
+#endif
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/inc/MPSettingsMainContainer.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,115 @@
+/*
+* Copyright (c) 2002 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:   Container class for Main view.*
+*/
+
+
+// Version : %version: 3 %
+
+
+
+
+#ifndef CMPSETTINGSMAINCONTAINER_H
+#define CMPSETTINGSMAINCONTAINER_H
+
+// INCLUDES
+#include    "MPSettingsBaseContainer.h"
+   
+// FORWARD DECLARATIONS
+class CEikTextListBox;
+class CAknIconArray;
+
+// CLASS DECLARATION
+
+/**
+*  CMPSettingsMainContainer container control class.
+*
+*  @lib MediaSettings.app
+*  @since 2.0
+*/
+class CMPSettingsMainContainer : public CMPSettingsBaseContainer
+    {
+    public: // Constructors and destructor
+        
+        /**
+        * C++ default constructor.
+        */
+        CMPSettingsMainContainer();
+
+        /**
+        * Destructor.
+        */
+        virtual ~CMPSettingsMainContainer();
+
+    private:    // Functions from base classes
+            
+        /**
+        * From CoeControl
+        */
+        void GetHelpContext(TCoeHelpContext& aContext) const;
+	void FocusChanged(TDrawNow /*aDrawNow*/);
+
+        /**
+        * From CMPSettingsBaseContainer
+        */
+        void ConstructComponentControlsL();
+
+        /**
+        * From CMPSettingsBaseContainer
+        */
+        TInt TitleResourceId();
+
+        /**
+        * From CoeControl
+        */
+        void HandleResourceChange( TInt aType );
+
+    private: // New functions
+
+        /**
+        * Contructs icon array for listbox
+        */
+        void MakeIconArrayL();
+
+        /**
+        * Load a possibly skinned icon (with mask) and append it to an 
+        * icon array.
+        * @since 2.6
+        * @param aArray    Icon array to add the icon to
+        * @param aID       Skin ID for the icon
+        * @param aMbmFile  Full path to MBM file which contains the default icon
+        * @param aBitmapId Id for the default icon in the MBM file
+        * @param aMaskId   Id for the default icon mask in the MBM file
+        */
+        static void AppendIconToArrayL(
+            CAknIconArray* aArray,
+            const TAknsItemID& aID,
+            const TDesC& aMbmFile,
+            TInt aBitmapId,
+            TInt aMaskId );
+        
+        /**
+        * Handles leave in HandleResourceChange method 
+        *
+        * @param aError     Error code
+        */
+        void HandleResourceChangeErrorL( TInt aError );
+        
+    };
+        
+#endif      // CMPSETTINGSMAINCONTAINER_H   
+            
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/inc/MPSettingsMainView.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,128 @@
+/*
+* Copyright (c) 2002 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:  MPSettingsMainView.h*
+*/
+
+
+// Version : %version: 2 %
+
+
+
+
+#ifndef MPSETTINGSMAINVIEW_H
+#define MPSETTINGSMAINVIEW_H
+
+// INCLUDES
+#include    <eikclb.h> //MEikListBoxObserver
+#include    "MPSettingsBaseView.h" //CMPSettingsBaseView
+#include    "MPSettingsModelForROP.h"
+
+// CLASS DECLARATION
+
+/**
+*   CMPSettingsMainView view class.
+*
+*  @lib MediaSettings.app
+*  @since 2.0
+*/
+class CMPSettingsMainView : public CMPSettingsBaseView,
+                            public MEikListBoxObserver
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        */
+        static CMPSettingsMainView* NewLC(CArrayFix<TUid>* aViewIds, CMPSettingsModelForROP* aModel, TBool iConstructAsGsPlugin);
+
+        /**
+        * Destructor.
+        */
+        virtual ~CMPSettingsMainView();
+
+    public: // Functions from base classes
+        
+        /**
+        * From CAknView
+        */
+        TUid Id() const;
+
+        /**
+        * From MEikMenuObserver
+        */
+        void HandleCommandL(TInt aCommand);
+
+    public: // New
+
+        /**
+        * Returns the index of the active folder.
+        * @return 0: video
+        *         1: streaming
+        */
+        TInt ActiveFolder();
+
+        /**
+        * Sets the index of the active folder.
+        * @param aCurrentItem Index of current item.
+        */
+        void SetActiveFolder(TInt aCurrentItem);
+
+    protected: // Functions from base classes
+
+        /**
+        * From MEikListBoxObserver
+        */
+        void HandleListBoxEventL(CEikListBox* aListBox,
+                                 TListBoxEvent aEventType);
+
+        /**
+        * From CMPSettingsBaseView
+        */
+        void DynInitContainerL();
+
+        /**
+        * From CMPSettingsBaseView
+        */
+        CMPSettingsBaseContainer* NewContainerL();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CMPSettingsMainView(CArrayFix<TUid>* aViewIds, CMPSettingsModelForROP* aModel, TBool iConstructAsGsPlugin);
+
+        /**
+        * Symbian 2nd phase constructor.
+        */
+        void ConstructL();
+
+    private: // New 
+
+        /**
+        * Handles listbox selection.
+        */
+        virtual void HandleListBoxSelectionL();
+
+    private: // Data
+        CArrayFix<TUid>* iViewIds;
+        
+        CMPSettingsModelForROP* iModel;
+		TBool	iGsPlugin;
+
+    };
+
+#endif      // MPSETTINGSMAINVIEW_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/inc/MPSettingsNaviPaneController.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,63 @@
+/*
+* Copyright (c) 2002 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:   M-class for NaviPane related callbacks to appui from view classes.*
+*/
+
+
+// Version : %version: 2 %
+
+
+
+
+#ifndef MMPSETTINGSNAVIPANECONTROLLER_H
+#define MMPSETTINGSNAVIPANECONTROLLER_H
+
+// FORWARD DECLARATIONS
+class CAknNavigationControlContainer;
+class CAknNavigationDecorator;
+
+// CLASS DECLARATION
+
+/**
+*  
+*
+*  @lib MediaSettings.app
+*  @since 2.0
+*/
+class MMPSettingsNaviPaneController
+    {
+    public: // New functions
+        
+        /**
+        * Returns pointer to MP's Navi pane object.
+        * @return CAknNavigationControlContainer.
+        */
+        virtual CAknNavigationControlContainer* NaviContainer() const = 0;
+    
+        /**
+        * Returns pointer to MP's tab group object.
+        * @return CAknNavigationDecorator.
+        */
+        virtual CAknNavigationDecorator* MPTabGroup() const = 0;
+
+        /**
+        * Updates tab group according to active view.
+        */
+        virtual void UpdateTabIndex() = 0;
+
+    };
+
+#endif      // MMPSETTINGSNAVIPANECONTROLLER_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/inc/MPSettingsSliderSettingItem.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,86 @@
+/*
+* Copyright (c) 2002 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:   Slider Settings for MPSettingsSliderSettingItem.h*
+*/
+
+
+// Version : %version: 3 %
+
+
+
+
+#ifndef CMPSettingsSliderSettingItem_H
+#define CMPSettingsSliderSettingItem_H
+
+//  INCLUDES
+#include    <aknsettingitemlist.h>
+
+// CLASS DECLARATION
+
+/**
+* CMPSettingsSliderSettingItem class derived from CAknSliderSettingItem.
+*
+* Overwrites functions SettingTextL() and CreateBitmapL() in order to enable displaying
+* textual current value instead of a bitmap in the settings item list. Should not be
+* further derived.
+*
+*  @lib MediaSettings.app
+*  @since 2.0
+*/
+class CMPSettingsSliderSettingItem : public CAknSliderSettingItem
+    {
+    public:
+
+        /**
+        * C++ default constructor.
+        */
+        CMPSettingsSliderSettingItem(TInt aIdentifier, TInt& aExternalSliderValue,
+                                 TInt aResource, TBool aBareFigure = ETrue);
+
+        /**
+        * Destructor.
+        */       
+        virtual ~CMPSettingsSliderSettingItem();
+
+    public:
+
+        /**
+        * From CAknSettingItem, obtains the current value's setting text.
+        * @since 1.0
+        * @return Reference to descriptor with the text.
+        */
+        const TDesC& SettingTextL();
+
+    protected:
+
+        /**
+        * From CAknSliderSettingItem
+        */
+        CAknSettingPage* CreateSettingPageL();
+
+        /**
+        * From CAknSliderSettingItem
+        */
+        CFbsBitmap* CreateBitmapL();
+
+    private:  // Data
+        HBufC* iSettingText;
+        TInt iResource;
+        TBool iBareFigure;
+    };
+
+#endif      // CMPSettingsSliderSettingItem_H   
+            
+// End of File
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/inc/MPSettingsStreamingContainer.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,93 @@
+/*
+* Copyright (c) 2002 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:   Container class for Streaming settings list view.*
+*/
+
+
+// Version : %version: 3 %
+
+
+
+#ifndef MPSETTINGSSTREAMINGCONTAINER_H
+#define MPSETTINGSSTREAMINGCONTAINER_H
+
+// INCLUDES
+#include    "MPSettingsBaseContainer.h"
+ 
+// FORWARD DECLARATIONS
+class CEikTextListBox;
+class CMPSettingsModelForROP;
+class CMPSettingsStreamingSettingItemList;
+
+// CLASS DECLARATION
+/**
+*  CMPSettingsStreamingContainer  container control class.
+*  
+*  @lib MediaSettings.app
+*  @since 2.0
+*/
+class CMPSettingsStreamingContainer : public CMPSettingsBaseContainer
+    {
+    public: // Constructors and destructor
+        
+        /**
+        * C++ default constructor.
+        */
+        CMPSettingsStreamingContainer(CMPSettingsModelForROP* aModel);
+
+        /**
+        * Destructor.
+        */
+        virtual ~CMPSettingsStreamingContainer();
+
+    public: // Functions from base classes
+            
+        /**
+        * From CoeControl
+        */
+        void GetHelpContext(TCoeHelpContext& aContext) const;
+	    void FocusChanged(TDrawNow /*aDrawNow*/);
+   
+        /**
+        * Edits current setting item.
+        * 
+        * @param aMenuOption
+        */
+        void EditCurrentItemFromMenuL(TBool aMenuOption);
+	
+    protected: // Functions from base classes 
+
+        /**
+        * From CMPSettingsBaseContainer
+        */
+        void ConstructComponentControlsL();
+
+    private:  // Functions from base classes
+
+        /**
+        * From CMPSettingsBaseContainer
+        */
+        TInt TitleResourceId();
+        CMPSettingsModelForROP* iModel;
+	
+		/**
+		 * Setting item list.
+	     */
+        CMPSettingsStreamingSettingItemList* iSettingList;
+    
+    };
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/inc/MPSettingsStreamingSettingItemList.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,216 @@
+/*
+* Copyright (c) 2002 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:   Setting item list class for Streaming setting list view.*
+*/
+
+
+// Version : %version: 3 %
+
+
+
+
+#ifndef MPSETTINGSSTREAMINGSETTINGITEMLIST_H
+#define MPSETTINGSSTREAMINGSETTINGITEMLIST_H
+
+//  INCLUDES
+#include <aknsettingitemlist.h>
+
+// FORWARD DECLARATIONS
+class CMPSettingsModelForROP;
+
+// CONSTANTS
+const TInt KMaxApNameLength = 255;
+
+// CLASS DECLARATION
+
+/**
+*  CMPSettingsStreamingSettingItemList
+*  Setting item list class for Streaming setting list view.
+*
+*/
+class CMPSettingsStreamingSettingItemList : public CAknSettingItemList
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * C++ default constructor.
+        */
+        CMPSettingsStreamingSettingItemList(CMPSettingsModelForROP* aModel);
+
+	    /**
+	    * 2nd-stage construction from resource id
+	    */
+	    void ConstructFromResourceL(TInt aResourceId);
+
+        /**
+        * From CCoeControl, 2nd-stage construction from constructed resource reader
+        */
+        void ConstructFromResourceL(TResourceReader& aReader);
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CMPSettingsStreamingSettingItemList();
+
+    public:     // Functions from base classes
+
+        /**
+        * From CAknSettingItemList
+        */
+        void EditItemL(TInt aIndex, TBool aCalledFromMenu);
+
+    protected:  // Functions from base classes
+        
+        /**
+        * From CAknSettingItemList
+        */
+        CAknSettingItem* CreateSettingItemL(TInt aSettingId);
+
+    private: //New
+
+        /**
+        * Sets Proxy host and Proxy port item visibility according to Proxy mode.
+        */
+        void SetItemVisibilityL();
+
+        /**
+        * Loads all setting values.
+        */
+        void LoadAllL();
+
+        /**
+        * Loads a specific setting value.
+        * @param aSettingId ID of the setting to be loaded.
+        */
+        void LoadSettingL(TInt aSettingId);
+
+        /**
+        * Stores a specific setting value.
+        * @param aSettingId ID of the setting to be stored.
+        */
+        void StoreSettingL(TInt aSettingId);
+
+        /**
+        * Launches the platform dialog for the connection selection.
+        */
+        void LaunchConnectionSelectionL();        
+
+        /**
+        * Updates currently selected connection's name to setting item.
+        */
+        void UpdateSelectedConnectionNameL();
+        
+        /**
+        * Sets proxy mode to disabled. 
+        */
+        void CheckProxyDisableL();
+        
+        /**
+         * Gets WAP id from IAP id. Leaves with KErrNotFound if no record with given 
+         * IAP id is found.
+         * 
+		 * @param  aIapId	IAP id.
+         * @return Access point id matching the given IAP id.
+         */
+        TUint32 WapIdFromIapIdL( TUint32 aIapId );
+
+        /**
+         * Gets IAP id from access point id. Leaves with KErrNotFound if no record with given 
+         * access point id is found.
+         * 
+		 * @param  aWapId	Access point id.
+         * @return IAP id matching the given access point id.
+         */
+        TUint32 IapIdFromWapIdL( TUint32 aWapId );        
+        
+    private: // From MEikListBoxObserver
+
+        /**
+         * Event handling section
+         */
+        void HandleListBoxEventL( CEikListBox* aListBox, 
+                                  TListBoxEvent aListBoxEvent );        
+        
+    private:
+        
+        /**
+         * ROP model. Not own. 
+         */
+        CMPSettingsModelForROP* iModel;
+
+        /**
+         * Proxy mode (on/off).
+         */
+        TBool iProxyMode;
+
+        /**
+         * Proxy host. Own.
+         */
+        HBufC* iProxyHost;
+
+        /**
+         * Pointer to Proxy host.
+         */
+        TPtr iProxyHostPtr;
+
+        /**
+         * Proxy port number.
+         */
+        TInt iProxyPort;
+
+        /**
+         * Connection timeout setting value.
+         */
+        TInt iConnTimeout;
+        
+        /**
+         * Server timeout setting value.
+         */
+        TInt iSrvTimeout;
+        
+        /**
+         * Access point id. 
+         */
+        TUint32 iDefaultAP;
+
+        /**
+         * Minimum UDP port number.
+         */
+        TInt iMinUDPPort;
+
+        /**
+         * Maximum UDP port number.
+         */
+        TInt iMaxUDPPort;
+
+        /**
+         * Name of selected access point. Own.
+         */
+        TBuf<KMaxApNameLength> iSelectedApName;
+      
+        /**
+         *  Connection setting item. Not own.
+         */
+        CAknTextSettingItem* iSettingConnectionItem;
+        
+        /**
+         *  Proxy mode item. Not own.
+         */
+        CAknBinaryPopupSettingItem* iSettingProxyItem;
+        
+    };
+
+#endif      // MPSETTINGSSTREAMINGSETTINGITEMLIST_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/inc/MPSettingsStreamingView.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,99 @@
+/*
+* Copyright (c) 2002 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:   Declares view for application.*
+*/
+
+
+// Version : %version: 3 %
+
+
+
+#ifndef MPSETTINGSSTREAMINGVIEW_H
+#define MPSETTINGSSTREAMINGVIEW_H
+
+// INCLUDES
+#include    <eikclb.h> //MEikListBoxObserver
+#include    "MPSettingsBaseView.h" //CMPSettingsBaseView
+
+// CLASS DECLARATION
+class CMPSettingsModelForROP;
+
+/**
+*  CMPSettingsStreamingView view class.
+* 
+*/
+class CMPSettingsStreamingView : public CMPSettingsBaseView 
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CMPSettingsStreamingView* NewLC(CMPSettingsModelForROP* aModel );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CMPSettingsStreamingView();
+
+    public: // Functions from base classes
+        
+        /**
+        * From CAknView
+        */
+        TUid Id() const;
+
+        /**
+        * From MEikMenuObserver
+        */
+        void HandleCommandL(TInt aCommand);
+
+    protected: // from MEikListBoxObserver
+
+ 
+    protected: // From CMPSettingsBaseView
+
+        /**
+        * Called at the end of DoActivateL.
+        */
+        void DynInitContainerL();
+
+        /**
+        * Creates new view specific container class.
+        */
+        CMPSettingsBaseContainer* NewContainerL();
+
+    private:
+        /**
+        * C++ default constructor.
+        */
+        CMPSettingsStreamingView(CMPSettingsModelForROP* aModel );
+
+        /**
+        * Symbian 2nd phase constructor.
+        */
+        void ConstructL();
+
+    private: // New 
+
+        /**
+        * Handles listbox selection.
+        */
+		CMPSettingsModelForROP* iModel;
+
+    };
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/inc/MPSettingsUDPPortSettingItem.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,68 @@
+/*
+* Copyright (c) 2002 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:   MPSettingsUDPPortSettingItem.h*
+*/
+
+
+// Version : %version: 3 %
+
+
+
+
+#ifndef CMPSETTINGSUDPPORTSETTINGITEM_H
+#define CMPSETTINGSUDPPORTSETTINGITEM_H
+
+//  INCLUDES
+#include    <aknsettingitemlist.h>
+
+// CLASS DECLARATION
+
+/**
+*  ?one_line_short_description.
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class CMPSettingsUDPPortSettingItem : public CAknIntegerEdwinSettingItem
+    {
+    public:  // Constructors and destructor
+        
+
+        /**
+        * C++ default constructor.
+        */
+        CMPSettingsUDPPortSettingItem(TInt aIdentifier,
+                                      TInt& aValue,
+                                      TInt& aRefValue);
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CMPSettingsUDPPortSettingItem();
+
+    public: // Functions from base classes
+
+        /**
+        * From CAknIntegerEdwinSettingItem
+        */
+        void EditItemL(TBool aCalledFromMenu);
+
+    private:
+        TInt& iRefValue;
+    };
+
+#endif      // CMPSETTINGSUDPPORTSETTINGITEM_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/inc/MPSettingsVideoContainer.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,103 @@
+/*
+* Copyright (c) 2002 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:   Declares container control for application.*
+*/
+
+
+// Version : %version: 3 %
+
+
+
+#ifndef MPSETTINGSVIDEOCONTAINER_H
+#define MPSETTINGSVIDEOCONTAINER_H
+
+// INCLUDES
+#include    "videoplayersettingsengine.h"
+#include    "MPSettingsBaseContainer.h"
+
+// FORWARD DECLARATIONS
+class CAknSettingItemList;
+class CMPSettingsModelForROP;   
+class CVcxNsSettingsEngine;
+
+// CLASS DECLARATION
+
+/**
+*  CMPSettingsVideoContainer  container control class.
+*  
+*  @lib MediaSettings.app
+*  @since 2.0
+*/
+class CMPSettingsVideoContainer : public CMPSettingsBaseContainer
+    {
+    public: // Constructors and destructor
+        
+        /**
+        * C++ default constructor.
+        */
+        CMPSettingsVideoContainer(CMPSettingsModelForROP* aModel);
+
+        /**
+        * Destructor.
+        */
+        virtual ~CMPSettingsVideoContainer();
+
+    public: // New
+
+        /**
+        * Edits current setting item.
+        * @since 2.0
+        */
+        void EditCurrentItemFromMenuL(TBool iMenuOption);
+        
+        /**
+        * Check if specified item is currently selected.
+		*
+		* @param aIndex		Item index	
+        */
+        TBool IsCurrentItem( TInt aIndex );
+
+    public: // Functions from base classes
+            
+        /**
+        * From CoeControl
+        */
+        void GetHelpContext(TCoeHelpContext& aContext) const;
+		void FocusChanged(TDrawNow /*aDrawNow*/);
+  		void SizeChanged();
+  		void HandleResourceChange(TInt aType);
+  
+    protected: // Functions from base classes 
+
+        /**
+        * From CMPSettingsBaseContainer
+        */
+        void ConstructComponentControlsL();
+
+    private:    // Functions from base classes
+
+        /**
+        * From CMPSettingsBaseContainer
+        */
+        TInt TitleResourceId();
+
+    private:
+        CAknSettingItemList* iSettingList;
+		CMPSettingsModelForROP* iModel; 
+		CVcxNsSettingsEngine* iVideoSettingsEngine;
+    };
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/inc/MPSettingsVideoSettingItemList.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,159 @@
+/*
+* Copyright (c) 2002 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:   Setting item list class for Video settings list view.*
+*/
+
+
+// Version : %version: 7 %
+
+
+
+
+#ifndef MPSETTINGSVIDEOSETTINGITEMLIST_H
+#define MPSETTINGSVIDEOSETTINGITEMLIST_H
+
+//  INCLUDES
+#include <aknsettingitemlist.h>
+
+// CONSTANTS
+
+
+// When video contrast is not drawn, we know to shift the contents
+const TInt KVideoContrastNotSupported ( -99 );
+
+// FORWARD DECLARATIONS
+class CMPSettingsModelForROP;
+class CVcxNsSettingsEngine;
+
+// CLASS DECLARATION
+
+/**
+*  CMPSettingsVideoSettingItemList
+*  Setting item list class for Video settings list view.
+*
+*  @lib MediaSettings.app
+*  @since 2.0
+*/
+class CMPSettingsVideoSettingItemList : public CAknSettingItemList 
+    {
+    public:  // Constructors and destructor
+        
+     /**
+     * Setting listbox's item idexes
+     */
+    typedef enum
+        {
+        EVideoSettingContrast = 0,
+        EVcSettingsViewParentControlIndex,
+        EVcSettingsViewMemoryItemIndex,
+        EVcSettingsViewThumbnailsIndex,
+        EVideoPlayerVersion,
+        EVcSettingsViewIadUpdateItemIndex // non-editable item
+        } TVideoSettingItemIndex;
+        
+        /**
+        * C++ default constructor.
+        */
+        CMPSettingsVideoSettingItemList( CMPSettingsModelForROP* aModel, 
+                                         CVcxNsSettingsEngine& aVideoSettingsEngine );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CMPSettingsVideoSettingItemList();
+
+    public:
+ 
+        /**
+        * Check if specified item is currently selected. 
+		* 
+		* @param aIndex			Item index
+        */
+        TBool IsCurrentItem( TInt aIndex );
+        
+        /**
+         * Check wheter or not the Contrast settings item shold be drawn
+         */
+        TBool VideoContrastIsSupportedL();
+        
+    public:     // Functions from base classes
+
+        /**
+        * From CAknSettingItemList
+        */
+        void EditItemL(TInt aIndex, TBool aCalledFromMenu);
+        
+        /**
+         * Opens current setting item for editing.
+         *
+         * @param aCalledFromMenu ETrue if started from menu.
+         */
+        void EditCurrentItemL( TBool aCalledFromMenu );
+        
+        /**
+        * From CAknSettingItemList
+        */
+        void LoadSettingsL();
+        
+    protected:  // Functions from base classes
+        
+        /**
+        * From CAknSettingItemList
+        */
+        CAknSettingItem* CreateSettingItemL(TInt aSettingId);
+
+    private: //New
+
+        /**
+        * Loads a specific setting value.
+        * @since 2.0
+        * @param aSettingId ID of the setting to be loaded.
+        */
+        void LoadSettingL(TInt aSettingId);
+
+        /**
+        * Stores a specific setting value.
+        * @since 2.0
+        * @param aSettingId ID of the setting to be stored.
+        */
+        void StoreSettingL(TInt aSettingId);
+
+        /**
+        * Loads all setting values.
+        * @since 2.0
+        */
+        void LoadAllL();
+        
+        /**
+         * Event handling section, from MEikListBoxObserver.
+         */
+        void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aListBoxEvent);
+        
+    private:
+		CMPSettingsModelForROP* iModel;
+		CVcxNsSettingsEngine& iVideoSettingsEngine;  // Video settings engine
+		
+	    TInt iSettingTemp; // Dummy setting placeholder for settings sublist items
+	    
+        TInt iVideoContrast;
+        TBool iVideoRepeatMode;
+        TBool iVideoDefaultViewMode;
+        TBool iRockerKeysMode;
+        TBool iRockerKeysSupported;
+		TBool iLandscapeSupportedByDevice;
+    };
+
+#endif      // MPSETTINGSVIDEOSETTINGITEMLIST_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/inc/MPSettingsVideoView.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,102 @@
+/*
+* Copyright (c) 2002 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:   Declares view for application.*
+*/
+
+
+// Version : %version: 3 %
+
+
+
+#ifndef MPSETTINGSVIDEOVIEW_H
+#define MPSETTINGSVIDEOVIEW_H
+
+// INCLUDES
+#include    "MPSettingsBaseView.h"
+
+// FORWARD DECLARATIONS
+class CMPSettingsModelForROP;
+
+// CLASS DECLARATION
+
+/**
+*  CMPSettingsVideoView view class.
+* 
+*  @lib MediaSettings.app
+*  @since 2.0
+*/
+class CMPSettingsVideoView : public CMPSettingsBaseView
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CMPSettingsVideoView* NewLC(CMPSettingsModelForROP* aModel );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CMPSettingsVideoView();
+
+    public: // Functions from base classes
+        
+        /**
+        * From CAknView
+        */
+        TUid Id() const;
+
+        /**
+        * From MEikMenuObserver
+        */
+        void HandleCommandL(TInt aCommand);
+        
+        /**
+        * From MEikMenuObserver
+        */
+        void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); 
+
+    protected: // From CMPSettingsBaseView
+
+        /**
+        * Called at the end of DoActivateL.
+        */
+        void DynInitContainerL();
+
+        /**
+        * Creates new view specific container class.
+        */
+        CMPSettingsBaseContainer* NewContainerL();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CMPSettingsVideoView(CMPSettingsModelForROP* aModel);
+
+        /**
+        * Symbian 2nd phase constructor.
+        */
+        void ConstructL();
+
+    private: //data
+
+        CMPSettingsModelForROP* iModel;
+
+    };
+
+#endif      // MPSETTINGSVIDEOVIEW_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/inc/mediasettings.hrh	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,76 @@
+/*
+* Copyright (c) 2002 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:  This file contains declarations for constants of MediaSettings.*
+*/
+
+
+// Version : %version: 3 %
+
+
+
+#ifndef MEDIASETTINGS_HRH
+#define MEDIASETTINGS_HRH
+
+// DATA TYPES
+
+enum TMediaSettingsCommandIds
+    {
+    EMPSettCmdHelp = 1,
+    EMPSettCmdOpen,
+    EMPSettCmdChange,
+    EMPSettCmdAdvancedSett,
+    EMediaSettingsCmdAppTest,
+    EMPMiddleSoftKeyChange
+    };
+
+enum TMediaSettingsTabViewId
+    {
+    EMPViewVideoTab = 1,
+    EMPViewAudioTab,
+    EMPViewStreamTab,
+    EMPViewFeedsTab
+    };
+
+
+// Setting Item Ids:
+enum TMPSettSettingItemId
+    {
+    EMPSettVideoContrastSettingId = 1,
+    EMPSettProxyModeSettingId,
+    EMPSettProxyHostSettingId,
+    EMPSettProxyPortSettingId,
+    EMPSettDefaultAPSettingId,          // 5
+    EMPSettBandwUsageSettingId,
+    EMPSettConnTimeoutSettingId,
+    EMPSettServerTimeoutSettingId,      
+    EMPSettMinUDPPortSettingId,         
+    EMPSettMaxUDPPortSettingId,         // 10
+    EMPSettAudioRepeatSettingId,
+    EMPSettAudioRandomSettingId,
+    EMPSettGPRSBwSettingId,             
+    EMPSettEGPRSBwSettingId,
+    EMPSettWCDMABwSettingId,            // 15
+    EMPSettWLANBwSettingId,
+    EMPSettHSDPABwSettingId,
+    EMPSettVideoDefaultViewSettingId,   
+    EMPSettVideoRockerKeysSettingId,
+    EVcSettingsviewIadUpdateItem,       // 20
+    EVcSettingsViewThumbnails,
+    EVcSettingsViewParentControlItem,
+    EVcSettingsViewMemoryItem
+    };
+
+#endif      // MEDIASETTINGS_HRH
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/loc/mediasettings.loc	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,348 @@
+/*
+* Copyright (c) 2002 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:  This is a localisation file for MediaSettings*
+*/
+
+
+// Version : %version: 7 %
+
+
+
+
+// LOCALISATION STRINGS
+
+// *** CAPTION strings ***
+
+//d:Application title for the grid view.
+//l:cell_app_pane_t1
+//r:5.2
+//
+#define qtn_mp_settings_short_caption "Video player settings"
+
+//d:Application title for the list view.
+//l:list_single_large_graphic_pane_t1
+//r:5.2
+//
+#define qtn_mp_settings_caption "Video player settings"
+
+//d:Media Settings plugin caption displayed under General Settings.
+//d:Displayed as a list item in general settings under application settings
+//l:list_single_large_graphic_pane_t1
+//r:5.2
+//
+#define qtn_set_folder_media_player "Videos"
+
+
+// ** MAIN view **
+
+//d:Text in Media Settings main view title pane.
+//d: UI Spec sec 14 application settings (p85)
+//l:title_pane_t2/opt9
+//r:5.2
+//
+#define qtn_mp_title_settings "Video player settings"
+
+//d:Text of a list item in main view's folder list.
+//d:Item opens Video settings view.
+//d: UI Spec sec 14 application settings (p85)
+//l:list_single_large_graphic_pane_t1
+//r:5.0
+//
+#define qtn_mp_settings_video "Video"
+
+//d:Text of a list item in main view's folder list.
+//d:Item opens Streaming settings view.
+//d: UI Spec sec 14 application settings (p85)
+//l:list_single_large_graphic_pane_t1
+//r:5.0
+//
+#define qtn_mp_settings_streaming "Streaming"
+
+
+// ** VIDEO view **
+
+//d:Text in Media Settings video view title pane.
+//d: UI Spec sec 14.1 video settings (p86)
+//l:title_pane_t2/opt9
+//r:5.0
+//
+#define qtn_mp_title_sett_video "Video settings"
+
+
+// ** STREAMING view **
+
+//d:Text in Media Settings streaming view title pane.
+//d: UI Spec 14.2 Streaming settings (p89)
+//l:title_pane_t2/opt9
+//r:5.0
+//
+#define qtn_mp_title_sett_stream "Streaming settings"
+
+//d:Text of a list item in s view's folder list.
+//d:Item opens Proxy settings folder.
+//d: UI Spec 14.2 Streaming settings (p89)
+//l:list_single_large_graphic_pane_t1_cp2
+//r:5.0
+//
+#define qtn_mp_setting_stream_proxy "RTSP Proxy"
+
+//d:Text of a list item in Streaming view's folder list.
+//d:Item opens Network settings folder.
+//d: UI Spec 14.2 Streaming settings (p89)
+//l:list_single_large_graphic_pane_t1_cp2
+//r:5.0
+//
+#define qtn_mp_setting_stream_net "Network"
+
+
+// ** PROXY view **
+
+//d:Text in proxy settings view title pane.
+//d: UI Spec 14.2.1 RTSP proxy (p90)
+//l:title_pane_t2/opt9
+//r:5.0
+//
+#define qtn_mp_sett_stream_title_proxy "Proxy"
+
+
+// ** NETWORK view **
+
+//d:Text in network settings view title pane.
+//d: UI Spec 14.2.2 Networking (p91)
+//l:title_pane_t2/opt9
+//r:5.0
+//
+#define qtn_mp_sett_stream_title_net "Network"
+
+
+
+// *** SETTING ITEMS ***
+
+// ** COMMON strings **
+
+// ** VIDEO CONTRAST **
+
+//d:Text of a list item in Video setting list view's list.
+//d:Item opens Video contrast setting page.
+//d:Appears also in the Video contrast setting page's title.
+//d: UI Spec sec 14.1 Video Settings (p87)
+//l:list_setting_pane_t1
+//r:5.0
+//
+#define qtn_mp_setting_video_contrast "Video contrast"
+
+//d:Text in slider control.
+//d:Video contrast setting page.
+//d:Minimum value.
+//d: UI Spec sec 14.1 Video Settings (p87)
+//l:setting_slider_pane_t2
+//r:5.0
+//
+#define qtn_vid_contrast_light "Light"
+
+//d:Text in slider control.
+//d:Video contrast setting page.
+//d:Maximum value.
+//d: UI Spec sec 14.1 Video Settings (p87)
+//l:setting_slider_pane_t2
+//r:5.0
+//
+#define qtn_vid_contrast_dark "Dark"
+
+//d:Text in Video setting list's Video contrast item's current value field.
+//d:Current value field text.
+//d: UI Spec sec 14.1 Video Settings (p87)
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_mp_contrast_value "%N%"
+
+// ** PROXY **
+
+//d:Text of a list item in RTSP Proxy setting list view's list.
+//d:Item opens Proxy mode setting page.
+//d:Appears also in the Proxy setting page's title.
+//d: UI Spec 14.2.1 RTSP proxy (p90)
+//l:list_setting_pane_t1
+//r:5.0
+//
+#define qtn_mp_setting_proxy "Proxy"
+
+//d:Text of a list item in Proxy mode setting page's list.
+//d:Appears also in Proxy settings list's Proxy item's current value field.
+//d:Setting value "Enabled".
+//d: UI Spec 14.2.1 RTSP proxy (p90)
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_mp_sett_proxy_enabled "Enabled"
+
+//d:Text of a list item in Proxy mode setting page's list.
+//d:Appears also in Proxy settings list's Proxy item's current value field.
+//d:Setting value "Disabled".
+//d: UI Spec 14.2.1 RTSP proxy (p90)
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_mp_sett_proxy_disabled "Disabled"
+
+
+// ** PROXY HOST **
+
+//d:Text of a list item in RTSP Proxy setting list view's list.
+//d:Item opens Proxy hostname setting page.
+//d:Appears also in the Proxy hostname setting page's title.
+//d: UI Spec 14.2.1 RTSP proxy (p90)
+//l:list_setting_pane_t1
+//r:5.0
+//
+#define qtn_mp_setting_proxy_host "Proxy hostname"
+
+
+// ** PROXY PORT **
+//d:Text of a list item in RTSP Proxy setting list view's list.
+//d:Item opens Proxy port setting page.
+//d:Appears also in the Proxy port setting page's title.
+//d: UI Spec 14.2.1 RTSP proxy (p91)	
+//l:list_setting_pane_t1
+//r:5.0
+//
+#define qtn_mp_setting_proxy_port "Proxy port"
+
+
+// ** DEFAULT ACCESS POINT **
+
+//d:Text of a list item in Network setting list view's list.
+//d:Item opens Default Access Point setting page.
+//d: UI Spec 14.2.1 RTSP proxy (p91)
+//l:list_setting_pane_t1
+//r:5.0
+//
+#define qtn_mp_setting_default_ap "Default Access Point"
+
+//d:Text of a list item in Auto disconnect time setting page's list.
+//d:Setting value "User defined".
+//d: UI Spec 14.2.2 Networking (p93)
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_mp_sett_autodiscon_user "User defined"
+
+
+// ** UDP PORT **
+
+//d:Text of a list item in Network setting list view's list.
+//d:Item opens Min UDP port setting page.
+//d:Appears also in the Min UDP port setting page's title.
+//d: UI Spec 14.2.2 Networking (p92)
+//l:list_setting_pane_t1
+//r:5.0
+//
+#define qtn_mp_setting_min_udp_port "Min UDP port"
+
+//d:Text of a list item in Network setting list view's list.
+//d:Item opens Max UDP port setting page.
+//d:Appears also in the Max UDP port setting page's title.
+//d: UI Spec 14.2.2 Networking (p92)
+//l:list_setting_pane_t1
+//r:5.0
+//
+#define qtn_mp_setting_max_udp_port "Max UDP port"
+
+
+// ** BEARER SPECIFIC MAX BANDWIDTH **
+
+//d:Text of a list item in Advanced streaming setting list view's list.
+//d:Item opens GPRS bandwidth setting page.
+//d:Appears also in the GPRS bandwidth setting page's title.
+//d: UI Spec 14.2.2 Networking (p93)
+//l:list_setting_pane_t1
+//r:5.0
+//
+#define qtn_mp_gprs_bandwidth "GPRS bandwidth"
+
+//d:Text of a list item in Advanced streaming setting list view's list.
+//d:Item opens EGPRS bandwidth setting page.
+//d:Appears also in the EGPRS bandwidth setting page's title.
+//d: UI Spec 14.2.2 Networking (p93)
+//l:list_setting_pane_t1
+//r:5.0
+//
+#define qtn_mp_egprs_bandwidth "EGPRS bandwidth"
+
+//d:Text of a list item in Advanced streaming setting list view's list.
+//d:Item opens WCDMA bandwidth setting page.
+//d:Appears also in the WCDMA bandwidth setting page's title.
+//d: UI Spec 14.2.2 Networking (p93)
+//l:list_setting_pane_t1
+//r:5.0
+//
+#define qtn_mp_wcdma_bandwidth "WCDMA bandwidth"
+
+//d:Text of a list item in Advanced streaming setting list view's list.
+//d:Item opens WLAN bandwidth setting page.
+//d:Appears also in the WLAN bandwidth setting page's title.
+//d: UI Spec 14.2.2 Networking (p93)
+//l:list_setting_pane_t1
+//r:5.0
+//
+#define qtn_mp_wlan_bandwidth "WLAN bandwidth"
+
+//d:Text of a list item in Advanced streaming setting list view's list.
+//d:Item opens HSDPA bandwidth setting page.
+//d:Appears also in the HSDPA bandwidth setting page's title.
+//d: UI Spec 14.2.2 Networking (p93)
+//l:list_setting_pane_t1
+//r:5.0
+//
+#define qtn_mp_hsdpa_bandwidth "HSDPA bandwidth"
+
+//d:Prompt text in user defined Bandwidth number query.
+//d:Data query.
+//d: UI Spec 14.2.2 Networking (p93)
+//l:popup_query_data_window
+//r:5.0
+//
+#define qtn_mp_header_bw "Bandwidth (Kbps):"
+
+//d:Text of a list item in GPRS/EGPRS/WCDMA bandwidth setting page's list.
+//d:Text in setting list item's current value field.
+//d:GPRS/EGPRS/WCDM bandwidth list item
+//d: UI Spec 14.2.2 Networking (p93)
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_mp_bw_sett_value "%U Kbps"
+
+
+//d:Text of a list item in GPRS/EGPRS/WCDMA/WLAN bandwidth setting page's list.
+//d:Text in setting list item's current value field in Mbps.
+//d:GPRS/EGPRS/WCDM/WLAN bandwidth list item
+//d: UI Spec 14.2.2 Networking (p93)
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_mp_bw_sett_value_mbit "%U Mbps"
+
+
+//d:Command in Options list.
+//d:Opens Advanced settings view.
+//d: UI Spec 14.2.2 Networking (p92)
+//l:list_single_pane_t1_cp2
+//r:5.0
+//
+#define qtn_mp_option_adv_settings "Advanced settings"
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/rom/mediasettings.iby	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2005 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:   MediaSettings ROM resources.*
+*/
+
+
+// Version : %version: 4 %
+
+
+#ifndef __MEDIASETTINGS_IBY__
+#define __MEDIASETTINGS_IBY__
+
+#include <data_caging_paths_for_iby.hrh>
+
+S60_APP_EXE( mediasettings )
+S60_APP_BITMAP( mediasettings )
+S60_UPGRADABLE_APP_REG_RSC( mediasettings )
+
+#endif // __MEDIASETTINGS_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/rom/mediasettingsresources.iby	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2005 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:   MediaSettingsResources ROM resources.*
+*/
+
+
+// Version : %version: 2 %
+
+
+#ifndef __MEDIASETTINGSRESOURCES_IBY__
+#define __MEDIASETTINGSRESOURCES_IBY__
+
+#include <data_caging_paths_for_iby.hrh>
+
+//Resource file(s) for MEDIASETTINGS
+
+S60_APP_RESOURCE(mediasettings)
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/src/MPSettingsAdvancedBwContainer.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,163 @@
+/*
+* Copyright (c) 2002 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:   Container class for Advanced bandwidth setting list view.*
+*/
+
+
+// Version : %version: 8 %
+
+
+
+// INCLUDE FILES
+#include    <aknlists.h>
+#include    <barsread.h>
+#include    <MediaSettings.rsg>
+#include    <csxhelp/iptv.hlp.hrh>
+
+#include    "MPSettingsApp.h"
+#include    "MPSettingsAdvancedBwContainer.h"
+#include    "MPSettingsAdvancedBwSettingItemList.h"
+#include    "MPSettingsConstants.h"
+#include	"mpxlog.h"
+
+class CMPSettingsModelForROP;
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CMPSettingsAdvancedBwContainer::CMPSettingsAdvancedBwContainer
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CMPSettingsAdvancedBwContainer::CMPSettingsAdvancedBwContainer(CMPSettingsModelForROP* aModel) 
+	: iModel( aModel)
+    {
+    MPX_FUNC("#MS# CMPSettingsAdvancedBwContainer::CMPSettingsAdvancedBwContainer()");
+    }
+
+// ---------------------------------------------------------
+// CMPSettingsAdvancedBwContainer::~CMPSettingsAdvancedBwContainer
+// Destructor
+// ---------------------------------------------------------
+//
+CMPSettingsAdvancedBwContainer::~CMPSettingsAdvancedBwContainer()
+    {
+    MPX_FUNC("#MS# CMPSettingsAdvancedBwContainer::~CMPSettingsAdvancedBwContainer()");
+	if (iSettingList) 
+		{
+		delete iSettingList;
+		}
+    }
+
+// ---------------------------------------------------------
+// CMPSettingsAdvancedBwContainer::EditCurrentItemFromMenuL
+// ---------------------------------------------------------
+//
+void CMPSettingsAdvancedBwContainer::EditCurrentItemFromMenuL()
+    {
+    MPX_FUNC("#MS# CMPSettingsAdvancedBwContainer::EditCurrentItemFromMenuL()");
+    TInt index = iListBox->CurrentItemIndex();
+    iSettingList->EditItemL(index, ETrue);
+    }
+
+// ---------------------------------------------------------
+// CMPSettingsAdvancedBwContainer::ConstructComponentControlsL
+// ---------------------------------------------------------
+//
+void CMPSettingsAdvancedBwContainer::ConstructComponentControlsL()
+    {
+    MPX_FUNC("#MS# CMPSettingsAdvancedBwContainer::ConstructComponentControlsL()");
+    iSettingList = new(ELeave) CMPSettingsAdvancedBwSettingItemList(iModel);
+
+    iSettingList->SetContainerWindowL(*this);
+
+    iSettingList->ConstructFromResourceL(R_MPSETT_BEARER_BW_SETTING_ITEM_LIST);
+
+    iComponentControl = iSettingList;
+    iListBox = iSettingList->ListBox();
+    }
+
+// ---------------------------------------------------------
+// CMPSettingsAdvancedBwContainer::TitleResourceId
+// ---------------------------------------------------------
+//
+TInt CMPSettingsAdvancedBwContainer::TitleResourceId()
+    {
+    return R_MPSETT_STREAMING_VIEW_TITLE;
+    }
+
+// ---------------------------------------------------------
+// CMPSettingsAdvancedBwContainer::GetHelpContext
+// ---------------------------------------------------------
+//
+void CMPSettingsAdvancedBwContainer::GetHelpContext(TCoeHelpContext& aContext) const
+    {
+    MPX_FUNC("#MS# CMPSettingsAdvancedBwContainer::GetHelpContext()");
+    aContext.iMajor = KIptvHelpContextUid;
+    aContext.iContext = KIPTV_HLP_SETTINGS;
+    }
+
+// ---------------------------------------------------------
+// CMPSettingsAdvancedBwContainer::FocusChanged
+// ---------------------------------------------------------
+//
+void CMPSettingsAdvancedBwContainer::FocusChanged(TDrawNow /*aDrawNow*/)
+	{
+		if( iListBox)
+        {
+        iListBox->SetFocus( IsFocused() );
+        }
+
+		if( iComponentControl)
+        {
+        iComponentControl->SetFocus( IsFocused() );
+        }
+	}
+
+// ---------------------------------------------------------------------------
+// CMPSettingsAdvancedBwContainer::SizeChanged()
+// Called by framwork when the view size is changed
+// ---------------------------------------------------------------------------
+//
+void CMPSettingsAdvancedBwContainer::SizeChanged()
+    {
+		if (iListBox)
+        {
+        iListBox->SetRect(Rect());
+        }
+
+		if (iComponentControl)
+        {
+        iComponentControl->SetRect(Rect());
+        }
+    }
+    
+// ---------------------------------------------------------
+// CMPSettingsAdvancedBwContainer::HandleResourceChange
+// Handles a resource relative event 
+// ---------------------------------------------------------
+//
+void CMPSettingsAdvancedBwContainer::HandleResourceChange( TInt aType )
+    {
+        MPX_DEBUG2(_L("#MS# CMPSettingsAdvancedBwContainer::HandleResourceChange(0x%X)"),aType);
+		if ( aType == KEikDynamicLayoutVariantSwitch ) //Handle change in layout orientation
+        {
+        TRect mainPaneRect;
+        AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPaneRect );
+        SetRect( mainPaneRect );
+		DrawNow();
+		}
+		CCoeControl::HandleResourceChange( aType );  
+    }
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/src/MPSettingsAdvancedBwSettingItem.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,251 @@
+/*
+* Copyright (c) 2002 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:   CAknSettingItemList compliant setting item class for Advanced bandwidth settings.*
+*/
+
+
+// Version : %version: 8 %
+
+
+
+
+// INCLUDE FILES
+#include    <AknQueryDialog.h>
+#include    <aknradiobuttonsettingpage.h>
+#include    <eikenv.h>
+#include    <MediaSettings.rsg>
+#include    <StringLoader.h>
+#include    <AknUtils.h>
+
+#include    "MPSettingsAdvancedBwSettingItem.h"
+#include	"mpxlog.h"
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CMPSettingsAdvancedBwSettingItem::CMPSettingsAdvancedBwSettingItem
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CMPSettingsAdvancedBwSettingItem::CMPSettingsAdvancedBwSettingItem(
+                                                            TInt aIdentifier,
+                                                            RArray<TInt>& aValueArray,
+                                                            TInt& aValue,
+                                                            TInt& aListValue,
+                                                            TInt aQueryRes) :
+    CAknEnumeratedTextPopupSettingItem(aIdentifier, aListValue),
+    iValueArray(aValueArray),
+    iValue(aValue),
+    iQueryRes(aQueryRes)
+    {
+    MPX_FUNC("#MS# CMPSettingsAdvancedBwSettingItem::CMPSettingsAdvancedBwSettingItem()");
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsAdvancedBwSettingItem::~CMPSettingsAdvancedBwSettingItem
+// Destructor
+// -----------------------------------------------------------------------------
+//
+CMPSettingsAdvancedBwSettingItem::~CMPSettingsAdvancedBwSettingItem()
+    {
+    MPX_FUNC("#MS# CMPSettingsAdvancedBwSettingItem::~CMPSettingsAdvancedBwSettingItem()");
+	if (iSettingText) 
+		{
+		delete iSettingText;
+		}
+
+    if (iEnumTextArray)
+        {
+        iEnumTextArray->ResetAndDestroy();
+        delete iEnumTextArray;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsAdvancedBwSettingItem::SettingTextL
+// -----------------------------------------------------------------------------
+//
+const TDesC& CMPSettingsAdvancedBwSettingItem::SettingTextL()
+    {
+    MPX_FUNC("#MS# CMPSettingsAdvancedBwSettingItem::SettingTextL()");
+    delete iSettingText;
+    iSettingText = NULL;
+
+    iSettingText = CreateValueTextL(iValue);
+
+    return *iSettingText;
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsAdvancedBwSettingItem::EditItemL
+// -----------------------------------------------------------------------------
+//
+void CMPSettingsAdvancedBwSettingItem::EditItemL(TBool aCalledFromMenu)
+    {
+	MPX_DEBUG2(_L("#MS# CMPSettingsAdvancedBwSettingItem::EditItemL(%d)"),aCalledFromMenu);
+    CAknEnumeratedTextPopupSettingItem::EditItemL(aCalledFromMenu);
+
+    TInt count = iValueArray.Count();
+
+    for (TInt index = 0; index < count; ++index)
+        {
+        if (iValueArray[index] == iValue)
+            {
+            SetInternalValue(index);
+            SetSelectedIndex(IndexFromValue(index));
+            break;
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsAdvancedBwSettingItem::CompleteConstructionL
+// -----------------------------------------------------------------------------
+//
+void CMPSettingsAdvancedBwSettingItem::CompleteConstructionL()
+    {
+    MPX_FUNC("#MS# CMPSettingsAdvancedBwSettingItem::CompleteConstructionL()");
+    __ASSERT_DEBUG(!iEnumTextArray, User::Leave(KErrAlreadyExists));
+
+    TInt count = iValueArray.Count();
+    iEnumTextArray = new(ELeave) CArrayPtrFlat<CAknEnumeratedText>(count + 1);
+    CAknEnumeratedText* enumText = NULL;
+    HBufC* text = NULL;
+
+    for (TInt index = 0; index < count; ++index)
+        {
+        text = CreateValueTextL(iValueArray[index]);
+        CleanupStack::PushL(text);
+        enumText = new(ELeave) CAknEnumeratedText(index, text);
+        CleanupStack::Pop(); // text
+        text = NULL;
+        CleanupStack::PushL(enumText);
+        iEnumTextArray->AppendL(enumText);
+        CleanupStack::Pop(); //enumText
+        enumText = NULL;
+        }
+
+    // Append "User defined" to the end of the array
+    text = StringLoader::LoadLC(R_MPSETT_USER_DEFINED);
+    enumText = new(ELeave) CAknEnumeratedText(count, text);
+    CleanupStack::Pop(); // text
+    CleanupStack::PushL(enumText);
+    iEnumTextArray->AppendL(enumText);
+    CleanupStack::Pop(); //enumText                
+
+    // poppedTextArray should be left empty! Magic number: array granularity
+    CArrayPtr<HBufC>* poppedTextArray = new(ELeave) CArrayPtrFlat<HBufC>(1);
+    // The ownership of both arrays is transferred to the base class.
+    SetEnumeratedTextArrays(iEnumTextArray, poppedTextArray);
+    iEnumTextArray = NULL;
+    poppedTextArray = NULL;
+
+    HandleTextArrayUpdateL();
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsAdvancedBwSettingItem::HandleSettingPageEventL
+// -----------------------------------------------------------------------------
+//
+void CMPSettingsAdvancedBwSettingItem::HandleSettingPageEventL(CAknSettingPage* aSettingPage,
+                                                           TAknSettingPageEvent aEventType)
+    {
+    MPX_FUNC("#MS# CMPSettingsAdvancedBwSettingItem::HandleSettingPageEventL()");
+    if (aEventType != EEventSettingCancelled)
+        {
+        CEikListBox* listbox = static_cast<CAknRadioButtonSettingPage*>(aSettingPage)->ListBoxControl();
+    
+        TInt current = listbox->CurrentItemIndex();
+        TInt count = listbox->Model()->NumberOfItems();
+        
+        if ( current == count - 1 )
+            {
+			// Search min and max values to use as limits.
+            TInt min = KMaxTInt;
+            TInt max = 0;
+            for ( TInt i=0; i<iValueArray.Count(); i++ )
+                {
+                if ( iValueArray[i] < min )
+                    {
+                    min = iValueArray[i];
+                    }
+                if ( iValueArray[i] > max )
+                    {
+                    max = iValueArray[i];
+                    }
+                }
+            
+            ShowAdvancedBwQueryL( min, max );
+            }
+        else
+            {
+            iValue = iValueArray[current];
+            }
+        }
+
+    CAknSettingItem::HandleSettingPageEventL(aSettingPage, aEventType);
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsAdvancedBwSettingItem::ShowAdvancedBwQueryL
+// -----------------------------------------------------------------------------
+//
+void CMPSettingsAdvancedBwSettingItem::ShowAdvancedBwQueryL( TInt aMin, TInt aMax )
+    {
+    MPX_FUNC("#MS# CMPSettingsAdvancedBwSettingItem::ShowAdvancedBwQueryL()");
+    TReal value = static_cast<TReal>(iValue) / 1000;
+    CAknFloatingPointQueryDialog* dlg = new (ELeave) CAknFloatingPointQueryDialog(value);
+
+    dlg->PrepareLC( iQueryRes );
+    dlg->SetMinimumAndMaximum( static_cast<TReal>(aMin) / 1000,
+                               static_cast<TReal>(aMax) / 1000 );
+    if ( dlg->RunLD() )
+        {
+        iValue = static_cast<TInt>(value * 1000);
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsAdvancedBwSettingItem::CreateValueTextL
+// -----------------------------------------------------------------------------
+//
+HBufC* CMPSettingsAdvancedBwSettingItem::CreateValueTextL(TInt aValue)
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsAdvancedBwSettingItem::CreateValueTextL(%d)"),aValue);
+    TRealFormat format(10, 2);
+    TBuf<10> valueString;
+    HBufC* convert;
+    TReal value = static_cast<TReal>(aValue) / 1000;
+
+    if (value >= 1000)
+        {
+        User::LeaveIfError(valueString.Num(value/1000, format));
+        convert = StringLoader::LoadL(R_MPSETT_ADVANCED_BW_VALUE_MBIT, valueString);
+        }
+    else
+        {
+        User::LeaveIfError(valueString.Num(value, format));
+        convert = StringLoader::LoadL(R_MPSETT_ADVANCED_BW_VALUE, valueString);
+        }
+
+    TPtr tmp( convert->Des() );
+    AknTextUtils::LanguageSpecificNumberConversion(tmp);
+    MPX_DEBUG2(_L("#MS# CMPSettingsAdvancedBwSettingItem::CreateValueTextL() ret (%S)"),&tmp);
+    return convert;
+
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/src/MPSettingsAdvancedBwSettingItemList.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,277 @@
+/*
+* Copyright (c) 2002 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:   Setting item list class for Advanced bandwidth setting list view.*
+*/
+
+
+// Version : %version: 7 %
+
+
+
+
+// INCLUDE FILES
+#include    <eikappui.h>
+#include    <MediaSettings.rsg>
+#include    <barsread.h>
+#include    <featmgr.h>
+
+#include    "mediasettings.hrh"
+#include    "MPSettingsAdvancedBwSettingItemList.h"
+#include    "MPSettingsAdvancedBwSettingItem.h"
+#include    "MPSettingsModelForROP.h"
+#include	"mpxlog.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CMPSettingsAdvancedBwSettingItemList::CMPSettingsAdvancedBwSettingItemList
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CMPSettingsAdvancedBwSettingItemList::CMPSettingsAdvancedBwSettingItemList(CMPSettingsModelForROP* aModel) 
+	: iModel( aModel)
+    {
+    MPX_FUNC("#MS# CMPSettingsAdvancedBwSettingItemList::CMPSettingsAdvancedBwSettingItemList()");
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsAdvancedBwSettingItemList::ConstructFromResourceL
+// -----------------------------------------------------------------------------
+//
+void CMPSettingsAdvancedBwSettingItemList::ConstructFromResourceL(TInt aResourceId) 
+    {
+	MPX_DEBUG2(_L("#MS# CMPSettingsAdvancedBwSettingItemList::ConstructFromResourceL(0x%X)"),aResourceId);
+	TResourceReader reader;
+	iCoeEnv->CreateResourceReaderLC(reader, aResourceId);
+	ConstructFromResourceL(reader);
+    CleanupStack::PopAndDestroy(); // reader
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsAdvancedBwSettingItemList::ConstructFromResourceL
+// -----------------------------------------------------------------------------
+//
+void CMPSettingsAdvancedBwSettingItemList::ConstructFromResourceL(TResourceReader& aReader) 
+    {
+	MPX_FUNC("#MS# CMPSettingsAdvancedBwSettingItemList::ConstructFromResourceL()");
+    LoadAllL();
+
+    iModel->GetMaxBwPresetsL(iGRPSMaxPresets, EBearerGPRS);    
+    iModel->GetMaxBwPresetsL(iEGRPSMaxPresets, EBearerEGPRS);
+    iModel->GetMaxBwPresetsL(iWCDMAMaxPresets, EBearerWCDMA);
+    iModel->GetMaxBwPresetsL(iWLANMaxPresets, EBearerWLAN);
+    iModel->GetMaxBwPresetsL(iHSDPAMaxPresets, EBearerHSDPA);
+
+    CalculateListPosition(iGPRSBw, iGPRSListValue, iGRPSMaxPresets);
+    CalculateListPosition(iEGPRSBw, iEGPRSListValue, iEGRPSMaxPresets);
+    CalculateListPosition(iWCDMABw, iWCDMAListValue, iWCDMAMaxPresets);
+    CalculateListPosition(iWLANBw, iWLANListValue, iWLANMaxPresets);
+    CalculateListPosition(iHSDPABw, iHSDPAListValue, iHSDPAMaxPresets);
+
+    CAknSettingItemList::ConstructFromResourceL(aReader);
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsAdvancedBwSettingItemList::~CMPSettingsAdvancedBwSettingItemList
+// Destructor
+// -----------------------------------------------------------------------------
+//
+CMPSettingsAdvancedBwSettingItemList::~CMPSettingsAdvancedBwSettingItemList()
+    {
+    MPX_FUNC("#MS# CMPSettingsAdvancedBwSettingItemList::~CMPSettingsAdvancedBwSettingItemList()");
+    iGRPSMaxPresets.Close();
+    iEGRPSMaxPresets.Close();
+    iWCDMAMaxPresets.Close();
+    iWLANMaxPresets.Close();
+    iHSDPAMaxPresets.Close();
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsAdvancedBwSettingItemList::EditItemL
+// -----------------------------------------------------------------------------
+//
+void CMPSettingsAdvancedBwSettingItemList::EditItemL(TInt aIndex, TBool aCalledFromMenu)
+    {
+	MPX_DEBUG3(_L("#MS# CMPSettingsAdvancedBwSettingItemList::EditItemL(%d,%d)"),aIndex,aCalledFromMenu);
+    // Call base class' method
+    CAknSettingItemList::EditItemL(aIndex, aCalledFromMenu);
+
+    // Store setting value to settings model
+    CAknSettingItem* settingItem = SettingItemArray()->At(aIndex);
+    TInt identifier = settingItem->Identifier();
+
+    settingItem->StoreL();   
+    StoreSettingL(identifier);
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsAdvancedBwSettingItemList::CreateSettingItemL
+// -----------------------------------------------------------------------------
+//
+CAknSettingItem* CMPSettingsAdvancedBwSettingItemList::CreateSettingItemL(TInt aSettingId)
+    {   
+	MPX_DEBUG2(_L("#MS# CMPSettingsAdvancedBwSettingItemList::CreateSettingItemL(%d)"),aSettingId);
+    CAknSettingItem* settingItem = NULL;
+
+    switch (aSettingId)
+        {
+        case EMPSettGPRSBwSettingId:
+            settingItem = new(ELeave) CMPSettingsAdvancedBwSettingItem(aSettingId,
+                iGRPSMaxPresets, iGPRSBw, iGPRSListValue, R_MPSETT_GPRS_BW_QUERY);
+            break;
+        case EMPSettEGPRSBwSettingId:
+            if (FeatureManager::FeatureSupported(KFeatureIdEdgeKnowledge))
+                {
+                settingItem = new(ELeave) CMPSettingsAdvancedBwSettingItem(aSettingId,
+                    iEGRPSMaxPresets, iEGPRSBw, iEGPRSListValue, R_MPSETT_EGPRS_BW_QUERY);
+                }
+            break;
+        case EMPSettWCDMABwSettingId:
+            if (FeatureManager::FeatureSupported(KFeatureIdProtocolWcdma)) 
+                {
+                settingItem = new(ELeave) CMPSettingsAdvancedBwSettingItem(aSettingId,
+                    iWCDMAMaxPresets, iWCDMABw, iWCDMAListValue, R_MPSETT_WCDMA_BW_QUERY);
+                }
+            break;
+        case EMPSettWLANBwSettingId:
+            if (FeatureManager::FeatureSupported(KFeatureIdProtocolWlan)) 
+                {
+                settingItem = new(ELeave) CMPSettingsAdvancedBwSettingItem(aSettingId,
+                    iWLANMaxPresets, iWLANBw, iWLANListValue, R_MPSETT_WLAN_BW_QUERY);
+                }
+            break;
+        case EMPSettHSDPABwSettingId:
+            if (FeatureManager::FeatureSupported(KFeatureIdHsxpaSupport)) 
+                {
+                settingItem = new(ELeave) CMPSettingsAdvancedBwSettingItem(aSettingId,
+                    iHSDPAMaxPresets, iHSDPABw, iHSDPAListValue, R_MPSETT_HSDPA_BW_QUERY);
+                }
+            break;
+        default:
+            break;
+        }
+
+    return settingItem;   
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsAdvancedBwSettingItemList::LoadAllL
+// -----------------------------------------------------------------------------
+//
+void CMPSettingsAdvancedBwSettingItemList::LoadAllL()
+    {
+    MPX_FUNC("#MS# CMPSettingsAdvancedBwSettingItemList::LoadAllL()");
+    iModel->LoadSettingsL(EConfigUser);
+    LoadSettingL(EMPSettGPRSBwSettingId);
+    LoadSettingL(EMPSettEGPRSBwSettingId);
+    LoadSettingL(EMPSettWCDMABwSettingId);
+    LoadSettingL(EMPSettWLANBwSettingId);
+    LoadSettingL(EMPSettHSDPABwSettingId);
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsAdvancedBwSettingItemList::LoadSettingL
+// -----------------------------------------------------------------------------
+//
+void CMPSettingsAdvancedBwSettingItemList::LoadSettingL(TInt aSettingId)
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsAdvancedBwSettingItemList::LoadSettingL(%d)"),aSettingId);
+    switch (aSettingId)
+        {
+        case EMPSettGPRSBwSettingId:
+            iModel->GetMaxBandwidth(iGPRSBw, EBearerGPRS);
+            break;
+        case EMPSettEGPRSBwSettingId:
+            iModel->GetMaxBandwidth(iEGPRSBw, EBearerEGPRS);
+            break;
+        case EMPSettWCDMABwSettingId:
+            iModel->GetMaxBandwidth(iWCDMABw, EBearerWCDMA);
+            break;
+        case EMPSettWLANBwSettingId:
+            iModel->GetMaxBandwidth(iWLANBw, EBearerWLAN);
+            break;
+        case EMPSettHSDPABwSettingId:
+            iModel->GetMaxBandwidth(iHSDPABw, EBearerHSDPA);
+            break;
+        default:
+            break;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsAdvancedBwSettingItemList::StoreSettingL
+// -----------------------------------------------------------------------------
+//
+void CMPSettingsAdvancedBwSettingItemList::StoreSettingL(TInt aSettingId)
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsAdvancedBwSettingItemList::StoreSettingL(%d)"),aSettingId);
+
+    switch (aSettingId)
+        {
+        case EMPSettGPRSBwSettingId:
+            {
+            iModel->SetMaxBandwidth(iGPRSBw, EBearerGPRS);
+            break;
+            }
+        case EMPSettEGPRSBwSettingId:
+            {
+            iModel->SetMaxBandwidth(iEGPRSBw, EBearerEGPRS);
+            break;
+            }
+        case EMPSettWCDMABwSettingId:
+            {
+            iModel->SetMaxBandwidth(iWCDMABw, EBearerWCDMA);
+            break;
+            }
+        case EMPSettWLANBwSettingId:
+            {
+            iModel->SetMaxBandwidth(iWLANBw, EBearerWLAN);
+            break;
+            }
+        case EMPSettHSDPABwSettingId:
+            {
+            iModel->SetMaxBandwidth(iHSDPABw, EBearerHSDPA);
+            break;
+            }
+        default:
+            break;
+        }
+    
+    iModel->StoreSettingsL();
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsAdvancedBwSettingItemList::CalculateListPosition
+// -----------------------------------------------------------------------------
+//
+void CMPSettingsAdvancedBwSettingItemList::CalculateListPosition(TInt aValue,
+                                                                 TInt& aListValue,
+                                                                 RArray<TInt>& aArray)
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsAdvancedBwSettingItemList::CalculateListPosition(%d)"),aValue);
+    TInt count = aArray.Count();
+    aListValue = count;
+
+    for (TInt index = 0; index < count; ++index)
+        {
+        if (aArray[index] == aValue)
+            {
+            aListValue = index;
+            break;
+            }
+        }
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/src/MPSettingsAdvancedBwView.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,155 @@
+/*
+* Copyright (c) 2002 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:   View class for Advanced bandwidth settings list view.*
+*/
+
+
+// Version : %version: 8 %
+
+
+
+// INCLUDE FILES
+#include    <aknViewAppUi.h>
+#include    <hlplch.h>             // For HlpLauncher
+#include    <featmgr.h>
+#include    <MediaSettings.rsg>
+
+#include    "mediasettings.hrh"
+#include    "MPSettingsNaviPaneController.h"
+#include    "MPSettingsAdvancedBwView.h"
+#include    "MPSettingsAdvancedBwContainer.h"
+#include    "MPSettingsConstants.h" 
+#include    "mpxlog.h"
+
+class CMPSettingsModelForROP; 
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CMPSettingsAdvancedBwView::CMPSettingsAdvancedBwView
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CMPSettingsAdvancedBwView::CMPSettingsAdvancedBwView( 
+        CMPSettingsModelForROP* aModel,
+        TBool iConstructAsGsPlugin ) 
+    : iModel( aModel), 
+      iGsPlugin(iConstructAsGsPlugin)
+    {
+    MPX_FUNC("#MS# CMPSettingsAdvancedBwView::CMPSettingsAdvancedBwView()");
+    }
+
+// ---------------------------------------------------------
+// CMPSettingsAdvancedBwView::ConstructL
+// Symbian OS two-phased constructor
+// ---------------------------------------------------------
+//
+void CMPSettingsAdvancedBwView::ConstructL()
+    {
+    MPX_FUNC("#MS# CMPSettingsAdvancedBwView::ConstructL()");
+    BaseConstructL(R_MPSETT_ADVANCED_BW_VIEW);
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsAdvancedBwView::NewLC
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CMPSettingsAdvancedBwView* CMPSettingsAdvancedBwView::NewLC(
+        CMPSettingsModelForROP* aModel, 
+        TBool iConstructAsGsPlugin )
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsAdvancedBwView::NewLC(%d)"),iConstructAsGsPlugin);
+    CMPSettingsAdvancedBwView* self = new(ELeave) CMPSettingsAdvancedBwView(aModel,iConstructAsGsPlugin);
+    
+    CleanupStack::PushL(self);
+    self->ConstructL();
+
+    return self;
+    }
+
+// ---------------------------------------------------------
+// CMPSettingsAdvancedBwView::~CMPSettingsAdvancedBwView()
+// Destructor
+// ---------------------------------------------------------
+//
+CMPSettingsAdvancedBwView::~CMPSettingsAdvancedBwView()
+    {
+    MPX_FUNC("#MS# CMPSettingsAdvancedBwView::~CMPSettingsAdvancedBwView()");
+    }
+
+// ---------------------------------------------------------
+// TUid CMPSettingsAdvancedBwView::Id
+// ---------------------------------------------------------
+//
+TUid CMPSettingsAdvancedBwView::Id() const
+    {
+    MPX_FUNC("#MS# CMPSettingsAdvancedBwView::Id()");
+    return KMPSettAdvancedBwViewId;
+    }
+
+// ---------------------------------------------------------
+// CMPSettingsAdvancedBwView::HandleCommandL
+// ---------------------------------------------------------
+//
+void CMPSettingsAdvancedBwView::HandleCommandL(TInt aCommand)
+    {   
+    MPX_DEBUG2(_L("#MS# CMPSettingsAdvancedBwView::HandleCommandL(%d)"),aCommand);
+    switch (aCommand)
+        {
+        case EMPSettCmdChange:
+            static_cast<CMPSettingsAdvancedBwContainer*>(iContainer)->EditCurrentItemFromMenuL();
+            break;
+        case EAknSoftkeyBack:
+            AppUi()->ActivateLocalViewL( KMPSettStreamingViewId );
+            break;
+        case EMPSettCmdHelp:
+            if( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+                {
+                HlpLauncher::LaunchHelpApplicationL(iEikonEnv->WsSession(), AppUi()->AppHelpContextL() );
+                }
+            break;
+        default:
+            AppUi()->HandleCommandL(aCommand);
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CMPSettingsAdvancedBwView::NewContainerL
+// ---------------------------------------------------------------------------
+//
+CMPSettingsBaseContainer* CMPSettingsAdvancedBwView::NewContainerL()
+    {
+    MPX_FUNC("#MS# CMPSettingsAdvancedBwView::NewContainerL()");
+    return new(ELeave) CMPSettingsAdvancedBwContainer(iModel);
+    }  
+
+// ---------------------------------------------------------------------------
+// CMPSettingsAdvancedBwView::SetNaviPaneL
+// Sets Navipane texts.
+// ---------------------------------------------------------------------------
+//
+void CMPSettingsAdvancedBwView::SetNaviPaneL()
+    {
+    MPX_FUNC("#MS# CMPSettingsAdvancedBwView::SetNaviPaneL()");
+    if (!iGsPlugin)
+        {
+        iNaviPaneContext = NULL;
+        CMPSettingsBaseView::SetNaviPaneL();
+        }
+    CMPSettingsBaseView::SetMiddleSoftKeyLabelL(R_MEDIASETTING_MSK_CHANGE,EMPSettCmdChange);
+    }
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/src/MPSettingsApp.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2002 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:   Application class required by AVKON application framework.*
+*/
+
+
+// Version : %version: 2 %
+
+
+
+// INCLUDE FILES
+#include    "MPSettingsApp.h"
+#include    "MPSettingsDocument.h"
+#include	"mpxlog.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CMPSettingsApp::AppDllUid
+// Returns application UID
+// ---------------------------------------------------------
+//
+TUid CMPSettingsApp::AppDllUid() const
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsApp::AppDllUid()"));
+    return KUidMediaSettings;
+    }
+
+   
+// ---------------------------------------------------------
+// CMPSettingsApp::CreateDocumentL
+// Creates CMPSettingsDocument object
+// ---------------------------------------------------------
+//
+CApaDocument* CMPSettingsApp::CreateDocumentL()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsApp::CreateDocumentL()"));
+    return CMPSettingsDocument::NewL(*this);
+    }
+
+// ================= OTHER EXPORTED FUNCTIONS ==============
+
+#include <eikstart.h>
+
+LOCAL_C CApaApplication* NewApplication()
+    {
+    return new CMPSettingsApp;
+    }
+
+GLDEF_C TInt E32Main()
+    {
+    return EikStart::RunApplication(NewApplication);
+    }
+
+// End of File  
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/src/MPSettingsAppUi.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,439 @@
+/*
+* 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 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:   Application UI class required by AVKON application architecture.*
+*/
+
+
+// Version : %version: 12 %
+
+
+
+// INCLUDE FILES
+#include    <MediaSettings.rsg>
+#include    <avkon.hrh>
+#include    <barsread.h>
+#include    <akntabgrp.h>
+#include    <featmgr.h>
+#include    <hlplch.h>
+#include    <StringLoader.h>
+#include    <AknsUtils.h>
+#include    <mediasettings.mbg>
+
+#include    "mediasettings.hrh"
+#include    "MPSettingsAppUi.h"
+#include    "MPSettingsMainView.h"
+#include    "MPSettingsVideoView.h"
+#include    "MPSettingsStreamingView.h"
+#include    "MPSettingsConstants.h"
+#include    "MPSettingsPluginView.h"
+#include    "MPSettingsAdvancedBwView.h"
+#include    "MPSettingsDocument.h"    
+#include    "mpsettingsmodel.h"
+#include    "MPSettingsModelForROP.h"
+#include    "mpxlog.h"
+
+#include    <centralrepository.h>
+#include    "MediaPlayerPrivateCRKeys.h"
+#include    "MediaPlayerVariant.hrh" 
+
+// CONSTANTS
+const TInt KMPSettViewIdArrayGranularity = 2;
+
+// ================= MEMBER FUNCTIONS =======================
+//
+
+// -----------------------------------------------------------------------------
+// CMPSettingsAppUi::CMPSettingsAppUi
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CMPSettingsAppUi::CMPSettingsAppUi()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsAppUi::CMPSettingsAppUi()"));
+    }
+
+// ----------------------------------------------------------
+// CMPSettingsAppUi::ConstructL()
+// Symbian OS default constructor.
+// ----------------------------------------------------------
+//
+void CMPSettingsAppUi::ConstructL() 
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsAppUi::ConstructL()"));
+    // Enable skin support in base construction
+    BaseConstructL( EAknEnableSkin | EAknEnableMSK | EAknSingleClickCompatible ); 
+
+    // Sets up TLS, must be done before FeatureManager is used.
+    FeatureManager::InitializeLibL();   
+
+    iVideoViewAvailable =  VideoContrastIsSupportedL();
+    
+    CMPSettingsDocument* doc = static_cast<CMPSettingsDocument*>( Document() );
+    iModel = doc->SettingsModel();
+    iRopModel = static_cast<CMPSettingsModelForROP*>(iModel);
+
+    // Fetch pointer to the default navi pane control
+    CEikStatusPane* sp = StatusPane();
+    iNaviPane = static_cast<CAknNavigationControlContainer*>
+        (sp->ControlL(TUid::Uid(EEikStatusPaneUidNavi)));
+
+    // Construct navipane tabs 
+    iDecoratedTabGroup = iNaviPane->CreateTabGroupL(this);
+
+    // Construct tabs if we have multiple views
+    if ( iVideoViewAvailable )
+        {
+        AddTabSettingsGroupL();
+        }
+
+    // Create vector which contains view id's for all setting folders. 
+    iViewIds = new(ELeave) CArrayFixFlat<TUid>(KMPSettViewIdArrayGranularity);
+    if ( iVideoViewAvailable )
+        {
+        iViewIds->AppendL( KMPSettVideoViewId );
+        }
+    iViewIds->AppendL( KMPSettStreamingViewId );
+
+    // Create application views
+    CAknView* view;  
+    view = CMPSettingsMainView::NewLC( iViewIds, iRopModel, EFalse );
+    AddViewL(view);      // transfer ownership to CAknViewAppUi
+    CleanupStack::Pop(); // view
+
+    // iMainView is not owned, i.e. it is not deleted in the destructor ->
+    // main view cannot be directly creted to iMainView, as it's against the coding
+    // conventions to place class' pointers to cleanup stack => static_cast.
+    iMainView = static_cast<CMPSettingsMainView*>(view);
+
+    if ( iVideoViewAvailable )
+        {
+        view = CMPSettingsVideoView::NewLC(iRopModel);
+        AddViewL(view);      // transfer ownership to CAknViewAppUi
+        CleanupStack::Pop(); // view
+        }
+    
+    CMPSettingsStreamingView* streamingView = CMPSettingsStreamingView::NewLC(iRopModel);
+    view = streamingView;
+    AddViewL(view);      // transfer ownership to CAknViewAppUi
+    CleanupStack::Pop(); // view 
+
+    view = CMPSettingsAdvancedBwView::NewLC( iRopModel, EFalse );
+    AddViewL(view);      // transfer ownership to CAknViewAppUi
+    CleanupStack::Pop(); // view 
+
+    // Construct plug-in views (if any exists)
+    CMPSettingsPluginView::ListImplementationsL(iImplInfoArray);
+    TInt count = iImplInfoArray.Count();
+
+    if (count > 0)
+        {
+        CMPSettingsPluginView* pluginView = NULL;
+
+        for (TInt ii(0); ii < count; ++ii)
+            {
+            TUid uid = iImplInfoArray[ii]->ImplementationUid();
+            pluginView = CMPSettingsPluginView::NewL(uid);
+            CleanupStack::PushL(pluginView);
+            AddViewL(pluginView);
+            CleanupStack::Pop();    // pluginView
+
+            if (pluginView->OpenedFromMainView())
+                {
+                iViewIds->AppendL(pluginView->Id());
+                }
+            }
+
+        // Sort UID array to rising order
+        TKeyArrayFix sortKey(0, ECmpTUint);
+        User::LeaveIfError(iViewIds->Sort(sortKey));
+        }
+ 
+    if ( iVideoViewAvailable && iMainView )
+        {    
+        SetDefaultViewL(*iMainView);
+        }
+    else if ( streamingView )
+        {
+        SetDefaultViewL(*streamingView);
+        }
+    }
+
+// ----------------------------------------------------
+// CMPSettingsAppUi::~CMPSettingsAppUi
+// Destructor
+// Frees reserved resources
+// ----------------------------------------------------
+//
+CMPSettingsAppUi::~CMPSettingsAppUi()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsAppUi::~CMPSettingsAppUi()"));
+
+    delete iDecoratedTabGroup;
+
+    if (iDoorObserver)
+        {
+        iDoorObserver->NotifyExit(MApaEmbeddedDocObserver::EEmpty);
+        }
+
+    delete iViewIds;
+
+    iImplInfoArray.ResetAndDestroy();
+    FeatureManager::UnInitializeLib();
+    }
+
+// ----------------------------------------------------
+// CMPSettingsAppUi::HandleCommandL
+// ----------------------------------------------------
+//
+void CMPSettingsAppUi::HandleCommandL(TInt aCommand)
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsAppUi::HandleCommandL(%d)"),aCommand);
+    switch (aCommand)
+        {
+        case EEikCmdExit:
+            Exit();
+            break;
+        case EMPSettCmdHelp:
+        case EAknCmdHelp:
+            HlpLauncher::LaunchHelpApplicationL( iEikonEnv->WsSession(), 
+			                                     AppHelpContextL() );
+            break;
+        default:
+            CAknViewAppUi::HandleCommandL(aCommand);
+            break;      
+        }
+    }
+
+// ----------------------------------------------------
+// CMPSettingsAppUi::HandleResourceChangeL
+// ----------------------------------------------------
+//
+void CMPSettingsAppUi::HandleResourceChangeL( TInt aType )
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsAppUi::HandleResourceChangeL(0x%X)"),aType);
+    CAknViewAppUi::HandleResourceChangeL( aType ); 
+ 
+    if( aType == KAknsMessageSkinChange )
+        {
+        AddTabSettingsGroupL();
+        }
+    }
+ 
+// ----------------------------------------------------
+// CMPSettingsAppUi::TabChangedL
+// MAknTabObserver callback for handling tab changed event.
+// ----------------------------------------------------
+//
+void CMPSettingsAppUi::TabChangedL(TInt aIndex)
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsAppUi::TabChangedL(%d)"),aIndex);
+    iMainView->SetActiveFolder(aIndex);
+    ActivateLocalViewL(iViewIds->At(aIndex));
+    }
+
+// ----------------------------------------------------
+// CMPSettingsAppUi::NaviContainer
+// ----------------------------------------------------
+//
+CAknNavigationControlContainer* CMPSettingsAppUi::NaviContainer() const
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsAppUi::NaviContainer()"));
+    return iNaviPane;
+    }
+
+// ----------------------------------------------------
+// CMPSettingsAppUi::MPTabGroup
+// ----------------------------------------------------
+//
+CAknNavigationDecorator* CMPSettingsAppUi::MPTabGroup() const
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsAppUi::MPTabGroup()"));
+    return iDecoratedTabGroup;
+    }
+
+// ----------------------------------------------------
+// CMPSettingsAppUi::UpdateTabIndex
+// Updates tabgroup.
+// ----------------------------------------------------
+//
+void CMPSettingsAppUi::UpdateTabIndex()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsAppUi::UpdateTabIndex()"));
+    if ( iTabGroup )
+        {
+        iTabGroup->SetActiveTabByIndex( iMainView->ActiveFolder() );
+        }
+    }
+
+// ------------------------------------------------------------------------------
+// CMPSettingsAppUi::DynInitMenuPaneL
+//  This function is called by the AVKON framework just before it displays
+//  a menu pane. Its default implementation is empty, and by overriding it,
+//  the application can set the state of menu items dynamically according
+//  to the state of application data.
+// ------------------------------------------------------------------------------
+//
+void CMPSettingsAppUi::DynInitMenuPaneL(
+    TInt /*aResourceId*/,CEikMenuPane* /*aMenuPane*/)
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsAppUi::DynInitMenuPaneL()"));
+    }
+
+// ----------------------------------------------------
+// CMPSettingsAppUi::HandleKeyEventL
+// Forwards key events to tabgroup when appropriate.
+// ----------------------------------------------------
+//
+TKeyResponse CMPSettingsAppUi::HandleKeyEventL(
+    const TKeyEvent& aKeyEvent, TEventCode aType)
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsAppUi::HandleKeyEventL()"));
+    // Check if the event should be handled by iTabGroup
+    if ( !iTabGroup || aType != EEventKey ||  iNaviPane->Top() != iDecoratedTabGroup)
+        {
+        return EKeyWasNotConsumed;
+        }
+
+    return iTabGroup->OfferKeyEventL(aKeyEvent, aType);
+    }
+
+// ----------------------------------------------------
+// CMPSettingsAppUi::AddTabSettingsGroupL()
+// (Re)create tab group with skin support
+// ----------------------------------------------------
+//
+void CMPSettingsAppUi::AddTabSettingsGroupL()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsAppUi::AddTabSettingsGroupL()"));
+    TBool iPushed = EFalse;
+    TFileName fileName;
+
+    // switch view if in tab
+    if(iNaviPane->Top() == iDecoratedTabGroup)
+        {
+        iNaviPane->PushDefaultL();
+        iPushed = ETrue;
+        }
+
+    iTabGroup = static_cast<CAknTabGroup*>
+        (iDecoratedTabGroup->DecoratedControl());
+
+    iTabGroup->SetTabFixedWidthL(KTabWidthWithTwoTabs);
+
+    HBufC* mbmpath = StringLoader::LoadLC(R_MPSETT_ICON_MBM_FILE);
+
+    // This is done to ensure upgraded file is used first. 
+    // If no upgraded file is found, default file in Z: drive will be used.
+    TFindFile find( CCoeEnv::Static()->FsSession() );
+    TInt err = find.FindByDir( *mbmpath, KNullDesC );
+    
+    if ( err )
+        {
+        fileName.Append( *mbmpath );        
+        }
+    else
+        {
+        fileName.Append( find.File() );    
+        }
+
+    // Create skinnable tabs
+    AddTabSettingsL(KAknsIIDQgnPropSetMpVideoTab3,
+        fileName,
+        EMbmMediasettingsQgn_prop_set_mp_video_tab2,
+        EMbmMediasettingsQgn_prop_set_mp_video_tab2_mask,
+        EMPViewVideoTab);
+
+    AddTabSettingsL(KAknsIIDQgnPropSetMpStreamTab3,
+        fileName,
+        EMbmMediasettingsQgn_prop_set_mp_stream_tab2,
+        EMbmMediasettingsQgn_prop_set_mp_stream_tab2_mask,
+        EMPViewStreamTab);
+    
+    CleanupStack::PopAndDestroy();  // mbmpath
+
+    // return to previous view & update correct tab index
+    if (iPushed) 
+        {
+        iNaviPane->PushL(*iDecoratedTabGroup);
+        UpdateTabIndex();
+        }
+    }
+
+// ----------------------------------------------------
+// CMPSettingsAppUi::AddTabSettingsL
+// Adds individual tabs.
+// ----------------------------------------------------
+//
+void CMPSettingsAppUi::AddTabSettingsL(
+    const TAknsItemID& aID,
+    const TDesC& aMbmFile,
+    TInt aBitmapId,
+    TInt aMaskId,
+    TInt aTabId)
+    {
+    
+    MPX_DEBUG1(_L("#MS# CMPSettingsAppUi::AddTabSettingsL()"));
+    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+
+    CFbsBitmap* bitmap = NULL;
+    CFbsBitmap* mask = NULL;
+
+    AknsUtils::CreateIconLC(skin, aID,
+        bitmap, mask, aMbmFile, aBitmapId, aMaskId);
+
+    // delete if exists
+    if(iTabGroup->TabIndexFromId(aTabId) >= 0)
+        {
+        iTabGroup->DeleteTabL(aTabId);
+        }
+
+    iTabGroup->AddTabL(aTabId, bitmap, mask);
+    
+    CleanupStack::Pop(2); // bitmap, mask
+    }
+
+// ----------------------------------------------------
+// CMPSettingsAppUi::ActivateLocalViewL
+// ----------------------------------------------------
+//
+void CMPSettingsAppUi::ActivateLocalViewL( TUid aViewId )
+    {
+    if ( !iVideoViewAvailable && 
+         aViewId == KMPSettMainViewId )
+        {
+        HandleCommandL( EEikCmdExit );
+        }
+    else 
+        {
+        CAknViewAppUi::ActivateLocalViewL( aViewId );
+        }
+    }
+
+// ----------------------------------------------------
+// CMPSettingsAppUi::VideoContrastIsSupportedL
+// ----------------------------------------------------
+//
+TBool CMPSettingsAppUi::VideoContrastIsSupportedL()
+    {
+    TInt flags = 0;
+
+    CRepository* repository = CRepository::NewL( KCRUidMediaPlayerFeatures );
+    repository->Get( KMPLocalVariation, flags );
+    delete repository;
+
+    return ( flags & KMediaPlayerVideoContrast );
+    }
+
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/src/MPSettingsDocument.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,111 @@
+/*
+* 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 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:   Document class required by AVKON application framework.*
+*/
+
+
+// Version : %version: 4 %
+
+
+
+// INCLUDE FILES
+#include    <ecom.h>
+
+#include    "MPSettingsDocument.h"
+#include    "MPSettingsAppUi.h"
+#include    "mpsettingsmodel.h"
+#include    "MPSettEngPluginImplementationUIDs.hrh"
+#include	"mpxlog.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CMPSettingsDocument::CMPSettingsDocument
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CMPSettingsDocument::CMPSettingsDocument(CEikApplication& aApp)
+: CAknDocument(aApp)    
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsDocument::CMPSettingsDocument()"));
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsDocument::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CMPSettingsDocument::ConstructL()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsDocument::ConstructL()"));
+    const TUid KSettingsModelForROPUid = {KMPSettEngImplUidROP};
+    iRopSettingsModel = CMPSettingsModel::NewL(KSettingsModelForROPUid);
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsDocument::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CMPSettingsDocument* CMPSettingsDocument::NewL(
+        CEikApplication& aApp)     // CMPSettingsApp reference
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsDocument::NewL()"));
+    CMPSettingsDocument* self = new(ELeave) CMPSettingsDocument(aApp);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsDocument::~CMPSettingsDocument
+// Destructor.
+// -----------------------------------------------------------------------------
+//
+CMPSettingsDocument::~CMPSettingsDocument()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsDocument::~CMPSettingsDocument()"));
+	if (iRopSettingsModel) 
+		{
+		delete iRopSettingsModel;
+		}
+
+    REComSession::FinalClose();
+    }
+    
+// ----------------------------------------------------
+// CMPSettingsDocument::SettingsModel
+// ----------------------------------------------------
+//
+CMPSettingsModel* CMPSettingsDocument::SettingsModel()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsDocument::SettingsModel()"));
+    return iRopSettingsModel;
+    }
+
+// ----------------------------------------------------
+// CMPSettingsDocument::CreateAppUiL()
+// constructs CMPSettingsAppUi
+// ----------------------------------------------------
+//
+CEikAppUi* CMPSettingsDocument::CreateAppUiL()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsDocument::CreateAppUiL()"));
+    return new(ELeave) CMPSettingsAppUi;
+    }
+
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/src/MPSettingsMainContainer.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,285 @@
+/*
+* Copyright (c) 2002 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:   Container class for Main view.*
+*/
+
+
+// Version : %version: 10 %
+
+
+
+
+// INCLUDE FILES
+#include    <barsread.h>
+#include    <MediaSettings.rsg>
+#include    <aknlists.h>
+#include    <AknIconArray.h>
+#include    <AknsUtils.h>
+#include    <gulicon.h>
+#include    <calslbs.h>
+#include    <eikclbd.h>
+#include    <StringLoader.h>
+#include    <mediasettings.mbg>
+#include    <featmgr.h>
+#include    <aknnotewrappers.h>
+#include    <textresolver.h>
+#include    <AknCommonDialogs.h>
+#include    <csxhelp/iptv.hlp.hrh>
+
+#include    "MPSettingsApp.h"
+#include    "MPSettingsMainContainer.h"
+#include    "MPSettingsConstants.h"
+#include	"mpxlog.h"
+
+// CONSTANTS
+const TInt KIconArrayGranularity = 2;
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CMPSettingsMainContainer::CMPSettingsMainContainer
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CMPSettingsMainContainer::CMPSettingsMainContainer()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsMainContainer::CMPSettingsMainContainer()"));
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsMainContainer::~CMPSettingsMainContainer
+// Destructor
+// -----------------------------------------------------------------------------
+//
+CMPSettingsMainContainer::~CMPSettingsMainContainer()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsMainContainer::~CMPSettingsMainContainer()"));
+	if (iListBox) 
+		{
+		delete iListBox;
+		}
+    }
+
+// ---------------------------------------------------------
+// CMPSettingsMainContainer::ConstructComponentControlsL
+// ---------------------------------------------------------
+//
+void CMPSettingsMainContainer::ConstructComponentControlsL()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsMainContainer::ConstructComponentControlsL()"));
+    // * Create listbox *
+
+    iListBox = new(ELeave) CAknSingleLargeStyleListBox;
+   
+    // Set's iListBox to be contained in this container
+    iListBox->SetContainerWindowL(*this); 
+
+    // Construct from resource
+    TResourceReader rReader;
+    iCoeEnv->Static()->CreateResourceReaderLC(rReader, 
+            R_MPSETT_MAIN_LBX_RESOURCE);
+
+    // Construct's iListBox from resource file
+    iListBox->ConstructFromResourceL(rReader); 
+    CleanupStack::PopAndDestroy(); // rReader
+    
+    iListBox->CreateScrollBarFrameL(ETrue);
+    iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(
+        CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
+
+    MakeIconArrayL();
+
+    iComponentControl = iListBox;
+    }
+
+// ---------------------------------------------------------
+// CMPSettingsMainContainer::HandleResourceChange
+// ---------------------------------------------------------
+//
+void CMPSettingsMainContainer::HandleResourceChange( TInt aType )
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsMainContainer::HandleResourceChange(0x%X)"),aType);
+    CCoeControl::HandleResourceChange( aType );
+ 
+    if( aType == KAknsMessageSkinChange )
+        {
+        TRAPD(err,MakeIconArrayL());
+            
+        if( err )
+            {
+            TRAP_IGNORE( HandleResourceChangeErrorL( err ) );
+            }
+        }
+        else if ( aType == KEikDynamicLayoutVariantSwitch ) //Handle change in layout orientation
+        {
+        TRect mainPaneRect;
+        AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPaneRect );
+        SetRect( mainPaneRect );
+		DrawNow();
+        }
+    }
+
+// ---------------------------------------------------------
+// CMPSettingsMainContainer::HandleResourceChangeErrorL
+// ---------------------------------------------------------
+//
+void CMPSettingsMainContainer::HandleResourceChangeErrorL( TInt aError )
+    {
+    CTextResolver* textresolver = NULL;
+    
+    // TextResolver instance for error resolving.
+    textresolver = CTextResolver::NewL();
+    
+    if ( textresolver )
+        {
+        // Resolve the error text
+        TPtrC text;
+        text.Set(textresolver->ResolveErrorString( aError ));
+    
+        CAknErrorNote* dlg = new (ELeave) CAknErrorNote(ETrue);
+        dlg->ExecuteLD(text);
+
+        delete textresolver;
+        }
+    }
+
+// ---------------------------------------------------------
+// CMPSettingsMainContainer::TitleResourceId
+// ---------------------------------------------------------
+//
+TInt CMPSettingsMainContainer::TitleResourceId()
+    {
+    return R_MPSETT_MAIN_VIEW_TITLE;
+    }
+
+// ---------------------------------------------------------
+// CMPSettingsMainContainer::GetHelpContext
+// ---------------------------------------------------------
+//
+void CMPSettingsMainContainer::GetHelpContext(TCoeHelpContext& aContext) const
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsMainContainer::GetHelpContext()"));
+    aContext.iMajor = KIptvHelpContextUid;
+    aContext.iContext = KIPTV_HLP_SETTINGS;
+    }
+
+// ---------------------------------------------------------
+// CMPSettingsMainContainer::MakeIconArrayL
+// ---------------------------------------------------------
+//
+void CMPSettingsMainContainer::MakeIconArrayL()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsMainContainer::MakeIconArrayL()"));
+
+	TFileName fileName;
+
+    // Construct CAknIconArray for iListBox
+    CEikColumnListBox* listbox = 
+        static_cast<CEikColumnListBox*>( iListBox );
+
+    delete listbox->ItemDrawer()->ColumnData()->IconArray();
+    listbox->ItemDrawer()->ColumnData()->SetIconArray( NULL );
+
+    HBufC* mbmpath = StringLoader::LoadLC( R_MPSETT_ICON_MBM_FILE );
+    
+    // This is done to ensure upgraded file is used first. 
+    // If no upgraded file is found, default file in Z: drive will be used.
+	TFindFile find( CCoeEnv::Static()->FsSession() );
+	TInt err = find.FindByDir( *mbmpath, KNullDesC );
+	
+	if ( err )
+		{
+		fileName.Append( *mbmpath );		
+		}
+	else
+		{
+		fileName.Append( find.File() );    
+		}
+
+    CAknIconArray* icons = 
+        new ( ELeave ) CAknIconArray( KIconArrayGranularity );
+    CleanupStack::PushL( icons );
+
+    AppendIconToArrayL( 
+        icons, 
+        KAknsIIDQgnPropSetMpVideoSub, 
+        fileName, 
+        EMbmMediasettingsQgn_prop_set_mp_video_sub, 
+        EMbmMediasettingsQgn_prop_set_mp_video_sub_mask );
+
+    AppendIconToArrayL(
+        icons, 
+        KAknsIIDQgnPropSetMpStreamSub, 
+		fileName, 
+        EMbmMediasettingsQgn_prop_set_mp_stream_sub, 
+        EMbmMediasettingsQgn_prop_set_mp_stream_sub_mask );
+  
+    
+    CleanupStack::Pop(); // icons
+    CleanupStack::PopAndDestroy(); // mbmpath
+
+    listbox->ItemDrawer()->ColumnData()->SetIconArray( icons );
+
+    }
+
+// ---------------------------------------------------------
+// CMPSettingsMainContainer::AppendIconToArrayL
+// ---------------------------------------------------------
+//
+void CMPSettingsMainContainer::AppendIconToArrayL(
+    CAknIconArray* aArray,
+    const TAknsItemID& aID,
+    const TDesC& aMbmFile,
+    TInt aBitmapId,
+    TInt aMaskId )
+    {
+    
+    MPX_DEBUG1(_L("#MS# CMPSettingsMainContainer::AppendIconToArrayL()"));
+    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+
+    CFbsBitmap* bitmap = NULL;
+    CFbsBitmap* mask = NULL;
+
+    AknsUtils::CreateIconLC( skin, aID,
+        bitmap, mask, aMbmFile, aBitmapId, aMaskId );
+
+    CGulIcon* icon = CGulIcon::NewL( bitmap, mask );
+    icon->SetBitmapsOwnedExternally( EFalse );
+
+    // icon now owns the bitmaps, no need to keep on cleanup stack.
+    CleanupStack::Pop(2); // mask, bitmap
+    bitmap = NULL;
+    mask = NULL;
+
+    CleanupStack::PushL( icon );
+    aArray->AppendL( icon );
+
+    // aArray now owns the icon, no need to delete.
+    CleanupStack::Pop();
+    }
+
+// ---------------------------------------------------------
+// CMPSettingsMainContainer::FocusChanged
+// ---------------------------------------------------------
+//
+void CMPSettingsMainContainer::FocusChanged(TDrawNow /*aDrawNow*/)
+{
+	if( iListBox)
+        {
+        iListBox->SetFocus( IsFocused() );
+        }
+}
+
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/src/MPSettingsMainView.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,221 @@
+/*
+* Copyright (c) 2002 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:   MPSettingsMainView.cpp*
+*/
+
+
+// Version : %version: 8 %
+
+
+
+// INCLUDE FILES
+#include    <avkon.hrh>
+#include    <MediaSettings.rsg>
+#include    <calslbs.h>
+#include    "MPSettingsAppUi.h"
+#include    "MPSettingsMainView.h"
+#include    "MPSettingsMainContainer.h" 
+#include    "mediasettings.hrh"
+#include    "MPSettingsConstants.h"
+#include    "MPSettingsModelForROP.h"
+#include    "mpxlog.h"
+
+// CONSTANTS
+const TInt KMPSettTopItemIndex = 0;
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CMPSettingsMainView::CMPSettingsMainView
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CMPSettingsMainView::CMPSettingsMainView(CArrayFix<TUid>* aViewIds, CMPSettingsModelForROP* aModel, TBool iConstructAsGsPlugin) 
+    : iViewIds(aViewIds), iModel(aModel), iGsPlugin(iConstructAsGsPlugin)
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsMainView::CMPSettingsMainView() iGsPlugin(%d)"),iGsPlugin);
+    }
+
+// ---------------------------------------------------------
+// CMPSettingsMainView::ConstructL
+// Symbian 2nd phase constructor can leave.
+// ---------------------------------------------------------
+//
+void CMPSettingsMainView::ConstructL()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsMainView::ConstructL()"));
+    BaseConstructL(R_MPSETT_MAIN_VIEW);
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsMainView::NewLC
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CMPSettingsMainView* CMPSettingsMainView::NewLC(CArrayFix<TUid>* aViewIds, CMPSettingsModelForROP* aModel, TBool iConstructAsGsPlugin)
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsMainView::NewLC()"));
+    CMPSettingsMainView* self = new(ELeave) CMPSettingsMainView(aViewIds,aModel,iConstructAsGsPlugin);
+    
+    CleanupStack::PushL(self);
+    self->ConstructL();
+
+    return self;
+    }
+
+// ---------------------------------------------------------
+// CMPSettingsMainView::~CMPSettingsMainView
+// ---------------------------------------------------------
+//
+CMPSettingsMainView::~CMPSettingsMainView()
+    {   
+    MPX_DEBUG1(_L("#MS# CMPSettingsMainView::~CMPSettingsMainView()"));
+    }
+
+// ---------------------------------------------------------
+// TUid CMPSettingsMainView::Id
+// ---------------------------------------------------------
+//
+TUid CMPSettingsMainView::Id() const
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsMainView::Id()"));
+    return KMPSettMainViewId;
+    }
+
+// ---------------------------------------------------------
+// CMPSettingsMainView::HandleCommandL
+// ---------------------------------------------------------
+//
+void CMPSettingsMainView::HandleCommandL(TInt aCommand)
+    {   
+    MPX_DEBUG2(_L("#MS# CMPSettingsMainView::HandleCommandL(%d)"),aCommand);
+    switch (aCommand)
+        {
+        case EMPSettCmdOpen:
+            HandleListBoxSelectionL();
+            break;
+        case EAknSoftkeyBack:
+            if ( iGsPlugin )
+                {
+                AppUi()->ActivateLocalViewL( KGSVideoPluginUid );       
+                }
+            else
+                {
+                AppUi()->HandleCommandL(EEikCmdExit);
+                }
+            break;
+        default:
+            AppUi()->HandleCommandL(aCommand);
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CMPSettingsMainView::NewContainerL
+// ---------------------------------------------------------------------------
+//
+CMPSettingsBaseContainer* CMPSettingsMainView::NewContainerL()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsMainView::NewContainerL()"));
+    return new(ELeave) CMPSettingsMainContainer;
+    }  
+
+// ---------------------------------------------------------------------------
+// CMPSettingsMainView::ActiveFolder
+// ---------------------------------------------------------------------------
+//
+TInt CMPSettingsMainView::ActiveFolder()
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsMainView::ActiveFolder() ret %d"),iCurrentItem);
+    return iCurrentItem;
+    }
+
+// ---------------------------------------------------------------------------
+// CMPSettingsMainView::SetActiveFolder
+// ---------------------------------------------------------------------------
+//
+void CMPSettingsMainView::SetActiveFolder(TInt aCurrentItem)
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsMainView::SetActiveFolder(%d)"),aCurrentItem);
+    iCurrentItem = aCurrentItem;
+    }
+
+// ---------------------------------------------------------------------------
+// CMPSettingsMainView::HandleListBoxEventL
+// ---------------------------------------------------------------------------
+//
+void CMPSettingsMainView::HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aEventType)
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsMainView::HandleListBoxEventL(0x%X)"),aEventType);
+    switch (aEventType)
+        {
+        case EEventEnterKeyPressed:
+        case EEventItemSingleClicked:
+        case EEventItemDoubleClicked:
+            HandleListBoxSelectionL();
+            break;
+        default:
+           break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CMPSettingsMainView::DynInitContainerL
+// ---------------------------------------------------------------------------
+//
+void CMPSettingsMainView::DynInitContainerL()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsMainView::DynInitContainerL()"));
+    CEikTextListBox* listbox = iContainer->ListBox();
+
+    listbox->SetListBoxObserver(this);
+    listbox->SetTopItemIndex(iTopItemIndex);
+
+    if (iCurrentItem >= 0 && iCurrentItem < listbox->Model()->NumberOfItems())
+        {
+        listbox->SetCurrentItemIndexAndDraw(iCurrentItem);
+        }
+    CMPSettingsBaseView::SetMiddleSoftKeyLabelL(R_MEDIASETTING_MSK_OPEN,EMPSettCmdOpen);
+    }
+
+// ---------------------------------------------------------------------------
+// CMPSettingsMainView::HandleListBoxSelectionL()
+// Handles listbox selection.
+// ---------------------------------------------------------------------------
+//
+void CMPSettingsMainView::HandleListBoxSelectionL() 
+    {
+    iCurrentItem = iContainer->ListBox()->CurrentItemIndex();
+    iTopItemIndex = iContainer->ListBox()->TopItemIndex();
+    MPX_DEBUG3(_L("#MS# CMPSettingsMainView::HandleListBoxSelectionL() iCurrentItem(%d,%d)"),iCurrentItem,iTopItemIndex);
+    
+    CMPSettingsBaseView* view = NULL;
+    TInt count = iViewIds->Count();
+
+    for (TInt i = 0; i < count; i++)
+        {
+        view = static_cast<CMPSettingsBaseView*>(AppUi()->View(iViewIds->At(i)));
+        view->SetCurrentItem(KMPSettTopItemIndex);
+        }
+
+    if ( iCurrentItem < count )
+        {
+        AppUi()->ActivateLocalViewL(iViewIds->At(iCurrentItem));
+        }
+    }
+
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/src/MPSettingsSliderSettingItem.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,152 @@
+/*
+* Copyright (c) 2002 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:   CAknSettingItemList compliant setting item class for slider settings.*
+*/
+
+
+// Version : %version: 6 %
+
+
+
+
+// INCLUDE FILES
+#include    <aknslider.h>
+#include    <StringLoader.h>
+#include    <aknslidersettingpage.h>
+#include    <MediaSettings.rsg>
+#include    <barsread.h>
+
+#include    "MPSettingsSliderSettingItem.h"
+#include	"mpxlog.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CMPSettingsSliderSettingItem::CMPSettingsSliderSettingItem
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CMPSettingsSliderSettingItem::CMPSettingsSliderSettingItem(TInt aIdentifier,
+    TInt& aExternalSliderValue, TInt aResource, TBool aBareFigure) :
+        CAknSliderSettingItem(aIdentifier, aExternalSliderValue),
+        iResource(aResource),
+        iBareFigure(aBareFigure)
+    {
+    MPX_FUNC("#MS# CMPSettingsSliderSettingItem::CMPSettingsSliderSettingItem()");
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsSliderSettingItem::~CMPSettingsSliderSettingItem
+// Destructor
+// -----------------------------------------------------------------------------
+//
+CMPSettingsSliderSettingItem::~CMPSettingsSliderSettingItem()
+    {
+    MPX_FUNC("#MS# CMPSettingsSliderSettingItem::~CMPSettingsSliderSettingItem()");
+	if (iSettingText) 
+		{
+		delete iSettingText;
+		}
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsSliderSettingItem::SettingTextL
+// -----------------------------------------------------------------------------
+//
+const TDesC& CMPSettingsSliderSettingItem::SettingTextL()
+    {
+    delete iSettingText;
+    iSettingText = NULL;
+
+    if (iBareFigure)
+        {
+        iSettingText = CAknSlider::CreateValueTextInHBufCL(InternalSliderValue(),
+                                                           iResource);
+        }
+    else 
+        {
+        iSettingText = StringLoader::LoadL(iResource, InternalSliderValue());
+        }
+
+	TPtr text = iSettingText->Des();
+   	AknTextUtils::LanguageSpecificNumberConversion(text);
+	MPX_DEBUG2(_L("#MS# CMPSettingsSliderSettingItem::SettingTextL(%S)"),&text);
+    return *iSettingText;
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsSliderSettingItem::CreateSettingPageL
+// -----------------------------------------------------------------------------
+//
+CAknSettingPage* CMPSettingsSliderSettingItem::CreateSettingPageL()
+    {
+    MPX_FUNC("#MS# CMPSettingsSliderSettingItem::CreateSettingPageL()");
+    CAknSliderSettingPage* settingPage = 
+        static_cast<CAknSliderSettingPage*>(CAknSliderSettingItem::CreateSettingPageL());
+    CleanupStack::PushL(settingPage);
+
+    if (iBareFigure && AknTextUtils::DigitModeQuery())
+        {
+        settingPage->ConstructL();
+        CAknSlider* slider = settingPage->SliderControl();
+        
+        // Read unnecessary SLIDER resource struct members
+        TResourceReader reader;
+        CCoeEnv::Static()->CreateResourceReaderLC(reader, iResource);
+
+        for (TInt ii = 0; ii < 6; ++ii)
+            {
+            reader.ReadInt16(); // layout, minvalue, maxvalue, step, valuetype, decimalplaces
+            }
+        
+        HBufC* buf = reader.ReadHBufCL(); // singular_valuelabel
+        delete buf;
+        buf = NULL;
+        
+        // Read minlabel from resource file
+        buf = reader.ReadHBufCL(); // minlabel
+        CleanupStack::PushL(buf);
+        TPtr ptr = buf->Des();
+        AknTextUtils::DisplayTextLanguageSpecificNumberConversion(ptr);
+        MPX_DEBUG2(_L("#MS# CMPSettingsSliderSettingItem::CreateSettingPageL() min(%S)"),&ptr);
+        slider->SetMinimumTextL(*buf);
+        CleanupStack::PopAndDestroy(); // buf
+        buf = NULL;
+        
+        // Read maxlabel from resource file
+        buf = reader.ReadHBufCL(); // maxlabel
+        CleanupStack::PushL(buf);
+        ptr.Set(buf->Des());
+        AknTextUtils::DisplayTextLanguageSpecificNumberConversion(ptr);
+        MPX_DEBUG2(_L("#MS# CMPSettingsSliderSettingItem::CreateSettingPageL() max(%S)"),&ptr);
+        slider->SetMaximumTextL(*buf);
+        CleanupStack::PopAndDestroy(2); // buf & reader
+        }
+
+    CleanupStack::Pop(); // settingPage
+    return settingPage;
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsSliderSettingItem::CreateBitmapL
+// -----------------------------------------------------------------------------
+//
+CFbsBitmap* CMPSettingsSliderSettingItem::CreateBitmapL()
+    {
+    MPX_FUNC("#MS# CMPSettingsSliderSettingItem::CreateBitmapL()");
+    return NULL;
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/src/MPSettingsStreamingContainer.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,123 @@
+/*
+* Copyright (c) 2002 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:   Container class for Streaming settings list view.*
+*/
+
+
+// Version : %version: 8 %
+
+
+
+// INCLUDE FILES
+#include    <aknlists.h>
+#include    <barsread.h>
+#include    <MediaSettings.rsg>
+#include    <csxhelp/iptv.hlp.hrh>
+
+#include    "MPSettingsApp.h"
+#include    "MPSettingsStreamingContainer.h"
+#include    "MPSettingsStreamingSettingItemList.h"
+#include    "MPSettingsConstants.h"
+#include	"mpxlog.h"
+
+class CMPSettingsModelForROP;
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CMPSettingsStreamingContainer::CMPSettingsStreamingContainer
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CMPSettingsStreamingContainer::CMPSettingsStreamingContainer(CMPSettingsModelForROP* aModel) : iModel( aModel)
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsStreamingContainer::CMPSettingsStreamingContainer()"));
+    }
+
+// ---------------------------------------------------------
+// CMPSettingsStreamingContainer::~CMPSettingsStreamingContainer
+// Destructor
+// ---------------------------------------------------------
+//
+CMPSettingsStreamingContainer::~CMPSettingsStreamingContainer()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsStreamingContainer::~CMPSettingsStreamingContainer()"));
+
+    delete iSettingList;
+    }
+
+// ---------------------------------------------------------
+// CMPSettingsStreamingContainer::ConstructComponentControlsL
+// ---------------------------------------------------------
+//
+void CMPSettingsStreamingContainer::ConstructComponentControlsL()
+    {
+    MPX_FUNC("#MS# CMPSettingsStreamingContainer::ConstructComponentControlsL()");
+    
+    iSettingList = new(ELeave) CMPSettingsStreamingSettingItemList( iModel );
+    iSettingList->SetContainerWindowL( *this );
+    iSettingList->ConstructFromResourceL( R_MPSETT_STREAMING_SETTING_ITEM_LIST );
+
+    iComponentControl = iSettingList;
+    iListBox = iSettingList->ListBox();
+    }
+
+// ---------------------------------------------------------
+// CMPSettingsStreamingContainer::TitleResourceId
+// ---------------------------------------------------------
+//
+TInt CMPSettingsStreamingContainer::TitleResourceId()
+    {
+    return R_MPSETT_STREAMING_VIEW_TITLE;
+    }
+
+// ---------------------------------------------------------
+// CMPSettingsStreamingContainer::GetHelpContext
+// ---------------------------------------------------------
+//
+void CMPSettingsStreamingContainer::GetHelpContext(TCoeHelpContext& aContext) const
+    {
+    MPX_FUNC("#MS# CMPSettingsStreamingContainer::GetHelpContext()");
+    aContext.iMajor = KIptvHelpContextUid;
+    aContext.iContext = KIPTV_HLP_SETTINGS;
+    }
+
+// ---------------------------------------------------------
+// CMPSettingsStreamingContainer::FocusChanged
+// ---------------------------------------------------------
+//
+void CMPSettingsStreamingContainer::FocusChanged(TDrawNow /*aDrawNow*/)
+    {
+	if( iListBox)
+        {
+        iListBox->SetFocus( IsFocused() );
+        }
+
+	if( iComponentControl)
+        {
+        iComponentControl->SetFocus( IsFocused() );
+        }
+    }
+
+// ---------------------------------------------------------
+// CMPSettingsStreamingContainer::EditCurrentItemFromMenuL
+// ---------------------------------------------------------
+//
+void CMPSettingsStreamingContainer::EditCurrentItemFromMenuL(TBool iMenuOption)
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsProxyContainer::EditCurrentItemFromMenuL(%d)"),iMenuOption);
+    TInt index = iListBox->CurrentItemIndex();
+    iSettingList->EditItemL(index, iMenuOption);
+    }
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/src/MPSettingsStreamingSettingItemList.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,557 @@
+/*
+* Copyright (c) 2002 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: 
+*
+*/
+
+
+// Version : %version: 4 %
+
+
+
+
+// INCLUDE FILES
+#include <eikappui.h>
+#include <akntextsettingpage.h>
+#include <barsread.h>
+
+#include <cmmanagerext.h>
+#include <cmdestinationext.h>
+#include <cmapplicationsettingsui.h>
+
+#include <commdb.h>             // CMDBSession
+#include <commsdattypesv1_1.h>  // CCDWAPIPBearerRecord
+
+#include "mediasettings.hrh"
+#include "MPSettingsStreamingSettingItemList.h"
+#include "MPSettingsUDPPortSettingItem.h"
+#include "MPSettingsModelForROP.h"
+#include "mpxlog.h"
+
+// CONSTANTS
+const TInt KMPSettProxyHostListItemId  = 4;
+const TInt KMPSettProxyPortListItemId  = 5;
+const TInt KMPSettProxyHostMaxLength   = 1000;
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CMPSettingsStreamingSettingItemList::CMPSettingsStreamingSettingItemList
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CMPSettingsStreamingSettingItemList::CMPSettingsStreamingSettingItemList(
+        CMPSettingsModelForROP* aModel ) 
+	: iModel( aModel), 
+	  iProxyHostPtr(NULL, 0)
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsStreamingSettingItemList::CMPSettingsStreamingSettingItemList()"));
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsStreamingSettingItemList::ConstructFromResourceL
+// -----------------------------------------------------------------------------
+//
+void CMPSettingsStreamingSettingItemList::ConstructFromResourceL(TInt aResourceId) 
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsStreamingSettingItemList::ConstructFromResourceL(0x%X)"),aResourceId);
+	TResourceReader reader;
+	iCoeEnv->CreateResourceReaderLC(reader, aResourceId);
+	ConstructFromResourceL(reader);
+    CleanupStack::PopAndDestroy(); // reader
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsStreamingSettingItemList::ConstructFromResourceL
+// -----------------------------------------------------------------------------
+//
+void CMPSettingsStreamingSettingItemList::ConstructFromResourceL(TResourceReader& aReader) 
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsStreamingSettingItemList::ConstructFromResourceL()"));
+    LoadAllL();
+    CAknSettingItemList::ConstructFromResourceL(aReader);
+    SetItemVisibilityL();
+    }
+  
+// -----------------------------------------------------------------------------
+// CMPSettingsStreamingSettingItemList::~CMPSettingsStreamingSettingItemList
+// Destructor
+// -----------------------------------------------------------------------------
+//
+CMPSettingsStreamingSettingItemList::~CMPSettingsStreamingSettingItemList()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsStreamingSettingItemList::~CMPSettingsStreamingSettingItemList()"));
+	
+    delete iProxyHost;
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsStreamingSettingItemList::EditItemL
+// -----------------------------------------------------------------------------
+//
+void CMPSettingsStreamingSettingItemList::EditItemL(TInt aIndex, TBool aCalledFromMenu)
+    {
+    MPX_DEBUG3(_L("#MS# CMPSettingsStreamingSettingItemList::EditItemL(%d,%d)"),aIndex,aCalledFromMenu);
+    CAknSettingItem* settingItem = SettingItemArray()->At(aIndex);
+    TInt identifier = settingItem->Identifier();
+
+    if ( identifier == EMPSettDefaultAPSettingId )
+        {
+        LaunchConnectionSelectionL();
+        }
+    else
+        {
+        // Call base call's method
+        CAknSettingItemList::EditItemL(aIndex, aCalledFromMenu);
+        }
+
+    // Store setting value to settings model
+    settingItem->StoreL();   
+    StoreSettingL(identifier);
+
+    // Hide/unhide Proxy port & Proxy host settings according to Proxy mode.
+    if (identifier == EMPSettProxyModeSettingId ||
+        identifier == EMPSettDefaultAPSettingId )
+        {
+        SetItemVisibilityL();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsStreamingSettingItemList::CreateSettingItemL
+// -----------------------------------------------------------------------------
+//
+CAknSettingItem* CMPSettingsStreamingSettingItemList::CreateSettingItemL(TInt aSettingId)
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsStreamingSettingItemList::CreateSettingItemL(%d)"),aSettingId);
+    __ASSERT_DEBUG(iProxyHost, User::Leave(KErrAbort));
+
+    CAknSettingItem* settingItem  = NULL;
+
+    switch ( aSettingId )
+        {
+        case EMPSettProxyModeSettingId:
+            iSettingProxyItem = new(ELeave) CAknBinaryPopupSettingItem( aSettingId, 
+                                                                        iProxyMode );
+            settingItem = iSettingProxyItem; 
+            break;
+        
+        case EMPSettProxyHostSettingId:
+            {
+            settingItem = new(ELeave) CAknTextSettingItem(aSettingId, iProxyHostPtr);
+            settingItem->SetSettingPageFlags(CAknTextSettingPage::EZeroLengthAllowed);
+            break;
+            }
+        
+        case EMPSettProxyPortSettingId:
+            settingItem = new(ELeave) CAknIntegerEdwinSettingItem(aSettingId, iProxyPort);
+            break;            
+        
+        case EMPSettDefaultAPSettingId:        
+            iSettingConnectionItem = new (ELeave) CAknTextSettingItem( aSettingId, 
+                                                                       iSelectedApName );
+            settingItem = iSettingConnectionItem;
+            break;
+
+        case EMPSettMinUDPPortSettingId:
+            settingItem = new(ELeave) CMPSettingsUDPPortSettingItem( aSettingId, 
+                                                                     iMinUDPPort, 
+                                                                     iMaxUDPPort);
+            break;            
+
+        case EMPSettMaxUDPPortSettingId:
+            settingItem = new(ELeave) CMPSettingsUDPPortSettingItem( aSettingId, 
+                                                                     iMaxUDPPort,
+                                                                     iMinUDPPort);
+            break;            
+            
+        default:
+            break;
+        }
+
+    return settingItem;   
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsStreamingSettingItemList::SetItemVisibilityL
+// -----------------------------------------------------------------------------
+//
+void CMPSettingsStreamingSettingItemList::SetItemVisibilityL()
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsStreamingSettingItemList::SetItemVisibilityL() iProxyMode(%d)"),iProxyMode);
+    SettingItemArray()->At(KMPSettProxyHostListItemId)->SetHidden( !iProxyMode );
+    SettingItemArray()->At(KMPSettProxyPortListItemId)->SetHidden( !iProxyMode );
+
+    HandleChangeInItemArrayOrVisibilityL();
+    
+    if ( ListBox() )
+       {
+       // Scrollbar update is required for the case when items are set hidden
+       // while list is scrolled down.
+       ListBox()->UpdateScrollBarsL();
+       }
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsStreamingSettingItemList::LoadAllL
+// -----------------------------------------------------------------------------
+//
+void CMPSettingsStreamingSettingItemList::LoadAllL()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsStreamingSettingItemList::LoadAllL()"));
+    iModel->LoadSettingsL(EConfigUser);
+    LoadSettingL(EMPSettProxyModeSettingId);
+    LoadSettingL(EMPSettProxyHostSettingId);
+    LoadSettingL(EMPSettProxyPortSettingId);
+    LoadSettingL(EMPSettDefaultAPSettingId);
+    LoadSettingL(EMPSettMinUDPPortSettingId);
+    LoadSettingL(EMPSettMaxUDPPortSettingId);
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsStreamingSettingItemList::LoadSettingL
+// -----------------------------------------------------------------------------
+//
+void CMPSettingsStreamingSettingItemList::LoadSettingL(TInt aSettingId)
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsStreamingSettingItemList::LoadSettingL(%d)"),aSettingId);
+    switch ( aSettingId )
+        {
+        case EMPSettDefaultAPSettingId:
+            {
+            TUint32 wapID = 0;
+            iModel->GetDefaultAp( wapID ); 
+            TRAPD( err, iDefaultAP = static_cast<TInt>( IapIdFromWapIdL( wapID ) ) );
+            if ( err )
+                {
+                iDefaultAP = 0;
+                }
+            
+            if ( iDefaultAP != 0 ) 
+                {
+                UpdateSelectedConnectionNameL();
+                }
+            }
+            break;
+
+        case EMPSettConnTimeoutSettingId:
+            iModel->GetConnectionTimeout(iConnTimeout);
+            break;
+
+        case EMPSettServerTimeoutSettingId:
+            iModel->GetServerTimeout(iSrvTimeout);
+            break;
+
+        case EMPSettMinUDPPortSettingId:
+            iModel->GetMinUDPPort(iMinUDPPort);
+            break;
+
+        case EMPSettMaxUDPPortSettingId:
+            iModel->GetMaxUDPPort(iMaxUDPPort);
+            break;
+        
+        case EMPSettProxyModeSettingId:
+            iModel->GetProxyMode(iProxyMode);
+            break;
+            
+        case EMPSettProxyHostSettingId:
+            {
+            if (!iProxyHost)
+                {
+                iProxyHost = HBufC::NewL(KMPSettProxyHostMaxLength);
+                iProxyHostPtr.Set(iProxyHost->Des());
+                }
+
+            iModel->GetProxyHostName(iProxyHostPtr);
+            break;
+            }
+        case EMPSettProxyPortSettingId:
+            iModel->GetProxyPort(iProxyPort);
+            break;
+            
+        default:
+            break;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsStreamingSettingItemList::StoreSettingL
+// -----------------------------------------------------------------------------
+//
+void CMPSettingsStreamingSettingItemList::StoreSettingL(TInt aSettingId)
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsStreamingSettingItemList::StoreSettingL(%d)"),aSettingId);
+    switch (aSettingId)
+        {
+        case EMPSettDefaultAPSettingId:
+            {
+            TUint32 wapID = 0;
+            TRAPD( err, wapID = WapIdFromIapIdL( static_cast<TUint32>( iDefaultAP ) ) );
+            if ( err == KErrNone )
+                {
+                iModel->SetDefaultAp( wapID );
+                }
+            }
+            break;
+        case EMPSettConnTimeoutSettingId:
+            iModel->SetConnectionTimeout(iConnTimeout);
+            break;
+        case EMPSettServerTimeoutSettingId:
+            iModel->SetServerTimeout(iSrvTimeout);
+            break;
+        case EMPSettMinUDPPortSettingId:
+            iModel->SetMinUDPPort(iMinUDPPort);
+            break;
+        case EMPSettMaxUDPPortSettingId:
+            iModel->SetMaxUDPPort(iMaxUDPPort);
+            break;
+        case EMPSettProxyModeSettingId:
+            iModel->SetProxyMode(iProxyMode);
+            break;
+        case EMPSettProxyHostSettingId:
+            iModel->SetProxyHostNameL(*iProxyHost);
+            break;
+        case EMPSettProxyPortSettingId:
+            iModel->SetProxyPort(iProxyPort);
+            break;
+        default:
+            break;
+        }
+
+    iModel->StoreSettingsL();
+    }
+
+// --------------------------------------------------------------------------
+// CMPSettingsStreamingSettingItemList::LaunchConnectionSelectionL()
+// --------------------------------------------------------------------------
+//
+void CMPSettingsStreamingSettingItemList::LaunchConnectionSelectionL()
+    {
+    MPX_FUNC("#MS# CMPSettingsStreamingSettingItemList::LaunchConnectionSelectionL()");
+    
+    CCmApplicationSettingsUi* settingsUi = CCmApplicationSettingsUi::NewL();
+    CleanupStack::PushL ( settingsUi );
+    
+    TCmSettingSelection selection;
+    selection.iId = iDefaultAP;
+    selection.iResult = CMManager::EConnectionMethod;
+    
+    TUint listItems = CMManager::EShowConnectionMethods;
+    TBearerFilterArray filters;
+    
+    TBool retVal = settingsUi->RunApplicationSettingsL( selection, listItems, filters );
+    if ( retVal )
+        {
+        TBool iapChanged = EFalse;
+    
+        switch ( selection.iResult )
+            {
+            case CMManager::EDestination:
+                break;
+
+            case CMManager::EAlwaysAsk:
+                {
+                iDefaultAP = 0; // Set AP to "None"
+                }
+                break;
+
+            case CMManager::EConnectionMethod:
+                {
+                if ( selection.iId != iDefaultAP)
+                    {
+                    iDefaultAP = selection.iId;
+                    iapChanged = ETrue;
+                    }
+                }
+                break;
+
+            default:
+                break;
+            }
+        
+        if ( iapChanged )
+            {
+            UpdateSelectedConnectionNameL( );
+            
+            if ( iSettingConnectionItem )
+                {
+                iSettingConnectionItem->LoadL ( );
+                iSettingConnectionItem->UpdateListBoxTextL ( );
+                }
+    
+            CheckProxyDisableL();
+            
+            DrawDeferred();
+            }
+        }
+    CleanupStack::PopAndDestroy ( settingsUi );
+    }
+
+// --------------------------------------------------------------------------
+// CMPSettingsStreamingSettingItemList::CheckProxyDisableL()
+// --------------------------------------------------------------------------
+//
+void CMPSettingsStreamingSettingItemList::CheckProxyDisableL()
+    {
+    if ( iProxyMode && iSettingProxyItem )
+        {
+        iSettingProxyItem->EditItemL( EFalse );
+        
+        iSettingProxyItem->StoreL();
+        StoreSettingL( EMPSettProxyModeSettingId );
+    
+        iSettingProxyItem->LoadL();
+        iSettingProxyItem->UpdateListBoxTextL();
+        }
+    }
+
+// --------------------------------------------------------------------------
+// CMPSettingsStreamingSettingItemList::UpdateSelectedConnectionNameL
+// --------------------------------------------------------------------------
+//
+void CMPSettingsStreamingSettingItemList::UpdateSelectedConnectionNameL()
+    {
+    MPX_FUNC("#MS# CMPSettingsStreamingSettingItemList::UpdateSelectedConnectionNameL()");
+    
+    RCmManagerExt cmManager;
+    RCmConnectionMethodExt connMethod;
+
+    CleanupClosePushL( cmManager );
+    CleanupClosePushL( connMethod );
+    
+    cmManager.OpenL();
+
+    // This leaves if conn method is not found.
+    TRAPD( leave, connMethod = cmManager.ConnectionMethodL( iDefaultAP ) );
+    if ( KErrNone == leave )
+        {
+        HBufC* tmpBuf = 
+                cmManager.GetConnectionMethodInfoStringL( iDefaultAP, CMManager::ECmName);
+
+        if( tmpBuf )
+			{
+			if ( tmpBuf->Length() < KMaxApNameLength )
+            	{
+	            iSelectedApName = *tmpBuf;
+            	}
+			delete tmpBuf;
+			}	
+        }
+
+    CleanupStack::PopAndDestroy( &connMethod );
+    CleanupStack::PopAndDestroy( &cmManager );
+    }
+
+// --------------------------------------------------------------------------
+// CMPSettingsStreamingSettingItemList::HandleListBoxEventL()
+// --------------------------------------------------------------------------
+//
+void CMPSettingsStreamingSettingItemList::HandleListBoxEventL(
+    CEikListBox* aListBox,
+    TListBoxEvent aListBoxEvent )
+    {
+    if ( ( aListBoxEvent == EEventEnterKeyPressed ) ||
+         ( aListBoxEvent == EEventItemSingleClicked ) ||
+         ( aListBoxEvent == EEventItemDoubleClicked ) )
+        {
+        CAknSettingItemList::HandleListBoxEventL( aListBox, aListBoxEvent );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsStreamingSettingItemList::WapIdFromIapIdL
+// -----------------------------------------------------------------------------
+//
+TUint32 CMPSettingsStreamingSettingItemList::WapIdFromIapIdL( TUint32 aIapId )
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsStreamingSettingItemList::WapIdFromIapIdL(%d)"),aIapId);
+    
+    TUint32 wap = 0;
+#ifdef __WINSCW__    
+    wap = aIapId;
+#else    
+    
+    CMDBSession* db = CMDBSession::NewL( CMDBSession::LatestVersion() );
+    CleanupStack::PushL( db );
+    
+    // WapIpBearer table contains the mapping between wap and iap id's.
+    CCDWAPIPBearerRecord* wapBearerRecord = 
+        static_cast<CCDWAPIPBearerRecord*>( 
+                CCDRecordBase::RecordFactoryL( KCDTIdWAPIPBearerRecord ) );
+        
+    CleanupStack::PushL( wapBearerRecord );
+    
+    wapBearerRecord->iWAPIAP = aIapId;
+    
+    TBool found = wapBearerRecord->FindL( *db );
+    if ( !found )
+        {
+        User::Leave( KErrNotFound );
+        }
+
+    wap = static_cast<TUint32>( wapBearerRecord->iWAPAccessPointId );
+    
+    CleanupStack::PopAndDestroy( wapBearerRecord );
+    CleanupStack::PopAndDestroy( db );
+
+#endif    
+    
+    MPX_DEBUG2(_L("#MS# CMPSettingsStreamingSettingItemList::WapIdFromIapIdL() - return wap id: %d "), wap);
+    return wap;
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsStreamingSettingItemList::IapIdFromWapIdL
+// -----------------------------------------------------------------------------
+//
+TUint32 CMPSettingsStreamingSettingItemList::IapIdFromWapIdL( TUint32 aWapId )
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsStreamingSettingItemList::IapIdFromWapIdL(%d)"),aWapId);
+    
+    TUint32 iap = 0;
+#ifdef __WINSCW__
+    iap = aWapId;
+#else    
+    CMDBSession* db = CMDBSession::NewL( CMDBSession::LatestVersion() );
+    CleanupStack::PushL( db );
+    
+    // WapIpBearer table contains the mapping between wap and iap id's.
+    CCDWAPIPBearerRecord* wapBearerRecord = 
+        static_cast<CCDWAPIPBearerRecord*>( 
+                CCDRecordBase::RecordFactoryL( KCDTIdWAPIPBearerRecord ) );
+        
+    CleanupStack::PushL( wapBearerRecord );
+    
+    wapBearerRecord->iWAPAccessPointId = aWapId;
+    
+    TBool found = wapBearerRecord->FindL( *db );
+    if ( !found )
+        {
+        User::Leave( KErrNotFound );
+        }
+
+    iap = static_cast<TUint32>( wapBearerRecord->iWAPIAP );
+    
+    CleanupStack::PopAndDestroy( wapBearerRecord );
+    CleanupStack::PopAndDestroy( db );
+
+#endif
+    
+    MPX_DEBUG2(_L("#MS# CMPSettingsStreamingSettingItemList::IapIdFromWapIdL() - return iap id: %d "), iap);
+    return iap;
+    }
+
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/src/MPSettingsStreamingView.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,171 @@
+/*
+* Copyright (c) 2002 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:   View class for Streaming list view.*
+*/
+
+
+// Version : %version: 8 %
+
+
+
+// INCLUDE FILES
+#include    <aknViewAppUi.h>
+#include    <MediaSettings.rsg>
+#include    <calslbs.h>
+#include    <featmgr.h>
+#include    <hlplch.h>             // For HlpLauncher
+#include    "mediasettings.hrh"
+#include    "MPSettingsAppUi.h"
+#include    "MPSettingsNaviPaneController.h"
+#include    "MPSettingsStreamingView.h"
+#include    "MPSettingsStreamingContainer.h"
+#include    "MPSettingsConstants.h" 
+#include    "mpxlog.h"
+
+class CMPSettingsModelForROP;
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CMPSettingsStreamingView::CMPSettingsStreamingView
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CMPSettingsStreamingView::CMPSettingsStreamingView(CMPSettingsModelForROP* aModel) 
+    : iModel( aModel)
+    {
+    MPX_FUNC("#MS# CMPSettingsStreamingView::CMPSettingsStreamingView()");
+    iNaviPaneContext = iNaviCntrl->MPTabGroup();
+    }
+
+// ---------------------------------------------------------
+// CMPSettingsStreamingView::ConstructL(const TRect& aRect)
+// Symbian OS two-phased constructor
+// ---------------------------------------------------------
+//
+void CMPSettingsStreamingView::ConstructL()
+    {
+    MPX_FUNC("#MS# CMPSettingsStreamingView::ConstructL()");
+    BaseConstructL(R_MPSETT_STREAMING_VIEW);
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsStreamingView::NewLC
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CMPSettingsStreamingView* CMPSettingsStreamingView::NewLC(CMPSettingsModelForROP* aModel)
+    {
+    MPX_FUNC("#MS# CMPSettingsStreamingView::NewLC()");
+    CMPSettingsStreamingView* self = new(ELeave) CMPSettingsStreamingView(aModel);
+    
+    CleanupStack::PushL(self);
+    self->ConstructL();
+
+    return self;
+    }
+
+// ---------------------------------------------------------
+// CMPSettingsStreamingView::~CMPSettingsStreamingView
+// Destructor
+// ---------------------------------------------------------
+//
+CMPSettingsStreamingView::~CMPSettingsStreamingView()
+    {
+    MPX_FUNC("#MS# CMPSettingsStreamingView::~CMPSettingsStreamingView()");
+    }
+
+// ---------------------------------------------------------
+// TUid CMPSettingsStreamingView::Id
+// ---------------------------------------------------------
+//
+TUid CMPSettingsStreamingView::Id() const
+    {
+    MPX_FUNC("#MS# CMPSettingsStreamingView::Id()");
+    return KMPSettStreamingViewId;
+    }
+
+// ---------------------------------------------------------
+// CMPSettingsStreamingView::HandleCommandL
+// ---------------------------------------------------------
+//
+void CMPSettingsStreamingView::HandleCommandL(TInt aCommand)
+    {   
+    MPX_DEBUG2(_L("#MS# CMPSettingsStreamingView::HandleCommandL(%d)"),aCommand);
+    switch (aCommand)
+        {
+        case EMPSettCmdChange:
+            static_cast<CMPSettingsStreamingContainer*>(iContainer)->EditCurrentItemFromMenuL(ETrue);
+            break;
+        case EMPMiddleSoftKeyChange:
+            static_cast<CMPSettingsStreamingContainer*>(iContainer)->EditCurrentItemFromMenuL(EFalse);
+            break;  
+        case EMPSettCmdAdvancedSett:
+            AppUi()->ActivateLocalViewL( KMPSettAdvancedBwViewId );
+            break;            
+        case EMPSettCmdOpen:
+            break;
+        case EAknSoftkeyBack:
+            {
+            // If video view is empty, then exit Settings
+            CMPSettingsAppUi* appUi = static_cast<CMPSettingsAppUi*>(AppUi());
+            appUi->ActivateLocalViewL( KMPSettMainViewId );
+            }
+            break;
+        case EMPSettCmdHelp:
+            if( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+                {
+                HlpLauncher::LaunchHelpApplicationL(iEikonEnv->WsSession(), AppUi()->AppHelpContextL() );
+                }
+            break;
+        default:
+            AppUi()->HandleCommandL(aCommand);
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CMPSettingsStreamingView::NewContainerL
+// ---------------------------------------------------------------------------
+//
+CMPSettingsBaseContainer* CMPSettingsStreamingView::NewContainerL()
+    {
+    MPX_FUNC("#MS# CMPSettingsStreamingView::NewContainerL()");
+    return new(ELeave) CMPSettingsStreamingContainer(iModel);
+    }  
+
+
+// ---------------------------------------------------------------------------
+// CMPSettingsStreamingView::DynInitContainerL
+// ---------------------------------------------------------------------------
+//
+void CMPSettingsStreamingView::DynInitContainerL()
+    {
+    MPX_FUNC("#MS# CMPSettingsStreamingView::DynInitContainerL()");
+    CEikTextListBox* listbox = iContainer->ListBox();
+
+    listbox->SetTopItemIndex(iTopItemIndex);
+
+    if (iCurrentItem >= 0 && iCurrentItem < listbox->Model()->NumberOfItems()) // magic
+        {
+        listbox->SetCurrentItemIndexAndDraw(iCurrentItem);
+        }
+    CMPSettingsBaseView::SetMiddleSoftKeyLabelL(R_MEDIASETTING_MSK_OPEN,EMPSettCmdOpen);
+    }
+
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/src/MPSettingsUDPPortSettingItem.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,81 @@
+/*
+* Copyright (c) 2002 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:   MPSettingsUDPPortSettingItem.cpp*
+*/
+
+
+// Version : %version: 3 %
+
+
+
+
+// INCLUDE FILES
+#include    <akntextsettingpage.h>
+
+#include    "mediasettings.hrh"
+#include    "MPSettingsUDPPortSettingItem.h"
+#include	"mpxlog.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CMPSettingsUDPPortSettingItem::CMPSettingsUDPPortSettingItem
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CMPSettingsUDPPortSettingItem::CMPSettingsUDPPortSettingItem(TInt aIdentifier, TInt& aValue, TInt& aRefValue) :
+    CAknIntegerEdwinSettingItem(aIdentifier, aValue), iRefValue(aRefValue)
+    {
+	MPX_DEBUG2(_L("#MS# CMPSettingsUDPPortSettingItem::CMPSettingsUDPPortSettingItem(%d)"),aIdentifier);
+    }
+  
+// Destructor
+CMPSettingsUDPPortSettingItem::~CMPSettingsUDPPortSettingItem()
+    {   
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsUDPPortSettingItem::EditItemL
+// -----------------------------------------------------------------------------
+//
+void CMPSettingsUDPPortSettingItem::EditItemL(TBool /*aCalledFromMenu*/)
+    {
+    MPX_FUNC("#MS# CMPSettingsUDPPortSettingItem::EditItemL()");
+    CAknSettingPage* dlg = new( ELeave )CAknIntegerSettingPage( 
+                                SettingPageResourceId(),
+                                InternalValueRef(),
+                                SettingPageFlags());
+
+    SetSettingPage(dlg);
+    SettingPage()->SetSettingPageObserver(this);
+    SettingPage()->ConstructL();
+
+    switch(Identifier())
+        {
+        case EMPSettMinUDPPortSettingId:
+            static_cast<CAknIntegerSettingPage*>(SettingPage())->IntegerEditorControl()->SetMaximumIntegerValue(iRefValue);
+            break;
+        case EMPSettMaxUDPPortSettingId:
+            static_cast<CAknIntegerSettingPage*>(SettingPage())->IntegerEditorControl()->SetMinimumIntegerValue(iRefValue);
+            break;
+        default:
+            break;
+        }
+
+    SettingPage()->ExecuteLD(CAknSettingPage::EUpdateWhenChanged);
+    SetSettingPage(NULL);
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/src/MPSettingsVideoContainer.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,180 @@
+/*
+* Copyright (c) 2002 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:   Container class for Video settings list view.*
+*/
+
+
+// Version : %version: 8 %
+
+
+
+// INCLUDE FILES
+#include    <aknlists.h>
+#include    <barsread.h>
+#include    <MediaSettings.rsg>
+#include    <csxhelp/iptv.hlp.hrh>
+
+#include    "MPSettingsApp.h"
+#include    "MPSettingsVideoContainer.h"
+#include    "MPSettingsVideoSettingItemList.h"
+#include    "MPSettingsConstants.h"
+#include    "MPSettingsModelForROP.h"
+#include	"mpxlog.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CMPSettingsVideoContainer::CMPSettingsVideoContainer
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CMPSettingsVideoContainer::CMPSettingsVideoContainer(CMPSettingsModelForROP* aModel) 
+	: iModel( aModel)
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsVideoContainer::CMPSettingsVideoContainer()"));
+    }
+
+// ---------------------------------------------------------
+// CMPSettingsVideoContainer::~CMPSettingsVideoContainer
+// Destructor
+// ---------------------------------------------------------
+//
+CMPSettingsVideoContainer::~CMPSettingsVideoContainer()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsVideoContainer::~CMPSettingsVideoContainer()"));
+	if (iSettingList) 
+		{
+		delete iSettingList;
+		}
+	
+	delete iVideoSettingsEngine;
+    }
+
+// ---------------------------------------------------------
+// CMPSettingsVideoContainer::EditCurrentItemFromMenuL
+// ---------------------------------------------------------
+//
+void CMPSettingsVideoContainer::EditCurrentItemFromMenuL(TBool iMenuOption)
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsVideoContainer::EditCurrentItemFromMenuL(%d)"),iMenuOption);
+    static_cast<CMPSettingsVideoSettingItemList*>(iSettingList)->EditCurrentItemL( iMenuOption );
+    }
+
+// ---------------------------------------------------------
+// CMPSettingsVideoContainer::ConstructComponentControlsL
+// ---------------------------------------------------------
+//
+void CMPSettingsVideoContainer::ConstructComponentControlsL()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsVideoContainer::ConstructComponentControlsL()"));
+    
+    iVideoSettingsEngine = CVcxNsSettingsEngine::NewL( );
+    
+    iSettingList = new(ELeave) CMPSettingsVideoSettingItemList(iModel, *iVideoSettingsEngine );
+
+    iSettingList->SetContainerWindowL(*this);
+
+    iSettingList->ConstructFromResourceL(R_MPSETT_VIDEO_SETTING_ITEM_LIST);
+    iSettingList->LoadSettingsL();
+
+    iComponentControl = iSettingList;
+    iListBox = iSettingList->ListBox();
+    }
+
+// ---------------------------------------------------------
+// CMPSettingsVideoContainer::TitleResourceId
+// ---------------------------------------------------------
+//
+TInt CMPSettingsVideoContainer::TitleResourceId()
+    {
+    return R_MPSETT_VIDEO_VIEW_TITLE;
+    }
+
+// ---------------------------------------------------------
+// CMPSettingsVideoContainer::GetHelpContext
+// ---------------------------------------------------------
+//
+void CMPSettingsVideoContainer::GetHelpContext(TCoeHelpContext& aContext) const
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsVideoContainer::GetHelpContext()"));
+    aContext.iMajor = KIptvHelpContextUid;
+    aContext.iContext = KIPTV_HLP_SETTINGS;
+    }
+
+// ---------------------------------------------------------
+// CMPSettingsVideoContainer::FocusChanged
+// ---------------------------------------------------------
+//
+void CMPSettingsVideoContainer::FocusChanged(TDrawNow /*aDrawNow*/)
+	{
+	if ( iListBox )
+        {
+        iListBox->SetFocus( IsFocused() );
+        }
+
+	if ( iComponentControl )
+        {
+        iComponentControl->SetFocus( IsFocused() );
+        }
+	}
+
+// ---------------------------------------------------------------------------
+// CMPSettingsVideoContainer::SizeChanged()
+// Called by framwork when the view size is changed
+// ---------------------------------------------------------------------------
+//
+void CMPSettingsVideoContainer::SizeChanged()
+    {
+	if ( iListBox )
+        {
+        iListBox->SetRect(Rect());
+        }
+
+	if ( iComponentControl )
+        {
+        iComponentControl->SetRect(Rect());
+        }
+    }
+    
+// ---------------------------------------------------------
+// CMPSettingsVideoContainer::HandleResourceChange
+// Handles a resource relative event 
+// ---------------------------------------------------------
+//
+void CMPSettingsVideoContainer::HandleResourceChange( TInt aType )
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsVideoContainer::HandleResourceChange(0x%X)"),aType);
+	if ( aType == KEikDynamicLayoutVariantSwitch ) //Handle change in layout orientation
+        {
+        TRect mainPaneRect;
+        AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPaneRect );
+        SetRect( mainPaneRect );
+		DrawNow();
+		}
+	CCoeControl::HandleResourceChange( aType );  
+    }
+
+// ---------------------------------------------------------
+// CMPSettingsVideoContainer::IsCurrentItem
+// ---------------------------------------------------------
+//
+TBool CMPSettingsVideoContainer::IsCurrentItem( TInt aIndex )
+    {
+    return static_cast<CMPSettingsVideoSettingItemList*>(iSettingList)
+        ->IsCurrentItem( aIndex );
+    }
+
+
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/src/MPSettingsVideoSettingItemList.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,284 @@
+/*
+* Copyright (c) 2002 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:   Setting item list class for Video settings list view.*
+*/
+
+
+// Version : %version: 20 %
+
+
+
+
+// INCLUDE FILES
+#include <eikappui.h>
+#include <MediaSettings.rsg>
+#include <StringLoader.h>
+#include <cmmanagerext.h>
+#include <cmdestinationext.h>
+#include <cmapplicationsettingsui.h>
+
+#include "MediaPlayerVariant.hrh" 
+#include "MediaPlayerPrivateCRKeys.h"
+#include "mediasettings.hrh"
+#include "MPSettingsVideoSettingItemList.h"
+#include "MPSettingsSliderSettingItem.h"
+#include "MPSettingsModelForROP.h"
+#include "MPSettingsAppUi.h" 
+#include "videoplayersettingsengine.h"
+#include "videoplayercenrepkeys.h"
+#include "mpxlog.h"
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CMPSettingsVideoSettingItemList::CMPSettingsVideoSettingItemList
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CMPSettingsVideoSettingItemList::CMPSettingsVideoSettingItemList(
+        CMPSettingsModelForROP* aModel, 
+        CVcxNsSettingsEngine& aVideoSettingsEngine) 
+    : iModel( aModel ), 
+      iVideoSettingsEngine(aVideoSettingsEngine), 
+      iRockerKeysSupported( EFalse )
+    {
+    CMPSettingsAppUi* AppUi =
+            static_cast<CMPSettingsAppUi*> (CCoeEnv::Static()->AppUi());
+    iLandscapeSupportedByDevice = AppUi->OrientationCanBeChanged();
+    
+    TBool rockerSupported = EFalse;
+    TRAP_IGNORE( rockerSupported = iModel->IsRockerKeysSupportedL() );
+    if ( rockerSupported )
+        {
+        iRockerKeysSupported = ETrue;
+        }
+    MPX_DEBUG3(_L("#MS# CMPSettingsVideoSettingItemList::CMPSettingsVideoSettingItemList() iLandscapeSupportedByDevice(%d) iRockerKeysSupported(%d) "),iLandscapeSupportedByDevice,iRockerKeysSupported );
+    }
+    
+// -----------------------------------------------------------------------------
+// CMPSettingsVideoSettingItemList::~CMPSettingsVideoSettingItemList
+// Destructor
+// -----------------------------------------------------------------------------
+//
+CMPSettingsVideoSettingItemList::~CMPSettingsVideoSettingItemList()
+    {   
+    MPX_DEBUG1(_L("#MS# CMPSettingsVideoSettingItemList::~CMPSettingsVideoSettingItemList()"));
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsVideoSettingItemList::EditItemL
+// -----------------------------------------------------------------------------
+//
+void CMPSettingsVideoSettingItemList::EditItemL(TInt aIndex, TBool aCalledFromMenu)
+    {
+    MPX_DEBUG3(_L("#MS# CMPSettingsVideoSettingItemList::EditItemL(%d,%d)"),aIndex,aCalledFromMenu);
+
+    TInt itemIndex = aIndex;
+    TBool storeModifiedSetting( ETrue );
+    
+    CAknSettingItem* settingItem = SettingItemArray()->At( itemIndex );
+    TInt identifier = settingItem->Identifier();
+    
+    // Load current value from shared data
+    switch ( identifier )
+         {
+         case EMPSettVideoContrastSettingId:
+            {
+            CAknSettingItemList::EditItemL( itemIndex, aCalledFromMenu );
+            break;
+            }
+
+         default:
+            break;
+         }
+    
+    if ( storeModifiedSetting )
+        {
+         // Store the modified setting
+        switch ( itemIndex )
+            {
+            case EVcSettingsViewParentControlIndex:
+            case EVcSettingsViewMemoryItemIndex:
+            case EVcSettingsViewThumbnailsIndex:
+                break;
+                
+            default:
+                {
+                // Store setting value to settings model
+                settingItem->StoreL();
+                StoreSettingL( identifier );
+                }
+                break;
+            }
+        }
+    }
+
+// --------------------------------------------------------------------------
+// CMPSettingsVideoSettingItemList::HandleListBoxEventL()
+// --------------------------------------------------------------------------
+//
+void CMPSettingsVideoSettingItemList::HandleListBoxEventL(
+    CEikListBox* aListBox,
+    TListBoxEvent aListBoxEvent )
+    {
+    if ( aListBoxEvent == EEventEnterKeyPressed   ||
+         aListBoxEvent == EEventItemSingleClicked ||
+         aListBoxEvent == EEventItemDoubleClicked )
+        {
+        TInt itemIndex = SettingItemArray()->ItemIndexFromVisibleIndex(
+            aListBox->CurrentItemIndex() );
+
+        CAknSettingItemList::HandleListBoxEventL( aListBox, aListBoxEvent );
+        }
+    }
+
+// --------------------------------------------------------------------------
+// CMPSettingsVideoSettingItemList::EditCurrentItemL()
+// --------------------------------------------------------------------------
+//
+void CMPSettingsVideoSettingItemList::EditCurrentItemL( TBool aCalledFromMenu )
+    {
+    TInt itemIndex = SettingItemArray()->ItemIndexFromVisibleIndex(
+            ListBox()->CurrentItemIndex() );
+   
+    EditItemL( itemIndex, aCalledFromMenu );
+    }
+
+// --------------------------------------------------------------------------
+// CMPSettingsVideoSettingItemList::IsCurrentItem()
+// --------------------------------------------------------------------------
+//
+TBool CMPSettingsVideoSettingItemList::IsCurrentItem( TInt aIndex )
+    {
+    TBool retValue( EFalse ); 
+    TInt currentIndex = SettingItemArray()->ItemIndexFromVisibleIndex(
+            ListBox()->CurrentItemIndex() );
+   
+    CAknSettingItem* settingItem = SettingItemArray()->At( currentIndex );
+    TInt identifier = settingItem->Identifier();
+    if ( aIndex == identifier )
+        {
+        retValue = ETrue;
+        }
+    
+    return retValue;
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsVideoSettingItemList::LoadSettingsL
+// -----------------------------------------------------------------------------
+//
+void CMPSettingsVideoSettingItemList::LoadSettingsL()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsVideoSettingItemList::LoadSettingsL()"));
+    // Get setting values from settings model
+    LoadAllL();
+
+    CAknSettingItemList::LoadSettingsL();
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsVideoSettingItemList::CreateSettingItemL
+// -----------------------------------------------------------------------------
+//
+CAknSettingItem* CMPSettingsVideoSettingItemList::CreateSettingItemL(TInt aSettingId)
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsVideoSettingItemList::CreateSettingItemL(%d)"),aSettingId);
+    CAknSettingItem* settingItem = NULL;
+
+    switch (aSettingId)
+        {
+        case EMPSettVideoContrastSettingId:
+            {
+            settingItem = new (ELeave) CMPSettingsSliderSettingItem(
+                aSettingId, iVideoContrast,
+                R_MPSETT_CONTRAST_SLIDER_LIST_VALUE, EFalse);
+            if ( ! VideoContrastIsSupportedL() )
+			    {
+                settingItem->SetHidden( ETrue );
+				}
+            break;
+            }
+        default:
+            break;
+        }
+
+    return settingItem;   
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsVideoSettingItemList::LoadSettingL
+// -----------------------------------------------------------------------------
+//
+void CMPSettingsVideoSettingItemList::LoadSettingL(TInt aSettingId)
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsVideoSettingItemList::LoadSettingL(%d)"),aSettingId);
+    switch (aSettingId)
+        {
+        case EMPSettVideoContrastSettingId:
+            iModel->GetVideoContrast(iVideoContrast);
+            break;
+            
+        default:
+            break;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsVideoSettingItemList::StoreSettingL
+// -----------------------------------------------------------------------------
+//
+void CMPSettingsVideoSettingItemList::StoreSettingL(TInt aSettingId)
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsVideoSettingItemList::StoreSettingL(%d)"),aSettingId);
+    switch (aSettingId)
+        {
+        case EMPSettVideoContrastSettingId:
+            iModel->SetVideoContrast(iVideoContrast);
+            break;
+
+        default:
+            break;
+        }
+
+    iModel->StoreSettingsL();
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsVideoSettingItemList::LoadAllL
+// -----------------------------------------------------------------------------
+//
+void CMPSettingsVideoSettingItemList::LoadAllL()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsVideoSettingItemList::LoadAllL()"));
+    iModel->LoadSettingsL(EConfigUser);
+    LoadSettingL(EMPSettVideoContrastSettingId);
+    }
+
+// --------------------------------------------------------------------------
+// Check if video contrast is supported.
+// --------------------------------------------------------------------------
+//
+TBool CMPSettingsVideoSettingItemList::VideoContrastIsSupportedL()
+    {
+    // As video contrast is only item in video settings list, 
+    // we can assume here that contrast is supported, because
+    // it has been already checked in AppUi/GsPlugin level.
+    return ETrue;
+    
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsapp/src/MPSettingsVideoView.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,174 @@
+/*
+* Copyright (c) 2002 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:   View class for Video settings list view.*
+*/
+
+
+// Version : %version: 8 %
+
+
+
+// INCLUDE FILES
+#include    <aknViewAppUi.h>
+#include    <MediaSettings.rsg>
+#include    <eikmenup.h>
+#include    <eiktxlbm.h>
+#include    <hlplch.h>             // For HlpLauncher
+#include    <featmgr.h>
+#include    "mediasettings.hrh"
+#include    "MPSettingsNaviPaneController.h"
+#include    "MPSettingsVideoView.h"
+#include    "MPSettingsVideoContainer.h"
+#include    "MPSettingsConstants.h" 
+#include    "MPSettingsModelForROP.h"
+#include    "mpxlog.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CMPSettingsVideoView::CMPSettingsVideoView
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CMPSettingsVideoView::CMPSettingsVideoView(CMPSettingsModelForROP* aModel) 
+    : iModel( aModel)
+    {
+        MPX_FUNC("#MS# CMPSettingsVideoView::CMPSettingsVideoView()");
+        iNaviPaneContext = iNaviCntrl->MPTabGroup();
+    }
+
+// ---------------------------------------------------------
+// CMPSettingsVideoView::ConstructL(const TRect& aRect)
+// Symbian OS two-phased constructor
+// ---------------------------------------------------------
+//
+void CMPSettingsVideoView::ConstructL()
+    {
+    MPX_FUNC("#MS# CMPSettingsVideoView::ConstructL()");
+    BaseConstructL(R_MPSETT_VIDEO_VIEW);
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsVideoView::NewLC
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CMPSettingsVideoView* CMPSettingsVideoView::NewLC(CMPSettingsModelForROP* aModel)
+    {
+    MPX_FUNC("#MS# CMPSettingsVideoView::NewLC()");
+    CMPSettingsVideoView* self = new(ELeave) CMPSettingsVideoView(aModel);
+    
+    CleanupStack::PushL(self);
+    self->ConstructL();
+
+    return self;
+    }
+
+// ---------------------------------------------------------
+// CMPSettingsVideoView::~CMPSettingsVideoView()
+// Destructor
+// ---------------------------------------------------------
+//
+CMPSettingsVideoView::~CMPSettingsVideoView()
+    {
+    MPX_FUNC("#MS# CMPSettingsVideoView::~CMPSettingsVideoView()");
+    }
+
+// ---------------------------------------------------------
+// TUid CMPSettingsVideoView::Id
+// ---------------------------------------------------------
+//
+TUid CMPSettingsVideoView::Id() const
+    {
+    MPX_FUNC("#MS# CMPSettingsVideoView::Id()");
+    return KMPSettVideoViewId;
+    }
+
+// ---------------------------------------------------------
+// CMPSettingsVideoView::HandleCommandL
+// ---------------------------------------------------------
+//
+void CMPSettingsVideoView::HandleCommandL(TInt aCommand)
+    {   
+    MPX_DEBUG2(_L("#MS# CMPSettingsVideoView::HandleCommandL(%d)"),aCommand);
+    switch (aCommand)
+        {
+        case EMPSettCmdChange:
+            static_cast<CMPSettingsVideoContainer*>(iContainer)->EditCurrentItemFromMenuL(ETrue);
+            break;
+        
+        case EMPMiddleSoftKeyChange:
+            static_cast<CMPSettingsVideoContainer*>(iContainer)->EditCurrentItemFromMenuL(EFalse);
+            break;
+        
+        case EAknSoftkeyBack:
+            AppUi()->ActivateLocalViewL(KMPSettMainViewId);
+            break;
+        
+        case EMPSettCmdHelp:
+            if( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+                {
+                HlpLauncher::LaunchHelpApplicationL( iEikonEnv->WsSession(), 
+                                                     AppUi()->AppHelpContextL() );
+                }
+            break;
+        
+        default:
+            AppUi()->HandleCommandL(aCommand);
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CMPSettingsVideoView::NewContainerL
+// ---------------------------------------------------------------------------
+//
+CMPSettingsBaseContainer* CMPSettingsVideoView::NewContainerL()
+    {
+    MPX_FUNC("#MS# CMPSettingsVideoView::NewContainerL()");
+    return new(ELeave) CMPSettingsVideoContainer(iModel);
+    }  
+
+// ---------------------------------------------------------------------------
+// CMPSettingsVideoView::DynInitContainerL
+// ---------------------------------------------------------------------------
+//
+void CMPSettingsVideoView::DynInitContainerL()
+    {
+    MPX_FUNC("#MS# CMPSettingsVideoView::DynInitContainerL()");
+    CEikTextListBox* listbox = iContainer->ListBox();
+
+    listbox->SetTopItemIndex(iTopItemIndex);
+
+    if (iCurrentItem >= 0 && iCurrentItem < listbox->Model()->NumberOfItems()) // magic
+        {
+        listbox->SetCurrentItemIndexAndDraw(iCurrentItem);
+        }
+    CMPSettingsBaseView::SetMiddleSoftKeyLabelL(R_MEDIASETTING_MSK_CHANGE,EMPMiddleSoftKeyChange);
+    }
+
+// ---------------------------------------------------------------------------
+// CMPSettingsVideoView::DynInitMenuPaneL
+// ---------------------------------------------------------------------------
+//
+void CMPSettingsVideoView::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ) 
+   {
+    MPX_FUNC("#MS# CMPSettingsVideoView::DynInitMenuPaneL()");
+
+    CMPSettingsBaseView::DynInitMenuPaneL( aResourceId, aMenuPane );
+    }
+
+// End of File
+
Binary file mediasettings/mediasettingsengine/conf/mediasettings.confml has changed
Binary file mediasettings/mediasettingsengine/conf/mediasettings_101F880B.crml has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsengine/data/101F857B.rss	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2002 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:   ECOM DLL interface & implementation description resource for*
+*/
+
+
+// Version : %version: 3 %
+
+
+
+//  INCLUDES
+#include <registryinfo.rh>
+
+#include "MPSettEngPluginInterfaceUIDs.hrh"
+#include "MPSettEngPluginImplementationUIDs.hrh"
+
+
+//  RESOURCE DEFINITIONS 
+// -----------------------------------------------------------------------------
+//   
+// theInfo
+// ECOM DLL interface & implementation description resource.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE REGISTRY_INFO theInfo
+    {
+    dll_uid = KMPSettEngDllUidROP;
+    interfaces =
+        {
+        INTERFACE_INFO
+            {
+            interface_uid = KMPSettEngUidPluginInterfaceMediaSettings;
+            implementations =
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = KMPSettEngImplUidROP;
+                    version_no = 1;
+                    display_name = "ROP specific settings model";
+                    default_data = "";
+                    opaque_data = "";
+                    }
+                };
+            }
+        };
+    }
+            
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsengine/data/MPSettingsROPModel.rss	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,230 @@
+/*
+* Copyright (c) 2002 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:   ROP model's resource file.*
+*/
+
+
+// Version : %version: 2 %
+
+
+
+
+//  RESOURCE IDENTIFIER
+NAME    ROPS
+
+//  INCLUDES
+#include    <eikon.rh>
+
+#include    "MPSettingsROPModel.rh"
+#include    "MPSettingsROPSettings.hrh"
+
+
+RESOURCE RSS_SIGNATURE { }
+
+RESOURCE TBUF 
+    {
+    buf = "";
+    }
+
+//  RESOURCE DEFINITIONS 
+// -----------------------------------------------------------------------------
+//   
+// r_mpsett_rop_settings_array
+// Array defining all ROP setting items (keys and ids).
+//
+//  ROP specific configuration keywords are defined in
+//  "Multimedia Framework - Video Player" Interface Specification.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE MPSETT_ROP_SETTING_ITEM_ARRAY r_mpsett_rop_settings_array
+    {
+    items = 
+        {
+        MPSETT_ROP_SETTING_ITEM
+            {
+            id = EMPRopContrast;
+            key = "Contrast";
+            },
+        MPSETT_ROP_SETTING_ITEM
+            {
+            id = EMPRopProxyMode;
+            key = "UseProxy";
+            },
+        MPSETT_ROP_SETTING_ITEM
+            {
+            id = EMPRopProxyHostName;
+            key = "Proxy";
+            },
+        MPSETT_ROP_SETTING_ITEM
+            {
+            id = EMPRopProxyPort;
+            key = "ProxyPort";
+            },
+        MPSETT_ROP_SETTING_ITEM
+            {
+            id = EMPRopDefaultAP;
+            key = "AccessPoint";
+            },
+        MPSETT_ROP_SETTING_ITEM
+            {
+            id = EMPRopBandwidthMode;
+            key = "ManualBandwidth";
+            },
+        MPSETT_ROP_SETTING_ITEM
+            {
+            id = EMPRopConnTimeout;
+            key = "ConnTimeout";
+            },
+        MPSETT_ROP_SETTING_ITEM
+            {
+            id = EMPRopServerTimeout;
+            key = "Timeout";
+            },
+        MPSETT_ROP_SETTING_ITEM
+            {
+            id = EMPRopMinUDPPort;
+            key = "MinUDPPort";
+            },
+        MPSETT_ROP_SETTING_ITEM
+            {
+            id = EMPRopMaxUDPPort;
+            key = "MaxUDPPort";
+            },
+        MPSETT_ROP_SETTING_ITEM
+            {
+            id = EMPRopCntrlVersion;
+            key = "RNControllerVersion";
+            },
+        MPSETT_ROP_SETTING_ITEM
+            {
+            id = EMPRopCntrlBldDate;
+            key = "RNControllerBuildDate";
+            },
+        MPSETT_ROP_SETTING_ITEM
+            {
+            id = EMPRopCntrlPlatform;
+            key = "RNControllerPlatform";
+            },
+        MPSETT_ROP_SETTING_ITEM
+            {
+            id = EMPRopDemandBwFactor;
+            key = "DemandBWFactor";
+            },
+        MPSETT_ROP_SETTING_ITEM
+            {
+            id = EMPRopGPRSMaxBw;
+            key = "GPRSMaximumBandwidth";
+            },
+        MPSETT_ROP_SETTING_ITEM
+            {
+            id = EMPRopGPRSSustainBw;
+            key = "GPRSSustainBandwidth";
+            },
+        MPSETT_ROP_SETTING_ITEM
+            {
+            id = EMPRopGPRSMaxBwPresets;
+            key = "GPRSMaximumBWPresets";
+            },
+        MPSETT_ROP_SETTING_ITEM
+            {
+            id = EMPRopGPRSSustainBwPresets;
+            key = "GPRSSustainBWPresets";
+            },
+        MPSETT_ROP_SETTING_ITEM
+            {
+            id = EMPRopEGPRSMaxBw;
+            key = "EGPRSMaximumBandwidth";
+            },
+        MPSETT_ROP_SETTING_ITEM
+            {
+            id = EMPRopEGPRSSustainBw;
+            key = "EGPRSSustainBandwidth";
+            },
+        MPSETT_ROP_SETTING_ITEM
+            {
+            id = EMPRopEGPRSMaxBwPresets;
+            key = "EGPRSMaximumBWPresets";
+            },
+        MPSETT_ROP_SETTING_ITEM
+            {
+            id = EMPRopEGPRSSustainBwPresets;
+            key = "EGPRSSustainBWPresets";
+            },
+        MPSETT_ROP_SETTING_ITEM
+            {
+            id = EMPRopWCDMAMaxBw;
+            key = "WCDMAMaximumBandwidth";
+            },
+        MPSETT_ROP_SETTING_ITEM
+            {
+            id = EMPRopWCDMASustainBw;
+            key = "WCDMASustainBandwidth";
+            },
+        MPSETT_ROP_SETTING_ITEM
+            {
+            id = EMPRopWCDMAMaxBwPresets;
+            key = "WCDMAMaximumBWPresets";
+            },
+        MPSETT_ROP_SETTING_ITEM
+            {
+            id = EMPRopWCDMASustainBwPresets;
+            key = "WCDMASustainBWPresets";
+            },
+        MPSETT_ROP_SETTING_ITEM
+            {
+            id = EMPRopWLANMaxBw;
+            key = "WLANMaximumBandwidth";
+            },
+        MPSETT_ROP_SETTING_ITEM
+            {
+            id = EMPRopWLANSustainBw;
+            key = "WLANSustainBandwidth";
+            },
+        MPSETT_ROP_SETTING_ITEM
+            {
+            id = EMPRopWLANMaxBwPresets;
+            key = "WLANMaximumBWPresets";
+            },
+        MPSETT_ROP_SETTING_ITEM
+            {
+            id = EMPRopWLANSustainBwPresets;
+            key = "WLANSustainBWPresets";
+            },
+        MPSETT_ROP_SETTING_ITEM
+            {
+            id = EMPRopHSDPAMaxBw;
+            key = "HSDPAMaximumBandwidth";
+            },
+        MPSETT_ROP_SETTING_ITEM
+            {
+            id = EMPRopHSDPASustainBw;
+            key = "HSDPASustainBandwidth";
+            },
+        MPSETT_ROP_SETTING_ITEM
+            {
+            id = EMPRopHSDPAMaxBwPresets;
+            key = "HSDPAMaximumBWPresets";
+            },
+        MPSETT_ROP_SETTING_ITEM
+            {
+            id = EMPRopHSDPASustainBwPresets;
+            key = "HSDPASustainBWPresets";
+            }
+        };
+    }
+            
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsengine/group/MPSettROPModel.mmp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,68 @@
+/*
+* Copyright (c) 2002 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:    Makefile for Media Settings ROP Model*
+*/
+
+
+
+// Version : %version: 8 %
+
+
+
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+TARGET          mpsettropmodel.dll
+CAPABILITY      CAP_ECOM_PLUGIN
+TARGETTYPE      PLUGIN
+UID             0x10009D8D 0x101F857B
+VENDORID        VID_DEFAULT
+//VERSION         11.6
+
+SOURCEPATH      ../src
+SOURCE          MPSettingsModelForROP.cpp
+SOURCE          MPSettingsRopConfigParser.cpp
+SOURCE          MPSettingsModelForRopImplementationProxy.cpp
+
+SOURCEPATH      ../data
+START RESOURCE  101F857B.rss
+TARGET mpsettropmodel.rsc                                                                
+END
+
+START RESOURCE  MPSettingsROPModel.rss
+HEADER
+TARGET mpsettingsropmodel.rsc       
+TARGETPATH      RESOURCE_FILES_DIR 
+END
+
+USERINCLUDE     .
+USERINCLUDE		../inc
+
+APP_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   /epoc32/include/ecom
+SYSTEMINCLUDE   /epoc32/include/mmf
+SYSTEMINCLUDE   /epoc32/include/mmf/common
+
+
+LIBRARY         euser.lib
+LIBRARY         mmfcontrollerframework.lib
+LIBRARY         charconv.lib
+LIBRARY         mpsettengine.lib
+LIBRARY         commdb.lib
+LIBRARY         bafl.lib
+LIBRARY         efsrv.lib
+LIBRARY         flogger.lib
+LIBRARY         centralrepository.lib
+LIBRARY         commsdat.lib
+
+//end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsengine/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,41 @@
+/*
+* 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 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:   This file provides the information required for building the*
+*/
+
+
+
+// Version : %version: 8 %
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+//
+//  Export the loc, stub sis iby files for S60 5.0
+//
+../rom/mpsettropmodel.iby      	CORE_APP_LAYER_IBY_EXPORT_PATH(mpsettropmodel.iby)
+../rom/mpsettropmodelrsc.iby    CORE_APP_LAYER_IBY_EXPORT_PATH(mpsettropmodelrsc.iby)
+
+// Generic configuration interface for component cenrep settings  
+// mediasettings_101F880B implementation specifics for cenrep data
+../conf/mediasettings.confml              APP_LAYER_CONFML(mediasettings.confml)
+../conf/mediasettings_101F880B.crml 	  APP_LAYER_CRML(mediasettings_101F880B.crml)
+
+PRJ_MMPFILES
+../group/MPSettROPModel.mmp
+
+PRJ_TESTMMPFILES
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsengine/inc/MPSettEngPluginImplementationUIDs.hrh	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2002 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:   ECOM implementation UIDs for ROP specific settings model plugin.*
+*/
+
+
+#ifndef MPSETTENGPLUGINIMPLEMENTATIONUIDS_HRH
+#define MPSETTENGPLUGINIMPLEMENTATIONUIDS_HRH
+
+// DLL UIDs
+#define KMPSettEngDllUidROP 0x101F857B
+
+// Implementation UIDs
+#define KMPSettEngImplUidROP 0x101F857D
+
+#endif // MPSETTENGPLUGINIMPLEMENTATIONUIDS_HRH
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsengine/inc/MPSettEngPluginInterfaceUIDs.hrh	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2002 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:    MPSettEngPluginInterfaceUIDs.hrh*
+*/
+
+
+
+// Version : %version: 2 %
+
+
+
+#ifndef MPSETTENGPLUGININTERFACEUIDS_HRH
+#define MPSETTENGPLUGININTERFACEUIDS_HRH
+
+#define KMPSettEngUidPluginInterfaceMediaSettings 0x101F857C
+
+#endif // MPSETTENGPLUGININTERFACEUIDS_HRH
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsengine/inc/MPSettingsModelForROP.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,504 @@
+/*
+* 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 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:    MMF ROP plugin specific settings model.*
+*/
+
+
+
+// Version : %version: 6 %
+
+
+
+
+#ifndef MPSETTINGSMODELFORROP_H
+#define MPSETTINGSMODELFORROP_H
+
+//  INCLUDES
+#include    <e32base.h> 
+#include    <centralrepository.h>
+#include    <mmf/common/mmfcontroller.h>
+#include    "mpsettingsmodel.h"
+
+class CMPRopSettingItem;
+class CMPSettingsRopConfigParser;
+class CCommsDatabase;
+class CApUtils;
+
+// CLASS DECLARATION
+
+/**
+*  CMPSettingsModelForROP
+*  MMF ROP plugin specific settings model.
+*
+*  @lib MPSettEngine.dll
+*  @since 2.0
+*/
+class CMPSettingsModelForROP : public CMPSettingsModel
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        */
+        static CMPSettingsModelForROP* NewL();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CMPSettingsModelForROP();
+
+    public: // Functions from base classes
+
+        /**
+        * From MMPSettingsModel, provides uid of the MMF controller,
+        * which settings this class handles
+        * @since 2.0
+        * @return MMF controller UID
+        */
+        const TUid MMFControllerID();
+        
+        /**
+        * From MMPSettingsModel,
+        * @since 2.0
+        */
+        void LoadSettingsL(TInt aConfigVersion);
+
+        /**
+        * From MMPSettingsModel, 
+        * @since 2.0
+        */
+        void StoreSettingsL();
+
+        /**
+        * From MMPSettingsModel, sets video contrast
+        * @since 2.0
+        * @param aContrast Contrast level
+        * @return Error value.
+        */
+        TInt SetVideoContrast(TInt aContrast);
+
+        /**
+        * From MMPSettingsModel, returns video contrast level.
+        * @since 2.0
+        * @param aContrast Contrast level:
+        * @return Error value.
+        */
+        TInt GetVideoContrast(TInt& aContrast);
+
+        /**
+        * From MMPSettingsModel, sets proxy mode..
+        * @since 2.0
+        * @param aMode Proxy mode.
+        * @return Error value.
+        */
+        TInt SetProxyMode(TInt aMode);
+        
+        /**
+        * From MMPSettingsModel, returns proxy mode.
+        * @since 2.0
+        * @param aMode Proxy mode:
+        *         0:    Disabled
+        *         1:    Enabled
+        * @return Error value.
+        */
+        TInt GetProxyMode(TInt& aMode);
+
+        /**
+        * From MMPSettingsModel, sets Proxy host name.
+        * @since 2.0
+        * @param aHostName Proxy host name.
+        * @return Error value.
+        */
+        TInt SetProxyHostNameL(const TDesC& aHostName);
+        
+        /**
+        * From MMPSettingsModel, returns proxy host name.
+        * @since 2.0
+        * @param aHostName Proxy host name.
+        * @return Error value.
+        */
+        TInt GetProxyHostName(TDes& aHostName);
+
+        /**
+        * From MMPSettingsModel, sets proxy port number.
+        * @since 2.0
+        * @param aPort Proxy port number.
+        * @return Error value.
+        */
+        TInt SetProxyPort(TInt aPort);
+        
+        /**
+        * From MMPSettingsModel, returns proxy port number..
+        * @since 2.0
+        * @return Integer: Proxy port number.
+        * @return Error value.
+        */
+        TInt GetProxyPort(TInt& aPort);
+        
+        /**
+        * From MMPSettingsModel, sets default access point.
+        * @since 2.0
+        * @param aApId Access point ID.
+        * @return Error value.
+        */
+        TInt SetDefaultAp(TUint32 aApId);
+
+        /**
+        * From MMPSettingsModel, returns default access point ID.
+        * @since 2.0
+        * @param aApId Access point ID.
+        * @return Error value.
+        */
+        TInt GetDefaultAp(TUint32& aApId);
+
+        /**
+        * Sets bandwidth control mode.
+        * @since 2.0
+        * @param aMode bandwidth control mode.
+        * @return Error value.
+        */
+        TInt SetBandwidthControlMode(TInt aMode);
+        
+        /**
+        * Returns bandwidth control mode.
+        * @since 2.0
+        * @param aMode bandwidth control mode:
+        *           0: Use dynamic bw control if possible
+        *           1: Use static bw control
+        * @return Error value.
+        */
+        TInt GetBandwidthControlMode(TInt& aMode);
+
+        /**
+        * From MMPSettingsModel, sets maximum bandwidth.
+        * @since 2.0
+        * @param aMaxBw Maximum bandwidth.
+        * @param aBearer Bearer, which max bw is set.
+        * @return Error value.
+        */
+        TInt SetMaxBandwidth(TInt aMaxBw, TDataBearer aBearer);
+        
+        /**
+        * From MMPSettingsModel, returns maximum bandwidth.
+        * @since 2.0
+        * @param aMaxBw Maximum bandwidth.
+        * @param aBearer Bearer, which max bw is enquired.
+        * @return Error value.
+        */
+        TInt GetMaxBandwidth(TInt& aMaxBw, TDataBearer aBearer);
+
+        /**
+        * From MMPSettingsModel, sets connection timeout.
+        * @since 2.0
+        * @param aTimeout Timeout in minutes.
+        * @return Error value.
+        */
+        TInt SetConnectionTimeout(TInt aTimeout);
+        
+        /**
+        * From MMPSettingsModel, returns connection timeout.
+        * @since 2.0
+        * @param aTimeout Timeout in minutes.
+        * @return Error value.
+        */
+        TInt GetConnectionTimeout(TInt& aTimeout);
+        
+        /**
+        * From MMPSettingsModel, sets server timout.
+        * @since 2.0
+        * @param aTimeout Timeout in minutes.
+        * @return Error value.
+        */
+        TInt SetServerTimeout(TInt aTimeout);
+        
+        /**
+        * From MMPSettingsModel, returns server timeout.
+        * @since 2.0
+        * @param aTimeout Timeout in minutes.
+        * @return Error value.
+        */
+        TInt GetServerTimeout(TInt& aTimeout);
+
+        /**
+        * From MMPSettingsModel, sets minimum UDP port number.
+        * @since 2.0
+        * @param aPort minimum port number.
+        * @return Error value.
+        */
+        TInt SetMinUDPPort(TInt aPort);
+
+        /**
+        * From MMPSettingsModel, returns minimum UDP port number.
+        * @since 2.0
+        * @param aPort minimum UDP port number in minutes.
+        * @return Error value.
+        */
+        TInt GetMinUDPPort(TInt& aPort);
+
+        /**
+        * From MMPSettingsModel, sets maximum UDP port number.
+        * @since 2.0
+        * @param aPort maximum port number.
+        * @return Error value.
+        */
+        TInt SetMaxUDPPort(TInt aPort);
+
+        /**
+        * From MMPSettingsModel, returns maximum UDP port number.
+        * @since 2.0
+        * @param aPort maximum UDP port number in minutes.
+        * @return Error value.
+        */
+        TInt GetMaxUDPPort(TInt& aPort);
+
+        /**
+        * Provides MMF controller version information.
+        * @since 2.0
+        * @param aVersion Controller version number.
+        * @return Error value.
+        */
+        TInt GetControllerVersionInfo(TDes& aVersion);
+            
+        /**
+        * Provides MMF controller's build date.
+        * @since 2.0
+        * @param aBldDate Controller build date.
+        * @return Error value.
+        */
+        TInt GetControllerBuildDate(TDes& aBldDate);
+
+        /**
+        * Provides additional information about MMF controller.
+        * @since 2.0
+        * @param aAdditionalInfo Additional controller information.
+        * @return Error value.
+        */
+        TInt GetControllerAdditionalInfo(TDes& aAdditionalInfo);
+
+        /**
+        * Sets demand bandwidth factor.
+        * @since 2.1
+        * @param aFactor Demand bandwidth factor.
+        * @return Error value.
+        */
+        TInt SetDemandBwFactor(TInt aFactor);
+
+        /**
+        * Returns demand factor bandwidth.
+        * @since 2.1
+        * @param aFactor Demand bandwidth factor.
+        * @return Error value.
+        */
+        TInt GetDemandBwFactor(TInt& aFactor); 
+
+        /**
+        * Sets sustainable bandwidth.
+        * @since 2.1
+        * @param aSustainBw Sustainable bandwidth.
+        * @param aBearer Bearer, which max bw is set.
+        * @return Error value.
+        */
+        TInt SetSustainBandwidth(TInt aSustainBw, TDataBearer aBearer);
+        
+        /**
+        * Returns sustainable bandwidth.
+        * @since 2.1
+        * @param aSustainBw Sustainable bandwidth.
+        * @param aBearer Bearer, which max bw is enquired.
+        * @return Error value.
+        */
+        TInt GetSustainBandwidth(TInt& aSustainBw, TDataBearer aBearer);
+
+        /**
+        * Returns an array of the fixed sustainable bandwidth values.
+        * @since 2.1
+        * @param aBwArray Fixed sustain bandwidth values are copied to this array.
+        * @param aBearer Bearer, which fixed sustain bw values is enquired.
+        * @return Error value.
+        */
+        TInt GetSustainBwPresetsL(RArray<TInt>& aBwArray, TDataBearer aBearer);
+
+        /**
+        * Returns an array of the fixed max bandwidth values.
+        * @since 2.1
+        * @param aBwArray Fixed max bandwidth values are copied to this array.
+        * @param aBearer Bearer, which fixed max bw values is enquired.
+        * @return Error value.
+        */
+        TInt GetMaxBwPresetsL(RArray<TInt>& aBwArray, TDataBearer aBearer);
+
+     public:  // value to / from MediaPlayer Repository
+	/**
+        * Returns video repeat mode.
+        * @since 2.0
+        * @return ETrue:    On
+        *         EFalse:   Off
+        */
+        TBool IsVideoRepeatOnL();
+
+        /**
+        * Sets video repeat mode. Deprecated.
+        * @since 2.0
+        * @param aRepeat Repeat mode.
+        */
+        void SetVideoRepeatL(const TBool aRepeat);
+
+		/**
+        * Returns default view mode. Deprecated.
+        * @since 3.2
+        * @return ETrue:    On  (Normal-screen view)
+        *         EFalse:   Off (Full-screen view)
+        */
+        TBool IsDefaultViewOnL();
+
+        /**
+        * Sets default view mode.
+        * @since 3.2
+        * @param aView Default view mode.
+        */
+        void SetDefaultViewL(const TBool aView);
+
+		/**
+        * Returns if Rocker Keys Feature is supported
+        * @since 3.2
+        * @return ETrue:    - Rocker Keys feature is supported
+        *         EFalse:   - Rocker Keys feature is not supported
+        */
+        TBool IsRockerKeysSupportedL();
+
+        /**
+        * Sets rocker keys mode.
+        * @since 3.2
+        * @param aRockerKeys rocker keys mode.
+        */
+        void SetRockerKeysL(const TBool aRockerKeys);
+
+		/**
+        * Returns Rocker Keys mode
+        * @since 3.2
+        * @return ETrue:    Show (Rocker Keys are shown)
+        *         EFalse:   Hide (Rocker Keys are hidden)
+        */
+		TBool ShowRockerKeysL();
+
+	/**
+        * Sets Media Player auto disconnection time.
+        * @since 2.0
+        * @param aTime Auto disconnection time.
+        */
+        void SetAutoDisconTimeL(const TInt aTime);
+
+        /**
+        * Returns Media Player auto disconnection time.
+        * @since 2.0
+        * @return 0:    Unlimited time
+        *         1-99: Time in minutes
+        */
+        TInt AutoDisconTimeL();
+
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CMPSettingsModelForROP();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+    private:
+
+        /**
+        * Function for setting an integer value to iItems
+        * array according to item id.
+        */
+        TInt SetIntegerValue(TInt aId, TInt aValue);
+
+        /**
+        * Function for getting an integer value from iItems
+        * array according to item id.
+        */
+        TInt GetIntegerValue(TInt aId, TInt& aValue);
+
+        /**
+        * Function for getting an string value from iItems
+        * array according to item id.
+        */
+        TInt GetStringValue(TInt aId, TDes& aString);
+
+        /**
+        * Resets aArray and populates it with values from iIntArray.
+        * aId is the id of an item from iItems, which iIntArray
+        * is copied.
+        */
+        TInt GetArrayL(TInt aId, RArray<TInt>& aArray);
+
+        /**
+        * Finds item from iItems according to it's id.
+        */
+        TInt GetItem(TInt aId, CMPRopSettingItem*& aItem);
+
+        /**
+        * Locates the resource file searching from y: to a: and then z: last.
+        *
+        * @param aFileName Full path to resource file.
+        * @param aFs File server session.
+        */
+        void LocateResourceFileL( TFileName& aFileName, RFs& aFs );
+    
+        /**
+         * Gets WAP id from IAP id. Leaves with KErrNotFound if no record with given 
+         * IAP id is found.
+         * 
+         * @return WAP id matching the given IAP id.
+         */
+        TUint32 WapIdFromIapIdL( TUint32 aIapId );
+
+        /**
+         * Gets WAP id from IAP id. Leaves with KErrNotFound if no record with given 
+         * IAP id is found.
+         * 
+         * @return WAP id matching the given IAP id.
+         */
+        TUint32 IapIdFromWapIdL( TUint32 aWapId );        
+        
+    private: // new
+           
+	void InitializeCentralRepositoryL();
+	void UninitializeCentralRepository();
+
+
+    private:    // Data
+
+        //Central repository objects
+        CRepository* iClient;
+		CRepository* iMediaPlayerClient;
+
+        CArrayPtr<CMPRopSettingItem>* iItems;
+        CMPSettingsRopConfigParser* iParser;
+
+        HBufC8* iROPSettings;
+        HBufC8* iROPHeader;
+
+        RMMFController iMMFController;      
+        CCommsDatabase* iCommDb;
+        CApUtils* iApUtils;
+    };
+
+#endif      // MPSETTINGSMODELFORROP_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsengine/inc/MPSettingsROPModel.rh	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2002 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:    Resource structure definitions for ROP settings model.*
+*/
+
+
+
+// Version : %version: 2 %
+
+
+
+
+//  STRUCTURE DEFINITIONS
+
+// -----------------------------------------------------------------------------
+// MPSETT_ROP_SETTING_ITEM
+// 
+// -----------------------------------------------------------------------------
+//
+STRUCT MPSETT_ROP_SETTING_ITEM
+    {
+    WORD id;
+    LTEXT key;
+    }
+
+// -----------------------------------------------------------------------------
+// MPSETT_ROP_SETTING_ITEM_ARRAY
+// ?description
+// -----------------------------------------------------------------------------
+//
+STRUCT MPSETT_ROP_SETTING_ITEM_ARRAY
+    {
+    STRUCT items[]; 
+    }
+
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsengine/inc/MPSettingsROPSettings.hrh	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,68 @@
+/*
+* Copyright (c) 2002 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:    This file contains declarations for constants of ROPSettings.*
+*/
+
+
+
+// Version : %version: 2 %
+
+
+
+#ifndef MPSETTINGSROPSETTINGS_HRH
+#define MPSETTINGSROPSETTINGS_HRH
+
+
+// DATA TYPES
+enum TMPRopItemIndexes
+    {
+    EMPRopContrast = 0,
+    EMPRopProxyMode,
+    EMPRopProxyPort,
+    EMPRopDefaultAP,
+    EMPRopBandwidthMode,
+    EMPRopConnTimeout,
+    EMPRopServerTimeout,
+    EMPRopProxyHostName,
+    EMPRopMinUDPPort,
+    EMPRopMaxUDPPort,
+    EMPRopCntrlVersion,
+    EMPRopCntrlBldDate,
+    EMPRopCntrlPlatform,
+    EMPRopDemandBwFactor,
+    EMPRopGPRSMaxBw,
+    EMPRopGPRSSustainBw,
+    EMPRopGPRSMaxBwPresets,
+    EMPRopGPRSSustainBwPresets,
+    EMPRopEGPRSMaxBw,
+    EMPRopEGPRSSustainBw,
+    EMPRopEGPRSMaxBwPresets,
+    EMPRopEGPRSSustainBwPresets,
+    EMPRopWCDMAMaxBw,
+    EMPRopWCDMASustainBw,
+    EMPRopWCDMAMaxBwPresets,
+    EMPRopWCDMASustainBwPresets,
+    EMPRopWLANMaxBw,
+    EMPRopWLANSustainBw,
+    EMPRopWLANMaxBwPresets,
+    EMPRopWLANSustainBwPresets,
+    EMPRopHSDPAMaxBw,
+    EMPRopHSDPASustainBw,
+    EMPRopHSDPAMaxBwPresets,
+    EMPRopHSDPASustainBwPresets
+    };
+
+#endif // MPSETTINGSROPSETTINGS_HRH
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsengine/inc/MPSettingsRopConfigParser.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,208 @@
+/*
+* Copyright (c) 2002 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:    Config descriptor parser for ROP specific settings.*
+*/
+
+
+
+// Version : %version: 2 %
+
+
+
+
+#ifndef MPROPCONFIGPARSER_H
+#define MPROPCONFIGPARSER_H
+
+//  INCLUDES
+#include    <e32base.h>
+
+// DATA TYPES
+enum TMPRopConfType
+    {
+    EMPRopConfTypeInteger = 1,
+    EMPRopConfTypeString = 2,
+    EMPRopConfTypeIntArray = 3
+    };
+
+// CLASS DECLARATION
+
+/**
+*  CMPRopSettingItem
+*   Setting item class, for storing item specific data.
+*   
+*
+*  @lib MPSettROPModel.dll
+*  @since 2.0
+*/
+class CMPRopSettingItem : public CBase
+    {
+    public:
+
+        /**
+        * Two-phased constructor.
+        */
+        static CMPRopSettingItem* NewLC(TInt aId, const TDesC& aKey);
+
+        /**
+        * Destructor.
+        */
+        virtual ~CMPRopSettingItem();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CMPRopSettingItem(TInt aId);
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL(const TDesC& aKey);
+
+    private: // Data
+        HBufC8* iKey;
+        TInt iId;
+
+        TBool iValueChanged;
+        TInt iError;
+        TInt iIntValue;
+        HBufC* iStringValue;
+        RArray<TInt> iIntArray;
+        TMPRopConfType iType;
+
+    private:    // Friend classes
+        friend class CMPSettingsModelForROP;
+        friend class CMPSettingsRopConfigParser;
+    };
+
+
+/**
+*  CMPSettingsRopConfigParser
+*  Config descriptor parser for ROP specific settings.
+*
+*  @lib MPSettROPModel.dll
+*  @since 2.0
+*/
+class CMPSettingsRopConfigParser : public CBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CMPSettingsRopConfigParser* NewL();
+       
+        /**
+        * Destructor.
+        */
+        virtual ~CMPSettingsRopConfigParser();
+
+    public: // New functions
+        
+        /**
+        * Parses config string and places parsed setting items to item array.
+        * @since 2.0
+        * @param aConfigString Configuration string
+        * @param aItemArray Item array
+        * @return Descriptor containing config string header.
+        */
+        HBufC8* ParseConfigStringL(const TDesC8& aConfigString, const CArrayPtr<CMPRopSettingItem>* aItemArray);
+
+        /**
+        * Creates configuration string from item's data in the item array.
+        * @since 2.0
+        * @param aItemArray Item array
+        * @param aConfigHeader Configuration string's header.
+        * @return Descriptor containing configuration string.
+        */
+        HBufC8* CreateConfigStringL(const CArrayPtr<CMPRopSettingItem>* aItemArray, const TDesC8& aConfigHeader);
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CMPSettingsRopConfigParser();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+    private:
+
+        /**
+        * Parses config header from config string.
+        */
+        HBufC8* ParseConfigHeaderL();
+
+        /**
+        * Returns descriptor containing next config entry.
+        */
+        HBufC8* NextConfigEntryL(TInt& aError);
+
+        /**
+        * Populates entry array from configuration string.
+        */
+        void PopulateEntryArrayFromConfigStringL();
+
+        /**
+        * Populates entry array from item array.
+        */
+        void PopulateEntryArrayFromItemArrayL();
+
+        /**
+        * Creates config entry from setting item.
+        */
+        HBufC8* CreateConfigEntryL(CMPRopSettingItem* aItem);
+
+        /**
+        * Creates configuration string from entry array.
+        */
+        HBufC8* CreateConfigStringFromEntryArrayL();
+
+        /**
+        * Parses next entry from config string.
+        */
+        TInt GetNextEntry(TPtrC8& aEntry);
+
+        /**
+        * Parses setting item data from all config entries.
+        */
+        void ParseSettingsBufferL();
+
+        /**
+        * Parses setting item data from a config entry for predefined setting items.
+        */
+        TInt GetConfigDataL(const TDesC8& aKey, TPtrC8& aValue, TMPRopConfType& aType);
+
+        /**
+        * Parses value string from a config entry.
+        */
+        TPtrC8 ValueStringPtr(const TDesC8& aValue, TInt& aError);
+
+    private:    // Data
+
+        CArrayPtr<HBufC8>* iEntries;
+        const CArrayPtr<CMPRopSettingItem>* iItemArray;
+
+        HBufC8* iConfigHeader;
+        HBufC8* iTmpBuf;
+        TPtrC8 iBufferPtr;    
+    };
+
+#endif      // MPROPCONFIGPARSER_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsengine/inc/MediaPlayerInternalCRKeys.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,36 @@
+/*
+* Copyright (c) 2004 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:   Media Player internal CenRep keys.*
+*/
+
+
+
+#ifndef MEDIAPLAYERINTERNALCRKEYS_H
+#define MEDIAPLAYERINTERNALCRKEYS_H
+
+// Media Player Settings API
+
+const TUid KCRUidMediaPlayerSettings = {0x101F880A};
+
+const TUint32 KMPMuted              = 0x00000001;
+const TUint32 KMPVolumeLevel        = 0x00000002;
+const TUint32 KMPRepeat             = 0x00000003;
+const TUint32 KMPAutoDisconnectTime = 0x00000004;
+const TUint32 KMPDefaultView		= 0x00000005;
+const TUint32 KMPRockerKeys			= 0x00000006;
+
+#endif      // MEDIAPLAYERINTERNALCRKEYS_H
+
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsengine/inc/MediaPlayerPrivateCRKeys.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2004 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:   Media Player internal CenRep keys.*
+*/
+
+
+#ifndef MEDIAPLAYERPRIVATECRKEYS_H
+#define MEDIAPLAYERPRIVATECRKEYS_H
+
+#include "MediaPlayerInternalCRKeys.h"
+
+// Media Player Features API
+
+const TUid KCRUidMediaPlayerFeatures = {0x101F880B};
+
+const TUint32 KMPLocalVariation = 0x00000001;
+
+#endif      // MEDIAPLAYERPRIVATECRKEYS_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsengine/inc/MediaPlayerVariant.hrh	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,69 @@
+/*
+* Copyright (c) 2004 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 MEDIAPLAYERVARIANT_HRH
+#define MEDIAPLAYERVARIANT_HRH
+
+// KMediaPlayerMixerSupport and KMediaPlayerChangeRTForAll 
+// moved to the MusicPlayer
+//
+
+// Feature to enable Video contrast setting in Media Settings.
+#define KMediaPlayerVideoContrast       0x01
+
+// Feature to enable IPv6 access point support in Media Settings
+// (Default access point).
+#define KMediaPlayerIPv6Support         0x02
+
+// Feature to hide various streaming functionalities for CR 409-372
+#define KMediaPlayerHideStreamingFunctionality   0x04
+
+// Feature to disable Save Prompt when Back softkey is pressed
+#define KMediaPlayerDisableSavePrompt   0x08
+
+// Feature to disable data transmission totally, 
+// when the streaming is in stopped state. 
+#define KMediaPlayerCloseData           0x10        
+     
+// Feature to immediately return to calling application after streaming clip ends
+#define KMediaPlayerReturnFocusBackToCallingApp   0x20
+
+// Feature to enable marquee (scrolling) text in media player details dialog.
+// If enabled, the item in dialog can be selected and the selected item starts
+// scrolling if the item text cannot be displayed as whole on the screen.
+#define KMediaPlayerMarqueeDetails      0x40
+
+// Feature to enable marquee (scrolling) text for artist name label in 
+// Music Player. When enabled and if the artist name is too long to fit into 
+// space reserved for it, the label starts scrolling. Scrolling is associated 
+// to player state, when playing is started the label starts scrolling and if 
+// the playing is stopped the scrolling stops, too.
+#define KMediaPlayerMarqueeArtistName   0x80
+
+// Feature to enable Rocker Keys
+#define KMediaPlayerRockerKeys	0x100
+
+//Allow to add, edit url
+#define MEDIAPLAYER_UI_Enhancements_P2
+
+// Feature to use MP volume control instead of avkon volume control
+#define KMEDIAPLAYERVOLUMECONTROL
+
+#define _THUMBNAIL_SUPPORT
+
+#endif // MEDIAPLAYERVARIANT_HRH
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsengine/rom/mpsettropmodel.iby	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2006-2009 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:   Image description file for project mpsettropmodel.*
+*/
+
+
+
+#ifndef MPSETTROPMODEL_IBY
+#define MPSETTROPMODEL_IBY
+
+#include <data_caging_paths_for_iby.hrh>
+
+ECOM_PLUGIN( mpsettropmodel.dll, mpsettropmodel.rsc )
+
+#endif // MPSETTROPMODEL_IBY
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsengine/rom/mpsettropmodelrsc.iby	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2006-2009 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:      Image description file for project .*
+*/
+
+
+
+
+#ifndef MPSETTROPMODELRSC_IBY
+#define MPSETTROPMODELRSC_IBY
+
+#include <data_caging_paths_for_iby.hrh>
+
+data=DATAZ_\RESOURCE_FILES_DIR\mpsettingsropmodel.rsc      	   RESOURCE_FILES_DIR\mpsettingsropmodel.rsc
+
+
+#endif // MPSETTROPMODELRSC_IBY
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsengine/src/MPSettingsModelForROP.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,1234 @@
+/*
+* Copyright (c) 2002 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:   MMF ROP plugin specific settings model.*
+*/
+
+
+// Version : %version: 10 %
+
+
+
+
+// INCLUDE FILES
+#include <mmf/common/mmfbase.h>
+#include <MMFROPCustomCommandConstants.h>
+#include <f32file.h>
+#include <bautils.h>
+#include <barsc.h>
+#include <barsread.h>
+#include <f32file.h>
+#include <commdb.h>             // CMDBSession
+#include <commsdattypesv1_1.h>  // CCDWAPIPBearerRecord
+#include <mpsettingsropmodel.rsg>
+
+#include    <data_caging_path_literals.hrh> // KDC_RESOURCE_FILES_DIR
+
+#include    "MPSettingsModelForROP.h"
+#include    "MPSettingsRopConfigParser.h"
+#include    "MPSettingsROPSettings.hrh"
+#include    "MediaPlayerPrivateCRKeys.h"
+#include	"MediaPlayerVariant.hrh" 
+#include	"mpxlog.h"
+
+// CONSTANTS
+// ROP controller UID
+const TUid KRopControllerUid = {0x101F8514};
+// This should be used only as the granularity for iItems array
+const TInt KMPRopItemsArrayGranularity = 8;
+// Initial config string length
+const TInt KMPRopConfigStringLength = 2048;
+// Seconds to milli seconds multiplier
+const TInt KMPRopSecondsMultiplier = 1000;
+// Unlocalized resource file path
+_LIT( KMPSettROPResource, "MPSettingsROPModel.rsc" );
+
+
+// CLASS DECLARATION
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::CMPSettingsModelForROP
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CMPSettingsModelForROP::CMPSettingsModelForROP()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsModelForROP::CMPSettingsModelForROP()"));
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CMPSettingsModelForROP::ConstructL()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsModelForROP::ConstructL()"));
+    InitializeCentralRepositoryL();
+    iItems = new(ELeave) CArrayPtrSeg<CMPRopSettingItem>(KMPRopItemsArrayGranularity);
+
+    // Connect RFs
+    RFs fs;
+    User::LeaveIfError(fs.Connect());
+    CleanupClosePushL(fs);
+
+    // Locate resource file
+    TFileName fileName;
+    LocateResourceFileL( fileName, fs );
+            
+    // Open resource file
+    RResourceFile resourceFile;
+    resourceFile.OpenL(fs, fileName);
+    CleanupClosePushL(resourceFile);
+    
+    // Read array from resource file to a buffer
+    resourceFile.ConfirmSignatureL(0); // Magic: dummy value
+
+    HBufC8* buf = resourceFile.AllocReadLC(R_MPSETT_ROP_SETTINGS_ARRAY);
+
+    CMPRopSettingItem* item = NULL;
+    TInt id = 0;
+    HBufC* key = NULL;
+
+    // Set buffer to resource reader
+    TResourceReader reader;
+    reader.SetBuffer(buf);
+    // Read number of items from the resource structure
+    TInt count = reader.ReadInt16();
+ 
+    for (TInt index = 0; index < count; ++index)
+        {
+        // Read id and key
+        id = reader.ReadInt16();
+        key = reader.ReadHBufCL();
+        CleanupStack::PushL(key);
+
+        // key's ownership is transferred to item
+        item = CMPRopSettingItem::NewLC(id, *key);
+        iItems->AppendL(item); // Ownership transferred
+        CleanupStack::Pop(2); // item & key
+        delete key;
+        key = NULL;
+        }
+
+    CleanupStack::PopAndDestroy(3); // fs, resourceFile & buf
+
+    // Create config parser
+    iParser = CMPSettingsRopConfigParser::NewL();
+
+    // Open ROP controller
+    TMMFPrioritySettings prioritySettings;
+    prioritySettings.iPriority = EMdaPriorityNormal;
+    prioritySettings.iPref = EMdaPriorityPreferenceNone;
+    prioritySettings.iState = EMMFStateIdle;
+    User::LeaveIfError(iMMFController.Open(KRopControllerUid,
+                                           prioritySettings));
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CMPSettingsModelForROP* CMPSettingsModelForROP::NewL()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsModelForROP::NewL()"));
+    CMPSettingsModelForROP* self = new(ELeave) CMPSettingsModelForROP;    
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+    }
+   
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::~CMPSettingsModelForROP
+// Destructor
+// -----------------------------------------------------------------------------
+//
+CMPSettingsModelForROP::~CMPSettingsModelForROP()
+    {  
+    MPX_DEBUG1(_L("#MS# CMPSettingsModelForROP::~CMPSettingsModelForROP()"));
+	UninitializeCentralRepository();
+
+    if (iItems)
+        {
+        iItems->ResetAndDestroy();
+        delete iItems;
+        }
+
+    if (iParser) 
+        {
+        delete iParser;
+        }
+
+    if (iROPSettings) 
+        {
+        delete iROPSettings;
+        }
+
+    if (iROPHeader) 
+        {
+        delete iROPHeader;
+        }
+
+    iMMFController.Close();
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::LoadSettingsL
+// -----------------------------------------------------------------------------
+//
+void CMPSettingsModelForROP::LoadSettingsL(TInt aConfigVersion)
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::LoadSettingsL(%d)"),aConfigVersion);
+    // Initialize variables
+    TInt configLength(KMPRopConfigStringLength);
+    TInt error(KErrOverflow);
+    const TMMFMessageDestinationPckg destinationPckg(KUidInterfaceMMFROPController);
+
+    TInt ropConfigVersion;
+    switch (aConfigVersion)
+        {
+        case EConfigDefault:
+            ropConfigVersion = KMMFAudioVideoConfigDefault;
+            break;
+        case EConfigUser:
+        default:
+            ropConfigVersion = KMMFAudioVideoConfigUser;
+            break;
+        }
+
+    const TPckgBuf<TInt> verPckg(ropConfigVersion);
+
+
+    // If iROPSettings is not large enough, increase the length and try again 
+    for (TInt i = 0; i < 2 && error == KErrOverflow; ++i)
+        {
+        delete iROPSettings;
+        iROPSettings = NULL;
+        iROPSettings = HBufC8::NewL(configLength);
+        TPtr8 ptr = iROPSettings->Des();
+
+        error = iMMFController.CustomCommandSync(destinationPckg, EMMFROPControllerGetApplicationConfig,
+            verPckg, KNullDesC8, ptr);
+
+        if (error == KErrOverflow)
+            {
+            // iROPSettings is not large enough => increase length:
+            // extract correct length from iROPSettings
+            TPckgBuf<TInt> newLength;
+            newLength.Copy(ptr);
+            configLength = newLength();
+            }
+        else 
+            {
+            // Leave if unexpected error occurred
+            User::LeaveIfError(error);
+            }               
+        }
+
+    // Leave if unexpected error occurred
+    User::LeaveIfError(error);
+
+    delete iROPHeader;
+    iROPHeader = NULL;
+    iROPHeader = iParser->ParseConfigStringL(*iROPSettings, iItems);
+
+    delete iROPSettings;
+    iROPSettings = NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::StoreSettingsL
+// -----------------------------------------------------------------------------
+//
+void CMPSettingsModelForROP::StoreSettingsL()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsModelForROP::StoreSettingsL()"));
+    delete iROPSettings;
+    iROPSettings = NULL;
+    iROPSettings = iParser->CreateConfigStringL(iItems, *iROPHeader);
+
+    if (iROPSettings)
+        {
+        const TMMFMessageDestinationPckg destinationPckg(KUidInterfaceMMFROPController);
+        const TPckgBuf<TBool> savePckg(ETrue);
+
+        User::LeaveIfError(iMMFController.CustomCommandSync(destinationPckg, EMMFROPControllerSetApplicationConfig,
+            *iROPSettings, savePckg));
+        }
+
+    // Set iValueChanged status to EFalse for all items
+    TInt count = iItems->Count();
+    for (TInt i = 0; i < count; ++i)
+        {
+        iItems->At(i)->iValueChanged = EFalse;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::SetVideoContrast
+// -----------------------------------------------------------------------------
+//
+TInt CMPSettingsModelForROP::SetVideoContrast(TInt aContrast)
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::SetVideoContrast(%d)"),aContrast);
+    return SetIntegerValue(EMPRopContrast, aContrast);
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::GetVideoContrast
+// -----------------------------------------------------------------------------
+//
+TInt CMPSettingsModelForROP::GetVideoContrast(TInt& aContrast)
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsModelForROP::GetVideoContrast()"));
+    return GetIntegerValue(EMPRopContrast, aContrast);
+    }
+
+
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::SetProxyMode
+// -----------------------------------------------------------------------------
+//
+TInt CMPSettingsModelForROP::SetProxyMode(TInt aMode)
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::SetProxyMode(%d)"),aMode);
+    return SetIntegerValue(EMPRopProxyMode, aMode);
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::GetProxyMode
+// -----------------------------------------------------------------------------
+//
+TInt CMPSettingsModelForROP::GetProxyMode(TInt& aMode)
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsModelForROP::GetProxyMode()"));
+    return GetIntegerValue(EMPRopProxyMode, aMode);
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::SetProxyHostNameL
+// -----------------------------------------------------------------------------
+//
+TInt CMPSettingsModelForROP::SetProxyHostNameL(const TDesC& aHostName)
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::SetProxyHostNameL(%S)"),&aHostName);
+    CMPRopSettingItem* item = NULL;
+    TInt error = GetItem(EMPRopProxyHostName, item);
+
+    if (!error)
+        {
+        delete item->iStringValue;
+        item->iStringValue = NULL;
+        item->iStringValue = aHostName.AllocL();
+
+        item->iValueChanged = ETrue;
+        item->iError = KErrNone;
+        }
+
+    MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::SetProxyHostNameL() ret %d"),error);
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::GetProxyHostName
+// -----------------------------------------------------------------------------
+//
+TInt CMPSettingsModelForROP::GetProxyHostName(TDes& aHostName)
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::GetProxyHostName(%S)"),&aHostName);
+    CMPRopSettingItem* item = NULL;
+    TInt error = GetItem(EMPRopProxyHostName, item);
+
+    if (!error)
+        {
+        error = item->iError;
+        }
+
+    if (!error)
+        {
+        // Fail safe: aHostName's length is not exceeded in the copy operation
+        aHostName.Copy(item->iStringValue->Left(aHostName.MaxLength()));
+        }
+
+    MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::GetProxyHostName() ret %d"),error);
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::SetProxyPort
+// -----------------------------------------------------------------------------
+//
+TInt CMPSettingsModelForROP::SetProxyPort(TInt aPort)
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::SetProxyPort(%d)"),aPort);
+    return SetIntegerValue(EMPRopProxyPort, aPort);
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::GetProxyPort
+// -----------------------------------------------------------------------------
+//
+TInt CMPSettingsModelForROP::GetProxyPort(TInt& aPort)
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsModelForROP::GetProxyPort()"));
+    return GetIntegerValue(EMPRopProxyPort, aPort);
+    }
+        
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::SetDefaultAp
+// -----------------------------------------------------------------------------
+//
+TInt CMPSettingsModelForROP::SetDefaultAp(TUint32 aApId)
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::SetDefaultAp(%d)"),aApId);
+    TInt error = KErrNone;
+
+    TUint32 tmp = 0;
+    TRAP( error, tmp = IapIdFromWapIdL( aApId ) );
+    if ( !error )
+        {
+        error = SetIntegerValue(EMPRopDefaultAP, tmp );
+        }
+    
+    MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::SetDefaultAp() ret %d"),error);
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::GetDefaultAp
+// -----------------------------------------------------------------------------
+//
+TInt CMPSettingsModelForROP::GetDefaultAp(TUint32& aApId)
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsModelForROP::GetDefaultAp()"));
+    TInt tmp = 0;
+      
+	TInt error = GetIntegerValue(EMPRopDefaultAP, tmp);
+    MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::GetDefaultAp - Got iap id %d"),tmp);
+	if ( tmp != 0 )
+	    {
+		TRAP( error, aApId = WapIdFromIapIdL(static_cast<TUint32>(tmp)) );
+	    }
+	else {
+        aApId = 0;
+        }
+    
+	return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::SetBandwidthControlMode
+// -----------------------------------------------------------------------------
+//
+TInt CMPSettingsModelForROP::SetBandwidthControlMode(TInt /*aMode*/)
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsModelForROP::SetBandwidthControlMode()"));
+    return KErrNotSupported;
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::GetBandwidthControlMode
+// -----------------------------------------------------------------------------
+//
+TInt CMPSettingsModelForROP::GetBandwidthControlMode(TInt& /*aMode*/)
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsModelForROP::GetBandwidthControlMode()"));
+    return KErrNotSupported;
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::SetMaxBandwidth
+// -----------------------------------------------------------------------------
+//
+TInt CMPSettingsModelForROP::SetMaxBandwidth(TInt aMaxBw, TDataBearer aBearer)
+    {
+    MPX_DEBUG3(_L("#MS# CMPSettingsModelForROP::SetMaxBandwidth(%d,%d)"),aMaxBw,aBearer);
+    TInt error = KErrNone;
+
+    switch (aBearer)
+        {
+        case EBearerGPRS:
+            error = SetIntegerValue(EMPRopGPRSMaxBw, aMaxBw);
+            break;
+        case EBearerEGPRS:
+            error = SetIntegerValue(EMPRopEGPRSMaxBw, aMaxBw);
+            break;
+        case EBearerWCDMA:
+            error = SetIntegerValue(EMPRopWCDMAMaxBw, aMaxBw);
+            break;
+        case EBearerWLAN:
+            error = SetIntegerValue(EMPRopWLANMaxBw, aMaxBw);
+            break;
+        case EBearerHSDPA:
+            error = SetIntegerValue(EMPRopHSDPAMaxBw, aMaxBw);
+            break;
+        default:
+            error = KErrNotSupported;
+            break;
+        }
+    
+    MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::SetMaxBandwidth() ret %d"),error);
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::GetMaxBandwidth
+// -----------------------------------------------------------------------------
+//
+TInt CMPSettingsModelForROP::GetMaxBandwidth(TInt& aMaxBw, TDataBearer aBearer)
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsModelForROP::GetMaxBandwidth()"));
+    TInt error = KErrNone;
+    
+    switch (aBearer)
+        {
+        case EBearerGPRS:
+            error = GetIntegerValue(EMPRopGPRSMaxBw, aMaxBw);
+            break;
+        case EBearerEGPRS:
+            error = GetIntegerValue(EMPRopEGPRSMaxBw, aMaxBw);
+            break;
+        case EBearerWCDMA:
+            error = GetIntegerValue(EMPRopWCDMAMaxBw, aMaxBw);
+            break;
+        case EBearerWLAN:
+            error = GetIntegerValue(EMPRopWLANMaxBw, aMaxBw);
+            break;
+        case EBearerHSDPA:
+            error = GetIntegerValue(EMPRopHSDPAMaxBw, aMaxBw);
+            break;
+        default:
+            error = KErrNotSupported;
+            break;
+        }
+
+    MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::GetMaxBandwidth() ret %d"),error);
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::SetConnectionTimeout
+// -----------------------------------------------------------------------------
+//
+TInt CMPSettingsModelForROP::SetConnectionTimeout(TInt aTimeout)
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::SetConnectionTimeout(%d)"),aTimeout);
+    return SetIntegerValue(EMPRopConnTimeout, aTimeout * KMPRopSecondsMultiplier);
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::GetConnectionTimeout
+// -----------------------------------------------------------------------------
+//
+TInt CMPSettingsModelForROP::GetConnectionTimeout(TInt& aTimeout)
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsModelForROP::GetConnectionTimeout()"));
+    TInt error = GetIntegerValue(EMPRopConnTimeout, aTimeout);
+    if (!error)
+        {
+        aTimeout = aTimeout / KMPRopSecondsMultiplier;
+        }
+
+    MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::GetConnectionTimeout() ret %d"),error);
+    return error;
+    }
+        
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::SetServerTimeout
+// -----------------------------------------------------------------------------
+//
+TInt CMPSettingsModelForROP::SetServerTimeout(TInt aTimeout)
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::SetServerTimeout(%d)"),aTimeout);
+    return SetIntegerValue(EMPRopServerTimeout, aTimeout * KMPRopSecondsMultiplier);
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::GetServerTimeout
+// -----------------------------------------------------------------------------
+//
+TInt CMPSettingsModelForROP::GetServerTimeout(TInt& aTimeout)
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsModelForROP::GetServerTimeout()"));
+    TInt error = GetIntegerValue(EMPRopServerTimeout, aTimeout);
+    if (!error)
+        {
+        aTimeout = aTimeout / KMPRopSecondsMultiplier;
+        }
+
+    MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::GetServerTimeout() ret %d"),error);
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::SetMinUDPPort
+// -----------------------------------------------------------------------------
+//
+TInt CMPSettingsModelForROP::SetMinUDPPort(TInt aPort)
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::SetMinUDPPort(%d)"),aPort);
+    return SetIntegerValue(EMPRopMinUDPPort, aPort);
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::GetMinUDPPort
+// -----------------------------------------------------------------------------
+//
+TInt CMPSettingsModelForROP::GetMinUDPPort(TInt& aPort)
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsModelForROP::GetMinUDPPort()"));
+    return GetIntegerValue(EMPRopMinUDPPort, aPort);
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::SetMaxUDPPort
+// -----------------------------------------------------------------------------
+//
+TInt CMPSettingsModelForROP::SetMaxUDPPort(TInt aPort)
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::SetMaxUDPPort(%d)"),aPort);
+    return SetIntegerValue(EMPRopMaxUDPPort, aPort);
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::GetMaxUDPPort
+// -----------------------------------------------------------------------------
+//
+TInt CMPSettingsModelForROP::GetMaxUDPPort(TInt& aPort)
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsModelForROP::GetMaxUDPPort()"));
+    return GetIntegerValue(EMPRopMaxUDPPort, aPort);
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::GetControllerVersionInfo
+// -----------------------------------------------------------------------------
+//
+TInt CMPSettingsModelForROP::GetControllerVersionInfo(TDes& aVersion)
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::GetControllerVersionInfo(%S)"),&aVersion);
+    return GetStringValue(EMPRopCntrlVersion, aVersion);
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::GetControllerBuildDate
+// -----------------------------------------------------------------------------
+//
+TInt CMPSettingsModelForROP::GetControllerBuildDate(TDes& aBldDate)
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::GetControllerBuildDate(%S)"),&aBldDate);
+    return GetStringValue(EMPRopCntrlBldDate, aBldDate);
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::GetControllerAdditionalInfo
+// -----------------------------------------------------------------------------
+//
+TInt CMPSettingsModelForROP::GetControllerAdditionalInfo(TDes& aAdditionalInfo)
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::GetControllerAdditionalInfo(%S)"),&aAdditionalInfo);
+    return GetStringValue(EMPRopCntrlPlatform, aAdditionalInfo);
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::SetDemandBwFactor
+// -----------------------------------------------------------------------------
+//
+TInt CMPSettingsModelForROP::SetDemandBwFactor(TInt aFactor)
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::SetDemandBwFactor(%d)"),aFactor);
+    return SetIntegerValue(EMPRopDemandBwFactor, aFactor);
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::GetDemandBwFactor
+// -----------------------------------------------------------------------------
+//
+TInt CMPSettingsModelForROP::GetDemandBwFactor(TInt& aFactor)
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsModelForROP::GetDemandBwFactor()"));
+    return GetIntegerValue(EMPRopDemandBwFactor, aFactor);
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::SetSustainBandwidth
+// -----------------------------------------------------------------------------
+//
+TInt CMPSettingsModelForROP::SetSustainBandwidth(TInt aSustainBw, TDataBearer aBearer)
+    {
+    MPX_DEBUG3(_L("#MS# CMPSettingsModelForROP::SetSustainBandwidth(%d,%d)"),aSustainBw,aBearer);
+    TInt error = KErrNone;
+
+    switch (aBearer)
+        {
+        case EBearerGPRS:
+            error = SetIntegerValue(EMPRopGPRSSustainBw, aSustainBw);
+            break;
+        case EBearerEGPRS:
+            error = SetIntegerValue(EMPRopEGPRSSustainBw, aSustainBw);
+            break;
+        case EBearerWCDMA:
+            error = SetIntegerValue(EMPRopWCDMASustainBw, aSustainBw);
+            break;
+        case EBearerWLAN:
+            error = SetIntegerValue(EMPRopWLANSustainBw, aSustainBw);
+            break;
+        case EBearerHSDPA:
+            error = SetIntegerValue(EMPRopHSDPASustainBw, aSustainBw);
+            break;
+        default:
+            error = KErrNotSupported;
+            break;
+        }
+    
+    MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::SetSustainBandwidth() ret %d"),error);
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::GetSustainBandwidth
+// -----------------------------------------------------------------------------
+//
+TInt CMPSettingsModelForROP::GetSustainBandwidth(TInt& aSustainBw, TDataBearer aBearer)
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsModelForROP::GetSustainBandwidth()"));
+    TInt error = KErrNone;
+    
+    switch (aBearer)
+        {
+        case EBearerGPRS:
+            error = GetIntegerValue(EMPRopGPRSSustainBw, aSustainBw);
+            break;
+        case EBearerEGPRS:
+            error = GetIntegerValue(EMPRopEGPRSSustainBw, aSustainBw);
+            break;
+        case EBearerWCDMA:
+            error = GetIntegerValue(EMPRopWCDMASustainBw, aSustainBw);
+            break;
+        case EBearerWLAN:
+            error = GetIntegerValue(EMPRopWLANSustainBw, aSustainBw);
+            break;
+        case EBearerHSDPA:
+            error = GetIntegerValue(EMPRopHSDPASustainBw, aSustainBw);
+            break;
+        default:
+            error = KErrNotSupported;
+            break;
+        }
+
+    MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::GetSustainBandwidth() ret %d"),error);
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::GetSustainBwPresetsL
+// -----------------------------------------------------------------------------
+//
+TInt CMPSettingsModelForROP::GetSustainBwPresetsL(RArray<TInt>& aBwArray, TDataBearer aBearer)
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsModelForROP::GetSustainBwPresetsL()"));
+    TInt error = KErrNone;
+    
+    switch (aBearer)
+        {
+        case EBearerGPRS:
+            error = GetArrayL(EMPRopGPRSSustainBwPresets, aBwArray);
+            break;
+        case EBearerEGPRS:
+            error = GetArrayL(EMPRopEGPRSSustainBwPresets, aBwArray);
+            break;
+        case EBearerWCDMA:
+            error = GetArrayL(EMPRopWCDMASustainBwPresets, aBwArray);
+            break;
+        case EBearerWLAN:
+            error = GetArrayL(EMPRopWLANSustainBwPresets, aBwArray);
+            break;
+        case EBearerHSDPA:
+            error = GetArrayL(EMPRopHSDPASustainBwPresets, aBwArray);
+            break;
+        default:
+            error = KErrNotSupported;
+            break;
+        }
+
+    MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::GetSustainBwPresetsL() ret %d"),error);
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::GetMaxBwPresetsL
+// -----------------------------------------------------------------------------
+//
+TInt CMPSettingsModelForROP::GetMaxBwPresetsL(RArray<TInt>& aBwArray, TDataBearer aBearer)
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsModelForROP::GetMaxBwPresetsL()"));
+    TInt error = KErrNone;
+    
+    switch (aBearer)
+        {
+        case EBearerGPRS:
+            error = GetArrayL(EMPRopGPRSMaxBwPresets, aBwArray);
+            break;
+        case EBearerEGPRS:
+            error = GetArrayL(EMPRopEGPRSMaxBwPresets, aBwArray);
+            break;
+        case EBearerWCDMA:
+            error = GetArrayL(EMPRopWCDMAMaxBwPresets, aBwArray);
+            break;
+        case EBearerWLAN:
+            error = GetArrayL(EMPRopWLANMaxBwPresets, aBwArray);
+            break;
+        case EBearerHSDPA:
+            error = GetArrayL(EMPRopHSDPAMaxBwPresets, aBwArray);
+            break;
+        default:
+            error = KErrNotSupported;
+            break;
+        }
+
+    MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::GetMaxBwPresetsL() ret %d"),error);
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::SetIntegerValue
+// -----------------------------------------------------------------------------
+//
+TInt CMPSettingsModelForROP::SetIntegerValue(TInt aId, TInt aValue)
+    {
+    MPX_DEBUG3(_L("#MS# CMPSettingsModelForROP::SetIntegerValue(%d,%d)"),aId,aValue);
+    CMPRopSettingItem* item = NULL;
+    TInt error = GetItem(aId, item);
+
+    if (!error)
+        {
+        item->iIntValue = aValue;
+        item->iValueChanged = ETrue;
+        item->iError = KErrNone; 
+        }
+   
+    MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::SetIntegerValue() ret %d"),error);
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::GetIntegerValue
+// -----------------------------------------------------------------------------
+//
+TInt CMPSettingsModelForROP::GetIntegerValue(TInt aId, TInt& aValue)
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::GetIntegerValue(%d)"),aId);
+    CMPRopSettingItem* item = NULL;
+    TInt error = GetItem(aId, item);
+    
+    if (!error)
+        {
+        error = item->iError;
+        }
+
+    if (!error)
+        {
+        if (item->iType == EMPRopConfTypeInteger)
+            {
+            aValue = item->iIntValue;
+            }
+        else
+            {
+            // Setting value's type is not integer
+            error = KErrNotFound;
+            }
+        }
+
+    MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::GetIntegerValue() ret %d"),error);
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::GetStringValue
+// -----------------------------------------------------------------------------
+//
+TInt CMPSettingsModelForROP::GetStringValue(TInt aId, TDes& aString)
+    {
+    MPX_DEBUG3(_L("#MS# CMPSettingsModelForROP::GetStringValue(%d,%S)"),aId,&aString);
+    CMPRopSettingItem* item = NULL;
+    TInt error = GetItem(aId, item);
+    
+    if (!error)
+        {
+        error = item->iError;
+        }
+    
+    if (!error)
+        {
+        if (item->iType == EMPRopConfTypeString)
+            {
+            HBufC* string = item->iStringValue;
+
+            if (aString.MaxLength() >= string->Length())
+                {
+                aString.Copy(*string);    
+                }
+            else
+                {
+                error = KErrOverflow;
+                }
+            }
+        else
+            {
+           // Setting value's type is not string
+            error = KErrNotFound;
+            }
+        }
+
+    MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::GetStringValue() ret %d"),error);
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::GetArrayL
+// -----------------------------------------------------------------------------
+//
+TInt CMPSettingsModelForROP::GetArrayL(TInt aId, RArray<TInt>& aArray)
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsModelForROP::GetArrayL()"));
+    CMPRopSettingItem* item = NULL;
+    TInt error = GetItem(aId, item);
+    
+    if (!error)
+        {
+        error = item->iError;
+        }
+
+    if (!error)
+        {
+        if (item->iType == EMPRopConfTypeIntArray)
+            {
+            TInt count = item->iIntArray.Count();
+            aArray.Reset();
+
+            for (TInt index = 0; index < count; ++index)
+                {
+                User::LeaveIfError(aArray.Append(item->iIntArray[index]));
+                }
+            }
+        else
+            {
+            error = KErrNotFound;
+            }
+        }
+
+    MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::GetArrayL() ret %d"),error);
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::GetItem
+// -----------------------------------------------------------------------------
+//
+TInt CMPSettingsModelForROP::GetItem(TInt aId, CMPRopSettingItem*& aItem)
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::GetItem(%d)"),aId);
+    CMPRopSettingItem* item = NULL;
+    TInt count = iItems->Count();
+    TInt error = KErrNone;
+    aItem = NULL;
+
+    for (TInt index = 0; index < count; ++index)
+        {
+        item = iItems->At(index);
+
+        if (aId == item->iId)
+            {
+            aItem = item;
+            break;
+            }
+        }
+
+    if (!aItem)
+        {
+        error = KErrNotFound;
+        }
+
+    MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::GetItem() ret %d"),error);
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::SetAutoDisconTimeL
+// -----------------------------------------------------------------------------
+//
+
+void CMPSettingsModelForROP::SetAutoDisconTimeL( const TInt aTime )
+    {   
+    MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::SetAutoDisconTimeL(%d)"),aTime);
+    if ( iClient->Set( KMPAutoDisconnectTime, aTime ) == KErrNotFound )
+        {
+        User::LeaveIfError( iClient->Create( KMPAutoDisconnectTime, aTime ) );   
+        }       
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::AutoDisconTimeL
+// -----------------------------------------------------------------------------
+//
+
+TInt CMPSettingsModelForROP::AutoDisconTimeL()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsModelForROP::AutoDisconTimeL()"));
+    TInt time = 0;
+    User::LeaveIfError( iClient->Get( KMPAutoDisconnectTime, time ) );   
+    MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::AutoDisconTimeL() ret %d"),time);
+    return time;
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::SetVideoRepeatL
+// -----------------------------------------------------------------------------
+//
+
+void CMPSettingsModelForROP::SetVideoRepeatL( TBool aRepeat )
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::SetVideoRepeatL(%d)"),aRepeat);
+    iClient->Set( KMPRepeat, aRepeat );  
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::IsVideoRepeatOnL
+// -----------------------------------------------------------------------------
+//
+
+TBool CMPSettingsModelForROP::IsVideoRepeatOnL()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsModelForROP::IsVideoRepeatOnL()"));
+    TInt repeat;
+    User::LeaveIfError( iClient->Get( KMPRepeat, repeat ) );   
+    MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::IsVideoRepeatOnL() ret %d"),repeat);
+    return repeat;
+    }
+
+// ----------------------------------------------------------------------------
+// CMPSettingsModelForROP::InitializeCentralRepositoryL
+//
+// Creating and setting keys for the Central Repository
+// ----------------------------------------------------------------------------
+//
+void CMPSettingsModelForROP::InitializeCentralRepositoryL()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsModelForROP::InitializeCentralRepositoryL()"));
+    iClient = CRepository::NewL( KCRUidMediaPlayerSettings );
+    iMediaPlayerClient = CRepository::NewL( KCRUidMediaPlayerFeatures );
+    }
+
+// ----------------------------------------------------------------------------
+// CMPSettingsModelForROP::UninitializeCentralRepositoryL
+//
+// Removes Central Repository objects
+// ----------------------------------------------------------------------------
+//
+void CMPSettingsModelForROP::UninitializeCentralRepository()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsModelForROP::UninitializeCentralRepository()"));
+    delete iClient;
+    iClient = NULL;
+
+	delete iMediaPlayerClient;
+	iMediaPlayerClient = NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::SetDefaultViewL
+// -----------------------------------------------------------------------------
+//
+void CMPSettingsModelForROP::SetDefaultViewL( TBool aView )
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::SetDefaultViewL(%d)"),aView);
+    iClient->Set( KMPDefaultView, aView );  
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::IsDefaultViewOnL
+// -----------------------------------------------------------------------------
+//
+TBool CMPSettingsModelForROP::IsDefaultViewOnL()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsModelForROP::IsDefaultViewOnL()"));
+    TInt view;
+	User::LeaveIfError( iClient->Get( KMPDefaultView, view ) );   
+	MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::IsDefaultViewOnL() ret %d"),view);
+    return view;
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::SetRockerKeysL
+// -----------------------------------------------------------------------------
+//
+void CMPSettingsModelForROP::SetRockerKeysL( TBool aRockerKeys )
+    {
+    iClient->Set( KMPRockerKeys, aRockerKeys );  
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::ShowRockerKeysL
+// -----------------------------------------------------------------------------
+//
+TBool CMPSettingsModelForROP::ShowRockerKeysL()
+    {
+	if (IsRockerKeysSupportedL())
+		{
+		TInt rockerKeys;
+		User::LeaveIfError( iClient->Get( KMPRockerKeys, rockerKeys ) );   
+		return rockerKeys;
+		}
+	else
+		{
+		return EFalse;
+		}
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::IsRockerKeysSupportedL
+// -----------------------------------------------------------------------------
+//
+TBool CMPSettingsModelForROP::IsRockerKeysSupportedL()
+    {
+	TBool isRockerKeysSupported( EFalse );
+    TInt value( 0 );
+    // Check if feature is enabled. See MediaPlayerVariant.hrh.
+    if ( !iMediaPlayerClient->Get( KMPLocalVariation, value ) )
+		{
+        isRockerKeysSupported = static_cast<TBool> ( value & KMediaPlayerRockerKeys );
+		}
+
+	RDebug::Print(_L("#MP# CMPSettingsModelForROP::CMPSettingsModelForROP(): return %d"),isRockerKeysSupported);
+    return isRockerKeysSupported;
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsModelForROP::LocateResourceFileL
+// -----------------------------------------------------------------------------
+//
+void CMPSettingsModelForROP::LocateResourceFileL( TFileName& aFileName, RFs& aFs )
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsModelForROP::LocateResourceFileL()"));
+    
+    // Get the path & file name with the drive not specified.
+    TParse parse;
+    parse.Set( KMPSettROPResource, &KDC_RESOURCE_FILES_DIR, NULL );
+    TPtrC rscFile = parse.FullName();
+
+    // This is done to ensure upgraded file is used first.
+    TFindFile find( aFs );
+    TInt err = find.FindByDir( rscFile, KNullDesC );
+    
+    if ( err )
+        {
+        MPX_DEBUG1(_L("#MS# CMPSettingsModelForROP::LocateResourceFileL() LEAVE: KErrNotFound"));
+        User::Leave( KErrNotFound );
+        }
+    else
+        {
+        aFileName.Append( find.File() );
+        }
+    MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::LocateResourceFileL(%S)"),&aFileName);
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxConnUtilImpl::WapIdFromIapIdL
+// -----------------------------------------------------------------------------
+//
+TUint32 CMPSettingsModelForROP::WapIdFromIapIdL( TUint32 aIapId )
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::WapIdFromIapIdL(%d)"),aIapId);
+    
+    TUint32 wap = 0;
+#ifdef __WINSCW__    
+    wap = aIapId;
+#else    
+    
+    CMDBSession* db = CMDBSession::NewL( CMDBSession::LatestVersion() );
+    CleanupStack::PushL( db );
+    
+    // WapIpBearer table contains the mapping between wap and iap id's.
+    CCDWAPIPBearerRecord* wapBearerRecord = 
+        static_cast<CCDWAPIPBearerRecord*>( CCDRecordBase::RecordFactoryL( KCDTIdWAPIPBearerRecord ) );
+        
+    CleanupStack::PushL( wapBearerRecord );
+    
+    wapBearerRecord->iWAPIAP = aIapId;
+    
+    TBool found = wapBearerRecord->FindL( *db );
+    if ( !found )
+        {
+        User::Leave(KErrNotFound);
+        }
+
+    wap = static_cast<TUint32>( wapBearerRecord->iWAPAccessPointId );
+    
+    CleanupStack::PopAndDestroy( wapBearerRecord );
+    CleanupStack::PopAndDestroy( db );
+
+#endif    
+    
+    MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::IapIdFromWapIdL() - return wap id: %d "), wap);
+    return wap;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxConnUtilImpl::IapIdFromWapIdL
+// -----------------------------------------------------------------------------
+//
+TUint32 CMPSettingsModelForROP::IapIdFromWapIdL( TUint32 aWapId )
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::IapIdFromWapIdL(%d)"),aWapId);
+    
+    TUint32 iap = 0;
+#ifdef __WINSCW__
+    iap = aWapId;
+#else    
+    CMDBSession* db = CMDBSession::NewL( CMDBSession::LatestVersion() );
+    CleanupStack::PushL( db );
+    
+    // WapIpBearer table contains the mapping between wap and iap id's.
+    CCDWAPIPBearerRecord* wapBearerRecord = 
+        static_cast<CCDWAPIPBearerRecord*>( CCDRecordBase::RecordFactoryL( KCDTIdWAPIPBearerRecord ) );
+        
+    CleanupStack::PushL( wapBearerRecord );
+    
+    wapBearerRecord->iWAPAccessPointId = aWapId;
+    
+    TBool found = wapBearerRecord->FindL( *db );
+    
+    if ( !found )
+        {
+        User::Leave(KErrNotFound);
+        }
+
+    iap = static_cast<TUint32>( wapBearerRecord->iWAPIAP );
+    
+    CleanupStack::PopAndDestroy( wapBearerRecord );
+    CleanupStack::PopAndDestroy( db );
+
+#endif
+    
+    MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::IapIdFromWapIdL() - return iap id: %d "), iap);
+    return iap;
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsengine/src/MPSettingsModelForRopImplementationProxy.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2002 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 group proxy for ROP specific media settings model*
+*/
+
+
+// Version : %version: 3 %
+
+
+
+
+// INCLUDE FILES
+#include    <e32std.h>
+#include    <implementationproxy.h>
+#include    "MPSettEngPluginImplementationUIDs.hrh"
+#include    "MPSettingsModelForROP.h"
+
+
+// CONSTANTS
+// Table of available ECOM plugin implementations for CMPSettingsModel in this DLL.
+const TImplementationProxy ImplementationTable[] =
+    {
+    IMPLEMENTATION_PROXY_ENTRY(KMPSettEngImplUidROP, CMPSettingsModelForROP::NewL)
+    };
+
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// ImplementationProxy
+// ECOM implementation table entry.
+// 
+// Returns: Table of available ECOM plugin implementations for CMPSettingsModel
+// in this DLL.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+    {
+    aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+
+    return ImplementationTable;
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsengine/src/MPSettingsRopConfigParser.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,633 @@
+/*
+* Copyright (c) 2002 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:   Config descriptor parser for ROP specific settings.*
+*/
+
+
+// Version : %version: 4 %
+
+
+
+
+// INCLUDE FILES
+#include    <utf.h>
+#include    "MPSettingsRopConfigParser.h"
+#include	"mpxlog.h"
+
+// CONSTANTS
+const TInt KMPRopEntryArrayGranularity = 16;
+
+_LIT8(KMPRopTypeInteger, "Integer");
+_LIT8(KMPRopTypeString, "String");
+_LIT8(KMPRopEntrySeparator, ";");
+_LIT8(KMPRopKeySeparator, ":");
+_LIT8(KMPRopValueSeparator, "=");
+_LIT8(KMPRopStringConstrainer, "\"");
+_LIT8(KMPRopArrayOpeningMarker, "{");
+_LIT8(KMPRopArrayClosingMarker, "}");
+_LIT8(KMPRopArraySeparator, ",");
+_LIT8(KMPRopIntegerEntryPrototype, "%S:Integer = %d;");
+_LIT8(KMPRopStringEntryPrototype, "%S:String = \"%S\";");
+
+const TInt KMPRopIntegerEntryPrototypeStaticLength = 23; // static length + 11 chars for the (32bit) TInt
+const TInt KMPRopStringEntryPrototypeStaticLength = 13;
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// *******************************
+// *** class CMPRopSettingItem ***
+// *******************************
+
+// -----------------------------------------------------------------------------
+// CMPRopSettingItem::CMPRopSettingItem
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CMPRopSettingItem::CMPRopSettingItem(TInt aId) : iId(aId),
+    iValueChanged(EFalse)
+    {
+    MPX_DEBUG1(_L("#MS# CMPRopSettingItem::CMPRopSettingItem()"));
+    }
+
+// -----------------------------------------------------------------------------
+// CMPRopSettingItem::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CMPRopSettingItem::ConstructL(const TDesC& aKey)
+    {
+    MPX_DEBUG2(_L("#MS# CMPRopSettingItem::ConstructL(%S)"),&aKey);
+    iKey = HBufC8::NewL(aKey.Length());
+    TPtr8 ptr = iKey->Des();
+    CnvUtfConverter::ConvertFromUnicodeToUtf8(ptr, aKey);
+    }
+
+// -----------------------------------------------------------------------------
+// CMPRopSettingItem::NewLC
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CMPRopSettingItem* CMPRopSettingItem::NewLC(TInt aId, const TDesC& aKey)
+    {
+    MPX_DEBUG3(_L("#MS# CMPRopSettingItem::NewLC(%d,%S)"),aId,&aKey);
+    CMPRopSettingItem* self = new(ELeave) CMPRopSettingItem(aId);
+    
+    CleanupStack::PushL(self);
+    self->ConstructL(aKey);
+
+    return self;
+    }
+   
+// -----------------------------------------------------------------------------
+// CMPRopSettingItem::~CMPRopSettingItem
+// Destructor
+// -----------------------------------------------------------------------------
+//
+CMPRopSettingItem::~CMPRopSettingItem()
+    {
+    MPX_DEBUG1(_L("#MS# CMPRopSettingItem::~CMPRopSettingItem()"));
+    if (iKey) 
+		{
+		delete iKey;
+		}
+    delete iStringValue;
+    iIntArray.Close();
+    }
+
+
+// ****************************************
+// *** class CMPSettingsRopConfigParser ***
+// ****************************************
+
+// -----------------------------------------------------------------------------
+// CMPSettingsRopConfigParser::CMPSettingsRopConfigParser
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CMPSettingsRopConfigParser::CMPSettingsRopConfigParser()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsRopConfigParser::CMPSettingsRopConfigParser()"));
+    }
+   
+// -----------------------------------------------------------------------------
+// CMPSettingsRopConfigParser::~CMPSettingsRopConfigParser
+// Destructor
+// -----------------------------------------------------------------------------
+//
+CMPSettingsRopConfigParser::~CMPSettingsRopConfigParser()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsRopConfigParser::~CMPSettingsRopConfigParser()"));
+	if (iEntries)
+      iEntries->ResetAndDestroy();
+    delete iEntries;
+    delete iTmpBuf;
+    delete iConfigHeader;
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsRopConfigParser::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CMPSettingsRopConfigParser::ConstructL()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsRopConfigParser::ConstructL()"));
+    iEntries = new(ELeave) CArrayPtrFlat<HBufC8>(KMPRopEntryArrayGranularity);
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsRopConfigParser::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CMPSettingsRopConfigParser* CMPSettingsRopConfigParser::NewL()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsRopConfigParser::NewL()"));
+    CMPSettingsRopConfigParser* self = new(ELeave) CMPSettingsRopConfigParser;
+    
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsRopConfigParser::ParseConfigStringL
+// -----------------------------------------------------------------------------
+//
+HBufC8* CMPSettingsRopConfigParser::ParseConfigStringL(const TDesC8& aConfigString, const CArrayPtr<CMPRopSettingItem>* aItemArray)
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsRopConfigParser::ParseConfigStringL()"));
+    iBufferPtr.Set(aConfigString);
+    iItemArray = aItemArray;
+    
+    // Parse header
+    HBufC8* header = ParseConfigHeaderL();
+    CleanupStack::PushL(header);
+
+    // Read all config entries to an array
+    PopulateEntryArrayFromConfigStringL();
+
+    // Parse config entries from the array, delete items from the entry array
+    ParseSettingsBufferL();
+    iEntries->ResetAndDestroy();
+
+    CleanupStack::Pop(); // header
+
+    return header;
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsRopConfigParser::CreateConfigStringL
+// -----------------------------------------------------------------------------
+//
+HBufC8* CMPSettingsRopConfigParser::CreateConfigStringL(const CArrayPtr<CMPRopSettingItem>* aItemArray, const TDesC8& aConfigHeader)
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsRopConfigParser::CreateConfigStringL()"));
+    HBufC8* configString = NULL;
+    iItemArray = aItemArray;
+
+    delete iConfigHeader;
+    iConfigHeader = NULL;
+    iConfigHeader = HBufC8::NewL(aConfigHeader.Length() + 1); // magic, leave room for line separator (';')
+    TPtr8 tmp = iConfigHeader->Des();
+
+    tmp.Append(aConfigHeader);
+    tmp.Append(KMPRopEntrySeparator);
+
+    PopulateEntryArrayFromItemArrayL();
+    
+    // If iEntries->Count() == 1 -> iEntries contains only config header ->
+    // none of the setting values has change => no need to create config string
+    if (iEntries->Count() > 1)
+        {
+        configString = CreateConfigStringFromEntryArrayL();
+        }
+
+    iEntries->ResetAndDestroy();
+
+    return configString;
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsRopConfigParser::ParseConfigHeaderL
+// -----------------------------------------------------------------------------
+//
+HBufC8* CMPSettingsRopConfigParser::ParseConfigHeaderL()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsRopConfigParser::ParseConfigHeaderL()"));
+    HBufC8* buf = NULL;
+    TPtrC8 ptr;
+    TInt error = GetNextEntry(ptr);
+    if (error)
+        {
+        // If header line cannot be found, the string is corrupted => Leave
+        User::Leave(KErrCorrupt);
+        }
+
+    buf = ptr.AllocL();
+    return buf;
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsRopConfigParser::NextConfigEntryL
+// -----------------------------------------------------------------------------
+//
+HBufC8* CMPSettingsRopConfigParser::NextConfigEntryL(TInt& aError)
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsRopConfigParser::NextConfigEntryL()"));
+    HBufC8* buf = NULL;
+
+    TPtrC8 ptr;
+    aError = GetNextEntry(ptr);
+
+    if (!aError)
+        {
+        buf = ptr.AllocL();
+        buf->Des().Trim();
+        }
+
+    return buf;
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsRopConfigParser::PopulateEntryArrayFromConfigStringL
+// -----------------------------------------------------------------------------
+//
+void CMPSettingsRopConfigParser::PopulateEntryArrayFromConfigStringL()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsRopConfigParser::PopulateEntryArrayFromConfigStringL()"));
+    TInt error(KErrNone);
+    iEntries->ResetAndDestroy();
+
+    do
+        {
+        HBufC8* buf = NextConfigEntryL(error);
+
+        if (!error)
+            {
+            iEntries->AppendL(buf);
+            }
+        }
+    while (!error);
+
+    if (error != KErrNotFound)
+        {
+        User::Leave(error);
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsRopConfigParser::PopulateEntryArrayFromItemArrayL
+// -----------------------------------------------------------------------------
+//
+void CMPSettingsRopConfigParser::PopulateEntryArrayFromItemArrayL()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsRopConfigParser::PopulateEntryArrayFromItemArrayL()"));
+    CMPRopSettingItem* item = NULL;
+    HBufC8* buf = NULL;
+    iEntries->ResetAndDestroy();
+
+    // Append config string header to array
+    iEntries->AppendL(iConfigHeader);
+    iConfigHeader = NULL;
+
+    TInt count = iItemArray->Count();
+    for (TInt i = 0; i < count; ++i)
+        {
+        item = iItemArray->At(i);
+
+        if (item->iValueChanged)
+            {
+            buf = CreateConfigEntryL(item);
+
+            if (buf)
+                {
+                CleanupStack::PushL(buf);
+                iEntries->AppendL(buf);
+                CleanupStack::Pop(); // buf
+                }
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsRopConfigParser::CreateConfigEntryL
+// -----------------------------------------------------------------------------
+//
+HBufC8* CMPSettingsRopConfigParser::CreateConfigEntryL(CMPRopSettingItem* aItem)
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsRopConfigParser::CreateConfigEntryL()"));
+    HBufC8* buf = NULL;
+
+    switch (aItem->iType)
+        {
+        case EMPRopConfTypeInteger:
+            {
+            buf = HBufC8::NewL(aItem->iKey->Length() + KMPRopIntegerEntryPrototypeStaticLength);
+            TPtr8 ptr = buf->Des();
+            ptr.Format(KMPRopIntegerEntryPrototype, aItem->iKey, aItem->iIntValue);
+            break;
+            }
+        case EMPRopConfTypeString:
+            {
+            HBufC* str = aItem->iStringValue;
+            HBufC8* str8 = CnvUtfConverter::ConvertFromUnicodeToUtf8L( *str );
+            CleanupStack::PushL( str8 );
+            TInt str8Length = str8->Length();
+            buf = HBufC8::NewL(aItem->iKey->Length() + str8Length + KMPRopStringEntryPrototypeStaticLength);
+            TPtr8 ptr = buf->Des();
+            ptr.Format(KMPRopStringEntryPrototype, aItem->iKey, &(*str8));
+            CleanupStack::PopAndDestroy( str8 );
+            break;
+            }
+        default:
+            break;
+        }
+
+    return buf;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMPSettingsRopConfigParser::GetNextEntry
+// -----------------------------------------------------------------------------
+//
+TInt CMPSettingsRopConfigParser::GetNextEntry(TPtrC8& aEntry)
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsRopConfigParser::GetNextEntry()"));
+    TInt error(KErrNone);
+
+    TInt offset = iBufferPtr.Find(KMPRopEntrySeparator);
+    if (offset != KErrNotFound)
+        {
+        aEntry.Set(iBufferPtr.Left(offset));
+        iBufferPtr.Set(iBufferPtr.Mid(++offset)); // don't include ';'
+        }
+    else
+        {
+        error = KErrNotFound;
+        }
+
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsRopConfigParser::ParseSettingsBufferL
+// -----------------------------------------------------------------------------
+//
+void CMPSettingsRopConfigParser::ParseSettingsBufferL()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsRopConfigParser::ParseSettingsBufferL()"));
+    CMPRopSettingItem* item;
+    TPtrC8 value;
+
+    TInt count = iItemArray->Count();
+    for (TInt i = 0; i < count; ++i)
+        {
+        item = iItemArray->At(i);
+
+        item->iError = GetConfigDataL(*item->iKey, value, item->iType);
+        
+        if (!item->iError)
+            {
+            switch (item->iType)
+                {
+                case EMPRopConfTypeInteger:
+                    {
+                    // Parse integer value
+                    TLex8 lex(value);
+                    item->iError = lex.Val(item->iIntValue);
+                    break;
+                    }
+                case EMPRopConfTypeIntArray:
+                    {
+                    HBufC8* tmp = NULL;
+                    TInt offset = 0; // Magic: should not be KErrNotFound initially
+                    TInt error = KErrNone;
+                    TInt intVal = 0;
+                    item->iIntArray.Reset();
+                    
+                    while (offset != KErrNotFound && !error)
+                        {
+                        offset = value.Find(KMPRopArraySeparator);
+
+                        if (offset != KErrNotFound)
+                            {
+                            tmp = value.Left(offset).AllocLC();
+                            }
+                        else
+                            {
+                            tmp = value.AllocLC();
+                            }
+
+                        tmp->Des().Trim();
+                        TLex8 lex(*tmp);
+                        error = lex.Val(intVal);
+
+                        if (!error)
+                            {
+                            User::LeaveIfError(item->iIntArray.Append(intVal));
+
+                            if (offset != KErrNotFound)
+                                {
+                                value.Set(value.Mid(offset + 1));
+                                }
+                            }
+
+                        CleanupStack::PopAndDestroy(); // tmp
+                        tmp = NULL;
+                        }
+                    
+                    item->iError = error;
+                    break;
+                    }
+                case EMPRopConfTypeString:
+                    // Parse string value
+                    value.Set(ValueStringPtr(value, item->iError));
+
+                    if (!item->iError)
+                        {
+                        delete item->iStringValue;
+                        item->iStringValue = NULL;
+                        item->iStringValue = HBufC::NewL(value.Length());
+    
+                        TPtr tmp = item->iStringValue->Des();
+                        CnvUtfConverter::ConvertToUnicodeFromUtf8(tmp, value);
+                        }
+                    break;
+                default:
+                    item->iError = KErrNotSupported;
+                    break;
+                }
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsRopConfigParser::GetConfigDataL
+// -----------------------------------------------------------------------------
+//
+TInt CMPSettingsRopConfigParser::GetConfigDataL(const TDesC8& aKey, TPtrC8& aValue, TMPRopConfType& aType)
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsRopConfigParser::GetConfigDataL()"));
+    TInt ret = KErrNotFound;
+    TInt offset = KErrNotFound;
+    HBufC8* buf = NULL;
+
+    // Try to find aConfigKey from the beginning of each entry untill one is found
+    // (offset has to be 0, as there can be several different config keys that
+    // include some other config key, e.g. "Timeout" vs. "ConnTimeout").
+    for (TInt i = 0; offset != 0 && i < iEntries->Count(); i++)
+        {
+        buf = iEntries->At(i);
+        offset = buf->Find(aKey);
+        }
+
+    // Parse type and value if correct key was found
+    if (offset == 0)
+        {
+        offset = buf->Find(KMPRopKeySeparator);
+        TInt offset2 = buf->Find(KMPRopValueSeparator);
+        TInt arrayOffset = buf->Find(KMPRopArrayOpeningMarker);
+
+        if (offset != KErrNotFound && offset2 != KErrNotFound && offset < offset2)
+            {
+            ++offset; // Move past the key separator
+
+            delete iTmpBuf;
+            iTmpBuf = NULL;
+            iTmpBuf = buf->Mid(offset, offset2 - offset).AllocL();
+            iTmpBuf->Des().Trim();
+            
+            // Parse type
+            if (*iTmpBuf == TPtrC8(KMPRopTypeInteger))
+                {
+                if (arrayOffset == KErrNotFound)
+                    {
+                    aType = EMPRopConfTypeInteger;
+                    }
+                else
+                    {
+                    aType = EMPRopConfTypeIntArray;
+                    }
+                }
+            else if (*iTmpBuf == TPtrC8(KMPRopTypeString))
+                {
+                aType = EMPRopConfTypeString;
+                }
+            else
+                {
+                ret = KErrNotSupported;
+                }
+ 
+            if (ret != KErrNotSupported)
+                {
+                // Parse value
+                delete iTmpBuf;
+                iTmpBuf = NULL;
+
+                if (aType == EMPRopConfTypeIntArray)
+                    {
+                    TInt arrayOffset2 = buf->Find(KMPRopArrayClosingMarker);
+
+                    if (arrayOffset2 != KErrNotFound && arrayOffset < arrayOffset2)
+                        {
+                        // Copy, but do not include markers
+                        iTmpBuf = buf->Mid(arrayOffset + 1, arrayOffset2 - arrayOffset - 1).AllocL();
+                        ret = KErrNone;
+                        }
+                    else
+                        {
+                        return KErrCorrupt;
+                        }
+                    }
+                else
+                    {
+                    iTmpBuf = buf->Mid(++offset2).AllocL(); // Move past the value separator
+                    ret = KErrNone;
+                    }
+
+                iTmpBuf->Des().Trim();
+
+                aValue.Set(*iTmpBuf);
+                }
+            }
+        }
+
+    return ret;
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsRopConfigParser::ValueStringPtr
+// -----------------------------------------------------------------------------
+//
+TPtrC8 CMPSettingsRopConfigParser::ValueStringPtr(const TDesC8& aValue, TInt& aError)
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsRopConfigParser::ValueStringPtr()"));
+    TPtrC8 ptr;
+    aError = KErrNotFound;
+    // Find first string constrainer
+    TInt offset = aValue.Find(KMPRopStringConstrainer);
+    
+    if (offset != KErrNotFound)
+        {
+        TPtrC8 tmp;
+        // 1.) Set offset1 to point the first character of the config string
+        // 2.) Set characters after the first string constrainer to tmp
+        tmp.Set(aValue.Mid(++offset));
+        // Find second string constrainer
+        offset = tmp.Find(KMPRopStringConstrainer);
+
+        if (offset != KErrNotFound)
+            {
+            // Set characters between the string constrainers to aString
+            ptr.Set(tmp.Left(offset));
+            aError = KErrNone;
+            }
+        }
+
+    return ptr;
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsRopConfigParser::CreateConfigStringFromEntryArrayL
+// -----------------------------------------------------------------------------
+//
+HBufC8* CMPSettingsRopConfigParser::CreateConfigStringFromEntryArrayL()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsRopConfigParser::CreateConfigStringFromEntryArrayL()"));
+    TInt length(0);
+    TInt count = iEntries->Count();
+    for (TInt i = 0; i < count; ++i)
+        {
+        length += iEntries->At(i)->Length();
+        }
+
+    HBufC8* configString = HBufC8::NewL(length);
+    TPtr8 ptr = configString->Des();
+
+    for (TInt j = 0; j < count; ++j)
+        {
+        ptr.Append(*iEntries->At(j));
+        }
+
+    return configString;
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsengine/tsrc/mediasettingsenginetest/Bwins/mpxmediasettingsenginetestu.def	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * LibEntryL(class CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsengine/tsrc/mediasettingsenginetest/EABI/mpxmediasettingsenginetestu.def	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsengine/tsrc/mediasettingsenginetest/conf/atsconf.txt	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,14 @@
+;Run \vado\videoplayer\tsrc\testing\tools\genATSdrop.pl from 
+;the tsrc folder to create ATS3 drop.
+[DROP]
+NAME VaDo - videoplayer - mediasettingsengine
+DEVICE INSERT_DEVICE
+FLASH INSERT_FLASH_IMAGE
+FLASH INSERT_FLASH_IMAGE
+FLASH INSERT_FLASH_IMAGE
+SIS \VideoApp_Domain\videoplayer\mpxvideoplayer\sis\VideoPlayer.sisx
+PKG group\mpxmediasettingsenginetest.pkg
+INI init\TestFramework.ini 200
+EMAIL INSERT_EMAIL
+RUN
+[ENDDROP]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsengine/tsrc/mediasettingsenginetest/conf/mpxmediasettingsenginetest.cfg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,721 @@
+#***********************************************************************************
+#
+# STIF test script file for testing MPSettROPModel.dll.
+#
+#***********************************************************************************
+
+[Define]
+ETrue				1
+EFalse				0
+
+EConfigDefault		0
+EConfigUser			1
+
+EDisabled			0
+EEnabled			1
+
+EDynamic			0
+EStatic				1
+
+EBearerGPRS			0
+EBearerEGPRS		1
+EBearerWCDMA		2
+EBearerCDMA			3
+EBearerCDMA2000		4
+EBearerWLAN			5
+EBearerHSDPA		6
+
+EIapInternet		"Internet"
+EIapWlan			"Wlan"
+[Enddefine]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10101 Load and Store settings EConfigDefault
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+test StoreSettings
+delete test
+[Endtest] 
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10102 LoadSettings EConfigDefault
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+delete test
+[Endtest] 
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10103 LoadSettings EConfigUser
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigUser
+delete test
+[Endtest] 
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10104 Load, modify and store settings, EConfigUser
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigUser
+test SetVideoContrast 50
+test SetProxyMode EFalse
+test SetProxyHostName Mulli
+test SetProxyPort 666
+test SetMaxBandwidth EBearerGPRS 100
+allowerrorcodes -5
+test SetBandwidthControlMode EDynamic 
+test SetDefaultAp EIapInternet
+test SetConnectionTimeout 5
+test SetServerTimeout 5
+test SetMinUDPPort 1
+test SetMaxUDPPort 10
+test SetDemandBwFactor 10
+allowerrorcodes -5
+test SetSustainBandwidth 100 EBearerGPRS
+test StoreSettings
+delete test
+[Endtest] 
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10105 ListImplementations
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+test ListImplementations
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10106 VideoContrast
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+test SetVideoContrast 0
+test GetVideoContrast 0
+delete test
+[Endtest] 
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10107 ProxyMode EEnabled
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+test SetProxyMode EEnabled
+test GetProxyMode EEnabled
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10108 ProxyMode EDisabled
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+test SetProxyMode EDisabled
+test GetProxyMode EDisabled
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10109 ProxyHostName
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+test SetProxyHostName Testi
+test GetProxyHostName Testi
+delete test
+[Endtest] 
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10110 ProxyPort
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+test SetProxyPort 1
+test GetProxyPort 1
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10111 DefaultAp
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+test SetDefaultAp EIapInternet
+test GetDefaultAp EIapInternet
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10112 BandwidthControlMode EDynamic
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+allownextresult -5
+test SetBandwidthControlMode EDynamic
+allownextresult -5
+test GetBandwidthControlMode EDynamic
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10113 BandwidthControlMode EStatic
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+allownextresult -5
+test SetBandwidthControlMode EStatic
+allownextresult -5
+test GetBandwidthControlMode EStatic
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET10114 MaxBandwidth GPRS
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+test SetMaxBandwidth EBearerGPRS 100
+test GetMaxBandwidth EBearerGPRS 100
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10115 MaxBandwidth EGPRS
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+test SetMaxBandwidth EBearerEGPRS 100
+test GetMaxBandwidth EBearerEGPRS 100
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10116 MaxBandwidth WCDMA
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+test SetMaxBandwidth EBearerWCDMA 100
+test GetMaxBandwidth EBearerWCDMA 100
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10117 MaxBandwidth CDMA
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+allowerrorcodes -5
+test SetMaxBandwidth EBearerCDMA 100
+allowerrorcodes -5
+test GetMaxBandwidth EBearerCDMA 100
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10118 MaxBandwidth CDMA2000
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+allowerrorcodes -5
+test SetMaxBandwidth EBearerCDMA2000 100
+allowerrorcodes -5
+test GetMaxBandwidth EBearerCDMA2000 100
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10119 MaxBandwidth WLAN
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+test SetMaxBandwidth EBearerWLAN 100
+test GetMaxBandwidth EBearerWLAN 100
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10120 MaxBandwidth HSDPA
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+test SetMaxBandwidth EBearerHSDPA 100
+test GetMaxBandwidth EBearerHSDPA 100
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10121 MaxBandwidth Invalid databearer
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+allownextresult -5
+test SetMaxBandwidth 616 100
+allownextresult -5
+test GetMaxBandwidth 616 100
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10122 ConnectionTimeout
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+test SetConnectionTimeout 5
+test GetConnectionTimeout 5
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10123 ServerTimeout
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+test SetServerTimeout 5
+test GetServerTimeout 5
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10124 MinUDPPort
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+test SetMinUDPPort 10
+test SetMinUDPPort 10
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10125 MaxUDPPort
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+test SetMaxUDPPort 1000
+test GetMaxUDPPort 1000
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10126 DemandBwFactor
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+test SetDemandBwFactor 10
+test GetDemandBwFactor 10
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10149 SustainBandwidth GPRS
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+allowerrorcodes -5
+test SetSustainBandwidth 100 EBearerGPRS
+allowerrorcodes -5
+test GetSustainBandwidth 100 EBearerGPRS
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10150 SustainBandwidth EGPRS
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+allowerrorcodes -5
+test SetSustainBandwidth 100 EBearerEGPRS
+allowerrorcodes -5
+test GetSustainBandwidth 100 EBearerEGPRS
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10151 SustainBandwidth WCDMA
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+allowerrorcodes -5
+test SetSustainBandwidth 100 EBearerWCDMA
+allowerrorcodes -5
+test GetSustainBandwidth 100 EBearerWCDMA
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10152 SustainBandwidth CDMA2000
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+allowerrorcodes -5
+test SetSustainBandwidth 100 EBearerCDMA2000
+allowerrorcodes -5
+test GetSustainBandwidth 100 EBearerCDMA2000
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10153 SustainBandwidth WLAN
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+allowerrorcodes -5
+test SetSustainBandwidth 100 EBearerWLAN
+allowerrorcodes -5
+test GetSustainBandwidth 100 EBearerWLAN
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10154 SustainBandwidth HSDPA
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+allowerrorcodes -5
+test SetSustainBandwidth 100 EBearerHSDPA
+allowerrorcodes -5
+test GetSustainBandwidth 100 EBearerHSDPA
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10128 SustainBwPresets GPRS
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+test GetSustainBwPresets EBearerGPRS
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10129 SustainBwPresets EGPRS
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+test GetSustainBwPresets EBearerEGPRS
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10130 SustainBwPresets WCDMA
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+test GetSustainBwPresets EBearerWCDMA
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10131 SustainBwPresets CDMA
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+allowerrorcodes -5
+test GetSustainBwPresets EBearerCDMA
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10132 SustainBwPresets CDMA2000
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+allowerrorcodes -5
+test GetSustainBwPresets EBearerCDMA2000
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core,error
+#------------------------------------------------------------------------------------
+[Test]
+title ET10133 SustainBwPresets WLAN
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+test GetSustainBwPresets EBearerWLAN
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10134 SustainBwPresets HSDPA
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+test GetSustainBwPresets EBearerHSDPA
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10135 SustainBwPresets Invalid databearer
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+allownextresult -5
+test GetSustainBwPresets 666
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10136 GetMaxBwPresets GPRS
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+test GetMaxBwPresets EBearerGPRS
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10137 GetMaxBwPresets EGPRS
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+test GetMaxBwPresets EBearerEGPRS
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10138 GetMaxBwPresets WCDMA
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+test GetMaxBwPresets EBearerWCDMA
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10139 GetMaxBwPresets CDMA
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+allownextresult -5
+test GetMaxBwPresets EBearerCDMA
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10140 GetMaxBwPresets CDMA2000
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+allownextresult -5
+test GetMaxBwPresets EBearerCDMA2000
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10141 GetMaxBwPresets WLAN
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+test GetMaxBwPresets EBearerWLAN
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10142 GetMaxBwPresets HSDPA
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+test GetMaxBwPresets EBearerHSDPA
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET10143 GetMaxBwPresets Invalid databearer
+create mpxmediasettingsenginetest test
+test Create
+test LoadSettings EConfigDefault
+allownextresult -5
+test GetMaxBwPresets 616
+delete test
+[Endtest]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsengine/tsrc/mediasettingsenginetest/custom/postrun_custom.xml	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,64 @@
+<step name="Fetch Test module Report" harness="STIF" enabled="true" passrate="100" significant="false">
+       <command>fetch-log</command>
+       <params>
+	    <param type="text"/>
+	    <param delete="true"/>
+	    <param path="C:\Logs\TestFramework\*"/>
+       </params>
+</step>
+<step name="Fetch Fusion logs" harness="STIF" enabled="true" passrate="100" significant="false">
+       <command>fetch-log</command>
+       <params>
+	    <param type="text"/>
+	    <param delete="true"/>
+	    <param path="c:\logs\Fusion\*"/>
+       </params>
+</step>
+<step name="Fetch Livetv logs" harness="STIF" enabled="true" passrate="100" significant="false">
+       <command>fetch-log</command>
+       <params>
+	    <param type="text"/>
+	    <param delete="true"/>
+	    <param path="c:\logs\Livetv\*"/>
+       </params>
+</step>
+<step name="Fetch IPTV logs" harness="STIF" enabled="true" passrate="100" significant="false">
+       <command>fetch-log</command>
+       <params>
+	    <param type="text"/>
+	    <param delete="true"/>
+	    <param path="c:\logs\iptv\*"/>
+       </params>
+</step>
+<step name="Fetch verify files" harness="STIF" enabled="true" passrate="100" significant="false">
+       <command>fetch-log</command>
+       <params>
+	    <param type="text"/>
+	    <param delete="true"/>
+	    <param path="c:\testing\data\verifynew\*"/>
+       </params>
+</step>
+<step name="Fetch TestScripter logs" harness="STIF" enabled="true" passrate="100" significant="false">
+       <command>fetch-log</command>
+       <params>
+	    <param type="text"/>
+	    <param delete="true"/>
+	    <param path="C:\Logs\TestFramework\TestScripter\*"/>
+       </params>
+</step>
+<step name="Fetch Testengine logs" harness="STIF" enabled="true" passrate="100" significant="false">
+       <command>fetch-log</command>
+       <params>
+	    <param type="text"/>
+	    <param delete="true"/>
+	    <param path="C:\Logs\TestFramework\Testengine\*"/>
+       </params>
+</step>
+<step name="Fetch Testserver logs" harness="STIF" enabled="true" passrate="100" significant="false">
+       <command>fetch-log</command>
+       <params>
+	    <param type="text"/>
+	    <param delete="true"/>
+	    <param path="C:\Logs\TestFramework\Testserver\*"/>
+       </params>
+</step>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsengine/tsrc/mediasettingsenginetest/custom/prerun_custom.xml	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,54 @@
+<step name="Create log directory for testmodule" harness="STIF" enabled="true" passrate="100" significant="false">
+    	<command>makedir</command>
+    	<params>
+        <param dir="c:\logs\testframework"/>
+    	</params>
+</step>
+<step name="Create log directory for fusion" harness="STIF" enabled="true" passrate="100" significant="false">
+    	<command>makedir</command>
+    	<params>
+        <param dir="c:\logs\Fusion"/>
+    	</params>
+</step>
+<step name="Create log directory for livetv" harness="STIF" enabled="true" passrate="100" significant="false">
+    	<command>makedir</command>
+    	<params>
+        <param dir="c:\logs\Livetv"/>
+    	</params>
+</step>
+<step name="Create log directory for iptv" harness="STIF" enabled="true" passrate="100" significant="false">
+    	<command>makedir</command>
+    	<params>
+        <param dir="c:\logs\iptv"/>
+    	</params>
+</step>
+<step name="Create directory for verify files" harness="STIF" enabled="true" passrate="100" significant="false">
+    	<command>makedir</command>
+    	<params>
+        <param dir="c:\testing\data\verifyzip"/>
+    	</params>
+</step>
+<step name="Create directory for verify files" harness="STIF" enabled="true" passrate="100" significant="false">
+    	<command>makedir</command>
+    	<params>
+        <param dir="c:\testing\data\verifynew"/>
+    	</params>
+</step>
+<step name="Create directory for TestScripter logs" harness="STIF" enabled="true" passrate="100" significant="false">
+    	<command>makedir</command>
+    	<params>
+        <param dir="c:\logs\testframework\TestScripter"/>
+    	</params>
+</step>
+<step name="Create directory for Testengine logs" harness="STIF" enabled="true" passrate="100" significant="false">
+    	<command>makedir</command>
+    	<params>
+        <param dir="c:\logs\testframework\Testengine"/>
+    	</params>
+</step>
+<step name="Create directory for Testserver logs" harness="STIF" enabled="true" passrate="100" significant="false">
+    	<command>makedir</command>
+    	<params>
+        <param dir="c:\logs\testframework\Testserver"/>
+    	</params>
+</step>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsengine/tsrc/mediasettingsenginetest/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,32 @@
+/*
+* 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 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: 
+*
+*/
+
+
+
+PRJ_PLATFORMS
+
+DEFAULT
+
+PRJ_TESTEXPORTS
+../conf/mpxmediasettingsenginetest.cfg		/epoc32/data/z/system/data/mpxmediasettingsenginetest.cfg
+../conf/mpxmediasettingsenginetest.cfg		/epoc32/winscw/c/testframework/mpxmediasettingsenginetest.cfg
+PRJ_EXPORTS
+
+PRJ_TESTMMPFILES
+mpxmediasettingsenginetest.mmp
+
+PRJ_MMPFILES
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsengine/tsrc/mediasettingsenginetest/group/mpxmediasettingsenginetest.mmp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,88 @@
+/*
+* 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 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:   MMP file for STIF Test Framework's TestScripter*
+*/
+
+
+
+#include <platform_paths.hrh>
+
+TARGET          mpxmediasettingsenginetest.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E3
+
+CAPABILITY      ALL -TCB
+/* Remove comments and replace 0x00000000 with correct vendor id */
+// VENDORID     0x00000000
+/* Remove comments and replace 0x00000000 with correct secure id */
+// SECUREID     0x00000000
+
+//TARGETPATH      ?target_path
+DEFFILE         mpxmediasettingsenginetest.def
+
+USERINCLUDE     ../inc 
+USERINCLUDE		../../../inc
+USERINCLUDE     ../../../../../tsrc/VCXTestCommon/inc
+
+APP_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   /epoc32/include/ecom
+
+SOURCEPATH      ../src
+SOURCE          mpxmediasettingsenginetest.cpp
+SOURCE          mpxmediasettingsenginetestBlocks.cpp
+
+//RESOURCE        resource_file
+//RESOURCE        resource_file2
+
+LIBRARY         euser.lib
+LIBRARY         stiftestinterface.lib
+LIBRARY         stiftestengine.lib
+LIBRARY         flogger.lib
+
+LIBRARY         mmfcontrollerframework.lib
+LIBRARY         charconv.lib
+LIBRARY         mpsettengine.lib
+LIBRARY         apengine.lib
+LIBRARY         commdb.lib
+LIBRARY         bafl.lib
+LIBRARY         efsrv.lib
+LIBRARY         centralrepository.lib
+LIBRARY         ecom.lib
+LIBRARY         vcxtestcommon.lib
+
+LANG            sc
+
+/*
+START WINS      
+?wins_specific_information
+END
+
+START MARM
+?marm_specific_information
+END
+*/
+// Other possible keywords:
+ 
+// DOCUMENT     ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes)
+/*
+START BITMAP ?target
+TARGETPATH   ?emulated_path_on_target_machine
+HEADER
+SOURCE       ?color_depth ?source_bitmap
+END
+*/
+// DEFFILE ?filename
+// AIF ?filename
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsengine/tsrc/mediasettingsenginetest/group/mpxmediasettingsenginetest.pkg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,62 @@
+;
+; 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 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:  Package file for mpx media settings engine STIF tests;
+
+; Languages
+&EN
+
+; Provide value for uid
+#{"mpxmediasettingsenginetest"},(0x00000000),1,1,0,TYPE=SA
+
+; 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
+"/epoc32/release/armv5/udeb/mpxmediasettingsenginetest.dll"   -	"!:/Sys/Bin/mpxmediasettingsenginetest.dll"
+"/epoc32/release/armv5/udeb/VCXTestCommon.dll"                - "!:/Sys/Bin/VCXTestCommon.dll"
+"/epoc32/release/armv5/udeb/VCXTestUtilModule.dll"            - "!:/Sys/Bin/VCXTestUtilModule.dll"
+"../conf/mpxmediasettingsenginetest.cfg"                      - "c:/testframework/mpxmediasettingsenginetest.cfg"
+"../init/testframework.ini"                                   - "c:/testframework/testframework.ini"
+
+
+; Embedded SIS 
+; None
+
+; End of Package body
+
+; PKG dependencies
+; None
+
+; PKG capabilities
+; None
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsengine/tsrc/mediasettingsenginetest/inc/mpxmediasettingsenginetest.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,248 @@
+/*
+* 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 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:   STIF testclass declaration*
+*/
+
+
+
+#ifndef MPXMEDIASETTINGSENGINETEST_H
+#define MPXMEDIASETTINGSENGINETEST_H
+
+//  INCLUDES
+#include <StifLogger.h>
+#include <TestScripterInternal.h>
+#include <StifTestModule.h>
+#include <TestclassAssert.h>
+#include "MPSettingsModelForROP.h"
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+#define TEST_CLASS_VERSION_MAJOR 0
+#define TEST_CLASS_VERSION_MINOR 0
+#define TEST_CLASS_VERSION_BUILD 0
+
+// Logging path
+_LIT( KMPXMediaSettingsEngineTestLogPath, "\\logs\\testframework\\MPXMediaSettingsEngineTest\\" ); 
+// Log file
+_LIT( KMPXMediaSettingsEngineTestLogFile, "MPXMediaSettingsEngineTest.txt" ); 
+_LIT( KMPXMediaSettingsEngineTestLogFileWithTitle, "MPXMediaSettingsEngineTest_[%S].txt" );
+
+_LIT( KTestModuleName, "MPXMediaSettingsEngineTest" );
+_LIT( KLogLocation, "In %S" );
+
+const TUint32 KDefaultIapId = 666;
+
+// FUNCTION PROTOTYPES
+//?type ?function_name(?arg_list);
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+class CMPXMediaSettingsEngineTest;
+class CMPSettingsModelForROP;
+class CCommsDatabase;
+class CVCXTestCommon;
+
+// DATA TYPES
+//enum ?declaration
+//typedef ?declaration
+//extern ?data_type;
+
+// CLASS DECLARATION
+
+/**
+*  CMediaSettingsEngineTest test class for STIF Test Framework TestScripter.
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+NONSHARABLE_CLASS(CMPXMediaSettingsEngineTest) : public CScriptBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CMPXMediaSettingsEngineTest* NewL( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CMPXMediaSettingsEngineTest();
+
+    public: // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    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 );
+
+    protected:  // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    protected:  // Functions from base classes
+
+        /**
+        * From ?base_class ?member_description
+        */
+        //?type ?member_function();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CMPXMediaSettingsEngineTest( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        // Prohibit copy constructor if not deriving from CBase.
+        // ?classname( const ?classname& );
+        // Prohibit assigment operator if not deriving from CBase.
+        // ?classname& operator=( const ?classname& );
+
+        /**
+        * Frees all resources allocated from test methods.
+        * @since ?Series60_version
+        */
+        void Delete();
+
+        /**
+        * Logs the method name
+        * @since ?Series60_version
+        */
+        void LogMethod( TPtrC aMethod );
+
+        /**
+        * Test methods are listed below. 
+        */
+
+        /**
+        * Example test method.
+        * @since ?Series60_version
+        * @param aItem Script line containing parameters.
+        * @return Symbian OS error code.
+        */
+        virtual TInt CreateL( CStifItemParser& aItem );
+        virtual TInt ListImplementationsL( CStifItemParser& aItem );
+        virtual TInt LoadSettingsLL( CStifItemParser& aItem );
+        virtual TInt StoreSettingsLL( CStifItemParser& aItem );
+        virtual TInt SetVideoContrastL( CStifItemParser& aItem );
+        virtual TInt GetVideoContrastL( CStifItemParser& aItem );
+        virtual TInt SetProxyModeL( CStifItemParser& aItem );
+        virtual TInt GetProxyModeL( CStifItemParser& aItem );
+        virtual TInt SetProxyHostNameLL( CStifItemParser& aItem );
+        virtual TInt GetProxyHostNameL( CStifItemParser& aItem );
+        virtual TInt SetProxyPortL( CStifItemParser& aItem );
+        virtual TInt GetProxyPortL( CStifItemParser& aItem );
+        virtual TInt SetDefaultApL( CStifItemParser& aItem );
+        virtual TInt GetDefaultApL( CStifItemParser& aItem );
+        virtual TInt SetBandwidthControlModeL( CStifItemParser& aItem );
+        virtual TInt GetBandwidthControlModeL( CStifItemParser& aItem );
+        virtual TInt SetMaxBandwidthL( CStifItemParser& aItem );
+        virtual TInt GetMaxBandwidthL( CStifItemParser& aItem );
+        virtual TInt SetConnectionTimeoutL( CStifItemParser& aItem );
+        virtual TInt GetConnectionTimeoutL( CStifItemParser& aItem );
+        virtual TInt SetServerTimeoutL( CStifItemParser& aItem );
+        virtual TInt GetServerTimeoutL( CStifItemParser& aItem );
+        virtual TInt SetMinUDPPortL( CStifItemParser& aItem );
+        virtual TInt GetMinUDPPortL( CStifItemParser& aItem );
+        virtual TInt SetMaxUDPPortL( CStifItemParser& aItem );
+        virtual TInt GetMaxUDPPortL( CStifItemParser& aItem );
+        virtual TInt GetControllerVersionInfoL( CStifItemParser& aItem );
+        virtual TInt GetControllerBuildDateL( CStifItemParser& aItem );
+        virtual TInt GetControllerAdditionalInfoL( CStifItemParser& aItem );
+        virtual TInt SetDemandBwFactorL( CStifItemParser& aItem );
+        virtual TInt GetDemandBwFactorL( CStifItemParser& aItem );
+        virtual TInt SetSustainBandwidthL( CStifItemParser& aItem );
+        virtual TInt GetSustainBandwidthL( CStifItemParser& aItem );
+        virtual TInt GetSustainBwPresetsLL( CStifItemParser& aItem );
+        virtual TInt GetMaxBwPresetsLL( CStifItemParser& aItem );
+        virtual TInt SetAutoDisconTimeLL( CStifItemParser& aItem );
+        virtual TInt AutoDisconTimeLL( CStifItemParser& aItem );
+        virtual TInt SetVideoRepeatLL( CStifItemParser& aItem );
+        virtual TInt IsVideoRepeatOnLL( CStifItemParser& aItem );
+        virtual TInt SetDefaultViewLL( CStifItemParser& aItem );
+        virtual TInt IsDefaultViewOnLL( CStifItemParser& aItem );
+        virtual TInt SetRockerKeysLL( CStifItemParser& aItem );
+        virtual TInt ShowRockerKeysLL( CStifItemParser& aItem );
+        virtual TInt IsRockerKeysSupportedLL( CStifItemParser& aItem );
+        
+        /**
+         * Method used to log version of test class
+         */
+        void SendTestClassVersion();
+
+        //ADD NEW METHOD DEC HERE
+        //[TestMethods] - Do not remove
+
+    public:     // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    protected:  // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    private:    // Data
+        
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+        // Reserved pointer for future extension
+        //TAny* iReserved;
+
+    public:     // Friend classes
+        //?friend_class_declaration;
+    protected:  // Friend classes
+        //?friend_class_declaration;
+    private:    // Friend classes
+        //?friend_class_declaration;
+
+        CMPSettingsModel* iModel;
+        CMPSettingsModelForROP* iSettingsModel;
+        CApUtils* iApUtils;
+        CCommsDatabase* iCommDb;
+        CVCXTestCommon* iVCXTestCommon;
+    };
+
+#endif      // MEDIASETTINGSENGINETEST_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsengine/tsrc/mediasettingsenginetest/init/TestFramework.ini	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,172 @@
+#
+# This is STIFTestFramework initialization file 123
+# 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': Sret of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases' 
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.sd
+#
+# 	- 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.
+
+[Engine_Defaults]
+
+TestReportMode= FullReport # Possible values are: 'Empty', 'Summary', 'Environment', 'TestCases' or 'FullReport'
+
+CreateTestReport= YES			# Possible values: YES or NO
+
+TestReportFilePath= c:\Logs\Fusion\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT			# Possible values: TXT or HTML
+TestReportOutput= FILE			# Possible values: FILE or RDEBUG
+TestReportFileCreationMode= APPEND	# Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+DisableMeasurement= stifmeasurementplugin04 
+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\mpxmediasettingsenginetest.cfg
+[End_Module]
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework 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)'#' 
+
+CreateLogDirectories= YES    # Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML         # Possible values: TXT or HTML
+#EmulatorOutput= FILE         # Possible values: FILE or RDEBUG
+
+#HardwareBasePath=  C:\
+#HardwareFormat= TXT			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+FileCreationMode= APPEND  # 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
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsengine/tsrc/mediasettingsenginetest/src/mpxmediasettingsenginetest.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,200 @@
+/*
+* 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 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:   This file contains testclass implementation.*
+*/
+
+
+
+// INCLUDE FILES
+#include <Stiftestinterface.h>
+#include "mpxmediasettingsenginetest.h"
+#include <SettingServerClient.h>
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CMediaSettingsEngineTest::CMediaSettingsEngineTest
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CMPXMediaSettingsEngineTest::CMPXMediaSettingsEngineTest( 
+    CTestModuleIf& aTestModuleIf ):
+        CScriptBase( aTestModuleIf )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CMediaSettingsEngineTest::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CMPXMediaSettingsEngineTest::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(KMPXMediaSettingsEngineTestLogFileWithTitle, &title);
+        }
+    else
+        {
+        logFileName.Copy(KMPXMediaSettingsEngineTestLogFile);
+        }
+
+    iLog = CStifLogger::NewL( KMPXMediaSettingsEngineTestLogPath, 
+                          logFileName,
+                          CStifLogger::ETxt,
+                          CStifLogger::EFile,
+                          EFalse );
+    
+    SendTestClassVersion();
+    }
+
+// -----------------------------------------------------------------------------
+// CMediaSettingsEngineTest::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CMPXMediaSettingsEngineTest* CMPXMediaSettingsEngineTest::NewL( 
+    CTestModuleIf& aTestModuleIf )
+    {
+    CMPXMediaSettingsEngineTest* self = new (ELeave) CMPXMediaSettingsEngineTest( aTestModuleIf );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+
+    }
+
+// Destructor
+CMPXMediaSettingsEngineTest::~CMPXMediaSettingsEngineTest()
+    { 
+
+    // Delete resources allocated from test methods
+    Delete();
+
+    // Delete logger
+    delete iLog; 
+
+    }
+
+//-----------------------------------------------------------------------------
+// CMediaSettingsEngineTest::SendTestClassVersion
+// Method used to send version of test class
+//-----------------------------------------------------------------------------
+//
+void CMPXMediaSettingsEngineTest::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("MediaSettingsEngineTest.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 ) // Backpointer to STIF Test Framework
+    {
+
+    return ( CScriptBase* ) CMPXMediaSettingsEngineTest::NewL( aTestModuleIf );
+
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettingsengine/tsrc/mediasettingsenginetest/src/mpxmediasettingsenginetestBlocks.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,1424 @@
+/*
+* 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 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:   This file contains testclass implementation.*
+*/
+
+
+
+// [INCLUDE FILES] - do not remove
+#include <e32svr.h>
+#include <StifParser.h>
+#include <Stiftestinterface.h>
+#include <commdb.h>
+#include "mpxmediasettingsenginetest.h"
+#include "MPSettEngPluginImplementationUIDs.hrh"
+#include "MPSettingsModelForROP.h"
+#include "vcxtestlog.h"
+#include "IptvTestUtilALR.h"
+#include "MPSettingsROPSettings.hrh"
+#include "VCXTestCommon.h"
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CMPXMediaSettingsEngineTest::Delete
+// Delete here all resources allocated and opened from test methods. 
+// Called from destructor. 
+// -----------------------------------------------------------------------------
+//
+void CMPXMediaSettingsEngineTest::Delete() 
+    {
+
+    if( iModel )
+        {
+        delete iModel;
+        iModel = NULL;
+        }
+
+    REComSession::FinalClose();
+
+    if (iCommDb) 
+        {
+        delete iCommDb;
+        iCommDb = NULL;
+        }
+    
+    if( iVCXTestCommon )
+        {
+        delete iVCXTestCommon;
+        iVCXTestCommon = NULL;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CMPXMediaSettingsEngineTest::RunMethodL
+// Run specified method. Contains also table of test mothods and their names.
+// -----------------------------------------------------------------------------
+//
+TInt CMPXMediaSettingsEngineTest::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( "Create", CMPXMediaSettingsEngineTest::CreateL ),
+        ENTRY( "ListImplementations", CMPXMediaSettingsEngineTest::ListImplementationsL ),
+        ENTRY( "LoadSettings", CMPXMediaSettingsEngineTest::LoadSettingsLL ),
+        ENTRY( "StoreSettings", CMPXMediaSettingsEngineTest::StoreSettingsLL ),
+        ENTRY( "SetVideoContrast", CMPXMediaSettingsEngineTest::SetVideoContrastL ),
+        ENTRY( "GetVideoContrast", CMPXMediaSettingsEngineTest::GetVideoContrastL ),
+        ENTRY( "SetProxyMode", CMPXMediaSettingsEngineTest::SetProxyModeL ),
+        ENTRY( "GetProxyMode", CMPXMediaSettingsEngineTest::GetProxyModeL ),
+        ENTRY( "SetProxyHostName", CMPXMediaSettingsEngineTest::SetProxyHostNameLL ),
+        ENTRY( "GetProxyHostName", CMPXMediaSettingsEngineTest::GetProxyHostNameL ),
+        ENTRY( "SetProxyPort", CMPXMediaSettingsEngineTest::SetProxyPortL ),
+        ENTRY( "GetProxyPort", CMPXMediaSettingsEngineTest::GetProxyPortL ),
+        ENTRY( "SetDefaultAp", CMPXMediaSettingsEngineTest::SetDefaultApL ),
+        ENTRY( "GetDefaultAp", CMPXMediaSettingsEngineTest::GetDefaultApL ),
+        ENTRY( "SetBandwidthControlMode", CMPXMediaSettingsEngineTest::SetBandwidthControlModeL ),
+        ENTRY( "GetBandwidthControlMode", CMPXMediaSettingsEngineTest::GetBandwidthControlModeL ),
+        ENTRY( "SetMaxBandwidth", CMPXMediaSettingsEngineTest::SetMaxBandwidthL ),
+        ENTRY( "GetMaxBandwidth", CMPXMediaSettingsEngineTest::GetMaxBandwidthL ),
+        ENTRY( "SetConnectionTimeout", CMPXMediaSettingsEngineTest::SetConnectionTimeoutL ),
+        ENTRY( "GetConnectionTimeout", CMPXMediaSettingsEngineTest::GetConnectionTimeoutL ),
+        ENTRY( "SetServerTimeout", CMPXMediaSettingsEngineTest::SetServerTimeoutL ),
+        ENTRY( "GetServerTimeout", CMPXMediaSettingsEngineTest::GetServerTimeoutL ),
+        ENTRY( "SetMinUDPPort", CMPXMediaSettingsEngineTest::SetMinUDPPortL ),
+        ENTRY( "GetMinUDPPort", CMPXMediaSettingsEngineTest::GetMinUDPPortL ),
+        ENTRY( "SetMaxUDPPort", CMPXMediaSettingsEngineTest::SetMaxUDPPortL ),
+        ENTRY( "GetMaxUDPPort", CMPXMediaSettingsEngineTest::GetMaxUDPPortL ),
+        ENTRY( "GetControllerVersionInfo", CMPXMediaSettingsEngineTest::GetControllerVersionInfoL ),
+        ENTRY( "GetControllerBuildDate", CMPXMediaSettingsEngineTest::GetControllerBuildDateL ),
+        ENTRY( "GetControllerAdditionalInfo", CMPXMediaSettingsEngineTest::GetControllerAdditionalInfoL ),
+        ENTRY( "SetDemandBwFactor", CMPXMediaSettingsEngineTest::SetDemandBwFactorL ),
+        ENTRY( "GetDemandBwFactor", CMPXMediaSettingsEngineTest::GetDemandBwFactorL ),
+        ENTRY( "SetSustainBandwidth", CMPXMediaSettingsEngineTest::SetSustainBandwidthL ),
+        ENTRY( "GetSustainBandwidth", CMPXMediaSettingsEngineTest::GetSustainBandwidthL ),
+        ENTRY( "GetSustainBwPresets", CMPXMediaSettingsEngineTest::GetSustainBwPresetsLL ),
+        ENTRY( "GetMaxBwPresets", CMPXMediaSettingsEngineTest::GetMaxBwPresetsLL ),
+        ENTRY( "SetAutoDisconTime", CMPXMediaSettingsEngineTest::SetAutoDisconTimeLL ),
+        ENTRY( "AutoDisconTime", CMPXMediaSettingsEngineTest::AutoDisconTimeLL ),
+        ENTRY( "SetVideoRepeat", CMPXMediaSettingsEngineTest::SetVideoRepeatLL ),
+        ENTRY( "IsVideoRepeatOn", CMPXMediaSettingsEngineTest::IsVideoRepeatOnLL ),
+        ENTRY( "SetDefaultView", CMPXMediaSettingsEngineTest::SetDefaultViewLL ),
+        ENTRY( "IsDefaultViewOn", CMPXMediaSettingsEngineTest::IsDefaultViewOnLL ),
+        ENTRY( "SetRockerKeys", CMPXMediaSettingsEngineTest::SetRockerKeysLL ),
+        ENTRY( "ShowRockerKeys", CMPXMediaSettingsEngineTest::ShowRockerKeysLL ),
+        ENTRY( "IsRockerKeysSupported", CMPXMediaSettingsEngineTest::IsRockerKeysSupportedLL ),
+        //ADD NEW ENTRY HERE
+        // [test cases entries] - Do not remove
+
+        };
+
+    const TInt count = sizeof( KFunctions ) / 
+                        sizeof( TStifFunctionInfo );
+
+    return RunInternalL( KFunctions, count, aItem );
+
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoScheduler_ApiTest::LogMethod
+// Generate log from current method
+// -----------------------------------------------------------------------------
+//
+void CMPXMediaSettingsEngineTest::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 );
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoScheduler_ApiTest::LogMethod
+// Generate log from current method
+// -----------------------------------------------------------------------------
+//
+TInt CMPXMediaSettingsEngineTest::CreateL( CStifItemParser& aItem )
+    {
+    LogMethod(_L("CreateL"));
+    VCXLOGLO1("--> CMPXMediaSettingsEngineTest::CreateL");
+    TInt error( 0 );
+    
+    iVCXTestCommon = CVCXTestCommon::NewL();
+    
+    const TUid KSettingsModelForROPUid = {KMPSettEngImplUidROP};
+    
+    iModel = CMPSettingsModel::NewL(KSettingsModelForROPUid);
+    
+    iSettingsModel = static_cast<CMPSettingsModelForROP*>(iModel);
+    
+    VCXLOGLO2("<-- CMPXMediaSettingsEngineTest::CreateL return %d", error);
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoScheduler_ApiTest::ListImplementationsL
+// List implementations of mpsettingsmodel
+// -----------------------------------------------------------------------------
+//
+TInt CMPXMediaSettingsEngineTest::ListImplementationsL( CStifItemParser& aItem )
+    {
+    LogMethod(_L("ListImplementationsL"));
+    VCXLOGLO1("--> CMPXMediaSettingsEngineTest::ListImplementationsL");
+    TInt error( 0 );
+    
+    RImplInfoPtrArray array;
+    iSettingsModel->ListImplementationsL( array );
+    
+    TInt i( 0 );
+    for( i = 0; i < array.Count(); i++ )
+        {
+        VCXLOGLO3("CMPXMediaSettingsEngineTest::ListImplementationsL, [%d] uid = %d", i, array[i]->ImplementationUid() );
+        }
+
+    VCXLOGLO2("<-- CMPXMediaSettingsEngineTest::ListImplementationsL return %d", error);
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoScheduler_ApiTest::LogMethod
+// Generate log from current method
+// -----------------------------------------------------------------------------
+//
+TInt CMPXMediaSettingsEngineTest::LoadSettingsLL( CStifItemParser& aItem )
+    {
+    LogMethod(_L("LoadSettingsLL"));
+    VCXLOGLO1("--> CMPXMediaSettingsEngineTest::LoadSettingsLL");
+    
+    TInt configVersion(0);
+    User::LeaveIfError( aItem.GetNextInt( configVersion ) );
+    
+    TRAPD( error, iSettingsModel->LoadSettingsL( configVersion ) );
+    
+    if( error != KErrNone )
+        {
+        VCXLOGLO2("CMPXMediaSettingsEngineTest::LoadSettingsLL -- error after call: %d", error );
+        return error;
+        }
+
+    VCXLOGLO1("<-- CMPXMediaSettingsEngineTest::LoadSettingsLL");
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoScheduler_ApiTest::LogMethod
+// Generate log from current method
+// -----------------------------------------------------------------------------
+//
+TInt CMPXMediaSettingsEngineTest::StoreSettingsLL( CStifItemParser& /*aItem*/ )
+    {
+    LogMethod(_L("StoreSettingsLL"));
+    VCXLOGLO1("--> CMPXMediaSettingsEngineTest::StoreSettingsLL");
+    TRAPD( error, iSettingsModel->StoreSettingsL() );
+    VCXLOGLO1("<-- CMPXMediaSettingsEngineTest::StoreSettingsLL");
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoScheduler_ApiTest::LogMethod
+// Generate log from current method
+// -----------------------------------------------------------------------------
+//
+TInt CMPXMediaSettingsEngineTest::SetVideoContrastL( CStifItemParser& aItem )
+    {
+    LogMethod(_L("SetVideoContrastL"));
+    VCXLOGLO1("--> CMPXMediaSettingsEngineTest::SetVideoContrastL");
+    TInt error( 0 );
+    
+    TInt value(0);
+    User::LeaveIfError( aItem.GetNextInt( value ) );
+    
+    error = iSettingsModel->SetVideoContrast( value );
+    VCXLOGLO2("CMPXMediaSettingsEngineTest::SetVideoContrastL -- error after call: %d", error );
+
+    VCXLOGLO1("<-- CMPXMediaSettingsEngineTest::SetVideoContrastL");
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoScheduler_ApiTest::LogMethod
+// Generate log from current method
+// -----------------------------------------------------------------------------
+//
+TInt CMPXMediaSettingsEngineTest::GetVideoContrastL( CStifItemParser& aItem )
+    {
+    LogMethod(_L("GetVideoContrastL"));
+    VCXLOGLO1("--> CMPXMediaSettingsEngineTest::GetVideoContrastL");
+    TInt error( 0 );
+    
+    TInt expectedValue(0);
+    User::LeaveIfError( aItem.GetNextInt( expectedValue ) );
+    
+    TInt value( 0 );
+    error = iSettingsModel->GetVideoContrast( value );
+    
+    if( error != KErrNone )
+        {
+        VCXLOGLO2("CMPXMediaSettingsEngineTest::GetVideoContrastL -- error after call: %d", error );
+        return error;
+        }
+
+    if( value != expectedValue )
+        {
+        VCXLOGLO3("CMPXMediaSettingsEngineTest::GetVideoContrastL -- value %d, expected value %d", value, expectedValue);
+        error = KErrCorrupt;
+        }
+    
+    VCXLOGLO1("<-- CMPXMediaSettingsEngineTest::GetVideoContrastL");
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoScheduler_ApiTest::SetProxyModeL
+// -----------------------------------------------------------------------------
+//
+TInt CMPXMediaSettingsEngineTest::SetProxyModeL( CStifItemParser& aItem )
+    {
+    LogMethod(_L("SetProxyModeL"));
+    VCXLOGLO1("--> CMPXMediaSettingsEngineTest::SetProxyModeL");
+    TInt error( 0 );
+
+    TInt value(0);
+    User::LeaveIfError( aItem.GetNextInt( value ) );
+    
+    error = iSettingsModel->SetProxyMode( value );
+    VCXLOGLO2("CMPXMediaSettingsEngineTest::SetProxyModeL -- error after call: %d", error );
+
+    VCXLOGLO1("<-- CMPXMediaSettingsEngineTest::SetProxyModeL");
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoScheduler_ApiTest::GetProxyModeL
+// -----------------------------------------------------------------------------
+//
+TInt CMPXMediaSettingsEngineTest::GetProxyModeL ( CStifItemParser& aItem )
+    {
+    LogMethod(_L("GetProxyModeL"));
+    VCXLOGLO1("--> CMPXMediaSettingsEngineTest::GetProxyModeL");
+    TInt error( 0 );
+    
+    TInt expectedValue(0);
+    User::LeaveIfError( aItem.GetNextInt( expectedValue ) );
+    
+    TInt value( 0 );
+    error = iSettingsModel->GetProxyMode( value );
+    
+    if( error != KErrNone )
+        {
+        VCXLOGLO2("CMPXMediaSettingsEngineTest::GetProxyModeL -- error after call: %d", error );
+        return error;
+        }
+
+    if( value != expectedValue )
+        {
+        VCXLOGLO3("CMPXMediaSettingsEngineTest::GetProxyModeL -- value %d, expected value %d", value, expectedValue);
+        error = KErrCorrupt;
+        }
+    
+    VCXLOGLO1("<-- CMPXMediaSettingsEngineTest::GetProxyModeL");
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoScheduler_ApiTest::SetProxyHostNameLL
+// -----------------------------------------------------------------------------
+//
+TInt CMPXMediaSettingsEngineTest::SetProxyHostNameLL( CStifItemParser& aItem )
+    {
+    LogMethod(_L("SetProxyHostNameLL"));
+    VCXLOGLO1("--> CMPXMediaSettingsEngineTest::SetProxyHostNameLL");
+
+    TPtrC value;
+    User::LeaveIfError( aItem.GetNextString( value ) );
+    
+    TRAPD( error, iSettingsModel->SetProxyHostNameL( value ) );
+    VCXLOGLO2("CMPXMediaSettingsEngineTest::SetProxyHostNameLL -- error after call: %d", error );
+
+    VCXLOGLO2("<-- CMPXMediaSettingsEngineTest::SetProxyHostNameLL return %d", error);
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoScheduler_ApiTest::GetProxyHostNameL
+// -----------------------------------------------------------------------------
+//
+TInt CMPXMediaSettingsEngineTest::GetProxyHostNameL( CStifItemParser& aItem )
+    {
+    LogMethod(_L("GetProxyHostNameL"));
+    VCXLOGLO1("--> CMPXMediaSettingsEngineTest::GetProxyHostNameL");
+    
+    TPtrC expectedValue;
+    User::LeaveIfError( aItem.GetNextString( expectedValue ) );
+
+    TBuf<256> value;
+    TRAPD( error, iSettingsModel->GetProxyHostName( value ) );
+    
+    if( error != KErrNone )
+        {
+        VCXLOGLO2("CMPXMediaSettingsEngineTest::GetProxyHostNameL -- error after call: %d", error );
+        return error;
+        }
+
+    if( value.CompareC(expectedValue) )
+        {
+        VCXLOGLO3("CMPXMediaSettingsEngineTest::GetProxyHostNameL -- value %S, expected value %S", &value, &expectedValue);
+        error = KErrCorrupt;
+        }
+    
+    VCXLOGLO2("<-- CMPXMediaSettingsEngineTest::GetProxyHostNameL return %d", error);
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoScheduler_ApiTest::SetProxyPortL
+// -----------------------------------------------------------------------------
+//
+TInt CMPXMediaSettingsEngineTest::SetProxyPortL( CStifItemParser& aItem )
+    {
+    LogMethod(_L("SetProxyPortL"));
+    VCXLOGLO1("--> CMPXMediaSettingsEngineTest::SetProxyPortL");
+    TInt error( 0 );
+
+    TInt value(0);
+    User::LeaveIfError( aItem.GetNextInt( value ) );
+    
+    error = iSettingsModel->SetProxyPort( value );
+    VCXLOGLO2("CMPXMediaSettingsEngineTest::SetProxyPortL -- error after call: %d", error );
+
+    VCXLOGLO2("<-- CMPXMediaSettingsEngineTest::SetProxyPortL return %d", error);
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoScheduler_ApiTest::GetProxyPortL
+// -----------------------------------------------------------------------------
+//
+TInt CMPXMediaSettingsEngineTest::GetProxyPortL( CStifItemParser& aItem )
+    {
+    LogMethod(_L("GetProxyPortL"));
+    VCXLOGLO1("--> CMPXMediaSettingsEngineTest::GetProxyPortL");
+    TInt error( 0 );
+    
+    TInt expectedValue(0);
+    User::LeaveIfError( aItem.GetNextInt( expectedValue ) );
+    
+    TInt value( 0 );
+    error = iSettingsModel->GetProxyPort( value );
+    
+    if( error != KErrNone )
+        {
+        VCXLOGLO2("CMPXMediaSettingsEngineTest::GetProxyPortL -- error after call: %d", error );
+        return error;
+        }
+
+    if( value != expectedValue )
+        {
+        VCXLOGLO3("CMPXMediaSettingsEngineTest::GetProxyPortL -- value %d, expected value %d", value, expectedValue);
+        error = KErrCorrupt;
+        }
+    
+    VCXLOGLO1("<-- CMPXMediaSettingsEngineTest::GetProxyPortL");    
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoScheduler_ApiTest::SetDefaultApL
+// -----------------------------------------------------------------------------
+//
+TInt CMPXMediaSettingsEngineTest::SetDefaultApL( CStifItemParser& aItem )
+    {
+    LogMethod(_L("SetDefaultApL"));
+    VCXLOGLO1("--> CMPXMediaSettingsEngineTest::SetDefaultApL");
+    TInt error( 0 );
+
+    TPtrC iapName;
+    User::LeaveIfError( aItem.GetNextString( iapName ) );
+
+    TUint32 iapId( 0 );
+    TBool iapFound = iVCXTestCommon->GetIapIdL( iapName, iapId );
+    
+    if( !iapFound )
+        {
+        VCXLOGLO2("CMPXMediaSettingsEngineTest::SetDefaultApL -- no IAP id found, using %d", KDefaultIapId );
+        iapId = KDefaultIapId;
+        }
+    
+    error = iSettingsModel->SetDefaultAp( iapId );
+    VCXLOGLO2("CMPXMediaSettingsEngineTest::SetDefaultApL -- error after call: %d", error );
+
+    VCXLOGLO2("<-- CMPXMediaSettingsEngineTest::SetDefaultApL return %d", error);
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoScheduler_ApiTest::GetDefaultApL
+// -----------------------------------------------------------------------------
+//
+TInt CMPXMediaSettingsEngineTest::GetDefaultApL( CStifItemParser& aItem )
+    {
+    LogMethod(_L("GetDefaultApL"));
+    VCXLOGLO1("--> CMPXMediaSettingsEngineTest::GetDefaultApL");
+    TInt error( 0 );
+    
+    TPtrC expectedIap;
+    User::LeaveIfError( aItem.GetNextString( expectedIap ) );
+    
+    TUint32 iapId( 0 );
+    TBool iapFound = iVCXTestCommon->GetIapIdL( expectedIap, iapId );
+    
+    if( !iapFound )
+        {
+        VCXLOGLO2("CMPXMediaSettingsEngineTest::GetDefaultApL -- no IAP id found, using %d", KDefaultIapId );
+        iapId = KDefaultIapId;
+        }
+    
+    TUint32 value( 0 );
+    error = iSettingsModel->GetDefaultAp( value );
+    
+    if( error != KErrNone )
+        {
+        VCXLOGLO2("CMPXMediaSettingsEngineTest::GetDefaultApL -- error after call: %d", error );
+        return error;
+        }
+
+    if( value != iapId )
+        {
+        VCXLOGLO3("CMPXMediaSettingsEngineTest::GetDefaultApL -- value %d, expected value %d", value, iapId );
+        error = KErrCorrupt;
+        }
+    
+    VCXLOGLO1("<-- CMPXMediaSettingsEngineTest::GetDefaultApL");    
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoScheduler_ApiTest::SetBandwidthControlModeL
+// -----------------------------------------------------------------------------
+//
+TInt CMPXMediaSettingsEngineTest::SetBandwidthControlModeL( CStifItemParser& aItem )
+    {
+    LogMethod(_L("SetBandwidthControlModeL"));
+    VCXLOGLO1("--> CMPXMediaSettingsEngineTest::SetBandwidthControlModeL");
+    TInt error( 0 );
+
+    TInt value(0);
+    User::LeaveIfError( aItem.GetNextInt( value ) );
+    
+    error = iSettingsModel->SetBandwidthControlMode( value );
+    VCXLOGLO2("CMPXMediaSettingsEngineTest::SetBandwidthControlModeL -- error after call: %d", error );
+
+    VCXLOGLO2("<-- CMPXMediaSettingsEngineTest::SetBandwidthControlModeL return %d", error);
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoScheduler_ApiTest::GetBandwidthControlModeL
+// -----------------------------------------------------------------------------
+//
+TInt CMPXMediaSettingsEngineTest::GetBandwidthControlModeL( CStifItemParser& aItem )
+    {
+    LogMethod(_L("GetBandwidthControlModeL"));
+    VCXLOGLO1("--> CMPXMediaSettingsEngineTest::GetBandwidthControlModeL");
+    TInt error( 0 );
+    
+    TInt expectedValue(0);
+    User::LeaveIfError( aItem.GetNextInt( expectedValue ) );
+    
+    TInt value( 0 );
+    error = iSettingsModel->GetBandwidthControlMode( value );
+    
+    if( error != KErrNone )
+        {
+        VCXLOGLO2("CMPXMediaSettingsEngineTest::GetBandwidthControlModeL -- error after call: %d", error );
+        return error;
+        }
+
+    if( value != expectedValue )
+        {
+        VCXLOGLO3("CMPXMediaSettingsEngineTest::GetBandwidthControlModeL -- value %d, expected value %d", value, expectedValue);
+        error = KErrCorrupt;
+        }
+    
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoScheduler_ApiTest::SetMaxBandwidthL
+// -----------------------------------------------------------------------------
+//
+TInt CMPXMediaSettingsEngineTest::SetMaxBandwidthL( CStifItemParser& aItem )
+    {
+    LogMethod(_L("SetMaxBandwidthL"));
+    VCXLOGLO1("--> CMPXMediaSettingsEngineTest::SetMaxBandwidthL");
+    TInt error( 0 );
+
+    // value for databearer
+    TInt value( 0 );
+    User::LeaveIfError( aItem.GetNextInt( value ) );
+
+    TDataBearer dataBearer = static_cast<TDataBearer>(value);
+    
+    // value for maxbandwidth
+    User::LeaveIfError( aItem.GetNextInt( value ) );
+   
+    error = iSettingsModel->SetMaxBandwidth( value, dataBearer );
+    
+    VCXLOGLO2("CMPXMediaSettingsEngineTest::SetMaxBandwidthL -- error after call: %d", error );
+
+    VCXLOGLO2("<-- CMPXMediaSettingsEngineTest::SetMaxBandwidthL return %d", error);    
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoScheduler_ApiTest::GetMaxBandwidthL
+// -----------------------------------------------------------------------------
+//
+TInt CMPXMediaSettingsEngineTest::GetMaxBandwidthL( CStifItemParser& aItem )
+    {
+    LogMethod(_L("GetMaxBandwidthL"));
+    VCXLOGLO1("--> CMPXMediaSettingsEngineTest::GetMaxBandwidthL");
+    TInt error( 0 );
+
+    // value for databearer
+    TInt bearerType( 0 );
+    User::LeaveIfError( aItem.GetNextInt( bearerType ) );
+
+    TDataBearer dataBearer = static_cast<TDataBearer>(bearerType);
+    
+    // value for expected value
+    TInt expectedValue( 0 );
+    User::LeaveIfError( aItem.GetNextInt( expectedValue ) );
+    
+    TInt value( 0 );
+    error = iSettingsModel->GetMaxBandwidth( value, dataBearer );
+    
+    if( error != KErrNone )
+        {
+        VCXLOGLO2("CMPXMediaSettingsEngineTest::GetMaxBandwidthL -- error after call: %d", error );
+        return error;
+        }
+
+    if( value != expectedValue )
+        {
+        VCXLOGLO3("CMPXMediaSettingsEngineTest::GetMaxBandwidthL -- value %d, expected value %d", value, expectedValue);
+        error = KErrCorrupt;
+        }
+    
+    VCXLOGLO2("<-- CMPXMediaSettingsEngineTest::GetMaxBandwidthL return %d", error);
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoScheduler_ApiTest::SetConnectionTimeoutL
+// -----------------------------------------------------------------------------
+//
+TInt CMPXMediaSettingsEngineTest::SetConnectionTimeoutL( CStifItemParser& aItem )
+    {
+    LogMethod(_L("SetConnectionTimeoutL"));
+    VCXLOGLO1("--> CMPXMediaSettingsEngineTest::SetConnectionTimeoutL");
+    TInt error( 0 );
+    
+    TInt value( 0 );
+    User::LeaveIfError( aItem.GetNextInt( value ) );
+
+    error = iSettingsModel->SetConnectionTimeout( value );
+    
+    if( error != KErrNone )
+        {
+        VCXLOGLO2("CMPXMediaSettingsEngineTest::SetConnectionTimeoutL -- error after call: %d", error );
+        return error;
+        }
+
+    VCXLOGLO2("<-- CMPXMediaSettingsEngineTest::SetConnectionTimeoutL return %d", error);
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoScheduler_ApiTest::GetConnectionTimeoutL
+// -----------------------------------------------------------------------------
+//
+TInt CMPXMediaSettingsEngineTest::GetConnectionTimeoutL( CStifItemParser& aItem )
+    {
+    LogMethod(_L("GetConnectionTimeoutL"));
+    VCXLOGLO1("--> CMPXMediaSettingsEngineTest::GetConnectionTimeoutL");
+    
+    TInt error( 0 );
+
+    TInt expectedValue( 0 );
+    User::LeaveIfError( aItem.GetNextInt( expectedValue ) );
+    
+    TInt value( 0 );
+    error = iSettingsModel->GetConnectionTimeout( value );
+    
+    if( error != KErrNone )
+        {
+        VCXLOGLO2("CMPXMediaSettingsEngineTest::GetConnectionTimeoutL -- error after call: %d", error );
+        return error;
+        }
+
+    if( value != expectedValue )
+        {
+        VCXLOGLO3("CMPXMediaSettingsEngineTest::GetConnectionTimeoutL -- value %d, expected value %d", value, expectedValue);
+        error = KErrCorrupt;
+        }
+    
+    VCXLOGLO2("<-- CMPXMediaSettingsEngineTest::GetConnectionTimeoutL return %d", error);
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoScheduler_ApiTest::SetServerTimeoutL
+// -----------------------------------------------------------------------------
+//
+TInt CMPXMediaSettingsEngineTest::SetServerTimeoutL( CStifItemParser& aItem )
+    {
+    LogMethod(_L("SetServerTimeoutL"));
+    VCXLOGLO1("--> CMPXMediaSettingsEngineTest::SetServerTimeoutL");
+    TInt error( 0 );
+    
+    TInt value( 0 );
+    User::LeaveIfError( aItem.GetNextInt( value ) );
+
+    error = iSettingsModel->SetServerTimeout( value );
+    
+    if( error != KErrNone )
+        {
+        VCXLOGLO2("CMPXMediaSettingsEngineTest::SetServerTimeoutL -- error after call: %d", error );
+        return error;
+        }
+
+    VCXLOGLO2("<-- CMPXMediaSettingsEngineTest::SetServerTimeoutL return %d", error);    
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoScheduler_ApiTest::GetServerTimeoutL
+// -----------------------------------------------------------------------------
+//
+TInt CMPXMediaSettingsEngineTest::GetServerTimeoutL( CStifItemParser& aItem )
+    {
+    LogMethod(_L("GetServerTimeoutL"));
+    VCXLOGLO1("--> CMPXMediaSettingsEngineTest::GetServerTimeoutL");
+    
+    TInt error( 0 );
+
+    TInt expectedValue( 0 );
+    User::LeaveIfError( aItem.GetNextInt( expectedValue ) );
+    
+    TInt value( 0 );
+    error = iSettingsModel->GetServerTimeout( value );
+    
+    if( error != KErrNone )
+        {
+        VCXLOGLO2("CMPXMediaSettingsEngineTest::GetServerTimeoutL -- error after call: %d", error );
+        return error;
+        }
+
+    if( value != expectedValue )
+        {
+        VCXLOGLO3("CMPXMediaSettingsEngineTest::GetServerTimeoutL -- value %d, expected value %d", value, expectedValue);
+        error = KErrCorrupt;
+        }
+    
+    VCXLOGLO2("<-- CMPXMediaSettingsEngineTest::GetServerTimeoutL return %d", error);
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoScheduler_ApiTest::SetMinUDPPortL
+// -----------------------------------------------------------------------------
+//
+TInt CMPXMediaSettingsEngineTest::SetMinUDPPortL( CStifItemParser& aItem )
+    {
+    LogMethod(_L("SetMinUDPPortL"));
+    VCXLOGLO1("--> CMPXMediaSettingsEngineTest::SetMinUDPPortL");
+    TInt error( 0 );
+    
+    TInt value( 0 );
+    User::LeaveIfError( aItem.GetNextInt( value ) );
+
+    error = iSettingsModel->SetMinUDPPort( value );
+
+    VCXLOGLO2("<-- CMPXMediaSettingsEngineTest::SetMinUDPPortL return %d", error);
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoScheduler_ApiTest::GetMinUDPPortL
+// -----------------------------------------------------------------------------
+//
+TInt CMPXMediaSettingsEngineTest::GetMinUDPPortL( CStifItemParser& aItem )
+    {
+    LogMethod(_L("GetMinUDPPortL"));
+    VCXLOGLO1("--> CMPXMediaSettingsEngineTest::GetMinUDPPortL");
+    
+    TInt error( 0 );
+
+    TInt expectedValue( 0 );
+    User::LeaveIfError( aItem.GetNextInt( expectedValue ) );
+    
+    TInt value( 0 );
+    error = iSettingsModel->GetMinUDPPort( value );
+    
+    if( error != KErrNone )
+        {
+        VCXLOGLO2("CMPXMediaSettingsEngineTest::GetMinUDPPortL -- error after call: %d", error );
+        return error;
+        }
+
+    if( value != expectedValue )
+        {
+        VCXLOGLO3("CMPXMediaSettingsEngineTest::GetMinUDPPortL -- value %d, expected value %d", value, expectedValue);
+        error = KErrCorrupt;
+        }
+    
+    VCXLOGLO2("<-- CMPXMediaSettingsEngineTest::GetMinUDPPortL return %d", error);
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoScheduler_ApiTest::SetMaxUDPPortL
+// -----------------------------------------------------------------------------
+//
+TInt CMPXMediaSettingsEngineTest::SetMaxUDPPortL( CStifItemParser& aItem )
+    {
+    LogMethod(_L("SetMaxUDPPortL"));
+    VCXLOGLO1("--> CMPXMediaSettingsEngineTest::SetMaxUDPPortL");
+    TInt error( 0 );
+    
+    TInt value( 0 );
+    User::LeaveIfError( aItem.GetNextInt( value ) );
+
+    error = iSettingsModel->SetMaxUDPPort( value );
+
+    VCXLOGLO2("<-- CMPXMediaSettingsEngineTest::SetMaxUDPPort return %d", error);
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoScheduler_ApiTest::GetMaxUDPPortL
+// -----------------------------------------------------------------------------
+//
+TInt CMPXMediaSettingsEngineTest::GetMaxUDPPortL( CStifItemParser& aItem )
+    {
+    LogMethod(_L("GetMaxUDPPortL"));
+    VCXLOGLO1("--> CMPXMediaSettingsEngineTest::GetMaxUDPPortL");
+    
+    TInt error( 0 );
+
+    TInt expectedValue( 0 );
+    User::LeaveIfError( aItem.GetNextInt( expectedValue ) );
+    
+    TInt value( 0 );
+    error = iSettingsModel->GetMaxUDPPort( value );
+    
+    if( error != KErrNone )
+        {
+        VCXLOGLO2("CMPXMediaSettingsEngineTest::GetMaxUDPPortL -- error after call: %d", error );
+        return error;
+        }
+
+    if( value != expectedValue )
+        {
+        VCXLOGLO3("CMPXMediaSettingsEngineTest::GetMaxUDPPortL -- value %d, expected value %d", value, expectedValue);
+        error = KErrCorrupt;
+        }
+    
+    VCXLOGLO2("<-- CMPXMediaSettingsEngineTest::GetMaxUDPPortL return %d", error);
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoScheduler_ApiTest::GetControllerVersionInfoL
+// -----------------------------------------------------------------------------
+//
+TInt CMPXMediaSettingsEngineTest::GetControllerVersionInfoL( CStifItemParser& aItem )
+    {
+    LogMethod(_L("GetControllerVersionInfoL"));
+    VCXLOGLO1("--> CMPXMediaSettingsEngineTest::GetControllerVersionInfoL");
+    TInt error( 0 );
+    
+    TBuf<256> verInfo;
+    error = iSettingsModel->GetControllerVersionInfo( verInfo );
+
+    if( error != KErrNone )
+        {
+        VCXLOGLO2("CMPXMediaSettingsEngineTest::GetControllerVersionInfoL -- error after call: %d", error );
+        }
+    
+    VCXLOGLO2("CMPXMediaSettingsEngineTest::GetControllerVersionInfoL : %S", &verInfo );
+    
+    VCXLOGLO2("<-- CMPXMediaSettingsEngineTest::GetControllerVersionInfoL return %d", error);
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoScheduler_ApiTest::GetControllerBuildDateL
+// -----------------------------------------------------------------------------
+//
+TInt CMPXMediaSettingsEngineTest::GetControllerBuildDateL( CStifItemParser& aItem )
+    {
+    LogMethod(_L("GetControllerBuildDateL"));
+    VCXLOGLO1("--> CMPXMediaSettingsEngineTest::GetControllerBuildDateL");
+    TInt error( 0 );
+    
+    TBuf<256> bldDate;
+    error = iSettingsModel->GetControllerBuildDate( bldDate );
+
+    if( error != KErrNone )
+        {
+        VCXLOGLO2("CMPXMediaSettingsEngineTest::GetControllerBuildDateL -- error after call: %d", error );
+        }
+    
+    VCXLOGLO2("CMPXMediaSettingsEngineTest::GetControllerBuildDateL : %S", &bldDate );
+    
+    VCXLOGLO2("<-- CMPXMediaSettingsEngineTest::GetControllerBuildDateL return %d", error);
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoScheduler_ApiTest::GetControllerAdditionalInfoL
+// -----------------------------------------------------------------------------
+//
+TInt CMPXMediaSettingsEngineTest::GetControllerAdditionalInfoL( CStifItemParser& aItem )
+    {
+    LogMethod(_L("GetControllerAdditionalInfoL"));
+    VCXLOGLO1("--> CMPXMediaSettingsEngineTest::GetControllerAdditionalInfoL");
+    TInt error( 0 );
+    
+    TBuf<256> addInfo;
+    error = iSettingsModel->GetControllerAdditionalInfo( addInfo );
+
+    if( error != KErrNone )
+        {
+        VCXLOGLO2("CMPXMediaSettingsEngineTest::GetControllerAdditionalInfoL -- error after call: %d", error );
+        }
+    
+    VCXLOGLO2("CMPXMediaSettingsEngineTest::GetControllerAdditionalInfoL : %S", &addInfo );
+     
+    VCXLOGLO2("<-- CMPXMediaSettingsEngineTest::GetControllerAdditionalInfoL return %d", error);
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoScheduler_ApiTest::SetDemandBwFactorL
+// -----------------------------------------------------------------------------
+//
+TInt CMPXMediaSettingsEngineTest::SetDemandBwFactorL( CStifItemParser& aItem )
+    {
+    LogMethod(_L("SetDemandBwFactorL"));
+    VCXLOGLO1("--> CMPXMediaSettingsEngineTest::SetDemandBwFactorL");
+    TInt error( 0 );
+    
+    TInt value( 0 );
+    User::LeaveIfError( aItem.GetNextInt( value ) );
+
+    error = iSettingsModel->SetDemandBwFactor( value );
+
+    VCXLOGLO2("<-- CMPXMediaSettingsEngineTest::SetDemandBwFactorL return %d", error);
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoScheduler_ApiTest::GetDemandBwFactorL
+// -----------------------------------------------------------------------------
+//
+TInt CMPXMediaSettingsEngineTest::GetDemandBwFactorL( CStifItemParser& aItem )
+    {
+    LogMethod(_L("GetDemandBwFactorL"));
+    VCXLOGLO1("--> CMPXMediaSettingsEngineTest::GetDemandBwFactorL");
+    
+    TInt error( 0 );
+
+    TInt expectedValue( 0 );
+    User::LeaveIfError( aItem.GetNextInt( expectedValue ) );
+    
+    TInt value( 0 );
+    error = iSettingsModel->GetDemandBwFactor( value );
+    
+    if( error != KErrNone )
+        {
+        VCXLOGLO2("CMPXMediaSettingsEngineTest::GetDemandBwFactorL -- error after call: %d", error );
+        return error;
+        }
+
+    if( value != expectedValue )
+        {
+        VCXLOGLO3("CMPXMediaSettingsEngineTest::GetDemandBwFactorL -- value %d, expected value %d", value, expectedValue);
+        error = KErrCorrupt;
+        }
+    
+    VCXLOGLO2("<-- CMPXMediaSettingsEngineTest::GetDemandBwFactorL return %d", error);
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoScheduler_ApiTest::SetSustainBandwidthL
+// -----------------------------------------------------------------------------
+//
+TInt CMPXMediaSettingsEngineTest::SetSustainBandwidthL( CStifItemParser& aItem )
+    {
+    LogMethod(_L("SetSustainBandwidthL"));
+    VCXLOGLO1("--> CMPXMediaSettingsEngineTest::SetSustainBandwidthL");
+    TInt error( 0 );
+
+    // value for databearer
+    TInt value( 0 );
+    User::LeaveIfError( aItem.GetNextInt( value ) );
+
+    TDataBearer dataBearer = static_cast<TDataBearer>(value);
+    
+    // value for maxbandwidth
+    User::LeaveIfError( aItem.GetNextInt( value ) );
+   
+    error = iSettingsModel->SetSustainBandwidth( value, dataBearer );
+
+    VCXLOGLO2("<-- CMPXMediaSettingsEngineTest::SetSustainBandwidthL return %d", error);       
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoScheduler_ApiTest::GetSustainBandwidthL
+// -----------------------------------------------------------------------------
+//
+TInt CMPXMediaSettingsEngineTest::GetSustainBandwidthL( CStifItemParser& aItem )
+    {
+    LogMethod(_L("GetSustainBandwidthL"));
+    VCXLOGLO1("--> CMPXMediaSettingsEngineTest::GetSustainBandwidthL");
+    TInt error( 0 );
+
+    // value for databearer
+    TInt bearerType( 0 );
+    User::LeaveIfError( aItem.GetNextInt( bearerType ) );
+
+    TDataBearer dataBearer = static_cast<TDataBearer>(bearerType);
+    
+    // value for expected value
+    TInt expectedValue( 0 );
+    User::LeaveIfError( aItem.GetNextInt( expectedValue ) );
+    
+    TInt value( 0 );
+    error = iSettingsModel->GetSustainBandwidth( value, dataBearer );
+
+    if( error != KErrNone )
+        {
+        VCXLOGLO2("CMPXMediaSettingsEngineTest::GetSustainBandwidthL -- error after call: %d", error );
+        return error;
+        }
+
+    if( value != expectedValue )
+        {
+        VCXLOGLO3("CMPXMediaSettingsEngineTest::GetSustainBandwidthL -- value %d, expected value %d", value, expectedValue);
+        error = KErrCorrupt;
+        }
+    
+    VCXLOGLO2("<-- CMPXMediaSettingsEngineTest::GetSustainBandwidthL return %d", error);
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoScheduler_ApiTest::GetSustainBwPresetsLL
+// -----------------------------------------------------------------------------
+//
+TInt CMPXMediaSettingsEngineTest::GetSustainBwPresetsLL( CStifItemParser& aItem )
+    {
+    LogMethod(_L("GetSustainBwPresetsLL"));
+    VCXLOGLO1("--> CMPXMediaSettingsEngineTest::SetSustainBandwidthL");
+    TInt error( 0 );
+
+    // value for databearer
+    TInt value( 0 );
+    User::LeaveIfError( aItem.GetNextInt( value ) );
+
+    TDataBearer dataBearer = static_cast<TDataBearer>(value);
+    
+    RArray<TInt> values;
+    error = iSettingsModel->GetSustainBwPresetsL( values, dataBearer );
+
+    if( error != KErrNone )
+        {
+        VCXLOGLO2("CMPXMediaSettingsEngineTest::GetSustainBwPresetsLL -- error after call: %d", error );
+        return error;
+        }
+
+    VCXLOGLO1("CMPXMediaSettingsEngineTest::SetSustainBandwidthL returned values:");
+    TInt i( 0 );
+    for( i = 0; i < values.Count(); i++ )
+        {
+        VCXLOGLO3("[%d] = %d", i, values[i]);
+        }
+
+    VCXLOGLO2("<-- CMPXMediaSettingsEngineTest::SetSustainBandwidthL return %d", error);
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoScheduler_ApiTest::GetMaxBwPresetsLL
+// -----------------------------------------------------------------------------
+//
+TInt CMPXMediaSettingsEngineTest::GetMaxBwPresetsLL( CStifItemParser& aItem )
+    {
+    LogMethod(_L("GetMaxBwPresetsLL"));
+    VCXLOGLO1("--> CMPXMediaSettingsEngineTest::GetMaxBwPresetsLL");
+    TInt error( 0 );
+
+    // value for databearer
+    TInt bearerType( 0 );
+    User::LeaveIfError( aItem.GetNextInt( bearerType ) );
+
+    TDataBearer dataBearer = static_cast<TDataBearer>(bearerType);
+    
+    RArray<TInt> values;
+    error = iSettingsModel->GetMaxBwPresetsL( values, dataBearer );
+    
+    if( error != KErrNone )
+        {
+        VCXLOGLO2("CMPXMediaSettingsEngineTest::GetMaxBwPresetsLL -- error after call: %d", error );
+        return error;
+        }
+
+    VCXLOGLO1("CMPXMediaSettingsEngineTest::GetMaxBwPresetsL returned values:");
+    TInt i( 0 );
+    for( i = 0; i < values.Count(); i++ )
+        {
+        VCXLOGLO3("[%d] = %d", i, values[i]);
+        }
+
+    VCXLOGLO2("<-- CMPXMediaSettingsEngineTest::GetMaxBwPresetsLL return %d", error);
+    
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoScheduler_ApiTest::SetAutoDisconTimeLL
+// -----------------------------------------------------------------------------
+//
+TInt CMPXMediaSettingsEngineTest::SetAutoDisconTimeLL( CStifItemParser& aItem )
+    {
+    LogMethod(_L("SetAutoDisconTimeLL"));
+    VCXLOGLO1("--> CMPXMediaSettingsEngineTest::SetAutoDisconTimeLL");
+    
+    TInt value( 0 );
+    User::LeaveIfError( aItem.GetNextInt( value ) );
+
+    TRAPD( error, iSettingsModel->SetAutoDisconTimeL( value ) );
+    
+    if( error != KErrNone )
+        {
+        VCXLOGLO2("CMPXMediaSettingsEngineTest::SetAutoDisconTimeLL -- error after call: %d", error );
+        return error;
+        }
+
+    VCXLOGLO2("<-- CMPXMediaSettingsEngineTest::SetAutoDisconTimeLL return %d", error);    
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoScheduler_ApiTest::AutoDisconTimeLL
+// -----------------------------------------------------------------------------
+//
+TInt CMPXMediaSettingsEngineTest::AutoDisconTimeLL( CStifItemParser& aItem )
+    {
+    LogMethod(_L("AutoDisconTimeLL"));
+    VCXLOGLO1("--> CMPXMediaSettingsEngineTest::AutoDisconTimeLL");
+    TInt error( 0 );
+    
+    TInt expectedValue( 0 );
+    User::LeaveIfError( aItem.GetNextInt( expectedValue ) );
+    
+    TInt value( 0 );
+    value = iSettingsModel->AutoDisconTimeL();
+    
+    if( error != KErrNone )
+        {
+        VCXLOGLO2("CMPXMediaSettingsEngineTest::AutoDisconTimeLL -- error after call: %d", error );
+        return error;
+        }
+
+    if( value != expectedValue )
+        {
+        VCXLOGLO3("CMPXMediaSettingsEngineTest::AutoDisconTimeLL -- value %d, expected value %d", value, expectedValue);
+        error = KErrCorrupt;
+        }
+    
+    VCXLOGLO2("<-- CMPXMediaSettingsEngineTest::AutoDisconTimeLL return %d", error);    
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoScheduler_ApiTest::SetVideoRepeatLL
+// -----------------------------------------------------------------------------
+//
+TInt CMPXMediaSettingsEngineTest::SetVideoRepeatLL( CStifItemParser& aItem )
+    {
+    LogMethod(_L("SetVideoRepeatLL"));
+    VCXLOGLO1("--> CMPXMediaSettingsEngineTest::SetVideoRepeatLL");
+
+    TInt value( 0 );
+    User::LeaveIfError( aItem.GetNextInt( value ) );
+
+    TBool repeat( value );
+    TRAPD( error, iSettingsModel->SetVideoRepeatL( repeat ) );
+
+    VCXLOGLO2("<-- CMPXMediaSettingsEngineTest::SetVideoRepeatLL return %d", error);    
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoScheduler_ApiTest::IsVideoRepeatOnLL
+// -----------------------------------------------------------------------------
+//
+TInt CMPXMediaSettingsEngineTest::IsVideoRepeatOnLL( CStifItemParser& aItem )
+    {
+    LogMethod(_L("IsVideoRepeatOnLL"));
+    VCXLOGLO1("--> CMPXMediaSettingsEngineTest::IsVideoRepeatOnLL");
+
+    TInt temp( 0 );
+    User::LeaveIfError( aItem.GetNextInt( temp ) );
+    
+    TBool expectedValue( temp );
+    
+    TBool value( 0 );
+    TRAPD( error, value = iSettingsModel->IsVideoRepeatOnL() );
+    
+    if( error != KErrNone )
+        {
+        VCXLOGLO2("CMPXMediaSettingsEngineTest::IsVideoRepeatOnL -- error after call: %d", error );
+        return error;
+        }
+   
+    if( value != expectedValue )
+        {
+        VCXLOGLO3("CMPXMediaSettingsEngineTest::IsVideoRepeatOnL -- value %d, expected value %d", value, expectedValue);
+        error = KErrCorrupt;
+        }
+    
+    VCXLOGLO2("<-- CMPXMediaSettingsEngineTest::IsVideoRepeatOnLL return %d", error);
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoScheduler_ApiTest::SetDefaultViewLL
+// -----------------------------------------------------------------------------
+//
+TInt CMPXMediaSettingsEngineTest::SetDefaultViewLL( CStifItemParser& aItem )
+    {
+    LogMethod(_L("SetDefaultViewLL"));
+    VCXLOGLO1("--> CMPXMediaSettingsEngineTest::SetDefaultViewLL");
+
+    TInt value( 0 );
+    User::LeaveIfError( aItem.GetNextInt( value ) );
+
+    TBool view( value );
+    TRAPD( error, iSettingsModel->SetDefaultViewL( view ) );
+    
+    VCXLOGLO2("<-- CMPXMediaSettingsEngineTest::SetDefaultViewLL return %d", error);    
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoScheduler_ApiTest::IsDefaultViewOnLL
+// -----------------------------------------------------------------------------
+//
+TInt CMPXMediaSettingsEngineTest::IsDefaultViewOnLL( CStifItemParser& aItem )
+    {
+    LogMethod(_L("IsDefaultViewOnLL"));
+    VCXLOGLO1("--> CMPXMediaSettingsEngineTest::IsDefaultViewOnLL");
+    
+    TInt temp( 0 );
+    User::LeaveIfError( aItem.GetNextInt( temp ) );
+    
+    TBool expectedValue( temp );
+    
+    TBool value( 0 );
+    TRAPD( error, value = iSettingsModel->IsDefaultViewOnL() );
+    
+    if( error != KErrNone )
+        {
+        VCXLOGLO2("CMPXMediaSettingsEngineTest::IsDefaultViewOnLL -- error after call: %d", error );
+        return error;
+        }
+
+    if( value != expectedValue )
+        {
+        VCXLOGLO3("CMPXMediaSettingsEngineTest::IsDefaultViewOnLL -- value %d, expected value %d", value, expectedValue);
+        error = KErrCorrupt;
+        }
+    
+    VCXLOGLO2("<-- CMPXMediaSettingsEngineTest::IsDefaultViewOnLL return %d", error);
+
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoScheduler_ApiTest::SetRockerKeysLL
+// -----------------------------------------------------------------------------
+//
+TInt CMPXMediaSettingsEngineTest::SetRockerKeysLL( CStifItemParser& aItem )
+    {
+    LogMethod(_L("SetRockerKeysLL"));
+    VCXLOGLO1("--> CMPXMediaSettingsEngineTest::SetRockerKeysLL");
+    
+    TInt value( 0 );
+    User::LeaveIfError( aItem.GetNextInt( value ) );
+
+    TBool keys( value );
+    TRAPD( error, iSettingsModel->SetRockerKeysL( keys ) );
+    
+    VCXLOGLO2("<-- CMPXMediaSettingsEngineTest::SetRockerKeysLL return %d", error);
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoScheduler_ApiTest::ShowRockerKeysLL
+// -----------------------------------------------------------------------------
+//
+TInt CMPXMediaSettingsEngineTest::ShowRockerKeysLL( CStifItemParser& aItem )
+    {
+    LogMethod(_L("ShowRockerKeysLL"));
+    VCXLOGLO1("--> CMPXMediaSettingsEngineTest::SetRockerKeysLL");
+
+    TInt temp( 0 );
+    User::LeaveIfError( aItem.GetNextInt( temp ) );
+    
+    TBool expectedValue( temp );
+    
+    TBool value( 0 );
+    TRAPD( error, value = iSettingsModel->ShowRockerKeysL() );
+    
+    if( error != KErrNone )
+        {
+        VCXLOGLO2("CMPXMediaSettingsEngineTest::ShowRockerKeysLL -- error after call: %d", error );
+        return error;
+        }
+
+    if( value != expectedValue )
+        {
+        VCXLOGLO3("CMPXMediaSettingsEngineTest::ShowRockerKeysLL -- value %d, expected value %d", value, expectedValue);
+        error = KErrCorrupt;
+        }
+    VCXLOGLO2("<-- CMPXMediaSettingsEngineTest::SetRockerKeysLL return %d", error);
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoScheduler_ApiTest::IsRockerKeysSupportedLL
+// -----------------------------------------------------------------------------
+//
+TInt CMPXMediaSettingsEngineTest::IsRockerKeysSupportedLL( CStifItemParser& aItem )
+    {
+    LogMethod(_L("IsRockerKeysSupportedLL"));
+    VCXLOGLO1("--> CMPXMediaSettingsEngineTest::IsRockerKeysSupportedLL");
+    
+    TInt temp( 0 );
+    User::LeaveIfError( aItem.GetNextInt( temp ) );
+    
+    TBool expectedValue( temp );
+    
+    TBool value( 0 );
+    TRAPD( error, value = iSettingsModel->IsRockerKeysSupportedL() );
+    
+    if( error != KErrNone )
+        {
+        VCXLOGLO2("CMPXMediaSettingsEngineTest::IsRockerKeysSupportedLL -- error after call: %d", error );
+        return error;
+        }
+
+    if( value != expectedValue )
+        {
+        VCXLOGLO3("CMPXMediaSettingsEngineTest::IsRockerKeysSupportedLL -- value %d, expected value %d", value, expectedValue);
+        error = KErrCorrupt;
+        }
+
+    VCXLOGLO2("<-- CMPXMediaSettingsEngineTest::IsRockerKeysSupportedLL return %d", error);
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CMPXMediaSettingsEngineTest::?member_function
+// ?implementation_description
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+/*
+TInt CMPXMediaSettingsEngineTest::?member_function(
+   CItemParser& aItem )
+   {
+
+   ?code
+
+   }
+*/
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+// None
+
+//  [End of File] - Do not remove
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mpsettbase/bmarm/MPSETTBASEU.DEF	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,22 @@
+EXPORTS
+	__24CMPSettingsBaseContainer @ 1 NONAME R3UNUSED ; CMPSettingsBaseContainer::CMPSettingsBaseContainer(void)
+	ConstructL__24CMPSettingsBaseContainerRC5TRect @ 2 NONAME R3UNUSED ; CMPSettingsBaseContainer::ConstructL(TRect const &)
+	CountComponentControls__C24CMPSettingsBaseContainer @ 3 NONAME R3UNUSED ; CMPSettingsBaseContainer::CountComponentControls(void) const
+	DoActivateL__19CMPSettingsBaseViewRC10TVwsViewIdG4TUidRC6TDesC8 @ 4 NONAME ; CMPSettingsBaseView::DoActivateL(TVwsViewId const &, TUid, TDesC8 const &)
+	DoDeactivate__19CMPSettingsBaseView @ 5 NONAME R3UNUSED ; CMPSettingsBaseView::DoDeactivate(void)
+	DynInitContainerL__19CMPSettingsBaseView @ 6 NONAME R3UNUSED ; CMPSettingsBaseView::DynInitContainerL(void)
+	DynInitMenuPaneL__19CMPSettingsBaseViewiP12CEikMenuPane @ 7 NONAME R3UNUSED ; CMPSettingsBaseView::DynInitMenuPaneL(int, CEikMenuPane *)
+	HandleClientRectChange__19CMPSettingsBaseView @ 8 NONAME R3UNUSED ; CMPSettingsBaseView::HandleClientRectChange(void)
+	ListBox__24CMPSettingsBaseContainer @ 9 NONAME R3UNUSED ; CMPSettingsBaseContainer::ListBox(void)
+	ListImplementationsL__21CMPSettingsPluginViewRt13RPointerArray1Z26CImplementationInformation @ 10 NONAME R3UNUSED ; CMPSettingsPluginView::ListImplementationsL(RPointerArray<CImplementationInformation> &)
+	NewL__21CMPSettingsPluginViewG4TUid @ 11 NONAME R3UNUSED ; CMPSettingsPluginView::NewL(TUid)
+	OfferKeyEventL__24CMPSettingsBaseContainerRC9TKeyEvent10TEventCode @ 12 NONAME R3UNUSED ; CMPSettingsBaseContainer::OfferKeyEventL(TKeyEvent const &, TEventCode)
+	SetCurrentItem__19CMPSettingsBaseViewi @ 13 NONAME R3UNUSED ; CMPSettingsBaseView::SetCurrentItem(int)
+	SetNaviPaneL__19CMPSettingsBaseView @ 14 NONAME R3UNUSED ; CMPSettingsBaseView::SetNaviPaneL(void)
+	SizeChanged__24CMPSettingsBaseContainer @ 15 NONAME R3UNUSED ; CMPSettingsBaseContainer::SizeChanged(void)
+	"_._19CMPSettingsBaseView" @ 16 NONAME R3UNUSED ; CMPSettingsBaseView::~CMPSettingsBaseView(void)
+	"_._21CMPSettingsPluginView" @ 17 NONAME R3UNUSED ; CMPSettingsPluginView::~CMPSettingsPluginView(void)
+	"_._24CMPSettingsBaseContainer" @ 18 NONAME R3UNUSED ; CMPSettingsBaseContainer::~CMPSettingsBaseContainer(void)
+	__19CMPSettingsBaseView @ 19 NONAME R3UNUSED ; CMPSettingsBaseView::CMPSettingsBaseView(void)
+	ComponentControl__C24CMPSettingsBaseContaineri @ 20 NONAME R3UNUSED ; CMPSettingsBaseContainer::ComponentControl(int) const
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mpsettbase/bwins/MPSETTBASEU.DEF	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,22 @@
+EXPORTS
+	??0CMPSettingsBaseContainer@@QAE@XZ @ 1 NONAME ; public: __thiscall CMPSettingsBaseContainer::CMPSettingsBaseContainer(void)
+	??0CMPSettingsBaseView@@QAE@XZ @ 2 NONAME ; public: __thiscall CMPSettingsBaseView::CMPSettingsBaseView(void)
+	??1CMPSettingsBaseContainer@@UAE@XZ @ 3 NONAME ; public: virtual __thiscall CMPSettingsBaseContainer::~CMPSettingsBaseContainer(void)
+	??1CMPSettingsBaseView@@UAE@XZ @ 4 NONAME ; public: virtual __thiscall CMPSettingsBaseView::~CMPSettingsBaseView(void)
+	??1CMPSettingsPluginView@@UAE@XZ @ 5 NONAME ; public: virtual __thiscall CMPSettingsPluginView::~CMPSettingsPluginView(void)
+	?ComponentControl@CMPSettingsBaseContainer@@UBEPAVCCoeControl@@H@Z @ 6 NONAME ; public: virtual class CCoeControl * __thiscall CMPSettingsBaseContainer::ComponentControl(int)const 
+	?ConstructL@CMPSettingsBaseContainer@@QAEXABVTRect@@@Z @ 7 NONAME ; public: void __thiscall CMPSettingsBaseContainer::ConstructL(class TRect const &)
+	?CountComponentControls@CMPSettingsBaseContainer@@UBEHXZ @ 8 NONAME ; public: virtual int __thiscall CMPSettingsBaseContainer::CountComponentControls(void)const 
+	?DoActivateL@CMPSettingsBaseView@@MAEXABVTVwsViewId@@VTUid@@ABVTDesC8@@@Z @ 9 NONAME ; protected: virtual void __thiscall CMPSettingsBaseView::DoActivateL(class TVwsViewId const &,class TUid,class TDesC8 const &)
+	?DoDeactivate@CMPSettingsBaseView@@MAEXXZ @ 10 NONAME ; protected: virtual void __thiscall CMPSettingsBaseView::DoDeactivate(void)
+	?DynInitContainerL@CMPSettingsBaseView@@MAEXXZ @ 11 NONAME ; protected: virtual void __thiscall CMPSettingsBaseView::DynInitContainerL(void)
+	?DynInitMenuPaneL@CMPSettingsBaseView@@MAEXHPAVCEikMenuPane@@@Z @ 12 NONAME ; protected: virtual void __thiscall CMPSettingsBaseView::DynInitMenuPaneL(int,class CEikMenuPane *)
+	?HandleClientRectChange@CMPSettingsBaseView@@QAEXXZ @ 13 NONAME ; public: void __thiscall CMPSettingsBaseView::HandleClientRectChange(void)
+	?ListBox@CMPSettingsBaseContainer@@UAEPAVCEikTextListBox@@XZ @ 14 NONAME ; public: virtual class CEikTextListBox * __thiscall CMPSettingsBaseContainer::ListBox(void)
+	?ListImplementationsL@CMPSettingsPluginView@@SAXAAV?$RPointerArray@VCImplementationInformation@@@@@Z @ 15 NONAME ; public: static void __cdecl CMPSettingsPluginView::ListImplementationsL(class RPointerArray<class CImplementationInformation> &)
+	?NewL@CMPSettingsPluginView@@SAPAV1@VTUid@@@Z @ 16 NONAME ; public: static class CMPSettingsPluginView * __cdecl CMPSettingsPluginView::NewL(class TUid)
+	?OfferKeyEventL@CMPSettingsBaseContainer@@UAE?AW4TKeyResponse@@ABUTKeyEvent@@W4TEventCode@@@Z @ 17 NONAME ; public: virtual enum TKeyResponse  __thiscall CMPSettingsBaseContainer::OfferKeyEventL(struct TKeyEvent const &,enum TEventCode)
+	?SetCurrentItem@CMPSettingsBaseView@@UAEXH@Z @ 18 NONAME ; public: virtual void __thiscall CMPSettingsBaseView::SetCurrentItem(int)
+	?SetNaviPaneL@CMPSettingsBaseView@@MAEXXZ @ 19 NONAME ; protected: virtual void __thiscall CMPSettingsBaseView::SetNaviPaneL(void)
+	?SizeChanged@CMPSettingsBaseContainer@@UAEXXZ @ 20 NONAME ; public: virtual void __thiscall CMPSettingsBaseContainer::SizeChanged(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mpsettbase/bwinscw/MPSETTBASEU.DEF	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,25 @@
+EXPORTS
+	??0CMPSettingsBaseContainer@@QAE@XZ @ 1 NONAME ; CMPSettingsBaseContainer::CMPSettingsBaseContainer(void)
+	??0CMPSettingsBaseView@@QAE@XZ @ 2 NONAME ; CMPSettingsBaseView::CMPSettingsBaseView(void)
+	??1CMPSettingsBaseContainer@@UAE@XZ @ 3 NONAME ; CMPSettingsBaseContainer::~CMPSettingsBaseContainer(void)
+	??1CMPSettingsBaseView@@UAE@XZ @ 4 NONAME ; CMPSettingsBaseView::~CMPSettingsBaseView(void)
+	??1CMPSettingsPluginView@@UAE@XZ @ 5 NONAME ; CMPSettingsPluginView::~CMPSettingsPluginView(void)
+	?ComponentControl@CMPSettingsBaseContainer@@UBEPAVCCoeControl@@H@Z @ 6 NONAME ; class CCoeControl * CMPSettingsBaseContainer::ComponentControl(int) const
+	?ConstructL@CMPSettingsBaseContainer@@QAEXABVTRect@@@Z @ 7 NONAME ; void CMPSettingsBaseContainer::ConstructL(class TRect const &)
+	?CountComponentControls@CMPSettingsBaseContainer@@UBEHXZ @ 8 NONAME ; int CMPSettingsBaseContainer::CountComponentControls(void) const
+	?DoActivateL@CMPSettingsBaseView@@MAEXABVTVwsViewId@@VTUid@@ABVTDesC8@@@Z @ 9 NONAME ; void CMPSettingsBaseView::DoActivateL(class TVwsViewId const &, class TUid, class TDesC8 const &)
+	?DoDeactivate@CMPSettingsBaseView@@MAEXXZ @ 10 NONAME ; void CMPSettingsBaseView::DoDeactivate(void)
+	?DynInitContainerL@CMPSettingsBaseView@@MAEXXZ @ 11 NONAME ; void CMPSettingsBaseView::DynInitContainerL(void)
+	?DynInitMenuPaneL@CMPSettingsBaseView@@MAEXHPAVCEikMenuPane@@@Z @ 12 NONAME ; void CMPSettingsBaseView::DynInitMenuPaneL(int, class CEikMenuPane *)
+	?HandleClientRectChange@CMPSettingsBaseView@@QAEXXZ @ 13 NONAME ; void CMPSettingsBaseView::HandleClientRectChange(void)
+	?ListBox@CMPSettingsBaseContainer@@UAEPAVCEikTextListBox@@XZ @ 14 NONAME ; class CEikTextListBox * CMPSettingsBaseContainer::ListBox(void)
+	?ListImplementationsL@CMPSettingsPluginView@@SAXAAV?$RPointerArray@VCImplementationInformation@@@@@Z @ 15 NONAME ; void CMPSettingsPluginView::ListImplementationsL(class RPointerArray<class CImplementationInformation> &)
+	?NewL@CMPSettingsPluginView@@SAPAV1@VTUid@@@Z @ 16 NONAME ; class CMPSettingsPluginView * CMPSettingsPluginView::NewL(class TUid)
+	?OfferKeyEventL@CMPSettingsBaseContainer@@UAE?AW4TKeyResponse@@ABUTKeyEvent@@W4TEventCode@@@Z @ 17 NONAME ; enum TKeyResponse CMPSettingsBaseContainer::OfferKeyEventL(struct TKeyEvent const &, enum TEventCode)
+	?SetCurrentItem@CMPSettingsBaseView@@UAEXH@Z @ 18 NONAME ; void CMPSettingsBaseView::SetCurrentItem(int)
+	?SetNaviPaneL@CMPSettingsBaseView@@MAEXXZ @ 19 NONAME ; void CMPSettingsBaseView::SetNaviPaneL(void)
+	?SizeChanged@CMPSettingsBaseContainer@@UAEXXZ @ 20 NONAME ; void CMPSettingsBaseContainer::SizeChanged(void)
+	?HandleResourceChange@CMPSettingsBaseContainer@@UAEXH@Z @ 21 NONAME ; void CMPSettingsBaseContainer::HandleResourceChange(int)
+	?SetSelectedItem@CMPSettingsBaseContainer@@QAEXH@Z @ 22 NONAME ; void CMPSettingsBaseContainer::SetSelectedItem(int)
+	?SetMiddleSoftKeyLabelL@CMPSettingsBaseView@@MAEXHH@Z @ 23 NONAME ; void CMPSettingsBaseView::SetMiddleSoftKeyLabelL(int, int)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mpsettbase/eabi/MPSettBaseU.DEF	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,38 @@
+EXPORTS
+	_ZN19CMPSettingsBaseView11DoActivateLERK10TVwsViewId4TUidRK6TDesC8 @ 1 NONAME
+	_ZN19CMPSettingsBaseView12DoDeactivateEv @ 2 NONAME
+	_ZN19CMPSettingsBaseView12SetNaviPaneLEv @ 3 NONAME
+	_ZN19CMPSettingsBaseView14SetCurrentItemEi @ 4 NONAME
+	_ZN19CMPSettingsBaseView16DynInitMenuPaneLEiP12CEikMenuPane @ 5 NONAME
+	_ZN19CMPSettingsBaseView17DynInitContainerLEv @ 6 NONAME
+	_ZN19CMPSettingsBaseView22HandleClientRectChangeEv @ 7 NONAME
+	_ZN19CMPSettingsBaseViewC2Ev @ 8 NONAME
+	_ZN19CMPSettingsBaseViewD0Ev @ 9 NONAME
+	_ZN19CMPSettingsBaseViewD1Ev @ 10 NONAME
+	_ZN19CMPSettingsBaseViewD2Ev @ 11 NONAME
+	_ZN21CMPSettingsPluginView20ListImplementationsLER13RPointerArrayI26CImplementationInformationE @ 12 NONAME
+	_ZN21CMPSettingsPluginView4NewLE4TUid @ 13 NONAME
+	_ZN21CMPSettingsPluginViewD0Ev @ 14 NONAME
+	_ZN21CMPSettingsPluginViewD1Ev @ 15 NONAME
+	_ZN21CMPSettingsPluginViewD2Ev @ 16 NONAME
+	_ZN24CMPSettingsBaseContainer10ConstructLERK5TRect @ 17 NONAME
+	_ZN24CMPSettingsBaseContainer11SizeChangedEv @ 18 NONAME
+	_ZN24CMPSettingsBaseContainer14OfferKeyEventLERK9TKeyEvent10TEventCode @ 19 NONAME
+	_ZN24CMPSettingsBaseContainer7ListBoxEv @ 20 NONAME
+	_ZN24CMPSettingsBaseContainerC2Ev @ 21 NONAME
+	_ZN24CMPSettingsBaseContainerD0Ev @ 22 NONAME
+	_ZN24CMPSettingsBaseContainerD1Ev @ 23 NONAME
+	_ZN24CMPSettingsBaseContainerD2Ev @ 24 NONAME
+	_ZNK24CMPSettingsBaseContainer16ComponentControlEi @ 25 NONAME
+	_ZNK24CMPSettingsBaseContainer22CountComponentControlsEv @ 26 NONAME
+	_ZTI19CMPSettingsBaseView @ 27 NONAME ; #<TI>#
+	_ZTI21CMPSettingsPluginView @ 28 NONAME ; #<TI>#
+	_ZTI24CMPSettingsBaseContainer @ 29 NONAME ; #<TI>#
+	_ZTV19CMPSettingsBaseView @ 30 NONAME ; #<VT>#
+	_ZTV21CMPSettingsPluginView @ 31 NONAME ; #<VT>#
+	_ZTV24CMPSettingsBaseContainer @ 32 NONAME ; #<VT>#
+	_ZThn12_N19CMPSettingsBaseView16DynInitMenuPaneLEiP12CEikMenuPane @ 33 NONAME ; #<thunk>#
+	_ZN24CMPSettingsBaseContainer20HandleResourceChangeEi @ 34 NONAME
+	_ZN24CMPSettingsBaseContainer15SetSelectedItemEi @ 35 NONAME
+	_ZN19CMPSettingsBaseView22SetMiddleSoftKeyLabelLEii @ 36 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mpsettbase/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,27 @@
+/*
+* 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 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:   Build information file for mpsettbase*
+*/
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/mediasettingsbase.iby             CORE_APP_LAYER_IBY_EXPORT_PATH(mediasettingsbase.iby)
+
+PRJ_MMPFILES
+mpsettbase.mmp
+
+PRJ_TESTMMPFILES
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mpsettbase/group/mpsettbase.mmp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2002 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:   Makefile for Media Settings base classes.*
+*/
+
+
+// Version : %version: 3 %
+
+
+
+#include <platform_paths.hrh>
+TARGET          mpsettbase.dll
+TARGETTYPE      dll
+UID             0x1000006C 0x101F85E3
+VENDORID		VID_DEFAULT
+
+SOURCEPATH      ../src
+SOURCE          MPSettingsBaseContainer.cpp
+SOURCE          MPSettingsBaseView.cpp
+SOURCE          MPSettingsPluginView.cpp
+
+USERINCLUDE     .
+USERINCLUDE     ../inc
+USERINCLUDE     ../../mediasettingsapp/inc
+
+APP_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   /epoc32/include/ecom
+
+CAPABILITY      CAP_GENERAL_DLL
+
+LIBRARY         avkon.lib
+LIBRARY         euser.lib
+LIBRARY         ecom.lib
+LIBRARY         cone.lib
+LIBRARY         eikcore.lib
+LIBRARY         commonengine.lib
+
+LIBRARY         eikcoctl.lib
+LIBRARY         featmgr.lib
+LIBRARY         aknskins.lib 
+LIBRARY         flogger.lib
+
+#if defined(ARMCC)
+deffile ../eabi/ 
+#elif defined(WINSCW)
+deffile ../bwinscw/ 
+#elif defined(WINS)
+deffile ../bwins/ 
+#else
+deffile ../bmarm/ 
+#endif
+
+//end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mpsettbase/inc/MPSettPluginViewInterfaceUID.hrh	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2002 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:   Defines ECOM interface UIDs.*
+*/
+
+
+// Version : %version: 2 %
+
+
+
+#ifndef MPSETTPLUGINVIEWINTERFACEUID_HRH
+#define MPSETTPLUGINVIEWINTERFACEUID_HRH
+
+// Interface UIDs
+#define KMPSettPluginViewInterfaceUid 0x101F85E4
+
+
+#endif // MPSETTPLUGINVIEWINTERFACEUID_HRH
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mpsettbase/inc/MPSettingsBaseContainer.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,123 @@
+/*
+* Copyright (c) 2002 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:   Base class for all Media Settings containers.*
+*/
+
+
+// Version : %version: 2 %
+
+
+
+#ifndef MPSETTINGSBASECONTAINER_H
+#define MPSETTINGSBASECONTAINER_H
+
+// INCLUDES
+#include    <coeccntx.h>
+#include    <eikclb.h>
+
+// CLASS DECLARATION
+
+/**
+*  CMPSettingsBaseContainer container class
+*
+*  @lib MPSettBase.dll
+*  @since 2.0
+*/
+class CMPSettingsBaseContainer : public CCoeControl
+{
+    public: // constructors and destructor
+
+        /*
+        * C++ constructor.
+        */
+        IMPORT_C CMPSettingsBaseContainer();
+      
+        /**
+        * Constructs all common parts of the container.
+        * @param aRect Listbox control's rect.
+        */
+        IMPORT_C void ConstructL(const TRect& aRect);
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CMPSettingsBaseContainer();
+
+    public:  // Functions from base classes
+
+        /**
+        * From CCoeControl.
+        */
+        IMPORT_C void SizeChanged();
+
+        /**
+        * From CCoeControl 
+        */
+        IMPORT_C void HandleResourceChange(TInt aType);
+        
+		/**
+        * From CCoeControl.
+        */
+        IMPORT_C TInt CountComponentControls() const;
+
+        /**
+        * From CCoeControl.
+        */
+        IMPORT_C CCoeControl* ComponentControl(TInt aIndex) const;
+
+        /**
+        * From CCoeControl.
+        */
+        IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,
+                                             TEventCode aType);
+
+    public:   // New
+        /**
+        * Provides access to listbox control.
+        * @since 2.0
+        * @return pointer to listbox control.
+        */
+        IMPORT_C virtual CEikTextListBox* ListBox();
+
+        /**
+        * Sets selected item in the listbox.
+        * @param aIndex Index of the item.
+        */
+        IMPORT_C void SetSelectedItem( TInt aIndex );
+
+
+    protected:  // New functions
+        /**
+        * Constructs component controls owned by the child class.
+        *   Pure virtual.
+        * @since 2.0
+        */
+        virtual void ConstructComponentControlsL() = 0;
+
+    private:  // New functions
+        /**
+        * Returns title resource id.
+        * @since 2.0
+        * @return title resource id.
+        */
+        virtual TInt TitleResourceId() = 0;
+
+    protected: // Data
+        CCoeControl* iComponentControl; // Not owned
+        CEikTextListBox* iListBox; // Not owned
+};
+
+#endif //MPSETTINGSBASECONTAINER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mpsettbase/inc/MPSettingsBaseView.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,142 @@
+/*
+* Copyright (c) 2002 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:   Base class for Media Settings views.*
+*/
+
+
+// Version : %version: 2 %
+
+
+
+
+#ifndef MPSETTINGSBASEVIEW_H
+#define MPSETTINGSBASEVIEW_H
+
+//  INCLUDES
+#include    <aknview.h>
+    
+// FORWARD DECLARATIONS
+class CMPSettingsBaseContainer;
+class CAknNavigationDecorator;
+class CMPSettingsAppUi;
+class MMPSettingsNaviPaneController;
+
+// CLASS DECLARATION
+
+/**
+*  Base class for Media Settings views.
+*
+*  @lib MPSettBase.dll
+*  @since 2.0
+*/
+class CMPSettingsBaseView : public CAknView
+    {
+    public:     // New data types
+        enum KMPViewPanicCodes
+            {
+            EMPViewPanicNullPtr = 1
+            };
+
+    public:     // Constructors and destructor
+
+        /**
+        * C++ default constructor
+        */
+        IMPORT_C CMPSettingsBaseView();
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CMPSettingsBaseView();
+
+    public:     // from CAknView
+
+        /**
+        * Handles client rect change.
+        */
+        IMPORT_C void HandleClientRectChange();
+
+    public:     // New
+
+        /**
+        * This function is used to set the current item in the listbox.
+        * @since 2.0
+        * @param aIndex Current item.
+        */
+        IMPORT_C virtual void SetCurrentItem(TInt aIndex);
+
+    protected:  // Functions from base classes
+
+        /**
+        * From CAknView
+        */
+        IMPORT_C void DoActivateL(const TVwsViewId& aPrevViewId,
+                                  TUid aCustomMessageId,
+                                  const TDesC8& aCustomMessage);
+
+        /**
+        * From CAknView
+        */
+        IMPORT_C void DoDeactivate();
+
+        /**
+        * From MEikMenuObserver
+        */
+        IMPORT_C void DynInitMenuPaneL(TInt aResourceId,
+                                       CEikMenuPane* aMenuPane);        
+
+    protected:  // New
+
+        /**
+        * Sets the correct navi pane for the view (eg. tabs, empty,
+        *   string etc.)
+        * @since 2.0
+        */
+        IMPORT_C virtual void SetNaviPaneL();
+
+        /**
+        * Called at the end of DoActivateL.
+        * @since 2.0
+        */
+        IMPORT_C virtual void DynInitContainerL();
+
+        /**
+        * Creates new view specific container class. Pure virtual.
+        * @since 2.0
+        */
+        virtual CMPSettingsBaseContainer* NewContainerL() = 0;
+
+        /** 
+        * Adds given resource text as MSK to CBA.
+        *
+        * @param aResourceId middle softkey label.
+        * @param aCommandId command that should be performed when MSK
+        *        is pressed.
+        * @since S60 v3.2
+        */
+        IMPORT_C virtual void SetMiddleSoftKeyLabelL(
+            const TInt aResourceId,
+            const TInt aCommandId );
+
+    protected:  // Data
+        CMPSettingsBaseContainer* iContainer;
+        CAknNavigationDecorator* iNaviPaneContext;
+        MMPSettingsNaviPaneController* iNaviCntrl;
+
+        TInt iCurrentItem;
+        TInt iTopItemIndex;
+    };
+
+#endif      // MPSETTINGSBASEVIEW_H   
+            
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mpsettbase/inc/MPSettingsPluginView.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2002 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:   Common interface for ECOM varied plug-in views.*
+*/
+
+
+// Version : %version: 3 %
+
+
+
+
+#ifndef CMPSETTINGSPLUGINVIEW_H
+#define CMPSETTINGSPLUGINVIEW_H
+
+// INCLUDES
+#include    <e32std.h>
+#include    <e32base.h>
+#include    <implementationinformation.h>
+
+#include    "MPSettingsBaseView.h"
+
+// CLASS DECLARATION
+
+/**
+*  CMPSettingsPluginView
+*  Common API for ECOM varied plug-in views.
+*
+*  @lib MPSettBase.dll
+*  @since 2.0
+*/
+class CMPSettingsPluginView : public CMPSettingsBaseView
+    {
+    public: // Constructors and destructor
+
+       /**
+        * Constructor.
+        */
+        IMPORT_C static CMPSettingsPluginView* NewL(TUid aUid);
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CMPSettingsPluginView();
+
+    public: // New
+
+        /**
+        * Provides an implementation information array.
+        * @since 2.0
+        * @param aImplInfoArray Array which is populated with the implementation
+        *   information of the available implementations.
+        */
+        IMPORT_C static void ListImplementationsL(RImplInfoPtrArray& aImplInfoArray);
+
+        /**
+        * Returns ETrue if the view should be opened from Main view's list.
+        * @return ETrue:  The view appears in Main view's list.
+        *         EFalse: The view does not appear in Main view's list (case: subview).
+        */
+        virtual TBool OpenedFromMainView() = 0;
+
+    protected:
+        TUid iDtor_ID_Key;
+    };
+
+#endif      // CMPSETTINGSPLUGINVIEW_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mpsettbase/rom/mediasettingsbase.iby	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2005 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:   MediaSettingsBase ROM*
+*/
+
+
+// Version : %version: 2 %
+
+#ifndef __MEDIASETTINGSBASE_IBY__
+#define __MEDIASETTINGSBASE_IBY__
+
+#include <data_caging_paths_for_iby.hrh>
+
+file=ABI_DIR\BUILD_DIR\mpsettbase.dll                       SHARED_LIB_DIR\mpsettbase.dll
+
+#endif //__MEDIASETTINGSBASE_IBY__
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mpsettbase/src/MPSettingsBaseContainer.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,175 @@
+/*
+* Copyright (c) 2002 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:   Base class for MediaSettings view containers.*
+*/
+
+
+// Version : %version: 2 %
+
+
+
+
+// INCLUDE FILES
+#include    <aknappui.h>
+#include    <akntitle.h>
+#include    <barsread.h>
+#include    <eikspane.h>
+#include    <aknlists.h> 
+#include    "MPSettingsBaseContainer.h" 
+#include	"mpxlog.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CMPSettingsBaseContainer::CMPSettingsBaseContainer
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CMPSettingsBaseContainer::CMPSettingsBaseContainer()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsBaseContainer::CMPSettingsBaseContainer()"));
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsBaseContainer::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CMPSettingsBaseContainer::ConstructL(const TRect& aRect)
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsBaseContainer::ConstructL()"));
+    CEikStatusPane* sp = static_cast<CAknAppUi*>(iCoeEnv->AppUi())->StatusPane();
+
+    CAknTitlePane* title = static_cast<CAknTitlePane*>(sp->ControlL(TUid::Uid(EEikStatusPaneUidTitle)));
+
+    TResourceReader rReader;
+    iCoeEnv->CreateResourceReaderLC(rReader, TitleResourceId());
+    title->SetFromResourceL(rReader);
+    CleanupStack::PopAndDestroy(); //rReader
+      
+    CreateWindowL(); // Makes the control a window-owning control
+ 
+    // Construct and initialize control(s)
+    ConstructComponentControlsL();
+
+    SetRect(aRect);
+    ActivateL();
+    }
+   
+// -----------------------------------------------------------------------------
+// CMPSettingsBaseContainer::~CMPSettingsBaseContainer
+// Destructor
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CMPSettingsBaseContainer::~CMPSettingsBaseContainer()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsBaseContainer::~CMPSettingsBaseContainer()"));
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsBaseContainer::ListBox
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CEikTextListBox* CMPSettingsBaseContainer::ListBox()
+    {
+    return iListBox;
+    }
+
+// ---------------------------------------------------------------------------
+// CMPSettingsBaseContainer::SizeChanged()
+// Called by framwork when the view size is changed
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CMPSettingsBaseContainer::SizeChanged()
+    {
+    if (iComponentControl)
+        {
+        iComponentControl->SetRect(Rect());
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CMPSettingsBaseContainer::CountComponentControls() const
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CMPSettingsBaseContainer::CountComponentControls() const
+    {
+    return 1; //magic
+    }
+
+// ---------------------------------------------------------------------------
+// CMPSettingsBaseContainer::ComponentControl(TInt aIndex) const
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CCoeControl* CMPSettingsBaseContainer::ComponentControl(TInt /*aIndex*/) const
+    {
+    return iComponentControl;
+    }
+
+// ---------------------------------------------------------
+// CMPSettingsBaseContainer::HandleResourceChange
+// Handles a resource relative event 
+// ---------------------------------------------------------
+//
+EXPORT_C void CMPSettingsBaseContainer::HandleResourceChange( TInt aType )
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsBaseContainer::HandleResourceChange(0x%X)"),aType);
+    if ( aType == KEikDynamicLayoutVariantSwitch ) //Handle change in layout orientation
+        {
+        TRect mainPaneRect;
+        AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPaneRect );
+        SetRect( mainPaneRect );
+		DrawNow();
+		}
+    CCoeControl::HandleResourceChange( aType );    
+    }
+
+// ---------------------------------------------------------------------------
+// CMPSettingsBaseContainer::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType)
+// Called when a key is pressed.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TKeyResponse  CMPSettingsBaseContainer::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType)
+    {
+    MPX_DEBUG4(_L("#MS# CMPSettingsBaseContainer::OfferKeyEventL() iCode(0x%X) iScanCode(0x%X) aType(0x%X)"),
+				 aKeyEvent.iCode,aKeyEvent.iScanCode,aType);
+    TKeyResponse response = EKeyWasNotConsumed;
+
+    if (iComponentControl &&
+        aKeyEvent.iCode != EKeyLeftArrow &&
+        aKeyEvent.iCode != EKeyRightArrow)
+        {
+        response = iComponentControl->OfferKeyEventL(aKeyEvent, aType); 
+        }
+
+    return response;
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsBaseContainer::SetSelectedItem()
+//
+//
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CMPSettingsBaseContainer::SetSelectedItem( TInt aIndex )
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsBaseContainer::SetSelectedItem(%d)"),aIndex);
+    if( iListBox && aIndex >= 0 )
+        {
+        iListBox->SetCurrentItemIndexAndDraw( aIndex );
+        }
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mpsettbase/src/MPSettingsBaseView.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,228 @@
+/*
+* Copyright (c) 2002 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:   Base class for MediaSettings views.*
+*/
+
+
+// Version : %version: 6 %
+
+
+
+
+// INCLUDE FILES
+#include    <aknViewAppUi.h>
+#include    <akntitle.h>
+#include    <barsread.h>
+#include    <aknnavi.h>
+#include    <aknnavide.h>
+#include    <featmgr.h>
+#include    <eikmenup.h>
+#include    <MediaSettings.rsg>
+#include    <StringLoader.h> 
+#include    "mediasettings.hrh"
+#include    "MPSettingsAppUi.h"
+#include    "MPSettingsBaseView.h"
+#include    "MPSettingsBaseContainer.h"
+#include    "MPSettingsNaviPaneController.h"
+#include    "MPSettingsConstants.h"
+#include    "mpxlog.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CMPSettingsBaseView::CMPSettingsBaseView
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CMPSettingsBaseView::CMPSettingsBaseView()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsBaseView::CMPSettingsBaseView()"));
+    iNaviCntrl = static_cast<CMPSettingsAppUi*>(AppUi());
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsBaseView::~CMPSettingsBaseView
+// Destructor
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CMPSettingsBaseView::~CMPSettingsBaseView()
+    {
+        MPX_DEBUG1(_L("#MS# CMPSettingsBaseView::~CMPSettingsBaseView()"));
+        if (iContainer)
+        {
+        AppUi()->RemoveFromStack(iContainer);
+        delete iContainer;
+        }
+
+        if (iNaviPaneContext && iNaviPaneContext != iNaviCntrl->MPTabGroup())
+        {
+        delete iNaviPaneContext;
+        }   
+    }
+
+// ---------------------------------------------------------
+// CMPSettingsBaseView::HandleClientRectChange
+// ---------------------------------------------------------
+//
+EXPORT_C void CMPSettingsBaseView::HandleClientRectChange()
+    {
+        MPX_DEBUG1(_L("#MS# CMPSettingsBaseView::HandleClientRectChange()"));
+        if (iContainer)
+        {
+        iContainer->SetRect(ClientRect());
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CMPSettingsBaseView::HandleClientRectChange
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CMPSettingsBaseView::SetCurrentItem(TInt aIndex)
+    {
+        MPX_DEBUG2(_L("#MS# CMPSettingsBaseView::SetCurrentItem(%d)"),aIndex);
+        iCurrentItem = aIndex;
+    }
+
+// ---------------------------------------------------------
+// CMPSettingsBaseView::DoActivateL
+// ---------------------------------------------------------
+//
+EXPORT_C void CMPSettingsBaseView::DoActivateL(
+   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
+   const TDesC8& /*aCustomMessage*/)
+    {
+        MPX_DEBUG1(_L("#MS# CMPSettingsBaseView::DoActivateL()"));
+        // Set correct navi pane
+        SetNaviPaneL();
+
+        // Create iContainer if one does not exist
+        if (!iContainer)
+        {
+            iContainer = NewContainerL();
+
+            __ASSERT_DEBUG(iContainer, User::Panic(_L("DoActivateL"), EMPViewPanicNullPtr));
+
+            iContainer->SetMopParent(this);
+
+            // Construction of component control could fail => delete iContainer in order 
+            // to quarantee that it is constructed again the next time it is used.
+            TRAPD(error, iContainer->ConstructL(ClientRect()));
+            if (error)
+                {
+                delete iContainer;
+                iContainer = NULL;
+                User::Leave(error);
+                }
+
+            AppUi()->AddToStackL(*this, iContainer);
+
+            DynInitContainerL();
+        } 
+   }
+
+// ---------------------------------------------------------
+// CMPSettingsBaseView::HandleCommandL
+// ---------------------------------------------------------
+//
+EXPORT_C void CMPSettingsBaseView::DoDeactivate()
+    {
+        MPX_DEBUG1(_L("#MS# CMPSettingsBaseView::DoDeactivate()"));
+        if (iContainer)
+        {
+            CEikTextListBox* listbox = iContainer->ListBox();
+            if (listbox)
+                {
+                iCurrentItem = listbox->CurrentItemIndex();
+                iTopItemIndex = listbox->TopItemIndex();
+                }
+
+            AppUi()->RemoveFromStack(iContainer);
+            delete iContainer;
+            iContainer = NULL;
+        }    
+    }
+
+// ---------------------------------------------------------------------------
+// CMPSettingsBaseView::DynInitMenuPaneL
+// Before showing a options menu
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CMPSettingsBaseView::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
+    {
+        MPX_DEBUG2(_L("#MS# CMPSettingsBaseView::DynInitMenuPaneL(0x%X)"),aResourceId);
+        if (aResourceId == R_MPSETT_APP_MENU)
+        {
+            // Help should be displayed only if the feature is supported according
+            // to Feature Manager
+            if (!FeatureManager::FeatureSupported(KFeatureIdHelp))
+                {
+                aMenuPane->SetItemDimmed(EMPSettCmdHelp, ETrue);
+                }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CMPSettingsBaseView::SetNaviPaneL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CMPSettingsBaseView::SetNaviPaneL()
+    {
+        MPX_DEBUG1(_L("#MS# CMPSettingsBaseView::SetNaviPaneL()"));
+        if (iNaviPaneContext)
+        {
+            iNaviCntrl->NaviContainer()->PushL(*iNaviPaneContext);
+            if (iNaviPaneContext == iNaviCntrl->MPTabGroup())
+                {
+                iNaviCntrl->UpdateTabIndex();
+                }
+        }
+        else 
+        {
+            iNaviCntrl->NaviContainer()->PushDefaultL();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CMPSettingsBaseView::DynInitContainerL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CMPSettingsBaseView::DynInitContainerL()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsBaseView::DynInitContainerL()"));
+    // Do nothing.
+    }
+
+// ---------------------------------------------------------------------------
+// CMPSettingsBaseView::SetMiddleSoftKeyLabelL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CMPSettingsBaseView::SetMiddleSoftKeyLabelL( const TInt aResourceId, const TInt aCommandId )
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsBaseView::SetMiddleSoftKeyLabelL()"));
+    CEikButtonGroupContainer* cbaGroup = Cba();
+    if ( cbaGroup )
+        {
+        HBufC* middleSKText = StringLoader::LoadLC( aResourceId );
+        TPtr mskPtr = middleSKText->Des();
+        MPX_DEBUG2(_L("#MS# CMPSettingsBaseView::SetMiddleSoftKeyLabelL(%S)"),&mskPtr);
+        cbaGroup->AddCommandToStackL(
+            KMediaSettingsMSKControlID,
+            aCommandId,
+            mskPtr );
+        CleanupStack::PopAndDestroy( middleSKText );
+        }
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mpsettbase/src/MPSettingsPluginView.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2002 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:   MPSettingsPluginView.cpp*
+*/
+
+
+// Version : %version: 3 %
+
+
+
+
+// INCLUDE FILES
+//#include    <e32base.h>
+#include    <ecom.h>
+#include    "MPSettingsPluginView.h"
+#include    "MPSettPluginViewInterfaceUID.hrh"
+#include	"mpxlog.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CMPSettingsPluginView::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CMPSettingsPluginView* CMPSettingsPluginView::NewL(TUid aUid)
+    {
+    MPX_DEBUG2(_L("#MS# CMPSettingsPluginView::NewL(0x%X)"),aUid);
+    return static_cast<CMPSettingsPluginView*>(REComSession::CreateImplementationL
+        (aUid, _FOFF(CMPSettingsPluginView, iDtor_ID_Key)));
+    }
+    
+// -----------------------------------------------------------------------------
+// CMPSettingsPluginView::~CMPSettingsPluginView
+// Destructor
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CMPSettingsPluginView::~CMPSettingsPluginView()
+    {
+    MPX_DEBUG1(_L("#MS# CMPSettingsPluginView::~CMPSettingsPluginView()"));
+    REComSession::FinalClose();
+    REComSession::DestroyedImplementation(iDtor_ID_Key);
+    }
+
+// -----------------------------------------------------------------------------
+// CMPSettingsPluginView::ListImplementationsL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CMPSettingsPluginView::ListImplementationsL(RImplInfoPtrArray& aImplInfoArray)
+    {
+    const TUid pluginViewInterfaceUID = {KMPSettPluginViewInterfaceUid};
+    MPX_DEBUG2(_L("#MS# CMPSettingsPluginView::ListImplementationsL(0x%X)"),pluginViewInterfaceUID);
+    REComSession::ListImplementationsL(pluginViewInterfaceUID, aImplInfoArray);
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videoplayersettingsengine/bwins/vcxnssettingsengineu.def	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,40 @@
+EXPORTS
+	??0TIptvDriveInfo@@QAE@XZ @ 1 NONAME ; TIptvDriveInfo::TIptvDriveInfo(void)
+	??0TIptvDriveMonitorEvent@@QAE@XZ @ 2 NONAME ; TIptvDriveMonitorEvent::TIptvDriveMonitorEvent(void)
+	??1CVideoSettingsDriveMonitor@@UAE@XZ @ 3 NONAME ; CVideoSettingsDriveMonitor::~CVideoSettingsDriveMonitor(void)
+	??1TIptvDriveInfo@@QAE@XZ @ 4 NONAME ; TIptvDriveInfo::~TIptvDriveInfo(void)
+	?ArrayPos@CVideoSettingsDriveMonitor@@QAEHH@Z @ 5 NONAME ; int CVideoSettingsDriveMonitor::ArrayPos(int)
+	?ArrayPosL@CVideoSettingsDriveMonitor@@QAEHH@Z @ 6 NONAME ; int CVideoSettingsDriveMonitor::ArrayPosL(int)
+	?CheckLockCodeL@CVcxNsSettingsEngine@@QAEHXZ @ 7 NONAME ; int CVcxNsSettingsEngine::CheckLockCodeL(void)
+	?FixedDrive@CVideoSettingsDriveMonitor@@QAEHH@Z @ 8 NONAME ; int CVideoSettingsDriveMonitor::FixedDrive(int)
+	?FixedDriveL@CVideoSettingsDriveMonitor@@QAEHH@Z @ 9 NONAME ; int CVideoSettingsDriveMonitor::FixedDriveL(int)
+	?GetAllowRoaming@CVcxNsSettingsEngine@@QAEHAAH@Z @ 10 NONAME ; int CVcxNsSettingsEngine::GetAllowRoaming(int &)
+	?GetAllowUseGprs@CVcxNsSettingsEngine@@QAEHAAH@Z @ 11 NONAME ; int CVcxNsSettingsEngine::GetAllowUseGprs(int &)
+	?GetParentControl@CVcxNsSettingsEngine@@QAEHAAH@Z @ 12 NONAME ; int CVcxNsSettingsEngine::GetParentControl(int &)
+	?GetPlayerVolume@CVcxNsSettingsEngine@@QAEHAAH@Z @ 13 NONAME ; int CVcxNsSettingsEngine::GetPlayerVolume(int &)
+	?GetUsedMemoryL@CVcxNsSettingsEngine@@QAEXAAH@Z @ 14 NONAME ; void CVcxNsSettingsEngine::GetUsedMemoryL(int &)
+	?GetUsedMemoryL@CVideoSettingsDriveMonitor@@QAEXAAH@Z @ 15 NONAME ; void CVideoSettingsDriveMonitor::GetUsedMemoryL(int &)
+	?GetUsedSnapId@CVcxNsSettingsEngine@@QAEHAAH@Z @ 16 NONAME ; int CVcxNsSettingsEngine::GetUsedSnapId(int &)
+	?GetVideoOnDemandThumbnails@CVcxNsSettingsEngine@@QAEHAAH@Z @ 17 NONAME ; int CVcxNsSettingsEngine::GetVideoOnDemandThumbnails(int &)
+	?IsMmcInserted@CVideoSettingsDriveMonitor@@QAEHXZ @ 18 NONAME ; int CVideoSettingsDriveMonitor::IsMmcInserted(void)
+	?MassStorageDrive@CVideoSettingsDriveMonitor@@QAEHXZ @ 19 NONAME ; int CVideoSettingsDriveMonitor::MassStorageDrive(void)
+	?MassStorageDriveL@CVideoSettingsDriveMonitor@@QAEHXZ @ 20 NONAME ; int CVideoSettingsDriveMonitor::MassStorageDriveL(void)
+	?MemoryCardDrive@CVideoSettingsDriveMonitor@@QAEHXZ @ 21 NONAME ; int CVideoSettingsDriveMonitor::MemoryCardDrive(void)
+	?MemoryCardDriveL@CVideoSettingsDriveMonitor@@QAEHXZ @ 22 NONAME ; int CVideoSettingsDriveMonitor::MemoryCardDriveL(void)
+	?NewL@CVcxNsSettingsEngine@@SAPAV1@XZ @ 23 NONAME ; class CVcxNsSettingsEngine * CVcxNsSettingsEngine::NewL(void)
+	?NewL@CVideoSettingsDriveMonitor@@SAPAV1@ABVRFs@@@Z @ 24 NONAME ; class CVideoSettingsDriveMonitor * CVideoSettingsDriveMonitor::NewL(class RFs const &)
+	?NewL@CVideoSettingsDriveMonitor@@SAPAV1@XZ @ 25 NONAME ; class CVideoSettingsDriveMonitor * CVideoSettingsDriveMonitor::NewL(void)
+	?PhoneMemoryDrive@CVideoSettingsDriveMonitor@@QAEHXZ @ 26 NONAME ; int CVideoSettingsDriveMonitor::PhoneMemoryDrive(void)
+	?PhoneMemoryDriveL@CVideoSettingsDriveMonitor@@QAEHXZ @ 27 NONAME ; int CVideoSettingsDriveMonitor::PhoneMemoryDriveL(void)
+	?RefreshAvailableDrivesL@CVideoSettingsDriveMonitor@@QAEXXZ @ 28 NONAME ; void CVideoSettingsDriveMonitor::RefreshAvailableDrivesL(void)
+	?RegisterObserverL@CVideoSettingsDriveMonitor@@QAEXPAVMIptvDriveMonitorObserver@@@Z @ 29 NONAME ; void CVideoSettingsDriveMonitor::RegisterObserverL(class MIptvDriveMonitorObserver *)
+	?RemoveObserverL@CVideoSettingsDriveMonitor@@QAEXPAVMIptvDriveMonitorObserver@@@Z @ 30 NONAME ; void CVideoSettingsDriveMonitor::RemoveObserverL(class MIptvDriveMonitorObserver *)
+	?RunL@CVideoSettingsDriveMonitor@@MAEXXZ @ 31 NONAME ; void CVideoSettingsDriveMonitor::RunL(void)
+	?SetAllowRoaming@CVcxNsSettingsEngine@@QAEHH@Z @ 32 NONAME ; int CVcxNsSettingsEngine::SetAllowRoaming(int)
+	?SetAllowUseGprs@CVcxNsSettingsEngine@@QAEHH@Z @ 33 NONAME ; int CVcxNsSettingsEngine::SetAllowUseGprs(int)
+	?SetParentControl@CVcxNsSettingsEngine@@QAEHH@Z @ 34 NONAME ; int CVcxNsSettingsEngine::SetParentControl(int)
+	?SetPlayerVolume@CVcxNsSettingsEngine@@QAEHH@Z @ 35 NONAME ; int CVcxNsSettingsEngine::SetPlayerVolume(int)
+	?SetUsedMemory@CVcxNsSettingsEngine@@QAEHH@Z @ 36 NONAME ; int CVcxNsSettingsEngine::SetUsedMemory(int)
+	?SetUsedSnapId@CVcxNsSettingsEngine@@QAEHH@Z @ 37 NONAME ; int CVcxNsSettingsEngine::SetUsedSnapId(int)
+	?SetVideoOnDemandThumbnails@CVcxNsSettingsEngine@@QAEHH@Z @ 38 NONAME ; int CVcxNsSettingsEngine::SetVideoOnDemandThumbnails(int)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videoplayersettingsengine/eabi/vcxnssettingsengineu.def	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,48 @@
+EXPORTS
+	_ZN14TIptvDriveInfoC1Ev @ 1 NONAME
+	_ZN14TIptvDriveInfoC2Ev @ 2 NONAME
+	_ZN14TIptvDriveInfoD1Ev @ 3 NONAME
+	_ZN14TIptvDriveInfoD2Ev @ 4 NONAME
+	_ZN20CVcxNsSettingsEngine13GetUsedSnapIdERi @ 5 NONAME
+	_ZN20CVcxNsSettingsEngine13SetUsedMemoryEi @ 6 NONAME
+	_ZN20CVcxNsSettingsEngine13SetUsedSnapIdEi @ 7 NONAME
+	_ZN20CVcxNsSettingsEngine14CheckLockCodeLEv @ 8 NONAME
+	_ZN20CVcxNsSettingsEngine14GetUsedMemoryLERi @ 9 NONAME
+	_ZN20CVcxNsSettingsEngine15GetAllowRoamingERi @ 10 NONAME
+	_ZN20CVcxNsSettingsEngine15GetAllowUseGprsERi @ 11 NONAME
+	_ZN20CVcxNsSettingsEngine15GetPlayerVolumeERi @ 12 NONAME
+	_ZN20CVcxNsSettingsEngine15SetAllowRoamingEi @ 13 NONAME
+	_ZN20CVcxNsSettingsEngine15SetAllowUseGprsEi @ 14 NONAME
+	_ZN20CVcxNsSettingsEngine15SetPlayerVolumeEi @ 15 NONAME
+	_ZN20CVcxNsSettingsEngine16GetParentControlERi @ 16 NONAME
+	_ZN20CVcxNsSettingsEngine16SetParentControlEi @ 17 NONAME
+	_ZN20CVcxNsSettingsEngine26GetVideoOnDemandThumbnailsERi @ 18 NONAME
+	_ZN20CVcxNsSettingsEngine26SetVideoOnDemandThumbnailsEi @ 19 NONAME
+	_ZN20CVcxNsSettingsEngine4NewLEv @ 20 NONAME
+	_ZN22TIptvDriveMonitorEventC1Ev @ 21 NONAME
+	_ZN22TIptvDriveMonitorEventC2Ev @ 22 NONAME
+	_ZN26CVideoSettingsDriveMonitor10FixedDriveEi @ 23 NONAME
+	_ZN26CVideoSettingsDriveMonitor11FixedDriveLEi @ 24 NONAME
+	_ZN26CVideoSettingsDriveMonitor13IsMmcInsertedEv @ 25 NONAME
+	_ZN26CVideoSettingsDriveMonitor14GetUsedMemoryLERi @ 26 NONAME
+	_ZN26CVideoSettingsDriveMonitor15MemoryCardDriveEv @ 27 NONAME
+	_ZN26CVideoSettingsDriveMonitor15RemoveObserverLEP25MIptvDriveMonitorObserver @ 28 NONAME
+	_ZN26CVideoSettingsDriveMonitor16MassStorageDriveEv @ 29 NONAME
+	_ZN26CVideoSettingsDriveMonitor16MemoryCardDriveLEv @ 30 NONAME
+	_ZN26CVideoSettingsDriveMonitor16PhoneMemoryDriveEv @ 31 NONAME
+	_ZN26CVideoSettingsDriveMonitor17MassStorageDriveLEv @ 32 NONAME
+	_ZN26CVideoSettingsDriveMonitor17PhoneMemoryDriveLEv @ 33 NONAME
+	_ZN26CVideoSettingsDriveMonitor17RegisterObserverLEP25MIptvDriveMonitorObserver @ 34 NONAME
+	_ZN26CVideoSettingsDriveMonitor23RefreshAvailableDrivesLEv @ 35 NONAME
+	_ZN26CVideoSettingsDriveMonitor4NewLERK3RFs @ 36 NONAME
+	_ZN26CVideoSettingsDriveMonitor4NewLEv @ 37 NONAME
+	_ZN26CVideoSettingsDriveMonitor8ArrayPosEi @ 38 NONAME
+	_ZN26CVideoSettingsDriveMonitor9ArrayPosLEi @ 39 NONAME
+	_ZN26CVideoSettingsDriveMonitorD0Ev @ 40 NONAME
+	_ZN26CVideoSettingsDriveMonitorD1Ev @ 41 NONAME
+	_ZN26CVideoSettingsDriveMonitorD2Ev @ 42 NONAME
+	_ZTI20CVcxNsSettingsEngine @ 43 NONAME ; #<TI>#
+	_ZTI26CVideoSettingsDriveMonitor @ 44 NONAME ; #<TI>#
+	_ZTV20CVcxNsSettingsEngine @ 45 NONAME ; #<VT>#
+	_ZTV26CVideoSettingsDriveMonitor @ 46 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videoplayersettingsengine/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,28 @@
+/*
+* 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:   Build information file for project vcxnsuiengine*
+*/
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/videoplayersettingsengine.iby             CORE_APP_LAYER_IBY_EXPORT_PATH(videoplayersettingsengine.iby)
+
+PRJ_MMPFILES
+
+videoplayersettingsengine.mmp
+
+PRJ_TESTMMPFILES
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videoplayersettingsengine/group/videoplayersettingsengine.mmp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,53 @@
+/*
+* 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:   Project definition file for Video Center UI Engine*
+*/
+
+
+
+#include <platform_paths.hrh>
+
+//OPTION ARMCC --asm --interleave
+ALWAYS_BUILD_AS_ARM
+
+TARGET        vcxnssettingsengine.dll
+TARGETTYPE    dll
+
+UID 0x1000008d 0x20016B9A
+
+CAPABILITY      CAP_GENERAL_DLL
+
+SOURCEPATH ../src
+
+SOURCE videoplayersettingsengine.cpp
+SOURCE videosettingsdrivemonitor.cpp
+SOURCE videosettingsdrivemonitorevent.cpp
+SOURCE videosettingsdriveinfo.cpp
+
+USERINCLUDE ../inc
+
+APP_LAYER_SYSTEMINCLUDE
+ 
+LIBRARY euser.lib
+LIBRARY flogger.lib
+LIBRARY bafl.lib
+LIBRARY estor.lib
+LIBRARY etel.lib 
+LIBRARY etelmm.lib
+LIBRARY centralrepository.lib
+LIBRARY efsrv.lib
+LIBRARY secui.lib       
+LIBRARY apmime.lib      
+LIBRARY platformenv.lib // PathInfo
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videoplayersettingsengine/inc/mvideosettingsdrivemonitorobserver.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,41 @@
+/*
+* 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: 
+*
+*/
+
+
+#ifndef __MVIDEOSETTINGSDRIVEMONITOROBSERVER_H__
+#define __MVIDEOSETTINGSDRIVEMONITOROBSERVER_H__
+
+#include "tvideosettingsdrivemonitorevent.h"
+
+// CLASS DECLARATION
+
+/**
+* Observer for CIptvDriveMonitor class.
+*/
+class MIptvDriveMonitorObserver
+    {
+        
+    public:
+        /**
+        * Handles drive monitor event.
+        *
+        * @param aEvent Event.
+        */
+        virtual void HandleDriveMonitorEvent( TIptvDriveMonitorEvent& aEvent ) = 0;
+    };
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videoplayersettingsengine/inc/tvideosettingsdriveinfo.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,102 @@
+/*
+* 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:   header file for TIptvDriveInfo class*
+*/
+
+
+
+
+#ifndef TVIDEOSETTINGDRIVEINFO_H
+#define TVIDEOSETTINGDRIVEINFO_H
+
+//  INCLUDES
+#include <e32base.h>
+
+const TInt KIptvDriveNameMaxLength = 256;
+
+// CLASS DECLARATION
+/**
+* Container class for storing drive info relevant for Video Center.
+*/
+class TIptvDriveInfo
+    {
+    public:
+
+        /*
+        * Attribute flags used in iFlags member.
+        */
+        enum TDriveAttributes
+            {
+            /**
+            * Media can be removed from the drive, (E or F, depending on hw configuration).
+            * If not set (= 0) then the drive is fixed.
+            */
+            ERemovable = 1 << 0,
+
+            /**
+            * Default mass storage drive.
+            */
+            EMassStorage = 1 << 1,
+            
+            /**
+            * Media is locked.
+            */
+            ELocked = 1 << 2,
+            
+            /**
+            * Media is removed from the drive.
+            */
+            EMediaNotPresent = 1 << 3            
+            };
+            
+        /**
+        * Constructor, clears member variables to zero.
+        */
+        IMPORT_C TIptvDriveInfo();
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C ~TIptvDriveInfo();
+            
+    public:
+    
+        /**
+        * Drive ID number, 0 points to A:, 1 to B:, 2 to C: and so on.
+        */
+        TInt iDrive;
+
+        /**
+        * Drive char.
+        */
+        TChar iDriveChar;
+        
+        /**
+        * Drive type, same as TDriveInfo::iType.
+        */
+        TInt iType;
+
+        /**
+        * Properties of the drive, see TDriveAttributes -enum for flag values.
+        */
+        TUint32 iFlags;
+        
+        /**
+        * Volume name. Removable drive can contain different volumes (mmc cards). This name
+        * refers to removable item (card label), not the drive. 
+        */
+        TBuf<KIptvDriveNameMaxLength> iVolumeName;
+    };
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videoplayersettingsengine/inc/tvideosettingsdrivemonitorevent.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,122 @@
+/*
+* 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:   Drive monitor event object*
+*/
+
+
+
+
+#ifndef TVIDEOSETTINGDRIVEMONITOREVENT_H
+#define TVIDEOSETTINGDRIVEMONITOREVENT_H
+
+//  INCLUDES
+#include <e32base.h>
+
+// CONSTANTS
+
+// MACROS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*  Used for sending events from CIptvDriveMonitor to client.
+*/
+class TIptvDriveMonitorEvent
+    {
+    public:
+    
+        /**
+        * Events, used in iEvent member variable.
+        */
+        enum TEvent
+            {
+            /**
+            * Value used at construction.
+            */                
+            ENone,
+            
+            /**
+            * Media was removed (typically memory card).
+            */                
+            EMediaRemoved,
+
+            /**
+            * Media was inserted (typically memory card).
+            */
+            EMediaInserted,
+            
+            /**
+            * Drive was locked.
+            */
+            EDriveLocked,
+            
+            /**
+            * Drive was unlocked.
+            */
+            EDriveUnlocked,
+
+            /**
+            * Drive was mounted.
+            */            
+            EDriveMounted,
+
+            /**
+            * Drive was dismounted.
+            */            
+            EDriveDismounted,
+            
+            /**
+            * Drive volume name was changed.
+            */
+            EDriveVolumeNameChanged
+            };
+            
+    public:  // Constructors and destructor
+        
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C TIptvDriveMonitorEvent();
+
+        /**
+        * Returns event as a descriptor. Used for debugging purposes.
+        *
+        * @param aEvent Event as enum.
+        * @return       Event as a descriptor.
+        */
+        static const TDesC& EventDes( TEvent aEvent );
+
+    public:
+    
+        /**
+        * Identifies the event, see TEvent for values.
+        */
+        TInt  iEvent;
+        
+        /**
+        * The drive which caused the event (a = 0, b = 1, ... etc).
+        */
+        TInt iDrive;
+
+    };
+
+#endif      // TVIDEOSETTINGDRIVEMONITOREVENT_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videoplayersettingsengine/inc/videoplayercenrepkeys.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,74 @@
+/*
+* 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:   App settings handles storing and loading of application settings*
+*/
+
+
+
+#ifndef VIDEOPLAYERCENREPKEYS_H
+#define VIDEOPLAYERCENREPKEYS_H
+
+// INCLUDES
+
+
+// CONSTANTS 
+
+// CenRep: UIDs
+//
+const TUid KIptvCenRepUid                       = { 0x102750E2 };
+const TUid KIptvAlrCenRepUid                    = { 0x2000B438 };
+
+// CenRep: Keys
+//
+const TInt KIptvCenRepPreferredMemoryKey        = 0x1;
+const TInt KIptvCenRepConnectionsKey            = 0x2;
+const TInt KIptvCenRepCellularKey               = 0x3;
+const TInt KIptvCenRepVoDThumbnailsKey          = 0x4;
+const TInt KIptvCenRepActiveServiceIdKey        = 0x5;
+const TInt KIptvCenRepVideoPlayerVolumeKey      = 0x6;
+const TInt KIptvCenRepMainAppServiceFocusKey    = 0x7;
+const TInt KIptvCenRepFirstTimeKey              = 0x8;
+const TInt KIptvCenRepServiceUpdatedKey         = 0x9;
+const TInt KIptvCenRepUpdatedServiceIdKey       = 0xA;
+const TInt KIptvCenRepAPModeKey                 = 0xB;
+const TInt KIptvCenRepParentControlKey          = 0xC;
+
+const TInt KIptvCenRepUsedSnapIdKey             = 0x1;
+const TInt KIptvCenRepAllowUseGprsKey           = 0x2;
+const TInt KIptvCenRepAllowRoamingKey           = 0x3;
+const TInt KIptvCenRepMaxUsedMemoryKey          = 0x4;
+const TInt KIptvCenRepIadUpdateCheckTimeKey     = 0xA;
+
+// CenRep: Key values
+//
+const TInt KIptvCenRepPreferredMemoryKeyPhone   = 0;
+const TInt KIptvCenRepPreferredMemoryKeyMmc     = 1;
+const TInt KIptvCenRepParentControlKeyOff       = 0;
+const TInt KIptvCenRepAPModeAlwaysAsk           = 0;
+const TInt KIptvCenRepAPModeUserDefined         = 1;
+
+const TInt KIptvCenRepConnectionKeyValueYes     = 1;
+const TInt KIptvCenRepConnectionKeyValueNo      = 0;
+const TInt KIptvCenRepSnapAlwaysAsk             = 0;
+
+// CenRep: Default values
+//
+const TInt KIptvCenRepPreferredMemoryKeyDefault = KIptvCenRepPreferredMemoryKeyMmc;
+const TInt KIptvCenRepFirstTimeKeyDefault       = 8;
+const TInt KIptvCenRepParentControlKeyDefault   = KIptvCenRepParentControlKeyOff;
+const TInt KIptvCenRepAPModeKeyDefault          = KIptvCenRepAPModeUserDefined;
+
+#endif //VIDEOPLAYERCENREPKEYS_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videoplayersettingsengine/inc/videoplayersettingsengine.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,229 @@
+/*
+* Copyright (c) 2006 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:   App settings handles storing and loading of application settings*
+*/
+
+
+
+#ifndef _CVCXNSSETTINGS_H_
+#define _CVCXNSSETTINGS_H_
+
+// INCLUDES
+#include <e32base.h>   
+#include <f32file.h>
+#include <etelmm.h>
+
+
+// CONSTANTS 
+
+// FORWARD DECLARATIONS
+class CRepository;
+
+
+// CLASS DECLARATION
+
+/**
+* Class CVcxNsSettingsEngine handles application setting related saving and loading.
+*
+* @lib vcxnssettingsengine.lib
+*/
+class CVcxNsSettingsEngine : public CBase
+    { 
+
+    public:
+
+        /**
+         * Two-phased constructor.
+         *
+         * @return New CIptvAppSettings object.
+         */
+        IMPORT_C static CVcxNsSettingsEngine* NewL();
+
+        /**
+         * Destructor.
+         */
+        virtual ~CVcxNsSettingsEngine();
+
+   
+    public: // Exported methods that handle application settings
+				
+		
+        /**
+         * Get used memory from CenRep. Leaves with system-wide error code
+         * on error.
+         *
+         * @param aUsedMemory Reference to variable where value is stored.
+         */
+        IMPORT_C void GetUsedMemoryL( TInt& aUsedMemory );
+
+        /**
+         * Set used memory to CenRep.
+         *
+         * @param aUsedMemory New value.        
+         * @return ETrue if successfull, EFalse otherwise.
+         */
+        IMPORT_C TBool SetUsedMemory( TInt aUsedMemory );
+
+        /**
+         * Get parental control setting from central repository.
+         *
+         * @param aParentControl On return, parental control setting value.
+         *                       0 if parental control is off, otherwise the age set. 
+         * @return ETrue if successfull, EFalse otherwise.
+         */
+        IMPORT_C TBool GetParentControl( TInt& aParentControl );
+
+        /**
+         * Set parental control setting to central repository.
+         *
+         * @param aParentControl Parental control value to set.
+         * @return ETrue if successfull, EFalse otherwise.
+         */
+        IMPORT_C TBool SetParentControl( TInt aParentControl );
+
+        /**
+         * Get VoD thumnbails from CenRep.
+         *
+         * @param aVodThumbnails Reference to variable where value is stored.
+         * @return ETrue if successfull, EFalse otherwise.
+         */
+        IMPORT_C TBool GetVideoOnDemandThumbnails( TInt& aVodThumbnails );
+        
+        /**
+         * Set VoD thumbnails to CenRep.
+         *
+         * @param aVodThumbnails New value.
+         * @return ETrue if successfull, EFalse otherwise.
+         */
+        IMPORT_C TBool SetVideoOnDemandThumbnails( TInt aVodThumbnails );
+        
+        /**
+         * Get UsedSnapId from CenRep.
+         *
+         * @param aUsedSnapId Reference to variable where value is stored.
+         * @return ETrue if successful, EFalse otherwise.
+         */
+        IMPORT_C TBool GetUsedSnapId( TInt& aUsedSnapId );
+
+        /**
+         * Set UsedSnapId to CenRep.
+         *
+         * @param aUsedSnapId New value.
+         * @return ETrue if successful, EFalse otherwise.
+         */
+        IMPORT_C TBool SetUsedSnapId( TInt aUsedSnapId );
+        
+        /**
+         * Get AllowUseGprs from CenRep.
+         *
+         * @param aAllowUseGprs Reference to variable where value is stored.
+         * @return ETrue if successful, EFalse otherwise.
+         */
+        IMPORT_C TBool GetAllowUseGprs( TInt& aAllowUseGprs );
+
+        /**
+         * Set AllowUseGprs to CenRep.
+         *
+         * @param aAllowUseGprs New value.
+         * @return ETrue if successful, EFalse otherwise.
+         */
+        IMPORT_C TBool SetAllowUseGprs( TInt aAllowUseGprs );
+        
+        /**
+         * Get AllowRoaming from CenRep.
+         *
+         * @param aAllowRoaming Reference to variable where value is stored.
+         * @return ETrue if successful, EFalse otherwise.
+         */
+        IMPORT_C TBool GetAllowRoaming( TInt& aAllowRoaming );
+
+        /**
+         * Set AllowRoaming to CenRep.
+         *
+         * @param aAllowRoaming New value.
+         * @return ETrue if successful, EFalse otherwise.
+         */
+        IMPORT_C TBool SetAllowRoaming( TInt aAllowRoaming );
+ 
+        /**
+         * Check the lock code 
+         *
+         * @return ETrue if the user enters the correct lock code
+         */
+        IMPORT_C TBool CheckLockCodeL();
+  
+        /**
+         * Get player volume setting fron CenRep
+         *
+         * @param aVolume Reference to variable where value is stored.
+         * @return ETrue if successful, EFalse otherwise.
+         */
+        IMPORT_C TBool GetPlayerVolume( TInt& aVolume );
+
+        /**
+         * Store volume setting to CenRep
+         *
+         * @param aVolume New value.
+         * @return ETrue if successful, EFalse otherwise.
+         */
+        IMPORT_C TBool SetPlayerVolume( TInt aVolume );
+        
+    private:
+         
+        /**
+         * C++ Constructor.
+         *
+         */
+        CVcxNsSettingsEngine( );
+        
+        /**
+         * EPOC constructor.
+         */
+        void ConstructL( );
+
+               
+        /**
+         * Read integer value from CenRep.
+         *
+         * @param aCategory CenRep category uid of the requested key
+         * @param aKey   CenRep key to read.
+         * @param aValue Reference to variable where value is stored.
+         * @return ETrue if successfull, EFalse otherwise.
+         */
+        TBool GetCenRepIntKey( TUid aCategory, TInt aKey, TInt& aValue );
+        
+        /**
+         * Write integer value to CenRep.
+         *
+         * @param aCategory CenRep category uid of the requested key
+         * @param aKey   CenRep key to write.
+         * @param aValue New value.
+         * @return ETrue if successfull, EFalse otherwise.
+         */
+        TBool SetCenRepIntKey(  TUid aCategory, TInt aKey, TInt aValue );
+              
+    private: // Data
+    
+        CRepository*  iCenRep;
+        CRepository*  iAlrCenRep;
+
+        TBool           iPhoneConnected;
+        RTelServer		iServer;
+        RMobilePhone	iPhone;
+
+    };
+
+#endif // _CVCXNSSETTINGS_H_
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videoplayersettingsengine/inc/videoplayersettingsengine.pan	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2001 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 __VCXNSSETTINGSENGINE_PAN__
+#define __VCXNSSETTINGSENGINE_PAN__
+
+#include <e32std.h>
+
+_LIT(KPanicVcxNsSettingsEngine, "VcxNsSettingsEngine");
+
+/** VCxNsSettings Engine panic codes */
+enum TVcxNsSettingsEnginePanics 
+    {
+    EVcxNsSettingsEngineArgument = 1,
+    EVcxNsSettingsEngineBadState
+    // add further panics here
+    };
+
+#endif // __VCXNSSETTINGSENGINE_PAN__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videoplayersettingsengine/inc/videosettingsdrivemonitor.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,301 @@
+/*
+* 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:   Helper class for Video Center for drive operations/monitoring.*
+*/
+
+
+
+
+#ifndef CVIDEOSETTINGSDRIVEMONITOR_H
+#define CVIDEOSETTINGSDRIVEMONITOR_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <f32file.h>
+#include "tvideosettingsdriveinfo.h"
+#include "tvideosettingsdrivemonitorevent.h"
+#include "mvideosettingsdrivemonitorobserver.h"
+
+// CONSTANTS
+
+// MACROS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+ * Helper class for Video Center for drive operations/monitoring.
+ * User can get available drives (through iAvailableDrives public member)
+ * and be notified when drives change (through MIptvDriveMonitorObserver interface).
+ */
+class CVideoSettingsDriveMonitor : public CActive
+    {                
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CVideoSettingsDriveMonitor* NewL();
+
+        /**
+        * Two-phased constructor. Use this is owner object already has a file session open.
+        *
+        * @param aFileSession file session.
+        */
+        IMPORT_C static CVideoSettingsDriveMonitor* NewL( const RFs& aFileSession );
+        
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CVideoSettingsDriveMonitor();
+        
+    public:
+        
+        /**
+        * Registers observer for drive events.
+        * iAvailableDrives is updated automatically if there are any
+        * observers registered, ie there is no need to call RefreshAvailableDrivesL
+        * when observing.
+        * Don't keep observers around if they do not need events. Observing should be used
+        * when user needs to know immedetially about memory card insertion/removed events,
+        * or drive locked/unlocked events.
+        *
+        * @param aObserver observer, ownership does not move.
+        */
+        IMPORT_C void RegisterObserverL( MIptvDriveMonitorObserver* aObserver );
+        
+        /**
+        * Removes observer, ownership does not move.
+        * @param aObserver observer to be removed from observers list.
+        */ 
+        IMPORT_C void RemoveObserverL( MIptvDriveMonitorObserver* aObserver );
+
+        /**
+        * Updates iAvailableDrives member variable from File server.
+        * This is called in ConstructL() also.
+        */ 
+        IMPORT_C void RefreshAvailableDrivesL();
+
+        /**
+        * Returns the position index of aDrive in iAvailableDrives.
+        *
+        * @param aDrive drive to search.
+        * @return Position index of aDrive in iAvailableDrives. If not found,
+        *         KErrNotFound is returned.
+        */        
+        IMPORT_C TInt ArrayPos( TInt aDrive );
+
+        /**
+        * Returns the position index of aDrive in iAvailableDrives. If not
+        * found, leaves with KErrNotFound code.
+        *
+        * @param aDrive drive to search.
+        * @return Position index of aDrive in iAvailableDrives.
+        */        
+        IMPORT_C TInt ArrayPosL( TInt aDrive );
+
+        /**
+        * Returns the first removable drive (= memory card drive) from iAvailableDrives
+        * array. Leaves with KErrNotFound if not found.
+        */        
+        IMPORT_C TInt MemoryCardDriveL();
+
+        /**
+        * Returns the first removable drive (= memory card drive) from iAvailableDrives
+        * array. Returns KErrNotFound if not found.
+        *
+        * @return drive number, or KErrNotFound if not found.
+        */        
+        IMPORT_C TInt MemoryCardDrive();
+
+        /**
+        * Returns the first mass storage drive from iAvailableDrives array.
+        * Mass storege drive means the drive which is preferred for storing large
+        * files in the device, the drive itself can be anything, usually not c though.
+        * Leaves with KErrNotFound if not found.
+        *
+        * @return Drive number.
+        */
+        IMPORT_C TInt MassStorageDriveL();
+
+        /**
+        * Returns the first mass storage drive from iAvailableDrives array.
+        * Mass storege drive means the drive which is preferred for storing large
+        * files in the device, the drive itself can be anything except c-drive.
+        * Returns KErrNotFound if not found.
+        *
+        * @return Drive number, or KErrNotFound if not found.
+        */
+        IMPORT_C TInt MassStorageDrive();
+
+        /**
+        * Returns the phone memory drive from iAvailableDrives array.
+        * Leaves with KErrNotFound if not found.
+        *
+        * @return Drive number.
+        */
+        IMPORT_C TInt PhoneMemoryDriveL();
+
+        /**
+        * Returns the PhoneMemory drive from iAvailableDrives array.
+        * Returns KErrNotFound if not found.
+        *
+        * @return Drive number, or KErrNotFound if not found.
+        */
+        IMPORT_C TInt PhoneMemoryDrive();
+
+        /**
+        * Returns the first fixed (= non removable) drive from iAvailableDrives array.
+        * Leaves with KErrNotFound if not found.
+        *
+        * @param aExcludeCDrive If ETrue, then C-drive is excluded.
+        * @return Drive number.
+        */
+        IMPORT_C TInt FixedDriveL( TBool aExcludeCDrive );
+
+        /**
+        * Returns the first fixed (= non removable) drive from iAvailableDrives array.
+        * Returns KErrNotFound if not found.
+        *
+        * @param aExcludeCDrive If ETrue, then C-drive is excluded.
+        * @return Drive number, or KErrNotFound if not found.
+        */
+        IMPORT_C TInt FixedDrive( TBool aExcludeCDrive );
+
+        /**
+        * Finds out if memory card is inserted and not locked.
+        *
+        * @return Returns ETrue is memory card is inserted and usable (not locked), EFalse otherwise.
+        */
+        IMPORT_C TBool IsMmcInserted();
+        
+        /**
+        * Gets the used memory from cenrep. If cenrep contains invalid drive or value is not found,
+        * chooses the preferred drive in the following order: 1. mass storage 2. memory card
+        * 3. EDriveC. If cenrep value was not usable, the chosen drive is written to cenrep.
+        * Leaves with system-wide error code if wasn't able to get the used memory.
+        *
+        * @param aUsedMemory The used memory drive is written here.
+        */        
+        IMPORT_C void GetUsedMemoryL( TInt& aUsedMemory );
+
+
+    protected: // Functions from base classes
+
+        /**
+        * From CActive, RunL.
+        * Called when operation completes.
+        */
+        IMPORT_C void RunL();
+
+        /**
+        * From CActive, cancels request.
+        */
+        void DoCancel();
+
+        /**
+        * From CActive, handles leaves from RunL.
+        */
+        TInt RunError( TInt aError );
+         
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CVideoSettingsDriveMonitor();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        *
+        * @param aFileSession
+        */
+        void ConstructL( const RFs& aFileSession );
+
+        /**
+        * Sends event to observers.
+        *
+        * @param aEvent event to send.
+        * @param aDrive drive which caused the event.
+        */
+        void SendEvent( TIptvDriveMonitorEvent::TEvent aEvent, TInt aDrive );
+
+        /**
+        * Compares iPreviousAvailableDrives and iAvailableDrives arrays and
+        * sends appropriate events if they differ.
+        */
+        void CompareOldAndNewAvailableDrives();
+        
+        /**
+        * Returns drive type as a descriptor. For debugging only.
+        * @param aType Drive type, see valid values from e32const.h TMediaType enum.
+        */
+        const TDesC& DriveTypeDes( TInt aType );
+
+        /**
+        * Prints available drives. For debugging only.
+        */
+        void PrintAvailableDrives();
+
+    public:
+    
+        /**
+        * Array of currently available drives. These are updated
+        * with RefreshAvailableDrivesL -method or from file
+        * server event. RefreshAvailableDrivesL is also called upon creation
+        * of this object.
+        * iAvailableDrives array contains drives which are available for mass
+        * storaging videos. If there is hard disk and memory card
+        * available(both e and f-drives), then c-drive is excluded from the array.
+        */
+        RArray<TIptvDriveInfo> iAvailableDrives;
+
+        
+    private:
+
+        /**
+        * Used to detect if refresh had any effect.
+        */
+        RArray<TIptvDriveInfo> iPreviousAvailableDrives;
+
+        /**
+        * Array of observers. Pointers not owned.
+        */
+        RArray<MIptvDriveMonitorObserver*> iObservers;
+        
+        /**
+        * Session to file server.
+        */
+        RFs iFs;
+        
+        /**
+        * ETrue if iFs is provided by the user of this class.
+        */
+        TBool iIfsIsProvidedByUser;
+
+    };
+
+#endif      // CVIDEOSETTINGSDRIVEMONITOR_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videoplayersettingsengine/rom/videoplayersettingsengine.iby	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,25 @@
+/*
+* 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 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:   videoplayersettingsengine ROM*
+*/
+
+
+#ifndef __VIDEOPLAYERSETTINGSENGINE_IBY__
+#define __VIDEOPLAYERSETTINGSENGINE_IBY__
+
+#include <data_caging_paths_for_iby.hrh>
+
+file=ABI_DIR\BUILD_DIR\vcxnssettingsengine.dll		SHARED_LIB_DIR\vcxnssettingsengine.dll
+
+#endif //__VIDEOPLAYERSETTINGSENGINE_IBY__
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videoplayersettingsengine/src/videoplayersettingsengine.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,351 @@
+/*
+* Copyright (c) 2006-2009 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:   App settings handles storing and loading of application settings*
+*/
+
+
+
+// INCLUDE FILES
+#include <e32def.h>
+#include <bldvariant.hrh>
+#include <bautils.h>
+#include <centralrepository.h>
+#include <commdb.h>
+#include <sysutil.h>
+#include <mmtsy_names.h>
+#include <secui.h>
+#include <secuisecurityhandler.h>
+
+#include "videosettingsdrivemonitor.h"
+
+#include "videoplayersettingsengine.pan"
+#include "videoplayersettingsengine.h"
+#include "videoplayercenrepkeys.h"
+#include "mpxlog.h"
+
+// CONSTANTS
+const TInt KTimeBeforeRetryingServerConnection = 50000;
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsEngine::CVcxNsSettings()
+// -----------------------------------------------------------------------------
+//
+CVcxNsSettingsEngine::CVcxNsSettingsEngine( )
+ :  iPhoneConnected( EFalse )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsEngine::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CVcxNsSettingsEngine::ConstructL()
+    {
+    iCenRep = CRepository::NewL( KIptvCenRepUid );
+    iAlrCenRep = CRepository::NewL( KIptvAlrCenRepUid );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsEngine::NewL()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CVcxNsSettingsEngine* CVcxNsSettingsEngine::NewL( )
+    {
+    MPX_FUNC("IptvUiEngine ## CIptvAppSettings::NewL()");
+    
+    CVcxNsSettingsEngine* self = new (ELeave) CVcxNsSettingsEngine();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsEngine::~CIptvAppSettings()
+// -----------------------------------------------------------------------------
+//
+CVcxNsSettingsEngine::~CVcxNsSettingsEngine()
+    {
+    MPX_FUNC("IptvUiEngine ## CIptvAppSettings::~CIptvAppSettings()");
+
+    if ( iPhoneConnected )
+	    {
+	    // close phone
+	    if ( iPhone.SubSessionHandle() )
+	        {
+	        iPhone.Close();
+	        }
+
+	    //close ETel connection
+	    if ( iServer.Handle() )
+	        {
+	        iServer.UnloadPhoneModule( KMmTsyModuleName );
+	        iServer.Close();
+	        }
+    	}
+
+    delete iCenRep;
+    delete iAlrCenRep;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsEngine::GetUsedMemory()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVcxNsSettingsEngine::GetUsedMemoryL( TInt& aUsedMemory )
+    {
+    MPX_FUNC("CVcxNsSettingsEngine::GetUsedMemoryL() start");
+
+    CVideoSettingsDriveMonitor* driveMonitor = CVideoSettingsDriveMonitor::NewL();
+    CleanupStack::PushL( driveMonitor ); // 1->
+                
+    driveMonitor->GetUsedMemoryL( aUsedMemory );
+
+    CleanupStack::PopAndDestroy( driveMonitor ); // <-1    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsEngine::SetUsedMemory()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CVcxNsSettingsEngine::SetUsedMemory( TInt aUsedMemory )
+    {
+    return SetCenRepIntKey( KIptvCenRepUid, 
+                            KIptvCenRepPreferredMemoryKey, 
+                            aUsedMemory );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsEngine::GetParentControl()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CVcxNsSettingsEngine::GetParentControl( TInt& aParentControl )
+    {
+    return GetCenRepIntKey( KIptvCenRepUid, 
+                            KIptvCenRepParentControlKey,
+                            aParentControl );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsEngine::SetParentControl()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CVcxNsSettingsEngine::SetParentControl( TInt aParentControl )
+    {
+    return SetCenRepIntKey( KIptvCenRepUid, 
+                            KIptvCenRepParentControlKey, 
+                            aParentControl );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsEngine::GetVideoOnDemandThumbnails()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CVcxNsSettingsEngine::GetVideoOnDemandThumbnails( TInt& aVodThumbnails )
+    {
+    return GetCenRepIntKey( KIptvCenRepUid, 
+                            KIptvCenRepVoDThumbnailsKey, 
+                            aVodThumbnails ); 
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsEngine::SetVideoOnDemandThumbnails()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CVcxNsSettingsEngine::SetVideoOnDemandThumbnails( TInt aVodThumbnails )
+    {
+    return SetCenRepIntKey( KIptvCenRepUid, KIptvCenRepVoDThumbnailsKey, aVodThumbnails );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsEngine::GetUsedSnapId()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CVcxNsSettingsEngine::GetUsedSnapId( TInt& aUsedSnapId )
+    {
+    return GetCenRepIntKey( KIptvAlrCenRepUid, KIptvCenRepUsedSnapIdKey, aUsedSnapId );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsEngine::SetUsedSnapId()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CVcxNsSettingsEngine::SetUsedSnapId( TInt aUsedSnapId )
+    {
+    return SetCenRepIntKey( KIptvAlrCenRepUid, KIptvCenRepUsedSnapIdKey, aUsedSnapId );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsEngine::GetAllowUseGprs()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CVcxNsSettingsEngine::GetAllowUseGprs( TInt& aAllowUseGprs )
+    {
+    return GetCenRepIntKey( KIptvAlrCenRepUid, KIptvCenRepAllowUseGprsKey, aAllowUseGprs );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsEngine::SetAllowUseGprs()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CVcxNsSettingsEngine::SetAllowUseGprs( TInt aAllowUseGprs )
+    {
+    return SetCenRepIntKey( KIptvAlrCenRepUid, KIptvCenRepAllowUseGprsKey, aAllowUseGprs );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsEngine::GetAllowRoaming()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CVcxNsSettingsEngine::GetAllowRoaming( TInt& aAllowRoaming )
+    {
+    return GetCenRepIntKey( KIptvAlrCenRepUid, KIptvCenRepAllowRoamingKey, aAllowRoaming );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsEngine::SetAllowRoaming()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CVcxNsSettingsEngine::SetAllowRoaming( TInt aAllowRoaming )
+    {
+    return SetCenRepIntKey( KIptvAlrCenRepUid, KIptvCenRepAllowRoamingKey, aAllowRoaming );
+    }
+
+    
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsEngine::CheckLockCodeL()
+// -----------------------------------------------------------------------------
+//   
+EXPORT_C TBool CVcxNsSettingsEngine::CheckLockCodeL()
+    {
+    TBool lockCodeAccepted = EFalse ;
+    
+    if ( !iPhoneConnected )
+        {
+        // Connect to ETel server
+        // All server connections are retried because occasional
+        // fails on connections are possible, at least on some servers.
+        TInt err = iServer.Connect();
+        if ( err != KErrNone )
+            {
+            User::After( KTimeBeforeRetryingServerConnection );
+            TInt err = iServer.Connect();
+            }
+        User::LeaveIfError( err );
+        User::LeaveIfError( iServer.SetExtendedErrorGranularity(
+            RTelServer::EErrorExtended ) );
+
+        // Load TSY.
+        err = iServer.LoadPhoneModule( KMmTsyModuleName );
+        if ( KErrAlreadyExists != err )
+            {
+            // May also return KErrAlreadyExists if something else
+            // has already loaded the TSY module. And that is
+            // not an error.
+            User::LeaveIfError( err );
+            }
+
+        // Open phones
+        User::LeaveIfError( iPhone.Open( iServer, KMmTsyPhoneName ) );
+        iPhoneConnected = ETrue;
+        }
+
+#ifndef __WINS__
+    // Initialize sec ui.
+    CSecurityHandler* handler = new( ELeave ) CSecurityHandler( iPhone );
+    CleanupStack::PushL( handler );
+    TSecUi::InitializeLibL();
+
+    lockCodeAccepted = handler->AskSecCodeL();
+
+	// Uninitialize security ui.
+	CleanupStack::PopAndDestroy( handler );
+	TSecUi::UnInitializeLib();
+#else
+        lockCodeAccepted = ETrue;
+#endif
+
+    return lockCodeAccepted;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsEngine::GetCenRepIntKey()
+// -----------------------------------------------------------------------------
+//            
+TBool CVcxNsSettingsEngine::GetCenRepIntKey( TUid aCategory, TInt aKey, TInt& aValue )
+    {
+    TInt error = KErrNotFound;
+
+    if ( aCategory == KIptvCenRepUid && iCenRep )
+        {
+        error = iCenRep->Get( aKey, aValue );
+        }
+    else if ( aCategory == KIptvAlrCenRepUid && iAlrCenRep )
+        {
+        error = iAlrCenRep->Get( aKey, aValue );
+        }
+    
+    return (error == KErrNone) ? ETrue : EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsEngine::SetCenRepIntKey()
+// -----------------------------------------------------------------------------
+//
+TBool CVcxNsSettingsEngine::SetCenRepIntKey( TUid aCategory, TInt aKey, TInt aValue )
+    {
+    TInt error = KErrNotFound;
+
+    if ( aCategory == KIptvCenRepUid && iCenRep )
+        {
+        error = iCenRep->Set( aKey, aValue );
+        }
+
+    else if ( aCategory == KIptvAlrCenRepUid && iAlrCenRep )
+        {
+        error = iAlrCenRep->Set( aKey, aValue );
+        }
+
+    return (error == KErrNone) ? ETrue : EFalse;    
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsEngine::GetPlayerVolume()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CVcxNsSettingsEngine::GetPlayerVolume( TInt& aVolume )
+    {
+    return GetCenRepIntKey( KIptvCenRepUid, 
+                            KIptvCenRepVideoPlayerVolumeKey, 
+                            aVolume );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsEngine::SetPlayerVolume()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CVcxNsSettingsEngine::SetPlayerVolume( TInt aVolume )
+    {
+    return SetCenRepIntKey( KIptvCenRepUid, 
+                            KIptvCenRepVideoPlayerVolumeKey, 
+                            aVolume );
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videoplayersettingsengine/src/videosettingsdriveinfo.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,33 @@
+/*
+* 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: 
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "tvideosettingsdriveinfo.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+EXPORT_C TIptvDriveInfo::TIptvDriveInfo()
+    : iDrive( 0 )
+    , iFlags( 0 )
+    {
+    }
+    
+EXPORT_C TIptvDriveInfo::~TIptvDriveInfo()
+    {
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videoplayersettingsengine/src/videosettingsdrivemonitor.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,863 @@
+/*
+* 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: 
+*
+*/
+
+
+
+
+// INCLUDE FILES
+#include "videosettingsdrivemonitor.h"
+#include "mvideosettingsdrivemonitorobserver.h"
+#include "tvideosettingsdrivemonitorevent.h"
+#include "tvideosettingsdriveinfo.h"
+
+#include <bldvariant.hrh>
+#ifdef RD_MULTIPLE_DRIVE_ENABLERS
+#include <driveinfo.h>
+#endif
+
+#include <centralrepository.h>
+#include "videoplayercenrepkeys.h"
+
+#include "mpxlog.h"
+
+// EXTERNAL DATA STRUCTURES
+
+// EXTERNAL FUNCTION PROTOTYPES  
+
+// CONSTANTS
+#if IPTV_LOGGING_METHOD != 0
+_LIT( KIptvMediaNotPresentDes, "EMediaNotPresent");
+_LIT( KIptvMediaUnknownDes, "EMediaUnknown");
+_LIT( KIptvMediaFloppyDes, "EMediaFloppy");
+_LIT( KIptvMediaHardDiskDes, "EMediaHardDisk");
+_LIT( KIptvMediaCdRomDes, "EMediaCdRom");
+_LIT( KIptvMediaRamDes, "EMediaRam");
+_LIT( KIptvMediaFlashDes, "EMediaFlash");
+_LIT( KIptvMediaRomDes, "EMediaRom");
+_LIT( KIptvMediaRemoteDes, "EMediaRemote");
+_LIT( KIptvMediaNANDFlashDes, "EMediaNANDFlash");
+#endif
+
+_LIT( KIptvEmptyDes, "" );
+
+// MACROS
+
+// LOCAL CONSTANTS AND MACROS
+
+// MODULE DATA STRUCTURES
+
+// LOCAL FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CVideoSettingsDriveMonitor::CVideoSettingsDriveMonitor
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CVideoSettingsDriveMonitor::CVideoSettingsDriveMonitor()
+: CActive( EPriorityStandard )
+    {
+    MPX_FUNC("CIptvDriveMonitor::CIptvDriveMonitor()");
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvEvents::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CVideoSettingsDriveMonitor::ConstructL( const RFs& aFileSession )
+    {
+    iFs                  = aFileSession;
+    iIfsIsProvidedByUser = ETrue;
+   
+    ConstructL();    
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvEvents::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CVideoSettingsDriveMonitor::ConstructL()
+    {
+    iObservers.Reset();
+    iAvailableDrives.Reset();
+    iPreviousAvailableDrives.Reset();
+    
+    if ( !iIfsIsProvidedByUser )
+        {
+        User::LeaveIfError( iFs.Connect() );
+        }
+        
+    CActiveScheduler::Add( this );
+    RefreshAvailableDrivesL();
+
+    MPX_DEBUG2("CIptvDriveMonitor:: PhoneMemoryDrive() returns %d",
+        PhoneMemoryDrive());
+    MPX_DEBUG2("CIptvDriveMonitor:: MemoryCardDrive() returns %d",
+        MemoryCardDrive());
+    MPX_DEBUG2("CIptvDriveMonitor:: MassStorageDrive() returns %d",
+        MassStorageDrive());
+    MPX_DEBUG2("CIptvDriveMonitor:: FixedDrive(c-drive excluded) returns %d",
+        FixedDrive( ETrue ));
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoSettingsDriveMonitor::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CVideoSettingsDriveMonitor* CVideoSettingsDriveMonitor::NewL()
+    {
+    MPX_FUNC("CIptvDriveMonitor::NewL() start");
+
+    CVideoSettingsDriveMonitor* self = new( ELeave ) CVideoSettingsDriveMonitor();
+        
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop(self);
+
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoSettingsDriveMonitor::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CVideoSettingsDriveMonitor* CVideoSettingsDriveMonitor::NewL( const RFs& aFileSession )
+    {
+    MPX_FUNC("CIptvDriveMonitor::NewL(RFs&) start");
+
+    CVideoSettingsDriveMonitor* self = new( ELeave ) CVideoSettingsDriveMonitor();
+        
+    CleanupStack::PushL( self );
+    self->ConstructL( aFileSession );
+    CleanupStack::Pop(self);
+
+    return self;
+    }
+    
+// Destructor
+EXPORT_C CVideoSettingsDriveMonitor::~CVideoSettingsDriveMonitor()
+    {
+    iObservers.Close();
+    iAvailableDrives.Close();
+    iPreviousAvailableDrives.Close();
+    Cancel();
+    
+    if ( !iIfsIsProvidedByUser )
+        {
+        iFs.Close();
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CVideoSettingsDriveMonitor::RegisterObserverL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVideoSettingsDriveMonitor::RegisterObserverL( MIptvDriveMonitorObserver* aObserver )
+    {
+    iObservers.AppendL( aObserver );
+
+    if ( !IsActive() )
+        {
+        iFs.NotifyChange( ENotifyDisk, iStatus );
+        SetActive();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoSettingsDriveMonitor::RemoveObserverL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVideoSettingsDriveMonitor::RemoveObserverL( MIptvDriveMonitorObserver* aObserver )
+    {
+    TInt i;
+    for ( i = 0; i < iObservers.Count(); i++ )
+        {
+        if ( aObserver == iObservers[i] )
+            {
+            iObservers.Remove( i );
+            iObservers.Compress();
+            break;
+            }
+        }
+        
+    if ( iObservers.Count() == 0 )
+        {
+        iFs.NotifyChangeCancel();
+        }    
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoSettingsDriveMonitor::RefreshAvailableDrivesL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVideoSettingsDriveMonitor::RefreshAvailableDrivesL()
+    {
+    MPX_FUNC("CIptvDriveMonitor::RefreshAvailableDrivesL() start");
+    
+    TDriveList driveList;
+    User::LeaveIfError( iFs.DriveList( driveList ) );
+
+    iPreviousAvailableDrives.Reset();
+    TInt i;
+    for ( i = 0; i < iAvailableDrives.Count(); i++ )
+        {
+        iPreviousAvailableDrives.Append( iAvailableDrives[i] );
+        }
+            
+    iAvailableDrives.Reset();
+    
+    for ( i = 0; i < driveList.Length(); i++ )
+        {
+        if ( driveList[i] != 0 && i != EDriveY ) // Some phones have a 1MB small flash drive at y-drive, rule it out
+            {
+            TDriveInfo driveInfo;
+            User::LeaveIfError( iFs.Drive( driveInfo, i ) );
+            
+            /*
+            From e32cost.h:
+            const TUint KMediaAttVariableSize   = 0x01;
+            const TUint KMediaAttDualDensity    = 0x02;
+            const TUint KMediaAttFormattable    = 0x04;
+            const TUint KMediaAttWriteProtected = 0x08;
+            const TUint KMediaAttLockable       = 0x10;
+            const TUint KMediaAttLocked         = 0x20;
+            const TUint KMediaAttHasPassword    = 0x40;
+            const TUint KMediaAttReadWhileWrite = 0x80;
+            const TUint KMediaAttDeleteNotify   = 0x100;
+            
+            The drive attributes.    
+            
+            const TUint KDriveAttLocal          = 0x01;
+            const TUint KDriveAttRom            = 0x02;
+            const TUint KDriveAttRedirected     = 0x04;
+            const TUint KDriveAttSubsted        = 0x08;
+            const TUint KDriveAttInternal       = 0x10;
+            const TUint KDriveAttRemovable      = 0x20;
+            const TUint KDriveAttRemote         = 0x40;
+            const TUint KDriveAttTransaction    = 0x80;
+            */
+
+            MPX_DEBUG3("CIptvDriveMonitor:: drive[%d]: type = %S",
+                                     i,
+                                     &DriveTypeDes( driveInfo.iType ));
+
+            MPX_DEBUG3(
+                "CIptvDriveMonitor::           MediaAtt flags = %x DriveAtt flags = %x",
+                    driveInfo.iMediaAtt,
+                    driveInfo.iDriveAtt );
+
+#ifdef __WINSCW__
+            // (2) c-drive is EMediaRam
+            // (3) d-drive is EMediaHardDisk
+            // (4) e-drive is EMediaHardDisk or EMediaNotPresent
+            // (25) z-drive is EMediaRom
+            if ( (driveInfo.iType == EMediaRam) ||                                     // c
+                 ((driveInfo.iType == EMediaHardDisk) && i != EDriveD /* skip d */) || // e
+                 (driveInfo.iType == EMediaNANDFlash) ||                               // nothing
+                 (driveInfo.iType == EMediaNotPresent) )                               // e
+#else
+            // (2) c-drive is EMediaNANDFlash
+            // (3) d-drive is EMediaRam
+            // (4) e-drive is EMediaHardDisk or EMediaNotPresent
+            // (5) f-drive is EMediaHardDisk or EMediaNotPresent
+            // (25) z-drive is EMediaRom
+            if ( (driveInfo.iType == EMediaHardDisk) ||  // e,f
+                 (driveInfo.iType == EMediaNANDFlash) || // c
+                 (driveInfo.iType == EMediaNotPresent) ) // e,f
+#endif // __WINSCW__
+                {                
+                if ( !(driveInfo.iMediaAtt & KMediaAttWriteProtected) &&
+                     !(driveInfo.iDriveAtt & KDriveAttExternal) &&   
+                      (driveInfo.iDriveAtt & KDriveAttLocal) )
+                    {
+                    TIptvDriveInfo iptvDriveInfo;
+                    TVolumeInfo volumeInfo;
+                    TChar ch;
+
+                    iFs.DriveToChar( i, ch );
+
+                    iptvDriveInfo.iDrive     = i;
+                    iptvDriveInfo.iDriveChar = ch;
+                    iptvDriveInfo.iType      = driveInfo.iType;
+
+
+#ifdef RD_MULTIPLE_DRIVE_ENABLERS
+
+                    TUint driveStatus;
+                    TInt err = DriveInfo::GetDriveStatus( iFs, i, driveStatus );
+                    if ( err == KErrNone )
+                        {
+                        if ( driveStatus & DriveInfo::EDriveRemovable )
+                            {
+                            iptvDriveInfo.iFlags |= TIptvDriveInfo::ERemovable;
+                            }
+                        }
+
+                    TInt massStorageDrive;
+                    err = DriveInfo::GetDefaultDrive( DriveInfo::EDefaultMassStorage,
+                                                      massStorageDrive );
+                    if ( err == KErrNone )
+                        {
+                        if ( i == massStorageDrive )
+                            {
+                            iptvDriveInfo.iFlags |= TIptvDriveInfo::EMassStorage;
+                            }                        
+                        }
+
+#else
+
+                    if ( driveInfo.iDriveAtt & KDriveAttRemovable )
+                        {
+                        if ( driveInfo.iMediaAtt & KMediaAttLockable )
+                            {
+                            //memory card has KDriveAttRemovable and KMediaAttLockable flags set
+                            iptvDriveInfo.iFlags |= TIptvDriveInfo::ERemovable;
+                            }
+                        else
+                            {
+                            //mass storage has KDriveAttRemovable set and KMediaAttLockable not set
+                            iptvDriveInfo.iFlags |= TIptvDriveInfo::EMassStorage;
+                            }
+                        }
+
+#endif // RD_MULTIPLE_DRIVE_ENABLERS
+
+                    if ( driveInfo.iMediaAtt & KMediaAttLocked )
+                        {
+                        iptvDriveInfo.iFlags |= TIptvDriveInfo::ELocked;
+                        }
+                    if ( driveInfo.iType == EMediaNotPresent )
+                        {
+                        iptvDriveInfo.iFlags |= TIptvDriveInfo::EMediaNotPresent;
+                        }
+
+                    // When mass storage mode is activated while application is running,
+                    // the only hint about that is the TVolumeInfo not being available. 
+                    // Therefore we mark drive as EMediaNotPresent if that structure
+                    // is not available.
+                    if ( iFs.Volume( volumeInfo, i ) != KErrNone )
+                        {
+                        iptvDriveInfo.iFlags |= TIptvDriveInfo::EMediaNotPresent;
+                        iptvDriveInfo.iVolumeName.Zero();
+                        }
+                    else
+                        {
+                        iptvDriveInfo.iVolumeName = volumeInfo.iName;
+                        }
+
+                    if ( iptvDriveInfo.iFlags & TIptvDriveInfo::EMediaNotPresent )
+                        {
+                        iptvDriveInfo.iFlags |= TIptvDriveInfo::ERemovable;
+                        }
+
+                    iAvailableDrives.AppendL( iptvDriveInfo );
+                    }
+                }
+            }
+        } // for
+
+    // if e and f-drives are available, then c-drive is removed from the available drives list
+    if ( ArrayPos( EDriveE ) != KErrNotFound &&
+         ArrayPos( EDriveF ) != KErrNotFound )
+        {
+        TInt cDrivePos = ArrayPos( EDriveC );
+        if ( cDrivePos != KErrNotFound )
+            {
+            MPX_DEBUG1(
+                "CIptvDriveMonitor:: e & f-drives available -> removing c from available drives");
+            iAvailableDrives.Remove( cDrivePos );
+            iAvailableDrives.Compress();
+            }
+        }
+    
+    }
+    
+// -----------------------------------------------------------------------------
+// CVideoSettingsDriveMonitor::ArrayPos
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CVideoSettingsDriveMonitor::ArrayPos( TInt aDrive )
+    {
+    TInt i;
+    for (i = 0; i < iAvailableDrives.Count(); i++ )
+        {
+        if ( iAvailableDrives[i].iDrive == aDrive )
+            {
+            return i;
+            }
+        }
+    return KErrNotFound;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoSettingsDriveMonitor::ArrayPosL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CVideoSettingsDriveMonitor::ArrayPosL( TInt aDrive )
+    {
+    TInt pos;
+    User::LeaveIfError( pos = ArrayPos( aDrive ) );
+    return pos;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoSettingsDriveMonitor::FindMemoryCardDriveL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CVideoSettingsDriveMonitor::MemoryCardDriveL()
+    {
+    TInt drive;
+    User::LeaveIfError( drive = MemoryCardDrive() );
+    return drive;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoSettingsDriveMonitor::MemoryCardDrive
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CVideoSettingsDriveMonitor::MemoryCardDrive()
+    {
+    TInt i;
+    for ( i = 0; i < iAvailableDrives.Count(); i++ )
+        {
+        if ( iAvailableDrives[i].iFlags & TIptvDriveInfo::ERemovable )
+            {
+            return iAvailableDrives[i].iDrive;
+            }
+        }
+    return KErrNotFound;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoSettingsDriveMonitor::MassStorageDriveL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CVideoSettingsDriveMonitor::MassStorageDriveL()
+    {
+    TInt drive;
+    User::LeaveIfError( drive = MassStorageDrive() );
+    return drive;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoSettingsDriveMonitor::MassStorageDrive
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CVideoSettingsDriveMonitor::MassStorageDrive()
+    {
+    TInt i;
+    for ( i = 0; i < iAvailableDrives.Count(); i++ )
+        {
+        if ( iAvailableDrives[i].iFlags & TIptvDriveInfo::EMassStorage )
+            {
+            return iAvailableDrives[i].iDrive;
+            }
+        }
+    return KErrNotFound;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoSettingsDriveMonitor::PhoneMemoryDriveL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CVideoSettingsDriveMonitor::PhoneMemoryDriveL()
+    {
+    TInt drive;
+    User::LeaveIfError( drive = PhoneMemoryDrive() );
+    return drive;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoSettingsDriveMonitor::PhoneMemoryDrive
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CVideoSettingsDriveMonitor::PhoneMemoryDrive()
+    {
+    TInt i;
+    for ( i = 0; i < iAvailableDrives.Count(); i++ )
+        {
+        if ( iAvailableDrives[i].iDrive == EDriveC )
+            {
+            return iAvailableDrives[i].iDrive;
+            }
+        }
+    return KErrNotFound;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoSettingsDriveMonitor::FixedDriveL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CVideoSettingsDriveMonitor::FixedDriveL( TBool aExcludeCDrive )
+    {
+    TInt drive;
+    User::LeaveIfError( drive = FixedDrive( aExcludeCDrive ) );
+    return drive;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoSettingsDriveMonitor::FixedDrive
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CVideoSettingsDriveMonitor::FixedDrive( TBool aExcludeCDrive )
+    {
+    TInt i;
+    for ( i = 0; i < iAvailableDrives.Count(); i++ )
+        {
+        MPX_DEBUG2("CIptvDriveMonitor:: iAvailableDrives[%d]", i);
+
+        if ( !(iAvailableDrives[i].iFlags & TIptvDriveInfo::ERemovable) )
+            {
+            if ( iAvailableDrives[i].iDrive != EDriveC )
+                {
+                MPX_DEBUG2("CIptvDriveMonitor:: FixedDrive() returning drive %d", iAvailableDrives[i].iDrive);
+                return iAvailableDrives[i].iDrive;
+                }
+            else
+                {
+                if ( !aExcludeCDrive )
+                    {
+                    MPX_DEBUG2("CIptvDriveMonitor:: FixedDrive() returning drive %d", iAvailableDrives[i].iDrive);
+                    return iAvailableDrives[i].iDrive;
+                    }   
+                }
+            }
+        }
+    return KErrNotFound;
+    }
+    
+// -----------------------------------------------------------------------------
+// CVideoSettingsDriveMonitor::IsMmcInserted()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CVideoSettingsDriveMonitor::IsMmcInserted()
+    {   
+    TInt drive = MemoryCardDrive();
+    
+    if ( drive == KErrNotFound )
+        {
+        return EFalse;
+        }
+        
+    TInt arrayPos = ArrayPos( drive );
+    
+    if ( arrayPos == KErrNotFound )
+        {
+        return EFalse;
+        }
+    
+    TUint32 flags = iAvailableDrives[arrayPos].iFlags;
+    
+    if ( (flags & TIptvDriveInfo::ELocked) || (flags & TIptvDriveInfo::EMediaNotPresent) )
+        {
+        return EFalse;
+        } 
+    
+    return ETrue;
+    }
+    
+// -----------------------------------------------------------------------------
+// CVideoSettingsDriveMonitor::RunL()
+// -----------------------------------------------------------------------------
+//
+void CVideoSettingsDriveMonitor::RunL()
+    {
+    MPX_FUNC("CIptvDriveMonitor::RunL() start");
+    
+    if ( iStatus == KErrNone )
+        {        
+        iFs.NotifyChange( ENotifyDisk, iStatus );
+        
+        TRAPD( err, RefreshAvailableDrivesL() );
+        if ( err != KErrNone )
+            {
+            MPX_DEBUG2("CIptvDriveMonitor:: RefreshAvailableDrivesL leaved with error code %d, ignoring", err);
+            } 
+        CompareOldAndNewAvailableDrives();
+        SetActive();
+        }
+    else
+        {
+        iFs.NotifyChange( ENotifyDisk, iStatus );
+        SetActive();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoSettingsDriveMonitor::DoCancel()
+// -----------------------------------------------------------------------------
+//
+void CVideoSettingsDriveMonitor::DoCancel()
+    {
+    iFs.NotifyChangeCancel( iStatus );
+    }       
+
+// -----------------------------------------------------------------------------
+// CVideoSettingsDriveMonitor::RunError()
+// -----------------------------------------------------------------------------
+//
+TInt CVideoSettingsDriveMonitor::RunError( TInt /* aError */ )
+    {
+    MPX_FUNC("CIptvDriveMonitor::RunL() leaved (should never happen).");
+    return KErrNone;
+    }       
+
+// -----------------------------------------------------------------------------
+// CVideoSettingsDriveMonitor::SendEvent()
+// -----------------------------------------------------------------------------
+//
+void CVideoSettingsDriveMonitor::SendEvent( TIptvDriveMonitorEvent::TEvent aEvent,
+    TInt aDrive )
+    {
+    MPX_DEBUG4("CIptvDriveMonitor:: Sending event: %S(%d), drive: %d",
+        &TIptvDriveMonitorEvent::EventDes( aEvent ),
+        aEvent,
+        aDrive );
+
+    TIptvDriveMonitorEvent event;
+        
+    for ( TInt i = 0; i < iObservers.Count(); i++ )
+        {
+        event.iEvent = static_cast<TInt>(aEvent);
+        event.iDrive = aDrive;
+        iObservers[i]->HandleDriveMonitorEvent( event );
+        }
+
+#if IPTV_LOGGING_METHOD != 0
+    PrintAvailableDrives();
+#endif
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoSettingsDriveMonitor::CompareOldAndNewAvailableDrives
+// -----------------------------------------------------------------------------
+//
+void CVideoSettingsDriveMonitor::CompareOldAndNewAvailableDrives()
+    {
+    // Run through old drives list to detect changes
+    TInt i;
+    for ( i = 0; i < iPreviousAvailableDrives.Count(); i++ )
+        {
+        TInt pos = ArrayPos( iPreviousAvailableDrives[i].iDrive );
+        if ( pos == KErrNotFound )
+            {
+            // drive was dismounted
+            SendEvent( TIptvDriveMonitorEvent::EDriveDismounted,
+                iPreviousAvailableDrives[i].iDrive );
+            }
+        else 
+            {
+            // drive still present
+            if ( iPreviousAvailableDrives[i].iFlags != iAvailableDrives[pos].iFlags )
+                {
+                // drive was changed
+                if ( (iPreviousAvailableDrives[i].iFlags & TIptvDriveInfo::EMediaNotPresent) && 
+                     !(iAvailableDrives[pos].iFlags & EMediaNotPresent) )
+                    {
+                    SendEvent( TIptvDriveMonitorEvent::EMediaInserted,
+                        iAvailableDrives[pos].iDrive );
+                    }
+                    
+                if ( !(iPreviousAvailableDrives[i].iFlags & TIptvDriveInfo::EMediaNotPresent) && 
+                     (iAvailableDrives[pos].iFlags & TIptvDriveInfo::EMediaNotPresent) )
+                    {
+                    SendEvent( TIptvDriveMonitorEvent::EMediaRemoved,
+                        iAvailableDrives[pos].iDrive );
+                    }
+
+                if ( !(iPreviousAvailableDrives[i].iFlags & TIptvDriveInfo::ELocked) && 
+                     (iAvailableDrives[pos].iFlags & TIptvDriveInfo::ELocked) )
+                    {
+                    SendEvent( TIptvDriveMonitorEvent::EDriveLocked,
+                        iAvailableDrives[pos].iDrive );
+                    }
+
+                if ( (iPreviousAvailableDrives[i].iFlags & TIptvDriveInfo::ELocked) && 
+                     !(iAvailableDrives[pos].iFlags & TIptvDriveInfo::ELocked) )
+                    {
+                    SendEvent( TIptvDriveMonitorEvent::EDriveUnlocked,
+                        iAvailableDrives[pos].iDrive );
+                    }               
+                }
+            
+            // drive volume name was changed
+            if ( iPreviousAvailableDrives[i].iVolumeName.Compare( 
+                 iAvailableDrives[pos].iVolumeName ) != 0 )
+                {
+                SendEvent( TIptvDriveMonitorEvent::EDriveVolumeNameChanged, 
+                    iAvailableDrives[pos].iDrive ); 
+                }
+            }
+        }
+
+    // Run through new drives list to detect mounted drives
+    for ( i = 0; i < iAvailableDrives.Count(); i++ )
+        {
+        TBool found = EFalse;
+        for ( TInt j = 0; j < iPreviousAvailableDrives.Count(); j++ )
+            {
+            if ( iPreviousAvailableDrives[j].iDrive == iAvailableDrives[i].iDrive )
+                {
+                found = ETrue;
+                break;
+                }
+            }
+        if ( !found )
+            {
+            SendEvent( TIptvDriveMonitorEvent::EDriveMounted,
+                iAvailableDrives[i].iDrive );
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoSettingsDriveMonitor::DriveType()
+// -----------------------------------------------------------------------------
+//
+#if IPTV_LOGGING_METHOD != 0 
+const TDesC& CVideoSettingsDriveMonitor::DriveTypeDes( TInt aType )
+    {
+    switch (aType)
+        {     
+        case EMediaNotPresent:
+            return KIptvMediaNotPresentDes;
+	      case EMediaUnknown:
+            return KIptvMediaUnknownDes;
+        case EMediaFloppy:
+            return KIptvMediaFloppyDes;
+        case EMediaHardDisk:
+            return KIptvMediaHardDiskDes;
+        case EMediaCdRom:
+            return KIptvMediaCdRomDes;
+        case EMediaRam:
+            return KIptvMediaRamDes;
+        case EMediaFlash:
+            return KIptvMediaFlashDes;
+        case EMediaRom:
+            return KIptvMediaRomDes;
+        case EMediaRemote:
+            return KIptvMediaRemoteDes;
+        case EMediaNANDFlash:
+            return KIptvMediaNANDFlashDes;
+        default:
+            return KIptvMediaUnknownDes;
+        }
+    }
+#else
+const TDesC& CVideoSettingsDriveMonitor::DriveTypeDes( TInt /*aType*/ )
+    {
+    return KIptvEmptyDes;
+    }
+#endif
+    
+// -----------------------------------------------------------------------------
+// CVideoSettingsDriveMonitor::PrintAvailableDrives()
+// -----------------------------------------------------------------------------
+//
+void CVideoSettingsDriveMonitor::PrintAvailableDrives()
+    {
+#if IPTV_LOGGING_METHOD != 0 
+    for ( TInt i = 0; i < iAvailableDrives.Count(); i++ )
+        {
+        IPTVLOGSTRING3_HIGH_LEVEL("CIptvDriveMonitor:: iAvailableDrives[%d].iDrive = %d",
+            i, iAvailableDrives[i].iDrive);
+        IPTVLOGSTRING2_HIGH_LEVEL("    ERemovableDrive  = %d",
+            !!(iAvailableDrives[i].iFlags & TIptvDriveInfo::ERemovable));
+        IPTVLOGSTRING2_HIGH_LEVEL("    EMassStorage     = %d",
+            !!(iAvailableDrives[i].iFlags & TIptvDriveInfo::EMassStorage));
+        IPTVLOGSTRING2_HIGH_LEVEL("    ELockedDrive     = %d",
+            !!(iAvailableDrives[i].iFlags & TIptvDriveInfo::ELocked));
+        IPTVLOGSTRING2_HIGH_LEVEL("    EMediaNotPresent = %d",
+            !!(iAvailableDrives[i].iFlags & TIptvDriveInfo::EMediaNotPresent));
+        }
+#endif
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoSettingsDriveMonitor::GetUsedMemoryL()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVideoSettingsDriveMonitor::GetUsedMemoryL( TInt& aUsedMemory )
+    {
+    MPX_FUNC("CIptvDriveMonitor::GetUsedMemoryL() start");
+    
+    TInt cenRepMemory = KErrNotFound; //init to some non valid drive value, in case that cenrep wont change it at all
+    
+    CRepository* cenRep = CRepository::NewL( KIptvCenRepUid );
+    CleanupStack::PushL( cenRep ); // 1->
+
+    TInt cenRepError = cenRep->Get( KIptvCenRepPreferredMemoryKey, cenRepMemory );
+                
+    aUsedMemory = EDriveC;
+        
+    if ( ArrayPos( cenRepMemory ) == KErrNotFound
+        || cenRepError != KErrNone )
+        {
+        MPX_DEBUG1(
+            "CIptvDriveMonitor:: cenrep value for used memory was not valid or not found.");
+
+        // Non existing drive or no cen rep value -> figure out the default drive
+        TInt massStorageDrive = MassStorageDrive();
+        if ( massStorageDrive != KErrNotFound )
+            {
+            MPX_DEBUG1("CIptvDriveMonitor:: using mass storage");
+            aUsedMemory = massStorageDrive;
+            }
+        else
+            {    
+            TInt memoryCardDrive  = MemoryCardDrive();
+            if ( memoryCardDrive != KErrNotFound )
+                {
+                MPX_DEBUG1("CIptvDriveMonitor:: using memory card");
+                aUsedMemory = memoryCardDrive;
+                }
+            }
+
+        MPX_DEBUG2(
+            "CIptvDriveMonitor:: writing new value to cenrep (%d)", aUsedMemory);
+
+        cenRep->Set( KIptvCenRepPreferredMemoryKey, aUsedMemory );
+        }
+    else
+        {
+        //Cenrep value was valid, use it
+        MPX_DEBUG1(
+            "CIptvDriveMonitor:: cenrep value for used memory was valid, using it.");
+        aUsedMemory = cenRepMemory;
+        }
+
+    CleanupStack::PopAndDestroy( cenRep ); // <-1
+            
+    MPX_DEBUG2("CIptvDriveMonitor:: using drive %d", aUsedMemory);
+    }
+    
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videoplayersettingsengine/src/videosettingsdrivemonitorevent.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,88 @@
+/*
+* 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: 
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "tvideosettingsdrivemonitorevent.h"
+
+_LIT( KIptvEmptyDes, "" );
+
+#if IPTV_LOGGING_METHOD != 0 
+_LIT(KIptvDmeMediaRemovedDes, "EMediaRemoved");
+_LIT(KIptvDmeMediaInsertedDes, "EMediaInserted");
+_LIT(KIptvDmeDriveLockedDes, "EDriveLocked");
+_LIT(KIptvDmeDriveUnlockedDes, "EDriveUnlocked");
+_LIT(KIptvDmeDriveMountedDes, "EDriveMounted");
+_LIT(KIptvDmeDriveDismountedDes, "EDriveDismounted");
+_LIT(KIptvDmeDriveVolumeNameChangedDes, "EDriveVolumeNameChanged");
+_LIT(KIptvDmeUnknownDes, "Unknown");
+#endif
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+EXPORT_C TIptvDriveMonitorEvent::TIptvDriveMonitorEvent()
+    : iEvent( ENone )
+    , iDrive( -1 )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// TIptvDriveMonitorEvent::EventDes()
+// -----------------------------------------------------------------------------
+//
+#if IPTV_LOGGING_METHOD != 0
+
+const TDesC& TIptvDriveMonitorEvent::EventDes( TIptvDriveMonitorEvent::TEvent aEvent )
+    {
+    switch ( aEvent )
+        {
+        case EMediaRemoved:
+            return KIptvDmeMediaRemovedDes;
+            
+        case EMediaInserted:
+            return KIptvDmeMediaInsertedDes;
+
+        case EDriveLocked:
+            return KIptvDmeDriveLockedDes;
+
+        case EDriveUnlocked:
+            return KIptvDmeDriveUnlockedDes;
+
+        case EDriveMounted:
+            return KIptvDmeDriveMountedDes;
+
+        case EDriveDismounted:
+            return KIptvDmeDriveDismountedDes;
+        
+        case EDriveVolumeNameChanged:
+            return KIptvDmeDriveVolumeNameChangedDes;
+
+        default:
+            return KIptvDmeUnknownDes;
+        }
+    }
+    
+#else
+
+const TDesC& TIptvDriveMonitorEvent::EventDes( TIptvDriveMonitorEvent::TEvent /*aEvent*/ )
+    {
+    return KIptvEmptyDes;
+    }
+
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videoplayersettingsengine/tsrc/vpsettingsenginetest/Bwins/vcxnssettingsenginetestu.def	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * LibEntryL(class CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videoplayersettingsengine/tsrc/vpsettingsenginetest/EABI/vcxnssettingsenginetestu.def	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videoplayersettingsengine/tsrc/vpsettingsenginetest/conf/atsconf.txt	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,14 @@
+;Run \vado\videoplayer\tsrc\testing\tools\genATSdrop.pl from 
+;the tsrc folder to create ATS3 drop.
+[DROP]
+NAME VaDo - videoplayer - videoplayersettingsengine
+DEVICE INSERT_DEVICE
+FLASH INSERT_FLASH_IMAGE
+FLASH INSERT_FLASH_IMAGE
+FLASH INSERT_FLASH_IMAGE
+SIS \VideoApp_Domain\videoplayer\videoplayerapp\mpxvideoplayer\sis\VideoPlayer.sisx
+PKG group\vcxnssettingsenginetest.pkg
+INI init\TestFramework.ini 200
+EMAIL INSERT_EMAIL
+RUN
+[ENDDROP]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videoplayersettingsengine/tsrc/vpsettingsenginetest/conf/vcxnssettingsenginetest.cfg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,248 @@
+#***********************************************************************************
+#
+# STIF test script file for testing vcxnssettingsengine.dll.
+#
+#***********************************************************************************
+
+[Define]
+EFixedDrive			1
+EMassStorageDrive	2
+EPhoneMemoryDrive	3
+EMemoryCardDrive	4
+[Enddefine]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title VPSE01 <not a test> Setup
+create VCXTestUtilModule Util
+allowerrorcodes -1
+Util DeleteDestination "testdest1"
+allowerrorcodes -1
+Util DeleteDestination "testdest2"
+pause 1000
+Util CreateDestination "testdest1"
+Util CreateDestination "testdest2"
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title VPSE02 UsedMemory EFixedDrive
+create vcxnssettingsenginetest test
+test Create
+test SetUsedMemory EFixedDrive
+test GetUsedMemory
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title VPSE03 UsedMemory EMassStorageDrive
+create vcxnssettingsenginetest test
+test Create
+test SetUsedMemory EMassStorageDrive
+test GetUsedMemory
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title VPSE17 UsedMemory EPhoneMemoryDrive 
+create vcxnssettingsenginetest test
+test Create
+test SetUsedMemory EMassStorageDrive
+test SetUsedMemory EPhoneMemoryDrive
+allowerrorcodes -20
+test GetUsedMemory
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title VPSE18 UsedMemory EMemoryCardDrive 
+create vcxnssettingsenginetest test
+test Create
+test SetUsedMemory EMemoryCardDrive
+test GetUsedMemory
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title VPSE04 UsedMemory id -1
+create vcxnssettingsenginetest test
+test Create
+test SetUsedMemory -1
+allownextresult -20
+test GetUsedMemory
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title VPSE16 UsedMemory id 616
+create vcxnssettingsenginetest test
+test Create
+test SetUsedMemory 616
+allownextresult -20
+test GetUsedMemory
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title VPSE05 ParentControl
+create vcxnssettingsenginetest test
+test Create
+test SetParentControl -1
+test GetParentControl -1
+test SetParentControl 0
+test GetParentControl 0
+test SetParentControl 1
+test GetParentControl 1
+test SetParentControl 99
+test GetParentControl 99
+test SetParentControl 100
+test GetParentControl 100
+test SetParentControl 101
+test GetParentControl 101
+test SetParentControl 1000
+test GetParentControl 1000
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title VPSE06 Thumbnails on & off
+create vcxnssettingsenginetest test
+test Create
+test SetVideoOnDemandThumbnails 1
+test GetVideoOnDemandThumbnails 1
+test SetVideoOnDemandThumbnails 0
+test GetVideoOnDemandThumbnails 0
+delete test
+[Endtest] 
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title VPSE07 Thumbnails invalid value
+create vcxnssettingsenginetest test
+test Create
+test SetVideoOnDemandThumbnails 0
+test SetVideoOnDemandThumbnails -1
+test GetVideoOnDemandThumbnails -1
+delete test
+[Endtest] 
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title VPSE08 UsedSnap
+create vcxnssettingsenginetest test
+test Create
+test SetUsedSnapId "testdest1"
+test GetUsedSnapId "testdest1"
+test SetUsedSnapId "testdest2"
+test GetUsedSnapId "testdest2"
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title VPSE09 UsedSnap invalid id
+create vcxnssettingsenginetest test
+test Create
+test SetUsedSnapId "INVALID"
+test GetUsedSnapId
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title VPSE10 AllowUseGprs on & off
+create vcxnssettingsenginetest test
+test Create
+test SetAllowUseGprs 1
+test GetAllowUseGprs 1
+test SetAllowUseGprs 0
+test GetAllowUseGprs 0
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title VPSE11 AllowRoaming on & off
+create vcxnssettingsenginetest test
+test Create
+test SetAllowRoaming 1
+test GetAllowRoaming 1
+test SetAllowRoaming 0
+test GetAllowRoaming 0
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title VPSE15 PlayerVolume
+create vcxnssettingsenginetest test
+test Create
+test SetPlayerVolume 0
+test GetPlayerVolume 0
+test SetPlayerVolume -1
+test GetPlayerVolume -1
+test SetPlayerVolume 1
+test GetPlayerVolume 1
+test SetPlayerVolume 99
+test GetPlayerVolume 99
+test SetPlayerVolume 100
+test GetPlayerVolume 100
+test SetPlayerVolume 101
+test GetPlayerVolume 101
+test SetPlayerVolume 1000
+test GetPlayerVolume 1000
+delete test
+[Endtest]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videoplayersettingsengine/tsrc/vpsettingsenginetest/custom/postrun_custom.xml	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,64 @@
+<step name="Fetch Test module Report" harness="STIF" enabled="true" passrate="100" significant="false">
+       <command>fetch-log</command>
+       <params>
+	    <param type="text"/>
+	    <param delete="true"/>
+	    <param path="C:\Logs\TestFramework\*"/>
+       </params>
+</step>
+<step name="Fetch Fusion logs" harness="STIF" enabled="true" passrate="100" significant="false">
+       <command>fetch-log</command>
+       <params>
+	    <param type="text"/>
+	    <param delete="true"/>
+	    <param path="c:\logs\Fusion\*"/>
+       </params>
+</step>
+<step name="Fetch Livetv logs" harness="STIF" enabled="true" passrate="100" significant="false">
+       <command>fetch-log</command>
+       <params>
+	    <param type="text"/>
+	    <param delete="true"/>
+	    <param path="c:\logs\Livetv\*"/>
+       </params>
+</step>
+<step name="Fetch IPTV logs" harness="STIF" enabled="true" passrate="100" significant="false">
+       <command>fetch-log</command>
+       <params>
+	    <param type="text"/>
+	    <param delete="true"/>
+	    <param path="c:\logs\iptv\*"/>
+       </params>
+</step>
+<step name="Fetch verify files" harness="STIF" enabled="true" passrate="100" significant="false">
+       <command>fetch-log</command>
+       <params>
+	    <param type="text"/>
+	    <param delete="true"/>
+	    <param path="c:\testing\data\verifynew\*"/>
+       </params>
+</step>
+<step name="Fetch TestScripter logs" harness="STIF" enabled="true" passrate="100" significant="false">
+       <command>fetch-log</command>
+       <params>
+	    <param type="text"/>
+	    <param delete="true"/>
+	    <param path="C:\Logs\TestFramework\TestScripter\*"/>
+       </params>
+</step>
+<step name="Fetch Testengine logs" harness="STIF" enabled="true" passrate="100" significant="false">
+       <command>fetch-log</command>
+       <params>
+	    <param type="text"/>
+	    <param delete="true"/>
+	    <param path="C:\Logs\TestFramework\Testengine\*"/>
+       </params>
+</step>
+<step name="Fetch Testserver logs" harness="STIF" enabled="true" passrate="100" significant="false">
+       <command>fetch-log</command>
+       <params>
+	    <param type="text"/>
+	    <param delete="true"/>
+	    <param path="C:\Logs\TestFramework\Testserver\*"/>
+       </params>
+</step>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videoplayersettingsengine/tsrc/vpsettingsenginetest/custom/prerun_custom.xml	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,54 @@
+<step name="Create log directory for testmodule" harness="STIF" enabled="true" passrate="100" significant="false">
+    	<command>makedir</command>
+    	<params>
+        <param dir="c:\logs\testframework"/>
+    	</params>
+</step>
+<step name="Create log directory for fusion" harness="STIF" enabled="true" passrate="100" significant="false">
+    	<command>makedir</command>
+    	<params>
+        <param dir="c:\logs\Fusion"/>
+    	</params>
+</step>
+<step name="Create log directory for livetv" harness="STIF" enabled="true" passrate="100" significant="false">
+    	<command>makedir</command>
+    	<params>
+        <param dir="c:\logs\Livetv"/>
+    	</params>
+</step>
+<step name="Create log directory for iptv" harness="STIF" enabled="true" passrate="100" significant="false">
+    	<command>makedir</command>
+    	<params>
+        <param dir="c:\logs\iptv"/>
+    	</params>
+</step>
+<step name="Create directory for verify files" harness="STIF" enabled="true" passrate="100" significant="false">
+    	<command>makedir</command>
+    	<params>
+        <param dir="c:\testing\data\verifyzip"/>
+    	</params>
+</step>
+<step name="Create directory for verify files" harness="STIF" enabled="true" passrate="100" significant="false">
+    	<command>makedir</command>
+    	<params>
+        <param dir="c:\testing\data\verifynew"/>
+    	</params>
+</step>
+<step name="Create directory for TestScripter logs" harness="STIF" enabled="true" passrate="100" significant="false">
+    	<command>makedir</command>
+    	<params>
+        <param dir="c:\logs\testframework\TestScripter"/>
+    	</params>
+</step>
+<step name="Create directory for Testengine logs" harness="STIF" enabled="true" passrate="100" significant="false">
+    	<command>makedir</command>
+    	<params>
+        <param dir="c:\logs\testframework\Testengine"/>
+    	</params>
+</step>
+<step name="Create directory for Testserver logs" harness="STIF" enabled="true" passrate="100" significant="false">
+    	<command>makedir</command>
+    	<params>
+        <param dir="c:\logs\testframework\Testserver"/>
+    	</params>
+</step>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videoplayersettingsengine/tsrc/vpsettingsenginetest/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,36 @@
+/*
+* Copyright (c) 2002 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:   ?Description*
+*/
+
+
+
+PRJ_PLATFORMS
+
+WINSCW ARMV5
+
+PRJ_TESTEXPORTS
+../conf/vcxnssettingsenginetest.cfg	/epoc32/data/z/system/data/vcxnssettingsenginetest.cfg
+../conf/vcxnssettingsenginetest.cfg	/epoc32/winscw/c/testframework/vcxnssettingsenginetest.cfg
+
+PRJ_EXPORTS
+
+
+PRJ_TESTMMPFILES
+vcxnssettingsenginetest.mmp
+
+PRJ_MMPFILES
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videoplayersettingsengine/tsrc/vpsettingsenginetest/group/vcxnssettingsenginetest.mmp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,74 @@
+/*
+* Copyright (c) 2002 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:   ?Description*
+*/
+
+
+#include <platform_paths.hrh>
+
+TARGET          vcxnssettingsenginetest.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E3
+
+CAPABILITY      ALL -TCB
+/* Remove comments and replace 0x00000000 with correct vendor id */
+// VENDORID     0x00000000
+/* Remove comments and replace 0x00000000 with correct secure id */
+// SECUREID     0x00000000
+
+//TARGETPATH      ?target_path
+DEFFILE         vcxnssettingsenginetest.def
+
+USERINCLUDE		../inc
+USERINCLUDE		../../../inc
+USERINCLUDE     ../../../../../tsrc/VCXTestCommon/inc
+
+APP_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH      ../src
+SOURCE          vcxnssettingsenginetest.cpp vcxnssettingsenginetestBlocks.cpp
+
+LIBRARY         euser.lib
+LIBRARY         stiftestinterface.lib
+LIBRARY         stiftestengine.lib
+LIBRARY			vcxnssettingsengine.lib
+LIBRARY			efsrv.lib
+LIBRARY         vcxtestcommon.lib
+LIBRARY         flogger.lib
+
+LANG            sc
+
+/*
+START WINS      
+?wins_specific_information
+END
+
+START MARM
+?marm_specific_information
+END
+*/
+// Other possible keywords:
+ 
+// DOCUMENT     ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes)
+/*
+START BITMAP ?target
+TARGETPATH   ?emulated_path_on_target_machine
+HEADER
+SOURCE       ?color_depth ?source_bitmap
+END
+*/
+// DEFFILE ?filename
+// AIF ?filename
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videoplayersettingsengine/tsrc/vpsettingsenginetest/group/vcxnssettingsenginetest.pkg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,61 @@
+;
+; 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 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:  Package file for settings engine STIF tests;
+
+; Languages
+&EN
+
+; Provide value for uid
+#{"vcxnssettingsenginetest"},(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
+"/epoc32/release/armv5/udeb/VCXTestCommon.dll"            - "!:/Sys/Bin/VCXTestCommon.dll"
+"/epoc32/release/armv5/udeb/VCXTestUtilModule.dll"        - "!:/Sys/Bin/VCXTestUtilModule.dll"
+"/epoc32/release/armv5/udeb/vcxnssettingsenginetest.dll"  - "!:/Sys/Bin/vcxnssettingsenginetest.dll"
+"../conf/vcxnssettingsenginetest.cfg"                     - "c:/TestFramework/vcxnssettingsenginetest.cfg"
+"../init/TestFramework.ini"                               - "c:/TestFramework/TestFramework.ini"
+
+; Embedded SIS 
+; None
+
+; End of Package body
+
+; PKG dependencies
+; None
+
+; PKG capabilities
+; None
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videoplayersettingsengine/tsrc/vpsettingsenginetest/inc/vcxnssettingsenginetest.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,230 @@
+/*
+* Copyright (c) 2002 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:   ?Description*
+*/
+
+
+
+
+#ifndef VCXNSSETTINGSENGINETEST_H
+#define VCXNSSETTINGSENGINETEST_H
+
+//  INCLUDES
+#include <StifLogger.h>
+#include <TestScripterInternal.h>
+#include <StifTestModule.h>
+#include <TestclassAssert.h>
+#include <f32file.h>
+
+#include "videoplayersettingsengine.h"
+#include "IptvTestUtilALR.h"
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+#define TEST_CLASS_VERSION_MAJOR 0
+#define TEST_CLASS_VERSION_MINOR 0
+#define TEST_CLASS_VERSION_BUILD 0
+
+// Logging path
+_LIT( KVcxNsSettingsEngineTestLogPath, "\\logs\\testframework\\VcxNsSettingsEngineTest\\" ); 
+// Log file
+_LIT( KVcxNsSettingsEngineTestLogFile, "VcxNsSettingsEngineTest.txt" ); 
+_LIT( KVcxNsSettingsEngineTestLogFileWithTitle, "VcxNsSettingsEngineTest[%S].txt" );
+// Log method usage
+_LIT( KTestModuleName, "VcxNsSettingsEngineTest" );
+_LIT( KLogLocation, "In %S" );
+
+// FUNCTION PROTOTYPES
+//?type ?function_name(?arg_list);
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+class CVcxNsSettingsEngineTest;
+class CVcxNsSettingsEngine;
+class CVideoSettingsDriveMonitor;
+
+// DATA TYPES
+//enum ?declaration
+//typedef ?declaration
+//extern ?data_type;
+
+enum TDriveType
+    {
+    EFixedDrive = 1,
+    EMassStorageDrive,
+    EPhoneMemoryDrive,
+    EMemoryCardDrive
+    };
+
+// CLASS DECLARATION
+
+/**
+*  CVcxNsSettingsEngineTest test class for STIF Test Framework TestScripter.
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+NONSHARABLE_CLASS(CVcxNsSettingsEngineTest) : public CScriptBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CVcxNsSettingsEngineTest* NewL( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CVcxNsSettingsEngineTest();
+
+    public: // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    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 );
+
+    protected:  // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    protected:  // Functions from base classes
+
+        /**
+        * From ?base_class ?member_description
+        */
+        //?type ?member_function();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CVcxNsSettingsEngineTest( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        // Prohibit copy constructor if not deriving from CBase.
+        // ?classname( const ?classname& );
+        // Prohibit assigment operator if not deriving from CBase.
+        // ?classname& operator=( const ?classname& );
+
+        /**
+        * Frees all resources allocated from test methods.
+        * @since ?Series60_version
+        */
+        void Delete();
+
+        /**
+        * Log current test method
+        * @since ?Series60_version
+        */
+        void LogMethod( TPtrC aMethod );
+        
+        TInt FindDrive( TInt aType );
+
+        /**
+        * Test methods are listed below. 
+        */
+
+        /**
+        * Example test method.
+        * @since ?Series60_version
+        * @param aItem Script line containing parameters.
+        * @return Symbian OS error code.
+        */
+        virtual TInt CreateL( CStifItemParser& aItem );
+        virtual TInt GetUsedMemoryL( CStifItemParser& aItem );
+        virtual TInt SetUsedMemoryL( CStifItemParser& aItem );
+        virtual TInt GetParentControl( CStifItemParser& aItem );
+        virtual TInt SetParentControl( CStifItemParser& aItem );
+        virtual TInt GetVideoOnDemandThumbnails( CStifItemParser& aItem );
+        virtual TInt SetVideoOnDemandThumbnails( CStifItemParser& aItem );
+        virtual TInt GetUsedSnapId( CStifItemParser& aItem );
+        virtual TInt SetUsedSnapId( CStifItemParser& aItem );
+        virtual TInt GetAllowUseGprs( CStifItemParser& aItem );
+        virtual TInt SetAllowUseGprs( CStifItemParser& aItem );
+        virtual TInt GetAllowRoaming( CStifItemParser& aItem );
+        virtual TInt SetAllowRoaming( CStifItemParser& aItem );
+        virtual TInt CheckLockCodeL( CStifItemParser& aItem );
+        virtual TInt GetPlayerVolume( CStifItemParser& aItem );
+        virtual TInt SetPlayerVolume( CStifItemParser& aItem );
+
+        /**
+         * Method used to log version of test class
+         */
+        void SendTestClassVersion();
+
+        //ADD NEW METHOD DEC HERE
+        //[TestMethods] - Do not remove
+
+    public:     // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    protected:  // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    private:    // Data
+        
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+        // Reserved pointer for future extension
+        //TAny* iReserved;
+
+    public:     // Friend classes
+        //?friend_class_declaration;
+    protected:  // Friend classes
+        //?friend_class_declaration;
+    private:    // Friend classes
+        //?friend_class_declaration;
+        Int64 iIadUpdateTime;
+        TInt iUsedMemory;
+        CVcxNsSettingsEngine* iSettingsEngine;
+        CVideoSettingsDriveMonitor* iDriveMonitor;
+        RFs iFs;
+    };
+
+#endif      // VCXNSSETTINGSENGINETEST_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videoplayersettingsengine/tsrc/vpsettingsenginetest/init/TestFramework.ini	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,172 @@
+#
+# This is STIFTestFramework initialization file 123
+# 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': Sret of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases' 
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.sd
+#
+# 	- 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.
+
+[Engine_Defaults]
+
+TestReportMode= FullReport # Possible values are: 'Empty', 'Summary', 'Environment', 'TestCases' or 'FullReport'
+
+CreateTestReport= YES			# Possible values: YES or NO
+
+TestReportFilePath= c:\Logs\Fusion\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT			# Possible values: TXT or HTML
+TestReportOutput= FILE			# Possible values: FILE or RDEBUG
+TestReportFileCreationMode= APPEND	# Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+DisableMeasurement= stifmeasurementplugin04 
+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\vcxnssettingsenginetest.cfg
+[End_Module]
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework 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)'#' 
+
+CreateLogDirectories= YES    # Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML         # Possible values: TXT or HTML
+#EmulatorOutput= FILE         # Possible values: FILE or RDEBUG
+
+#HardwareBasePath=  C:\
+#HardwareFormat= TXT			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+FileCreationMode= APPEND  # 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
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videoplayersettingsengine/tsrc/vpsettingsenginetest/src/vcxnssettingsenginetest.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,201 @@
+/*
+* Copyright (c) 2002 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:   ?Description*
+*/
+
+
+
+
+// INCLUDE FILES
+#include <Stiftestinterface.h>
+#include "vcxnssettingsenginetest.h"
+#include <SettingServerClient.h>
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsEngineTest::CVcxNsSettingsEngineTest
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CVcxNsSettingsEngineTest::CVcxNsSettingsEngineTest( 
+    CTestModuleIf& aTestModuleIf ):
+        CScriptBase( aTestModuleIf )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsEngineTest::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CVcxNsSettingsEngineTest::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(KVcxNsSettingsEngineTestLogFileWithTitle, &title);
+        }
+    else
+        {
+        logFileName.Copy(KVcxNsSettingsEngineTestLogFile);
+        }
+
+    iLog = CStifLogger::NewL( KVcxNsSettingsEngineTestLogPath, 
+                          logFileName,
+                          CStifLogger::ETxt,
+                          CStifLogger::EFile,
+                          EFalse );
+
+    SendTestClassVersion();
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsEngineTest::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CVcxNsSettingsEngineTest* CVcxNsSettingsEngineTest::NewL( 
+    CTestModuleIf& aTestModuleIf )
+    {
+    CVcxNsSettingsEngineTest* self = new (ELeave) CVcxNsSettingsEngineTest( aTestModuleIf );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+
+    }
+
+// Destructor
+CVcxNsSettingsEngineTest::~CVcxNsSettingsEngineTest()
+    { 
+
+    // Delete resources allocated from test methods
+    Delete();
+
+    // Delete logger
+    delete iLog; 
+
+    }
+
+//-----------------------------------------------------------------------------
+// CVcxNsSettingsEngineTest::SendTestClassVersion
+// Method used to send version of test class
+//-----------------------------------------------------------------------------
+//
+void CVcxNsSettingsEngineTest::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("VcxNsSettingsEngineTest.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 ) // Backpointer to STIF Test Framework
+    {
+
+    return ( CScriptBase* ) CVcxNsSettingsEngineTest::NewL( aTestModuleIf );
+
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videoplayersettingsengine/tsrc/vpsettingsenginetest/src/vcxnssettingsenginetestBlocks.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,828 @@
+/*
+* Copyright (c) 2002 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:   ?Description*
+*/
+
+
+
+
+// [INCLUDE FILES] - do not remove
+#include <e32svr.h>
+#include <StifParser.h>
+#include <Stiftestinterface.h>
+#include <cmmanagerext.h>
+#include <cmdestinationext.h>
+#include "vcxnssettingsenginetest.h"
+#include "vcxtestlog.h"
+#include "videosettingsdrivemonitor.h"
+#include "IptvTestUtilALR.h"
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsEngineTest::Delete
+// Delete here all resources allocated and opened from test methods. 
+// Called from destructor. 
+// -----------------------------------------------------------------------------
+//
+void CVcxNsSettingsEngineTest::Delete() 
+    {
+    if( iSettingsEngine )
+           {
+           delete iSettingsEngine;
+           iSettingsEngine = NULL;
+           }
+    
+    iFs.Close();
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsEngineTest::RunMethodL
+// Run specified method. Contains also table of test mothods and their names.
+// -----------------------------------------------------------------------------
+//
+TInt CVcxNsSettingsEngineTest::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( "Create", CVcxNsSettingsEngineTest::CreateL ),
+        ENTRY( "GetUsedMemory", CVcxNsSettingsEngineTest::GetUsedMemoryL ),
+        ENTRY( "SetUsedMemory", CVcxNsSettingsEngineTest::SetUsedMemoryL ),
+        ENTRY( "GetParentControl", CVcxNsSettingsEngineTest::GetParentControl ),
+        ENTRY( "SetParentControl", CVcxNsSettingsEngineTest::SetParentControl ),
+        ENTRY( "GetVideoOnDemandThumbnails", CVcxNsSettingsEngineTest::GetVideoOnDemandThumbnails ),
+        ENTRY( "SetVideoOnDemandThumbnails", CVcxNsSettingsEngineTest::SetVideoOnDemandThumbnails ),
+        ENTRY( "GetUsedSnapId", CVcxNsSettingsEngineTest::GetUsedSnapId ),
+        ENTRY( "SetUsedSnapId", CVcxNsSettingsEngineTest::SetUsedSnapId ),
+        ENTRY( "GetAllowUseGprs", CVcxNsSettingsEngineTest::GetAllowUseGprs ),
+        ENTRY( "SetAllowUseGprs", CVcxNsSettingsEngineTest::SetAllowUseGprs ),
+        ENTRY( "GetAllowRoaming", CVcxNsSettingsEngineTest::GetAllowRoaming ),
+        ENTRY( "SetAllowRoaming", CVcxNsSettingsEngineTest::SetAllowRoaming ),
+        ENTRY( "CheckLockCodeL", CVcxNsSettingsEngineTest::CheckLockCodeL ),
+        ENTRY( "GetPlayerVolume", CVcxNsSettingsEngineTest::GetPlayerVolume ),  
+        ENTRY( "SetPlayerVolume", CVcxNsSettingsEngineTest::SetPlayerVolume )  
+        //ADD NEW ENTRY HERE
+        // [test cases entries] - Do not remove
+
+        };
+
+    const TInt count = sizeof( KFunctions ) / 
+                        sizeof( TStifFunctionInfo );
+
+    return RunInternalL( KFunctions, count, aItem );
+
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsEngineTest::GetUsedMemoryL
+// ?implementation_description
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CVcxNsSettingsEngineTest::CreateL(
+   CStifItemParser& /*aItem*/ )
+   {
+   // Print to UI
+   _LIT( KVcxVideoSettingsEngineTest, "VcxVideoSettingsEngineTest" );
+   _LIT( KCurrentFunction, "In CreateL" );
+   TestModuleIf().Printf( 0, KVcxVideoSettingsEngineTest, KCurrentFunction );
+   // Print to log file
+   iLog->Log( KCurrentFunction );
+   
+   VCXLOGLO1(">>> CVcxNsSettingsEngineTest::CreateL");
+
+   if( !iSettingsEngine )
+       {
+       iSettingsEngine = CVcxNsSettingsEngine::NewL();
+       }
+   
+   iIadUpdateTime = 0;
+   
+   User::LeaveIfError( iFs.Connect() );
+   
+   VCXLOGLO1("<<< CVcxNsSettingsEngineTest::CreateL");
+   return KErrNone;
+   }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsEngineTest::LogMethod
+// Generate log from current method
+// -----------------------------------------------------------------------------
+//
+void CVcxNsSettingsEngineTest::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 );
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXPlayerCoreApiTest::LogMethod
+// Generate log from current method
+// -----------------------------------------------------------------------------
+//
+TInt CVcxNsSettingsEngineTest::FindDrive( TInt aType )
+    {
+    VCXLOGLO1(">>> CVcxNsSettingsEngineTest::FindDrive");
+    
+    CVideoSettingsDriveMonitor* driveMonitor = CVideoSettingsDriveMonitor::NewL( iFs );
+    TInt driveNumber( -1 );
+    
+    switch( aType )
+        {
+        case EFixedDrive:
+            driveNumber = driveMonitor->FixedDrive(EFalse);
+            break;
+        case EMassStorageDrive:
+            driveNumber = driveMonitor->MassStorageDrive();
+            break;
+        case EPhoneMemoryDrive:
+            driveNumber = driveMonitor->PhoneMemoryDrive();
+            break;
+        case EMemoryCardDrive:
+            driveNumber = driveMonitor->MemoryCardDrive();
+            break;
+        default:
+            //Set given int to drivenumber
+            driveNumber = aType;
+        }
+    
+    VCXLOGLO2("<<< CVcxNsSettingsEngineTest::FindDrive (%d)", driveNumber);
+    return driveNumber;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsEngineTest::GetUsedMemoryL
+// ?implementation_description
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CVcxNsSettingsEngineTest::GetUsedMemoryL(
+   CStifItemParser& aItem )
+   {
+   LogMethod(_L("GetUsedMemoryL"));
+   
+   VCXLOGLO1(">>> CVcxNsSettingsEngineTest::GetUsedMemoryL");
+   
+   TInt expectedValue( -1 );
+   if( aItem.GetNextInt( expectedValue ) != KErrNone )
+       {
+       expectedValue = iUsedMemory;
+       }
+
+   TInt usedMemory( 0 );
+   TRAPD( error, iSettingsEngine->GetUsedMemoryL( usedMemory ) );
+
+   if( error != KErrNone )
+       {
+       VCXLOGLO2("CVcxNsSettingsEngineTest::GetUsedMemoryL -- error after call: %d", error);
+	   VCXLOGLO2("<<< CVcxNsSettingsEngineTest::GetUsedMemoryL (%d)", error);
+       return error;
+       }
+
+   if( expectedValue != usedMemory )
+       {
+       VCXLOGLO3("CVcxNsSettingsEngineTest::GetUsedMemoryL -- Expected memory: %d Used memory: %d", expectedValue, usedMemory);
+       error = KErrCorrupt;
+       }
+      
+   VCXLOGLO2("<<< CVcxNsSettingsEngineTest::GetUsedMemoryL (%d)", error);
+   return error;
+   }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsEngineTest::SetUsedMemory
+// ?implementation_description
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CVcxNsSettingsEngineTest::SetUsedMemoryL(
+   CStifItemParser& aItem )
+   {
+   LogMethod(_L("SetUsedMemoryL"));
+   VCXLOGLO1(">>> CVcxNsSettingsEngineTest::SetUsedMemoryL");
+
+   TInt error( 0 );
+
+   TInt driveType( -1 );
+   User::LeaveIfError( aItem.GetNextInt( driveType ) );
+
+   TInt driveNumber( 0 );
+   driveNumber = FindDrive( driveType );
+  
+   // Attempt to set the used memory
+   TBool ret;
+   ret = iSettingsEngine->SetUsedMemory( driveNumber );
+
+   if( !ret )
+       {
+       VCXLOGLO1("CVcxNsSettingsEngineTest::SetUsedMemory -- Returned false!");
+       error = KErrGeneral;
+       }
+   else
+       {
+       iUsedMemory = driveNumber;
+       }
+   
+   VCXLOGLO1("<<< CVcxNsSettingsEngineTest::SetUsedMemory");
+   return error;
+   }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsEngineTest::GetParentControl
+// ?implementation_description
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CVcxNsSettingsEngineTest::GetParentControl(
+   CStifItemParser& aItem )
+   {
+   LogMethod(_L("GetParentControl"));
+   
+   VCXLOGLO1(">>> CVcxNsSettingsEngineTest::GetParentControl");
+
+   TInt expectedParentControl( -1 );
+   aItem.GetNextInt( expectedParentControl );
+   
+   TInt parentControl( 0 );
+   TBool ret( EFalse );
+   ret = iSettingsEngine->GetParentControl( parentControl );
+
+   if( !ret )
+       {
+       VCXLOGLO1("CVcxNsSettingsEngineTest::GetParentControl -- Returned false!");
+       VCXLOGLO1("<<< CVcxNsSettingsEngineTest::GetParentControl");
+       return KErrGeneral;
+       }
+   
+   if( expectedParentControl != -1 && expectedParentControl != parentControl )
+       {
+       VCXLOGLO3("CVcxNsSettingsEngineTest::GetParentControl -- Expected value: %d Returned value: %d", expectedParentControl, parentControl);
+       VCXLOGLO1("<<< CVcxNsSettingsEngineTest::GetParentControl");
+       return KErrCorrupt;
+       }
+   
+   VCXLOGLO1("<<< CVcxNsSettingsEngineTest::GetParentControl");
+   return KErrNone;
+   }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsEngineTest::SetParentControl
+// ?implementation_description
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CVcxNsSettingsEngineTest::SetParentControl(
+   CStifItemParser& aItem )
+   {
+   LogMethod(_L("SetParentControl"));
+   
+   VCXLOGLO1(">>> CVcxNsSettingsEngineTest::SetParentControl");
+
+   TInt parentControl( 0 );
+   aItem.GetNextInt( parentControl );
+
+   TBool ret;
+   ret = iSettingsEngine->SetParentControl( parentControl );
+   
+   if( !ret )
+       {
+       VCXLOGLO1("CVcxNsSettingsEngineTest::SetParentControl -- Returned false!");
+       VCXLOGLO1("<<< CVcxNsSettingsEngineTest::SetParentControl");
+       return KErrGeneral;
+       }
+   
+   VCXLOGLO1("<<< CVcxNsSettingsEngineTest::SetParentControl");
+   return KErrNone;
+   }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsEngineTest::GetVideoOnDemandThumbnails
+// ?implementation_description
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CVcxNsSettingsEngineTest::GetVideoOnDemandThumbnails(
+   CStifItemParser& aItem )
+   {
+   LogMethod(_L("GetVideoOnDemandThumbnails"));
+   
+   VCXLOGLO1(">>> CVcxNsSettingsEngineTest::GetVideoOnDemandThumbnails");
+   
+   TInt expectedValue( -1 );
+   aItem.GetNextInt( expectedValue );
+   
+   TInt value( 0 );
+   TBool ret;
+   TRAPD( error, ret = iSettingsEngine->GetVideoOnDemandThumbnails( value ) );
+   
+   if( error )
+       {
+       VCXLOGLO2("CVcxNsSettingsEngineTest::GetVideoOnDemandThumbnails -- Returned %d!", error);
+       VCXLOGLO1("<<< CVcxNsSettingsEngineTest::GetVideoOnDemandThumbnails");
+       return error;
+       }
+   
+   if( !ret )
+       {
+       VCXLOGLO1("CVcxNsSettingsEngineTest::GetVideoOnDemandThumbnails -- Returned false!");
+       VCXLOGLO1("<<< CVcxNsSettingsEngineTest::GetVideoOnDemandThumbnails");
+       return KErrGeneral;
+       }
+   
+   if( expectedValue != -1 && expectedValue != value )
+       {
+       VCXLOGLO3("CVcxNsSettingsEngineTest::GetVideoOnDemandThumbnails -- Expected value: %d Returned value: %d", expectedValue, value);
+       VCXLOGLO1("<<< CVcxNsSettingsEngineTest::GetVideoOnDemandThumbnails");
+       return KErrCorrupt;
+       }
+   
+   VCXLOGLO1("<<< CVcxNsSettingsEngineTest::GetVideoOnDemandThumbnails");
+   return KErrNone;
+   }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsEngineTest::SetVideoOnDemandThumbnails
+// ?implementation_description
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CVcxNsSettingsEngineTest::SetVideoOnDemandThumbnails(
+   CStifItemParser& aItem )
+   {
+   LogMethod(_L("SetVideoOnDemandThumbnails"));
+
+   VCXLOGLO1(">>> CVcxNsSettingsEngineTest::SetVideoOnDemandThumbnails");
+
+   TInt value( 0 );
+   aItem.GetNextInt( value );
+
+   TBool ret;
+   TRAPD( error, ret = iSettingsEngine->SetVideoOnDemandThumbnails( value ) );
+   
+   if( error )
+       {
+       VCXLOGLO2("CVcxNsSettingsEngineTest::SetVideoOnDemandThumbnails -- Returned %d!", error);
+       VCXLOGLO1("<<< CVcxNsSettingsEngineTest::SetVideoOnDemandThumbnails");
+       return error;
+       }
+   
+   if( !ret )
+       {
+       VCXLOGLO1("CVcxNsSettingsEngineTest::SetVideoOnDemandThumbnails -- Returned false!");
+       VCXLOGLO1("<<< CVcxNsSettingsEngineTest::SetVideoOnDemandThumbnails");
+       return KErrGeneral;
+       }
+   
+   VCXLOGLO1("<<< CVcxNsSettingsEngineTest::SetVideoOnDemandThumbnails");
+   return KErrNone;
+   }
+
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsEngineTest::GetUsedSnapId
+// ?implementation_description
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CVcxNsSettingsEngineTest::GetUsedSnapId(
+   CStifItemParser& aItem )
+   {
+   LogMethod(_L("GetUsedSnapId"));
+   
+   VCXLOGLO1(">>> CVcxNsSettingsEngineTest::GetUsedSnapId");
+   
+   aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+   
+   TPtrC snapName;
+   aItem.GetNextString( snapName );
+   
+   TInt expectedValue( -1 );
+
+   if( snapName.Length() > 0 )
+       {
+       CIptvTestUtilALR* alrUtil = CIptvTestUtilALR::NewLC();
+       expectedValue = alrUtil->GetDestinationIdL( snapName );
+       CleanupStack::PopAndDestroy( alrUtil );
+       }
+   
+   TInt value( 0 );
+   TBool ret;
+   ret = iSettingsEngine->GetUsedSnapId( value );
+   
+   if( !ret )
+       {
+       VCXLOGLO1("CVcxNsSettingsEngineTest::GetUsedSnapId -- Returned false!");
+       VCXLOGLO1("<<< CVcxNsSettingsEngineTest::GetUsedSnapId");
+       return KErrGeneral;
+       }
+   
+   VCXLOGLO2("<<< CVcxNsSettingsEngineTest::GetUsedSnapId -- value %d", value);
+   
+   if( expectedValue != -1 && expectedValue != value )
+       {
+       VCXLOGLO3("CVcxNsSettingsEngineTest::GetUsedSnapId -- Expected value: %d Returned value: %d", expectedValue, value);
+       VCXLOGLO1("<<< CVcxNsSettingsEngineTest::GetUsedSnapId");
+       return KErrCorrupt;
+       }
+   
+   VCXLOGLO1("<<< CVcxNsSettingsEngineTest::GetUsedSnapId");
+   return KErrNone;
+
+   }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsEngineTest::SetUsedSnapId
+// ?implementation_description
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CVcxNsSettingsEngineTest::SetUsedSnapId(
+   CStifItemParser& aItem )
+   {
+   LogMethod(_L("SetUsedSnapId"));   
+
+   VCXLOGLO1(">>> CVcxNsSettingsEngineTest::SetUsedSnapId");
+
+   aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+   
+   TPtrC snapName;
+   aItem.GetNextString( snapName );
+   
+   TInt usedSnap( -1 );
+
+   if( snapName.Compare(_L("INVALID")) != 0 )
+       {
+       CIptvTestUtilALR* alrUtil = CIptvTestUtilALR::NewLC();
+       usedSnap = alrUtil->GetDestinationIdL( snapName );
+       CleanupStack::PopAndDestroy( alrUtil );
+       }
+
+   TBool ret;
+   ret = iSettingsEngine->SetUsedSnapId( usedSnap );
+   
+   if( !ret )
+       {
+       VCXLOGLO1("CVcxNsSettingsEngineTest::SetUsedSnapId -- Returned false!");
+       VCXLOGLO1("<<< CVcxNsSettingsEngineTest::SetUsedSnapId");
+       return KErrGeneral;
+       }
+   
+   VCXLOGLO1("<<< CVcxNsSettingsEngineTest::SetUsedSnapId");
+   return KErrNone;
+
+   }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsEngineTest::GetAllowUseGprs
+// ?implementation_description
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CVcxNsSettingsEngineTest::GetAllowUseGprs(
+   CStifItemParser& aItem )
+   {
+   LogMethod(_L("GetAllowUseGprs"));
+   
+   VCXLOGLO1(">>> CVcxNsSettingsEngineTest::GetAllowUseGprs");
+
+   TInt expectedValue( -1 );
+   aItem.GetNextInt( expectedValue );
+   
+   TInt value( 0 );
+   TBool ret;
+   ret = iSettingsEngine->GetAllowUseGprs( value );
+   
+   if( !ret )
+       {
+       VCXLOGLO1("CVcxNsSettingsEngineTest::GetAllowUseGprs -- Returned false!");
+       VCXLOGLO1("<<< CVcxNsSettingsEngineTest::GetAllowUseGprs");
+       return KErrGeneral;
+       }
+   
+   if( expectedValue != -1 && expectedValue != value )
+       {
+       VCXLOGLO3("CVcxNsSettingsEngineTest::GetAllowUseGprs -- Expected value: %d Returned value: %d", expectedValue, value);
+       VCXLOGLO1("<<< CVcxNsSettingsEngineTest::GetAllowUseGprs");
+       return KErrCorrupt;
+       }
+   
+   VCXLOGLO1("<<< CVcxNsSettingsEngineTest::GetAllowUseGprs");
+
+   return KErrNone;
+
+   }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsEngineTest::SetAllowUseGprs
+// ?implementation_description
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CVcxNsSettingsEngineTest::SetAllowUseGprs(
+   CStifItemParser& aItem )
+   {
+   LogMethod(_L("SetAllowUseGprs"));
+   
+   VCXLOGLO1(">>> CVcxNsSettingsEngineTest::SetAllowUseGprs");
+
+   TInt value( 0 );
+   aItem.GetNextInt( value );
+
+   TBool ret;
+   ret = iSettingsEngine->SetAllowUseGprs( value );
+   
+   if( !ret )
+       {
+       VCXLOGLO1("CVcxNsSettingsEngineTest::SetAllowUseGprs -- Returned false!");
+       VCXLOGLO1("<<< CVcxNsSettingsEngineTest::SetAllowUseGprs");
+       return KErrGeneral;
+       }
+   
+   VCXLOGLO1("<<< CVcxNsSettingsEngineTest::SetAllowUseGprs");
+
+   return KErrNone;
+
+   }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsEngineTest::GetAllowRoaming
+// ?implementation_description
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CVcxNsSettingsEngineTest::GetAllowRoaming(
+   CStifItemParser& aItem )
+   {
+   LogMethod(_L("GetAllowRoaming"));
+   
+   VCXLOGLO1(">>> CVcxNsSettingsEngineTest::GetAllowRoaming");
+
+   TInt expectedValue( -1 );
+   aItem.GetNextInt( expectedValue );
+   
+   TInt value( 0 );
+   TBool ret;
+   ret = iSettingsEngine->GetAllowRoaming( value );
+   
+   if( !ret )
+       {
+       VCXLOGLO1("CVcxNsSettingsEngineTest::GetAllowRoaming -- Returned false!");
+       VCXLOGLO1("<<< CVcxNsSettingsEngineTest::GetAllowRoaming");
+       return KErrGeneral;
+       }
+   
+   if( expectedValue != -1 && expectedValue != value )
+       {
+       VCXLOGLO3("CVcxNsSettingsEngineTest::GetAllowRoaming -- Expected value: %d Returned value: %d", expectedValue, value);
+       VCXLOGLO1("<<< CVcxNsSettingsEngineTest::GetAllowRoaming");
+       return KErrCorrupt;
+       }
+   
+   VCXLOGLO1("<<< CVcxNsSettingsEngineTest::GetAllowRoaming");
+
+   return KErrNone;
+
+   }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsEngineTest::SetAllowRoaming
+// ?implementation_description
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CVcxNsSettingsEngineTest::SetAllowRoaming(
+   CStifItemParser& aItem )
+   {
+   LogMethod(_L("SetAllowRoaming"));
+  
+   VCXLOGLO1(">>> CVcxNsSettingsEngineTest::SetAllowRoaming");
+
+   TInt value( 0 );
+   aItem.GetNextInt( value );
+
+   TBool ret;
+   ret = iSettingsEngine->SetAllowRoaming( value );
+   
+   if( !ret )
+       {
+       VCXLOGLO1("CVcxNsSettingsEngineTest::SetAllowRoaming -- Returned false!");
+       VCXLOGLO1("<<< CVcxNsSettingsEngineTest::SetAllowRoaming");
+       return KErrGeneral;
+       }
+  
+   VCXLOGLO1("<<< CVcxNsSettingsEngineTest::SetAllowRoaming");
+
+   return KErrNone;
+
+   }
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsEngineTest::CheckLockCodeL
+// ?implementation_description
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CVcxNsSettingsEngineTest::CheckLockCodeL(
+   CStifItemParser& aItem )
+   {
+   LogMethod(_L("CheckLockCodeL"));
+   
+   VCXLOGLO1(">>> CVcxNsSettingsEngineTest::CheckLockCodeL");
+
+   TInt expectedValue( -1 );
+   aItem.GetNextInt( expectedValue );
+   
+   TInt value( 0 );
+   TBool ret;
+   TRAPD(error, ret = iSettingsEngine->CheckLockCodeL());
+
+   if( error != KErrNone )
+       {
+       VCXLOGLO2("CVcxNsSettingsEngineTest::CheckLockCodeL -- Error %d", error);
+       VCXLOGLO1("<<< CVcxNsSettingsEngineTest::CheckLockCodeL");
+       return KErrGeneral;
+       }
+
+   if( !ret )
+       {
+       VCXLOGLO1("CVcxNsSettingsEngineTest::CheckLockCodeL -- Returned false!");
+       VCXLOGLO1("<<< CVcxNsSettingsEngineTest::CheckLockCodeL");
+       return KErrGeneral;
+       }
+   
+   if( expectedValue != -1 && expectedValue != value )
+       {
+       VCXLOGLO3("CVcxNsSettingsEngineTest::CheckLockCodeL -- Expected value: %d Returned value: %d", expectedValue, value);
+       VCXLOGLO1("<<< CVcxNsSettingsEngineTest::CheckLockCodeL");
+       return KErrCorrupt;
+       }
+   
+   VCXLOGLO1("<<< CVcxNsSettingsEngineTest::CheckLockCodeL");
+
+   return KErrNone;
+   }
+
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsEngineTest::GetPlayerVolume
+// ?implementation_description
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CVcxNsSettingsEngineTest::GetPlayerVolume(
+   CStifItemParser& aItem )
+   {
+   LogMethod(_L("GetPlayerVolume"));
+   
+   VCXLOGLO1(">>> CVcxNsSettingsEngineTest::GetPlayerVolume");
+
+    TInt expectedValue( -1 );
+    aItem.GetNextInt( expectedValue );
+    
+    TInt value( 0 );
+    TBool ret;
+    ret = iSettingsEngine->GetPlayerVolume( value );
+    
+    if( !ret )
+        {
+        VCXLOGLO1("CVcxNsSettingsEngineTest::GetPlayerVolume -- Returned false!");
+        VCXLOGLO1("<<< CVcxNsSettingsEngineTest::GetPlayerVolume");
+        return KErrGeneral;
+        }
+    
+    if( expectedValue != -1 && expectedValue != value )
+        {
+        VCXLOGLO3("CVcxNsSettingsEngineTest::GetPlayerVolume -- Expected value: %d Returned value: %d", expectedValue, value);
+        VCXLOGLO1("<<< CVcxNsSettingsEngineTest::GetPlayerVolume");
+        return KErrCorrupt;
+        }
+
+	VCXLOGLO1("<<< CVcxNsSettingsEngineTest::GetPlayerVolume");
+
+   return KErrNone;
+   }
+
+
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsEngineTest::SetPlayerVolume
+// ?implementation_description
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CVcxNsSettingsEngineTest::SetPlayerVolume(
+   CStifItemParser& aItem )
+   {
+   LogMethod(_L("SetPlayerVolume"));
+   
+   VCXLOGLO1(">>> CVcxNsSettingsEngineTest::SetPlayerVolume");
+
+   TInt value( 0 );
+   aItem.GetNextInt( value );
+
+   TBool ret;
+   ret = iSettingsEngine->SetPlayerVolume( value );
+   
+   if( !ret )
+       {
+       VCXLOGLO1("CVcxNsSettingsEngineTest::SetPlayerVolume -- Returned false!");
+       VCXLOGLO1("<<< CVcxNsSettingsEngineTest::SetPlayerVolume");
+       return KErrGeneral;
+       }
+  
+   VCXLOGLO1("<<< CVcxNsSettingsEngineTest::SetPlayerVolume");
+
+   return KErrNone;
+
+   }
+
+
+// -----------------------------------------------------------------------------
+// CVcxNsSettingsEngineTest::?member_function
+// ?implementation_description
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+/*
+TInt CVcxNsSettingsEngineTest::?member_function(
+   CStifItemParser& aItem )
+   {
+
+   ?code
+
+   }
+*/
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+// None
+
+//  [End of File] - Do not remove
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/package_definition.xml	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<SystemDefinition schema="3.0.0">
+ <package id="videoplayer" name="Video Player Apps" version="92.92.1" levels="support plugin util apps" xmlns:qt="http://www.nokia.com/qt">
+  <collection id="videoplayer_plat" name="Video Player Apps Platform Interfaces" level="apps">
+   <component id="video_player_file_details_dialog_api" name="Video Player File Details Dialog API" class="api" filter="s60" introduced="^3">
+    <unit bldFile="videoplayer_plat/video_player_file_details_dialog_api/group"/>
+   </component> 
+   <component id="videocollection_api" name="Video Collection API" class="api" filter="s60" introduced="^3">
+    <unit bldFile="videoplayer_plat/videocollection_api/group"/>
+   </component>    
+   <component id="videoplayer_startup_api" name="Video Player Startup API" class="api" filter="s60" introduced="^3">
+    <unit bldFile="videoplayer_plat/videoplayer_startup_api/group"/>
+   </component>
+  </collection>
+  <collection id="videofeeds" name="Video Feeds" level="plugin">
+   <component id="vccommon" name="Vccommon" filter="s60" introduced="^3">
+    <unit bldFile="videofeeds/vccommon/group"/>
+   </component>
+  </collection>
+  <collection id="videocollection" name="Video Collection" level="util">
+   <component id="hgmyvideos" name="Hg My Videos" filter="s60" introduced="^3">
+    <unit bldFile="videocollection/hgmyvideos/group"/>
+   </component>
+   <component id="hgmyvideosplugin" name="Hg My Videos Plugin" filter="s60" introduced="^3">
+    <unit bldFile="videocollection/hgmyvideosplugin/group"/>
+   </component>  
+   <component id="mpxmyvideoscollection" name="MPX My Videos Collection" filter="s60" introduced="^3">
+    <unit bldFile="videocollection/mpxmyvideoscollection/group"/>
+   </component>
+   <component id="myvideosindicatorplugin" name="My Videos Indicator Plugin" filter="s60" introduced="^3">
+    <unit bldFile="videocollection/myvideosindicatorplugin/group"/>
+   </component>
+  </collection>
+  <collection id="mediasettings" name="Media Settings" level="support">
+   <component id="gsvideoplugin" name="Gs Video Plugin" filter="s60" introduced="^3">
+    <unit bldFile="mediasettings/gsvideoplugin/group"/>
+   </component>
+   <component id="mediasettingsapp" name="Media Settings App" filter="s60" introduced="^3">
+    <unit bldFile="mediasettings/mediasettingsapp/group"/>
+   </component>
+   <component id="mediasettingsengine" name="Media Settings Engine" filter="s60" introduced="^3">
+    <unit bldFile="mediasettings/mediasettingsengine/group"/>   
+    </component>
+   <component id="mpsettbase" name="Mp Settbase" filter="s60" introduced="^3">
+    <unit bldFile="mediasettings/mpsettbase/group"/>
+   </component>
+   <component id="videoplayersettingsengine" name="Video Player Settings Engine" filter="s60" introduced="^3">
+    <unit bldFile="mediasettings/videoplayersettingsengine/group"/>
+   </component>
+  </collection>
+  <collection id="File Details" name="File Details" level="plugin">
+   <component id="filedetailsdialog" name="File Details Dialog" filter="s60" introduced="^3">
+    <unit bldFile="filedetails/filedetailsdialog/group"/>
+   </component>
+  <component id="filedetailsplugin" name="File Details Plugin" filter="s60" introduced="^3">
+    <unit bldFile="filedetails/filedetailsplugin/group"/>
+   </component>
+  </collection>  
+  <collection id="videoplayerapp" name="Video Player App" level="apps">
+   <component id="lwplayer" name="Lw Player" filter="s60" introduced="^3">
+    <unit bldFile="videoplayerapp/lwplayer/group"/>
+   </component>
+   <component id="mpxvideoplayer" name="Mpx Video Player" filter="s60" introduced="^3">
+    <unit bldFile="videoplayerapp/mpxvideoplayer/group"/>
+   </component>
+  </collection>
+  <collection id="videoplayback" name="Video Playback Plugins" level="plugin">
+   <component id="videohelix" name="Video Helix" filter="s60" introduced="^3">
+    <unit bldFile="videoplayback/videohelix/group"/>
+   </component>
+   <component id="videopldplaybackviewplugin" name="Videopld Playback Plugin" filter="s60" introduced="^3">
+    <unit bldFile="videoplayback/videopdlplaybackviewplugin/group"/>
+   </component>   
+   <component id="videoplaybackcontrols" name="Videopld Playback Controls" filter="s60" introduced="^3">
+    <unit bldFile="videoplayback/videoplaybackcontrols/group"/>
+   </component>  
+   <component id="videoplaybackviewplugin" name="Video Playback View Plugin" filter="s60" introduced="^3">
+    <unit bldFile="videoplayback/videoplaybackviewplugin/group"/>
+   </component>   
+   <component id="videoplaybackviews" name="Video Playback Views" filter="s60" introduced="^3">
+    <unit bldFile="videoplayback/videoplaybackviews/group"/>
+   </component>
+  </collection>
+ </package>
+</SystemDefinition>
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/package_map.xml	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,1 @@
+<PackageMap root="sf" layer="app"/>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysdef_1_4_0.dtd	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,86 @@
+ <!ELEMENT SystemDefinition (systemModel?, build?)>
+ <!ATTLIST SystemDefinition
+  name CDATA #REQUIRED
+  schema CDATA #REQUIRED>
+ <!ELEMENT systemModel (layer+)>
+ <!ELEMENT layer (logicalset* | module*)*>
+ <!ATTLIST layer
+  name CDATA #REQUIRED
+  levels CDATA #IMPLIED
+  span CDATA #IMPLIED>
+ <!ELEMENT logicalset (logicalsubset* | module* | unit* | package* | prebuilt*)*>
+ <!ATTLIST logicalset name CDATA #REQUIRED>
+ <!ELEMENT logicalsubset (module* | unit* | package* | prebuilt*)*>
+ <!ATTLIST logicalsubset name CDATA #REQUIRED>
+ <!ELEMENT module (component* | unit* | package* | prebuilt*)*>
+ <!ATTLIST module
+  name CDATA #REQUIRED
+  level CDATA #IMPLIED>
+ <!ELEMENT component (unit* | package* | prebuilt*)*>
+ <!ATTLIST component name CDATA #REQUIRED>
+ <!ELEMENT unit EMPTY>
+ <!ATTLIST unit
+  unitID ID #REQUIRED
+  name CDATA #REQUIRED
+  mrp CDATA #REQUIRED
+  filter CDATA #IMPLIED
+  bldFile CDATA #REQUIRED
+  priority CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT package EMPTY>
+ <!ATTLIST package
+  name CDATA #REQUIRED
+  mrp CDATA #REQUIRED
+  filter CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT prebuilt EMPTY>
+ <!ATTLIST prebuilt
+  name CDATA #REQUIRED
+  version CDATA #REQUIRED
+  late (Y|N) #IMPLIED
+  filter CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT build (option* | target+ | targetList+ | unitList+ | configuration+)*>
+ <!ELEMENT unitList (unitRef+)>
+ <!ATTLIST unitList
+  name ID #REQUIRED
+  description CDATA #REQUIRED>
+ <!ELEMENT unitRef EMPTY>
+ <!ATTLIST unitRef unit IDREF #REQUIRED>
+ <!ELEMENT targetList EMPTY>
+ <!ATTLIST targetList
+  name ID #REQUIRED
+  description CDATA #REQUIRED
+  target IDREFS #REQUIRED>
+ <!ELEMENT target EMPTY>
+ <!ATTLIST target
+  name ID #REQUIRED
+  abldTarget CDATA #REQUIRED
+  description CDATA #REQUIRED>
+ <!ELEMENT option EMPTY>
+ <!ATTLIST option
+  name ID #REQUIRED
+  abldOption CDATA #REQUIRED
+  description CDATA #REQUIRED
+  enable (Y | N | y | n) #REQUIRED>
+ <!ELEMENT configuration (unitListRef+ | layerRef+ | task+)*>
+ <!ATTLIST configuration
+  name ID #REQUIRED
+  description CDATA #REQUIRED
+  filter CDATA #REQUIRED>
+ <!ELEMENT task ( unitListRef* , (buildLayer | specialInstructions))>
+ <!ELEMENT unitListRef EMPTY>
+ <!ATTLIST unitListRef unitList IDREF #REQUIRED>
+ <!ELEMENT layerRef EMPTY>
+ <!ATTLIST layerRef layerName CDATA #REQUIRED>
+ <!ELEMENT buildLayer EMPTY>
+ <!ATTLIST buildLayer
+  command CDATA #REQUIRED
+  targetList IDREFS #IMPLIED
+  unitParallel (Y | N | y | n) #REQUIRED
+  targetParallel (Y | N | y | n) #IMPLIED>
+ <!ELEMENT specialInstructions EMPTY>
+ <!ATTLIST specialInstructions
+  name CDATA #REQUIRED
+  cwd CDATA #REQUIRED
+  command CDATA #REQUIRED>  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/BWINS/VCXTestCommonu.def	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,151 @@
+EXPORTS
+	??0CIptvTestActiveWait@@AAE@XZ @ 1 NONAME ; CIptvTestActiveWait::CIptvTestActiveWait(void)
+	??0CIptvTestEvent@@QAE@ABVTDesC16@@H@Z @ 2 NONAME ; CIptvTestEvent::CIptvTestEvent(class TDesC16 const &, int)
+	??0CIptvTestVideoCreator@@QAE@XZ @ 3 NONAME ; CIptvTestVideoCreator::CIptvTestVideoCreator(void)
+	??0CTestUtilConnectionWaiter@@AAE@PAVMTestUtilConnectionObserver@@@Z @ 4 NONAME ; CTestUtilConnectionWaiter::CTestUtilConnectionWaiter(class MTestUtilConnectionObserver *)
+	??0CVCXTestMessageWait@@AAE@PAVMVCXTestMessageWaitObserver@@@Z @ 5 NONAME ; CVCXTestMessageWait::CVCXTestMessageWait(class MVCXTestMessageWaitObserver *)
+	??1CIptvTestActiveWait@@UAE@XZ @ 6 NONAME ; CIptvTestActiveWait::~CIptvTestActiveWait(void)
+	??1CIptvTestDownloadManager@@UAE@XZ @ 7 NONAME ; CIptvTestDownloadManager::~CIptvTestDownloadManager(void)
+	??1CIptvTestEvent@@UAE@XZ @ 8 NONAME ; CIptvTestEvent::~CIptvTestEvent(void)
+	??1CIptvTestEventWaiter@@UAE@XZ @ 9 NONAME ; CIptvTestEventWaiter::~CIptvTestEventWaiter(void)
+	??1CIptvTestMobilecrashWatcher@@UAE@XZ @ 10 NONAME ; CIptvTestMobilecrashWatcher::~CIptvTestMobilecrashWatcher(void)
+	??1CIptvTestTimer@@UAE@XZ @ 11 NONAME ; CIptvTestTimer::~CIptvTestTimer(void)
+	??1CIptvTestUtilALR@@UAE@XZ @ 12 NONAME ; CIptvTestUtilALR::~CIptvTestUtilALR(void)
+	??1CIptvTestVerifyData@@UAE@XZ @ 13 NONAME ; CIptvTestVerifyData::~CIptvTestVerifyData(void)
+	??1CIptvTestVideoCreator@@UAE@XZ @ 14 NONAME ; CIptvTestVideoCreator::~CIptvTestVideoCreator(void)
+	??1CTestUtilConnection@@UAE@XZ @ 15 NONAME ; CTestUtilConnection::~CTestUtilConnection(void)
+	??1CTestUtilConnectionWaiter@@UAE@XZ @ 16 NONAME ; CTestUtilConnectionWaiter::~CTestUtilConnectionWaiter(void)
+	??1CVCXTestMessageWait@@UAE@XZ @ 17 NONAME ; CVCXTestMessageWait::~CVCXTestMessageWait(void)
+	??1CVCXTestPSSubscriber@@UAE@XZ @ 18 NONAME ; CVCXTestPSSubscriber::~CVCXTestPSSubscriber(void)
+	??1CVCXTestTimerWait@@UAE@XZ @ 19 NONAME ; CVCXTestTimerWait::~CVCXTestTimerWait(void)
+	?ActionEndL@CVCXTestStatsKeeper@@QAEXABVTDesC16@@H@Z @ 20 NONAME ; void CVCXTestStatsKeeper::ActionEndL(class TDesC16 const &, int)
+	?ActionEndL@CVCXTestStatsKeeper@@QAEXJH@Z @ 21 NONAME ; void CVCXTestStatsKeeper::ActionEndL(long, int)
+	?ActionProgressL@CVCXTestStatsKeeper@@QAEXABVTDesC16@@0@Z @ 22 NONAME ; void CVCXTestStatsKeeper::ActionProgressL(class TDesC16 const &, class TDesC16 const &)
+	?ActionProgressL@CVCXTestStatsKeeper@@QAEXJABVTDesC16@@@Z @ 23 NONAME ; void CVCXTestStatsKeeper::ActionProgressL(long, class TDesC16 const &)
+	?ActionStartL@CVCXTestStatsKeeper@@QAEXABVTDesC16@@0H@Z @ 24 NONAME ; void CVCXTestStatsKeeper::ActionStartL(class TDesC16 const &, class TDesC16 const &, int)
+	?ActionStartL@CVCXTestStatsKeeper@@QAEXJABVTDesC16@@@Z @ 25 NONAME ; void CVCXTestStatsKeeper::ActionStartL(long, class TDesC16 const &)
+	?ActionTraceL@CVCXTestStatsKeeper@@QAEXABVTDesC16@@@Z @ 26 NONAME ; void CVCXTestStatsKeeper::ActionTraceL(class TDesC16 const &)
+	?Activate@CIptvTestEvent@@QAEXXZ @ 27 NONAME ; void CIptvTestEvent::Activate(void)
+	?ActiveWait@CIptvTestActiveWait@@QAEXW4TIptvTestActiveWaitCmd@1@@Z @ 28 NONAME ; void CIptvTestActiveWait::ActiveWait(enum CIptvTestActiveWait::TIptvTestActiveWaitCmd)
+	?AddEvent@CIptvTestEventWaiter@@QAEHPAVCIptvTestEvent@@H@Z @ 29 NONAME ; int CIptvTestEventWaiter::AddEvent(class CIptvTestEvent *, int)
+	?AddMessage@CVCXTestMessageWait@@QAEXJ@Z @ 30 NONAME ; void CVCXTestMessageWait::AddMessage(long)
+	?AdvanceSystemTimeHours@CVCXTestCommon@@SAHH@Z @ 31 NONAME ; int CVCXTestCommon::AdvanceSystemTimeHours(int)
+	?AdvanceSystemTimeMinutes@CVCXTestCommon@@SAHH@Z @ 32 NONAME ; int CVCXTestCommon::AdvanceSystemTimeMinutes(int)
+	?AdvanceSystemTimeSeconds@CVCXTestCommon@@SAHH@Z @ 33 NONAME ; int CVCXTestCommon::AdvanceSystemTimeSeconds(int)
+	?After@CIptvTestTimer@@QAEXVTTimeIntervalMicroSeconds32@@@Z @ 34 NONAME ; void CIptvTestTimer::After(class TTimeIntervalMicroSeconds32)
+	?AttachL@CTestUtilConnection@@QAEXXZ @ 35 NONAME ; void CTestUtilConnection::AttachL(void)
+	?CancelTimer@CIptvTestTimer@@QAEXXZ @ 36 NONAME ; void CIptvTestTimer::CancelTimer(void)
+	?CheckNewCrashesL@CIptvTestMobilecrashWatcher@@QAEXXZ @ 37 NONAME ; void CIptvTestMobilecrashWatcher::CheckNewCrashesL(void)
+	?CheckTimeouts@CIptvTestEventWaiter@@QAEHXZ @ 38 NONAME ; int CIptvTestEventWaiter::CheckTimeouts(void)
+	?CompareMobilecrashesL@CIptvTestMobilecrashWatcher@@QAEHAAV?$RPointerArray@VHBufC16@@@@0@Z @ 39 NONAME ; int CIptvTestMobilecrashWatcher::CompareMobilecrashesL(class RPointerArray<class HBufC16> &, class RPointerArray<class HBufC16> &)
+	?ConnectL@CTestUtilConnection@@QAEXXZ @ 40 NONAME ; void CTestUtilConnection::ConnectL(void)
+	?ConstructL@CIptvTestActiveWait@@AAEXXZ @ 41 NONAME ; void CIptvTestActiveWait::ConstructL(void)
+	?ConstructL@CIptvTestDownloadManager@@AAEXXZ @ 42 NONAME ; void CIptvTestDownloadManager::ConstructL(void)
+	?ConstructL@CIptvTestVideoCreator@@AAEXXZ @ 43 NONAME ; void CIptvTestVideoCreator::ConstructL(void)
+	?ConstructL@CVCXTestMessageWait@@AAEXXZ @ 44 NONAME ; void CVCXTestMessageWait::ConstructL(void)
+	?ConstructL@CVCXTestTimerWait@@AAEXXZ @ 45 NONAME ; void CVCXTestTimerWait::ConstructL(void)
+	?CoolDownL@CVCXTestMessageWait@@QAEXH@Z @ 46 NONAME ; void CVCXTestMessageWait::CoolDownL(int)
+	?CopyMethodL@CIptvTestUtilALR@@QAEXAAVTDesC16@@00@Z @ 47 NONAME ; void CIptvTestUtilALR::CopyMethodL(class TDesC16 &, class TDesC16 &, class TDesC16 &)
+	?CreateBadIapL@CVCXTestCommon@@QAEKAAVTDesC16@@@Z @ 48 NONAME ; unsigned long CVCXTestCommon::CreateBadIapL(class TDesC16 &)
+	?CreateDestinationL@CIptvTestUtilALR@@QAEXAAVTDesC16@@@Z @ 49 NONAME ; void CIptvTestUtilALR::CreateDestinationL(class TDesC16 &)
+	?CreateVerifyData@CVCXTestCommon@@QAEHAAVTDesC16@@H@Z @ 50 NONAME ; int CVCXTestCommon::CreateVerifyData(class TDesC16 &, int)
+	?CreateVerifyDataL@CIptvTestVerifyData@@QAEHAAVTDesC16@@H@Z @ 51 NONAME ; int CIptvTestVerifyData::CreateVerifyDataL(class TDesC16 &, int)
+	?CreateVideoFileL@CVCXTestCommon@@QAEXW4TIptvTestVideoType@CIptvTestVideoCreator@@AAVTDesC16@@H@Z @ 52 NONAME ; void CVCXTestCommon::CreateVideoFileL(enum CIptvTestVideoCreator::TIptvTestVideoType, class TDesC16 &, int)
+	?CreateVideoFilesL@CVCXTestCommon@@QAEXW4TIptvTestVideoType@CIptvTestVideoCreator@@AAVTDesC16@@HAAV?$RPointerArray@VHBufC16@@@@@Z @ 53 NONAME ; void CVCXTestCommon::CreateVideoFilesL(enum CIptvTestVideoCreator::TIptvTestVideoType, class TDesC16 &, int, class RPointerArray<class HBufC16> &)
+	?CreateVideoL@CIptvTestVideoCreator@@QAEXW4TIptvTestVideoType@1@AAVTDesC16@@H@Z @ 54 NONAME ; void CIptvTestVideoCreator::CreateVideoL(enum CIptvTestVideoCreator::TIptvTestVideoType, class TDesC16 &, int)
+	?CreateVideosL@CIptvTestVideoCreator@@QAEXW4TIptvTestVideoType@1@AAVTDesC16@@HAAV?$RPointerArray@VHBufC16@@@@@Z @ 55 NONAME ; void CIptvTestVideoCreator::CreateVideosL(enum CIptvTestVideoCreator::TIptvTestVideoType, class TDesC16 &, int, class RPointerArray<class HBufC16> &)
+	?Deactivate@CIptvTestEvent@@QAEXXZ @ 56 NONAME ; void CIptvTestEvent::Deactivate(void)
+	?DeleteDestinationL@CIptvTestUtilALR@@QAEXAAVTDesC16@@@Z @ 57 NONAME ; void CIptvTestUtilALR::DeleteDestinationL(class TDesC16 &)
+	?DeleteDummyFilesL@CVCXTestCommon@@QAEXH@Z @ 58 NONAME ; void CVCXTestCommon::DeleteDummyFilesL(int)
+	?DeleteMethodL@CIptvTestUtilALR@@QAEXAAVTDesC16@@0@Z @ 59 NONAME ; void CIptvTestUtilALR::DeleteMethodL(class TDesC16 &, class TDesC16 &)
+	?DoCancel@CVCXTestPSSubscriber@@EAEXXZ @ 60 NONAME ; void CVCXTestPSSubscriber::DoCancel(void)
+	?DownloadL@CIptvTestDownloadManager@@QAEHAAVTDesC16@@000JH@Z @ 61 NONAME ; int CIptvTestDownloadManager::DownloadL(class TDesC16 &, class TDesC16 &, class TDesC16 &, class TDesC16 &, long, int)
+	?EnableTimestamps@CIptvTestVerifyData@@QAEXH@Z @ 62 NONAME ; void CIptvTestVerifyData::EnableTimestamps(int)
+	?EnableVerifyTimestamps@CVCXTestCommon@@QAEXH@Z @ 63 NONAME ; void CVCXTestCommon::EnableVerifyTimestamps(int)
+	?EndWait@CVCXTestPSSubscriber@@QAEXXZ @ 64 NONAME ; void CVCXTestPSSubscriber::EndWait(void)
+	?EnsureFileIsNotInUse@CVCXTestCommon@@QAEHABVTPtrC16@@@Z @ 65 NONAME ; int CVCXTestCommon::EnsureFileIsNotInUse(class TPtrC16 const &)
+	?EventHappened@CIptvTestEventWaiter@@QAEHPAVCIptvTestEvent@@PAPAV2@@Z @ 66 NONAME ; int CIptvTestEventWaiter::EventHappened(class CIptvTestEvent *, class CIptvTestEvent * *)
+	?Get@CVCXTestPSSubscriber@@QAEHAAH@Z @ 67 NONAME ; int CVCXTestPSSubscriber::Get(int &)
+	?Get@CVCXTestPSSubscriber@@QAEHAAVTDes16@@@Z @ 68 NONAME ; int CVCXTestPSSubscriber::Get(class TDes16 &)
+	?GetDestinationIdL@CIptvTestUtilALR@@QAEHAAVTDesC16@@@Z @ 69 NONAME ; int CIptvTestUtilALR::GetDestinationIdL(class TDesC16 &)
+	?GetError@CIptvTestDownloadManager@@QAEXAAVRHttpDownload@@AAJ@Z @ 70 NONAME ; void CIptvTestDownloadManager::GetError(class RHttpDownload &, long &)
+	?GetEventCount@CIptvTestEventWaiter@@QAEHXZ @ 71 NONAME ; int CIptvTestEventWaiter::GetEventCount(void)
+	?GetFileSize@CVCXTestCommon@@QAEHAAVTDesC16@@AAK@Z @ 72 NONAME ; int CVCXTestCommon::GetFileSize(class TDesC16 &, unsigned long &)
+	?GetIapIdByNameL@CVCXTestCommon@@QAEHABVTDesC16@@AAK@Z @ 73 NONAME ; int CVCXTestCommon::GetIapIdByNameL(class TDesC16 const &, unsigned long &)
+	?GetIapIdByTypeL@CVCXTestCommon@@QAEHW4TIptvTestIapType@1@AAKH@Z @ 74 NONAME ; int CVCXTestCommon::GetIapIdByTypeL(enum CVCXTestCommon::TIptvTestIapType, unsigned long &, int)
+	?GetIapIdL@CVCXTestCommon@@QAEHABVTDesC16@@AAK@Z @ 75 NONAME ; int CVCXTestCommon::GetIapIdL(class TDesC16 const &, unsigned long &)
+	?GetIapNameById@CVCXTestCommon@@QAEHAAVTDes16@@K@Z @ 76 NONAME ; int CVCXTestCommon::GetIapNameById(class TDes16 &, unsigned long)
+	?GetName@CIptvTestEvent@@QAEXAAVTDes16@@@Z @ 77 NONAME ; void CIptvTestEvent::GetName(class TDes16 &)
+	?GetPSProperty@CVCXTestCommon@@SAHVTUid@@IAAH@Z @ 78 NONAME ; int CVCXTestCommon::GetPSProperty(class TUid, unsigned int, int &)
+	?GetPSProperty@CVCXTestCommon@@SAHVTUid@@IAAVTDes16@@@Z @ 79 NONAME ; int CVCXTestCommon::GetPSProperty(class TUid, unsigned int, class TDes16 &)
+	?GetState@CTestUtilConnection@@QAE?AW4TConnectionState@1@XZ @ 80 NONAME ; enum CTestUtilConnection::TConnectionState CTestUtilConnection::GetState(void)
+	?GetVideoFile@CIptvTestVideoCreator@@AAEXAAVTDes16@@W4TIptvTestVideoType@1@ABVTDesC16@@@Z @ 81 NONAME ; void CIptvTestVideoCreator::GetVideoFile(class TDes16 &, enum CIptvTestVideoCreator::TIptvTestVideoType, class TDesC16 const &)
+	?HasTimeouted@CIptvTestEvent@@QAEHAAVTTime@@@Z @ 82 NONAME ; int CIptvTestEvent::HasTimeouted(class TTime &)
+	?IsConnectionActive@CTestUtilConnectionWaiter@@QAEHK@Z @ 83 NONAME ; int CTestUtilConnectionWaiter::IsConnectionActive(unsigned long)
+	?IsWaiting@CIptvTestActiveWait@@QAEHXZ @ 84 NONAME ; int CIptvTestActiveWait::IsWaiting(void)
+	?ListDir@CVCXTestCommon@@QAEHABVTDesC16@@H@Z @ 85 NONAME ; int CVCXTestCommon::ListDir(class TDesC16 const &, int)
+	?NewL@CIptvTestActiveWait@@SAPAV1@XZ @ 86 NONAME ; class CIptvTestActiveWait * CIptvTestActiveWait::NewL(void)
+	?NewL@CIptvTestDownloadManager@@SAPAV1@PAVMTestUtilDownloadObserver@@@Z @ 87 NONAME ; class CIptvTestDownloadManager * CIptvTestDownloadManager::NewL(class MTestUtilDownloadObserver *)
+	?NewL@CIptvTestEventWaiter@@SAPAV1@AAVMIptvTestEventWaiterObserver@@@Z @ 88 NONAME ; class CIptvTestEventWaiter * CIptvTestEventWaiter::NewL(class MIptvTestEventWaiterObserver &)
+	?NewL@CIptvTestMobilecrashWatcher@@SAPAV1@H@Z @ 89 NONAME ; class CIptvTestMobilecrashWatcher * CIptvTestMobilecrashWatcher::NewL(int)
+	?NewL@CIptvTestMobilecrashWatcher@@SAPAV1@XZ @ 90 NONAME ; class CIptvTestMobilecrashWatcher * CIptvTestMobilecrashWatcher::NewL(void)
+	?NewL@CIptvTestTimer@@SAPAV1@AAVMIptvTestTimerObserver@@H@Z @ 91 NONAME ; class CIptvTestTimer * CIptvTestTimer::NewL(class MIptvTestTimerObserver &, int)
+	?NewL@CIptvTestUtilALR@@SAPAV1@XZ @ 92 NONAME ; class CIptvTestUtilALR * CIptvTestUtilALR::NewL(void)
+	?NewL@CIptvTestVerifyData@@SAPAV1@XZ @ 93 NONAME ; class CIptvTestVerifyData * CIptvTestVerifyData::NewL(void)
+	?NewL@CIptvTestVideoCreator@@SAPAV1@XZ @ 94 NONAME ; class CIptvTestVideoCreator * CIptvTestVideoCreator::NewL(void)
+	?NewL@CTestUtilConnection@@SAPAV1@PAVMTestUtilConnectionObserver@@@Z @ 95 NONAME ; class CTestUtilConnection * CTestUtilConnection::NewL(class MTestUtilConnectionObserver *)
+	?NewL@CTestUtilConnectionWaiter@@SAPAV1@PAVMTestUtilConnectionObserver@@@Z @ 96 NONAME ; class CTestUtilConnectionWaiter * CTestUtilConnectionWaiter::NewL(class MTestUtilConnectionObserver *)
+	?NewL@CVCXTestCommon@@SAPAV1@XZ @ 97 NONAME ; class CVCXTestCommon * CVCXTestCommon::NewL(void)
+	?NewL@CVCXTestMessageWait@@SAPAV1@PAVMVCXTestMessageWaitObserver@@@Z @ 98 NONAME ; class CVCXTestMessageWait * CVCXTestMessageWait::NewL(class MVCXTestMessageWaitObserver *)
+	?NewL@CVCXTestPSSubscriber@@SAPAV1@VTUid@@KW4TType@RProperty@@PAVMVCXTestPSObserver@@@Z @ 99 NONAME ; class CVCXTestPSSubscriber * CVCXTestPSSubscriber::NewL(class TUid, unsigned long, enum RProperty::TType, class MVCXTestPSObserver *)
+	?NewL@CVCXTestStatsKeeper@@SAPAV1@XZ @ 100 NONAME ; class CVCXTestStatsKeeper * CVCXTestStatsKeeper::NewL(void)
+	?NewL@CVCXTestTimerWait@@SAPAV1@XZ @ 101 NONAME ; class CVCXTestTimerWait * CVCXTestTimerWait::NewL(void)
+	?NewLC@CIptvTestDownloadManager@@SAPAV1@PAVMTestUtilDownloadObserver@@@Z @ 102 NONAME ; class CIptvTestDownloadManager * CIptvTestDownloadManager::NewLC(class MTestUtilDownloadObserver *)
+	?NewLC@CIptvTestUtilALR@@SAPAV1@XZ @ 103 NONAME ; class CIptvTestUtilALR * CIptvTestUtilALR::NewLC(void)
+	?NewLC@CTestUtilConnection@@SAPAV1@PAVMTestUtilConnectionObserver@@@Z @ 104 NONAME ; class CTestUtilConnection * CTestUtilConnection::NewLC(class MTestUtilConnectionObserver *)
+	?NewLC@CTestUtilConnectionWaiter@@SAPAV1@PAVMTestUtilConnectionObserver@@@Z @ 105 NONAME ; class CTestUtilConnectionWaiter * CTestUtilConnectionWaiter::NewLC(class MTestUtilConnectionObserver *)
+	?ParseIntFromString@CVCXTestCommon@@SAHAAHAAVTDesC16@@@Z @ 106 NONAME ; int CVCXTestCommon::ParseIntFromString(int &, class TDesC16 &)
+	?PrintIaps@CVCXTestCommon@@QAEXXZ @ 107 NONAME ; void CVCXTestCommon::PrintIaps(void)
+	?ReadMobilecrashesL@CIptvTestMobilecrashWatcher@@QAEXAAV?$RPointerArray@VHBufC16@@@@ABVTDesC16@@@Z @ 108 NONAME ; void CIptvTestMobilecrashWatcher::ReadMobilecrashesL(class RPointerArray<class HBufC16> &, class TDesC16 const &)
+	?ReceiveMessage@CVCXTestMessageWait@@QAEXJH@Z @ 109 NONAME ; void CVCXTestMessageWait::ReceiveMessage(long, int)
+	?RemoveUsedDestinationCenRepL@CIptvTestUtilALR@@QAEXXZ @ 110 NONAME ; void CIptvTestUtilALR::RemoveUsedDestinationCenRepL(void)
+	?Reset@CIptvTestEventWaiter@@QAEHXZ @ 111 NONAME ; int CIptvTestEventWaiter::Reset(void)
+	?Reset@CVCXTestMessageWait@@QAEXXZ @ 112 NONAME ; void CVCXTestMessageWait::Reset(void)
+	?ResetReceivedMessages@CVCXTestMessageWait@@QAEXXZ @ 113 NONAME ; void CVCXTestMessageWait::ResetReceivedMessages(void)
+	?ReturnMobileCrashCount@CIptvTestMobilecrashWatcher@@QAEHXZ @ 114 NONAME ; int CIptvTestMobilecrashWatcher::ReturnMobileCrashCount(void)
+	?ReturnNewCrashes@CIptvTestMobilecrashWatcher@@QAEHAAV?$RPointerArray@VHBufC16@@@@@Z @ 115 NONAME ; int CIptvTestMobilecrashWatcher::ReturnNewCrashes(class RPointerArray<class HBufC16> &)
+	?Set@CVCXTestPSSubscriber@@QAEHAAH@Z @ 116 NONAME ; int CVCXTestPSSubscriber::Set(int &)
+	?Set@CVCXTestPSSubscriber@@QAEHABVTDesC16@@@Z @ 117 NONAME ; int CVCXTestPSSubscriber::Set(class TDesC16 const &)
+	?SetConnectionPreferences@CTestUtilConnection@@QAEXIK@Z @ 118 NONAME ; void CTestUtilConnection::SetConnectionPreferences(unsigned int, unsigned long)
+	?SetDriveFreeSpaceL@CVCXTestCommon@@QAEXHI@Z @ 119 NONAME ; void CVCXTestCommon::SetDriveFreeSpaceL(int, unsigned int)
+	?SetMethodBoolAttributeL@CIptvTestUtilALR@@QAEXAAVTDesC16@@0HH@Z @ 120 NONAME ; void CIptvTestUtilALR::SetMethodBoolAttributeL(class TDesC16 &, class TDesC16 &, int, int)
+	?SetMethodIntAttributeL@CIptvTestUtilALR@@QAEXAAVTDesC16@@0HH@Z @ 121 NONAME ; void CIptvTestUtilALR::SetMethodIntAttributeL(class TDesC16 &, class TDesC16 &, int, int)
+	?SetMethodPriorityL@CIptvTestUtilALR@@QAEXAAVTDesC16@@0K@Z @ 122 NONAME ; void CIptvTestUtilALR::SetMethodPriorityL(class TDesC16 &, class TDesC16 &, unsigned long)
+	?SetMethodStringAttributeL@CIptvTestUtilALR@@QAEXAAVTDesC16@@0H0@Z @ 123 NONAME ; void CIptvTestUtilALR::SetMethodStringAttributeL(class TDesC16 &, class TDesC16 &, int, class TDesC16 &)
+	?SetPSProperty@CVCXTestCommon@@SAHVTUid@@IABVTDesC16@@@Z @ 124 NONAME ; int CVCXTestCommon::SetPSProperty(class TUid, unsigned int, class TDesC16 const &)
+	?SetPSProperty@CVCXTestCommon@@SAHVTUid@@IH@Z @ 125 NONAME ; int CVCXTestCommon::SetPSProperty(class TUid, unsigned int, int)
+	?SetSystemTime@CVCXTestCommon@@SAHVTTime@@@Z @ 126 NONAME ; int CVCXTestCommon::SetSystemTime(class TTime)
+	?SetTimeZone@CVCXTestCommon@@SAHAAVTDesC16@@@Z @ 127 NONAME ; int CVCXTestCommon::SetTimeZone(class TDesC16 &)
+	?SetUsedDestinationL@CIptvTestUtilALR@@QAEXAAVTDesC16@@@Z @ 128 NONAME ; void CIptvTestUtilALR::SetUsedDestinationL(class TDesC16 &)
+	?Start@CIptvTestActiveWait@@QAEHXZ @ 129 NONAME ; int CIptvTestActiveWait::Start(void)
+	?Start@CVCXTestPSSubscriber@@QAEXXZ @ 130 NONAME ; void CVCXTestPSSubscriber::Start(void)
+	?StartStatsKeepingL@CVCXTestStatsKeeper@@QAEXABVTDesC16@@0@Z @ 131 NONAME ; void CVCXTestStatsKeeper::StartStatsKeepingL(class TDesC16 const &, class TDesC16 const &)
+	?Stop@CIptvTestActiveWait@@QAEHXZ @ 132 NONAME ; int CIptvTestActiveWait::Stop(void)
+	?TerminateConnectionL@CTestUtilConnection@@QAEXXZ @ 133 NONAME ; void CTestUtilConnection::TerminateConnectionL(void)
+	?TerminateDestinationConnectionsL@CIptvTestUtilALR@@QAEXAAVTDesC16@@@Z @ 134 NONAME ; void CIptvTestUtilALR::TerminateDestinationConnectionsL(class TDesC16 &)
+	?VerifyData@CVCXTestCommon@@QAEHAAVTDesC16@@AAW4TVerifyResult@CIptvTestVerifyData@@@Z @ 135 NONAME ; int CVCXTestCommon::VerifyData(class TDesC16 &, enum CIptvTestVerifyData::TVerifyResult &)
+	?VerifyDataL@CIptvTestVerifyData@@QAEHAAVTDesC16@@AAW4TVerifyResult@1@@Z @ 136 NONAME ; int CIptvTestVerifyData::VerifyDataL(class TDesC16 &, enum CIptvTestVerifyData::TVerifyResult &)
+	?WaitChangeL@CVCXTestPSSubscriber@@QAEXXZ @ 137 NONAME ; void CVCXTestPSSubscriber::WaitChangeL(void)
+	?WaitForAllL@CVCXTestMessageWait@@QAEXHH@Z @ 138 NONAME ; void CVCXTestMessageWait::WaitForAllL(int, int)
+	?WaitForConnection@CTestUtilConnectionWaiter@@QAEXK@Z @ 139 NONAME ; void CTestUtilConnectionWaiter::WaitForConnection(unsigned long)
+	?WaitForMessageL@CVCXTestMessageWait@@QAEXJHH@Z @ 140 NONAME ; void CVCXTestMessageWait::WaitForMessageL(long, int, int)
+	?WaitL@CVCXTestTimerWait@@QAEXK@Z @ 141 NONAME ; void CVCXTestTimerWait::WaitL(unsigned long)
+	?WaitUntilConnectionIsClosed@CTestUtilConnectionWaiter@@QAEXK@Z @ 142 NONAME ; void CTestUtilConnectionWaiter::WaitUntilConnectionIsClosed(unsigned long)
+	?WriteVerifyData@CVCXTestCommon@@QAAHAAVTDesC16@@V?$TRefByValue@$$CBVTDesC16@@@@ZZ @ 143 NONAME ; int CVCXTestCommon::WriteVerifyData(class TDesC16 &, class TRefByValue<class TDesC16 const >, ...)
+	?WriteVerifyData@CVCXTestCommon@@QAEHAAVTDesC16@@0@Z @ 144 NONAME ; int CVCXTestCommon::WriteVerifyData(class TDesC16 &, class TDesC16 &)
+	?WriteVerifyDataL@CIptvTestVerifyData@@QAEHAAVTDesC16@@0@Z @ 145 NONAME ; int CIptvTestVerifyData::WriteVerifyDataL(class TDesC16 &, class TDesC16 &)
+	?ListFilesProcessesAndThreadsL@CVCXTestCommon@@SAXAAVRFs@@@Z @ 146 NONAME ; void CVCXTestCommon::ListFilesProcessesAndThreadsL(class RFs &)
+	?GetDefaultIap@CIptvTestUtilALR@@QAEKXZ @ 147 NONAME ; unsigned long CIptvTestUtilALR::GetDefaultIap(void)
+	?SetDefaultIapCenRep@CIptvTestUtilALR@@QAEHXZ @ 148 NONAME ; int CIptvTestUtilALR::SetDefaultIapCenRep(void)
+	?GetDefaultIapCenRep@CIptvTestUtilALR@@QAEKXZ @ 149 NONAME ; unsigned long CIptvTestUtilALR::GetDefaultIapCenRep(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/EABI/VCXTestCommonu.def	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,220 @@
+EXPORTS
+	_ZN14CIptvTestEvent10DeactivateEv @ 1 NONAME
+	_ZN14CIptvTestEvent12HasTimeoutedER5TTime @ 2 NONAME
+	_ZN14CIptvTestEvent7GetNameER6TDes16 @ 3 NONAME
+	_ZN14CIptvTestEvent8ActivateEv @ 4 NONAME
+	_ZN14CIptvTestEventC2ERK7TDesC16i @ 5 NONAME
+	_ZN14CIptvTestEventD0Ev @ 6 NONAME
+	_ZN14CIptvTestEventD1Ev @ 7 NONAME
+	_ZN14CIptvTestEventD2Ev @ 8 NONAME
+	_ZN14CIptvTestTimer11CancelTimerEv @ 9 NONAME
+	_ZN14CIptvTestTimer4NewLER22MIptvTestTimerObserveri @ 10 NONAME
+	_ZN14CIptvTestTimer5AfterE27TTimeIntervalMicroSeconds32 @ 11 NONAME
+	_ZN14CIptvTestTimerD0Ev @ 12 NONAME
+	_ZN14CIptvTestTimerD1Ev @ 13 NONAME
+	_ZN14CIptvTestTimerD2Ev @ 14 NONAME
+	_ZN14CVCXTestCommon10VerifyDataER7TDesC16RN19CIptvTestVerifyData13TVerifyResultE @ 15 NONAME
+	_ZN14CVCXTestCommon11GetFileSizeER7TDesC16Rm @ 16 NONAME
+	_ZN14CVCXTestCommon11SetTimeZoneER7TDesC16 @ 17 NONAME
+	_ZN14CVCXTestCommon13CreateBadIapLER7TDesC16 @ 18 NONAME
+	_ZN14CVCXTestCommon13GetPSPropertyE4TUidjR6TDes16 @ 19 NONAME
+	_ZN14CVCXTestCommon13GetPSPropertyE4TUidjRi @ 20 NONAME
+	_ZN14CVCXTestCommon13SetPSPropertyE4TUidjRK7TDesC16 @ 21 NONAME
+	_ZN14CVCXTestCommon13SetPSPropertyE4TUidji @ 22 NONAME
+	_ZN14CVCXTestCommon13SetSystemTimeE5TTime @ 23 NONAME
+	_ZN14CVCXTestCommon14GetIapNameByIdER6TDes16m @ 24 NONAME
+	_ZN14CVCXTestCommon15GetIapIdByNameLERK7TDesC16Rm @ 25 NONAME
+	_ZN14CVCXTestCommon15GetIapIdByTypeLENS_16TIptvTestIapTypeERmi @ 26 NONAME
+	_ZN14CVCXTestCommon15WriteVerifyDataER7TDesC1611TRefByValueIKS0_Ez @ 27 NONAME
+	_ZN14CVCXTestCommon15WriteVerifyDataER7TDesC16S1_ @ 28 NONAME
+	_ZN14CVCXTestCommon16CreateVerifyDataER7TDesC16i @ 29 NONAME
+	_ZN14CVCXTestCommon16CreateVideoFileLEN21CIptvTestVideoCreator18TIptvTestVideoTypeER7TDesC16i @ 30 NONAME
+	_ZN14CVCXTestCommon17CreateVideoFilesLEN21CIptvTestVideoCreator18TIptvTestVideoTypeER7TDesC16iR13RPointerArrayI7HBufC16E @ 31 NONAME
+	_ZN14CVCXTestCommon17DeleteDummyFilesLEi @ 32 NONAME
+	_ZN14CVCXTestCommon18ParseIntFromStringERiR7TDesC16 @ 33 NONAME
+	_ZN14CVCXTestCommon18SetDriveFreeSpaceLEij @ 34 NONAME
+	_ZN14CVCXTestCommon20EnsureFileIsNotInUseERK7TPtrC16 @ 35 NONAME
+	_ZN14CVCXTestCommon22AdvanceSystemTimeHoursEi @ 36 NONAME
+	_ZN14CVCXTestCommon22EnableVerifyTimestampsEi @ 37 NONAME
+	_ZN14CVCXTestCommon24AdvanceSystemTimeMinutesEi @ 38 NONAME
+	_ZN14CVCXTestCommon24AdvanceSystemTimeSecondsEi @ 39 NONAME
+	_ZN14CVCXTestCommon29ListFilesProcessesAndThreadsLER3RFs @ 40 NONAME
+	_ZN14CVCXTestCommon4NewLEv @ 41 NONAME
+	_ZN14CVCXTestCommon7ListDirERK7TDesC16i @ 42 NONAME
+	_ZN14CVCXTestCommon9GetIapIdLERK7TDesC16Rm @ 43 NONAME
+	_ZN14CVCXTestCommon9PrintIapsEv @ 44 NONAME
+	_ZN16CIptvTestUtilALR11CopyMethodLER7TDesC16S1_S1_ @ 45 NONAME
+	_ZN16CIptvTestUtilALR13DeleteMethodLER7TDesC16S1_ @ 46 NONAME
+	_ZN16CIptvTestUtilALR13GetDefaultIapEv @ 47 NONAME
+	_ZN16CIptvTestUtilALR17GetDestinationIdLER7TDesC16 @ 48 NONAME
+	_ZN16CIptvTestUtilALR18CreateDestinationLER7TDesC16 @ 49 NONAME
+	_ZN16CIptvTestUtilALR18DeleteDestinationLER7TDesC16 @ 50 NONAME
+	_ZN16CIptvTestUtilALR18SetMethodPriorityLER7TDesC16S1_m @ 51 NONAME
+	_ZN16CIptvTestUtilALR19SetUsedDestinationLER7TDesC16 @ 52 NONAME
+	_ZN16CIptvTestUtilALR22SetMethodIntAttributeLER7TDesC16S1_ii @ 53 NONAME
+	_ZN16CIptvTestUtilALR23SetMethodBoolAttributeLER7TDesC16S1_ii @ 54 NONAME
+	_ZN16CIptvTestUtilALR25SetMethodStringAttributeLER7TDesC16S1_iS1_ @ 55 NONAME
+	_ZN16CIptvTestUtilALR28RemoveUsedDestinationCenRepLEv @ 56 NONAME
+	_ZN16CIptvTestUtilALR32TerminateDestinationConnectionsLER7TDesC16 @ 57 NONAME
+	_ZN16CIptvTestUtilALR4NewLEv @ 58 NONAME
+	_ZN16CIptvTestUtilALR5NewLCEv @ 59 NONAME
+	_ZN16CIptvTestUtilALRD0Ev @ 60 NONAME
+	_ZN16CIptvTestUtilALRD1Ev @ 61 NONAME
+	_ZN16CIptvTestUtilALRD2Ev @ 62 NONAME
+	_ZN17CVCXTestTimerWait10ConstructLEv @ 63 NONAME
+	_ZN17CVCXTestTimerWait4NewLEv @ 64 NONAME
+	_ZN17CVCXTestTimerWait5WaitLEm @ 65 NONAME
+	_ZN17CVCXTestTimerWaitD0Ev @ 66 NONAME
+	_ZN17CVCXTestTimerWaitD1Ev @ 67 NONAME
+	_ZN17CVCXTestTimerWaitD2Ev @ 68 NONAME
+	_ZN19CIptvTestActiveWait10ActiveWaitENS_22TIptvTestActiveWaitCmdE @ 69 NONAME
+	_ZN19CIptvTestActiveWait10ConstructLEv @ 70 NONAME
+	_ZN19CIptvTestActiveWait4NewLEv @ 71 NONAME
+	_ZN19CIptvTestActiveWait4StopEv @ 72 NONAME
+	_ZN19CIptvTestActiveWait5StartEv @ 73 NONAME
+	_ZN19CIptvTestActiveWait9IsWaitingEv @ 74 NONAME
+	_ZN19CIptvTestActiveWaitC1Ev @ 75 NONAME
+	_ZN19CIptvTestActiveWaitC2Ev @ 76 NONAME
+	_ZN19CIptvTestActiveWaitD0Ev @ 77 NONAME
+	_ZN19CIptvTestActiveWaitD1Ev @ 78 NONAME
+	_ZN19CIptvTestActiveWaitD2Ev @ 79 NONAME
+	_ZN19CIptvTestVerifyData11VerifyDataLER7TDesC16RNS_13TVerifyResultE @ 80 NONAME
+	_ZN19CIptvTestVerifyData16EnableTimestampsEi @ 81 NONAME
+	_ZN19CIptvTestVerifyData16WriteVerifyDataLER7TDesC16S1_ @ 82 NONAME
+	_ZN19CIptvTestVerifyData17CreateVerifyDataLER7TDesC16i @ 83 NONAME
+	_ZN19CIptvTestVerifyData4NewLEv @ 84 NONAME
+	_ZN19CIptvTestVerifyDataD0Ev @ 85 NONAME
+	_ZN19CIptvTestVerifyDataD1Ev @ 86 NONAME
+	_ZN19CIptvTestVerifyDataD2Ev @ 87 NONAME
+	_ZN19CTestUtilConnection20TerminateConnectionLEv @ 88 NONAME
+	_ZN19CTestUtilConnection24SetConnectionPreferencesEjm @ 89 NONAME
+	_ZN19CTestUtilConnection4NewLEP27MTestUtilConnectionObserver @ 90 NONAME
+	_ZN19CTestUtilConnection5NewLCEP27MTestUtilConnectionObserver @ 91 NONAME
+	_ZN19CTestUtilConnection7AttachLEv @ 92 NONAME
+	_ZN19CTestUtilConnection8ConnectLEv @ 93 NONAME
+	_ZN19CTestUtilConnectionD0Ev @ 94 NONAME
+	_ZN19CTestUtilConnectionD1Ev @ 95 NONAME
+	_ZN19CTestUtilConnectionD2Ev @ 96 NONAME
+	_ZN19CVCXTestMessageWait10AddMessageEl @ 97 NONAME
+	_ZN19CVCXTestMessageWait10ConstructLEv @ 98 NONAME
+	_ZN19CVCXTestMessageWait11WaitForAllLEii @ 99 NONAME
+	_ZN19CVCXTestMessageWait14ReceiveMessageEli @ 100 NONAME
+	_ZN19CVCXTestMessageWait15WaitForMessageLElii @ 101 NONAME
+	_ZN19CVCXTestMessageWait21ResetReceivedMessagesEv @ 102 NONAME
+	_ZN19CVCXTestMessageWait4NewLEP27MVCXTestMessageWaitObserver @ 103 NONAME
+	_ZN19CVCXTestMessageWait5ResetEv @ 104 NONAME
+	_ZN19CVCXTestMessageWait9CoolDownLEi @ 105 NONAME
+	_ZN19CVCXTestMessageWaitC1EP27MVCXTestMessageWaitObserver @ 106 NONAME
+	_ZN19CVCXTestMessageWaitC2EP27MVCXTestMessageWaitObserver @ 107 NONAME
+	_ZN19CVCXTestMessageWaitD0Ev @ 108 NONAME
+	_ZN19CVCXTestMessageWaitD1Ev @ 109 NONAME
+	_ZN19CVCXTestMessageWaitD2Ev @ 110 NONAME
+	_ZN19CVCXTestStatsKeeper10ActionEndLERK7TDesC16i @ 111 NONAME
+	_ZN19CVCXTestStatsKeeper10ActionEndLEli @ 112 NONAME
+	_ZN19CVCXTestStatsKeeper12ActionStartLERK7TDesC16S2_i @ 113 NONAME
+	_ZN19CVCXTestStatsKeeper12ActionStartLElRK7TDesC16 @ 114 NONAME
+	_ZN19CVCXTestStatsKeeper12ActionTraceLERK7TDesC16 @ 115 NONAME
+	_ZN19CVCXTestStatsKeeper15ActionProgressLERK7TDesC16S2_ @ 116 NONAME
+	_ZN19CVCXTestStatsKeeper15ActionProgressLElRK7TDesC16 @ 117 NONAME
+	_ZN19CVCXTestStatsKeeper18StartStatsKeepingLERK7TDesC16S2_ @ 118 NONAME
+	_ZN19CVCXTestStatsKeeper4NewLEv @ 119 NONAME
+	_ZN20CIptvTestEventWaiter13CheckTimeoutsEv @ 120 NONAME
+	_ZN20CIptvTestEventWaiter13EventHappenedEP14CIptvTestEventPS1_ @ 121 NONAME
+	_ZN20CIptvTestEventWaiter13GetEventCountEv @ 122 NONAME
+	_ZN20CIptvTestEventWaiter4NewLER28MIptvTestEventWaiterObserver @ 123 NONAME
+	_ZN20CIptvTestEventWaiter5ResetEv @ 124 NONAME
+	_ZN20CIptvTestEventWaiter8AddEventEP14CIptvTestEventi @ 125 NONAME
+	_ZN20CIptvTestEventWaiterD0Ev @ 126 NONAME
+	_ZN20CIptvTestEventWaiterD1Ev @ 127 NONAME
+	_ZN20CIptvTestEventWaiterD2Ev @ 128 NONAME
+	_ZN20CVCXTestPSSubscriber11WaitChangeLEv @ 129 NONAME
+	_ZN20CVCXTestPSSubscriber3GetER6TDes16 @ 130 NONAME
+	_ZN20CVCXTestPSSubscriber3GetERi @ 131 NONAME
+	_ZN20CVCXTestPSSubscriber3SetERK7TDesC16 @ 132 NONAME
+	_ZN20CVCXTestPSSubscriber3SetERi @ 133 NONAME
+	_ZN20CVCXTestPSSubscriber4NewLE4TUidmN9RProperty5TTypeEP18MVCXTestPSObserver @ 134 NONAME
+	_ZN20CVCXTestPSSubscriber5StartEv @ 135 NONAME
+	_ZN20CVCXTestPSSubscriber7EndWaitEv @ 136 NONAME
+	_ZN20CVCXTestPSSubscriber8DoCancelEv @ 137 NONAME
+	_ZN20CVCXTestPSSubscriberD0Ev @ 138 NONAME
+	_ZN20CVCXTestPSSubscriberD1Ev @ 139 NONAME
+	_ZN20CVCXTestPSSubscriberD2Ev @ 140 NONAME
+	_ZN21CIptvTestVideoCreator10ConstructLEv @ 141 NONAME
+	_ZN21CIptvTestVideoCreator12CreateVideoLENS_18TIptvTestVideoTypeER7TDesC16i @ 142 NONAME
+	_ZN21CIptvTestVideoCreator12GetVideoFileER6TDes16NS_18TIptvTestVideoTypeERK7TDesC16 @ 143 NONAME
+	_ZN21CIptvTestVideoCreator13CreateVideosLENS_18TIptvTestVideoTypeER7TDesC16iR13RPointerArrayI7HBufC16E @ 144 NONAME
+	_ZN21CIptvTestVideoCreator4NewLEv @ 145 NONAME
+	_ZN21CIptvTestVideoCreatorC1Ev @ 146 NONAME
+	_ZN21CIptvTestVideoCreatorC2Ev @ 147 NONAME
+	_ZN21CIptvTestVideoCreatorD0Ev @ 148 NONAME
+	_ZN21CIptvTestVideoCreatorD1Ev @ 149 NONAME
+	_ZN21CIptvTestVideoCreatorD2Ev @ 150 NONAME
+	_ZN24CIptvTestDownloadManager10ConstructLEv @ 151 NONAME
+	_ZN24CIptvTestDownloadManager4NewLEP25MTestUtilDownloadObserver @ 152 NONAME
+	_ZN24CIptvTestDownloadManager5NewLCEP25MTestUtilDownloadObserver @ 153 NONAME
+	_ZN24CIptvTestDownloadManager8GetErrorER13RHttpDownloadRl @ 154 NONAME
+	_ZN24CIptvTestDownloadManager9DownloadLER7TDesC16S1_S1_S1_li @ 155 NONAME
+	_ZN24CIptvTestDownloadManagerD0Ev @ 156 NONAME
+	_ZN24CIptvTestDownloadManagerD1Ev @ 157 NONAME
+	_ZN24CIptvTestDownloadManagerD2Ev @ 158 NONAME
+	_ZN25CTestUtilConnectionWaiter17WaitForConnectionEm @ 159 NONAME
+	_ZN25CTestUtilConnectionWaiter18IsConnectionActiveEm @ 160 NONAME
+	_ZN25CTestUtilConnectionWaiter27WaitUntilConnectionIsClosedEm @ 161 NONAME
+	_ZN25CTestUtilConnectionWaiter4NewLEP27MTestUtilConnectionObserver @ 162 NONAME
+	_ZN25CTestUtilConnectionWaiter5NewLCEP27MTestUtilConnectionObserver @ 163 NONAME
+	_ZN25CTestUtilConnectionWaiterC1EP27MTestUtilConnectionObserver @ 164 NONAME
+	_ZN25CTestUtilConnectionWaiterC2EP27MTestUtilConnectionObserver @ 165 NONAME
+	_ZN25CTestUtilConnectionWaiterD0Ev @ 166 NONAME
+	_ZN25CTestUtilConnectionWaiterD1Ev @ 167 NONAME
+	_ZN25CTestUtilConnectionWaiterD2Ev @ 168 NONAME
+	_ZN27CIptvTestMobilecrashWatcher16CheckNewCrashesLEv @ 169 NONAME
+	_ZN27CIptvTestMobilecrashWatcher16ReturnNewCrashesER13RPointerArrayI7HBufC16E @ 170 NONAME
+	_ZN27CIptvTestMobilecrashWatcher18ReadMobilecrashesLER13RPointerArrayI7HBufC16ERK7TDesC16 @ 171 NONAME
+	_ZN27CIptvTestMobilecrashWatcher21CompareMobilecrashesLER13RPointerArrayI7HBufC16ES3_ @ 172 NONAME
+	_ZN27CIptvTestMobilecrashWatcher22ReturnMobileCrashCountEv @ 173 NONAME
+	_ZN27CIptvTestMobilecrashWatcher4NewLEi @ 174 NONAME
+	_ZN27CIptvTestMobilecrashWatcher4NewLEv @ 175 NONAME
+	_ZN27CIptvTestMobilecrashWatcherD0Ev @ 176 NONAME
+	_ZN27CIptvTestMobilecrashWatcherD1Ev @ 177 NONAME
+	_ZN27CIptvTestMobilecrashWatcherD2Ev @ 178 NONAME
+	_ZTI11CVerifyFile @ 179 NONAME
+	_ZTI14CIptvTestEvent @ 180 NONAME
+	_ZTI14CIptvTestTimer @ 181 NONAME
+	_ZTI14CVCXTestCommon @ 182 NONAME
+	_ZTI16CIptvTestUtilALR @ 183 NONAME
+	_ZTI17CVCXTestStatsItem @ 184 NONAME
+	_ZTI17CVCXTestTimerWait @ 185 NONAME
+	_ZTI19CIptvTestActiveWait @ 186 NONAME
+	_ZTI19CIptvTestVerifyData @ 187 NONAME
+	_ZTI19CTestUtilConnection @ 188 NONAME
+	_ZTI19CVCXTestMessageWait @ 189 NONAME
+	_ZTI19CVCXTestStatsKeeper @ 190 NONAME
+	_ZTI20CIptvTestEventWaiter @ 191 NONAME
+	_ZTI20CVCXTestPSSubscriber @ 192 NONAME
+	_ZTI21CIptvTestVideoCreator @ 193 NONAME
+	_ZTI24CIptvTestDownloadManager @ 194 NONAME
+	_ZTI24CVCXTestStatsItemSummary @ 195 NONAME
+	_ZTI25CTestUtilConnectionWaiter @ 196 NONAME
+	_ZTI27CIptvTestMobilecrashWatcher @ 197 NONAME
+	_ZTV11CVerifyFile @ 198 NONAME
+	_ZTV14CIptvTestEvent @ 199 NONAME
+	_ZTV14CIptvTestTimer @ 200 NONAME
+	_ZTV14CVCXTestCommon @ 201 NONAME
+	_ZTV16CIptvTestUtilALR @ 202 NONAME
+	_ZTV17CVCXTestStatsItem @ 203 NONAME
+	_ZTV17CVCXTestTimerWait @ 204 NONAME
+	_ZTV19CIptvTestActiveWait @ 205 NONAME
+	_ZTV19CIptvTestVerifyData @ 206 NONAME
+	_ZTV19CTestUtilConnection @ 207 NONAME
+	_ZTV19CVCXTestMessageWait @ 208 NONAME
+	_ZTV19CVCXTestStatsKeeper @ 209 NONAME
+	_ZTV20CIptvTestEventWaiter @ 210 NONAME
+	_ZTV20CVCXTestPSSubscriber @ 211 NONAME
+	_ZTV21CIptvTestVideoCreator @ 212 NONAME
+	_ZTV24CIptvTestDownloadManager @ 213 NONAME
+	_ZTV24CVCXTestStatsItemSummary @ 214 NONAME
+	_ZTV25CTestUtilConnectionWaiter @ 215 NONAME
+	_ZTV27CIptvTestMobilecrashWatcher @ 216 NONAME
+	_ZN16CIptvTestUtilALR19GetDefaultIapCenRepEv @ 217 NONAME
+	_ZN16CIptvTestUtilALR19SetDefaultIapCenRepEv @ 218 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/conf/VCXTestCommon.cfg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,4 @@
+
+[Test]
+title No tests for this module.
+[Endtest]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/group/VCXTestCommon.mmp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,100 @@
+/*
+* 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 <platform_paths.hrh>
+
+TARGET          vcxtestcommon.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E7
+
+#if defined(EKA2)
+
+CAPABILITY      CAP_GENERAL_DLL
+/* Remove comments and replace 0x00000000 with correct vendor id */
+// VENDORID     0x101FB657
+/* Remove comments and replace 0x00000000 with correct secure id */
+// SECUREID     0x102073DB
+#endif
+
+//TARGETPATH      ?target_path
+DEFFILE         VCXTestCommon.def
+
+SOURCEPATH      ../src
+SOURCE          CIptvTestTimer.cpp
+SOURCE          CIptvTestVerifyData.cpp
+SOURCE          CIptvTestMobilecrashWatcher.cpp
+SOURCE          CIptvTestEventWaiter.cpp
+SOURCE          CIptvTestEvent.cpp
+SOURCE			CIptvTestActiveWait.cpp
+SOURCE          TestUtilConnectionWaiter.cpp
+SOURCE          IptvTestDownloadManager.cpp
+SOURCE          IptvTestUtilALR.cpp
+SOURCE          CIptvTestVideoCreator.cpp
+SOURCE          TestUtilConnection.cpp
+SOURCE          VCXTestCommon.cpp
+SOURCE          VCXTestTimerWait.cpp
+SOURCE          VCXTestPSSubscriber.cpp
+SOURCE          VCXTestMessageWait.cpp
+SOURCE          VCXTestStatsKeeper.cpp
+
+//RESOURCE        resource_file
+//RESOURCE        resource_file2
+
+USERINCLUDE     ../inc
+
+APP_LAYER_SYSTEMINCLUDE
+
+LIBRARY         euser.lib
+LIBRARY         flogger.lib
+LIBRARY         efsrv.lib
+LIBRARY         bafl.lib
+LIBRARY         commdb.lib
+LIBRARY         estor.lib // filestore
+LIBRARY         edbms.lib // rdbstoredatabase
+LIBRARY         tzclient.lib // RTz
+LIBRARY         downloadmgr.lib
+LIBRARY         esock.lib
+LIBRARY         cmmanager.lib
+LIBRARY         centralrepository.lib
+LIBRARY         ezip.lib
+
+LANG            SC
+
+/*
+START WINS
+?wins_specific_information
+END
+
+START MARM
+?marm_specific_information
+END
+*/
+// Other possible keywords:
+
+// DOCUMENT     ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes)
+/*
+START BITMAP ?target
+TARGETPATH   ?emulated_path_on_target_machine
+HEADER
+SOURCE       ?color_depth ?source_bitmap
+END
+*/
+// DEFFILE ?filename
+// AIF ?filename
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/group/VCXTestCommon.pkg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,58 @@
+;
+; 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 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: 
+;
+;
+
+; Languages
+&EN
+
+; Package header
+#{"VCXTestCommon"},(0x101F7961),0,0,0
+
+; Localised Vendor name
+%{"Nokia EN"}
+
+; Unique Vendor name
+:"Nokia"
+
+; Logo
+; None
+
+; Package signature - Optional
+; None
+
+; Start of Package body
+
+; Condition blocks
+; None
+
+; Options list
+; None
+
+; Install files
+  "\epoc32\release\armv5\udeb\VCXTestCommon.dll"              -   "!:\Sys\Bin\VCXTestCommon.dll"
+  "..\conf\VCXTestCommon.cfg"                                 -   "c:\TestFramework\VCXTestCommon.cfg"
+  "..\init\TestFramework.ini"                                 -   "c:\TestFramework\TestFramework.ini"
+  
+; Embedded SIS
+; None
+
+; End of Package body
+
+; PKG dependencies
+; None
+
+; PKG capabilities
+; None
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* 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: 
+*
+*/
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+PRJ_TESTEXPORTS
+
+PRJ_MMPFILES
+
+PRJ_TESTMMPFILES
+VCXTestCommon.mmp
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/inc/CIptvTestActiveWait.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,110 @@
+/*
+* 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 CIPTVTESTACTIVEWAIT_H
+#define CIPTVTESTACTIVEWAIT_H
+
+//  INCLUDES
+#include <e32base.h>
+
+// CONSTANTS
+
+// MACROS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*
+*
+*
+*
+*  @since
+*/
+class CIptvTestActiveWait : public CBase
+    {
+    public:  // Constructors and destructor
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CIptvTestActiveWait * NewL();
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CIptvTestActiveWait ();
+
+
+	enum TIptvTestActiveWaitCmd
+       	{
+       	EActiveWaitStart,
+       	EActiveWaitStop
+       	};
+
+    public: // New functions
+
+    	/*
+    	* To start and stop CActiveSchedulerWait
+    	*/
+
+		IMPORT_C void ActiveWait( TIptvTestActiveWaitCmd aActiveWaitCmd );
+
+		/*
+		 * Returns ETrue if CActiveSchedulerWait is running.
+		 */
+		IMPORT_C TBool IsWaiting();
+
+        /*
+         * Starts active wait.
+         */
+        IMPORT_C TInt Start();
+
+        /*
+         * Stops active wait.
+         */
+        IMPORT_C TInt Stop();
+
+
+    protected: // From base classes
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CIptvTestActiveWait ();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        IMPORT_C void ConstructL();
+
+    private:    // Data
+		CActiveSchedulerWait* iActiveSchedulerWait;
+    };
+
+
+#endif      // CIPTVTESTACTIVEWAIT_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/inc/CIptvTestEvent.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,119 @@
+/*
+* 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 CIPTVTESTEVENT_H
+#define CIPTVTESTEVENT_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <e32std.h>
+
+// CONSTANTS
+
+// MACROS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+class CIptvTestEvent;
+
+// CLASS DECLARATION
+
+/**
+*
+*
+*
+*
+*  @since
+*/
+class CIptvTestEvent : public CBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        //IMPORT_C static CIptvTestEvent* NewL(TInt aTimeoutSeconds);
+
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C CIptvTestEvent( const TDesC& aName, TInt aTimeoutSeconds);
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CIptvTestEvent();
+
+
+    public: // New functions
+
+		/**
+		* Compares if this and aEvent are same. Returns ETrue if so, else EFalse.
+		*/
+		IMPORT_C virtual TBool Compare( CIptvTestEvent& aEvent ) = 0;
+
+		/**
+		* Returns error code if there's error in the event, otherwise KErrNone.
+		*/
+		IMPORT_C virtual TInt GetError( ) = 0;
+
+		/**
+		* Getter for even name.
+		*/
+		IMPORT_C void GetName( TDes& aName );
+
+		/**
+		* Returns if event has timed out.
+		*/
+		IMPORT_C TBool HasTimeouted( TTime& aTimeNow );
+
+		/*
+		* Starts timing for this event
+		*/
+		IMPORT_C void Activate( );
+
+		/*
+		* Stops timing for this event
+		*/
+		IMPORT_C void Deactivate( );
+
+    protected: //from base classes
+
+    private:
+
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+    private:    // Data
+
+          TInt iTimeoutSeconds;
+          TTime iActivationTime;
+          TBuf<32> iName;
+          TBool iActive;
+    };
+
+
+#endif      // CIPTVTESTEVENT_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/inc/CIptvTestEventWaiter.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,155 @@
+/*
+* 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 CIPTVTESTEVENTWAITER_H
+#define CIPTVTESTEVENTWAITER_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <e32cmn.h>
+
+// CONSTANTS
+
+// MACROS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+class MIptvTestEventWaiterObserver;
+class CIptvTestEvent;
+
+// CLASS DECLARATION
+
+/**
+*
+* CIptvTestEventWaiter USAGE:
+*
+* Implement callbacks from MIptvTestEventWaiterObserver.
+* Create your own event class inherited from CIptvTestEvent.
+* Create instance.
+*
+* Add events that are expected to happen with CIptvTestEventWaiter::AddEvent method.
+*  - Two queues: sequential events and others
+*
+* When event happen, call CIptvTestEventWaiter::EventHappened(event)
+*  - This will compare the event to the ones in queues with CIptvTestEvent::Compare() method.
+*    First tries to find not sequential events and then last sequential event in queue.
+*  - If event is not found or it's timedout MIptvTestEventWaiterObserver::EventWaiterErrorL is called.
+*
+*  @since
+*/
+
+class CIptvTestEventWaiter : public CActive
+	{
+	public:
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CIptvTestEventWaiter* NewL(MIptvTestEventWaiterObserver& aObserver);
+
+        /**
+        * Destructor.
+        */
+		IMPORT_C virtual ~CIptvTestEventWaiter();
+
+	public: // New functions
+
+		/**
+		* Checks if events have timeouted
+		*/
+		IMPORT_C TInt CheckTimeouts();
+
+		/**
+		* Will add an event to queue and also check all events if they have timeouted
+		*/
+		IMPORT_C TInt AddEvent(CIptvTestEvent* aEvent, TBool aSequential);
+
+		/**
+		* Will check the event against the events in queue
+		* If event is found it is returned in aQueuedEvent
+		* If event is not found the first event in event queue is returned in aQueuedEvent
+		*/
+		IMPORT_C TInt EventHappened(CIptvTestEvent* aEvent, CIptvTestEvent** aQueuedEvent);
+
+		/**
+		* Resets the event waiter system. All events are deleted.
+		*/
+		IMPORT_C TInt Reset();
+
+		/**
+		* Returns the amount of events left in queues
+		*/
+		IMPORT_C TInt GetEventCount();
+
+    protected: //from base classes
+
+		// from CActive
+
+	    /*
+	     * RunL()
+	     *
+	     * Handle request completion events
+	     *
+	     */
+	    void RunL();
+
+	    /*
+	     * DoCancel()
+	     *
+	     * Cancel any outstanding requests
+	     *
+	     */
+	    void DoCancel();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CIptvTestEventWaiter(MIptvTestEventWaiterObserver& aObserver);
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+    private:    // Data
+
+	private:
+
+		// Events which should happen sequential
+		RPointerArray<CIptvTestEvent> iEventQueue;
+
+		// Events which have no particular order where they happen
+		RPointerArray<CIptvTestEvent> iEventDump;
+
+		RPointerArray<CIptvTestEvent> iPastEvents;
+
+		MIptvTestEventWaiterObserver& iObserver;
+
+		RTimer iTimer;
+	};
+
+#endif // CIPTVTESTEVENTWAITER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/inc/CIptvTestMobilecrashWatcher.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,145 @@
+/*
+* 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 CIPTVTESTMOBILECRASHWATCHER_H
+#define CIPTVTESTMOBILECRASHWATCHER_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <e32cmn.h> // RArray
+#include <f32file.h> // RFs
+
+// CONSTANTS
+
+// MACROS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+
+// CLASS DECLARATION
+
+
+/**
+*
+*
+*
+*
+*  @since
+*/
+class CIptvTestMobilecrashWatcher : public CBase
+    {
+    public:  // Constructors and destructor
+
+
+        /**
+        * Two-phased constructor.
+        * This has iPanicEnabled member set ETrue which will cause panic in destructor if there's new mobilecrashes
+        */
+        IMPORT_C static CIptvTestMobilecrashWatcher* NewL();
+
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CIptvTestMobilecrashWatcher* NewL(TBool aPanicEnabled);
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CIptvTestMobilecrashWatcher();
+
+
+    public: // New functions
+
+		/**
+        * Reads all mobilecrashes in c:\data and e:\ directories.
+        * @since
+        * @param aCrashes list of mobilecrash files are stored into here
+        * @return
+        */
+		void ReadMobilecrashesL( RPointerArray<HBufC>& aCrashes, const TDesC& aDrive );
+
+    	/**
+        * Compares the two arrays of filenames and reports new files in aCrashesNow and causes a panic.
+        * @since
+        * @param aCrashesBefore old filelist
+        * @param aCrashesNow new filelist
+        * @return ETrue if new mobilecrashes are found, otherwise EFalse
+        */
+		IMPORT_C TBool CompareMobilecrashesL(RPointerArray<HBufC>& aCrashesBefore, RPointerArray<HBufC>& aCrashesNow);
+
+    	/**
+        * Checks for new mobilecrashes. Panics if found.
+        * @since
+        * @param
+        * @return
+        */
+		IMPORT_C void CheckNewCrashesL();
+
+		/**
+        * Checks for new mobilecrashes.
+        * @since
+        * @param aArray is populated of the new mobilecrashes.
+        * @return EFalse if new mobilecrashes are not found. ETrue if found.
+        */
+		IMPORT_C TBool ReturnNewCrashes(RPointerArray<HBufC>& aArray);
+
+		/**
+        * Returns the count of mobilecrashes in c:\\data and e:\\
+        * @since
+        * @param
+        * @return Count of mobilecrashes in c:\\data and e:\\
+        */
+		IMPORT_C TInt ReturnMobileCrashCount();
+
+    protected: //from base classes
+
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CIptvTestMobilecrashWatcher();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL(TBool aPanicEnabled);
+
+    private:    // Data
+		// If ETrue and new mobilecrashes are found then a panic will be thrown in destructor
+		TBool iPanicEnabled;
+
+		// File system session
+		RFs iFsSession;
+
+		RPointerArray<HBufC> iCrashesBefore;
+
+		RPointerArray<HBufC> iCrashesNow;
+    };
+
+
+#endif      // CIPTVTESTMOBILECRASHWATCHER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/inc/CIptvTestTimer.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,92 @@
+/*
+* 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 CIPTVTESTTIMER_H
+#define CIPTVTESTTIMER_H
+
+//  INCLUDES
+#include <e32base.h>
+
+// CONSTANTS
+
+// MACROS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+class MIptvTestTimerObserver;
+
+// CLASS DECLARATION
+
+/**
+*
+*
+*
+*
+*  @since
+*/
+class CIptvTestTimer : public CActive
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CIptvTestTimer* NewL(MIptvTestTimerObserver& aObserver, TInt aId);
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CIptvTestTimer();
+
+
+    public: // New functions
+		IMPORT_C void After(TTimeIntervalMicroSeconds32 aInterval);
+		IMPORT_C void CancelTimer( );
+
+    protected: //from base classes
+	    void RunL();
+	    void DoCancel();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CIptvTestTimer(MIptvTestTimerObserver& aObserver, TInt aId);
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+    private:    // Data
+	    RTimer iTimer;
+	    MIptvTestTimerObserver& iObserver;
+	    TInt  iId;
+	    TBool iRestartAfterCancel;
+	    TTimeIntervalMicroSeconds32 iInterval;
+    };
+
+
+#endif      // CIPTVTESTTIMER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/inc/CIptvTestVerifyData.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,274 @@
+/*
+* 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: 
+*
+*/
+
+
+/*
+
+Testmodule needs two new blocks:
+ EnableVerifying
+  - Parameters: verify ID, appendmode: 0 = if verify file exists it will be
+    overwritten, 1 data is written to end of file
+  - Verify ID can be the Case ID
+  - Calls IptvTestUtility::CreateVerifyData
+  - The case can call EnableVerifying block of multiple modules. Verify ID should be same in each call,
+    just use append mode in other calls but the first.
+  - If this has not been called then IptvTestUtility::VerifyData and
+    IptvTestUtility::WriteVerifyData do nothing
+
+ Verify
+  - Parameters: The verify ID used in the case
+  - Calls IptvTestUtility::VerifyData(CaseId) for the ID
+  - Case should call Verify block only once, even EnableVerifying is called for multiple test modules
+
+ After call to EnableVerifying the test module can write data with two different
+ IptvTestUtility::WriteVerifyData methods.
+
+ VerifyData will fail at the first time it's called. This is because it can't
+ find already verified file to compare with the one generated during the case run.
+ The unverified file can be found from E (or C if MMC is not installed) drive
+ in the folder: \iptvtest\verify\<VerifyID>.txt. This file must be verified by
+ hand and copied to IPTV_engine\internal\data\verify.
+
+ Note: Only logs from HW test runs should be accepted. Emulator and HW might give
+ different results.
+
+ IPTV_engine\internal\sis\generateverifylist.pl script generates
+ internal\data\verifyExports.inf file which exports the verified files to
+ correct locations. internal\sis\pkgExports.txt is also created and the
+ lines inside must be copied to STIF_IPTV_Engine.pkg. The verified files will
+ be installed in c:\Testframework\Iptvtest\verify folder on the terminal.
+
+ File & directory summary.
+ 1. (E/C):\iptvtest\verify\<VerifyID>.txt (on hardware)
+ 	- Generated during the case run
+ 2. internal\data\verify
+ 	- #1 should be copied here after it has been verified manually for first time.
+ 3. c:\Testframework\Iptvtest\verify (on hardware)
+  	- Verified files are installed here. Compared to #1
+ 4. internal\sis\generateverifylist.pl
+ 	- Creates files #5 & #6
+ 5. internal\data\verifyExports.inf
+ 	- Exports the files in folders: epoc32\winscw\c\testframework\iptvtest\verify
+					epoc32\data\Z\System\Data\Iptvtest\Verify
+ 6. \internal\sis\pkgExports.txt
+  	- Pkg lines for the files, copy to STIF_IPTV_Engine.pkg
+
+Example case:
+
+[Test]
+title ET39000 Data verifying example
+create IptvProvisioningTest ProvTest
+create IptvServiceManagementApiTest SMTest
+SMTest DeleteServicesDb
+ProvTest Create
+ProvTest EnableVerifying ET39000 	// first module and first call will create new data file
+ProvTest LocalProvision "c:\TestFramework\testvod_services.xml"
+create IptvVodContentApiTest VCTest
+VCTest Create SERV_1
+VCTest EnableVerifying ET39000 APPEND 	// second module will append to the same file
+VCTest SelectIap 3G_AP
+VCTest UpdateEcg
+waittestclass VCTest
+VCTest VerifyAllCategoryContent KIptvVodContentCategoryRootId
+ProvTest Verify ET39000  		// only one module will do the verifying
+VCTest Destroy
+delete VCTest
+ProvTest Destroy
+delete ProvTest
+SMTest Destroy
+delete SMTest
+[Endtest]
+
+*/
+
+
+#ifndef CIPTVTESTVERIFYDATA_H
+#define CIPTVTESTVERIFYDATA_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <e32cmn.h> // RArray
+#include <f32file.h> // RFs
+#include <BAUTILS.H>
+#include <S32FILE.H>
+
+// CONSTANTS
+const TInt KIptvTestErrVerifyFailed = -1112;
+_LIT(KIptvVerifyZipFile, "c:\\testing\\data\\verifyzip\\verify.zip" );
+
+// MACROS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+class CZipFile;
+
+// CLASS DECLARATION
+
+class CVerifyFile : public CBase
+	{
+	public:
+		static CVerifyFile* CVerifyFile::NewL();
+
+		virtual ~CVerifyFile();
+
+	// data
+
+		TBuf<64> iId;
+
+		/**
+	    * Returns the file name and path where case data is written to be verified
+	    * @since
+	    * @param aFileName pointer to descriptor where file name is written
+	    * @return Error code, KErrNone if no errors,
+	    */
+		void GetFileToWrite(TDes& aFileName);
+
+		void CreateNewFile();
+
+		void WriteData(TDesC& aData);
+
+		void CloseFileHandles();
+
+	protected:
+		CVerifyFile();
+		void ConstructL();
+
+	private:
+		RFs iFs;
+		HBufC* iFileName;
+		TBool iFileOpen;
+		RFileWriteStream iFileStream;
+		RFile iFile;
+
+		void OpenStream();
+		void ResolveFileName();
+	};
+
+
+/**
+*
+*  @since
+*/
+class CIptvTestVerifyData : public CBase
+    {
+    public:  // Constructors and destructor
+
+		enum TVerifyResult
+			{
+			EVerifyOk = 0,
+			EVerifyFailed = -1112,
+			EVerifiedFileNotFound = -1111,
+			EFileToVerifyNotFound = -1110,
+			ESystemError = -1109
+			};
+
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CIptvTestVerifyData* NewL();
+
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CIptvTestVerifyData();
+
+
+    public: // New functions
+
+  		/**
+        * Initializes the verify file, deletes if the file exists
+        * @since
+        * @param aVerifyId An id to identify the file where verify data is written
+        * @return Error code, KErrNone if no errors,
+        */
+		IMPORT_C TInt CreateVerifyDataL(TDesC& aVerifyId, TBool aAppend);
+
+		/**
+        * Writes verify data to a file
+        * @since
+        * @param aVerifyId An id to identify the file where verify data is written
+        * @param aVerifyData Data to write into the file
+        * @return Error code, KErrNone if no errors,
+        */
+		IMPORT_C TInt WriteVerifyDataL(TDesC& aVerifyId, TDesC& aVerifyData);
+
+		/**
+        * Verifies the results, result is written to aVerifyResult
+        * @since
+        * @param aVerifyId An id to identify the files which are compared
+        * @return Error code, KErrNone if no errors,
+        */
+		IMPORT_C TInt VerifyDataL(TDesC& aVerifyId, TVerifyResult& aVerifyResult);
+
+        /**
+        * Enables timestamp writing to the file.
+        * @since
+        * @param aUseTimestamps
+        * @return Error code, KErrNone if no errors,
+        */
+        IMPORT_C void EnableTimestamps( TBool aUseTimestamps );
+
+    protected: //from base classes
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CIptvTestVerifyData();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+    	TInt GetVerifyFileIndex(TInt& aIndex, TDesC& aVerifyId);
+
+    	/*
+    	 * Reads a file into the buffer.
+    	 */
+    	TInt ReadFileL(RFs& aFs, TDes& aFileName, HBufC8** aBuff, TVerifyResult& aVerifyResult);
+
+    	/*
+    	 * Extracts a file from zip file.
+    	 */
+    	void ExtractVerifyFileL( TDesC& aVerifyId, const TDesC& aDestFile );
+
+    	/*
+    	 * Checks if file exists in zip file.
+    	 */
+    	TBool FileExistsInZip( CZipFile* aZipFile, const TDesC& aFileName );
+
+    private:    // Data
+		RFs iFs;
+
+		RPointerArray<CVerifyFile> iVerifyFiles;
+
+		CZipFile* iZipFile;
+
+		TBool iUseTimestamps;
+
+		HBufC* iBuffer;
+    };
+
+#endif      // CIPTVTESTVERIFYDATA_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/inc/CIptvTestVideoCreator.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,124 @@
+/*
+* 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 CIptvTestVideoCreator_H
+#define CIptvTestVideoCreator_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <e32std.h>
+#include <f32file.h>
+#include <BAUTILS.H>
+
+// CONSTANTS
+const int KVcxTestLargeFile3GB = -999;
+
+// MACROS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*
+*
+*
+*
+*  @since
+*/
+class CIptvTestVideoCreator : public CBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CIptvTestVideoCreator* NewL();
+
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C CIptvTestVideoCreator();
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CIptvTestVideoCreator();
+
+        enum TIptvTestVideoType
+			{
+            IptvTestVideo3Gp,               // Extension .3GP
+            IptvTestVideo3Gp2,              // Extension .3G2
+            IptvTestVideoMp2,               // Extension .MP2
+            IptvTestVideoMpeg1,             // Extension .MPG
+            IptvTestVideoMpeg2,             // Extension .MPG
+            IptvTestVideoSuperVideoCd,      // Extension .MPG
+            IptvTestVideoMp3,               // Extension .MP3
+            IptvTestVideoAppleMpeg,         // Extension .MP4
+            IptvTestVideoMpeg4,             // Extension .MP4
+            IptvTestVideoMpegAvc,           // Extension .MP4
+            IptvTestVideoQuicktime,         // Extension .MOV
+            IptvTestVideoRealVideo,         // Extension .RM
+            IptvTestVideoAvi,               // Extension .AVI
+            IptvTestVideoWmv,                // Extension .WMV
+            IptvTestVideoAviAC3              // Extension .AVI
+			};
+
+    public: // New functions
+
+        /**
+        * Creates video to specified location by copying file from e/c:\testing\data according to the video type.
+        * @param aVideoType a type of video which is created
+        * @param aFileName path filename where video is created
+        * @param aSize size of the video. If -1 then size will not be changed, if any other, playback of
+        * video will probably fail.
+        */
+        IMPORT_C void CreateVideoL( TIptvTestVideoType aVideoType, TDesC& aFileName, TInt aSize );
+
+        /*
+         * Creates number of video files to specified location.
+         */
+        IMPORT_C void CreateVideosL( TIptvTestVideoType aVideoType, TDesC& aFileName, TInt aCount, RPointerArray<HBufC>& aFileArray );
+
+    protected: //from base classes
+
+    private:
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        IMPORT_C void ConstructL();
+
+        /**
+        * Returns the file and path for specied file type.
+        */
+        IMPORT_C void GetVideoFile( TDes& aFileName, CIptvTestVideoCreator::TIptvTestVideoType aVideoType, const TDesC& aDrive );
+
+    private:    // Data
+       RFs iFs;
+       CFileMan* iFileMan;
+    };
+
+
+#endif      // CIptvTestVideoCreator_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/inc/IptvTestDownloadManager.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,92 @@
+/*
+* 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 IPTVTESTDOWNLOADMANAGER_H
+#define IPTVTESTDOWNLOADMANAGER_H
+
+#include <e32base.h>
+#include <CommDbConnPref.h>
+#include <es_sock.h>
+#include <DownloadMgrClient.h>
+#include <HttpDownloadMgrCommon.h>
+#include "MTestUtilDownloadObserver.h"
+#include "MIptvTestTimerObserver.h"
+
+// FORWARD DECLARATIONS;
+class CIptvTestTimer;
+
+// CLASS DECLARATION
+
+
+/**
+* CTestUtilConnection  Controls the internet connection initiation and shutdown
+*/
+class CIptvTestDownloadManager : public CBase, MHttpDownloadMgrObserver, public MIptvTestTimerObserver
+    {
+	public:
+
+	    /*
+	     * NewL()
+	     */
+	    IMPORT_C static CIptvTestDownloadManager* NewL(MTestUtilDownloadObserver *aObs);
+
+	    /*
+	     * NewL()
+	     */
+	    IMPORT_C static CIptvTestDownloadManager* NewLC(MTestUtilDownloadObserver *aObs);
+
+	    /*
+	     * ~CTestUtilConnection()
+	     */
+	    IMPORT_C virtual ~CIptvTestDownloadManager();
+
+
+		IMPORT_C TInt DownloadL( TDesC& aAddress, TDesC16& aOutFile, TDesC& aUserName, TDesC& aPassword, TInt32 aIapId = 0, TInt aTimeoutSeconds = 300);
+
+		IMPORT_C void GetError(RHttpDownload& aDownload, TInt32& aDownloadError);
+
+	private:
+
+	   virtual void HandleDMgrEventL( RHttpDownload& aDownload, THttpDownloadEvent aEvent );
+
+	   virtual void TimerComplete(TInt aTimerId, TInt aError);
+
+	   void DeleteDownloadAsync( TInt aError );
+
+	private:
+
+		void ConstructL();
+
+		CIptvTestDownloadManager(MTestUtilDownloadObserver *aObs);
+
+	private:
+		RHttpDownloadMgr iDownloadMgr;
+		RHttpDownload* iDownload;
+
+		MTestUtilDownloadObserver *iObserver;
+
+		TBool iDownloadRunning;
+		CIptvTestTimer* iTimer;
+
+		TBool iTimerStartedForDownloadDeletion;
+		TInt iError;
+		TBool iDownloadFinishInformed;
+    };
+
+
+#endif // IAPCONNECT_V20ENGINE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/inc/IptvTestUtilALR.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,191 @@
+/*
+* 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 IptvTestUtilALR_H
+#define IptvTestUtilALR_H
+
+#include <e32base.h>
+#include "MTestUtilConnectionObserver.h"
+
+#include <cmmanagerext.h>
+#include <cmdestinationext.h>
+#include <cmconnectionmethodext.h>
+#include <cmconnectionmethoddef.h>
+#include <commdbconnpref.h>
+
+// FORWARD DECLARATIONS;
+class CIptvTestActiveWait;
+
+// CONSTANTS
+
+// Declared in CIptvUtil.h and vcxconnutilimpl.cpp
+const TUid VCXTEST_KIptvAlrCenRepUid = { 0x2000B438 };
+const TInt VCXTEST_KIptvCenRepUsedSnapIdKey   = 0x1;
+const TInt VCXTEST_KIptvCenRepDefaultIapIdKey   = 0x2;
+const TInt VCXTEST_KIptvCenRepAPModeAlwaysAsk = 0;
+
+// CLASS DECLARATION
+
+/**
+* CIptvTestUtilALR  Controls the internet connection initiation and shutdown
+*/
+class CIptvTestUtilALR : public CBase, public MTestUtilConnectionObserver
+    {
+public:
+
+    /*
+     * NewL()
+     */
+    IMPORT_C static CIptvTestUtilALR* NewL();
+
+    /*
+     * NewL()
+     */
+    IMPORT_C static CIptvTestUtilALR* NewLC();
+
+    /*
+     * ~CIptvTestUtilALR()
+     */
+    IMPORT_C virtual ~CIptvTestUtilALR();
+
+public: // Functions from base classes
+
+    void ConnectionCreated();
+    void ConnectionClosed();
+    void ConnectionFailed();
+    void ConnectionAlreadyExists();
+    void ConnectionTimeout();
+
+public: // New functions
+
+    /**
+    * Delete the used destination cenrep value.
+    */
+    IMPORT_C void RemoveUsedDestinationCenRepL();
+
+    /**
+    * Set the used destination cenrep value for Video Center & IPTV_Engine.
+    */
+    IMPORT_C void SetUsedDestinationL( TDesC& aDestinationName );
+
+    /**
+    * Create new destination (SNAP)
+    */
+    IMPORT_C void CreateDestinationL( TDesC& aDestinationName );
+
+    /**
+    * Delete a destination (SNAP)
+    */
+    IMPORT_C void DeleteDestinationL( TDesC& aDestinationName );
+
+    /**
+    * Copy existing connection method to defined SNAP.
+    */
+    IMPORT_C void CopyMethodL( TDesC& aMethodName, TDesC& aNewMethodName, TDesC& aNewDestinationName );
+
+    /**
+    * Delete a connection method.
+    */
+    IMPORT_C void DeleteMethodL( TDesC& aDestinationName, TDesC& aMethodName );
+
+    /**
+    * Set priority for a connection method.
+    */
+    IMPORT_C void SetMethodPriorityL( TDesC& aDestinationName, TDesC& aMethodName, TUint32 aPriority );
+
+    /**
+     * Sets specified string attribute for a method.
+     */
+    IMPORT_C void SetMethodStringAttributeL( TDesC& aDestinationName, TDesC& aMethodName, TInt aAttribute, TDesC& aAttributeValue );
+
+    /**
+     * Sets specified integer attribute for a method.
+     */
+    IMPORT_C void SetMethodIntAttributeL( TDesC& aDestinationName, TDesC& aMethodName, TInt aAttribute, TInt aAttributeValue );
+
+    /**
+     * Sets specified boolean attribute for a method.
+     */
+    IMPORT_C void SetMethodBoolAttributeL( TDesC& aDestinationName, TDesC& aMethodName, TInt aAttribute, TBool aAttributeValue );
+
+    /**
+    * Returns id of given destination.
+    */
+    IMPORT_C TInt GetDestinationIdL( TDesC& aDestinationName );
+
+    /**
+    * Terminates active connections for the destination's IAPs.
+    */
+    IMPORT_C void TerminateDestinationConnectionsL( TDesC& aDestinationName );
+    
+    /**
+     * Gets the default access point from connection manager
+     */
+    IMPORT_C TUint32 GetDefaultIap( void );
+    
+    /**
+     * Gets the default iap, saves it to cenrep
+     */
+    IMPORT_C TInt SetDefaultIapCenRep( void );
+    
+    /**
+     * Gets the default iap id from cenrep
+     */
+    IMPORT_C TUint32 GetDefaultIapCenRep( void );
+
+    
+private: // New functions
+
+    /**
+     * Prints destination's IAPs and their priorities to debug output.
+     */
+    void PrintDestinationL( RCmDestinationExt& aDestination );
+
+    /**
+     * Compares two connection method names. 
+     * @param aSearchedName name for the method to search for. 
+     * @param aCurrentName name to compare against.
+     * @param aStrict If false then and aSearchedName is "Internet" there's few alternatives for 
+     *        aCurrentName which will match too.
+     * @return ETrue if match, otherwise EFalse.
+     */
+    TBool MethodMatchesL( const TDesC& aSearchedName, const TDesC& aCurrentName, TBool aStrict );
+
+private:
+
+    /*
+     * CIptvTestUtilALR()
+     */
+    CIptvTestUtilALR();
+
+    /*
+     * ConstructL()
+     */
+    void ConstructL();
+
+private: // Data
+
+    RCmManagerExt iCmManager;
+
+    // CIptvTestActiveWait
+    CIptvTestActiveWait* iActiveWait;
+
+    };
+
+
+#endif // IAPCONNECT_V20ENGINE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/inc/MIptvTestEventWaiterObserver.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,48 @@
+/*
+* 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 MIPTVTESTEVENTWAITEROBSERVER_H
+#define MIPTVTESTEVENTWAITEROBSERVER_H
+
+// INCLUDES
+
+#include <e32def.h>
+
+// FORWARD DECLARATIONS
+class CIptvTestEvent;
+
+// CLASS DECLARATION
+
+class MIptvTestEventWaiterObserver
+    {
+    public:
+		/**
+		* Which event caused an error and why
+		*/
+		virtual void EventWaiterErrorL(TInt aError, CIptvTestEvent& aEvent) = 0;
+
+		/**
+		*
+		*/
+		virtual void EventWaiterAllEventsValidated() = 0;
+
+    };
+
+#endif  // MIPTVTESTEVENTWAITEROBSERVER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/inc/MIptvTestTimerObserver.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,40 @@
+/*
+* 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 MIPTVTESTTIMEROBSERVER_H
+#define MIPTVTESTTIMEROBSERVER_H
+
+// INCLUDES
+
+#include <e32def.h>
+
+// FORWARD DECLARATIONS
+
+
+// CLASS DECLARATION
+
+class MIptvTestTimerObserver
+    {
+    public:
+		virtual void TimerComplete(TInt aTimerId, TInt aError) = 0;
+
+    };
+
+#endif  // MIPTVTESTTIMEROBSERVER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/inc/MTestUtilConnectionObserver.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,40 @@
+/*
+* 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 MIPTVUTILCONNECIONTOBSERVER_H
+#define MIPTVUTILCONNECIONTOBSERVER_H
+
+// INCLUDES
+
+#include <e32std.h>
+
+// CLASS DECLARATION
+
+class MTestUtilConnectionObserver
+    {
+public:
+
+    virtual void ConnectionCreated() = 0;
+    virtual void ConnectionClosed() = 0;
+    virtual void ConnectionFailed() = 0;
+    virtual void ConnectionAlreadyExists() = 0;
+    virtual void ConnectionTimeout() = 0;
+    };
+
+#endif // IPTVUTILCONNECIONTOBSERVER_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/inc/MTestUtilDownloadObserver.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,37 @@
+/*
+* 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 MIPTVUTILDOWNLOADOBSERVER_H
+#define MIPTVUTILDOWNLOADOBSERVER_H
+
+// INCLUDES
+
+#include <e32std.h>
+
+// CLASS DECLARATION
+
+class MTestUtilDownloadObserver
+    {
+public:
+
+    virtual void DownloadFinished(TInt aError) = 0;
+
+    };
+
+#endif // MIPTVUTILDOWNLOADOBSERVER_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/inc/TestUtilConnection.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,160 @@
+/*
+* 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 TESTUTILCONNECTION_H
+#define TESTUTILCONNECTION_H
+
+#include <e32base.h>
+#include <CommDbConnPref.h>
+#include <es_sock.h>
+#include <e32std.h>
+#include "MTestUtilConnectionObserver.h"
+
+// FORWARD DECLARATIONS;
+//class CCommDbOverrideSettings;
+
+// CONSTANTS
+const TUint32 KUndefinedIAPid = 0x00;
+const TUint32 KTimeout = 1000000;
+
+// CLASS DECLARATION
+
+
+/**
+* CTestUtilConnection  Controls the internet connection initiation and shutdown
+*/
+class CTestUtilConnection : public CActive
+    {
+public:
+
+    enum TConnectionState
+    	{
+    	EIdle = 0, EConnecting, EFailed, EConnected
+    	};
+
+    /*
+     * NewL()
+     */
+    IMPORT_C static CTestUtilConnection* NewL(MTestUtilConnectionObserver* aObserver);
+
+    /*
+     * NewL()
+     */
+    IMPORT_C static CTestUtilConnection* NewLC(MTestUtilConnectionObserver* aObserver);
+
+    /*
+     * ~CTestUtilConnection()
+     */
+    IMPORT_C virtual ~CTestUtilConnection();
+
+    /*
+     * ConnectL()
+     *
+     * Creates a connection to IAP. ASYNC.
+     *
+     */
+    IMPORT_C void ConnectL();
+
+    /*
+     * TerminateConnectionL()
+     *
+     * Terminate an active connection
+     *
+     */
+    IMPORT_C void TerminateConnectionL();
+
+    /*
+     * SetConnectionPreferences()
+     *
+     * Sets connection preferences
+     *
+     * Params:
+     * TUint aBearer    Bearer type
+     * TUint32 aIapId   IAP to be connected, default KUndefinedIAPid
+     *
+     */
+    IMPORT_C void SetConnectionPreferences(TUint aBearer, TUint32 aIapId = KUndefinedIAPid);
+
+    /*
+     * AttachL()
+     *
+     * Attach to active connection.
+     *
+     */
+    IMPORT_C void AttachL();
+
+    /*
+     * GetState()
+     *
+     * Get connection state
+     *
+     * Params:
+     *
+     */
+    IMPORT_C TConnectionState GetState();
+
+protected: // from CActive
+
+    /*
+     * RunL()
+     *
+     * Handle request completion events
+     *
+     */
+    void RunL();
+
+    /*
+     * DoCancel()
+     *
+     * Cancel any outstanding requests
+     *
+     */
+    void DoCancel();
+
+    // From MTestUtilConnectionObserver
+
+private:
+
+    /*
+     * CTestUtilConnection()
+     */
+    CTestUtilConnection(MTestUtilConnectionObserver* aObserver);
+
+    /*
+     * ConstructL()
+     */
+    void ConstructL();
+
+private:
+
+    TCommDbConnPref iPref;
+
+    // Owns
+    RConnection iConnect;
+    RSocketServ iSocketServ;
+
+    TRequestStatus iTimerStatus;
+
+    TConnectionState iConnectionState;
+
+    MTestUtilConnectionObserver* iObserver;
+
+    };
+
+
+#endif // IAPCONNECT_V20ENGINE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/inc/TestUtilConnectionWaiter.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,141 @@
+/*
+* 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 TESTUTILCONNECTIONWAITER_H
+#define TESTUTILCONNECTIONWAITER_H
+
+#include <e32base.h>
+#include <CommDbConnPref.h>
+
+#include <es_enum.h>
+#include <es_sock.h>
+#include <in_sock.h>
+
+
+// FORWARD DECLARATIONS;
+//class CCommDbOverrideSettings;
+class MTestUtilConnectionObserver;
+
+// CONSTANTS
+
+// CLASS DECLARATION
+
+/**
+* CTestUtilConnectionWaiter
+*/
+class CTestUtilConnectionWaiter : public CActive
+    {
+public:
+
+    /*
+     * NewL()
+     */
+    IMPORT_C static CTestUtilConnectionWaiter* NewL(MTestUtilConnectionObserver* aObserver);
+
+    /*
+     * NewLC()
+     */
+    IMPORT_C static CTestUtilConnectionWaiter* NewLC(MTestUtilConnectionObserver* aObserver);
+
+    /*
+     * ~CTestUtilConnection()
+     */
+    IMPORT_C virtual ~CTestUtilConnectionWaiter();
+
+    /*
+     * WaitForConnection(TUint32 aIapId)
+     *
+     * Waits until connection is created. Asynchronous.
+     *
+     */
+    IMPORT_C void WaitForConnection(TUint32 aIapId);
+
+    /*
+     * WaitUntilConnectionIsClosed(TUint32 aIapId)
+     *
+     * Waits until connection is closed. Asynchronous.
+     *
+     */
+    IMPORT_C void WaitUntilConnectionIsClosed(TUint32 aIapId);
+
+    /*
+     * TBool IsConnectionActive()
+     *
+     * Checks if connection is active
+     *
+     */
+    IMPORT_C TBool IsConnectionActive(TUint32 aIapId);
+
+
+protected: // from CActive
+
+    /*
+     * RunL()
+     *
+     * Handle request completion events
+     *
+     */
+    void RunL();
+
+    /*
+     * DoCancel()
+     *
+     * Cancel any outstanding requests
+     *
+     */
+    void DoCancel();
+
+    // From MTestUtilConnectionObserver
+
+private:
+
+    /*
+     * CTestUtilConnectionWaiter()
+     */
+    CTestUtilConnectionWaiter(MTestUtilConnectionObserver* aObserver);
+
+    /*
+     * ConstructL()
+     */
+    void ConstructL();
+
+    enum TConnectionWaiterState
+    	{
+    	ENoWaitState,
+    	EWaitingConnection,
+    	EWaitingConnectionClosed
+	    };
+
+private:
+
+    MTestUtilConnectionObserver* iObserver;
+
+    TUint32 iIapId;
+
+    RTimer iTimer;
+
+ 	RSocketServ iServ;
+
+	TInt iCheckCount;
+
+	TConnectionWaiterState iWaitState;
+
+    };
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/inc/VCXTestCommon.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,293 @@
+/*
+* 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 CVCXTestCommon_H
+#define CVCXTestCommon_H
+
+//  INCLUDES
+#include "CIptvTestVerifyData.h"
+#include "MTestUtilConnectionObserver.h"
+#include "CIptvTestVideoCreator.h"
+#include "VCXTestConstants.h"
+
+// MACROS
+// FORWARD DECLARATIONS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// CLASS DECLARATION
+
+/**
+*  This class should have no depencies to any Video Center release!
+*  Add functionality with depencies to IptvTestUtility.
+*
+*  @since
+*/
+class CVCXTestCommon : public CBase, public MTestUtilConnectionObserver
+    {
+    public:  // Constructors and destructor
+
+		enum TIptvTestIapType
+			{
+			EWlanIap,  	// Any WLAN AP
+			EGprsIap, 	// Any GPRS AP
+			};
+
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CVCXTestCommon* NewL();
+
+        /**
+        * Destructor.
+        */
+        virtual ~CVCXTestCommon();
+
+    public: // New functions
+
+        /**
+        * Gets size of a file.
+        * @since
+        * @param
+        */
+        IMPORT_C TBool GetFileSize(TDesC& aFullPath, TUint32& aFileSize);
+
+        /**
+        * Searches AP by name.
+        * First searches if there's IAP matchin for the name. After that following rules are used:
+        * If name is Internet tries to find first GPRS AP, Internet2 second GPRS AP
+        * If name is Wlan tries to find first WLAN AP, Wlan2 second WLAN AP
+        * If AP is not found returns on of the known APs, if one is found.
+        */
+        IMPORT_C TBool GetIapIdL(const TDesC& aIapName, TUint32& aIapId);
+
+        /**
+        * Searches AP by name.
+        */
+		IMPORT_C TBool GetIapIdByNameL(const TDesC& aIapName, TUint32& aIapId);
+
+        /**
+        * Searches for AP as defined in TIptvTestIapType. In emulator always returns "Ethernet with Daemon Dynamic IP"
+        * @since
+        * @param aType AP type which is wanted
+        * @param aIapId id of found AP is written here
+        * @param aOrderNumber return nTh AP of the specified type
+        * @return KErrNotFound if no AP with the type is found, KErrNone if no errors,
+        */
+		IMPORT_C TInt GetIapIdByTypeL(TIptvTestIapType aType, TUint32& aIapId, TInt aOrderNumber);
+
+        /**
+        * Returns a name of AP.
+        */
+        IMPORT_C TBool GetIapNameById(TDes& aIapName, TUint32 aIapId);
+
+        /**
+        * Prints APs in COMMDB into debug output.
+        */
+        IMPORT_C void PrintIaps();
+
+  		/**
+        * Initializes the verify file, deletes if the file exists
+        * @since
+        * @param aVerifyId An id to identify the file where verify data is written
+        * @return Error code, KErrNone if no errors,
+        */
+		IMPORT_C TInt CreateVerifyData(TDesC& aVerifyId, TBool aAppend);
+
+		/**
+        * Writes verify data to a file
+        * @since
+        * @param aVerifyId An id to identify the file where verify data is written
+        * @param aVerifyData Data to write into the file
+        * @return Error code, KErrNone if no errors,
+        */
+		IMPORT_C TInt WriteVerifyData(TDesC& aVerifyId, TDesC& aVerifyData);
+
+		/**
+        * Writes verify data to a file
+        * @since
+        * @param aVerifyId An id to identify the file where verify data is written
+        * @param aVerifyData Data to write into the file
+        * @return Error code, KErrNone if no errors,
+        */
+		IMPORT_C TInt WriteVerifyData(TDesC& aVerifyId, TRefByValue<const TDesC> aFmt, ... );
+
+		/**
+        *
+        * @since
+        * @param aVerifyId An id to identify the files which are compared
+        * @param aVerifyResult Result is written here
+        * @return Error code, KErrNone if no errors,
+        */
+		IMPORT_C TInt VerifyData(TDesC& aVerifyId, CIptvTestVerifyData::TVerifyResult& aVerifyResult);
+
+        /**
+        * Enables timestamp writing into the verify file.
+        * @since
+        * @param aUseTimestamps
+        */
+        IMPORT_C void EnableVerifyTimestamps( TBool aUseTimestamps );
+
+        /**
+        * Converts string to integer.
+		* @param aInt parsed int is stored here
+        * @param aString string containing the number
+        * @return KErrNone if succeed, otherwise an error code
+        */
+		IMPORT_C static TInt ParseIntFromString(TInt& aInt, TDesC& aString);
+
+        /**
+        * Creates bad iap for testing purposes
+        * @param aName name of the iap to be created
+        */
+		IMPORT_C TUint32 CreateBadIapL(TDesC& aName);
+
+        /**
+        * static TInt AdvanceSystemTimeSeconds();
+        * @return KErrNone if succeed, otherwise an error code
+        */
+        IMPORT_C static TInt AdvanceSystemTimeSeconds( TInt aCount );
+
+        /**
+        * static TInt AdvanceSystemTimeMinutes();
+        * @return KErrNone if succeed, otherwise an error code
+        */
+        IMPORT_C static TInt AdvanceSystemTimeMinutes( TInt aCount );
+
+        /**
+        * static TInt AdvanceSystemTimeHours();
+        * @return KErrNone if succeed, otherwise an error code
+        */
+        IMPORT_C static TInt AdvanceSystemTimeHours( TInt aCount );
+
+        /**
+        * static TInt SetSystemTime();
+        * @return KErrNone if succeed, otherwise an error code
+        */
+		IMPORT_C static TInt SetSystemTime(TTime aTime);
+
+        /**
+        * static TInt SetTimeZone();
+        * @return KErrNone if succeed, otherwise an error code
+        */
+		IMPORT_C static TInt SetTimeZone(TDesC& aTimeZone);
+
+	    /*
+	     * Creates a video file to the system.
+	     */
+	    IMPORT_C void CreateVideoFileL( CIptvTestVideoCreator::TIptvTestVideoType aVideoType, TDesC& aFileName, TInt aSize );
+
+        /*
+         * Creates video files to the system.
+         */
+        IMPORT_C void CreateVideoFilesL( CIptvTestVideoCreator::TIptvTestVideoType aVideoType, TDesC& aFileName, TInt aCount, RPointerArray<HBufC>& aFileArray );
+
+	    /*
+	     * Sets free space for a drive.
+	     */
+	    IMPORT_C void SetDriveFreeSpaceL( TInt aDriveNumber, TUint aDesiredFreeSpace );
+
+        /**
+         * Deletes files created by SetDriveFreeSpaceL. Should be called by any test module which
+         * has reserved disk space.
+         */
+        IMPORT_C void DeleteDummyFilesL( TInt aDriveNumber );
+
+        /*
+         * Returns KErrNone if file is not in use.
+         */
+        IMPORT_C TInt EnsureFileIsNotInUse( const TPtrC& aFileName );
+
+	    /*
+	     * CalculateSpaceToReserveL
+	     */
+	    void CalculateSpaceToReserveL( RFs &aFs, TInt aDriveNumber, TInt aDesiredSpace, TInt64& aSpaceToReserve );
+
+	    /**
+	     *  PrintDriveInfo
+	     */
+	    void PrintDriveInfo( const TPtrC& aDriveLetter );
+
+	    /**
+	     * ListDir
+	     */
+	    IMPORT_C TInt ListDir( const TDesC& aDir, TInt aLevel );
+
+        /**
+        * Reads integer from P&S.
+        * @return KErrNone if succeed, otherwise an error code
+        */
+        IMPORT_C static TInt GetPSProperty( const TUid aCategory, const TUint aKey, TInt& aValue );
+
+        /**
+        * Writes integer to P&S.
+        * @return KErrNone if succeed, otherwise an error code
+        */
+        IMPORT_C static TInt SetPSProperty( const TUid aCategory, const TUint aKey, const TInt aValue );
+
+        /**
+        * Reads descriptor from P&S.
+        * @return KErrNone if succeed, otherwise an error code
+        */
+        IMPORT_C static TInt GetPSProperty( const TUid aCategory, const TUint aKey, TDes& aValue );
+
+        /**
+        * Writes descriptor to P&S.
+        * @return KErrNone if succeed, otherwise an error code
+        */
+        IMPORT_C static TInt SetPSProperty( const TUid aCategory, const TUint aKey, const TDesC& aValue );
+        
+        /**
+         * Prints open files in the file session and which thread / process is keeping the files open.
+         * @param aFs file session, for example CCoeEnv::Static()->FsSession() as param is good idea. 
+         */
+        IMPORT_C static void ListFilesProcessesAndThreadsL( RFs &aFs );        
+
+    public: // From base classes
+
+        void ConnectionCreated() {};
+        void ConnectionClosed() {};
+        void ConnectionFailed() {};
+        void ConnectionAlreadyExists() {};
+        void ConnectionTimeout() {};
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CVCXTestCommon();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+    private:    // Data
+	    CIptvTestVerifyData*   iIptvVerifyData;
+        CIptvTestVideoCreator* iVideoCreator;
+        RFs iFs;
+    };
+
+
+#endif      // CVCXTestCommon_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/inc/VCXTestConstants.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* 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 VCXTESTCONSTANTS_H
+#define VCXTESTCONSTANTS_H
+
+// CONSTANTS
+const TInt KIptvTestErrNotFound = -1111;
+const TInt KIptvTestNoSignal = -999666;
+
+_LIT(KIptvTestBadIapName, "BadIap");
+
+#endif      // VCXTESTCONSTANTS_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/inc/VCXTestLog.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,106 @@
+/*
+* 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 VCXTESTLOG_H
+#define VCXTESTLOG_H
+
+// INCLUDES
+#include <e32std.h>
+#include <e32svr.h>
+
+//#define FILE_LOGGING_IN_UREL_BUILD 1
+
+// MACROS
+#ifdef _DEBUG
+
+// SELECT LOG TYPE FROM HERE
+// 0 = RDebug
+// 1 = file logging
+// 2 = no logging
+#ifdef __WINSCW__
+    #define LOGTYPE 0
+#else
+    #define LOGTYPE 1
+#endif __WINSCW__
+
+#if LOGTYPE == 0
+      
+    #define VCXLOGLO1(s)               RDebug::Print(_L(#s))
+    #define VCXLOGLO2(s, a)            RDebug::Print(_L(#s), a)
+    #define VCXLOGLO3(s, a, b)         RDebug::Print(_L(#s), a, b)
+    #define VCXLOGLO4(s, a, b, c)      RDebug::Print(_L(#s), a, b, c)
+    #define VCXLOGLO5(s, a, b, c, d)   RDebug::Print(_L(#s), a, b, c, d)
+
+#endif
+
+#if LOGTYPE == 1
+    
+    #include <flogger.h>
+    
+    _LIT(KIPTVLogFolder2,"Fusion");
+    _LIT(KIPTVLogFile2,"Fusion.txt");
+    
+    #define VCXLOGLO1(AAA)                  do { _LIT(tempIPTVLogDes,AAA); RFileLogger::Write(KIPTVLogFolder2(),KIPTVLogFile2(),EFileLoggingModeAppend,tempIPTVLogDes()); } while ( EFalse )
+    #define VCXLOGLO2(AAA,BBB)              do { _LIT(tempIPTVLogDes,AAA); RFileLogger::WriteFormat(KIPTVLogFolder2(),KIPTVLogFile2(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempIPTVLogDes()),BBB); } while ( EFalse )
+    #define VCXLOGLO3(AAA,BBB,CCC)          do { _LIT(tempIPTVLogDes,AAA); RFileLogger::WriteFormat(KIPTVLogFolder2(),KIPTVLogFile2(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempIPTVLogDes()),BBB,CCC); } while ( EFalse )
+    #define VCXLOGLO4(AAA,BBB,CCC,DDD)      do { _LIT(tempIPTVLogDes,AAA); RFileLogger::WriteFormat(KIPTVLogFolder2(),KIPTVLogFile2(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempIPTVLogDes()),BBB,CCC,DDD); } while ( EFalse )
+    #define VCXLOGLO5(AAA,BBB,CCC,DDD,EEE)  do { _LIT(tempIPTVLogDes,AAA); RFileLogger::WriteFormat(KIPTVLogFolder2(),KIPTVLogFile2(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempIPTVLogDes()),BBB,CCC,DDD,EEE); } while ( EFalse )
+    
+#endif
+
+#if LOGTYPE == 2
+   
+    #define VCXLOGLO1(s)               
+    #define VCXLOGLO2(s, a)           
+    #define VCXLOGLO3(s, a, b)       
+    #define VCXLOGLO4(s, a, b, c)     
+    #define VCXLOGLO5(s, a, b, c, d)
+
+#endif
+
+#else // _DEBUG
+
+    #ifdef FILE_LOGGING_IN_UREL_BUILD
+    
+    #include <flogger.h>
+    
+    _LIT(KIPTVLogFolder2,"Fusion");
+    _LIT(KIPTVLogFile2,"Fusion.txt");
+    
+    #define VCXLOGLO1(AAA)                  do { _LIT(tempIPTVLogDes,AAA); RFileLogger::Write(KIPTVLogFolder2(),KIPTVLogFile2(),EFileLoggingModeAppend,tempIPTVLogDes()); } while ( EFalse )
+    #define VCXLOGLO2(AAA,BBB)              do { _LIT(tempIPTVLogDes,AAA); RFileLogger::WriteFormat(KIPTVLogFolder2(),KIPTVLogFile2(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempIPTVLogDes()),BBB); } while ( EFalse )
+    #define VCXLOGLO3(AAA,BBB,CCC)          do { _LIT(tempIPTVLogDes,AAA); RFileLogger::WriteFormat(KIPTVLogFolder2(),KIPTVLogFile2(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempIPTVLogDes()),BBB,CCC); } while ( EFalse )
+    #define VCXLOGLO4(AAA,BBB,CCC,DDD)      do { _LIT(tempIPTVLogDes,AAA); RFileLogger::WriteFormat(KIPTVLogFolder2(),KIPTVLogFile2(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempIPTVLogDes()),BBB,CCC,DDD); } while ( EFalse )
+    #define VCXLOGLO5(AAA,BBB,CCC,DDD,EEE)  do { _LIT(tempIPTVLogDes,AAA); RFileLogger::WriteFormat(KIPTVLogFolder2(),KIPTVLogFile2(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempIPTVLogDes()),BBB,CCC,DDD,EEE); } while ( EFalse )
+
+    #else // FILE_LOGGING_IN_UREL_BUILD
+
+    #define VCXLOGLO1(s)
+    #define VCXLOGLO2(s, a)
+    #define VCXLOGLO3(s, a, b)
+    #define VCXLOGLO4(s, a, b, c)
+    #define VCXLOGLO5(s, a, b, c, d)
+  
+    #endif // FILE_LOGGING_IN_UREL_BUILD
+
+#endif // _DEBUG
+
+
+#endif  // VCXTESTLOG_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/inc/VCXTestMessageWait.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,149 @@
+/*
+* 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 VCXTESTMESSAGEWAIT_H_
+#define VCXTESTMESSAGEWAIT_H_
+
+//  INCLUDES
+#include <e32base.h>
+#include "MIptvTestTimerObserver.h"
+
+// CONSTANTS
+
+// MACROS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+class CIptvTestActiveWait;
+class CIptvTestTimer;
+
+/**
+* MVCXTestMessageWaitObserver
+*/
+class MVCXTestMessageWaitObserver
+    {
+    public:
+    
+	    /**
+	    * Called when message queue empties or there's timeout.
+	    */
+    	virtual void MessageWaitComplete( TInt aError ) = 0;
+    
+    };
+
+/**
+* CVCXTestMessageWait
+*/
+class CVCXTestMessageWait : public CBase, public MIptvTestTimerObserver
+    {
+    public:  // Constructors and destructor
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CVCXTestMessageWait * NewL( MVCXTestMessageWaitObserver* aObserver );
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CVCXTestMessageWait ();
+
+
+    public: // New functions
+
+		/**
+		* Resets already received messages, wait queue and cancels previous receiving.  
+		*/		
+		IMPORT_C void Reset();
+
+        /**
+        * Resets only already received messages.  
+        */      
+        IMPORT_C void ResetReceivedMessages();
+        
+		/**
+		* Adds message to the wait queue.
+		*/
+		IMPORT_C void AddMessage( TInt32 aMsg );
+		
+		/**
+		* Waits for a message. Calls observer callback when message is received. This will reset 
+		* previously added messages. 
+		*/		
+		IMPORT_C void WaitForMessageL( TInt32 aMsg, TInt aTimeoutSeconds, TBool aDoBlock );
+		
+		/**
+		* Waits for the added messages. Calls observer callback when messages have been received.
+		*/		
+		IMPORT_C void WaitForAllL( TInt aTimeoutSeconds, TBool aDoBlock );
+		
+        /**
+        * Waits until messages have not been received for the specified seconds. 
+        */      
+        IMPORT_C void CoolDownL( TInt aSeconds );		
+
+		/**
+		* Checks wait queue for the message.
+		*/		
+		IMPORT_C void ReceiveMessage( TInt32 aMsg, TInt aError );
+		
+    public: // From base classes.
+        
+        void TimerComplete( TInt aTimerId, TInt aError );
+    
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CVCXTestMessageWait( MVCXTestMessageWaitObserver* aObserver );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        IMPORT_C void ConstructL();
+
+    private:    // Data
+		
+		MVCXTestMessageWaitObserver* iObserver;
+		
+	    CIptvTestActiveWait* iActiveWaitBlocking;
+	    
+	    CIptvTestTimer* iTimeoutTimer;
+	    
+	    // Messages which are received while waited messages array is empty.
+	    RArray<TInt32> iReceivedMessages;
+	    
+	    RArray<TInt32> iWaitedMessages;
+	  
+	    TInt iTimeoutSeconds;
+	    
+	    TBool iWaitStarted;
+	    
+	    TBool iCoolingDown;
+	    
+	    TInt iError;
+    };
+
+#endif // VCXTESTMESSAGEWAIT_H_
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/inc/VCXTestPSObserver.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,32 @@
+/*
+* 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 VCXTESTPSOBSERVER_H
+#define VCXTESTPSOBSERVER_H
+
+#include <e32def.h>
+#include <e32cmn.h>
+
+class MVCXTestPSObserver
+    {
+public:
+    virtual void ValueChangedL( const TUid& aUid, const TUint32& aKey, const TInt&  aValue ) = 0;
+    virtual void ValueChangedL( const TUid& aUid, const TUint32& aKey, const TDesC& aValue ) = 0;
+    };
+
+#endif // VCXTESTPSOBSERVER_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/inc/VCXTestPSSubscriber.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,174 @@
+/*
+* 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 VCXTESTPSSUBSCRIBER_H
+#define VCXTESTPSSUBSCRIBER_H
+
+#include <e32base.h>	// For CActive, link against: euser.lib
+#include <e32std.h>		// For RTimer, link against: euser.lib
+
+#include <e32property.h>
+
+class MVCXTestPSObserver;
+
+class CVCXTestPSSubscriber : public CActive
+    {
+    public:
+
+        /**
+         * Construction.
+         *
+         * @param aUid      category for the property
+         * @param aKey      key id for the property
+         * @param aType     type of the key (at the moment only int and text are supported)
+         * @param aObserver pointer to observer to who to notify about changes
+         *
+         * @return The newly constructed CVcxConnUtilPubSub
+         */
+        IMPORT_C static CVCXTestPSSubscriber* NewL( const TUid aUid,
+                                             const TUint32 aKey,
+                                             RProperty::TType aType,
+                                             MVCXTestPSObserver* aObserver );
+
+        /**
+         * Destructor.
+         *
+         */
+        IMPORT_C virtual ~CVCXTestPSSubscriber();
+
+        /**
+         * Returns a pubsub value from this property
+         *
+         *@param &aValue value to fetch
+         *
+         *@return TInt KErrNone or some system level error code
+         */
+        IMPORT_C TInt Get( TInt& aValue );
+
+        /**
+         * Returns a pubsub value from this property
+         *
+         *@param &aValue value tofetch
+         *
+         *@return TInt KErrNone or some system level error code
+         */
+        IMPORT_C TInt Get( TDes& aValue );
+
+        /**
+         * Sets a pubsub value from this property
+         *
+         *@param aValue value to set
+         *
+         *@return TInt KErrNone or some system level error code
+         */
+        IMPORT_C TInt Set( TInt& aValue );
+
+        /**
+         * Sets a pubsub value from this property
+         *
+         *@param aValue value to set
+         *
+         *@return TInt KErrNone or some system level error code
+         */
+        IMPORT_C TInt Set( const TDesC& aValue );
+
+        /**
+         * Start subscribing if not already started
+         */
+        IMPORT_C void Start();
+
+        /**
+         * Activate safe wait object to wait modifications
+         */
+        IMPORT_C void WaitChangeL();
+
+        /**
+         * Explicitly ends waiting
+         */
+        IMPORT_C void EndWait();
+
+    private:  // constuct / destruct
+
+        /**
+         * Constructor
+         *
+         */
+        CVCXTestPSSubscriber( const TUid aUid,
+                                const TUint32 aKey,
+                                RProperty::TType aType,
+                                MVCXTestPSObserver* aObserver );
+
+        /**
+         * Symbian 2nd phase construction
+         *
+         */
+        void ConstructL();
+
+    private: // from CActive
+
+        /**
+         * From CActive. Calles when value subscribed to changes
+         *
+         */
+        void RunL();
+
+        /**
+         * From CActive. Cancels subscribtion
+         *
+         */
+        void DoCancel();
+
+    private:
+
+        /**
+         * ETrue if object is initialized and subscribtion starts
+         */
+        TBool                    iInitialized;
+
+        /**
+         * Property to subscribe
+         */
+        RProperty                iProperty;
+
+        /**
+         * Category uid for the property
+         */
+        const TUid               iUid;
+
+        /**
+         * Key id for the property
+         */
+        const TUint32            iKey;
+
+        /**
+         * type of the property
+         */
+        RProperty::TType         iKeyType;
+
+        /**
+         * Waiter object for data change
+         */
+        CActiveSchedulerWait* iSafeWait;
+
+        /**
+         * Observer
+         */
+        MVCXTestPSObserver* iObserver;
+    };
+
+#endif // VCXTESTPSSUBSCRIBER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/inc/VCXTestStatsKeeper.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,236 @@
+/*
+* 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 VCXTESTSTATSKEEPER_H
+#define VCXTESTSTATSKEEPER_H
+
+//  INCLUDES
+#include <e32base.h>
+
+// CONSTANTS
+
+// MACROS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+* Class to hold a single statistics item.
+*/
+class CVCXTestStatsItem : public CBase
+    {
+    public:  // Constructors and destructor
+    
+        /**
+        * Two-phased constructor.
+        */
+        static CVCXTestStatsItem* NewL();
+
+        /**
+        * Destructor.
+        */
+        virtual ~CVCXTestStatsItem();
+	
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CVCXTestStatsItem();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+    
+    public: // Data
+
+        TBool iIsActive;
+        
+        TInt32 iId;
+        HBufC* iDescId;
+        HBufC* iDesc;
+        TInt iError;
+        TTime iStartTime;
+        TTime iEndTime;
+        
+        RPointerArray<HBufC> iTraces;
+        RPointerArray<CVCXTestStatsItem> iProgresses;
+    };
+
+/**
+* Class to hold summary for statistics.
+*/
+class CVCXTestStatsItemSummary : public CBase
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        */
+        static CVCXTestStatsItemSummary* NewL();
+
+        /**
+        * Destructor.
+        */
+        virtual ~CVCXTestStatsItemSummary();
+    
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CVCXTestStatsItemSummary();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+    
+    public: // Data
+        TInt32 iId;
+        HBufC* iDescId;
+        HBufC* iDesc;
+        
+        TUint iCount;
+        TUint iFailCount;
+
+        // These are all microseconds.
+        TInt64 iMinTime;
+        TInt64 iMaxTime;
+        TReal iAvgTime;
+        
+        TInt64 iTotalTime;
+        TInt64 iFailTime;
+    };
+
+/**
+* Class to keep track of statistics.
+*/
+class CVCXTestStatsKeeper : public CBase
+    {
+    public:  // Constructors and destructor
+    
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CVCXTestStatsKeeper* NewL();
+
+        /**
+        * Destructor.
+        */
+        virtual ~CVCXTestStatsKeeper ();
+
+    public: // New functions
+
+    	/**
+    	* Sets the name and filename for statistics. Report is written when class is desctructed.
+    	*/
+		IMPORT_C void StartStatsKeepingL( const TDesC& aName, const TDesC& aFileName );
+
+		/**
+		 * Adds an action to the statistics lists.
+		 */
+		IMPORT_C void ActionStartL( TInt32 aId, const TDesC& aDesc );
+
+        /**
+         * Adds an action to the statistics lists. 
+         * if param aDescMerge is true then action descsription will contain the descid. 
+         */
+        IMPORT_C void ActionStartL( const TDesC& aDescId, const TDesC& aDesc, TBool aDescMerge = EFalse );
+		
+		/**
+		 * Ends an action.
+		 * Leaves with KErrAbort if more than 33% of actions have failed. Test should abort itself in that case.
+		 */
+		IMPORT_C void ActionEndL( TInt32 aId, TInt aError );
+
+        /**
+         * Ends an action.
+         * Leaves with KErrAbort if more than 33% of actions have failed. Test should abort itself in that case.
+         */
+        IMPORT_C void ActionEndL( const TDesC& aDescId, TInt aError );
+		
+		/**
+		 * Sets progress information for an action. These are saved in the report.
+		 */
+		IMPORT_C void ActionProgressL( TInt32 aId, const TDesC& aProgressDesc );
+
+        /**
+         * Sets progress information for an action. These are saved in the report.
+         */
+        IMPORT_C void ActionProgressL( const TDesC& aDescId, const TDesC& aProgressDesc );
+		
+		/**
+		 * Generic trace for different actions. Last 20 of these are saved in the report only if action fails.
+		 */
+		IMPORT_C void ActionTraceL( const TDesC& aDesc );
+		
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CVCXTestStatsKeeper();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+    private: // New functions.
+        
+        CVCXTestStatsItem* GetActiveAction( TInt32 aId );
+        
+        CVCXTestStatsItem* GetActiveAction( const TDesC& aDesc );
+        
+        CVCXTestStatsItem* GetLastActiveAction( TBool aOnlyDescId );
+        
+        TInt FormatDate( const TTime& aDate, TDes& aStr );
+        
+        void GenerateReportL( const TDesC& aFileName, TBool aFullReport );
+        
+        TUint DataSizeL();
+        
+        void CheckFailsL();
+
+        void GetActionSummariesL( RPointerArray<CVCXTestStatsItemSummary>& aSummaries, TBool aFailActiveActions );
+        
+    private:    // Data
+
+        TBool iStarted;
+        
+        HBufC* iReportName;
+        
+        HBufC* iReportFileName;       
+        
+        RPointerArray<CVCXTestStatsItem> iActions;
+        
+        RPointerArray<HBufC> iTraces;
+        
+        TBool iAbortedBecauseTooManyFails;
+    };
+
+#endif      // VCXTESTSTATSKEEPER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/inc/VCXTestTimerWait.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,62 @@
+/*
+* 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 VCXTIMERWAIT_H
+#define VCXTIMERWAIT_H
+
+//  INCLUDES
+#include <e32base.h>
+#include "VCXTestLog.h"
+#include "MIptvTestTimerObserver.h"
+
+// FORWARD DECLARATIONS
+class CIptvTestTimer;
+class CIptvTestActiveWait;
+
+// DATA TYPES
+
+// CLASS DECLARATION
+
+/**
+ * Timer waiter class.
+ */
+class CVCXTestTimerWait : public CBase, public MIptvTestTimerObserver
+    {
+    public:
+        IMPORT_C static CVCXTestTimerWait* NewL();
+
+        IMPORT_C ~CVCXTestTimerWait();
+
+        IMPORT_C void WaitL( TUint32 aMicroSeconds );
+
+    public:
+        void TimerComplete(TInt aTimerId, TInt aError);
+
+    private:
+
+        IMPORT_C void ConstructL();
+
+        CVCXTestTimerWait();
+
+    private:
+        CIptvTestTimer* iTimer;
+        CIptvTestActiveWait* iWait;
+
+    };
+
+#endif // VCXTIMERWAIT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/init/TestFramework.ini	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,165 @@
+#
+# This is STIFTestFramework 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.
+
+[Engine_Defaults]
+
+TestReportMode= FullReport    # Possible values are: 
+                              # 'Summary', 'Environment', 'TestCases' or 'FullReport'
+
+CreateTestReport= YES         # Possible values: YES or NO
+
+TestReportFilePath= C:\Logs\Fusion\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT         # Possible values: TXT or HTML
+TestReportOutput= FILE        # Possible values: FILE or RDEBUG
+TestReportFileCreationMode= APPEND # Possible values: OVERWRITE or APPEND
+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\VCXTestCommon.cfg
+[End_Module]
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework 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)'#' 
+
+CreateLogDirectories= YES    # Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML         # Possible values: TXT or HTML
+#EmulatorOutput= FILE         # Possible values: FILE or RDEBUG
+
+#HardwareBasePath=  C:\
+#HardwareFormat= TXT			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+FileCreationMode= APPEND  # 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
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/src/CIptvTestActiveWait.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,194 @@
+/*
+* 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 "CIptvTestActiveWait.h"
+#include "VCXTestLog.h"
+
+// EXTERNAL DATA STRUCTURES
+
+// EXTERNAL FUNCTION PROTOTYPES
+
+// CONSTANTS
+
+// MACROS
+
+// LOCAL CONSTANTS AND MACROS
+
+// MODULE DATA STRUCTURES
+
+// LOCAL FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CIptvTestActiveWait::
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CIptvTestActiveWait* CIptvTestActiveWait::NewL()
+    {
+    VCXLOGLO1(">>>CIptvTestActiveWait::NewL");
+    CIptvTestActiveWait* self = new (ELeave) CIptvTestActiveWait();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+    VCXLOGLO1("<<<CIptvTestActiveWait::NewL");
+    return self;
+    }
+// -----------------------------------------------------------------------------
+// CIptvTestActiveWait::~CIptvTestActiveWait
+// destructor
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CIptvTestActiveWait::~CIptvTestActiveWait()
+    {
+    VCXLOGLO1(">>>CIptvTestActiveWait::~CIptvTestActiveWait");
+
+    ActiveWait(EActiveWaitStop);
+    delete iActiveSchedulerWait;
+    iActiveSchedulerWait = NULL;
+
+    VCXLOGLO1("<<<CIptvTestActiveWait::~CIptvTestActiveWait");
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestActiveWait::~CIptvTestActiveWait
+// destructor
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CIptvTestActiveWait::CIptvTestActiveWait()
+    {
+    VCXLOGLO1(">>>CIptvTestActiveWait::CIptvTestActiveWait");
+
+
+    VCXLOGLO1("<<<CIptvTestActiveWait::CIptvTestActiveWait");
+    }
+
+
+// -----------------------------------------------------------------------------
+// CIptvTestActiveWait::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CIptvTestActiveWait::ConstructL()
+    {
+    VCXLOGLO1(">>>CIptvTestActiveWait::ConstructL");
+
+    iActiveSchedulerWait = new (ELeave) CActiveSchedulerWait;
+
+    VCXLOGLO1("<<<CIptvTestActiveWait::ConstructL");
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestActiveWait::ActiveWait
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CIptvTestActiveWait::ActiveWait( TIptvTestActiveWaitCmd aActiveWaitCmd )
+    {
+    VCXLOGLO1(">>>CIptvTestActiveWait::ActiveWait");
+
+  	VCXLOGLO2("aActiveWaitCmd=%d", aActiveWaitCmd );
+
+	switch( aActiveWaitCmd )
+		{
+		case EActiveWaitStart:
+		    {
+		    if( !iActiveSchedulerWait->IsStarted() )
+		        {
+		        iActiveSchedulerWait->Start();
+		        }
+		    else
+		        {
+		        VCXLOGLO1("ActiveSchedulerWait already started");
+		        }
+		    }
+			break;
+		case EActiveWaitStop:
+		    {
+			if( iActiveSchedulerWait->IsStarted() )
+				{
+				iActiveSchedulerWait->AsyncStop();
+				}
+			else
+		        {
+		        VCXLOGLO1("ActiveSchedulerWait already stopped");
+		        }
+			}
+			break;
+		default:
+			break;
+		}
+
+    VCXLOGLO1("<<<CIptvTestActiveWait::ActiveWait");
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestActiveWait::IsWaiting
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CIptvTestActiveWait::IsWaiting()
+    {
+    return iActiveSchedulerWait->IsStarted();
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestActiveWait::Start
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CIptvTestActiveWait::Start( )
+    {
+    TInt err = KErrNotReady;
+    if( !iActiveSchedulerWait->IsStarted() )
+        {
+        iActiveSchedulerWait->Start();
+        err = KErrNone;
+        }
+    else
+        {
+        VCXLOGLO1("ActiveSchedulerWait already started");
+        }
+    return err;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestActiveWait::Stop
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CIptvTestActiveWait::Stop( )
+    {
+    TInt err = KErrNotReady;
+    if( iActiveSchedulerWait->IsStarted() )
+        {
+        iActiveSchedulerWait->AsyncStop();
+        err = KErrNone;
+        }
+    else
+        {
+        VCXLOGLO1("ActiveSchedulerWait already stopped");
+        }
+    return err;
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/src/CIptvTestEvent.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -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 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: 
+*
+*/
+
+
+//  INCLUDES
+#include "CIptvTestEvent.h"
+#include "VCXTestLog.h"
+
+EXPORT_C CIptvTestEvent::~CIptvTestEvent()
+    {
+    }
+
+EXPORT_C TBool CIptvTestEvent::HasTimeouted(TTime& aTimeNow)
+    {
+	if(!iActive)
+		{
+		return EFalse;
+		}
+	TTimeIntervalSeconds secondsAlive;
+	aTimeNow.SecondsFrom(iActivationTime, secondsAlive);
+
+	VCXLOGLO3("CIptvTestEvent:: '%S' seconds to timeout: %d", &iName, iTimeoutSeconds - secondsAlive.Int() );
+
+	if(secondsAlive.Int() >= iTimeoutSeconds)
+		{
+		return ETrue;
+		}
+	return EFalse;
+    }
+
+EXPORT_C CIptvTestEvent::CIptvTestEvent( const TDesC& aName, TInt aTimeoutSeconds)
+    {
+	iName = _L("Noname Event");
+	iName = aName;
+	iTimeoutSeconds = aTimeoutSeconds;
+	iActive = EFalse;
+    }
+
+void CIptvTestEvent::ConstructL()
+    {
+    }
+
+EXPORT_C void CIptvTestEvent::GetName(TDes& aName)
+	{
+	aName = iName;
+	}
+
+
+EXPORT_C void CIptvTestEvent::Activate()
+	{
+	iActive = ETrue;
+	iActivationTime.UniversalTime();
+	VCXLOGLO2("ACTIVATED %S", &iName);
+	}
+
+EXPORT_C void CIptvTestEvent::Deactivate()
+	{
+	iActive = EFalse;
+	VCXLOGLO2("DEACTIVATED %S", &iName);
+	}
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/src/CIptvTestEventWaiter.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,327 @@
+/*
+* 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: 
+*
+*/
+
+
+//  INCLUDES
+#include "CIptvTestEventWaiter.h"
+#include "MIptvTestEventWaiterObserver.h"
+#include "CIptvTestEvent.h"
+#include "VCXTestLog.h"
+
+// -----------------------------------------------------------------------------
+// CIptvTestEventWaiter::NewL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CIptvTestEventWaiter* CIptvTestEventWaiter::NewL(MIptvTestEventWaiterObserver& aObserver)
+{
+	VCXLOGLO1(">>>CIptvTestEventWaiter::NewL");
+	CIptvTestEventWaiter* self = new (ELeave) CIptvTestEventWaiter(aObserver);
+
+	CleanupStack::PushL( self );
+	self->ConstructL();
+	CleanupStack::Pop( self );
+	VCXLOGLO1("<<<CIptvTestEventWaiter::NewL");
+	return self;
+}
+
+// -----------------------------------------------------------------------------
+// CIptvTestEventWaiter::~CIptvTestEventWaiter
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CIptvTestEventWaiter::~CIptvTestEventWaiter()
+{
+	VCXLOGLO1(">>>CIptvTestEventWaiter::~CIptvTestEventWaiter");
+   	if( IsAdded() )
+        {
+        Deque(); // calls also Cancel()
+        }
+
+	iTimer.Close();
+
+	Reset();
+	VCXLOGLO1("<<<CIptvTestEventWaiter::~CIptvTestEventWaiter");
+}
+
+// -----------------------------------------------------------------------------
+// CIptvTestEventWaiter::CheckTimeouts
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CIptvTestEventWaiter::CheckTimeouts()
+{
+	VCXLOGLO1(">>>CIptvTestEventWaiter::CheckTimeouts");
+	TTime now;
+	now.UniversalTime();
+
+	TInt i;
+	for(i=0; i<iEventQueue.Count();i++)
+		{
+		CIptvTestEvent* event = iEventQueue[i];
+		if( event->HasTimeouted( now ) )
+			{
+			VCXLOGLO1("CIptvTestEventWaiter:: event timedout");
+			iObserver.EventWaiterErrorL( KErrTimedOut, *event );
+			VCXLOGLO1("<<<CIptvTestEventWaiter::CheckTimeouts");
+			return KErrTimedOut;
+			}
+		}
+
+	for(i=0; i<iEventDump.Count();i++)
+		{
+		CIptvTestEvent* event = iEventDump[i];
+		if( event->HasTimeouted( now ) )
+			{
+			VCXLOGLO1("CIptvTestEventWaiter:: event timedout");
+			iObserver.EventWaiterErrorL( KErrTimedOut, *event );
+			VCXLOGLO1("<<<CIptvTestEventWaiter::CheckTimeouts");
+			return KErrTimedOut;
+			}
+		}
+
+	VCXLOGLO1("<<<CIptvTestEventWaiter::CheckTimeouts");
+
+	return KErrNone;
+}
+
+// -----------------------------------------------------------------------------
+// CIptvTestEventWaiter::AddEvent
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CIptvTestEventWaiter::AddEvent(CIptvTestEvent* aEvent, TBool aSequential)
+{
+	VCXLOGLO1(">>>CIptvTestEventWaiter::AddEvent");
+
+	if(aSequential)
+		{
+		// First event in queue, activate it
+		if(iEventQueue.Count() <= 0)
+			{
+			aEvent->Activate();
+			}
+		// Add event
+		iEventQueue.Append( aEvent );
+		}
+	else
+		{
+		// All events in dump are active
+		iEventDump.Append( aEvent );
+		aEvent->Activate();
+		}
+
+	if( !IsActive() )
+		{
+		iTimer.After(iStatus, 1000000); // once in second
+		SetActive();
+		}
+
+	VCXLOGLO1("<<<CIptvTestEventWaiter::AddEvent");
+	return KErrNone;
+}
+
+// -----------------------------------------------------------------------------
+// CIptvTestEventWaiter::EventHappened
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CIptvTestEventWaiter::EventHappened(CIptvTestEvent* aEvent, CIptvTestEvent** aQueuedEvent)
+{
+	VCXLOGLO1(">>>CIptvTestEventWaiter::EventHappened");
+	TBool eventFound = EFalse;
+
+	// Check first from the queue.
+
+	VCXLOGLO1("Event queue:");
+
+	for(TInt i=0; i<iEventQueue.Count();i++)
+		{
+		CIptvTestEvent* event = iEventQueue[i];
+		TBuf<32> name;
+		event->GetName(name);
+		VCXLOGLO3(" queue %d: %S, %d", i, &name);
+		}
+
+	//CheckTimeouts();
+
+	if(iEventQueue.Count() > 0)
+		{
+		CIptvTestEvent* event = iEventQueue[0];
+		TBuf<32> name;
+		event->GetName(name);
+		VCXLOGLO2(" - %S", &name);
+
+		if( !eventFound && event->Compare( *aEvent ) )
+			{
+			iEventQueue.Remove( 0 );
+			if(iEventQueue.Count() > 0)
+				{
+				iEventQueue[0]->Activate();
+				}
+			iPastEvents.Append( event );
+			eventFound = ETrue;
+
+			*aQueuedEvent = event;
+
+			VCXLOGLO1("*Match*");
+			}
+		}
+
+	// Check if the event is in the dump, meaning it can happen any time.
+
+	VCXLOGLO1("Event dump:");
+
+	if(!eventFound)
+		{
+		for(TInt i=0; i<iEventDump.Count();i++)
+			{
+			CIptvTestEvent* event = iEventDump[i];
+
+			TBuf<32> name;
+			event->GetName(name);
+			VCXLOGLO2(" - %S", &name);
+
+			if( !eventFound && event->Compare( *aEvent ) )
+				{
+				iEventDump.Remove( i );
+				iPastEvents.Append( event );
+				eventFound = ETrue;
+				*aQueuedEvent = event;
+				VCXLOGLO1("*Match*");
+				}
+			}
+		}
+
+	// Event was found and there's no more events in queues. Message observer that all events are validated.
+
+	if( eventFound && iEventQueue.Count() == 0 && iEventDump.Count() == 0 )
+		{
+		iObserver.EventWaiterAllEventsValidated();
+		}
+
+	if( !eventFound )
+		{
+		VCXLOGLO1("CIptvTestEventWaiter:: Event not found from queues.");
+
+		if(iEventQueue.Count() > 0)
+			{
+			CIptvTestEvent* event = iEventQueue[0];
+			*aQueuedEvent = event;
+			}
+
+		VCXLOGLO1("<<<CIptvTestEventWaiter::EventHappened");
+		return KErrNotFound;
+		}
+
+	VCXLOGLO1("<<<CIptvTestEventWaiter::EventHappened");
+	return KErrNone;
+}
+
+// -----------------------------------------------------------------------------
+// CIptvTestEventWaiter::Reset
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CIptvTestEventWaiter::Reset()
+{
+	VCXLOGLO1(">>>CIptvTestEventWaiter::Reset");
+	iEventQueue.ResetAndDestroy();
+	iEventDump.ResetAndDestroy();
+	iPastEvents.ResetAndDestroy();
+	VCXLOGLO1("<<<CIptvTestEventWaiter::Reset");
+	return KErrNone;
+}
+
+
+// -----------------------------------------------------------------------------
+// CIptvTestEventWaiter::GetEventCount
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CIptvTestEventWaiter::GetEventCount()
+{
+	VCXLOGLO1(">>>CIptvTestEventWaiter::GetEventCount");
+	TInt count = 0;
+	count += iEventQueue.Count();
+	count += iEventDump.Count();
+	VCXLOGLO2("<<<CIptvTestEventWaiter:: events in queue: %d", count);
+
+	VCXLOGLO1("<<<CIptvTestEventWaiter::GetEventCount");
+	return count;
+}
+
+// -----------------------------------------------------------------------------
+// CIptvTestEventWaiter::CIptvTestEventWaiter
+// -----------------------------------------------------------------------------
+//
+CIptvTestEventWaiter::CIptvTestEventWaiter(MIptvTestEventWaiterObserver& aObserver)
+ : CActive(CActive::EPriorityStandard), iObserver(aObserver)
+{
+
+}
+
+// -----------------------------------------------------------------------------
+// CIptvTestEventWaiter::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CIptvTestEventWaiter::ConstructL()
+{
+	VCXLOGLO1(">>>CIptvTestEventWaiter::ConstructL");
+	User::LeaveIfError(iTimer.CreateLocal());
+	CActiveScheduler::Add(this);
+	VCXLOGLO1("<<<CIptvTestEventWaiter::ConstructL");
+}
+
+// ---------------------------------------------------------------------------
+// CTestUtilConnectionWaiter::RunL()
+//
+// Handle request completion events
+// ---------------------------------------------------------------------------
+//
+void CIptvTestEventWaiter::RunL()
+	{
+ 	//VCXLOGLO1(">>>CIptvTestEventWaiter::RunL");
+
+//    TInt statusCode = iStatus.Int();
+
+	CheckTimeouts();
+
+	// Start timer again if waiting for events
+
+	if(iEventQueue.Count() > 0 || iEventDump.Count() > 0)
+		{
+
+		if( !IsActive() )
+			{
+			iTimer.After(iStatus, 1000000); // once in second
+			SetActive();
+			}
+		}
+
+
+    //VCXLOGLO1("<<<CIptvTestEventWaiter::RunL");
+	}
+
+// ---------------------------------------------------------------------------
+// CIptvTestEventWaiter::DoCancel()
+//
+// Cancels ongoing requests
+// ---------------------------------------------------------------------------
+//
+void CIptvTestEventWaiter::DoCancel()
+	{
+	VCXLOGLO1(">>>CIptvTestEventWaiter::DoCancel");
+	iTimer.Cancel();
+	VCXLOGLO1("<<<CIptvTestEventWaiter::DoCancel");
+    }
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/src/CIptvTestMobilecrashWatcher.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,299 @@
+/*
+* 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 <BAUTILS.H>
+#include <S32FILE.H>
+
+#include "CIptvTestMobilecrashWatcher.h"
+#include "VCXTestLog.h"
+
+// EXTERNAL DATA STRUCTURES
+
+// EXTERNAL FUNCTION PROTOTYPES
+
+// CONSTANTS
+
+// MACROS
+
+// LOCAL CONSTANTS AND MACROS
+
+// MODULE DATA STRUCTURES
+
+// LOCAL FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+_LIT(KDriveC, "C:\\");
+_LIT(KDriveE, "E:\\");
+_LIT(KDriveF, "F:\\");
+
+// -----------------------------------------------------------------------------
+// CIptvTestMobilecrashWatcher::
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CIptvTestMobilecrashWatcher* CIptvTestMobilecrashWatcher::NewL()
+    {
+    VCXLOGLO1(">>>CIptvTestMobilecrashWatcher::NewL");
+    CIptvTestMobilecrashWatcher* self = new (ELeave) CIptvTestMobilecrashWatcher( );
+    CleanupStack::PushL(self);
+    self->ConstructL(ETrue);
+    CleanupStack::Pop();
+    VCXLOGLO1("<<<CIptvTestMobilecrashWatcher::NewL");
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestMobilecrashWatcher::
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CIptvTestMobilecrashWatcher* CIptvTestMobilecrashWatcher::NewL(TBool aPanicEnabled)
+    {
+    VCXLOGLO1(">>>CIptvTestMobilecrashWatcher::NewL");
+    CIptvTestMobilecrashWatcher* self = new (ELeave) CIptvTestMobilecrashWatcher( );
+    CleanupStack::PushL(self);
+    self->ConstructL(aPanicEnabled);
+    CleanupStack::Pop();
+    VCXLOGLO1("<<<CIptvTestMobilecrashWatcher::NewL");
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestMobilecrashWatcher::~CIptvTestMobilecrashWatcher
+// destructor
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CIptvTestMobilecrashWatcher::~CIptvTestMobilecrashWatcher()
+    {
+    VCXLOGLO1(">>>CIptvTestMobilecrashWatcher::~CIptvTestMobilecrashWatcher");
+
+   	iCrashesBefore.ResetAndDestroy();
+   	iCrashesNow.ResetAndDestroy();
+   	iFsSession.Close();
+
+    VCXLOGLO1("<<<CIptvTestMobilecrashWatcher::~CIptvTestMobilecrashWatcher");
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestMobilecrashWatcher::CIptvTestMobilecrashWatcher
+// -----------------------------------------------------------------------------
+//
+CIptvTestMobilecrashWatcher::CIptvTestMobilecrashWatcher()
+    {
+    VCXLOGLO1(">>>CIptvTestMobilecrashWatcher::CIptvTestMobilecrashWatcher");
+
+
+    VCXLOGLO1("<<<CIptvTestMobilecrashWatcher::CIptvTestMobilecrashWatcher");
+    }
+
+
+// -----------------------------------------------------------------------------
+// CIptvTestMobilecrashWatcher::ConstructL()
+// -----------------------------------------------------------------------------
+//
+void CIptvTestMobilecrashWatcher::ConstructL(TBool aPanicEnabled)
+    {
+    VCXLOGLO1(">>>CIptvTestMobilecrashWatcher::ConstructL");
+
+	iPanicEnabled = aPanicEnabled;
+	iFsSession.Connect();
+
+    iCrashesBefore.ResetAndDestroy();
+	TRAP_IGNORE( ReadMobilecrashesL(iCrashesBefore, KDriveC) );
+	TRAP_IGNORE( 	ReadMobilecrashesL(iCrashesBefore, KDriveE) );
+	TRAP_IGNORE( ReadMobilecrashesL(iCrashesBefore, KDriveF) );
+    VCXLOGLO1("<<<CIptvTestMobilecrashWatcher::ConstructL");
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestMobilecrashWatcher::ReadMobilecrashesL()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CIptvTestMobilecrashWatcher::ReadMobilecrashesL( RPointerArray<HBufC>& aCrashes, const TDesC& aDrive )
+	{
+	VCXLOGLO1(">>>CIptvTestMobilecrashWatcher::ReadMobilecrashes");
+
+    CDir* dirList  = NULL;
+
+    TBuf<KMaxFileName> path(aDrive);
+
+    if(aDrive == KDriveC)
+        {
+        path.Append(_L("data\\"));
+        }
+
+    path.Append(_L("*.*"));
+
+    if( !iFsSession.IsValidDrive(EDriveE) )
+        {
+        User::Leave( KErrNotSupported );
+        }
+
+    if ( iFsSession.GetDir( path, KEntryAttMatchExclude|KEntryAttDir, ESortByName, dirList ) == KErrNone )
+        {
+        CleanupStack::PushL( dirList );
+
+        for ( TInt file = 0; file < dirList->Count(); file++ )
+            {
+            HBufC* fileName = HBufC::NewL(KMaxFileName);
+            CleanupStack::PushL( fileName );
+
+            fileName->Des().Append(aDrive);
+            fileName->Des().Append((*dirList)[file].iName);
+
+            if(fileName->Des().FindF( _L("mobilecrash") ) >= 0)
+                {
+                CleanupStack::Pop( fileName );
+                aCrashes.Append(fileName);
+                }
+            else
+                {
+                CleanupStack::PopAndDestroy( fileName );
+                }
+            }
+        CleanupStack::PopAndDestroy( dirList );
+        }
+
+    VCXLOGLO1("<<<CIptvTestMobilecrashWatcher::ReadMobilecrashes");
+	}
+
+// -----------------------------------------------------------------------------
+// CIptvTestMobilecrashWatcher::CompareMobilecrashesL()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CIptvTestMobilecrashWatcher::CompareMobilecrashesL(RPointerArray<HBufC>& aCrashesBefore, RPointerArray<HBufC>& aCrashesNow)
+	{
+	VCXLOGLO1(">>>CIptvTestMobilecrashWatcher::CompareMobilecrashesL");
+	TBool newCrashes = EFalse;
+
+	TInt i = 0;
+	TInt e = 0;
+
+	VCXLOGLO2("CIptvTestMobilecrashWatcher:: crash files before: %d", aCrashesBefore.Count());
+	VCXLOGLO2("CIptvTestMobilecrashWatcher:: crash files now: %d", aCrashesNow.Count());
+
+	// remove crashesBefore from crashesNow
+
+	// Check is the mobilecrash log in the before array
+	for(e=0;e<aCrashesBefore.Count();e++)
+		{
+		for(i=0; i<aCrashesNow.Count(); i++)
+			{
+			TPtrC before = aCrashesBefore[e]->Des();
+			TPtrC now = aCrashesNow[i]->Des();
+
+			if(before == now )
+				{
+				HBufC* buf = aCrashesNow[i];
+				aCrashesNow.Remove(i);
+				delete buf;
+				break;
+				}
+			}
+		}
+
+	if(aCrashesNow.Count() > 0)
+		{
+		newCrashes = ETrue;
+		VCXLOGLO1("CIptvTestMobilecrashWatcher:: New mobilecrashes:");
+		for(i=0;i<aCrashesNow.Count(); i++)
+			{
+			TPtr16 file = aCrashesNow[i]->Des();
+			VCXLOGLO2("CIptvTestMobilecrashWatcher:: %S", &file);
+			}
+		}
+
+	VCXLOGLO1("<<<CIptvTestMobilecrashWatcher::CompareMobilecrashesL");
+	return newCrashes;
+	}
+
+// -----------------------------------------------------------------------------
+// CIptvTestMobilecrashWatcher::CheckNewCrashesL()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CIptvTestMobilecrashWatcher::CheckNewCrashesL()
+	{
+	VCXLOGLO1(">>>CIptvTestMobilecrashWatcher::CheckNewCrashesL");
+
+	iCrashesNow.ResetAndDestroy();
+	TRAP_IGNORE( ReadMobilecrashesL(iCrashesNow, KDriveC) );
+	TRAP_IGNORE( ReadMobilecrashesL(iCrashesNow, KDriveE) );
+	TRAP_IGNORE( ReadMobilecrashesL(iCrashesNow, KDriveF) );
+	if( CompareMobilecrashesL(iCrashesBefore, iCrashesNow) )
+		{
+		VCXLOGLO1("CIptvTestMobilecrashWatcher:: * ERROR * There's new mobilecrashes, panicing!");
+		User::Panic(_L("New mobilecrash log"), KErrGeneral);
+		}
+
+	VCXLOGLO1("<<<CIptvTestMobilecrashWatcher::CheckNewCrashesL");
+	}
+
+// -----------------------------------------------------------------------------
+// CIptvTestMobilecrashWatcher::ReturnNewCrashes()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CIptvTestMobilecrashWatcher::ReturnNewCrashes(RPointerArray<HBufC>& aArray)
+	{
+	VCXLOGLO1(">>>CIptvTestMobilecrashWatcher::CheckNewCrashesL");
+
+	aArray.ResetAndDestroy();
+	TRAP_IGNORE( ReadMobilecrashesL(aArray, KDriveC) );
+	TRAP_IGNORE( ReadMobilecrashesL(aArray, KDriveE) );
+	TRAP_IGNORE( ReadMobilecrashesL(aArray, KDriveF) );
+	TBool newCrashes = CompareMobilecrashesL(iCrashesBefore, aArray);
+	if( newCrashes )
+		{
+		VCXLOGLO1("CIptvTestMobilecrashWatcher:: * ERROR * There's new mobilecrashes!");
+		}
+
+	VCXLOGLO1("<<<CIptvTestMobilecrashWatcher::CheckNewCrashesL");
+	return newCrashes;
+	}
+
+// -----------------------------------------------------------------------------
+// CIptvTestMobilecrashWatcher::ReturnMobileCrashCount()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CIptvTestMobilecrashWatcher::ReturnMobileCrashCount()
+	{
+	VCXLOGLO1(">>>CIptvTestMobilecrashWatcher::ReturnMobileCrashCount");
+
+    RPointerArray<HBufC> array;
+
+    array.ResetAndDestroy();
+    TRAP_IGNORE( ReadMobilecrashesL(array, KDriveC) );
+    TRAP_IGNORE( ReadMobilecrashesL(array, KDriveE) );
+    TRAP_IGNORE( ReadMobilecrashesL(array, KDriveF) );
+	TInt count = array.Count();
+	array.ResetAndDestroy();
+
+	VCXLOGLO1("<<<CIptvTestMobilecrashWatcher::ReturnMobileCrashCount");
+	return count;
+	}
+
+// ---------------------------------
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/src/CIptvTestTimer.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,184 @@
+/*
+* 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 "CIptvTestTimer.h"
+#include "MIptvTestTimerObserver.h"
+#include "VCXTestLog.h"
+
+// EXTERNAL DATA STRUCTURES
+
+// EXTERNAL FUNCTION PROTOTYPES
+
+// CONSTANTS
+
+// MACROS
+
+// LOCAL CONSTANTS AND MACROS
+
+// MODULE DATA STRUCTURES
+
+// LOCAL FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CIptvTestTimer::
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CIptvTestTimer* CIptvTestTimer::NewL(MIptvTestTimerObserver& aObserver, TInt aId)
+    {
+    VCXLOGLO1(">>>CIptvTestTimer::NewL");
+    CIptvTestTimer* self = new (ELeave) CIptvTestTimer(aObserver, aId);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+    VCXLOGLO1("<<<CIptvTestTimer::NewL");
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestTimer::~CIptvTestTimer
+// destructor
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CIptvTestTimer::~CIptvTestTimer()
+    {
+    VCXLOGLO1(">>>CIptvTestTimer::~CIptvTestTimer");
+    iRestartAfterCancel = EFalse;
+    Cancel();
+    iTimer.Close();
+
+   	if( IsAdded() )
+        {
+        Deque(); // calls also Cancel()
+        }
+
+    VCXLOGLO1("<<<CIptvTestTimer::~CIptvTestTimer");
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestTimer::~CIptvTestTimer
+// destructor
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CIptvTestTimer::CancelTimer()
+    {
+    VCXLOGLO1(">>>CIptvTestTimer::CancelTimer");
+    if( IsActive() )
+    	{
+    	iRestartAfterCancel = EFalse;
+    	Cancel();
+    	}
+    VCXLOGLO1("<<<CIptvTestTimer::CancelTimer");
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestTimer::CIptvTestTimer
+//
+// -----------------------------------------------------------------------------
+//
+CIptvTestTimer::CIptvTestTimer(MIptvTestTimerObserver& aObserver, TInt aId) : CActive(EPriorityStandard), iObserver(aObserver),
+	iId(aId)
+    {
+    VCXLOGLO1(">>>CIptvTestTimer::CIptvTestTimer");
+    CActiveScheduler::Add(this);
+    VCXLOGLO1("<<<CIptvTestTimer::CIptvTestTimer");
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestTimer::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+void CIptvTestTimer::ConstructL()
+    {
+    VCXLOGLO1(">>>CIptvTestTimer::ConstructL");
+    User::LeaveIfError(iTimer.CreateLocal());
+    VCXLOGLO1("<<<CIptvTestTimer::ConstructL");
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestTimer::After
+//
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CIptvTestTimer::After(TTimeIntervalMicroSeconds32 aInterval)
+    {
+
+    iInterval = aInterval;
+
+    if( !IsActive() )
+    	{
+	    VCXLOGLO2("CIptvTestTimer::After: Setting active. (%d)", this);
+    	iTimer.After( iStatus, aInterval );
+	    SetActive();
+	    iRestartAfterCancel = EFalse; 
+    	}
+	else
+		{
+		// Cancel and start again when cancel is done.
+		VCXLOGLO2("CIptvTestTimer::After: Restarting! (%d)", this);
+		iRestartAfterCancel = ETrue;
+		iTimer.Cancel();
+		}
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestTimer::RunL
+//
+// -----------------------------------------------------------------------------
+//
+void CIptvTestTimer::RunL()
+    {
+    TInt status = iStatus.Int();
+
+    if( status == KErrNone )
+        {
+        iObserver.TimerComplete( iId, iStatus.Int() );
+        }
+    else
+    if( status == KErrCancel && iRestartAfterCancel )
+        {
+        iRestartAfterCancel = EFalse;
+        iTimer.After( iStatus, iInterval );
+        SetActive();
+        VCXLOGLO2("CIptvTestTimer::RunL: Restarted! (%d)", this);
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestTimer::DoCancel
+//
+// -----------------------------------------------------------------------------
+//
+void CIptvTestTimer::DoCancel()
+    {
+    VCXLOGLO1(">>>CIptvTestTimer::DoCancel");
+    iTimer.Cancel();
+    VCXLOGLO1("<<<CIptvTestTimer::DoCancel");
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/src/CIptvTestVerifyData.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,762 @@
+/*
+* 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 <zipfile.h>
+
+#include "CIptvTestVerifyData.h"
+#include "VCXTestLog.h"
+
+// EXTERNAL DATA STRUCTURES
+
+// EXTERNAL FUNCTION PROTOTYPES
+
+// CONSTANTS
+
+// MACROS
+
+// LOCAL CONSTANTS AND MACROS
+
+// MODULE DATA STRUCTURES
+
+// LOCAL FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+_LIT(KDriveC, "C:\\");
+_LIT(KLineBreak, "\r\n");
+
+_LIT(KPathVerifyWrite, "testing\\data\\verifynew\\");
+_LIT(KVerifyExtension, ".txt");
+
+// -----------------------------------------------------------------------------
+// CVerifyFile::NewL
+// -----------------------------------------------------------------------------
+//
+CVerifyFile* CVerifyFile::NewL()
+	{
+	CVerifyFile* self = new (ELeave) CVerifyFile();
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+// -----------------------------------------------------------------------------
+// CVerifyFile::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CVerifyFile::ConstructL()
+	{
+	iFs.Connect();
+	iId.Zero();
+	}
+
+// -----------------------------------------------------------------------------
+// CVerifyFile::CVerifyFile
+// -----------------------------------------------------------------------------
+//
+CVerifyFile::CVerifyFile()
+	{
+
+	}
+
+// -----------------------------------------------------------------------------
+// CVerifyFile::~CVerifyFile
+// -----------------------------------------------------------------------------
+//
+CVerifyFile::~CVerifyFile()
+	{
+	delete iFileName;
+	iFileName = NULL;
+	CloseFileHandles();
+	iFs.Close();
+	}
+
+// -----------------------------------------------------------------------------
+// CVerifyFile::CloseFileHandles
+// -----------------------------------------------------------------------------
+//
+void CVerifyFile::CloseFileHandles()
+	{
+	VCXLOGLO1(">>>CVerifyFile::CloseFileHandles");
+	if(iFileOpen)
+		{
+			iFile.Close();
+			iFileStream.Close();
+		}
+	iFileOpen = EFalse;
+	VCXLOGLO1("<<<CVerifyFile::CloseFileHandles");
+	}
+
+// -----------------------------------------------------------------------------
+// CVerifyFile::ResolveFileName
+// -----------------------------------------------------------------------------
+//
+void CVerifyFile::ResolveFileName()
+	{
+	if(iFileName == NULL)
+		{
+		iFileName = HBufC::NewL(256);
+		}
+	else
+		{
+		return;
+		}
+
+	VCXLOGLO1(">>>CVerifyFile::ResolveFileName");
+
+	iFileName->Des().Zero();
+
+	iFileName->Des().Append(KDriveC);
+
+	iFileName->Des().Append(KPathVerifyWrite);
+
+	BaflUtils::EnsurePathExistsL(iFs, iFileName->Des());
+
+	iFileName->Des().Append(iId);
+	iFileName->Des().Append(KVerifyExtension);
+
+	VCXLOGLO1("<<CVerifyFile::ResolveFileName");
+	}
+
+// -----------------------------------------------------------------------------
+// CVerifyFile::OpenStream
+// -----------------------------------------------------------------------------
+//
+void CVerifyFile::OpenStream()
+	{
+	if(iFileOpen)
+		{
+		return;
+		}
+
+	VCXLOGLO1(">>>CVerifyFile::OpenStream");
+
+	ResolveFileName();
+
+	// create the stream
+
+	TInt filePos = 0;
+	if(BaflUtils::FileExists(iFs, iFileName->Des()))
+		{
+	   	TInt result = iFile.Open(iFs, iFileName->Des(), EFileShareAny | EFileWrite | EFileStreamText);
+		if(result != KErrNone)
+			{
+			TPtrC fileName = iFileName->Des();
+			VCXLOGLO2("Could not open file: %S", &fileName);
+			VCXLOGLO1("<<<CIptvTestVerifyData::WriteVerifyData");
+			iFile.Close();
+			User::Leave(result);
+			}
+	   	iFile.Seek(ESeekEnd, filePos);
+
+		iFileStream.Attach(iFile, filePos);
+		}
+	else
+		{
+		User::Leave(KErrCorrupt);
+		}
+
+	iFileOpen = ETrue;
+	VCXLOGLO1("<<<CVerifyFile::OpenStream");
+	}
+
+// -----------------------------------------------------------------------------
+// CVerifyFile::CreateNewFile
+// -----------------------------------------------------------------------------
+//
+void CVerifyFile::CreateNewFile()
+	{
+	ResolveFileName();
+
+	VCXLOGLO1(">>>CVerifyFile::CreateNewFile");
+
+	if(BaflUtils::FileExists(iFs, iFileName->Des() ))
+		{
+		iFs.Delete(iFileName->Des());
+		}
+
+	if(KErrNone == iFile.Create(iFs, iFileName->Des(), EFileShareAny | EFileWrite | EFileStreamText))
+		{
+		iFile.Close();
+		}
+
+	VCXLOGLO1("<<<CVerifyFile::CreateNewFile");
+	}
+
+// -----------------------------------------------------------------------------
+// CVerifyFile::WriteData
+// -----------------------------------------------------------------------------
+//
+void CVerifyFile::WriteData(TDesC& aData)
+	{
+	OpenStream();
+
+	iFileStream.WriteL(aData);
+	}
+
+// -----------------------------------------------------------------------------
+// CVerifyFile::GetFileToWrite
+// -----------------------------------------------------------------------------
+//
+void CVerifyFile::GetFileToWrite(TDes& aFileName)
+    {
+	ResolveFileName();
+
+	if(iFileName->Des().Length() > 0)
+		{
+		aFileName = iFileName->Des();
+		}
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestVerifyData::
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CIptvTestVerifyData* CIptvTestVerifyData::NewL()
+    {
+    VCXLOGLO1(">>>CIptvTestVerifyData::NewL");
+    CIptvTestVerifyData* self = new (ELeave) CIptvTestVerifyData( );
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+    VCXLOGLO1("<<<CIptvTestVerifyData::NewL");
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestVerifyData::~CIptvTestVerifyData
+// destructor
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CIptvTestVerifyData::~CIptvTestVerifyData()
+    {
+    VCXLOGLO1(">>>CIptvTestVerifyData::~CIptvTestVerifyData");
+	
+    delete iZipFile;
+	iZipFile = NULL;
+	
+    iFs.Close();
+	
+    iVerifyFiles.ResetAndDestroy();
+    
+    delete iBuffer;
+    iBuffer = NULL;
+    
+    VCXLOGLO1("<<<CIptvTestVerifyData::~CIptvTestVerifyData");
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestVerifyData::GetVerifyFileIndex
+// -----------------------------------------------------------------------------
+//
+TInt CIptvTestVerifyData::GetVerifyFileIndex(TInt& aIndex, TDesC& aVerifyId)
+    {
+    aIndex = -1;
+
+    TInt i;
+
+    for(i=0; i<iVerifyFiles.Count(); i++)
+    	{
+    	if(iVerifyFiles[i]->iId == aVerifyId)
+    		{
+    		aIndex = i;
+    		}
+    	}
+
+    if(aIndex == -1)
+    	{
+    	return KErrNotFound;
+    	}
+
+    return KErrNone;
+	}
+
+// -----------------------------------------------------------------------------
+// CIptvTestVerifyData::CreateVerifyData
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CIptvTestVerifyData::CreateVerifyDataL(TDesC& aVerifyId, TBool aAppend)
+    {
+    VCXLOGLO1(">>>CIptvTestVerifyData::CreateVerifyData");
+
+	if(aVerifyId.Length() <= 0)
+		{
+		VCXLOGLO1("No verify Id");
+		VCXLOGLO1("<<<CIptvTestVerifyData::CreateVerifyData");
+		return KErrNone;
+		}
+
+//BAFL::EnsurePathExistsL
+
+    TInt result = KErrNone;
+
+    TInt index;
+
+    if(KErrNone != GetVerifyFileIndex(index, aVerifyId))
+    	{
+    	CVerifyFile *vf = CVerifyFile::NewL();
+    	vf->iId = aVerifyId;
+    	iVerifyFiles.Append(vf);
+    	if(KErrNone != GetVerifyFileIndex(index, aVerifyId))
+    		{
+    		VCXLOGLO1("CIptvTestVerifyData:: Verify file not found even after creating one.");
+    		VCXLOGLO1("<<<CIptvTestVerifyData::CreateVerifyData");
+    		return KErrGeneral;
+    		}
+	   	}
+
+	TBuf<256> fileName;
+
+	if(!aAppend)
+		{
+		iVerifyFiles[index]->CreateNewFile();
+		}
+
+	iVerifyFiles[index]->GetFileToWrite(fileName);
+
+	VCXLOGLO2("CIptvTestVerifyData:: writePath %S", &fileName);
+
+    VCXLOGLO1("<<<CIptvTestVerifyData::CreateVerifyData");
+    return result;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CIptvTestVerifyData::WriteVerifyData
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CIptvTestVerifyData::WriteVerifyDataL(TDesC& aVerifyId, TDesC& aVerifyData)
+    {
+    TInt index;
+
+    if(KErrNone != GetVerifyFileIndex(index, aVerifyId))
+    	{
+    	//VCXLOGLO1("Call to WriteVerifyData before CreateVerifyData is called.");
+    	//VCXLOGLO1("<<<CIptvTestVerifyData::WriteVerifyData");
+    	return KErrNone;
+    	}
+
+//    VCXLOGLO1(">>>CIptvTestVerifyData::WriteVerifyData");
+
+    iBuffer->Des().Zero();
+
+    if( iUseTimestamps )
+        {
+        _LIT(KDateTimeString,"%D%M%Y%/0%1%/1%2%/2%3%/3 %-B%:0%H%:1%T%:2%S%.%*C2%:3%-B");
+        TBuf<128> timeString;
+        TTime time;
+        time.HomeTime();
+        TBuf<128> buff;
+        time.FormatL( buff, KDateTimeString );
+        iBuffer->Des().Append( buff );
+        iBuffer->Des().Append( _L(" ") );
+        }
+
+    iBuffer->Des().Append( aVerifyData );
+
+	TInt result = KErrNone;
+	iVerifyFiles[index]->WriteData( *iBuffer );
+	TBuf<12> lineChange(KLineBreak);
+	iVerifyFiles[index]->WriteData( lineChange );
+
+//    VCXLOGLO1("<<<CIptvTestVerifyData::WriteVerifyData");
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestVerifyData::VerifyData
+// ----------------------------------------------------------------------------
+//
+EXPORT_C TInt CIptvTestVerifyData::VerifyDataL(TDesC& aVerifyId, TVerifyResult& aVerifyResult)
+    {
+    // Get index for the verified file info
+    // If not found then exit w/o error
+    TInt index;
+
+    if(KErrNone != GetVerifyFileIndex(index, aVerifyId))
+    	{
+    	VCXLOGLO1("CIptvTestVerifyData::VerifyDataL - Data verifying is not enabled.");
+    	aVerifyResult = EVerifiedFileNotFound;
+    	return KErrNone;
+    	}
+
+    VCXLOGLO1(">>>CIptvTestVerifyData::VerifyData");
+
+	TInt result = KErrNone;
+	aVerifyResult = EVerifyOk;
+
+	// Connect to file system
+	TBuf<256> fileNameRead( _L("c:\\testing\\data\\iptvtempverify.txt") ); // File which is extracted from verify.zip
+	TBuf<256> fileNameWrite; // File which is written during the test
+
+	TRAPD( err, ExtractVerifyFileL( aVerifyId, fileNameRead ) );
+	if( err != KErrNone )
+		{
+		VCXLOGLO2("CIptvTestVerifyData:: verify file extract failed: %d", err);
+		VCXLOGLO1("<<<CIptvTestVerifyData::VerifyDataL");
+		aVerifyResult = EVerifiedFileNotFound;
+		return KErrNone;
+		}
+
+	iVerifyFiles[index]->GetFileToWrite(fileNameWrite);
+	iVerifyFiles[index]->CloseFileHandles();
+
+	// Check that the files exist
+
+	if(!BaflUtils::FileExists(iFs, fileNameRead))
+		{
+		VCXLOGLO2("File used to verify data not found. %S must be verified by hand and added to the verify.zip.", &fileNameWrite);
+		VCXLOGLO1("<<<CIptvTestVerifyData::VerifyDataL");
+		aVerifyResult = EVerifiedFileNotFound;
+		return KErrNone;
+		}
+
+	if(!BaflUtils::FileExists(iFs, fileNameWrite))
+		{
+		VCXLOGLO2("File %S not found. This should not happen.", &fileNameWrite);
+		VCXLOGLO1("<<<CIptvTestVerifyData::VerifyDataL");
+		aVerifyResult = EVerifiedFileNotFound;
+		return KErrNone;
+		}
+
+	// Open files and do comparison line by line
+
+	// Verified file from installation
+	RFile fileFromInst;
+	TFileText fromInst;
+	HBufC* lineFromInstBuff = HBufC::NewL( 1024 * 4 );
+	CleanupStack::PushL( lineFromInstBuff );
+	TPtr lineFromInst( lineFromInstBuff->Des() );
+
+	// File from test case
+	RFile fileFromTest;
+	TFileText fromTest;
+	HBufC* lineFromTestBuff = HBufC::NewL( 1024 * 4 );
+	CleanupStack::PushL( lineFromTestBuff );
+	TPtr lineFromTest( lineFromTestBuff->Des() );
+
+   	result = fileFromInst.Open(iFs, fileNameRead, EFileRead | EFileStreamText);
+	if(result != KErrNone)
+		{
+		VCXLOGLO2("Could not open file 1: %S", &fileNameRead);
+		CleanupStack::PopAndDestroy( lineFromTestBuff );
+		CleanupStack::PopAndDestroy( lineFromInstBuff );
+		VCXLOGLO1("<<<CIptvTestVerifyData::VerifyDataL");
+		aVerifyResult = ESystemError;
+		return result;
+		}
+	CleanupClosePushL(fileFromInst);
+
+   	result = fileFromTest.Open(iFs, fileNameWrite, EFileRead | EFileStreamText);
+	if(result != KErrNone)
+		{
+		VCXLOGLO2("Could not open file 2: %S", &fileNameRead);
+		VCXLOGLO1("<<<CIptvTestVerifyData::VerifyDataL");
+		aVerifyResult = ESystemError;
+		CleanupStack::PopAndDestroy(&fileFromInst);
+		CleanupStack::PopAndDestroy( lineFromTestBuff );
+		CleanupStack::PopAndDestroy( lineFromInstBuff );
+		return result;
+		}
+	CleanupClosePushL(fileFromTest);
+
+	TInt lineNumber(0);
+	TInt totalResult(0);
+	TInt32 totalLength(0);
+
+	fromInst.Set(fileFromInst);
+	fromTest.Set(fileFromTest);
+
+	while(result == KErrNone)
+		{
+		TInt result2(KErrNone);
+
+		result = fromInst.Read(lineFromInst);
+		result2 = fromTest.Read(lineFromTest);
+
+		// End of file reached for both files. No differences.
+		if(result == KErrEof && result2 == KErrEof)
+			{
+			result = KErrNone;
+			break;
+			}
+
+        // Eof reached only for one file. Verify failed.
+		if( result == KErrEof )
+			{
+			aVerifyResult = EVerifyFailed;
+			VCXLOGLO1("End of file reached for installed verify file!");
+			break;
+			}
+        else if( result2 == KErrEof )
+			{
+			aVerifyResult = EVerifyFailed;
+			VCXLOGLO1("End of file reached for test verify file!");
+			break;
+			}
+
+        // Error reading the files.
+		if(result != KErrNone && result != KErrTooBig)
+			{
+			VCXLOGLO3("CIptvTestVerifyData:: reading file (test) failed at line: %d, result: %d", lineNumber, result);
+			break;
+			}
+
+		if(result2 != KErrNone && result2 != KErrTooBig)
+			{
+			VCXLOGLO3("CIptvTestVerifyData:: reading file (test) failed at line: %d, result: %d", lineNumber, result);
+			result = result2;
+			break;
+			}
+
+		totalLength += lineFromInst.Length();
+
+		// Don't compare if line is for path because it can have service id which varies
+		if( KErrNotFound != lineFromTest.Match(_L("*\\Data\\videocenter\\*")) && KErrNotFound != lineFromTest.Match(_L("*\\data\\videocenter\\*")) )
+			{
+			TInt res = lineFromInst.Compare(lineFromTest);
+			if(res < 0)
+				{
+				totalResult += (res *- 1);
+				}
+			else
+				{
+				totalResult += res;
+				}
+
+			if(res != KErrNone)
+				{
+				VCXLOGLO3("CIptvTestVerifyData:: Lines at line %d are different. Res: %d", lineNumber, res);
+				VCXLOGLO2("CIptvTestVerifyData:: %S", &lineFromInst);
+				VCXLOGLO2("CIptvTestVerifyData:: %S", &lineFromTest);
+				aVerifyResult = EVerifyFailed;
+				break; // No more verifying
+				}
+			}
+
+		lineNumber++;
+		}
+
+	VCXLOGLO2("CIptvTestVerifyData:: %d lines verified.", lineNumber);
+	VCXLOGLO2("CIptvTestVerifyData:: %d total length of file.", totalLength);
+	VCXLOGLO2("CIptvTestVerifyData:: %d total difference.", totalResult);
+
+	CleanupStack::PopAndDestroy(&fileFromTest);
+	CleanupStack::PopAndDestroy(&fileFromInst);
+	CleanupStack::PopAndDestroy( lineFromTestBuff );
+	CleanupStack::PopAndDestroy( lineFromInstBuff );
+
+    VCXLOGLO1("<<<CIptvTestVerifyData::VerifyData");
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestVerifyData::VerifyData
+// ----------------------------------------------------------------------------
+//
+EXPORT_C void CIptvTestVerifyData::EnableTimestamps( TBool aUseTimestamps )
+    {
+    iUseTimestamps = aUseTimestamps;
+    }
+// -----------------------------------------------------------------------------
+// CIptvTestVerifyData::CIptvTestVerifyData
+// -----------------------------------------------------------------------------
+//
+CIptvTestVerifyData::CIptvTestVerifyData()
+    {
+    VCXLOGLO1(">>>CIptvTestVerifyData::CIptvTestVerifyData");
+
+    VCXLOGLO1("<<<CIptvTestVerifyData::CIptvTestVerifyData");
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestVerifyData::ConstructL()
+// -----------------------------------------------------------------------------
+//
+void CIptvTestVerifyData::ConstructL()
+    {
+    VCXLOGLO1(">>>CIptvTestVerifyData::ConstructL");
+	iVerifyFiles.ResetAndDestroy();
+	User::LeaveIfError( iFs.Connect() );
+	TRAPD(err, iZipFile = CZipFile::NewL( iFs, KIptvVerifyZipFile ) );
+	if( err == KErrNoMemory )
+		{
+		User::Leave( err );
+		}
+	if( err != KErrNone )
+		{
+	    VCXLOGLO2("CIptvTestVerifyData:: CZipFile::NewL err: %d", err);
+	    delete iZipFile;
+	    iZipFile = NULL;
+		}
+
+	iBuffer = HBufC::NewL( 1024 * 5 );
+
+    VCXLOGLO1("<<<CIptvTestVerifyData::ConstructL");
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestVerifyData::ReadFile()
+// -----------------------------------------------------------------------------
+//
+TInt CIptvTestVerifyData::ReadFileL(RFs& aFs, TDes& aFileName, HBufC8** aBuff, TVerifyResult& aVerifyResult)
+    {
+	VCXLOGLO2(">>>CIptvTestVerifyData::ReadFile: %S", &aFileName);
+
+	TInt result = KErrNone;
+	RFile file;
+	TInt fileSize;
+
+   	result = file.Open(aFs, aFileName, EFileRead | EFileStreamText);
+	if(result != KErrNone)
+		{
+		VCXLOGLO2("Could not open file 1: %S", &aFileName);
+		VCXLOGLO1("<<<CIptvTestVerifyData::VerifyDataL");
+		aVerifyResult = ESystemError;
+		return result;
+		}
+	CleanupClosePushL(file);
+
+	file.Size(fileSize);
+
+	TInt filePos = 0;
+	file.Seek(ESeekStart, filePos);
+
+	HBufC8* buff = HBufC8::NewL( fileSize);
+
+	TPtr8 ptr( buff->Des() );
+	file.Read(ptr);
+
+	*aBuff = buff;
+
+	CleanupStack::PopAndDestroy(&file);
+
+    VCXLOGLO1("<<<CIptvTestVerifyData::ReadFile");
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestVerifyData::ExtractVerifyFile()
+// -----------------------------------------------------------------------------
+//
+void CIptvTestVerifyData::ExtractVerifyFileL( TDesC& aVerifyId, const TDesC& aDestFile )
+	{
+	VCXLOGLO1(">>>CIptvTestVerifyData::ExtractVerifyFile");
+
+	iFs.Delete( aDestFile );
+
+	if( !iZipFile )
+		{
+		VCXLOGLO1("CIptvTestVerifyData:: iZipFile == NULL! Leaving..");
+		User::Leave( KErrNotReady );
+		}
+
+    TBuf<256> verifyFileName( aVerifyId );
+    verifyFileName.Append( KVerifyExtension );
+    VCXLOGLO2("CIptvTestVerifyData:: verifyFileName: %S", &verifyFileName);
+    VCXLOGLO2("CIptvTestVerifyData:: aDestFile: %S", &aDestFile);
+
+	if( !FileExistsInZip( iZipFile, verifyFileName ) )
+	  	{
+		VCXLOGLO1("CIptvTestVerifyData:: No such file in zip! Leaving..");
+		User::Leave( CIptvTestVerifyData::EVerifiedFileNotFound );
+	  	}
+
+    // Get zip file member from the archive
+    VCXLOGLO1("CIptvTestVerifyData:: Get zip file member from the archive");
+    CZipFileMember* member = iZipFile->CaseInsensitiveMemberL( verifyFileName );
+    if( member == NULL )
+    	{
+    	VCXLOGLO1("CIptvTestVerifyData:: zip member is null.  Leaving..");
+    	User::Leave(KErrGeneral);
+    	}
+    CleanupStack::PushL( member );
+
+    // Get read stream for the file
+    VCXLOGLO1("CIptvTestVerifyData:: Get read stream for the file");
+    RZipFileMemberReaderStream* stream;
+    iZipFile->GetInputStreamL( member, stream );
+    CleanupStack::PushL( stream );
+
+    // Alloc buffer and read the archived file
+    VCXLOGLO1("CIptvTestVerifyData:: Alloc buffer and read the archived file");
+    HBufC8* buffer = HBufC8::NewLC( member->UncompressedSize() );
+    TPtr8 bufferPtr( buffer->Des() );
+    User::LeaveIfError( stream->Read( bufferPtr, member->UncompressedSize() ) );
+
+    // Write the file to the filesystem
+    VCXLOGLO1("CIptvTestVerifyData:: Write the file to the filesystem");
+    RFile file;
+    User::LeaveIfError( file.Replace( iFs, aDestFile, EFileWrite ) );
+    CleanupClosePushL( file );
+    User::LeaveIfError( file.Write(*buffer) );
+
+    CleanupStack::PopAndDestroy( &file );
+    CleanupStack::PopAndDestroy( buffer );
+    CleanupStack::PopAndDestroy( stream );
+    CleanupStack::PopAndDestroy( member );
+
+    VCXLOGLO1("<<<CIptvTestVerifyData::ExtractVerifyFile");
+	}
+
+// -----------------------------------------------------------------------------
+// CIptvTestVerifyData::FileExistsInZip()
+// -----------------------------------------------------------------------------
+//
+TBool CIptvTestVerifyData::FileExistsInZip( CZipFile* aZipFile, const TDesC& aFileName )
+	{
+	VCXLOGLO1(">>>CIptvTestVerifyData::FileExistsInZip");
+
+	CZipFileMember* member = NULL;
+
+	VCXLOGLO1("CIptvTestVerifyData:: list of members");
+	CZipFileMemberIterator* members = aZipFile->GetMembersL();
+
+	VCXLOGLO1("CIptvTestVerifyData:: loop all members");
+
+	while ((member = members->NextL()) != 0)
+	    {
+	    VCXLOGLO3("CIptvTestVerifyData:: member %S, size: %d", &(*member->Name()), member->CompressedSize());
+
+	    if( aFileName == (*member->Name()) )
+	    	{
+		    delete member;
+			delete members;
+			VCXLOGLO1("<<<CIptvTestVerifyData::FileExistsInZip");
+		    return ETrue;
+	    	}
+
+	    delete member;
+	    }
+
+	delete members;
+	VCXLOGLO1("<<<CIptvTestVerifyData::FileExistsInZip");
+	return EFalse;
+	}
+
+// ---------------------------------
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/src/CIptvTestVideoCreator.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,363 @@
+/*
+* 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: 
+*
+*/
+
+
+//  INCLUDES
+#include <f32file.h>
+#include <BAUTILS.H>
+
+#include "CIptvTestVideoCreator.h"
+#include "VCXTestLog.h"
+
+// -----------------------------------------------------------------------------
+//  NewL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CIptvTestVideoCreator* CIptvTestVideoCreator::NewL()
+    {
+    CIptvTestVideoCreator* self;
+    self = new (ELeave) CIptvTestVideoCreator();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+//  CIptvTestVideoCreator
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CIptvTestVideoCreator::~CIptvTestVideoCreator()
+    {
+    delete iFileMan;
+    iFileMan = NULL;
+    iFs.Close();
+    }
+
+// -----------------------------------------------------------------------------
+//  CIptvTestVideoCreator
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CIptvTestVideoCreator::CIptvTestVideoCreator()
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+//  ConstructL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CIptvTestVideoCreator::ConstructL()
+    {
+    User::LeaveIfError( iFs.Connect() );
+    iFileMan = CFileMan::NewL( iFs );
+    }
+
+// -----------------------------------------------------------------------------
+//  CreateVideoL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CIptvTestVideoCreator::CreateVideoL(CIptvTestVideoCreator::TIptvTestVideoType aVideoType, TDesC& aFileName, TInt aSize)
+    {
+    VCXLOGLO1(">>>CIptvTestVideoCreator::CreateVideoL");
+
+    // Resolve source filename
+    TBuf<256> srcFileName;
+
+    GetVideoFile( srcFileName, aVideoType, _L("C") );
+    if( !BaflUtils::FileExists(iFs, srcFileName) )
+        {
+        VCXLOGLO2("CIptvTestVideoCreator:: %S does not exist.", &srcFileName);
+        GetVideoFile( srcFileName, aVideoType, _L("E") );
+        if( !BaflUtils::FileExists(iFs, srcFileName) )
+            {
+            VCXLOGLO2("CIptvTestVideoCreator:: %S does not exist.", &srcFileName);
+            VCXLOGLO2("CIptvTestVideoCreator:: test video file %S missing! PANIC.", &srcFileName);
+            User::Panic(_L("Video files missing!"), KErrNotFound);
+            }
+        }
+    
+    BaflUtils::EnsurePathExistsL( iFs, aFileName.Left( aFileName.LocateReverse('\\') ) );
+
+    BaflUtils::DeleteFile( iFs, aFileName );
+    
+    VCXLOGLO2("CIptvTestVideoCreator:: aSize = %d", aSize);
+    
+    TInt64 wantedSize( 0 );
+    
+    // Check the size
+    if( aSize == KVcxTestLargeFile3GB ) {
+        wantedSize = 3000000000;
+    }
+    else {
+        wantedSize = aSize;
+    }
+    
+    //wantedSize = wantedSize == 0 ? wantedSize -1 : wantedSize;
+    
+    VCXLOGLO2("CIptvTestVideoCreator:: Wanted file size: %Ld", wantedSize);
+
+    // Read source file into memory, won't work on huge files.
+    RFile64 srcFile;
+    VCXLOGLO2("CIptvTestVideoCreator:: Opening %S", &srcFileName);
+    User::LeaveIfError( srcFile.Open( iFs, srcFileName, EFileRead ) );
+    CleanupClosePushL( srcFile );
+
+    TInt64 srcSize(0);
+    VCXLOGLO2("CIptvTestVideoCreator:: Getting size of %S", &srcFileName);
+    User::LeaveIfError( srcFile.Size( srcSize ) );
+
+    HBufC8* data = HBufC8::NewL( srcSize );
+    TPtr8 ptr( data->Des() );
+    srcFile.Read( ptr, srcSize );
+    CleanupStack::PopAndDestroy( &srcFile );
+
+    CleanupStack::PushL( data );
+
+    // Write new file.
+    RFile64 dstFile;
+    VCXLOGLO1("CIptvTestVideoCreator:: Replace");
+    User::LeaveIfError( dstFile.Replace( iFs, aFileName, EFileWrite ) );
+    CleanupClosePushL(dstFile);
+
+    if( wantedSize <= srcSize )
+        {
+        if( wantedSize == -1 )
+            {
+            VCXLOGLO2("CIptvTestVideoCreator:: Writing %Ld", srcSize);
+            User::LeaveIfError( dstFile.Write( *data, srcSize ) );
+            }
+        else
+            {
+            VCXLOGLO2("CIptvTestVideoCreator:: Writing %Ld", wantedSize);
+            User::LeaveIfError( dstFile.Write( *data, wantedSize ) );
+            }
+        }
+    else
+        {
+        VCXLOGLO2("CIptvTestVideoCreator:: Writing %Ld", srcSize);
+        User::LeaveIfError( dstFile.Write( *data, srcSize ) );
+
+        const TInt KIptvTest200Kilos = 1024*200;
+        HBufC8* buff = HBufC8::NewL( KIptvTest200Kilos );
+        buff->Des().SetLength( KIptvTest200Kilos );
+        CleanupStack::PushL( buff );
+        TInt64 bytesToWrite = wantedSize - srcSize;
+        while( bytesToWrite > 0 )
+            {
+            if( bytesToWrite >= KIptvTest200Kilos )
+                {
+                bytesToWrite -= KIptvTest200Kilos;
+                User::LeaveIfError( dstFile.Write( *buff ) );
+                }
+            else
+                {
+                User::LeaveIfError( dstFile.Write( *buff, bytesToWrite ) );
+                bytesToWrite = 0;
+                }
+            }
+        CleanupStack::PopAndDestroy( buff );
+        }
+
+    CleanupStack::PopAndDestroy( &dstFile );
+    CleanupStack::PopAndDestroy( data );
+
+    VCXLOGLO1("<<<CIptvTestVideoCreator::CreateVideoL");
+    }
+
+
+// -----------------------------------------------------------------------------
+//  CreateVideosL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CIptvTestVideoCreator::CreateVideosL(CIptvTestVideoCreator::TIptvTestVideoType aVideoType, TDesC& aFileName, TInt aCount, RPointerArray<HBufC>& aFileArray )
+    {
+    VCXLOGLO1(">>>CIptvTestVideoCreator::CreateVideosL");
+
+    // Resolve source filename
+    TBuf<256> srcFileName;
+
+    GetVideoFile( srcFileName, aVideoType, _L("C") );
+
+    if( !BaflUtils::FileExists(iFs, srcFileName) )
+        {
+        VCXLOGLO2("CIptvTestVideoCreator:: %S does not exist.", &srcFileName);
+        GetVideoFile( srcFileName, aVideoType, _L("E") );
+        if( !BaflUtils::FileExists(iFs, srcFileName) )
+            {
+            VCXLOGLO2("CIptvTestVideoCreator:: %S does not exist.", &srcFileName);
+            VCXLOGLO2("CIptvTestVideoCreator:: test video file %S missing! PANIC.", &srcFileName);
+            // Comment next line if you want dummy files to be created. They won't be recognized by MDS.
+            User::Panic(_L("Video files missing!"), KErrNotFound);
+            }
+        }
+
+    TBool fileExists = BaflUtils::FileExists(iFs, srcFileName);
+
+    HBufC* newFileName = HBufC::NewL( 256 );
+    CleanupStack::PushL( newFileName );
+
+    newFileName->Des().Copy( aFileName.Left( aFileName.LocateReverse('\\') ) );
+    BaflUtils::EnsurePathExistsL(iFs, *newFileName);
+
+    TInt dotPos = aFileName.LocateReverse('.');
+
+    for( TInt i = 0; i < aCount; i++ )
+        {
+        newFileName->Des().Copy( aFileName.Left( dotPos ) );
+        newFileName->Des().Append( _L("_") );
+        newFileName->Des().AppendNum( i );
+        newFileName->Des().Append( aFileName.Right( aFileName.Length() - dotPos ) );
+
+        HBufC* fileForClient = newFileName->Des().AllocL();
+        aFileArray.Append( fileForClient );
+
+        if( fileExists )
+            {
+            User::LeaveIfError( iFileMan->Copy(srcFileName, *newFileName) );
+            VCXLOGLO2("CIptvTestVideoCreator:: copy file: '%S'", newFileName);
+            }
+        else
+            {
+            VCXLOGLO2("CIptvTestVideoCreator:: new fake file: '%S'", newFileName);
+            RFile file;
+            CleanupClosePushL(file);
+            User::LeaveIfError( file.Replace(iFs, *newFileName, EFileWrite) );
+            User::LeaveIfError( file.SetSize( 1024*10 ) );
+            CleanupStack::PopAndDestroy( &file );
+            }
+        User::After( 100000 ); // Wait tenth of a second.
+        }
+
+    CleanupStack::PopAndDestroy( newFileName );
+
+    VCXLOGLO1("<<<CIptvTestVideoCreator::CreateVideosL");
+    }
+
+// -----------------------------------------------------------------------------
+//  GetVideoFile
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CIptvTestVideoCreator::GetVideoFile( TDes& aFileName, CIptvTestVideoCreator::TIptvTestVideoType aVideoType, const TDesC& aDrive )
+    {
+    VCXLOGLO1(">>>CIptvTestVideoCreator::GetVideoFile");
+    aFileName.Copy( aDrive );
+
+    _LIT(KIptvTestVideoBasePath, ":\\testing\\data\\");
+
+    aFileName.Append( KIptvTestVideoBasePath );
+    
+    VCXLOGLO2("CIptvTestVideoCreator::GetVideoFile -- using %S", &aFileName);
+
+    switch (aVideoType)
+        {
+        case CIptvTestVideoCreator::IptvTestVideo3Gp:
+            {
+            aFileName.Append( _L("video_3gp.xxx") );
+            }
+            break;
+
+        case CIptvTestVideoCreator::IptvTestVideo3Gp2:
+            {
+            aFileName.Append( _L("video_3gp2.xxx") );
+            }
+            break;
+
+        case CIptvTestVideoCreator::IptvTestVideoMp2:
+            {
+            aFileName.Append( _L("video_mp2.xxx") );
+            }
+            break;
+
+        case CIptvTestVideoCreator::IptvTestVideoMpeg1:
+            {
+            aFileName.Append( _L("video_mpeg1.xxx") );
+            }
+            break;
+
+        case CIptvTestVideoCreator::IptvTestVideoMpeg2:
+            {
+            aFileName.Append( _L("video_mpeg2.xxx") );
+            }
+            break;
+
+        case CIptvTestVideoCreator::IptvTestVideoSuperVideoCd:
+            {
+            aFileName.Append( _L("video_supervideocd.xxx") );
+            }
+            break;
+
+        case CIptvTestVideoCreator::IptvTestVideoMp3:
+            {
+            aFileName.Append( _L("video_mp3.xxx") );
+            }
+            break;
+
+        case CIptvTestVideoCreator::IptvTestVideoAppleMpeg:
+            {
+            aFileName.Append( _L("video_applempeg.xxx") );
+            }
+            break;
+
+        case CIptvTestVideoCreator::IptvTestVideoMpeg4:
+            {
+            aFileName.Append( _L("video_mpeg4.xxx") );
+            }
+            break;
+
+        case CIptvTestVideoCreator::IptvTestVideoMpegAvc:
+            {
+            aFileName.Append( _L("video_mpegavc.xxx") );
+            }
+            break;
+
+        case CIptvTestVideoCreator::IptvTestVideoQuicktime:
+            {
+            aFileName.Append( _L("video_quicktime.xxx") );
+            }
+            break;
+
+        case CIptvTestVideoCreator::IptvTestVideoRealVideo:
+            {
+            aFileName.Append( _L("video_realvideo.xxx") );
+            }
+            break;
+
+        case CIptvTestVideoCreator::IptvTestVideoAvi:
+            {
+            aFileName.Append( _L("video_avi.xxx") );
+            }
+            break;
+
+        case CIptvTestVideoCreator::IptvTestVideoWmv:
+            {
+            aFileName.Append( _L("video_wmv.xxx") );
+            }
+            break;
+
+        case CIptvTestVideoCreator::IptvTestVideoAviAC3:
+            {
+            aFileName.Append( _L("video_aviac3.xxx") );
+            }
+            break;            
+        default:
+            User::Panic(_L("IptvMyVideosApiTest: Unknown video type!"), KErrCorrupt);
+        }
+    VCXLOGLO1("<<<CIptvTestVideoCreator::GetVideoFile");
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/src/IptvTestDownloadManager.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,519 @@
+/*
+* 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 <e32base.h>
+#include <f32file.h>
+#include <DownloadMgrClient.h>
+#include <HttpDownloadMgrCommon.h>
+
+#include "IptvTestDownloadManager.h"
+#include "VCXTestLog.h"
+#include "CIptvTestTimer.h"
+
+// ========================== MEMBER FUNCTIONS ===============================
+
+// ---------------------------------------------------------------------------
+// CTestUtilConnection::NewL()
+//
+// Constructs CTestUtilConnection object
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CIptvTestDownloadManager* CIptvTestDownloadManager::NewL(MTestUtilDownloadObserver *aObs)
+    {
+    VCXLOGLO1(">>>CIptvTestDownloadManager::NewL");
+    CIptvTestDownloadManager* self = NewLC(aObs);
+    CleanupStack::Pop(self);
+    VCXLOGLO1("<<<CIptvTestDownloadManager::NewL");
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CTestUtilConnection::NewLC()
+//
+// Constructs CTestUtilConnection object
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CIptvTestDownloadManager* CIptvTestDownloadManager::NewLC(MTestUtilDownloadObserver *aObs)
+    {
+    VCXLOGLO1(">>>CIptvTestDownloadManager::NewLC");
+    CIptvTestDownloadManager* self = new (ELeave) CIptvTestDownloadManager(aObs);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    VCXLOGLO1("<<<CIptvTestDownloadManager::NewLC");
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CTestUtilConnection::CTestUtilConnection()
+//
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CIptvTestDownloadManager::CIptvTestDownloadManager(MTestUtilDownloadObserver *aObs)
+: iObserver(aObs)
+    {
+    VCXLOGLO1(">>>CIptvTestDownloadManager::CIptvTestUtilConnection");
+
+    VCXLOGLO1("<<<CIptvTestDownloadManager::CIptvTestUtilConnection");
+    }
+
+// ---------------------------------------------------------------------------
+// CTestUtilConnection::~CTestUtilConnection()
+//
+// Destructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CIptvTestDownloadManager::~CIptvTestDownloadManager()
+    {
+    VCXLOGLO1(">>>CIptvTestDownloadManager::~CIptvTestDownloadManager");
+
+	iDownloadMgr.DeleteAll();
+	iDownloadMgr.RemoveObserver(*this);
+	iDownloadMgr.Close();
+
+	if( iDownload )
+		{
+		iDownload->Delete();
+		iDownload = NULL;
+		}
+
+    if( iTimer )
+        {
+        delete iTimer;
+        iTimer = NULL;
+        }
+
+    VCXLOGLO1("<<<CIptvTestDownloadManager::~CIptvTestDownloadManager");
+    }
+
+// ---------------------------------------------------------------------------
+// CIptvTestDownloadManager::ConstructL()
+//
+// Second phase constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CIptvTestDownloadManager::ConstructL()
+    {
+    VCXLOGLO1(">>>CIptvTestDownloadManager::ConstructL");
+
+	iDownloadRunning = EFalse;
+	TUid uid;
+	uid.iUid = 0x101FB3E3;
+	iDownloadMgr.ConnectL(uid, *this, ETrue);
+
+    iTimer = CIptvTestTimer::NewL(*this, 0);
+
+   	VCXLOGLO1("<<<CIptvTestDownloadManager::ConstructL");
+    }
+
+
+// ---------------------------------------------------------------------------
+// CIptvTestDownloadManager::HandleDMgrEventL()
+//
+// ---------------------------------------------------------------------------
+//
+void CIptvTestDownloadManager::HandleDMgrEventL( RHttpDownload& aDownload, THttpDownloadEvent aEvent )
+	{
+	VCXLOGLO1(">>>CIptvTestDownloadManager::HandleDMgrEventL");
+
+	TInt32 downloadId;
+	aDownload.GetIntAttribute(EDlAttrId, downloadId);
+
+	VCXLOGLO3("CIptvTestDownloadManager:: downloadId: %d, aEvent: %d", downloadId, aEvent);
+
+    switch (aEvent.iProgressState)
+        {
+        case EHttpContentTypeReceived:
+            VCXLOGLO1("CIptvTestDownloadManager:: EHttpContentTypeReceived");
+            User::LeaveIfError(aDownload.Start());
+            break;
+        case EHttpProgNone:
+            VCXLOGLO1("CIptvTestDownloadManager:: EHttpProgNone");
+            break;
+        case EHttpStarted:
+            VCXLOGLO1("CIptvTestDownloadManager:: EHttpStarted");
+            break;
+        case EHttpProgCreatingConnection:
+            VCXLOGLO1("CIptvTestDownloadManager:: EHttpProgCreatingConnection");
+            break;
+        case EHttpProgConnectionNeeded:
+            VCXLOGLO1("CIptvTestDownloadManager:: EHttpProgConnectionNeeded");
+            break;
+        case EHttpProgConnected:
+            VCXLOGLO1("CIptvTestDownloadManager:: EHttpProgConnected");
+            break;
+        case EHttpProgConnectionSuspended:
+            VCXLOGLO1("CIptvTestDownloadManager:: EHttpProgConnectionSuspended");
+            break;
+        case EHttpProgDisconnected:
+            VCXLOGLO1("CIptvTestDownloadManager:: EHttpProgDisconnected");
+            break;
+        case EHttpProgDownloadStarted:
+            VCXLOGLO1("CIptvTestDownloadManager:: EHttpProgDownloadStarted");
+            break;
+        case EHttpContentTypeRequested:
+            VCXLOGLO1("CIptvTestDownloadManager:: EHttpContentTypeRequested");
+            break;
+        case EHttpProgSubmitIssued:
+            VCXLOGLO1("CIptvTestDownloadManager:: EHttpProgSubmitIssued");
+            break;
+        case EHttpProgResponseHeaderReceived:
+            VCXLOGLO1("CIptvTestDownloadManager:: EHttpProgResponseHeaderReceived");
+            break;
+        case EHttpProgResponseBodyReceived:
+            VCXLOGLO1("CIptvTestDownloadManager:: EHttpProgResponseBodyReceived");
+            break;
+        case EHttpProgRedirectedPermanently:
+            VCXLOGLO1("CIptvTestDownloadManager:: EHttpProgRedirectedPermanently");
+            break;
+        case EHttpProgRedirectedTemporarily:
+            VCXLOGLO1("CIptvTestDownloadManager:: EHttpProgRedirectedTemporarily");
+            break;
+        case EHttpProgDlNameChanged:
+            VCXLOGLO1("CIptvTestDownloadManager:: EHttpProgDlNameChanged");
+            break;
+        case EHttpProgContentTypeChanged:
+            VCXLOGLO1("CIptvTestDownloadManager:: EHttpProgContentTypeChanged");
+            break;
+        case EHttpProgCodDescriptorDownloaded:
+            VCXLOGLO1("CIptvTestDownloadManager:: EHttpProgCodDescriptorDownloaded");
+            break;
+        case EHttpProgCodDownloadStarted:
+            VCXLOGLO1("CIptvTestDownloadManager:: EHttpProgCodDownloadStarted");
+            break;
+        case EHttpProgCodDescriptorAccepted:
+            VCXLOGLO1("CIptvTestDownloadManager:: EHttpProgCodDescriptorAccepted");
+            break;
+        case EHttpProgCodLoadEnd:
+            VCXLOGLO1("CIptvTestDownloadManager:: EHttpProgCodLoadEnd");
+            break;
+        case EHttpProgSupportedMultiPart:
+            VCXLOGLO1("CIptvTestDownloadManager:: EHttpProgSupportedMultiPart");
+            break;
+        case EHttpProgMovingContentFile:
+            VCXLOGLO1("CIptvTestDownloadManager:: EHttpProgMovingContentFilep");
+            break;
+        case EHttpProgContentFileMoved:
+            VCXLOGLO1("CIptvTestDownloadManager:: EHttpProgContentFileMoved");
+            break;
+        default:
+            VCXLOGLO1("CIptvTestDownloadManager:: Unknown state");
+            break;
+        }
+
+    switch (aEvent.iDownloadState)
+        {
+        case EHttpDlCompleted:
+            {
+            VCXLOGLO1("CIptvTestDownloadManager:: EHttpDlCompleted");
+
+			DeleteDownloadAsync( KErrNone );
+            }
+            break;
+
+        case EHttpDlFailed:
+            {
+			TInt32 err;
+			GetError( aDownload, err );
+			VCXLOGLO2("CIptvTestDownloadManager:: Download failed, err: %d", err);
+			if( err == KErrNone )
+			    {
+			    err = KErrGeneral;
+			    }
+			DeleteDownloadAsync( err );
+            }
+            break;
+
+        case EHttpDlCreated:
+            VCXLOGLO1("CIptvTestDownloadManager:: EHttpDlCreated");
+            iDownloadRunning = ETrue;
+            break;
+
+        case EHttpDlInprogress:
+            VCXLOGLO1("CIptvTestDownloadManager:: EHttpDlInprogress");
+            break;
+
+        case EHttpDlPaused:
+            {
+            VCXLOGLO1("CIptvTestDownloadManager:: EHttpDlPaused");
+
+			TInt32 err;
+			GetError(aDownload, err);
+			VCXLOGLO2("CIptvTestDownloadManager:: Download is paused, err: %d", err);
+			if(err == KErrNone) err = KErrGeneral;
+
+			DeleteDownloadAsync( err );
+            }
+	        break;
+
+        case EHttpDlMoved:
+            VCXLOGLO1("CIptvTestDownloadManager:: EHttpDlMoved");
+            break;
+
+        case EHttpDlMediaRemoved:
+            VCXLOGLO1("CIptvTestDownloadManager:: EHttpDlMediaRemoved");
+            break;
+
+        case EHttpDlMediaInserted:
+            VCXLOGLO1("CIptvTestDownloadManager:: EHttpDlMediaInserted");
+            break;
+
+        case EHttpDlPausable:
+            VCXLOGLO1("CIptvTestDownloadManager:: EHttpDlPausable");
+            break;
+
+        case EHttpDlNonPausable:
+            VCXLOGLO1("CIptvTestDownloadManager:: EHttpDlNonPausable");
+            break;
+
+        case EHttpDlDeleted:
+            VCXLOGLO1("CIptvTestDownloadManager:: EHttpDlDeleted");
+
+            if( !iDownloadFinishInformed )
+                {
+                VCXLOGLO1("CIptvTestDownloadManager:: Informing observer.");
+                iDownloadFinishInformed = ETrue;
+                iObserver->DownloadFinished( iError );
+                iDownloadRunning = EFalse;
+                }
+            break;
+
+        case EHttpDlAlreadyRunning:
+            VCXLOGLO1("CIptvTestDownloadManager:: EHttpDlAlreadyRunning");
+            break;
+
+        case EHttpDlDeleting:
+            VCXLOGLO1("CIptvTestDownloadManager:: EHttpDlDeleting");
+            if( !iDownloadFinishInformed )
+                {
+                VCXLOGLO1("CIptvTestDownloadManager:: Informing observer.");
+                iDownloadFinishInformed = ETrue;
+                iObserver->DownloadFinished( iError );
+                iDownloadRunning = EFalse;
+                }
+            break;
+
+        case EHttpDlCancelTransaction:
+            VCXLOGLO1("CIptvTestDownloadManager:: EHttpDlCancelTransaction");
+            break;
+
+        default:
+            VCXLOGLO1("CIptvTestDownloadManager:: Unknown state");
+            break;
+        }
+
+
+	VCXLOGLO1("<<<CIptvTestDownloadManager::HandleDMgrEventL");
+	}
+
+// ---------------------------------------------------------------------------
+// CIptvTestDownloadManager::DownloadL()
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CIptvTestDownloadManager::DownloadL( TDesC& aAddress, TDesC16& aOutFile, TDesC& aUserName, TDesC& aPassword, TInt32 aIapId, TInt aTimeoutSeconds)
+	{
+	VCXLOGLO1(">>>CIptvTestDownloadManager::DownloadL");
+
+	TBool result;
+
+	if( iDownload )
+		{
+		VCXLOGLO1("Download already ongoing.");
+		VCXLOGLO1("<<<CIptvTestDownloadManager::DownloadL");
+		return KErrNone;
+		}
+
+	iDownloadFinishInformed = EFalse;
+	iTimerStartedForDownloadDeletion = EFalse;
+	iError = KErrNone;
+
+    iTimer->After(aTimeoutSeconds * 1000000);
+
+    TBuf8<3000> address;
+    TBuf8<256> username;
+	TBuf8<256> password;
+
+	address.Copy(aAddress);
+	username.Copy(aUserName);
+	password.Copy(aPassword);
+
+	VCXLOGLO3("CIptvTestDownloadManager:: Starting downloading: %S -> %S", &aAddress, &aOutFile);
+	VCXLOGLO3("CIptvTestDownloadManager:: User: %S, PW %S", &aUserName, &aPassword);
+	VCXLOGLO2("CIptvTestDownloadManager:: Timeout: %d", aTimeoutSeconds);
+
+	TInt err = KErrNone;
+
+	err = iDownloadMgr.SetIntAttribute( EDlMgrIap, aIapId );
+    if ( err != KErrNone )
+        {
+        VCXLOGLO2("CIptvTestDownloadManager:: Could not set AP! err: %d", err);
+        return err;
+        }
+
+	RHttpDownload& download = iDownloadMgr.CreateDownloadL( address, result );
+
+	iDownload = &download;
+
+    err = iDownload->SetStringAttribute( EDlAttrDestFilename, aOutFile);
+    if(err != KErrNone)
+    	{
+    	VCXLOGLO1("Setting destfilename failed.");
+    	VCXLOGLO1("<<<CIptvTestDownloadManager::DownloadL");
+    	return err;
+    	}
+
+    download.SetBoolAttribute(EDlAttrNoContentTypeCheck, ETrue);
+    download.SetIntAttribute(EDlAttrUserData, 0);
+
+    err = download.SetStringAttribute(EDlAttrUsername, username);
+    if(err != KErrNone)
+    	{
+    	VCXLOGLO1("Setting download username failed.");
+    	VCXLOGLO1("<<<CIptvTestDownloadManager::DownloadL");
+    	return err;
+    	}
+
+    err = download.SetStringAttribute(EDlAttrPassword, password);
+    if(err != KErrNone)
+    	{
+    	VCXLOGLO1("Setting download password failed.");
+    	VCXLOGLO1("<<<CIptvTestDownloadManager::DownloadL");
+    	return err;
+    	}
+
+	err = iDownload->Start();
+    if(err != KErrNone)
+    	{
+    	VCXLOGLO1("Starting download failed.");
+    	VCXLOGLO1("<<<CIptvTestDownloadManager::DownloadL");
+    	return err;
+    	}
+
+	VCXLOGLO1("<<<CIptvTestDownloadManager::DownloadL");
+
+	return err;
+	}
+
+// ---------------------------------------------------------
+// CIptvTestDownloadManager::GetError
+// ---------------------------------------------------------
+//
+EXPORT_C void CIptvTestDownloadManager::GetError(RHttpDownload& aDownload,
+                                          TInt32& aDownloadError)
+    {
+    TInt32 errorId;
+    TInt32 globalErrorId;
+    aDownload.GetIntAttribute(EDlAttrErrorId, errorId);
+    aDownload.GetIntAttribute(EDlAttrGlobalErrorId, globalErrorId);
+    VCXLOGLO2("CIptvTestDownloadManager:: DL error ID: %d", errorId);
+    VCXLOGLO2("CIptvTestDownloadManager:: DL global error ID: %d", globalErrorId);
+
+    switch(errorId)
+        {
+        case EConnectionFailed:
+            aDownloadError = EConnectionFailed;
+            VCXLOGLO1("CIptvTestDownloadManager::  EConnectionFailed -> EIptvDlConnectionFailed");
+            if(globalErrorId == KErrServerBusy)
+                {
+                VCXLOGLO1("CIptvTestDownloadManager:: server busy -> EIptvDlGeneral");
+                aDownloadError = KErrServerBusy;
+                }
+            break;
+        case EHttpAuthenticationFailed:
+            VCXLOGLO1("CIptvTestDownloadManager::  EHttpAuthenticationFailed -> EIptvDlAuthFailed");
+            aDownloadError = EHttpAuthenticationFailed;
+            break;
+        case EProxyAuthenticationFailed:
+            VCXLOGLO1("CIptvTestDownloadManager::  EProxyAuthenticationFailed -> EIptvDlProxyAuthFailed");
+            aDownloadError = EProxyAuthenticationFailed;
+            break;
+        case EDestFileInUse:
+            VCXLOGLO1("CIptvTestDownloadManager::  EDestFileInUse -> EIptvDlDestFileInUse");
+            aDownloadError = EDestFileInUse;
+            break;
+        case EBadUrl:
+            VCXLOGLO1("CIptvTestDownloadManager::  EBadUrl -> EIptvDlBadUrl");
+            aDownloadError = EBadUrl;
+            break;
+        case EMMCRemoved:
+            VCXLOGLO1("CIptvTestDownloadManager::  EMMCRemoved -> EIptvDlMmcRemoved");
+            aDownloadError = EMMCRemoved;
+            break;
+        case EDiskFull:
+            VCXLOGLO1("CIptvTestDownloadManager::  EDiskFull -> EIptvDlDiskFull");
+            aDownloadError = EDiskFull;
+            break;
+        case EObjectNotFound:
+            VCXLOGLO1("CIptvTestDownloadManager::  EObjectNotFound -> EIptvDlContentNotFound");
+            aDownloadError = EObjectNotFound;
+            break;
+
+        default:
+            VCXLOGLO1("CIptvTestDownloadManager::  unknown -> EIptvDlGeneral");
+            aDownloadError = KErrGeneral;
+            break;
+        }
+    }
+
+// ---------------------------------------------------------
+// CIptvTestDownloadManager::DeleteDownloadAsync
+// ---------------------------------------------------------
+//
+void CIptvTestDownloadManager::DeleteDownloadAsync( TInt aErrorToObserver )
+    {
+    VCXLOGLO1(">>>CIptvTestDownloadManager::DeleteDownloadAsync");
+    if( iDownload )
+        {
+        iTimer->After( 1000000 ); // 1 second
+        iTimerStartedForDownloadDeletion = ETrue;
+        iError = aErrorToObserver;
+        }
+    VCXLOGLO1("<<<CIptvTestDownloadManager::DeleteDownloadAsync");
+    }
+
+void CIptvTestDownloadManager::TimerComplete( TInt aTimerId, TInt aError )
+    {
+    VCXLOGLO1(">>>CIptvTestDownloadManager::TimerComplete");
+
+    VCXLOGLO3("CIptvTestDownloadManager:: aTimerId: %d, aError: %d", aTimerId, aError);
+
+    if( iTimerStartedForDownloadDeletion )
+        {
+        iTimerStartedForDownloadDeletion = EFalse;
+        VCXLOGLO1("IptvTestDownloadManager:: Deleting the download.");
+
+        if( iDownload )
+            {
+            iDownload->Delete();
+            iDownload = NULL;
+            }
+
+        // Obsever is informed at DL deletion.
+        }
+    else
+        {
+        iObserver->DownloadFinished(KErrTimedOut);
+        }
+
+    VCXLOGLO1("<<<CIptvTestDownloadManager::TimerComplete");
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/src/IptvTestUtilALR.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,1082 @@
+/*
+* 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 <centralrepository.h>
+
+#include "IptvTestUtilALR.h"
+#include "VCXTestLog.h"
+#include "TestUtilConnection.h"
+#include "CIptvTestActiveWait.h"
+#include "TestUtilConnectionWaiter.h"
+#include "VCXTestConstants.h"
+#include <cmpluginpacketdatadef.h>
+
+// ========================== MEMBER FUNCTIONS ===============================
+
+// ---------------------------------------------------------------------------
+// CIptvTestUtilALR::NewL()
+//
+// Constructs CIptvTestUtilALR object
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CIptvTestUtilALR* CIptvTestUtilALR::NewL()
+    {
+    VCXLOGLO1(">>>CIptvIptvTestUtilALR::NewL");
+    CIptvTestUtilALR* self = NewLC();
+    CleanupStack::Pop(self);
+    VCXLOGLO1("<<<CIptvIptvTestUtilALR::NewL");
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CIptvTestUtilALR::NewLC()
+//
+// Constructs CIptvTestUtilALR object
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CIptvTestUtilALR* CIptvTestUtilALR::NewLC()
+    {
+    VCXLOGLO1(">>>CIptvIptvTestUtilALR::NewLC");
+    CIptvTestUtilALR* self = new (ELeave) CIptvTestUtilALR();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    VCXLOGLO1("<<<CIptvIptvTestUtilALR::NewLC");
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CIptvTestUtilALR::~CIptvTestUtilALR()
+//
+// Destructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CIptvTestUtilALR::~CIptvTestUtilALR()
+    {
+    VCXLOGLO1(">>>CIptvIptvTestUtilALR::~CIptvIptvTestUtilALR");
+
+	iCmManager.Close();
+
+    delete iActiveWait;
+    iActiveWait = NULL;
+
+    VCXLOGLO1("<<<CIptvIptvTestUtilALR::~CIptvIptvTestUtilALR");
+    }
+
+// ---------------------------------------------------------------------------
+// CIptvTestUtilALR::ConstructL()
+//
+// Second phase constructor
+// ---------------------------------------------------------------------------
+//
+void CIptvTestUtilALR::ConstructL()
+    {
+    VCXLOGLO1(">>>CIptvIptvTestUtilALR::ConstructL");
+
+    iCmManager.OpenL();
+
+    iActiveWait = CIptvTestActiveWait::NewL();
+
+    VCXLOGLO1("<<<CIptvIptvTestUtilALR::ConstructL");
+    }
+
+// ---------------------------------------------------------------------------
+// CIptvTestUtilALR::CIptvTestUtilALR()
+//
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CIptvTestUtilALR::CIptvTestUtilALR()
+    {
+    VCXLOGLO1(">>>CIptvIptvTestUtilALR::CIptvIptvTestUtilALR");
+
+    VCXLOGLO1("<<<CIptvIptvTestUtilALR::CIptvIptvTestUtilALR");
+    }
+
+// ---------------------------------------------------------------------------
+// CIptvTestUtilALR::RemoveUsedDestinationCenRepL()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CIptvTestUtilALR::RemoveUsedDestinationCenRepL()
+    {
+    VCXLOGLO1(">>>CIptvIptvTestUtilALR::RemoveUsedDestinationCenRep");
+
+    CRepository* cenRep = CRepository::NewLC( VCXTEST_KIptvAlrCenRepUid );
+    User::LeaveIfError( cenRep->Delete( VCXTEST_KIptvCenRepUsedSnapIdKey ) );
+    CleanupStack::PopAndDestroy( cenRep );
+
+   	VCXLOGLO1("<<<CIptvIptvTestUtilALR::RemoveUsedDestinationCenRep");
+    }
+
+// ---------------------------------------------------------------------------
+// CIptvTestUtilALR::SetUsedDestinationL()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CIptvTestUtilALR::SetUsedDestinationL( TDesC& aDestinationName )
+    {
+    VCXLOGLO1(">>>CIptvIptvTestUtilALR::SetUsedDestinationL");
+
+    VCXLOGLO2("CIptvIptvTestUtilALR:: dest name: %S", &aDestinationName);
+
+    TInt destId(0);
+
+    if( aDestinationName.Compare( _L("ALWAYS_ASK") ) != KErrNone )
+        {
+        destId = GetDestinationIdL( aDestinationName );
+        }
+    VCXLOGLO2("CIptvIptvTestUtilALR:: dest id: %d", destId);
+    
+    TCmDefConnValue defaultConnection;
+    defaultConnection.iType = ECmDefConnDestination;
+    defaultConnection.iId = destId;
+    iCmManager.WriteDefConnL( defaultConnection );
+
+   	VCXLOGLO1("<<<CIptvIptvTestUtilALR::SetUsedDestinationL");
+    }
+
+// ---------------------------------------------------------------------------
+// CIptvTestUtilALR::CreateDestinationL()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CIptvTestUtilALR::CreateDestinationL( TDesC& aDestinationName )
+    {
+    VCXLOGLO1(">>>CIptvIptvTestUtilALR::CreateDestinationL");
+
+    VCXLOGLO2("CIptvIptvTestUtilALR:: dest name: %S", &aDestinationName);
+
+	RCmDestinationExt dest;
+	TRAPD( err, dest = iCmManager.CreateDestinationL( aDestinationName ) );
+	VCXLOGLO2("CIptvIptvTestUtilALR::CreateDestinationL: CreateDestinationL returned: %d", err);
+	User::LeaveIfError( err );
+	
+	CleanupClosePushL( dest );
+	TRAP( err, dest.SetHiddenL( EFalse ) );
+	VCXLOGLO2("CIptvIptvTestUtilALR::CreateDestinationL: SetHiddenL returned: %d", err);
+	User::LeaveIfError( err );
+	
+	// This leaves sometimes with KErrLocked, try again in that case few times. 
+	for( TInt retry = 0; retry < 5; retry++ )
+	    {
+	    TRAP( err, dest.UpdateL() );
+	    VCXLOGLO2("CIptvIptvTestUtilALR::CreateDestinationL: UpdateL returned: %d", err);
+	    if( err != KErrLocked )
+	        {
+	        User::LeaveIfError( err );
+	        break; // All ok.
+	        }
+	    User::After( 1000000 );
+	    }
+
+	CleanupStack::PopAndDestroy( &dest );
+
+   	VCXLOGLO1("<<<CIptvIptvTestUtilALR::CreateDestinationL");
+    }
+
+// ---------------------------------------------------------------------------
+// CIptvTestUtilALR::DeleteDestinationL()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CIptvTestUtilALR::DeleteDestinationL( TDesC& aDestinationName )
+    {
+    VCXLOGLO1(">>>CIptvIptvTestUtilALR::DeleteDestinationL");
+
+    VCXLOGLO2("CIptvIptvTestUtilALR:: dest name: '%S'", &aDestinationName);
+
+    TInt destId = GetDestinationIdL( aDestinationName );
+    RCmDestinationExt destination = iCmManager.DestinationL( destId );
+    CleanupClosePushL( destination );
+
+    TRAP_IGNORE( TerminateDestinationConnectionsL( aDestinationName ) );
+
+    // Delete methods first.
+    for(TInt e=destination.ConnectionMethodCount()-1; e>=0 ; e--)
+        {
+        RCmConnectionMethodExt method = destination.ConnectionMethodL( e );
+        CleanupClosePushL( method );
+        VCXLOGLO2( "CIptvIptvTestUtilALR:: deleting method: %d", e );
+
+        destination.DeleteConnectionMethodL( method  );
+        destination.UpdateL();
+        CleanupStack::PopAndDestroy( &method );
+        }
+
+    VCXLOGLO2( "CIptvIptvTestUtilALR:: deleting destination id: %d", destId );
+    destination.DeleteLD();
+    
+    CleanupStack::PopAndDestroy( &destination );
+
+   	VCXLOGLO1("<<<CIptvIptvTestUtilALR::DeleteDestinationL");
+    }
+
+// ---------------------------------------------------------------------------
+// CIptvTestUtilALR::CopyMethodL()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CIptvTestUtilALR::CopyMethodL( TDesC& aMethodName, TDesC& aNewMethodName, TDesC& aNewDestinationName )
+    {
+    VCXLOGLO1(">>>CIptvIptvTestUtilALR::CopyMethodL");
+
+    TBuf<256> srcMethodName( aMethodName );
+
+	VCXLOGLO2( "CIptvIptvTestUtilALR:: srcMethodName: %S", &srcMethodName );
+	VCXLOGLO2( "CIptvIptvTestUtilALR:: aNewMethodName: %S", &aNewMethodName );
+	VCXLOGLO2( "CIptvIptvTestUtilALR:: aNewDestinationName: %S", &aNewDestinationName );
+	
+	// Find target destination.
+    TInt targetDestId = GetDestinationIdL( aNewDestinationName );
+    RCmDestinationExt targetDestination = iCmManager.DestinationL( targetDestId );
+    CleanupClosePushL( targetDestination );
+
+    // Check if target has destination with the name already.
+    for(TInt e=0; e<targetDestination.ConnectionMethodCount(); e++)
+    	{
+    	RCmConnectionMethodExt method = targetDestination.ConnectionMethodL( e );
+    	CleanupClosePushL( method );
+
+    	HBufC* methodName = method.GetStringAttributeL( CMManager::ECmName );
+    	CleanupStack::PushL( methodName );
+
+    	VCXLOGLO2( "CIptvIptvTestUtilALR:: method: '%S'", methodName );
+    	if( MethodMatchesL( srcMethodName, *methodName, ETrue ) )
+    	    {
+			VCXLOGLO1( "CIptvIptvTestUtilALR:: Target destination already has method with the name.");
+        	CleanupStack::PopAndDestroy( methodName );
+    		CleanupStack::PopAndDestroy( &method );
+    		CleanupStack::PopAndDestroy( &targetDestination );
+            VCXLOGLO1("<<<CIptvIptvTestUtilALR::CopyMethodL");
+            return;
+    		}
+    	CleanupStack::PopAndDestroy( methodName );
+		CleanupStack::PopAndDestroy( &method );
+    	}
+
+	// Find method from destinations and create copy of it.
+	TBool found( EFalse );
+	TBool foundExact( EFalse );
+    TUint32 foundDestId( 0 );
+    TInt foundIapIndex( 0 );
+
+	RArray<TUint32> destIds(5);
+	iCmManager.AllDestinationsL( destIds );
+	VCXLOGLO2( "CIptvIptvTestUtilALR:: dest Count: %d", destIds.Count() );
+	
+	for(TInt i=0; i<destIds.Count(); i++ )
+	    {
+	    RCmDestinationExt sourceDestination = iCmManager.DestinationL( destIds[i] );
+	    CleanupClosePushL( sourceDestination );
+
+	    HBufC* name = sourceDestination.NameLC();
+	    VCXLOGLO2( "CIptvIptvTestUtilALR:: dest: '%S'", name );
+		TInt methodCount = sourceDestination.ConnectionMethodCount();
+		VCXLOGLO2( "CIptvIptvTestUtilALR:: methodCount: %d", methodCount );
+
+	    for(TInt e=0; e<sourceDestination.ConnectionMethodCount(); e++)
+	    	{
+	    	RCmConnectionMethodExt sourceMethod = sourceDestination.ConnectionMethodL( e );
+	    	CleanupClosePushL( sourceMethod );
+
+	    	HBufC* methodName = sourceMethod.GetStringAttributeL( CMManager::ECmName );
+	    	CleanupStack::PushL( methodName );
+	    	
+	    	TInt iapId = sourceMethod.GetIntAttributeL( CMManager::ECmIapId );
+	    	VCXLOGLO3( "CIptvIptvTestUtilALR:: method: '%S', id: %d", methodName, iapId );
+
+            // Check for exact match.
+            if( MethodMatchesL( srcMethodName, *methodName, ETrue ) )
+                {
+                VCXLOGLO1( "CIptvIptvTestUtilALR:: exact match.");
+                foundExact = ETrue;
+                foundDestId = destIds[i];
+                foundIapIndex = e;
+                }
+
+	    	// No exact match found yet, check if its any of the alternative iaps.
+	    	if( !foundExact && MethodMatchesL( srcMethodName, *methodName, EFalse ) )
+	    	    {
+	    	    VCXLOGLO1( "CIptvIptvTestUtilALR:: alt match.");
+	    	    found = ETrue;
+                foundDestId = destIds[i];
+                foundIapIndex = e;
+	    	    }
+
+	    	CleanupStack::PopAndDestroy( methodName );
+    		CleanupStack::PopAndDestroy( &sourceMethod );
+    		
+    		// No need to search further.
+    		if( foundExact )
+    		    {
+    		    break;
+    		    }
+	    	}
+
+        CleanupStack::PopAndDestroy( name );
+        CleanupStack::PopAndDestroy( &sourceDestination );
+
+		// No need to search further.
+		if( foundExact )
+		    {
+		    break;
+		    }        
+	    }
+
+    // Iap found, create copy of it.
+    if( foundExact || found )
+        {
+        VCXLOGLO1( "CIptvIptvTestUtilALR:: Creating copy of the method." );
+        
+        RCmDestinationExt sourceDestination = iCmManager.DestinationL( foundDestId );
+	    CleanupClosePushL( sourceDestination );
+	    
+	    VCXLOGLO1( "CIptvIptvTestUtilALR:: source dest ok." );
+
+    	RCmConnectionMethodExt sourceMethod = sourceDestination.ConnectionMethodL( foundIapIndex );
+    	CleanupClosePushL( sourceMethod );
+    	
+    	VCXLOGLO1( "CIptvIptvTestUtilALR:: source method ok." );
+    	
+        HBufC* sourceMethodName = sourceMethod.GetStringAttributeL( CMManager::ECmName );
+        CleanupStack::PushL( sourceMethodName );
+        
+        VCXLOGLO1( "CIptvIptvTestUtilALR:: source method name ok." );
+
+		RCmConnectionMethodExt newMethod = sourceMethod.CreateCopyL();
+		CleanupClosePushL( newMethod );
+		
+		VCXLOGLO1( "CIptvIptvTestUtilALR:: copy ok." );
+		
+		// If method names are same rename source method because there can't be two with same name.
+        if( *sourceMethodName == aNewMethodName )
+            {
+            VCXLOGLO1( "CIptvIptvTestUtilALR:: Method names are same, renaming source method." );
+            HBufC* newName = HBufC::NewL( sourceMethodName->Length() + 5);
+            newName->Des().Append( *sourceMethodName );
+            newName->Des().Append( _L("_old") );
+            sourceMethod.SetStringAttributeL( CMManager::ECmName, *newName );
+            delete newName;
+            sourceMethod.UpdateL();            
+            }
+		
+		// Set name for new method.
+        newMethod.SetStringAttributeL( CMManager::ECmName, aNewMethodName );
+		// Disable dialog asking permission.
+		newMethod.SetIntAttributeL( CMManager::ECmSeamlessnessLevel, CMManager::ESeamlessnessShowprogress );
+		
+		VCXLOGLO1( "CIptvIptvTestUtilALR:: new method updated." );
+		
+		targetDestination.AddConnectionMethodL( newMethod );
+		targetDestination.UpdateL();
+		
+		VCXLOGLO1( "CIptvIptvTestUtilALR:: method added to target dest." );
+		
+		CleanupStack::PopAndDestroy( &newMethod );
+		CleanupStack::PopAndDestroy( sourceMethodName );
+		CleanupStack::PopAndDestroy( &sourceMethod );
+		CleanupStack::PopAndDestroy( &sourceDestination );
+        }
+	// No iap found, search from uncategorized IAPs.
+    else
+		{
+		RArray<TUint32> cmarray;
+		TRAPD( err, iCmManager.ConnectionMethodL( cmarray, EFalse, EFalse, EFalse ) );
+		if( err != KErrNone )
+		    {
+		    VCXLOGLO2( "CIptvIptvTestUtilALR:: could not get uncategorized IAPs. err: %d", err );
+		    cmarray.Reset();
+		    cmarray.Close();
+		    }
+
+		VCXLOGLO2( "CIptvIptvTestUtilALR:: uncategorized IAP count: %d", cmarray.Count() );
+
+		for( TInt e = 0; e < cmarray.Count(); e++ )
+            {
+            RCmConnectionMethodExt sourceMethod = iCmManager.ConnectionMethodL( cmarray[e] );
+            CleanupClosePushL( sourceMethod );
+
+            HBufC* methodName = sourceMethod.GetStringAttributeL( CMManager::ECmName );
+            CleanupStack::PushL( methodName );
+            
+            TInt iapId = sourceMethod.GetIntAttributeL( CMManager::ECmIapId );
+            VCXLOGLO3( "CIptvIptvTestUtilALR:: method: '%S', id: %d", methodName, iapId );
+
+            // Check for exact match.
+            if( MethodMatchesL( srcMethodName, *methodName, ETrue ) )
+                {
+                VCXLOGLO1( "CIptvIptvTestUtilALR:: exact match.");
+                foundExact = ETrue;
+                foundIapIndex = e;
+                }
+
+	    	// No exact match found yet, check if its any of the alternative iaps.
+	    	if( !foundExact && MethodMatchesL( srcMethodName, *methodName, EFalse ) )
+	    	    {
+	    	    VCXLOGLO1( "CIptvIptvTestUtilALR:: alt match.");
+	    	    found = ETrue;
+                foundIapIndex = e;
+	    	    }
+
+            CleanupStack::PopAndDestroy( methodName );
+            CleanupStack::PopAndDestroy( &sourceMethod );
+
+    		// No need to search further.
+    		if( foundExact )
+    		    {
+    		    break;
+    		    }
+            }
+
+        // Found IAP from uncategorized dest.
+        if( found || foundExact )
+            {
+            VCXLOGLO1( "CIptvIptvTestUtilALR:: Creating copy of the method." );
+
+            RCmConnectionMethodExt sourceMethod = iCmManager.ConnectionMethodL( cmarray[foundIapIndex] );
+            CleanupClosePushL( sourceMethod );
+
+            HBufC* sourceMethodName = sourceMethod.GetStringAttributeL( CMManager::ECmName );
+            CleanupStack::PushL( sourceMethodName );
+            
+            RCmConnectionMethodExt newMethod = sourceMethod.CreateCopyL();
+            VCXLOGLO1( "CIptvIptvTestUtilALR:: New Method ok." );
+            CleanupClosePushL( newMethod );
+            
+            // If method names are same rename source method because there can't be two with same name.
+            if( *sourceMethodName == aNewMethodName )
+                {
+                VCXLOGLO1( "CIptvIptvTestUtilALR:: Method names are same, renaming source method." );
+                HBufC* newName = HBufC::NewL( sourceMethodName->Length() + 5);
+                newName->Des().Append( *sourceMethodName );
+                newName->Des().Append( _L("_old") );
+                sourceMethod.SetStringAttributeL( CMManager::ECmName, *newName );
+                delete newName;
+                sourceMethod.UpdateL();
+                }            
+            
+            // Set name for new method.
+            newMethod.SetStringAttributeL( CMManager::ECmName, aNewMethodName );
+            // Disable dialog asking permission.
+            newMethod.SetIntAttributeL( CMManager::ECmSeamlessnessLevel, CMManager::ESeamlessnessShowprogress );
+            
+            targetDestination.AddConnectionMethodL( newMethod );
+            targetDestination.UpdateL();
+
+            CleanupStack::PopAndDestroy( &newMethod );            
+            CleanupStack::PopAndDestroy( sourceMethodName );
+            CleanupStack::PopAndDestroy( &sourceMethod );            
+            }
+
+        cmarray.Reset();
+        cmarray.Close();
+		}
+
+	destIds.Reset();
+	destIds.Close();
+
+	PrintDestinationL( targetDestination );
+	CleanupStack::PopAndDestroy( &targetDestination );
+	
+	if( !foundExact && !found )
+	    {
+	    VCXLOGLO2( "CIptvIptvTestUtilALR:: source method %S not found!", &srcMethodName );
+#ifdef __WINSCW__
+	    VCXLOGLO1( "CIptvIptvTestUtilALR:: EMULATOR BUILD, check that iap is not uncategorized." );
+#endif
+	    User::Leave(KErrNotFound);
+	    }	
+
+   	VCXLOGLO1("<<<CIptvIptvTestUtilALR::CopyMethodL");
+    }
+
+// ---------------------------------------------------------------------------
+// CIptvTestUtilALR::DeleteMethodL()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CIptvTestUtilALR::DeleteMethodL( TDesC& aDestinationName, TDesC& aMethodName )
+    {
+    VCXLOGLO1(">>>CIptvIptvTestUtilALR::DeleteMethodL");
+
+	VCXLOGLO2( "CIptvIptvTestUtilALR:: aDestinationName: %S", &aDestinationName );
+	VCXLOGLO2( "CIptvIptvTestUtilALR:: aMethodName: %S", &aMethodName );
+
+    TInt destId = GetDestinationIdL( aDestinationName );
+    RCmDestinationExt destination = iCmManager.DestinationL( destId );
+    CleanupClosePushL( destination );
+
+	TBool found( EFalse );
+
+	// Find method and delete it.
+	for(TInt e=0; e< destination.ConnectionMethodCount(); e++)
+    	{
+    	RCmConnectionMethodExt method = destination.ConnectionMethodL( e );
+    	CleanupClosePushL( method );
+
+    	HBufC* methodName = method.GetStringAttributeL( CMManager::ECmName );
+        CleanupStack::PushL( methodName );
+        TInt iapId = method.GetIntAttributeL( CMManager::ECmIapId );
+        VCXLOGLO3( "CIptvIptvTestUtilALR:: method: '%S', id: %d", methodName, iapId );
+
+    	if( methodName->Compare( aMethodName ) == 0 )
+    		{
+			VCXLOGLO1( "CIptvIptvTestUtilALR:: Match. Deleting." );
+			found = ETrue;
+			destination.DeleteConnectionMethodL( method  );
+			destination.UpdateL();
+    		}
+    	CleanupStack::PopAndDestroy( methodName );
+    	CleanupStack::PopAndDestroy( &method );
+    	}
+
+	if(!found)
+		{
+		VCXLOGLO1( "CIptvIptvTestUtilALR:: method not found!");
+		User::Leave(KErrNotFound);
+		}
+
+	PrintDestinationL( destination );
+	CleanupStack::PopAndDestroy( &destination );
+
+   	VCXLOGLO1("<<<CIptvIptvTestUtilALR::DeleteMethodL");
+    }
+
+// ---------------------------------------------------------------------------
+// CIptvTestUtilALR::SetMethodPriorityL()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CIptvTestUtilALR::SetMethodPriorityL( TDesC& aDestinationName, TDesC& aMethodName, TUint32 aPriority )
+    {
+    VCXLOGLO1(">>>CIptvIptvTestUtilALR::SetMethodPriorityL");
+
+	VCXLOGLO2( "CIptvIptvTestUtilALR:: aDestinationName: %S", &aDestinationName );
+	VCXLOGLO2( "CIptvIptvTestUtilALR:: aMethodName: %S", &aMethodName );
+	VCXLOGLO2( "CIptvIptvTestUtilALR:: aPriority: %d", aPriority );
+
+    TInt destId = GetDestinationIdL( aDestinationName );
+    RCmDestinationExt destination = iCmManager.DestinationL( destId );
+    CleanupClosePushL( destination );
+
+	TBool found( EFalse );
+
+	if( aPriority > destination.ConnectionMethodCount() )
+		{
+		VCXLOGLO2( "CIptvIptvTestUtilALR:: Priority must be less than there's methods in the destination, count: %d!", destination.ConnectionMethodCount() );
+		User::Leave( KErrCorrupt );
+		}
+
+	// No need to set priority here.
+	if( destination.ConnectionMethodCount() <= 1 )
+	    {
+	    CleanupStack::PopAndDestroy( &destination );
+	    VCXLOGLO1("<<<CIptvIptvTestUtilALR::SetMethodPriorityL");
+	    return;
+	    }
+
+	// Find the method and set priority
+	for(TInt e=0; e < destination.ConnectionMethodCount(); e++)
+    	{
+    	VCXLOGLO1( "CIptvIptvTestUtilALR:: Get method." );
+    	RCmConnectionMethodExt method = destination.ConnectionMethodL( e );
+    	CleanupClosePushL( method );
+
+    	HBufC* methodName = method.GetStringAttributeL( CMManager::ECmName );
+        CleanupStack::PushL( methodName );
+        VCXLOGLO1( "CIptvIptvTestUtilALR:: Get iap id." );
+        TInt iapId = method.GetIntAttributeL( CMManager::ECmIapId );
+        VCXLOGLO3( "CIptvIptvTestUtilALR:: method: '%S', id: %d", methodName, iapId );
+
+    	if( methodName->Compare( aMethodName ) == 0 )
+    		{
+			VCXLOGLO1( "CIptvIptvTestUtilALR:: Match. Setting priority." );
+			found = ETrue;
+			destination.ModifyPriorityL( method, aPriority );
+			destination.UpdateL();
+    		}
+    	CleanupStack::PopAndDestroy( methodName );
+    	CleanupStack::PopAndDestroy( &method );
+    	}
+
+	if(!found)
+		{
+		VCXLOGLO1( "CIptvIptvTestUtilALR:: method not found!");
+		User::Leave(KErrNotFound);
+		}
+
+	PrintDestinationL( destination );
+	CleanupStack::PopAndDestroy( &destination );
+
+   	VCXLOGLO1("<<<CIptvIptvTestUtilALR::SetMethodPriorityL");
+    }
+
+// ---------------------------------------------------------------------------
+// CIptvTestUtilALR::SetMethodStringAttributeL()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CIptvTestUtilALR::SetMethodStringAttributeL( TDesC& aDestinationName, TDesC& aMethodName, TInt aAttribute, TDesC& aAttributeValue )
+    {
+    VCXLOGLO1(">>>CIptvIptvTestUtilALR::SetMethodStringAttributeL");
+
+    VCXLOGLO2( "CIptvIptvTestUtilALR:: aDestinationName: %S", &aDestinationName );
+    VCXLOGLO2( "CIptvIptvTestUtilALR:: aMethodName: %S", &aMethodName );
+    VCXLOGLO2( "CIptvIptvTestUtilALR:: aAttribute: %d", aAttribute );
+    VCXLOGLO2( "CIptvIptvTestUtilALR:: aAttributeValue: %S", &aAttributeValue );
+
+    TInt destId = GetDestinationIdL( aDestinationName );
+    RCmDestinationExt destination = iCmManager.DestinationL( destId );
+    CleanupClosePushL( destination );
+
+    TBool found( EFalse );
+
+    // Find the method and set attribute
+    for(TInt e=0; e < destination.ConnectionMethodCount(); e++)
+        {
+        RCmConnectionMethodExt method = destination.ConnectionMethodL( e );
+        CleanupClosePushL( method );
+
+        HBufC* methodName = method.GetStringAttributeL( CMManager::ECmName );
+        CleanupStack::PushL( methodName );
+        TInt iapId = method.GetIntAttributeL( CMManager::ECmIapId );
+        VCXLOGLO3( "CIptvIptvTestUtilALR:: method: '%S', id: %d", methodName, iapId );
+
+        if( MethodMatchesL( aMethodName, *methodName, EFalse ) )
+            {
+            VCXLOGLO1( "CIptvIptvTestUtilALR:: Match. Setting attribute." );
+            found = ETrue;
+
+            method.SetStringAttributeL( aAttribute, aAttributeValue );
+            method.UpdateL();
+            }
+            
+        CleanupStack::PopAndDestroy( methodName );
+        CleanupStack::PopAndDestroy( &method );
+        }
+
+    if(!found)
+        {
+        VCXLOGLO1( "CIptvIptvTestUtilALR:: method not found!");
+        User::Leave(KErrNotFound);
+        }
+
+    CleanupStack::PopAndDestroy( &destination );
+
+    VCXLOGLO1("<<<CIptvIptvTestUtilALR::SetMethodStringAttributeL");
+    }
+
+// ---------------------------------------------------------------------------
+// CIptvTestUtilALR::SetMethodIntAttributeL()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CIptvTestUtilALR::SetMethodIntAttributeL( TDesC& aDestinationName, TDesC& aMethodName, TInt aAttribute, TInt aAttributeValue )
+    {
+    VCXLOGLO1(">>>CIptvIptvTestUtilALR::SetMethodIntAttributeL");
+
+    VCXLOGLO2( "CIptvIptvTestUtilALR:: aDestinationName: %S", &aDestinationName );
+    VCXLOGLO2( "CIptvIptvTestUtilALR:: aMethodName: %S", &aMethodName );
+    VCXLOGLO2( "CIptvIptvTestUtilALR:: aAttribute: %d", aAttribute );
+    VCXLOGLO2( "CIptvIptvTestUtilALR:: aAttributeValue: %d", aAttributeValue );
+
+    TInt destId = GetDestinationIdL( aDestinationName );
+    RCmDestinationExt destination = iCmManager.DestinationL( destId );
+    CleanupClosePushL( destination );
+
+    TBool found( EFalse );
+
+    // Find the method and set attribute
+    for(TInt e=0; e < destination.ConnectionMethodCount(); e++)
+        {
+        RCmConnectionMethodExt method = destination.ConnectionMethodL( e );
+        CleanupClosePushL( method );
+
+        HBufC* methodName = method.GetStringAttributeL( CMManager::ECmName );
+        CleanupStack::PushL( methodName );
+        TInt iapId = method.GetIntAttributeL( CMManager::ECmIapId );
+        VCXLOGLO3( "CIptvIptvTestUtilALR:: method: '%S', id: %d", methodName, iapId );
+
+        if( MethodMatchesL( aMethodName, *methodName, EFalse ) )
+            {
+            VCXLOGLO1( "CIptvIptvTestUtilALR:: Match. Setting attribute." );
+            found = ETrue;
+
+            method.SetIntAttributeL( aAttribute, aAttributeValue );
+            method.UpdateL();
+            }
+            
+        CleanupStack::PopAndDestroy( methodName );
+        CleanupStack::PopAndDestroy( &method );
+        }
+
+    if(!found)
+        {
+        VCXLOGLO1( "CIptvIptvTestUtilALR:: method not found!");
+        User::Leave(KErrNotFound);
+        }
+
+    CleanupStack::PopAndDestroy( &destination );
+
+    VCXLOGLO1("<<<CIptvIptvTestUtilALR::SetMethodIntAttributeL");
+    }
+
+// ---------------------------------------------------------------------------
+// CIptvTestUtilALR::SetMethodBoolAttributeL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CIptvTestUtilALR::SetMethodBoolAttributeL( TDesC& aDestinationName, TDesC& aMethodName, TInt aAttribute, TBool aAttributeValue )
+    {
+    VCXLOGLO1(">>>CIptvIptvTestUtilALR::SetMethodBoolAttributeL");
+
+    VCXLOGLO2( "CIptvIptvTestUtilALR:: aDestinationName: %S", &aDestinationName );
+    VCXLOGLO2( "CIptvIptvTestUtilALR:: aMethodName: %S", &aMethodName );
+    VCXLOGLO2( "CIptvIptvTestUtilALR:: aAttribute: %d", aAttribute );
+    VCXLOGLO2( "CIptvIptvTestUtilALR:: aAttributeValue: %d", &aAttributeValue );
+
+    TInt destId = GetDestinationIdL( aDestinationName );
+    RCmDestinationExt destination = iCmManager.DestinationL( destId );
+    CleanupClosePushL( destination );
+
+    TBool found = EFalse;
+
+    // Find the method and set attribute
+    for(TInt e=0; e < destination.ConnectionMethodCount(); e++)
+        {
+        RCmConnectionMethodExt method = destination.ConnectionMethodL( e );
+        CleanupClosePushL( method );
+
+        HBufC* methodName = method.GetStringAttributeL( CMManager::ECmName );
+        CleanupStack::PushL( methodName );
+        TInt iapId = method.GetIntAttributeL( CMManager::ECmIapId );
+        VCXLOGLO3( "CIptvIptvTestUtilALR:: method: '%S', id: %d", methodName, iapId );
+
+        if( MethodMatchesL( aMethodName, *methodName, EFalse ) )
+            {
+            VCXLOGLO1( "CIptvIptvTestUtilALR:: Match. Setting attribute." );
+            found = ETrue;
+
+            method.SetBoolAttributeL( aAttribute, aAttributeValue );
+            method.UpdateL();
+            }
+            
+        CleanupStack::PopAndDestroy( methodName );
+        CleanupStack::PopAndDestroy( &method );
+        }
+
+    if(!found)
+        {
+        VCXLOGLO1( "CIptvIptvTestUtilALR:: method not found!");
+        User::Leave(KErrNotFound);
+        }
+
+    CleanupStack::PopAndDestroy( &destination );
+
+    VCXLOGLO1("<<<CIptvIptvTestUtilALR::SetMethodBoolAttributeL");
+    }
+
+// ---------------------------------------------------------------------------
+// CIptvTestUtilALR::GetDestinationIdL()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CIptvTestUtilALR::GetDestinationIdL( TDesC& aDestinationName )
+    {
+    VCXLOGLO1(">>>CIptvIptvTestUtilALR::GetDestinationIdL");
+
+    VCXLOGLO2("CIptvIptvTestUtilALR:: dest name: '%S'", &aDestinationName);
+
+    RArray<TUint32> destIds(5);
+
+    iCmManager.AllDestinationsL( destIds );
+    VCXLOGLO2( "CIptvIptvTestUtilALR:: dest Count: %d", destIds.Count() );
+
+    TInt foundDestId(0);
+
+    for(TInt i=0; i<destIds.Count(); i++ )
+        {
+        RCmDestinationExt dest = iCmManager.DestinationL( destIds[i] );
+        CleanupClosePushL( dest );
+        HBufC* name = dest.NameLC();
+        VCXLOGLO3( "CIptvIptvTestUtilALR:: dest: '%S', id: %d", name, destIds[i] );
+        if( name->Compare( aDestinationName ) == 0 )
+            {
+            foundDestId = destIds[i];
+            VCXLOGLO2( "CIptvIptvTestUtilALR:: found destination id: %d", destIds[i] );
+            CleanupStack::PopAndDestroy( name );
+            CleanupStack::PopAndDestroy( &dest );
+            break;
+            }
+        else
+            {
+            CleanupStack::PopAndDestroy( name );
+            CleanupStack::PopAndDestroy( &dest );
+            }
+        }
+
+    if( foundDestId == 0 )
+        {
+        VCXLOGLO1( "CIptvIptvTestUtilALR:: destination not found!");
+        User::Leave( KErrNotFound );
+        }
+
+    destIds.Reset();
+    destIds.Close();
+
+    VCXLOGLO1("<<<CIptvIptvTestUtilALR::GetDestinationIdL");
+    return foundDestId;
+    }
+
+// ---------------------------------------------------------------------------
+// CIptvTestUtilALR::TerminateDestinationConnectionsL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CIptvTestUtilALR::TerminateDestinationConnectionsL( TDesC& aDestinationName )
+    {
+    VCXLOGLO1(">>>CIptvIptvTestUtilALR::TerminateDestinationConnectionsL");
+
+    VCXLOGLO2( "CIptvIptvTestUtilALR:: aDestinationName: %S", &aDestinationName );
+
+    TInt destId = GetDestinationIdL( aDestinationName );
+    RCmDestinationExt destination = iCmManager.DestinationL( destId );
+    CleanupClosePushL( destination );
+
+    // Check if there's active connections for the methods
+    for(TInt e=0; e < destination.ConnectionMethodCount(); e++)
+        {
+        RCmConnectionMethodExt method = destination.ConnectionMethodL( e );
+        CleanupClosePushL( method );
+
+        HBufC* methodName = method.GetStringAttributeL( CMManager::ECmName );
+        CleanupStack::PushL( methodName );
+        TInt iapId = method.GetIntAttributeL( CMManager::ECmIapId );
+        VCXLOGLO3( "CIptvIptvTestUtilALR:: method: '%S', id: %d", methodName, iapId );
+
+        CTestUtilConnectionWaiter* connectionWaiter = CTestUtilConnectionWaiter::NewL( this );
+        CleanupStack::PushL( connectionWaiter );
+
+        // Terminate active connection
+        if( connectionWaiter->IsConnectionActive( iapId ) )
+            {
+            CTestUtilConnection* connectionUtil = CTestUtilConnection::NewL( this );
+            CleanupStack::PushL( connectionUtil );
+            connectionUtil->SetConnectionPreferences( KCommDbBearerUnknown, iapId );
+            connectionUtil->AttachL();
+
+            connectionUtil->TerminateConnectionL();
+            connectionWaiter->WaitUntilConnectionIsClosed( iapId );
+            iActiveWait->Start();
+
+            CleanupStack::PopAndDestroy( connectionUtil );
+            }
+        CleanupStack::PopAndDestroy( connectionWaiter );
+        CleanupStack::PopAndDestroy( methodName );
+        CleanupStack::PopAndDestroy( &method );
+        }
+
+    CleanupStack::PopAndDestroy( &destination );
+
+    VCXLOGLO1("<<<CIptvIptvTestUtilALR::TerminateDestinationConnectionsL");
+    }
+
+// ---------------------------------------------------------------------------
+// CIptvTestUtilALR::GetDefaultIap
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TUint32 CIptvTestUtilALR::GetDefaultIap()
+    {
+    VCXLOGLO1(">>>CIptvTestUtilALR::GetDefaultIap");
+    RSocketServ ss;
+    ss.Connect();
+    
+    RConnection conn;
+    conn.Open( ss );
+
+    TCommDbConnPref prefs;
+    prefs.SetDialogPreference( ECommDbDialogPrefDoNotPrompt );
+
+    conn.Start( prefs );
+    TUint32 iap( 0 );
+    conn.GetIntSetting( _L("IAP\\Id"), iap );
+    conn.Close();
+
+    VCXLOGLO2("<<<CIptvTestUtilALR::GetDefaultIap return %D", iap);
+    return iap;
+    }
+
+// ---------------------------------------------------------------------------
+// CIptvTestUtilALR::SetDefaultIapCenRep
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CIptvTestUtilALR::SetDefaultIapCenRep()
+    {
+    TUint32 iap( 0 );
+    iap = GetDefaultIap();
+    TInt err( 0 );
+    
+    if( iap != 0 )
+        {
+        VCXLOGLO1("CIptvTestUtilALR::SetDefaultIapCenRep Create cenrep.");
+        CRepository* cenRep = CRepository::NewLC( VCXTEST_KIptvAlrCenRepUid );
+        VCXLOGLO1("CIptvTestUtilALR::SetDefaultIapCenRep Set cenrep.");
+        User::LeaveIfError( cenRep->Set( VCXTEST_KIptvCenRepDefaultIapIdKey, (TInt)iap ) );
+        CleanupStack::PopAndDestroy( cenRep );
+        }
+    else
+        {
+        err = KErrNotFound;
+        }
+    
+    return err;   
+    }
+
+// ---------------------------------------------------------------------------
+// CIptvTestUtilALR::GetDefaultIap
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TUint32 CIptvTestUtilALR::GetDefaultIapCenRep()
+    {
+    TInt iap( 0 );
+    
+    VCXLOGLO1("CIptvTestUtilALR::GetDefaultIapCenRep Create cenrep.");
+    CRepository* cenRep = CRepository::NewLC( VCXTEST_KIptvAlrCenRepUid );
+    VCXLOGLO1("CIptvTestUtilALR::GetDefaultIapCenRep Set cenrep.");
+    User::LeaveIfError( cenRep->Get( VCXTEST_KIptvCenRepDefaultIapIdKey, iap) );
+    CleanupStack::PopAndDestroy( cenRep );
+    
+    TUint32 iapId( iap );
+    
+    return iapId;
+    }
+
+// ---------------------------------------------------------------------------
+// CIptvTestUtilALR::PrintDestinationL
+// ---------------------------------------------------------------------------
+//
+void CIptvTestUtilALR::PrintDestinationL( RCmDestinationExt& aDestination )
+    {
+    HBufC* destName = aDestination.NameLC();
+
+    TPtr destNamePtr = destName->Des();
+    VCXLOGLO2( "CIptvIptvTestUtilALR:: Destination: %S", &destNamePtr );
+
+    for(TInt e=0; e < aDestination.ConnectionMethodCount(); e++)
+        {
+        RCmConnectionMethodExt method = aDestination.ConnectionMethodL( e );
+        CleanupClosePushL( method );
+
+        HBufC* methodName = method.GetStringAttributeL( CMManager::ECmName );
+        CleanupStack::PushL( methodName );
+
+        TUint priority = aDestination.PriorityL( method );
+        TInt iapId = method.GetIntAttributeL( CMManager::ECmIapId );
+        VCXLOGLO4( "CIptvIptvTestUtilALR:: Method: %S, priority: %d, id: %d", methodName, priority, iapId );
+
+        CleanupStack::PopAndDestroy( methodName );
+        CleanupStack::PopAndDestroy( &method );
+        }
+
+    CleanupStack::PopAndDestroy( destName );
+    }
+
+// ---------------------------------------------------------------------------
+// CIptvTestUtilALR::MethodMatchesL
+// ---------------------------------------------------------------------------
+//
+TBool CIptvTestUtilALR::MethodMatchesL( const TDesC& aSearchedName, const TDesC& aCurrentName, TBool aStrict )
+    {
+#ifdef __WINSCW__
+    if( aSearchedName.Compare( _L("Ethernet with Daemon Dynamic IP") ) == 0 )
+        {
+        return ETrue;
+        }
+#endif
+
+    if( aSearchedName.Compare( aCurrentName ) == 0 )
+        {
+        return ETrue;
+        }
+        
+    if( aStrict) 
+        {
+        return EFalse;
+        }
+
+    if( aSearchedName.Compare( _L("Internet") ) == 0 ||  aSearchedName.Compare( _L("Internet2") ) == 0 )
+        {
+        TBuf<256> temp( aCurrentName );
+        temp.LowerCase();
+
+        _LIT(KIapElisaInternet, "elisa internet");
+        _LIT(KIapDnaGPRS, "dna gprs");
+        _LIT(KIapSoneraGPRS, "sonera gprs");
+        _LIT(KIapRLGPRS, "rl gprs");
+        _LIT(KIapInternet, "internet");
+        _LIT(KIapProinternet, "prointernet");
+        _LIT(KGprsInternet, "gprs internet");
+
+        if( temp.Compare( KIapElisaInternet ) == KErrNone ) return ETrue;
+        if( temp.Compare( KIapDnaGPRS ) == KErrNone ) return ETrue;
+        if( temp.Compare( KIapRLGPRS ) == KErrNone ) return ETrue;
+        if( temp.Compare( KIapInternet ) == KErrNone ) return ETrue;
+        if( temp.Compare( KIapProinternet ) == KErrNone ) return ETrue;
+        if( temp.Compare( KGprsInternet ) == KErrNone ) return ETrue;
+        if( temp.Compare( KIapSoneraGPRS ) == KErrNone ) return ETrue;
+        }    
+
+    return EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+// CIptvTestUtilALR::ConnectionCreated
+// ---------------------------------------------------------------------------
+//
+void CIptvTestUtilALR::ConnectionCreated()
+    {
+    iActiveWait->Stop();
+    }
+
+// ---------------------------------------------------------------------------
+// CIptvTestUtilALR::ConnectionClosed
+// ---------------------------------------------------------------------------
+//
+void CIptvTestUtilALR::ConnectionClosed()
+    {
+    iActiveWait->Stop();
+    }
+
+// ---------------------------------------------------------------------------
+// CIptvTestUtilALR::ConnectionFailed
+// ---------------------------------------------------------------------------
+//
+void CIptvTestUtilALR::ConnectionFailed()
+    {
+    iActiveWait->Stop();
+    }
+
+// ---------------------------------------------------------------------------
+// CIptvTestUtilALR::ConnectionAlreadyExists
+// ---------------------------------------------------------------------------
+//
+void CIptvTestUtilALR::ConnectionAlreadyExists()
+    {
+    iActiveWait->Stop();
+    }
+
+// ---------------------------------------------------------------------------
+// CIptvTestUtilALR::ConnectionTimeout
+// ---------------------------------------------------------------------------
+//
+void CIptvTestUtilALR::ConnectionTimeout()
+    {
+    iActiveWait->Stop();
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/src/TestUtilConnection.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,365 @@
+/*
+* 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 "TestUtilConnection.h"
+
+#include "VCXTestLog.h"
+#include "MTestUtilConnectionObserver.h"
+#include <es_enum.h>
+
+// ========================== MEMBER FUNCTIONS ===============================
+
+// ---------------------------------------------------------------------------
+// CTestUtilConnection::NewL()
+//
+// Constructs CTestUtilConnection object
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CTestUtilConnection* CTestUtilConnection::NewL(MTestUtilConnectionObserver* aObserver)
+    {
+    VCXLOGLO1(">>>CIptvTestUtilConnection::NewL");
+    CTestUtilConnection* self = NewLC(aObserver);
+    CleanupStack::Pop(self);
+    VCXLOGLO1("<<<CIptvTestUtilConnection::NewL");
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CTestUtilConnection::NewLC()
+//
+// Constructs CTestUtilConnection object
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CTestUtilConnection* CTestUtilConnection::NewLC(MTestUtilConnectionObserver* aObserver)
+    {
+    VCXLOGLO1(">>>CIptvTestUtilConnection::NewLC");
+    CTestUtilConnection* self = new (ELeave) CTestUtilConnection(aObserver);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    VCXLOGLO1("<<<CIptvTestUtilConnection::NewLC");
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CTestUtilConnection::CTestUtilConnection()
+//
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CTestUtilConnection::CTestUtilConnection(MTestUtilConnectionObserver* aObserver)
+: CActive(CActive::EPriorityHigh), iConnectionState(EIdle), iObserver(aObserver)
+    {
+    VCXLOGLO1(">>>CIptvTestUtilConnection::CIptvTestUtilConnection");
+    SetConnectionPreferences(ECommDbBearerUnknown, 0);
+    VCXLOGLO1("<<<CIptvTestUtilConnection::CIptvTestUtilConnection");
+    }
+
+// ---------------------------------------------------------------------------
+// CTestUtilConnection::~CTestUtilConnection()
+//
+// Destructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CTestUtilConnection::~CTestUtilConnection()
+    {
+    VCXLOGLO1(">>>CIptvTestUtilConnection::~CIptvTestUtilConnection");
+   	Cancel();
+
+    iConnect.Close();
+    iSocketServ.Close();
+
+//	iTimer.Cancel();
+//	iTimer.Close();
+
+   	if( IsAdded() )
+        {
+        Deque(); // calls also Cancel()
+        }
+
+    VCXLOGLO1("<<<CIptvTestUtilConnection::~CIptvTestUtilConnection");
+    }
+
+// ---------------------------------------------------------------------------
+// CTestUtilConnection::ConstructL()
+//
+// Second phase constructor
+// ---------------------------------------------------------------------------
+//
+void CTestUtilConnection::ConstructL()
+    {
+    VCXLOGLO1(">>>CIptvTestUtilConnection::ConstructL");
+
+   	iSocketServ.Connect();
+    iConnect.Open(iSocketServ);
+
+//    User::LeaveIfError(iTimer.CreateLocal());
+
+	CActiveScheduler::Add(this);
+
+   	VCXLOGLO1("<<<CIptvTestUtilConnection::ConstructL");
+    }
+
+// ---------------------------------------------------------------------------
+// CTestUtilConnection::ConnectL()
+//
+// Start connecting to IAP.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CTestUtilConnection::ConnectL()
+	{
+	VCXLOGLO1(">>>CIptvTestUtilConnection::ConnectL");
+
+	if(iConnectionState == CTestUtilConnection::EConnected)
+		{
+		VCXLOGLO1(">>>CIptvTestUtilConnection:: Already connected");
+		return;
+		}
+
+	if (!IsActive())
+		{
+        iConnect.Start(iPref, iStatus);
+        iConnectionState = CTestUtilConnection::EConnecting;
+
+	//if the line below panics it's either because you made a request but you haven't
+	//SetActive the object (pR->iStatus.iFlags&TRequestStatus::EActive==0) or you didn't set the iStatus
+	//to KRequestPending (pR->iStatus.iFlags&TRequestStatus::ERequestPending==0)
+//		iTimerStatus = KRequestPending;
+//	    iTimer.After(iTimerStatus, KTimeout);
+
+		SetActive();
+		VCXLOGLO1(">>>CIptvTestUtilConnection:: Connecting");
+        }
+	else
+		{
+		//globalNote->ShowNoteL(EAknGlobalInformationNote, KTextNotReady);
+		}
+	VCXLOGLO1("<<<CIptvTestUtilConnection::ConnectL");
+	}
+
+
+// ---------------------------------------------------------------------------
+// CTestUtilConnection::AttachL()
+//
+// Attach to open IAP.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CTestUtilConnection::AttachL()
+	{
+	VCXLOGLO1(">>>CIptvTestUtilConnection::AttachL");
+
+	if(iConnectionState == CTestUtilConnection::EConnected)
+		{
+		VCXLOGLO1(">>>CIptvTestUtilConnection:: Already connected");
+		VCXLOGLO1("<<<CIptvTestUtilConnection::AttachL");
+		User::Leave(KErrAlreadyExists);
+		}
+
+	if (!IsActive())
+		{
+        TUint activeConnections = 0;
+        User::LeaveIfError(iConnect.EnumerateConnections(activeConnections));
+
+        TConnectionInfo info;
+        TPckg<TConnectionInfo> infoPckg(info);
+
+        TInt found = EFalse;
+        for(TInt i=1;i<=activeConnections;i++)
+        	{
+
+			User::LeaveIfError(iConnect.GetConnectionInfo(i, infoPckg));
+
+			VCXLOGLO3("CIptvTestUtilConnection:: %d vs %d.", iPref.IapId(), info.iIapId);
+
+			if(info.iIapId == iPref.IapId())
+				{
+				found = ETrue;
+				break;
+				}
+
+        	}
+        if(!found)
+        	{
+			VCXLOGLO1(">>>CIptvTestUtilConnection:: No connection found to that AP.");
+			VCXLOGLO1("<<<CIptvTestUtilConnection::AttachL");
+        	User::Leave(KErrNotFound);
+        	}
+
+        User::LeaveIfError(iConnect.Attach(infoPckg, RConnection::EAttachTypeNormal));
+        iConnectionState = CTestUtilConnection::EConnected;
+        }
+
+	VCXLOGLO1("<<<CIptvTestUtilConnection::AttachL");
+	return;
+	}
+
+// ---------------------------------------------------------------------------
+// CTestUtilConnection::RunL()
+//
+// Handle request completion events
+// ---------------------------------------------------------------------------
+//
+void CTestUtilConnection::RunL()
+	{
+ 	VCXLOGLO1(">>>CIptvTestUtilConnection::RunL");
+
+	/*if(iTimerStatus.Int() == KErrNone)
+		{
+		VCXLOGLO1("CTestUtilConnection:: Connection timeout.");
+		iObserver->ConnectionTimeout();
+		iTimer.Cancel();
+		}
+ */
+    TInt statusCode = iStatus.Int();
+
+    switch (statusCode)
+	    {
+	    case KErrNone: // Connection created succesfully
+	        {
+	        //PrintNoteL(KTextConnectionCreated);
+	        VCXLOGLO1("CTestUtilConnection:: Connection created.");
+	        iConnectionState = CTestUtilConnection::EConnected;
+//	        iTimer.Cancel();
+	        iObserver->ConnectionCreated();
+	        break;
+	        }
+
+	    case KErrNotFound: // Connection failed
+	        {
+	        //PrintNoteL(KTextGeneralError);
+	        VCXLOGLO1("CTestUtilConnection:: Connection failed.");
+	        iConnectionState = CTestUtilConnection::EFailed;
+	        //iTimer.Cancel();
+	        iObserver->ConnectionFailed();
+	        break;
+	        }
+
+	    case KErrCancel: // Connection attempt cancelled
+	        {
+	        //PrintNoteL(KTextConnectionCancelled);
+	        VCXLOGLO1("CTestUtilConnection:: Connection attemption canceled.");
+	        iConnectionState = CTestUtilConnection::EFailed;
+//	        iTimer.Cancel();
+	        iObserver->ConnectionFailed();
+	        break;
+	        }
+
+	    case KErrAlreadyExists: // Connection already exists
+	        {
+	        //PrintNoteL(KTextConnectionExists);
+	        VCXLOGLO1("CTestUtilConnection:: Connection already exists.");
+	        iConnectionState = CTestUtilConnection::EFailed;
+//	        iTimer.Cancel();
+	        iObserver->ConnectionAlreadyExists();
+	        break;
+	        }
+
+	    default:
+	        {
+	        //TBuf<KErrorResolverMaxTextLength> errorText;
+	        // Use text resolver to resolve error text
+	        //errorText = iTextResolver->ResolveError(statusCode);
+	        //PrintErrorL(errorText, statusCode);
+	        VCXLOGLO2("CTestUtilConnection:: Unknown error: %d", statusCode);
+	        iConnectionState = CTestUtilConnection::EFailed;
+//	        iTimer.Cancel();
+	        iObserver->ConnectionFailed();
+	        break;
+	        }
+        }
+
+    VCXLOGLO1("<<<CIptvTestUtilConnection::RunL");
+	}
+
+// ---------------------------------------------------------------------------
+// CTestUtilConnection::DoCancel()
+//
+// Cancels ongoing requests
+// ---------------------------------------------------------------------------
+//
+void CTestUtilConnection::DoCancel()
+	{
+	VCXLOGLO1(">>>CIptvTestUtilConnection::DoCancel");
+	VCXLOGLO1("<<<CIptvTestUtilConnection::DoCancel");
+    // Nothing to do here
+	}
+
+
+// ---------------------------------------------------------------------------
+// CTestUtilConnection::TerminateConnectionL()
+//
+// This function should not be used in normal situation, since it terminates
+// the active connection, even if there are other application using
+// the connection. Calling the RConnection::Close() closes the connection.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CTestUtilConnection::TerminateConnectionL()
+    {
+    VCXLOGLO1(">>>CIptvTestUtilConnection::TermínateConnectionL");
+
+/*
+    if (iProgressNotifier->GetState() == EIAPConnectStateConnected)
+        {
+        // Show confirmation dialog first
+        if (ShowQueryDialogL())
+            {
+            // RConnection::Stop() terminates connection by stopping whole
+            // network interface even if there are other clients using
+            // the connection. It is not recommended to use it unless it is
+            // really meaningful.
+            User::LeaveIfError(iConnect.Stop());
+
+            }
+        }
+    else
+        {
+        PrintNoteL(KTextNotConnected);
+        }
+        */
+    User::LeaveIfError(iConnect.Stop());
+    VCXLOGLO1("<<<CIptvTestUtilConnection::TermínateConnectionL");
+    }
+
+CTestUtilConnection::TConnectionState CTestUtilConnection::GetState()
+    {
+    return iConnectionState;
+    }
+
+// ---------------------------------------------------------------------------
+// CTestUtilConnection::SetConnectionPreferences(TUint aBearer,
+//                                                 TBool aDialog,
+//                                                 TUint32 aIapId)
+//
+// This function sets connection preferences.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CTestUtilConnection::SetConnectionPreferences(
+    TUint aBearer,
+    TUint32 aIapId)
+    {
+    VCXLOGLO1(">>>CIptvTestUtilConnection::SetConnectionPreferences");
+    iPref.SetDirection(ECommDbConnectionDirectionOutgoing);
+	iPref.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
+    iPref.SetIapId(aIapId);
+    iPref.SetBearerSet(aBearer);
+    iPref.SetDirection(ECommDbConnectionDirectionOutgoing);
+	VCXLOGLO1("<<<CIptvTestUtilConnection::SetConnectionPreferences");
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/src/TestUtilConnectionWaiter.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -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: 
+*
+*/
+
+
+// INCLUDE FILES
+
+#include "TestUtilConnectionWaiter.h"
+#include "VCXTestLog.h"
+#include "MTestUtilConnectionObserver.h"
+
+const TInt KMillion = 1000000;
+
+// ========================== MEMBER FUNCTIONS ===============================
+
+// ---------------------------------------------------------------------------
+// CTestUtilConnectionWaiter::NewL()
+//
+// Constructs CTestUtilConnectionWaiter object
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CTestUtilConnectionWaiter* CTestUtilConnectionWaiter::NewL(MTestUtilConnectionObserver* aObserver)
+    {
+    VCXLOGLO1(">>>CTestUtilConnectionWaiter::NewL");
+    CTestUtilConnectionWaiter* self = NewLC(aObserver);
+    CleanupStack::Pop(self);
+    VCXLOGLO1("<<<CTestUtilConnectionWaiter::NewL");
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CTestUtilConnectionWaiter::NewLC()
+//
+// Constructs CTestUtilConnectionWaiter object
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CTestUtilConnectionWaiter* CTestUtilConnectionWaiter::NewLC(MTestUtilConnectionObserver* aObserver)
+    {
+    VCXLOGLO1(">>>CTestUtilConnectionWaiter::NewLC");
+    CTestUtilConnectionWaiter* self = new (ELeave) CTestUtilConnectionWaiter(aObserver);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    VCXLOGLO1("<<<CTestUtilConnectionWaiter::NewLC");
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CTestUtilConnectionWaiter::CTestUtilConnectionWaiter()
+//
+// Constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CTestUtilConnectionWaiter::CTestUtilConnectionWaiter(MTestUtilConnectionObserver* aObserver)
+: CActive(CActive::EPriorityHigh), iObserver(aObserver)
+    {
+    VCXLOGLO1(">>>CTestUtilConnectionWaiter::CTestUtilConnectionWaiter");
+
+    VCXLOGLO1("<<<CTestUtilConnectionWaiter::CTestUtilConnectionWaiter");
+    }
+
+// ---------------------------------------------------------------------------
+// CTestUtilConnectionWaiter::~CTestUtilConnectionWaiter()
+//
+// Destructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CTestUtilConnectionWaiter::~CTestUtilConnectionWaiter()
+    {
+    VCXLOGLO1(">>>CTestUtilConnectionWaiter::~CTestUtilConnectionWaiter");
+
+   	if( IsAdded() )
+        {
+        Deque(); // calls also Cancel()
+        }
+
+   	iServ.Close();
+
+   	iTimer.Close();
+
+    VCXLOGLO1("<<<CTestUtilConnectionWaiter::~CTestUtilConnectionWaiter");
+    }
+
+// ---------------------------------------------------------------------------
+// CTestUtilConnectionWaiter::ConstructL()
+//
+// Second phase constructor
+// ---------------------------------------------------------------------------
+//
+void CTestUtilConnectionWaiter::ConstructL()
+    {
+    VCXLOGLO1(">>>CTestUtilConnectionWaiter::ConstructL");
+
+   	// get connection for the iap
+
+   	TInt err = iServ.Connect();
+   	if(err != KErrNone)
+   		{
+   		VCXLOGLO2("Could not connect to socket server, %d.", err);
+   		User::Leave(err);
+   		}
+
+   	User::LeaveIfError(iTimer.CreateLocal());
+
+	CActiveScheduler::Add(this);
+
+
+   	VCXLOGLO1("<<<CTestUtilConnectionWaiter::ConstructL");
+    }
+
+// ---------------------------------------------------------------------------
+// CTestUtilConnectionWaiter::WaitForConnection()
+//
+// Start waiting the IAP to be active
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CTestUtilConnectionWaiter::WaitForConnection(TUint32 aIapId)
+	{
+	VCXLOGLO1(">>>CTestUtilConnectionWaiter::WaitForConnection");
+
+	if (!IsActive())
+		{
+		iWaitState = EWaitingConnection;
+
+		iIapId = aIapId;
+		iTimer.After(iStatus, KMillion);
+		SetActive();
+		iCheckCount = 0;
+
+		VCXLOGLO2(">>>CTestUtilConnectionWaiter:: Waiting until connection is created for Iap: %d", aIapId);
+        }
+	else
+		{
+		VCXLOGLO1(">>>CTestUtilConnectionWaiter:: error - already ACTIVE");
+		}
+
+	VCXLOGLO1("<<<CTestUtilConnectionWaiter::WaitForConnection");
+	}
+
+
+// ---------------------------------------------------------------------------
+// CTestUtilConnectionWaiter::WaitUntilConnectionIsClosed()
+//
+// Start waiting the IAP to be active
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CTestUtilConnectionWaiter::WaitUntilConnectionIsClosed(TUint32 aIapId)
+	{
+	VCXLOGLO1(">>>CTestUtilConnectionWaiter::WaitUntilConnectionIsClosed");
+
+	if (!IsActive())
+		{
+		iWaitState = EWaitingConnectionClosed;
+
+		iIapId = aIapId;
+		iTimer.After(iStatus, KMillion);
+		SetActive();
+		iCheckCount = 0;
+
+		VCXLOGLO2(">>>CTestUtilConnectionWaiter:: Waiting until connection closed for Iap: %d", aIapId);
+        }
+	else
+		{
+		VCXLOGLO1(">>>CTestUtilConnectionWaiter:: error - already ACTIVE");
+		}
+
+	VCXLOGLO1("<<<CTestUtilConnectionWaiter::WaitUntilConnectionIsClosed");
+	}
+
+// ---------------------------------------------------------------------------
+// CTestUtilConnectionWaiter::RunL()
+//
+// Handle request completion events
+// ---------------------------------------------------------------------------
+//
+void CTestUtilConnectionWaiter::RunL()
+	{
+ 	VCXLOGLO1(">>>CTestUtilConnectionWaiter::RunL");
+
+//    TInt statusCode = iStatus.Int();
+
+	if( iCheckCount++ == 30 )
+		{
+		VCXLOGLO1("CTestUtilConnectionWaiter:: Connection request timed out.");
+		iObserver->ConnectionTimeout();
+		iCheckCount = 0;
+		Cancel();
+		}
+    else
+        {
+    	switch(iWaitState)
+    		{
+    		case EWaitingConnection:
+    			{
+    			if(IsConnectionActive(iIapId))
+    				{
+    				iObserver->ConnectionCreated();
+    				iWaitState = ENoWaitState;
+    				VCXLOGLO1("Connection is active!");
+    				}
+    		    else
+    		    	{
+    		    	SetActive();
+    				iTimer.After(iStatus, KMillion);
+    		    	}
+    			}
+    			break;
+
+    		case EWaitingConnectionClosed:
+    			{
+    			if(!IsConnectionActive(iIapId))
+    				{
+    				iObserver->ConnectionClosed();
+    				iWaitState = ENoWaitState;
+    				VCXLOGLO1("Connection is closed!");
+    				}
+    			else
+    				{
+    		    	SetActive();
+    				iTimer.After(iStatus, KMillion);
+    				}
+    			}
+    			break;
+
+    		default:
+    			break;
+    		}
+    	}
+
+    VCXLOGLO1("<<<CTestUtilConnectionWaiter::RunL");
+
+	}
+
+// ---------------------------------------------------------------------------
+// CTestUtilConnectionWaiter::DoCancel()
+//
+// Cancels ongoing requests
+// ---------------------------------------------------------------------------
+//
+void CTestUtilConnectionWaiter::DoCancel()
+	{
+	VCXLOGLO1(">>>CTestUtilConnectionWaiter::DoCancel");
+	iTimer.Cancel();
+	VCXLOGLO1("<<<CTestUtilConnectionWaiter::DoCancel");
+    }
+
+// ---------------------------------------------------------------------------
+// CTestUtilConnectionWaiter::IsConnectionActive(TUint32 aIapId)
+//
+// Checks if IAP specified in iWaitConnectionForIapId is active
+// ---------------------------------------------------------------------------
+EXPORT_C TBool CTestUtilConnectionWaiter::IsConnectionActive(TUint32 aIapId)
+	{
+	VCXLOGLO1(">>>CTestUtilConnectionWaiter::IsConnectionActive");
+
+    RConnection connection;
+
+	TUint count;
+
+ 	TInt err = connection.Open(iServ, KAfInet);
+
+ 	if(err != KErrNone)
+ 		{
+ 		iServ.Close();
+   		VCXLOGLO2("CTestUtilConnectionWaiter::Could not connect to open connection: %d.", err);
+   		User::Leave(err);
+ 		}
+
+    err = connection.EnumerateConnections(count);
+ 	if(err != KErrNone)
+ 		{
+ 		connection.Close();
+ 		iServ.Close();
+   		VCXLOGLO2("CTestUtilConnectionWaiter::Could not enum connections, %d.", err);
+   		User::Leave(err);
+ 		}
+
+    for(; count; --count)
+        {
+        TPckgBuf<TConnectionInfo> connInfo;
+
+        if(connection.GetConnectionInfo(count, connInfo) == KErrNone)
+            {
+            VCXLOGLO2("CTestUtilConnectionWaiter:: Connection IAP id: %d", connInfo().iIapId);
+
+            if(aIapId == connInfo().iIapId)
+            	{
+            	VCXLOGLO1("CTestUtilConnectionWaiter:: IAP is connected.");
+            	VCXLOGLO1("<<<CTestUtilConnectionWaiter::IsConnectionActive");
+            	connection.Close();
+				return ETrue;
+            	}
+            }
+        }
+
+ 	connection.Close();
+
+	VCXLOGLO1("<<<CTestUtilConnectionWaiter::IsConnectionActive");
+    return EFalse;
+	}
+
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/src/VCXTestCommon.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,1335 @@
+/*
+* 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 <e32Base.h>
+#include <tz.h>
+#include <badesca.h>
+#include <commdb.h>
+#include <mmf/common/mmfcontrollerpluginresolver.h>
+
+#include "VCXTestCommon.h"
+#include "IptvTestUtilALR.h"
+#include "CIptvTestVerifyData.h"
+#include "TestUtilConnectionWaiter.h"
+#include "VCXTestLog.h"
+
+// EXTERNAL DATA STRUCTURES
+
+// EXTERNAL FUNCTION PROTOTYPES
+
+// CONSTANTS
+
+// MACROS
+
+// LOCAL CONSTANTS AND MACROS
+_LIT(KDummyfilePathFormat, "%S:\\data\\temp");
+_LIT(KDummyfileFormat, "%d.dat");
+_LIT(KDoubleBacklash, "\\");
+
+// MODULE DATA STRUCTURES
+
+// LOCAL FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CVCXTestCommon::CVCXTestCommon
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CVCXTestCommon::CVCXTestCommon()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestCommon::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CVCXTestCommon::ConstructL()
+    {
+    VCXLOGLO1(">>>CVCXTestCommon::ConstructL");
+
+    User::LeaveIfError( iFs.Connect() );
+
+    PrintIaps(); 
+
+    PrintDriveInfo( _L("C") );
+    PrintDriveInfo( _L("E") );
+    PrintDriveInfo( _L("D") );
+    PrintDriveInfo( _L("F") );
+
+    //ListDir( _L("C:\\"), 0 );
+    //ListDir( _L("E:\\"), 0 );
+
+    iIptvVerifyData = CIptvTestVerifyData::NewL();
+    iVideoCreator = CIptvTestVideoCreator::NewL();
+
+    VCXLOGLO1("<<<CVCXTestCommon::ConstructL");
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvServicesFromFile::~CVCXTestCommon
+// Destructor
+// -----------------------------------------------------------------------------
+//
+CVCXTestCommon::~CVCXTestCommon()
+    {
+    VCXLOGLO1(">>>CVCXTestCommon::~CVCXTestCommon");
+
+    delete iIptvVerifyData;
+    iIptvVerifyData = NULL;
+
+    delete iVideoCreator;
+    iVideoCreator = NULL;
+
+    iFs.Close();
+
+    VCXLOGLO1("<<<CVCXTestCommon::~CVCXTestCommon");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestCommon::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CVCXTestCommon* CVCXTestCommon::NewL()
+    {
+    VCXLOGLO1(">>>CVCXTestCommon::NewL");
+    CVCXTestCommon* self = new( ELeave ) CVCXTestCommon;
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+    VCXLOGLO1("<<<CVCXTestCommon::NewL");
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestCommon::GetFileSize
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CVCXTestCommon::GetFileSize(TDesC& aFullPath, TUint32& aFileSize)
+    {
+    VCXLOGLO1(">>>CVCXTestCommon::GetFileSize");
+    TBool rv = FALSE;
+    TEntry entry;
+    TInt err = KErrNone;
+
+    aFileSize=0;
+
+    err = iFs.Entry( aFullPath, entry );
+
+    if(KErrNone == err && !entry.IsDir())
+        {
+        aFileSize = entry.iSize;
+        rv = TRUE;
+        }
+
+    VCXLOGLO1("<<<CVCXTestCommon::GetFileSize");
+    return rv;
+    }
+    
+// -----------------------------------------------------------------------------
+// CVCXTestCommon::GetIapIdL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CVCXTestCommon::GetIapIdL(const TDesC& aIapName, TUint32& aIapId)
+    {
+    VCXLOGLO1(">>>CVCXTestCommon::GetIapIdL");
+
+    TBool found( EFalse );
+
+#ifdef __WINSCW__
+    if( aIapName != KIptvTestBadIapName && aIapName != _L("invalidiap") )
+        {
+        _LIT(KEmulatorIap, "Ethernet with Daemon Dynamic IP");
+        found = GetIapIdByNameL(KEmulatorIap, aIapId);
+        VCXLOGLO1("<<<CVCXTestCommon::GetIapIdL");
+        return found;
+        }
+#endif
+    
+    if( aIapName == _L("default") )
+        {
+        VCXLOGLO1("CVCXTestCommon::GetIapIdL -- Searching default iap from cenrep");
+        CIptvTestUtilALR* util = CIptvTestUtilALR::NewLC();
+        aIapId = util->GetDefaultIapCenRep();
+        CleanupStack::PopAndDestroy( util );
+        if( aIapId != 0 )
+            {
+            VCXLOGLO2("CVCXTestCommon::GetIapIdL -- Got default from cenrep: %d", aIapId);
+            return ETrue;
+            }
+        }
+    
+    if( aIapName == _L("default") )
+        {
+        VCXLOGLO1("CVCXTestCommon::GetIapIdL -- Getting default iap via ALR util");
+        CIptvTestUtilALR* util = CIptvTestUtilALR::NewLC();
+        aIapId = util->GetDefaultIap();
+        CleanupStack::PopAndDestroy( util );
+        if( aIapId != 0 )
+            {
+            VCXLOGLO2("CVCXTestCommon::GetIapIdL -- Got default: %d", aIapId);
+            return ETrue;
+            }
+        }
+    
+    VCXLOGLO2("CVCXTestCommon:: Searching IAP: %S", &aIapName);
+
+    found = GetIapIdByNameL(aIapName, aIapId);
+
+    // Iap with exact name found
+    if( found )
+        {
+        VCXLOGLO1("<<<CVCXTestCommon::GetIapIdL");
+        return found;
+        }
+    else
+    if(aIapName == KIptvTestBadIapName) // Search bad iap only for a name.
+        {
+        VCXLOGLO2("CVCXTestCommon:: Iap with name %S not found!", &aIapName);
+        VCXLOGLO1("<<<CVCXTestCommon::GetIapIdL");
+        return found;
+        }
+
+    VCXLOGLO1("<<<CVCXTestCommon:: Iap with exact name was not found.");
+
+    TBuf<128> searchFor(aIapName);
+    searchFor.LowerCase();
+
+    if(searchFor == _L("invalidiap") )
+        {
+        aIapId = 6000;
+        VCXLOGLO1("<<<CVCXTestCommon::GetIapIdL");
+        return ETrue;
+        }
+
+    TBool isWlanIapName( EFalse );
+
+    if( aIapName == _L("wlan") )
+        {
+        found = GetIapIdByTypeL(CVCXTestCommon::EWlanIap, aIapId, 0);
+        isWlanIapName = ETrue;
+        }
+    else
+    if( aIapName == _L("wlan2") )
+        {
+        found = GetIapIdByTypeL(CVCXTestCommon::EWlanIap, aIapId, 1);
+        isWlanIapName = ETrue;
+        }
+    else
+    if( aIapName == _L("internet") )
+        {
+        found = GetIapIdByTypeL(CVCXTestCommon::EGprsIap, aIapId, 0);
+        }
+    else
+    if( aIapName == _L("internet2") )
+        {
+        found = GetIapIdByTypeL(CVCXTestCommon::EGprsIap, aIapId, 1);
+        }
+
+    if( !found && !isWlanIapName )
+        {
+        VCXLOGLO1("<<<CVCXTestCommon:: Trying to find alternative IAP.");
+
+        // Try search other known GPRS IAPs
+        _LIT(KIapElisaInternet, "elisa internet");
+        _LIT(KIapElisaMMS, "elisa mms");
+        _LIT(KIapInternet, "internet");
+        _LIT(KIapProinternet, "prointernet");
+        _LIT(KGprsInternet, "gprs internet");
+
+        if( GetIapIdByNameL(KIapElisaInternet, aIapId) ||
+            GetIapIdByNameL(KIapElisaMMS, aIapId) ||
+            GetIapIdByNameL(KIapInternet, aIapId) ||
+            GetIapIdByNameL(KIapProinternet, aIapId) ||
+            GetIapIdByNameL(KGprsInternet, aIapId) )
+            {
+            found = ETrue;
+            }
+
+        if( !found )
+            {
+            VCXLOGLO1("<<<CVCXTestCommon:: Any GPRS IAP is good...");
+            found = GetIapIdByTypeL(CVCXTestCommon::EGprsIap, aIapId, 0);
+            }
+        }
+    else
+        {
+        VCXLOGLO1("<<<CVCXTestCommon:: WLAN IAP wanted. Not found.");
+        }
+
+    VCXLOGLO1("<<<CVCXTestCommon::GetIapIdL");
+    return found;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestCommon::GetIapIdByNameL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CVCXTestCommon::GetIapIdByNameL(const TDesC& aIapName, TUint32& aIapId)
+    {
+    VCXLOGLO1(">>>CVCXTestCommon::GetIapIdByNameL");
+    TBool found = EFalse;
+    aIapId = 0;
+
+    TBuf<128> searchFor(aIapName);
+    searchFor.LowerCase();
+    
+    // Get IAP names and ids from the database
+    CCommsDatabase* cdb( NULL );
+    TRAPD( err, cdb = CCommsDatabase::NewL( EDatabaseTypeIAP ) );
+    if( err != KErrNone )
+        {
+        VCXLOGLO2("CVCXTestCommon::GetIapIdByNameL: CCommsDatabase::NewL left: %d, leaving", err);
+        User::Leave( err );
+        }
+    CleanupStack::PushL( cdb );
+
+    cdb->ShowHiddenRecords();
+
+    CCommsDbTableView* view( NULL );
+    TRAP( err, view = cdb->OpenTableLC( TPtrC(IAP) ); CleanupStack::Pop( view ); );
+    CleanupStack::PushL( view );
+    
+    if( err != KErrNone )
+        {
+        VCXLOGLO2("CVCXTestCommon::GetIapIdByNameL: CCommsDatabase::OpenTableLC left: %d, leaving", err);
+        User::Leave( err );
+        }
+    
+    TBuf<40> name;
+    TUint32 id;
+    TInt res = view->GotoFirstRecord();
+    while( res == KErrNone )
+        {
+        TRAP( err, view->ReadTextL( TPtrC(COMMDB_NAME), name ) );
+        if( err != KErrNone ) continue;
+        TRAP( err, view->ReadUintL( TPtrC(COMMDB_ID), id ) );
+        if( err != KErrNone ) continue;
+
+        name.LowerCase();
+        if(searchFor == name)
+            {
+            aIapId = id;
+            VCXLOGLO3("CVCXTestCommon:: Found IAP: %d, %S", aIapId, &aIapName);
+            found = ETrue;
+            break;
+            }
+        res = view->GotoNextRecord();
+        }
+
+    CleanupStack::PopAndDestroy( view );
+    CleanupStack::PopAndDestroy( cdb );
+
+    VCXLOGLO1("<<<CVCXTestCommon::GetIapIdByNameL");
+    return found;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestCommon::GetIapIdByTypeL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CVCXTestCommon::GetIapIdByTypeL(TIptvTestIapType aType, TUint32& aIapId, TInt aOrderNumber)
+    {
+    VCXLOGLO1(">>>CVCXTestCommon::GetIapIdByTypeL");
+
+    aIapId = 0;
+    TBool found( EFalse );
+
+    #ifdef __WINSCW__
+        found = GetIapIdByNameL( _L("Ethernet with Daemon Dynamic IP"), aIapId );
+        VCXLOGLO1("<<<CVCXTestCommon::GetIapIdByTypeL");
+        return found;
+    #endif
+
+    // Get AP names and ids from the database
+    CCommsDatabase* TheDb = CCommsDatabase::NewL( EDatabaseTypeIAP );
+    CleanupStack::PushL( TheDb );
+
+    TheDb->ShowHiddenRecords();
+
+    CCommsDbTableView* view = TheDb->OpenTableLC( TPtrC(IAP) );
+
+    TBuf<40> name;
+    TUint32 id;
+    TBuf<255> iapType;
+    TInt matchCount(0);
+
+    TInt res = view->GotoFirstRecord();
+
+    while( res == KErrNone )
+        {
+        view->ReadTextL( TPtrC(COMMDB_NAME), name );
+        view->ReadUintL( TPtrC(COMMDB_ID), id );
+        view->ReadTextL( TPtrC(IAP_SERVICE_TYPE), iapType);
+
+        VCXLOGLO3("CVCXTestCommon:: name: %S, id: %d", &name, id);
+        VCXLOGLO2("CVCXTestCommon:: type: %S", &iapType);
+
+        if( ( iapType == _L("LANService") && aType == EWlanIap && name != _L("Easy WLAN") ) ||
+            ( iapType == _L("OutgoingGPRS") && aType == EGprsIap ) )
+            {
+            if( matchCount == aOrderNumber )
+                {
+                found = ETrue;
+                aIapId = id;
+                break;
+                }
+            matchCount++;
+            }
+
+        res = view->GotoNextRecord();
+        }
+
+    CleanupStack::PopAndDestroy( view ); // view
+    CleanupStack::PopAndDestroy( TheDb ); // TheDb
+
+    VCXLOGLO1("<<<CVCXTestCommon::GetIapIdByTypeL");
+    return found;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestCommon::GetIapNameById
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CVCXTestCommon::GetIapNameById(TDes& aIapName, TUint32 aIapId)
+    {
+    TBool found = FALSE;
+
+    // Get AP names and ids from the database
+    CCommsDatabase* TheDb = CCommsDatabase::NewL( EDatabaseTypeIAP );
+    CleanupStack::PushL( TheDb );
+
+    TheDb->ShowHiddenRecords();
+
+    CCommsDbTableView* view = TheDb->OpenTableLC( TPtrC(IAP) );
+
+    TBuf<40> name;
+    TUint32 id;
+    TInt res = view->GotoFirstRecord();
+
+    while( res == KErrNone )
+        {
+        view->ReadTextL( TPtrC(COMMDB_NAME), name );
+        view->ReadUintL( TPtrC(COMMDB_ID), id );
+
+        res = view->GotoNextRecord();
+        //VCXLOGLO3("IAP name, id: %S, %d", &name, id);
+        if(id == aIapId)
+            {
+            found = TRUE;
+            aIapName.Zero();
+            aIapName.Append(name);
+            break;
+            }
+        }
+
+    CleanupStack::PopAndDestroy( view ); // view
+    CleanupStack::PopAndDestroy( TheDb ); // TheDb
+
+    return found;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestCommon::PrintIaps
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVCXTestCommon::PrintIaps()
+    {
+    VCXLOGLO1(">>>CVCXTestCommon::PrintIaps");
+    // Get IAP names and ids from the database
+    CCommsDatabase* TheDb( NULL );
+    TRAPD( err, TheDb = CCommsDatabase::NewL( EDatabaseTypeIAP ) );
+
+    if( err == KErrNone && TheDb )
+        {
+        CleanupStack::PushL( TheDb );
+
+        TheDb->ShowHiddenRecords();
+
+        CCommsDbTableView* view( NULL );
+        TRAP( err, view = TheDb->OpenTableLC( TPtrC(IAP) ); CleanupStack::Pop( view ); );
+        CleanupStack::PushL( view );
+
+        if( err == KErrNone && view )
+            {
+            TBuf<40> name;
+            TUint32 id;
+            err = view->GotoFirstRecord();
+            while( err == KErrNone )
+                {
+                TRAP( err, view->ReadTextL( TPtrC(COMMDB_NAME), name ) );
+                if( err != KErrNone ) break;
+                TRAP( err, view->ReadUintL( TPtrC(COMMDB_ID), id ) );
+                if( err != KErrNone ) break;
+                VCXLOGLO3("CVCXTestCommon:: IAP name, id: %S, %d", &name, id);
+
+                err = view->GotoNextRecord();
+                if( err != KErrNone ) break;
+                }
+            }
+        CleanupStack::PopAndDestroy( view ); // view
+        CleanupStack::PopAndDestroy( TheDb ); // TheDb
+        }
+    VCXLOGLO1("<<<CVCXTestCommon::PrintIaps");
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestVerifyData::CreateVerifyData
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CVCXTestCommon::CreateVerifyData(TDesC& aVerifyId, TBool aAppend)
+    {
+    VCXLOGLO2(">>>CVCXTestCommon::CreateVerifyData: %S", &aVerifyId);
+    TInt result = KErrNone;
+    TRAPD(err, result = iIptvVerifyData->CreateVerifyDataL(aVerifyId, aAppend));
+    if(err != KErrNone)
+        {
+        VCXLOGLO2("CIptvVerifyData::CreateVerifyDataL caused a leave. %d", err);
+        result = err;
+        }
+    VCXLOGLO1("<<<CVCXTestCommon::CreateVerifyData");
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestVerifyData::WriteVerifyData
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CVCXTestCommon::WriteVerifyData(TDesC& aVerifyId, TDesC& aVerifyData)
+    {
+    //VCXLOGLO1(">>>CVCXTestCommon::WriteVerifyData");
+    TInt result = KErrNone;
+    TRAPD(err, result = iIptvVerifyData->WriteVerifyDataL(aVerifyId, aVerifyData));
+    if(err != KErrNone)
+        {
+        VCXLOGLO2("CIptvVerifyData::WriteVerifyDataL caused a leave. %d", err);
+        result = err;
+        }
+    //VCXLOGLO1("<<<CVCXTestCommon::WriteVerifyData");
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestVerifyData::WriteVerifyData
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CVCXTestCommon::WriteVerifyData(TDesC& aVerifyId, TRefByValue<const TDesC> aFmt, ... )
+    {
+    //VCXLOGLO1(">>>CVCXTestCommon::WriteVerifyData(formatted)");
+
+    VA_LIST argptr; //pointer to argument list
+    VA_START( argptr, aFmt );
+
+    HBufC* str;
+    str = HBufC::NewLC(1024*3);
+
+    //TBuf<512*3> str;
+    //TBuf<512> format(_L("TESTI: %d, %S"));
+
+    str->Des().FormatList(aFmt, argptr);
+
+    TInt result = KErrNone;
+    TRAPD(err, result = iIptvVerifyData->WriteVerifyDataL(aVerifyId, *str));
+
+    CleanupStack::PopAndDestroy(str);
+
+    if(err != KErrNone)
+        {
+        VCXLOGLO2("CIptvVerifyData::WriteVerifyDataL caused a leave. %d", err);
+        result = err;
+        }
+
+    //VCXLOGLO1("<<<CVCXTestCommon::WriteVerifyData(formatted)");
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestVerifyData::VerifyData
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CVCXTestCommon::VerifyData(TDesC& aVerifyId, CIptvTestVerifyData::TVerifyResult& aVerifyResult)
+    {
+    VCXLOGLO1(">>>CVCXTestCommon::VerifyData");
+    TInt result = KErrNone;
+    TRAPD(err, result = iIptvVerifyData->VerifyDataL(aVerifyId, aVerifyResult));
+    if(err != KErrNone)
+        {
+        VCXLOGLO2("CIptvVerifyData::VerifyDataL caused a leave. %d", err);
+        result = err;
+        }
+    VCXLOGLO1("<<<CVCXTestCommon::VerifyData");
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestVerifyData::EnableVerifyTimestamps
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVCXTestCommon::EnableVerifyTimestamps( TBool aUseTimestamps )
+    {
+    VCXLOGLO1(">>>CVCXTestCommon::EnableVerifyTimestamps");
+    iIptvVerifyData->EnableTimestamps( aUseTimestamps );
+    VCXLOGLO1("<<<CVCXTestCommon::EnableVerifyTimestamps");
+    }
+   
+// -----------------------------------------------------------------------------
+// CVCXTestCommon::ParseIntFromString
+// -----------------------------------------------------------------------------
+EXPORT_C TInt CVCXTestCommon::ParseIntFromString(TInt& aInt, TDesC& aString)
+    {
+    VCXLOGLO1(">>>CVCXTestCommon::ParseIntFromString");
+
+    TLex lex(aString);
+    TInt err = lex.Val(aInt);
+
+    VCXLOGLO1("<<<CVCXTestCommon::ParseIntFromString");
+    return err;
+    }
+    
+// -----------------------------------------------------------------------------
+// CVCXTestCommon::CreateBadIapL
+// Creates a not working, crappy iap with given name.
+// Use with caution, because there is no easy way of removing created iaps
+//
+// @param aName name of the iap to be created
+// @return iapId new iap's id.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TUint32 CVCXTestCommon::CreateBadIapL(TDesC& aName)
+    {
+    VCXLOGLO1(">>>CVCXTestCommon::CreateBadIapL");
+    CCommsDatabase* cdb = CCommsDatabase::NewL( EDatabaseTypeIAP );
+    CleanupStack::PushL( cdb );
+
+    TBuf16<40> name;
+    name.Copy( aName );
+
+    TUint32 iapId( 0 );
+    TUint32 iapServiceId( 1 );
+    TUint32 id( 2 );
+    TUint32 iapNetworkId( 3 );
+    TUint32 weighting( 4 );
+    TUint32 loc( 5 );
+
+    User::LeaveIfError( cdb->BeginTransaction() );
+
+    CCommsDbTableView* iapTable = cdb->OpenTableLC( TPtrC( IAP ) );
+
+    User::LeaveIfError( iapTable->InsertRecord( iapId ) );
+
+    iapTable->WriteTextL( TPtrC( COMMDB_NAME ), name );
+    iapTable->WriteUintL( TPtrC( IAP_SERVICE ), iapServiceId );
+    iapTable->WriteTextL( TPtrC( IAP_SERVICE_TYPE ), TPtrC( LAN_SERVICE ) );
+    iapTable->WriteTextL( TPtrC( IAP_BEARER_TYPE ), TPtrC( LAN_BEARER ) );
+    iapTable->WriteUintL( TPtrC( IAP_BEARER ), id );
+    iapTable->WriteUintL( TPtrC( IAP_NETWORK ), iapNetworkId );
+    iapTable->WriteUintL( TPtrC( IAP_NETWORK_WEIGHTING ), weighting );
+    iapTable->WriteUintL( TPtrC( IAP_LOCATION ), loc );
+
+    User::LeaveIfError( iapTable->PutRecordChanges( EFalse, EFalse ) );
+
+    CleanupStack::PopAndDestroy( iapTable );
+
+    User::LeaveIfError( cdb->CommitTransaction() );
+
+    CleanupStack::PopAndDestroy( cdb );
+    VCXLOGLO1("<<<CVCXTestCommon::CreateBadIapL");
+    return iapId;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestCommon::AdvanceSystemTimeSeconds
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CVCXTestCommon::AdvanceSystemTimeSeconds( TInt aCount )
+	{
+	VCXLOGLO1(">>>CVCXTestCommon::AdvanceSystemTimeSeconds");
+
+    TTime now;
+    now.HomeTime();
+
+    TTimeIntervalSeconds second(1*aCount);
+    now += second;
+
+    TInt err = CVCXTestCommon::SetSystemTime(now);
+
+	VCXLOGLO1("<<<CVCXTestCommon::AdvanceSystemTimeSeconds");
+
+	return err;
+	}
+
+// -----------------------------------------------------------------------------
+// CVCXTestCommon::AdvanceSystemTimeMinutes
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CVCXTestCommon::AdvanceSystemTimeMinutes( TInt aCount )
+    {
+    VCXLOGLO1(">>>CVCXTestCommon::AdvanceSystemTimeMinutes");
+
+    TTime now;
+    now.HomeTime();
+
+    TTimeIntervalSeconds minute(1*60*aCount);
+    now += minute;
+
+    TInt err = CVCXTestCommon::SetSystemTime(now);
+
+    VCXLOGLO1("<<<CVCXTestCommon::AdvanceSystemTimeMinutes");
+
+    return err;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestCommon::AdvanceSystemTimeHours
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CVCXTestCommon::AdvanceSystemTimeHours( TInt aCount )
+    {
+    VCXLOGLO1(">>>CVCXTestCommon::AdvanceSystemTimeHours");
+
+    TTime now;
+    now.HomeTime();
+
+    TTimeIntervalSeconds hour(1*60*60*aCount);
+    now += hour;
+
+    TInt err = CVCXTestCommon::SetSystemTime(now);
+
+    VCXLOGLO1("<<<CVCXTestCommon::AdvanceSystemTimeHours");
+    return err;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestCommon::SetSystemTime()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CVCXTestCommon::SetSystemTime(TTime aTime)
+	{
+	VCXLOGLO1(">>>CVCXTestCommon::SetSystemTime");
+
+    TTime noDST(aTime);
+    RTz tz;
+    TInt err = tz.Connect();
+    if(err != KErrNone)
+    	{
+    	VCXLOGLO2("RTz::Connect failed: %d", err);
+    	VCXLOGLO1("<<<CVCXTestCommon::SetSystemTime");
+    	return err;
+    	}
+    CleanupClosePushL(tz);
+    err = tz.SetHomeTime(noDST);
+    if(err != KErrNone)
+    	{
+    	VCXLOGLO2("RTz::SetHomeTime failed: %d", err);
+    	VCXLOGLO1("<<<CVCXTestCommon::SetSystemTime");
+    	CleanupStack::PopAndDestroy(&tz);
+    	return err;
+    	}
+
+	CleanupStack::PopAndDestroy(&tz);
+
+	VCXLOGLO1("<<<CVCXTestCommon::SetSystemTime");
+
+	return err;
+	}
+
+// -----------------------------------------------------------------------------
+// CVCXTestCommon::SetTimeZone()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CVCXTestCommon::SetTimeZone(TDesC& aTimeZone)
+	{
+	VCXLOGLO1(">>>CVCXTestCommon::SetTimeZone");
+
+    RTz tz;
+    TInt err = tz.Connect();
+    if(err != KErrNone)
+    	{
+    	VCXLOGLO2("RTz::Connect failed: %d", err);
+    	VCXLOGLO1("<<<CVCXTestCommon::SetTimeZone");
+    	return err;
+    	}
+    CleanupClosePushL(tz);
+
+    TBuf8<256> timezone;
+    timezone.Copy( aTimeZone ); // Conversion
+
+    CTzId* tzId = CTzId::NewL( timezone );
+    CleanupStack::PushL(tzId);
+
+    TRAP(err, tz.SetTimeZoneL( *tzId ) );
+	CleanupStack::PopAndDestroy(tzId);
+	CleanupStack::PopAndDestroy(&tz);
+
+    if(err != KErrNone)
+    	{
+    	VCXLOGLO2("RTz::SetTimeZone failed: %d", err);
+    	VCXLOGLO1("<<<CVCXTestCommon::SetTimeZone");
+    	return err;
+    	}
+
+	VCXLOGLO1("<<<CVCXTestCommon::SetTimeZone");
+
+	return err;
+	}
+
+// -----------------------------------------------------------------------------
+// CVCXTestCommon::CreateVideoFileL()
+//
+// Creates a video file to file system.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVCXTestCommon::CreateVideoFileL( CIptvTestVideoCreator::TIptvTestVideoType aVideoType, TDesC& aFileName, TInt aSize )
+    {
+    VCXLOGLO1(">>>CVCXTestCommon::CreateVideoFileL");
+    iVideoCreator->CreateVideoL( aVideoType, aFileName, aSize );
+    VCXLOGLO1("<<<CVCXTestCommon::CreateVideoFileL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestCommon::CreateVideoFilesL()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVCXTestCommon::CreateVideoFilesL( CIptvTestVideoCreator::TIptvTestVideoType aVideoType, TDesC& aFileName, TInt aCount, RPointerArray<HBufC>& aFileArray )
+    {
+    VCXLOGLO1(">>>CVCXTestCommon::CreateVideoFilesL");
+    iVideoCreator->CreateVideosL( aVideoType, aFileName, aCount, aFileArray );
+    VCXLOGLO1("<<<CVCXTestCommon::CreateVideoFilesL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestCommon::SetDriveFreeSpaceL()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVCXTestCommon::SetDriveFreeSpaceL( TInt aDriveNumber, TUint aDesiredFreeSpace )
+    {
+    VCXLOGLO1(">>>CVCXTestCommon::SetDriveFreeSpaceL");
+
+    const TInt KIptvTest1KB = 1024;
+    const TInt KIptvTest1MB = KIptvTest1KB*KIptvTest1KB;
+
+#ifdef  __WINSCW__
+    if(aDriveNumber == EDriveC)
+        {
+        VCXLOGLO1("CVCXTestCommon:: ABORT! No C drive fill in emulator.");
+        User::Leave( KErrAbort );
+        }
+#endif
+
+    TChar driveLetter;
+    User::LeaveIfError( RFs::DriveToChar( aDriveNumber, driveLetter ) );
+
+    TBuf<255> path;
+    path.Append( driveLetter );
+    path.Append( _L(":\\data\\temp") );
+    path.Append( KDoubleBacklash );
+
+    // First check that if there's free space to fill.
+
+    TInt64 spaceToReserve = 0;
+    CalculateSpaceToReserveL(iFs, aDriveNumber, aDesiredFreeSpace, spaceToReserve);
+
+    if( spaceToReserve == 0 )
+        {
+        VCXLOGLO1("<<<CVCXTestCommon::SetDriveFreeSpaceL");
+        return;
+        }
+
+    // No space, try freeing by deleting existing dummy files.
+    if( spaceToReserve < 0 )
+        {
+        VCXLOGLO1("CVCXTestCommon:: Trying to free some space.");
+
+        for( TInt i=50; i>0; i-- )
+            {
+            TBuf<256> filePath;
+            filePath.Zero();
+            filePath.Append( path );
+            filePath.AppendFormat( KDummyfileFormat, i );
+            if( BaflUtils::FileExists( iFs, filePath ) )
+                {
+                VCXLOGLO2("CVCXTestCommon:: Deleting %S.", &filePath);
+                iFs.Delete( filePath );
+                CalculateSpaceToReserveL(iFs, aDriveNumber, aDesiredFreeSpace, spaceToReserve);
+
+                // Is there's enough free space now.
+                if( spaceToReserve > 0 )
+                    {
+                    break;
+                    }
+                }
+            }
+
+        // Recheck free space.
+        if( spaceToReserve < 0 )
+            {
+            VCXLOGLO1("CVCXTestCommon:: Error! There's already less than wanted space!");
+            User::Leave( KErrAbort );
+            }
+        }
+
+    BaflUtils::EnsurePathExistsL(iFs, path);
+
+    // Start creating files of 256 MB size.
+    TInt64 dummyFileSize = 256 * KIptvTest1MB;
+
+    TInt count = 0;
+    while( ETrue )
+        {
+        // Check that there's still enough free space for the dummyfile
+        CalculateSpaceToReserveL( iFs, aDriveNumber, aDesiredFreeSpace, spaceToReserve );
+
+        if( spaceToReserve <= 0 )
+            {
+            VCXLOGLO1("CVCXTestCommon:: Nothing to reserve anymore.");
+            break;
+            }
+
+        // Fill all at once if less than 1MB to go.
+        if( spaceToReserve < KIptvTest1MB )
+            {
+            dummyFileSize = spaceToReserve;
+            }
+
+        // Not enough space for dummy file, find smaller size.
+        while( dummyFileSize > spaceToReserve )
+            {
+            dummyFileSize /= 2;
+            }
+
+        // Find free filename.
+        TBuf<256> filePath;
+        do
+            {
+            filePath.Zero();
+            filePath.Append( path );
+            count++;
+            filePath.AppendFormat(KDummyfileFormat, count);
+            }
+        while ( BaflUtils::FileExists( iFs, filePath ) );
+
+        VCXLOGLO3("Creating %Ld b file to '%S'", dummyFileSize, &filePath);
+
+        // Create the file.
+        RFile file;
+        TInt err = file.Replace(iFs, filePath, EFileWrite);
+        if(err != KErrNone)
+            {
+            VCXLOGLO2("file.Replace fail: %d", err);
+            }
+        User::LeaveIfError(err);
+        err = file.SetSize( dummyFileSize );
+        if(err != KErrNone)
+            {
+            VCXLOGLO2("file.SetSize fail: %d", err);
+            }
+        User::LeaveIfError(err);
+        file.Close();
+
+        TVolumeInfo volumeInfo;
+        User::LeaveIfError(iFs.Volume(volumeInfo, aDriveNumber));
+        VCXLOGLO2("Free space after: %Ld b", volumeInfo.iFree);
+        }
+
+    VCXLOGLO1("<<<CVCXTestCommon::SetDriveFreeSpaceL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestCommon::CalculateSpaceToReserve
+// -----------------------------------------------------------------------------
+//
+void CVCXTestCommon::CalculateSpaceToReserveL( RFs &aFs, TInt aDriveNumber, TInt aDesiredSpace, TInt64& aSpaceToReserve)
+    {
+    TVolumeInfo volumeInfo;
+    User::LeaveIfError(aFs.Volume(volumeInfo, aDriveNumber));
+
+    TInt64 driveSize       = volumeInfo.iSize;
+    TInt64 reservedSpace   = 0;
+    if(aDriveNumber == EDriveC)
+        {
+        reservedSpace = 1024*500; // Leave 500KB extra free to C drive
+        }
+
+    TInt64 driveFreeSpace  = volumeInfo.iFree;
+    TInt64 usableSpace     = driveFreeSpace - reservedSpace;
+    aSpaceToReserve        = usableSpace - aDesiredSpace;
+
+    VCXLOGLO2("CVCXTestCommon: driveSize      = %Ld", driveSize);
+    VCXLOGLO2("CVCXTestCommon: reservedSpace  = %Ld", reservedSpace);
+    VCXLOGLO2("CVCXTestCommon: freeSpace      = %Ld", driveFreeSpace);
+    VCXLOGLO2("CVCXTestCommon: usableSpace    = %Ld", usableSpace);
+    VCXLOGLO2("CVCXTestCommon: desiredSpace   = %d", aDesiredSpace);
+    VCXLOGLO2("CVCXTestCommon: spaceToReserve = %Ld", aSpaceToReserve);
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestCommon::DeleteDummyFilesL()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVCXTestCommon::DeleteDummyFilesL( TInt aDriveNumber )
+    {
+    VCXLOGLO1(">>>CVCXTestCommon::DeleteDummyFilesL");
+
+    CFileMan* fileMan = CFileMan::NewL(iFs);
+    CleanupStack::PushL(fileMan);
+
+    TBuf<3> driveLetter;
+    TChar driveChar;
+    RFs::DriveToChar( aDriveNumber, driveChar );
+    driveLetter.Append(driveChar);
+
+    TBuf<255>path;
+
+    path.Format( KDummyfilePathFormat, &driveLetter );
+    path.Append(KDoubleBacklash);
+    fileMan->RmDir(path);
+
+    CleanupStack::PopAndDestroy(fileMan);
+
+    VCXLOGLO1("<<<CVCXTestCommon::DeleteDummyFilesL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestCommon::EnsureFileIsNotInUse()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CVCXTestCommon::EnsureFileIsNotInUse( const TPtrC& aFileName )
+    {
+    TInt error( KErrNone );
+    RFile file;
+    // MDS or someone else could have the file in exclusive use. Try 6 times in 10 second intervals.
+    for(TInt retry = 0; retry < 6; retry++)
+        {
+        error = file.Open(iFs, aFileName, EFileShareExclusive);
+        if( error == KErrInUse )
+            {
+            User::After( 1000000 * 10 );
+            }
+        else
+            {
+            break;
+            }
+        }
+
+    file.Close();
+    VCXLOGLO2("CVCXTestCommon::EnsureFileIsNotInUse: %d", error);
+    return error;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CVCXTestCommon::PrintDriveInfo()
+// -----------------------------------------------------------------------------
+//
+void CVCXTestCommon::PrintDriveInfo( const TPtrC& aDriveLetter )
+    {
+    TInt driveNumber(-1);
+    TInt64 driveSize(0);
+    TInt64 driveFreeSpace(0);
+
+    if( aDriveLetter.Length() > 0 && iFs.CharToDrive( aDriveLetter[0], driveNumber ) == KErrNone )
+        {
+        TVolumeInfo volumeInfo;
+        if( iFs.Volume(volumeInfo, driveNumber) == KErrNone )
+            {
+            driveSize       = volumeInfo.iSize / 1024 / 1024;
+            driveFreeSpace  = volumeInfo.iFree / 1024 / 1024;
+            VCXLOGLO2("CVCXTestCommon:: drive: %S", &aDriveLetter );
+            VCXLOGLO2("CVCXTestCommon::  - size: %d MB", driveSize);
+            VCXLOGLO2("CVCXTestCommon::  - free: %d MB", driveFreeSpace);
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestCommon::ListDir
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CVCXTestCommon::ListDir( const TDesC& aDir, TInt aLevel )
+    {
+    CDir* fileList = NULL;
+    CDir* dirList = NULL;
+
+    if( aLevel == 0 )
+        {
+        VCXLOGLO2("CVCXTestCommon:: Listing directory %S", &aDir);
+        }
+
+    TInt err( KErrNone );
+    err = iFs.GetDir( aDir, KEntryAttMatchExclusive | KEntryAttDir, ESortByName, dirList );
+    if( err == KErrNone )
+        {
+        err = iFs.GetDir( aDir, KEntryAttMatchExclude | KEntryAttDir, ESortByName, fileList );
+        }
+
+    CleanupStack::PushL( dirList );
+    CleanupStack::PushL( fileList );
+
+    HBufC* pre = HBufC::NewL( 256 );
+    CleanupStack::PushL( pre );
+
+    for( TInt i=0; i<aLevel; i++ )
+        {
+        pre->Des().Append( _L(" ") );
+        }
+
+    if( err == KErrNone )
+        {
+        HBufC* fileName = HBufC::NewL( 256 );
+        CleanupStack::PushL( fileName );
+
+        if( dirList )
+        for ( TInt file = 0; file < dirList->Count(); file++ )
+            {
+            fileName->Des().Zero();
+            fileName->Des().Append( aDir );
+            fileName->Des().Append( (*dirList)[file].iName );
+            VCXLOGLO3("%S (d) %S", pre, fileName);
+            fileName->Des().Append( _L("\\") );
+            fileName->Des().LowerCase();
+#if 0
+            ListDir( *fileName, aLevel+1 );
+#else
+            if( fileName->Des().Find( _L(":\\private\\") ) < 0 &&
+                fileName->Des().Find( _L(":\\resource\\") ) < 0 &&
+                fileName->Des().Find( _L(":\\sys\\") ) < 0 &&
+                fileName->Des().Find( _L(":\\testframework\\") ) < 0 &&
+                fileName->Des().Find( _L(":\\nokia\\") ) < 0 &&
+                fileName->Des().Find( _L(":\\system\\") ) < 0 )
+                {
+                ListDir( fileName->Des(), aLevel+1 );
+                }
+#endif
+            }
+
+        TUint32 totalSize(0);
+        if( fileList )
+        for ( TInt file = 0; file < fileList->Count(); file++ )
+            {
+            fileName->Des().Zero();
+            fileName->Des().Append( aDir );
+            fileName->Des().Append( (*fileList)[file].iName );
+
+            RFile rf;
+            if( rf.Open( iFs, *fileName, EFileRead|EFileShareAny ) == KErrNone )
+                {
+                TInt size(0);
+                if( rf.Size( size ) == KErrNone )
+                    {
+                    totalSize += size;
+                    VCXLOGLO4("%S (f) %S - %d KB", pre, fileName, size/1024 );
+                    }
+                rf.Close();
+                }
+            else
+                {
+                VCXLOGLO3("%S (f) %S", pre, fileName);
+                }
+
+            }
+            VCXLOGLO3("%S Total size: %d KB", pre, totalSize/1024 );
+            CleanupStack::PopAndDestroy( fileName );
+        }
+
+    CleanupStack::PopAndDestroy( pre );
+    CleanupStack::PopAndDestroy( fileList );
+    CleanupStack::PopAndDestroy( dirList );
+
+    if( aLevel == 0 )
+        {
+        VCXLOGLO1("CVCXTestCommon:: Directory listed.");
+        }
+
+    return err;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestCommon::GetPSProperty
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CVCXTestCommon::GetPSProperty( const TUid aCategory, const TUint aKey, TInt& aValue )
+    {
+    VCXLOGLO2("CVCXTestCommon:: RProperty::Get key %d.", aKey);
+    TInt err = RProperty::Get( aCategory, aKey, aValue );
+    if( err != KErrNone )
+        {
+        VCXLOGLO2("CVCXTestCommon:: RProperty::Get int returned error: %d.", err);
+        }
+    return err;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CVCXTestCommon::SetPSProperty
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CVCXTestCommon::SetPSProperty( const TUid aCategory, const TUint aKey, const TInt aValue )
+    {
+    VCXLOGLO2("CVCXTestCommon:: RProperty::Set key %d.", aKey);
+    TInt err = RProperty::Set( aCategory, aKey, aValue );
+    if( err != KErrNone )
+        {
+        VCXLOGLO2("CVCXTestCommon:: RProperty::Set int returned error: %d.", err);
+        }
+    return err;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestCommon::GetPSProperty
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CVCXTestCommon::GetPSProperty( const TUid aCategory, const TUint aKey, TDes& aValue )
+    {
+    VCXLOGLO2("CVCXTestCommon:: RProperty::Get key %d.", aKey);
+    TInt err = RProperty::Get( aCategory, aKey, aValue );
+    if( err != KErrNone )
+        {
+        VCXLOGLO2("CVCXTestCommon:: RProperty::Get desc returned error: %d.", err);
+        }
+    return err;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CVCXTestCommon::SetPSProperty
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CVCXTestCommon::SetPSProperty( const TUid aCategory, const TUint aKey, const TDesC& aValue )
+    {
+    VCXLOGLO2("CVCXTestCommon:: RProperty::Set key %d.", aKey);
+    TInt err = RProperty::Set( aCategory, aKey, aValue );
+    if( err != KErrNone )
+        {
+        VCXLOGLO2("CVCXTestCommon:: RProperty::Set desc returned error: %d.", err);
+        }
+    return err;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestCommon::ListFilesProcessesAndThreadsL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVCXTestCommon::ListFilesProcessesAndThreadsL( RFs& aFs )
+    {
+    RArray<TInt> fileThreadIds;
+    CleanupClosePushL( fileThreadIds );
+    
+    RPointerArray<HBufC> fileNames;
+    CleanupResetAndDestroyPushL( fileNames );
+
+    // Get list of open files.
+    CFileList* fileList = 0;
+    TOpenFileScan fileScan( aFs );
+    fileScan.NextL( fileList );
+    
+    CleanupStack::PushL( fileList );
+    
+    while( fileList )
+        {
+        for (TInt i = 0; i < fileList->Count(); ++i)
+            {
+            fileNames.Append( (*fileList)[i].iName.AllocL() );
+            fileThreadIds.Append( fileScan.ThreadId() );
+            //VCXLOGLO4("File: %S Size: %d Thread Id: %d", &(*fileList)[i].iName, (*fileList)[i].iSize, fileScan.ThreadId() );
+            }
+        CleanupStack::PopAndDestroy( fileList );
+        fileScan.NextL( fileList );
+        CleanupStack::PushL( fileList );
+        }
+    
+    CleanupStack::PopAndDestroy( fileList );
+    
+    // Get list of processes and their threads.    
+    TFindProcess findProcess;
+    TFullName processName;
+    
+    TInt err( KErrNone );
+    
+    // List processes.
+    while( findProcess.Next( processName ) == KErrNone )
+        {
+        RProcess process;
+        err = process.Open( processName );
+        if( err != KErrNone ) 
+            {
+            continue;            
+            }
+        CleanupClosePushL( process );
+
+        TProcessId pid;
+        pid = process.Id();
+        TInt id = pid.Id();
+        VCXLOGLO4("Process: %S, ID: %d (%x)", &processName, id, pid.Id() );
+        
+        TFindThread findThread;
+        TFullName threadName;
+        
+        // List threads that belong to current process.
+        while( findThread.Next( threadName ) == KErrNone )
+            {
+            RThread thread;
+            err = thread.Open( threadName );
+            if( err == KErrNone )
+                {
+                CleanupClosePushL( thread );
+                RProcess threadProcess;
+                err = thread.Process( threadProcess ) ;
+                if( err == KErrNone )
+                    {
+                    CleanupClosePushL( threadProcess );
+                    if( threadProcess.Id() == process.Id() )
+                        {
+                        TThreadId tid;
+                        tid = thread.Id();
+                        id = tid.Id();
+                        VCXLOGLO4(" - Thread: %S, ID: %d (%x)", &threadName, id, tid.Id() );
+                        
+                        // And list open files for the thread.
+                        for( TInt i = 0; i < fileThreadIds.Count(); i++ )
+                            {
+                            if( fileThreadIds[i] == tid.Id() )
+                                {
+                                VCXLOGLO2("   - %S", fileNames[i] );
+                                }
+                            }
+                        }
+                    CleanupStack::PopAndDestroy( &threadProcess );
+                    }
+                CleanupStack::PopAndDestroy( &thread );
+                }        
+            }
+        
+        VCXLOGLO1("---");
+        CleanupStack::PopAndDestroy( &process );
+        }
+    
+    CleanupStack::PopAndDestroy( &fileNames );
+    CleanupStack::PopAndDestroy( &fileThreadIds );
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/src/VCXTestMessageWait.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,356 @@
+/*
+* 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 "VCXTestMessageWait.h"
+#include "VCXTestLog.h"
+#include "CIptvTestActiveWait.h"
+#include "CIptvTestTimer.h"
+
+// EXTERNAL DATA STRUCTURES
+
+// EXTERNAL FUNCTION PROTOTYPES
+
+// CONSTANTS
+const TInt KTimeoutSecond = 1000000;
+
+// MACROS
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CVCXTestMessageWait::
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CVCXTestMessageWait* CVCXTestMessageWait::NewL( MVCXTestMessageWaitObserver* aObserver )
+    {
+    VCXLOGLO1(">>>CVCXTestMessageWait::NewL");
+    CVCXTestMessageWait* self = new (ELeave) CVCXTestMessageWait( aObserver );
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+    VCXLOGLO1("<<<CVCXTestMessageWait::NewL");
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestMessageWait::~CVCXTestMessageWait
+// destructor
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CVCXTestMessageWait::~CVCXTestMessageWait()
+    {
+    VCXLOGLO1(">>>CVCXTestMessageWait::~CVCXTestMessageWait");
+    
+    iActiveWaitBlocking->Stop();
+    delete iActiveWaitBlocking;
+    iActiveWaitBlocking = NULL;
+
+    if( iTimeoutTimer )
+        {
+        iTimeoutTimer->CancelTimer();
+        delete iTimeoutTimer;
+        iTimeoutTimer = NULL;
+        }
+
+    iReceivedMessages.Reset();
+    iWaitedMessages.Reset();
+    
+    VCXLOGLO1("<<<CVCXTestMessageWait::~CVCXTestMessageWait");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestMessageWait::~CVCXTestMessageWait
+// destructor
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CVCXTestMessageWait::CVCXTestMessageWait( MVCXTestMessageWaitObserver* aObserver )
+ : iObserver( aObserver )
+    {
+    VCXLOGLO1(">>>CVCXTestMessageWait::CVCXTestMessageWait");
+
+    VCXLOGLO1("<<<CVCXTestMessageWait::CVCXTestMessageWait");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestMessageWait::ConstructL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVCXTestMessageWait::ConstructL()
+    {
+    VCXLOGLO1(">>>CVCXTestMessageWait::ConstructL");
+    
+    iActiveWaitBlocking = CIptvTestActiveWait::NewL();
+    iTimeoutTimer = CIptvTestTimer::NewL(*this, 0);
+
+    VCXLOGLO1("<<<CVCXTestMessageWait::ConstructL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestMessageWait::Reset
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVCXTestMessageWait::Reset()
+    {
+    VCXLOGLO1(">>>CVCXTestMessageWait::Reset");
+    iCoolingDown = EFalse;
+    iWaitStarted = EFalse;
+    iWaitedMessages.Reset();
+    iReceivedMessages.Reset();
+    iTimeoutTimer->Cancel();
+    iActiveWaitBlocking->Stop();
+    VCXLOGLO1("<<<CVCXTestMessageWait::Reset");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestMessageWait::ResetReceivedMessages
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVCXTestMessageWait::ResetReceivedMessages()
+	{
+    VCXLOGLO1(">>>CVCXTestMessageWait::ResetReceivedMessages");
+    iReceivedMessages.Reset();    
+    VCXLOGLO1("<<<CVCXTestMessageWait::ResetReceivedMessages");
+	}
+
+// -----------------------------------------------------------------------------
+// CVCXTestMessageWait::AddMessage
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVCXTestMessageWait::AddMessage( TInt32 aMsg )
+    {
+    VCXLOGLO1(">>>CVCXTestMessageWait::AddMessage");
+    iWaitedMessages.Append( aMsg );    
+    VCXLOGLO1("<<<CVCXTestMessageWait::AddMessage");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestMessageWait::WaitForMessageL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVCXTestMessageWait::WaitForMessageL( TInt32 aMsg, TInt aTimeoutSeconds, TBool aDoBlock )
+	{
+    VCXLOGLO1(">>>CVCXTestMessageWait::WaitForMessageL");
+
+    iWaitedMessages.Reset();
+    iWaitedMessages.Append( aMsg );
+    
+    iTimeoutSeconds = aTimeoutSeconds;
+    WaitForAllL( aTimeoutSeconds, aDoBlock );
+    
+    VCXLOGLO1("<<<CVCXTestMessageWait::WaitForMessageL");
+	}
+
+// -----------------------------------------------------------------------------
+// CVCXTestMessageWait::WaitForAllL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVCXTestMessageWait::WaitForAllL( TInt aTimeoutSeconds, TBool aDoBlock )
+	{
+    VCXLOGLO1(">>>CVCXTestMessageWait::WaitForAllL");
+
+    iWaitStarted = ETrue;
+    
+    iTimeoutSeconds = aTimeoutSeconds;
+    
+    // Nothing to wait.
+    if( iWaitedMessages.Count() <= 0 )
+        {
+        VCXLOGLO1("<<<CVCXTestMessageWait::WaitForAllL");
+        User::Leave( KErrNotReady );
+        }    
+    
+    // Check already received messages.
+    for( TInt i = iReceivedMessages.Count()-1; i >= 0; i-- )
+        {
+        for( TInt e = iWaitedMessages.Count()-1; e >= 0; e-- )
+            {
+            if( iReceivedMessages[i] == iWaitedMessages[e] )
+                {
+                iWaitedMessages.Remove( e );
+                iReceivedMessages.Remove( i );
+                break;
+                }
+            }
+        }
+    
+    if( iWaitedMessages.Count() > 0 )
+        {
+        // There's messages to wait. Start timeout timer.
+        iTimeoutTimer->After( aTimeoutSeconds * KTimeoutSecond );
+    
+        // Client wants blocking call.
+        if( aDoBlock )
+            {
+            iActiveWaitBlocking->Start();
+            User::LeaveIfError( iError );
+            }
+        }
+    else
+        {
+        iWaitStarted = EFalse;
+        
+        // Nothing to wait for.
+        iTimeoutTimer->CancelTimer();
+        
+        // Not blocking, inform client with callback.
+        if( !aDoBlock )
+            {
+            iObserver->MessageWaitComplete( KErrNone );
+            }
+        }
+    
+    VCXLOGLO1("<<<CVCXTestMessageWait::WaitForAllL");
+	}
+
+// -----------------------------------------------------------------------------
+// CVCXTestMessageWait::CoolDownL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVCXTestMessageWait::CoolDownL( TInt aSeconds )
+    {
+    VCXLOGLO1(">>>CVCXTestMessageWait::CoolDownL");
+
+    Reset();
+    
+    iTimeoutSeconds = aSeconds;
+    
+    iCoolingDown = ETrue;
+    
+    iTimeoutTimer->After( iTimeoutSeconds * KTimeoutSecond );
+    
+    iActiveWaitBlocking->Start();
+        
+    VCXLOGLO1("<<<CVCXTestMessageWait::CoolDownL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestMessageWait::ReceiveMessage
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVCXTestMessageWait::ReceiveMessage( TInt32 aMsg, TInt aError )
+	{
+    if( !iWaitStarted )
+        {
+        VCXLOGLO1("CVCXTestMessageWait::ReceiveMessage: Wait not active.");
+        return;
+        }
+
+    VCXLOGLO1(">>>CVCXTestMessageWait::ReceiveMessage");
+
+    if( aError != KErrNone )
+        {
+        iWaitStarted = EFalse;
+        if( iActiveWaitBlocking->IsWaiting() )
+            {
+            iError = aError;
+            iActiveWaitBlocking->Stop();
+            }
+        else
+            {
+            iObserver->MessageWaitComplete( aError );
+            }
+        iTimeoutTimer->CancelTimer();
+        VCXLOGLO1("<<<CVCXTestMessageWait::ReceiveMessage");
+        return;
+        }
+    
+    if( iCoolingDown ) 
+        {
+        iTimeoutTimer->After( iTimeoutSeconds * KTimeoutSecond );
+        VCXLOGLO1("<<<CVCXTestMessageWait::ReceiveMessage");
+        return;
+        }
+    
+    if( !iWaitStarted ) 
+        {
+        iReceivedMessages.Append( aMsg );
+        VCXLOGLO1("<<<CVCXTestMessageWait::ReceiveMessage");
+        return;
+        }
+
+    if( iWaitedMessages.Count() > 0 )
+        {
+        // Check if message is in wait queue.
+        for( TInt i = iWaitedMessages.Count()-1; i >= 0; i-- )
+            {
+            if( iWaitedMessages[i] == aMsg )
+                {
+                iWaitedMessages.Remove( i );
+                break;
+                }
+            }
+        
+        if( iWaitedMessages.Count() <= 0 )
+            {
+            iWaitStarted = EFalse;
+            // Stop wait.
+            if( iActiveWaitBlocking->IsWaiting() )
+                {
+                iError = KErrNone;
+                iActiveWaitBlocking->Stop();
+                }
+            // Not waiting, client wants callback.
+            else
+                {
+                iObserver->MessageWaitComplete( KErrNone );
+                }
+            // Stop timer too.
+            iTimeoutTimer->CancelTimer();
+            }
+        }
+    
+    VCXLOGLO1("<<<CVCXTestMessageWait::ReceiveMessage");
+	}
+
+// -----------------------------------------------------------------------------
+// CVCXTestMessageWait::TimerComplete
+// -----------------------------------------------------------------------------
+//
+void CVCXTestMessageWait::TimerComplete( TInt /* aTimerId */, TInt aError )
+    {
+    if( aError != KErrCancel )
+        {
+        if( iCoolingDown )
+            {
+            VCXLOGLO1("CVCXTestMessageWait:: Cooldown done.");
+            iActiveWaitBlocking->Stop();
+            iCoolingDown = EFalse;
+            }
+        else
+        if( iWaitedMessages.Count() > 0 )
+            {
+            iWaitStarted = EFalse;
+            VCXLOGLO2("CVCXTestMessageWait:: Timeout. Messages left: %d", iWaitedMessages.Count());
+            if( iActiveWaitBlocking->IsWaiting() )
+                {
+                iActiveWaitBlocking->Stop();
+                iError = KErrTimedOut;
+                }
+            else
+                {
+                // Client wants callback.
+                iObserver->MessageWaitComplete( KErrTimedOut );
+                }
+            }
+        }
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/src/VCXTestPSSubscriber.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,215 @@
+/*
+* 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 "VCXTestLog.h"
+#include "VCXTestPSSubscriber.h"
+#include "VCXTestPSObserver.h"
+
+const TInt KMaxStrLenght( 100 );
+
+// -----------------------------------------------------------------------------
+// CVCXTestPSSubscriber::CVCXTestPSSubscriber()
+// -----------------------------------------------------------------------------
+//
+CVCXTestPSSubscriber::CVCXTestPSSubscriber( const TUid aUid,
+                                                const TUint32 aKey,
+                                                RProperty::TType aType,
+                                                MVCXTestPSObserver* aObserver ) :
+    CActive( EPriorityStandard ),
+    iUid( aUid ),
+    iKey( aKey ),
+    iKeyType(aType),
+    iObserver( aObserver )
+    {
+        // NOP
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestPSSubscriber::NewL()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CVCXTestPSSubscriber* CVCXTestPSSubscriber::NewL( const TUid aUid,
+                                                      const TUint32 aKey,
+                                                      RProperty::TType aType,
+                                                      MVCXTestPSObserver* aObserver )
+    {
+    CVCXTestPSSubscriber* self =
+                      new( ELeave ) CVCXTestPSSubscriber( aUid, aKey, aType, aObserver );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestPSSubscriber::ConstructL()
+// -----------------------------------------------------------------------------
+//
+void CVCXTestPSSubscriber::ConstructL()
+    {
+    iInitialized = EFalse;
+    User::LeaveIfError( iProperty.Attach( iUid, iKey ) );
+    CActiveScheduler::Add( this );
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestPSSubscriber::~CVCXTestPSSubscriber()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CVCXTestPSSubscriber::~CVCXTestPSSubscriber()
+    {
+    if( IsActive() )
+        {
+        Cancel();
+        }
+    iProperty.Close();
+
+    delete iSafeWait;
+    iSafeWait = NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestPSSubscriber::Get()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CVCXTestPSSubscriber::Get( TInt& aValue )
+    {
+    return iProperty.Get( aValue );
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestPSSubscriber::Get()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CVCXTestPSSubscriber::Get( TDes& aValue )
+    {
+    return iProperty.Get( aValue );
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestPSSubscriber::Set()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CVCXTestPSSubscriber::Set( TInt& aValue )
+    {
+    return iProperty.Set( aValue );
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestPSSubscriber::Set()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CVCXTestPSSubscriber::Set( const TDesC& aValue )
+    {
+    return iProperty.Set( aValue );
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestPSSubscriber::Start()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVCXTestPSSubscriber::Start()
+    {
+    if( !IsActive() )
+        {
+        iProperty.Subscribe( iStatus );
+        SetActive();
+        iInitialized = ETrue;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestPSSubscriber::WaitChange()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVCXTestPSSubscriber::WaitChangeL()
+    {
+    if( !iSafeWait )
+        {
+        iSafeWait = new ( ELeave ) CActiveSchedulerWait;
+        }
+    if ( iSafeWait && !iSafeWait->IsStarted() )
+        {
+        iSafeWait->Start();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestPSSubscriber::EndWait()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVCXTestPSSubscriber::EndWait()
+    {
+    if ( iSafeWait && iSafeWait->IsStarted() )
+        {
+        iSafeWait->AsyncStop();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestPSSubscriber::DoCancel()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVCXTestPSSubscriber::DoCancel()
+    {
+    if( IsActive() )
+        {
+        iProperty.Cancel();
+        }
+    iInitialized = EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestPSSubscriber::RunL()
+// -----------------------------------------------------------------------------
+//
+void CVCXTestPSSubscriber::RunL()
+    {
+    VCXLOGLO1(">>>CVCXTestPSSubscriber::RunL");
+    // resubscribe before processing new
+    // value to prevent missing updates
+    iProperty.Subscribe( iStatus );
+    SetActive();
+
+    if( iInitialized )
+        {
+        TBuf< KMaxStrLenght > strValue;
+        TInt intValue;
+
+        if( iKeyType == RProperty::EInt )
+            {
+            // int type changed
+            if( iProperty.Get( intValue ) == KErrNone && iObserver )
+                {
+                iObserver->ValueChangedL( iUid, iKey, intValue );
+                }
+            }
+        else if( iKeyType == RProperty::EText )
+            {
+            if( iProperty.Get( strValue ) == KErrNone && iObserver )
+                {
+                iObserver->ValueChangedL( iUid, iKey, strValue );
+                }
+            }
+        }
+    EndWait();
+    iInitialized = ETrue;
+    VCXLOGLO1("<<<CVCXTestPSSubscriber::RunL");
+  }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/src/VCXTestStatsKeeper.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,830 @@
+/*
+* 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: 
+*
+*/
+
+
+//  INCLUDES
+#include "VCXTestStatsKeeper.h"
+#include "VCXTestLog.h"
+#include <flogger.h>
+#include <mmf/common/mmfcontrollerpluginresolver.h> // CleanupResetAndDestroyPushL
+
+// CONSTANTS
+const TUint KMaxTraces = 20;
+
+// MACROS
+
+#ifndef __WINSCW__
+
+_LIT( KVCXTestLogFolder, "Fusion" );
+
+#define VCXTESTSTATS_W1(FILE,AAA)                  do { _LIT(tempIPTVLogDes,AAA); RFileLogger::Write(KVCXTestLogFolder,FILE,EFileLoggingModeAppend,tempIPTVLogDes()); } while ( EFalse )
+#define VCXTESTSTATS_W2(FILE,AAA,BBB)              do { _LIT(tempIPTVLogDes,AAA); RFileLogger::WriteFormat(KVCXTestLogFolder,FILE,EFileLoggingModeAppend,TRefByValue<const TDesC>(tempIPTVLogDes()),BBB); } while ( EFalse )
+#define VCXTESTSTATS_W3(FILE,AAA,BBB,CCC)          do { _LIT(tempIPTVLogDes,AAA); RFileLogger::WriteFormat(KVCXTestLogFolder,FILE,EFileLoggingModeAppend,TRefByValue<const TDesC>(tempIPTVLogDes()),BBB,CCC); } while ( EFalse )
+#define VCXTESTSTATS_W4(FILE,AAA,BBB,CCC,DDD)      do { _LIT(tempIPTVLogDes,AAA); RFileLogger::WriteFormat(KVCXTestLogFolder,FILE,EFileLoggingModeAppend,TRefByValue<const TDesC>(tempIPTVLogDes()),BBB,CCC,DDD); } while ( EFalse )
+#define VCXTESTSTATS_W5(FILE,AAA,BBB,CCC,DDD,EEE)  do { _LIT(tempIPTVLogDes,AAA); RFileLogger::WriteFormat(KVCXTestLogFolder,FILE,EFileLoggingModeAppend,TRefByValue<const TDesC>(tempIPTVLogDes()),BBB,CCC,DDD,EEE); } while ( EFalse )
+
+#else
+
+#define VCXTESTSTATS_W1(FILE,s)               RDebug::Print(_L(#s))
+#define VCXTESTSTATS_W2(FILE,s, a)            RDebug::Print(_L(#s), a)
+#define VCXTESTSTATS_W3(FILE,s, a, b)         RDebug::Print(_L(#s), a, b)
+#define VCXTESTSTATS_W4(FILE,s, a, b, c)      RDebug::Print(_L(#s), a, b, c)
+#define VCXTESTSTATS_W5(FILE,s, a, b, c, d)   RDebug::Print(_L(#s), a, b, c, d)
+
+#endif
+
+// -----------------------------------------------------------------------------
+// CVCXTestStatsItem::NewL
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CVCXTestStatsItem* CVCXTestStatsItem::NewL()
+    {
+    CVCXTestStatsItem* self = new (ELeave)CVCXTestStatsItem();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestStatsItem::~CVCXTestStatsKeeper
+// destructor
+// -----------------------------------------------------------------------------
+//
+CVCXTestStatsItem::~CVCXTestStatsItem()
+    {
+    delete iDesc;
+    iDesc = NULL;
+    
+    delete iDescId;
+    iDescId = NULL;
+    
+    iTraces.ResetAndDestroy();
+    iProgresses.ResetAndDestroy();
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestStatsItem::CVCXTestStatsItem()
+// -----------------------------------------------------------------------------
+//
+CVCXTestStatsItem::CVCXTestStatsItem()
+    {
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestStatsItem::ConstructL()
+// -----------------------------------------------------------------------------
+//
+void CVCXTestStatsItem::ConstructL()
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CVCXTestStatsItemSummary::NewL
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CVCXTestStatsItemSummary* CVCXTestStatsItemSummary::NewL()
+    {
+    CVCXTestStatsItemSummary* self = new (ELeave)CVCXTestStatsItemSummary();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestStatsItemSummary::~CVCXTestStatsKeeper
+// destructor
+// -----------------------------------------------------------------------------
+//
+CVCXTestStatsItemSummary::~CVCXTestStatsItemSummary()
+    {
+    delete iDesc;
+    iDesc = NULL;
+    
+    delete iDescId;
+    iDescId = NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestStatsItemSummary::CVCXTestStatsItemSummary()
+// -----------------------------------------------------------------------------
+//
+CVCXTestStatsItemSummary::CVCXTestStatsItemSummary()
+    {
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestStatsItemSummary::ConstructL()
+// -----------------------------------------------------------------------------
+//
+void CVCXTestStatsItemSummary::ConstructL()
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CVCXTestStatsKeeper::NewL
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CVCXTestStatsKeeper* CVCXTestStatsKeeper::NewL()
+    {
+    CVCXTestStatsKeeper* self = new (ELeave)CVCXTestStatsKeeper();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestStatsKeeper::~CVCXTestStatsKeeper
+// destructor
+// -----------------------------------------------------------------------------
+//
+CVCXTestStatsKeeper::~CVCXTestStatsKeeper ()
+    {
+    if( iStarted )
+        {
+        GenerateReportL( _L("FusionStats.txt"), EFalse );
+        GenerateReportL( _L("FusionStatsFull.txt"), ETrue );
+        }
+    
+    delete iReportName;
+    iReportName = NULL;
+    
+    delete iReportFileName;
+    iReportFileName = NULL;
+    
+    iActions.ResetAndDestroy();
+    iTraces.ResetAndDestroy();
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestStatsKeeper::CVCXTestStatsKeeper
+// -----------------------------------------------------------------------------
+//
+CVCXTestStatsKeeper::CVCXTestStatsKeeper()
+    {
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestStatsKeeper::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CVCXTestStatsKeeper::ConstructL()
+    {
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestStatsKeeper::StartStatsKeepingL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVCXTestStatsKeeper::StartStatsKeepingL( const TDesC& aName, const TDesC& aFileName )
+    {
+    iStarted = ETrue;
+    iReportName = aName.AllocL();
+    iReportFileName = aFileName.AllocL();
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestStatsKeeper::ActionStartL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVCXTestStatsKeeper::ActionStartL( TInt32 aId, const TDesC& aDesc )
+    {
+    VCXLOGLO3(">>>CVCXTestStatsKeeper::ActionStartL: %d = %S ------>", aId, &aDesc);
+    if( !iStarted )
+        {
+        return;
+        }
+        
+    CVCXTestStatsItem* item = CVCXTestStatsItem::NewL();
+    item->iId = aId;
+    item->iDesc = aDesc.AllocL();
+    item->iStartTime.HomeTime();
+    item->iIsActive = ETrue;
+    
+    iActions.AppendL( item );
+    VCXLOGLO1("<<<CVCXTestStatsKeeper::ActionStartL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestStatsKeeper::ActionStartL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVCXTestStatsKeeper::ActionStartL( const TDesC& aDescId, const TDesC& aDesc, TBool aDescMerge )
+    {
+    VCXLOGLO3(">>>CVCXTestStatsKeeper::ActionStartL %S = %S ------>", &aDescId, &aDesc);
+    if( !iStarted )
+        {
+        return;
+        }
+
+    CVCXTestStatsItem* item = CVCXTestStatsItem::NewL();
+    item->iDescId = aDescId.AllocL();
+    if( aDescMerge )
+        {
+        item->iDesc = HBufC::NewL( aDesc.Length() + aDescId.Length() );
+        item->iDesc->Des().Append( aDesc );
+        item->iDesc->Des().Append( aDescId );
+        }
+    else
+        {
+        item->iDesc = aDesc.AllocL();
+        }
+    item->iStartTime.HomeTime();
+    item->iIsActive = ETrue;
+    
+    iActions.AppendL( item );
+    VCXLOGLO1("<<<CVCXTestStatsKeeper::ActionStartL (desc)");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestStatsKeeper::ActionEndL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVCXTestStatsKeeper::ActionEndL( TInt32 aId, TInt aError )
+    {
+    VCXLOGLO3(">>>CVCXTestStatsKeeper::ActionEndL: %d, err: %d ------>", aId, aError);
+    if( !iStarted )
+        {
+        return;
+        }
+    
+    CVCXTestStatsItem* item = GetActiveAction( aId );
+    
+    if( !item )
+        {
+        VCXLOGLO1("CVCXTestStatsKeeper:: No active action to end!");
+        VCXLOGLO1("<<<CVCXTestStatsKeeper::ActionEndL");
+        return;
+        }
+    
+    item->iError = aError;
+    item->iEndTime.HomeTime();
+    
+    TBuf<64> prgBuff( _L("OK") );
+    if( aError != KErrNone )
+        {
+        prgBuff.Format( _L("Failed (%d)"), item->iError);
+        }
+    ActionProgressL( aId, prgBuff );
+    
+    item->iIsActive = EFalse;
+    
+    if( aError != KErrNone )
+        {
+        for( TInt i = 0; i < iTraces.Count(); i++ )
+            {
+            item->iTraces.AppendL( iTraces[i] );
+            }
+        iTraces.Reset();
+        }
+    
+    CheckFailsL();
+    
+    VCXLOGLO1("<<<CVCXTestStatsKeeper::ActionEndL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestStatsKeeper::ActionEndL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVCXTestStatsKeeper::ActionEndL( const TDesC& aDescId, TInt aError )
+    {
+    VCXLOGLO3(">>>CVCXTestStatsKeeper::ActionEndL :%S, err: %d ------>", &aDescId, aError);
+    if( !iStarted )
+        {
+        return;
+        }
+    
+    CVCXTestStatsItem* item = GetActiveAction( aDescId );
+    
+    if( !item )
+        {
+        VCXLOGLO1("CVCXTestStatsKeeper:: No active action to end!");
+        VCXLOGLO1("<<<CVCXTestStatsKeeper::ActionEndL (tdesc)");
+        return;
+        }
+    
+    item->iError = aError;
+    item->iEndTime.HomeTime();
+    
+    TBuf<64> prgBuff( _L("OK") );
+    if( aError != KErrNone )
+        {
+        prgBuff.Format( _L("Failed (%d)"), item->iError);
+        }
+    ActionProgressL( aDescId, prgBuff );
+
+    item->iIsActive = EFalse;
+    
+    if( aError != KErrNone )
+        {
+        for( TInt i = 0; i < iTraces.Count(); i++ )
+            {
+            item->iTraces.AppendL( iTraces[i] );
+            }
+        iTraces.Reset();
+        }
+    
+    CheckFailsL();
+    
+    VCXLOGLO1("<<<CVCXTestStatsKeeper::ActionEndL (tdesc)");    
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestStatsKeeper::ActionProgressL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVCXTestStatsKeeper::ActionProgressL( TInt32 aId, const TDesC& aProgressDesc )
+    {
+    VCXLOGLO3(">>>CVCXTestStatsKeeper::ActionProgressL: %d = %S", aId, &aProgressDesc);
+    if( !iStarted )
+        {
+        return;
+        }
+
+    CVCXTestStatsItem* item = GetActiveAction( aId );
+    
+    if( !item )
+        {
+        User::Leave( KErrNotFound );
+        }
+    
+    CVCXTestStatsItem* progress = CVCXTestStatsItem::NewL();
+    
+    progress->iStartTime.HomeTime();
+    progress->iDesc = aProgressDesc.AllocL();
+    
+    item->iProgresses.AppendL( progress );        
+    VCXLOGLO1("<<<CVCXTestStatsKeeper::ActionProgressL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestStatsKeeper::ActionProgressL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVCXTestStatsKeeper::ActionProgressL( const TDesC& aDescId, const TDesC& aProgressDesc )
+    {
+    VCXLOGLO3(">>>CVCXTestStatsKeeper::ActionProgressL: %S = %S", &aDescId, &aProgressDesc);
+    if( !iStarted )
+        {
+        return;
+        }
+
+    CVCXTestStatsItem* item = GetActiveAction( aDescId );
+    
+    if( !item )
+        {
+        User::Leave( KErrNotFound );
+        }
+    
+    CVCXTestStatsItem* progress = CVCXTestStatsItem::NewL();
+    
+    progress->iStartTime.HomeTime();
+    progress->iDesc = aProgressDesc.AllocL();
+    
+    item->iProgresses.AppendL( progress );
+    VCXLOGLO1("<<<CVCXTestStatsKeeper::ActionProgressL (desc)");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestStatsKeeper::ActionTraceL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVCXTestStatsKeeper::ActionTraceL( const TDesC& aDesc )
+    {
+    VCXLOGLO1(">>>CVCXTestStatsKeeper::ActionTraceL");
+    if( !iStarted )
+        {
+        return;
+        }
+    
+    while( iTraces.Count() > KMaxTraces )
+        {
+        iTraces.Remove( 0 );
+        }
+    
+    iTraces.AppendL( aDesc.AllocL() );
+    VCXLOGLO1("<<<CVCXTestStatsKeeper::ActionTraceL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestStatsKeeper::GetActiveAction
+// -----------------------------------------------------------------------------
+//
+CVCXTestStatsItem* CVCXTestStatsKeeper::GetActiveAction( TInt32 aId )
+    {
+    VCXLOGLO1(">>>CVCXTestStatsKeeper::GetActiveAction");
+    for( TInt i = 0; i < iActions.Count(); i++ )
+        {
+        if( iActions[i]->iId == aId && iActions[i]->iIsActive )
+            {
+            VCXLOGLO2("CVCXTestStatsKeeper:: Found %S.", iActions[i]->iDesc);
+            VCXLOGLO1("<<<CVCXTestStatsKeeper::GetActiveAction");
+            return iActions[i];
+            }
+        }
+    VCXLOGLO1("<<<CVCXTestStatsKeeper::GetActiveAction");
+    return GetLastActiveAction( EFalse );
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestStatsKeeper::GetActiveAction
+// -----------------------------------------------------------------------------
+//
+CVCXTestStatsItem* CVCXTestStatsKeeper::GetActiveAction( const TDesC& aDescId )
+    {
+    VCXLOGLO1(">>>CVCXTestStatsKeeper::GetActiveAction (desc)");
+    for( TInt i = 0; i < iActions.Count(); i++ )
+        {
+        if( iActions[i]->iDescId && *iActions[i]->iDescId == aDescId && iActions[i]->iIsActive )
+            {
+            VCXLOGLO2("CVCXTestStatsKeeper:: Found %S.", iActions[i]->iDesc);
+            VCXLOGLO1("<<<CVCXTestStatsKeeper::GetActiveAction (desc)");            
+            return iActions[i];
+            }
+        }
+    VCXLOGLO1("<<<CVCXTestStatsKeeper::GetActiveAction (desc)");
+    return GetLastActiveAction( ETrue );
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestStatsKeeper::GetLastActiveAction
+// -----------------------------------------------------------------------------
+//
+CVCXTestStatsItem* CVCXTestStatsKeeper::GetLastActiveAction( TBool aOnlyDescId )
+    {
+    VCXLOGLO1(">>>CVCXTestStatsKeeper::GetLastActiveAction");
+    for( TInt i = iActions.Count()-1; i >= 0; i-- )
+        {
+        if( iActions[i]->iIsActive )
+            {
+            if( ( aOnlyDescId && iActions[i]->iDesc ) || ( !aOnlyDescId && !iActions[i]->iDesc ) ) 
+                {
+                continue;
+                }
+            VCXLOGLO2("CVCXTestStatsKeeper:: Found: %S.", iActions[i]->iDesc);
+            VCXLOGLO1("<<<CVCXTestStatsKeeper::GetLastActiveAction");
+            return iActions[i];
+            }
+        }
+    VCXLOGLO1("<<<CVCXTestStatsKeeper::GetLastActiveAction");
+    return NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestStatsKeeper::FormatDate
+// -----------------------------------------------------------------------------
+//
+TInt CVCXTestStatsKeeper::FormatDate( const TTime& aDate, TDes& aStr )
+    {
+    _LIT(KDateTimeString,"%D%M%Y%/0%1%/1%2%/2%3%/3 %-B%:0%H%:1%T%:2%S%.%*C2%:3%-B");
+
+    TRAPD( err, aDate.FormatL( aStr, KDateTimeString ) );
+    return err;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestStatsKeeper::GenerateReport
+// -----------------------------------------------------------------------------
+//
+void CVCXTestStatsKeeper::GenerateReportL( const TDesC& aFileName, TBool aFullReport )
+    {
+    aFileName.Length();
+    
+    if( !iStarted )
+        {
+        return;
+        }
+
+    if ( aFullReport )
+        {
+        VCXTESTSTATS_W2( aFileName, "CVCXTestStatsKeeper:: Data size for the report: %d kBs", DataSizeL() );
+        }
+
+    if( iReportName )
+        {
+        VCXTESTSTATS_W1(aFileName, "");
+        VCXTESTSTATS_W1(aFileName, "-------------------------------------------------------------------------");
+        VCXTESTSTATS_W2(aFileName, " %S", iReportName);
+        VCXTESTSTATS_W1(aFileName, "-------------------------------------------------------------------------");
+        }
+    
+    if( aFullReport )
+        {
+        const TInt KMaxDescLen = 52;
+        
+        for( TInt i = 0; i < iActions.Count(); i++ )
+            {
+            TBuf<256> startTime;
+            TBuf<256> endTime;
+            
+            CVCXTestStatsItem* item = iActions[i];
+            
+            FormatDate( item->iStartTime, startTime );
+            if( !item->iIsActive )
+                {
+                FormatDate( item->iEndTime, endTime );
+                }
+            
+            TBuf<KMaxDescLen+10> shortened;
+            if( item->iDesc->Length() > KMaxDescLen )
+                {
+                TPtrC left = item->iDesc->Left( KMaxDescLen/2 );
+                TPtrC right = item->iDesc->Right( KMaxDescLen/2 );
+                shortened.Format( _L("%S ... %S"), &left, &right );
+                }
+            else
+                {
+                shortened.Copy( *item->iDesc );
+                }
+            
+            TBuf<1024*2> buff;
+            buff.Format( _L("%- *S %S"), 60, &shortened, &startTime);
+            VCXTESTSTATS_W2(aFileName, "%S", &buff);
+    
+            if( item->iProgresses.Count() > 0 )
+                {
+                for( TInt e = 0; e < item->iProgresses.Count(); e++ )
+                    {
+                    FormatDate( item->iProgresses[e]->iStartTime, startTime );
+                    if( item->iProgresses[e]->iDesc->Length() > KMaxDescLen )
+                        {
+                        TPtrC left = item->iProgresses[e]->iDesc->Left( KMaxDescLen/2-2 );
+                        TPtrC right = item->iProgresses[e]->iDesc->Right( KMaxDescLen/2-2 );
+                        shortened.Format( _L("%S .. %S"), &left, &right );
+                        }
+                    else
+                        {
+                        shortened.Copy( *item->iProgresses[e]->iDesc );
+                        }
+                    buff.Format( _L("   %- *S %S"), 57, &shortened, &startTime );
+                    VCXTESTSTATS_W2(aFileName, "%S", &buff);
+                    }
+                }
+            
+            if( item->iTraces.Count() > 0 )
+                {
+                VCXTESTSTATS_W1(aFileName, "   Traces:");
+                for( TInt e = 0; e < item->iTraces.Count(); e++ )
+                    {
+                    VCXTESTSTATS_W2(aFileName, "   %S", item->iTraces[e]);
+                    }
+                }
+            }
+        }
+    
+    RPointerArray<CVCXTestStatsItemSummary> summaries;
+    CleanupResetAndDestroyPushL( summaries );
+    GetActionSummariesL( summaries, ETrue );
+    
+    TBuf<256> buff;
+
+    _LIT( KVCXTESTDest, "Desc" );
+    _LIT( KVCXTESTFails, "Fails" );
+    _LIT( KVCXTESTTotal, "Total" ); 
+    _LIT( KVCXTESTMinTime, "MinTime" ); 
+    _LIT( KVCXTESTMaxTime, "MaxTime" ); 
+    _LIT( KVCXTESTAvgTime, "AvgTime");
+    _LIT( KVCXTESTTotalTime, "TotTime");
+    
+    const TInt KDescFieldLen = 32;
+    
+    // Header.
+    buff.Format( _L("%- *S %+ 6S %+ 6S %+ 6S %+ 6S %+ 6S %+ 6S"), KDescFieldLen,
+            &KVCXTESTDest, &KVCXTESTFails, &KVCXTESTTotal, &KVCXTESTMinTime, &KVCXTESTMaxTime, &KVCXTESTAvgTime, &KVCXTESTTotalTime );
+    VCXTESTSTATS_W2(aFileName, "%S", &buff);
+    
+    // Data.
+    for( TInt e = 0; e < summaries.Count(); e++ )
+        {
+        TBuf<KDescFieldLen+10> shortened;
+        if( summaries[e]->iDesc->Length() > KDescFieldLen )
+            {
+            TPtrC left = summaries[e]->iDesc->Left( KDescFieldLen/2-2 );
+            TPtrC right = summaries[e]->iDesc->Right( KDescFieldLen/2-2 );
+            shortened.Format( _L("%S .. %S"), &left, &right );
+            }
+        else
+            {
+            shortened.Copy( *summaries[e]->iDesc );
+            }        
+        
+        const TReal KXXXMillion = 1000000;
+        TReal minTime = (TReal)summaries[e]->iMinTime / KXXXMillion; 
+        TReal maxTime = (TReal)summaries[e]->iMaxTime / KXXXMillion;
+        TReal avgTime = (TReal)summaries[e]->iAvgTime / KXXXMillion;
+        TInt totalTime = (TReal)summaries[e]->iTotalTime / KXXXMillion;
+        
+        buff.Format( _L("%- *S %+ 6d %+ 6d %+ 6.2f %+ 6.2f %+ 6.2f %+ 6d"), KDescFieldLen, 
+                &shortened, summaries[e]->iFailCount, summaries[e]->iCount,  
+                minTime, maxTime, avgTime, totalTime );
+        VCXTESTSTATS_W2(aFileName, "%S", &buff);
+        }
+    
+    if( iAbortedBecauseTooManyFails )
+        {
+        VCXTESTSTATS_W1(aFileName, "Too many fails, test was aborted!");
+        }
+    
+    CleanupStack::PopAndDestroy( &summaries );
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestStatsKeeper::GetActionSummariesL
+// -----------------------------------------------------------------------------
+//
+void CVCXTestStatsKeeper::GetActionSummariesL( RPointerArray<CVCXTestStatsItemSummary>& aSummaries, TBool aFailActiveActions )
+    {
+    if( aFailActiveActions )
+        {
+        for( TInt i = 0; i < iActions.Count(); i++ )
+            {
+            CVCXTestStatsItem* item = iActions[i];
+            if( item->iIsActive )
+                {
+                item->iError = KErrUnknown;
+                item->iEndTime.HomeTime();
+                item->iIsActive = EFalse;
+                }
+            }
+        }
+    
+    for( TInt i = 0; i < iActions.Count(); i++ )
+        {
+        CVCXTestStatsItem* item = iActions[i];
+        if( item->iIsActive )
+            {
+            continue;
+            }
+        
+        CVCXTestStatsItemSummary* itemSummary( NULL );
+        
+        // Find summary item.
+        for( TInt e = 0; e < aSummaries.Count(); e++ )
+            {
+            if( item->iDesc && aSummaries[e]->iDesc && *item->iDesc == *aSummaries[e]->iDesc )
+                {
+                itemSummary = aSummaries[e];
+                break;
+                }
+            }
+
+        // Not found, create new one.
+        if( !itemSummary )
+            {
+            itemSummary = CVCXTestStatsItemSummary::NewL();
+            itemSummary->iId = item->iId;
+            itemSummary->iTotalTime = 0;
+            itemSummary->iMaxTime = -1;
+            itemSummary->iMinTime = -1;
+            if( item->iDescId ) itemSummary->iDescId = item->iDescId->AllocL();
+            itemSummary->iDesc = item->iDesc->AllocL();
+            aSummaries.Append( itemSummary );
+            }
+        
+        // Increase counts.
+        itemSummary->iCount++;
+        if( item->iError != KErrNone )
+            {
+            itemSummary->iFailCount++;
+            }
+        
+        // Add item to stats.
+        TTimeIntervalMicroSeconds runTime( 0 );
+        runTime = item->iEndTime.MicroSecondsFrom( item->iStartTime );
+        if( runTime.Int64() > 0 )
+            {
+            if( item->iError != KErrNone )
+                {
+                itemSummary->iFailTime += runTime.Int64();
+                }
+            itemSummary->iTotalTime += runTime.Int64();
+            TReal run = (TReal)runTime.Int64() / 1000000;
+
+            itemSummary->iMaxTime = 
+                ( runTime.Int64() > itemSummary->iMaxTime || itemSummary->iMaxTime < 0 ) ? runTime.Int64() : itemSummary->iMaxTime;  
+            itemSummary->iMinTime = 
+                ( runTime.Int64() < itemSummary->iMinTime || itemSummary->iMinTime < 0) ? runTime.Int64() : itemSummary->iMinTime;
+            }
+        }
+    
+    // Calc avg times and check other times.
+    for( TInt e = 0; e < aSummaries.Count(); e++ )
+        {
+        aSummaries[e]->iAvgTime = (TReal)aSummaries[e]->iTotalTime / (TReal)aSummaries[e]->iCount;
+        aSummaries[e]->iMinTime = aSummaries[e]->iMinTime < 0 ? 0 : aSummaries[e]->iMinTime;
+        aSummaries[e]->iMaxTime = aSummaries[e]->iMaxTime < 0 ? 0 : aSummaries[e]->iMaxTime;
+        }
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestStatsKeeper::DataSizeL
+// -----------------------------------------------------------------------------
+//
+TUint CVCXTestStatsKeeper::DataSizeL()
+    {
+    TUint size( 0 );
+    
+    size += iActions.Count() * sizeof( CVCXTestStatsItem );
+    
+    for( TInt i = 0; i < iActions.Count(); i++ )
+        {
+        CVCXTestStatsItem* item = iActions[i];
+        if( item->iDescId ) size += item->iDescId->Size();
+        size += item->iDesc->Size();
+        
+        size += item->iProgresses.Count() * sizeof( CVCXTestStatsItem );
+        
+        for( TInt e = 0; e < item->iProgresses.Count(); e++ )
+            {
+            size += item->iProgresses[e]->iDesc->Size();
+            }
+        
+        if( item->iTraces.Count() > 0 )
+            {
+            for( TInt e = 0; e < item->iTraces.Count(); e++ )
+                {
+                size += item->iTraces[e]->Size();
+                }
+            }
+        }
+    return size/1024;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestStatsKeeper::CheckFailsL
+// -----------------------------------------------------------------------------
+//
+void CVCXTestStatsKeeper::CheckFailsL()
+    {
+    RPointerArray<CVCXTestStatsItemSummary> summaries;
+    CleanupResetAndDestroyPushL( summaries );
+    GetActionSummariesL( summaries, EFalse );
+    
+    const TReal KVCXTestStatsKeeperMaxFailPercent = 0.33;
+    
+    for( TInt i = 0; i < summaries.Count(); i++ )
+        {
+        // Check fails only when there's some actions done. 
+        if( summaries[i]->iCount > 10 )
+            {
+            // Check if there's too many fails.
+            TReal failPercent = (TReal)summaries[i]->iFailCount / (TReal)summaries[i]->iCount;
+            
+            if( failPercent > KVCXTestStatsKeeperMaxFailPercent )
+                {
+                iAbortedBecauseTooManyFails = ETrue;
+                VCXLOGLO1("CVCXTestStatsKeeper:: Too many fails, leaving with KErrAbort");
+                User::Leave( KErrAbort );                
+                }
+            
+            const TInt64 KTest10Minutes = 1000000 * 60 * 10;
+            
+            // Check if failing cases take too long to run.
+            if( summaries[i]->iTotalTime > 0 && summaries[i]->iFailTime > KTest10Minutes ) 
+                {
+                TReal failTimePercent = (TReal)summaries[i]->iFailTime / (TReal)summaries[i]->iTotalTime;
+                if( failTimePercent > KVCXTestStatsKeeperMaxFailPercent )
+                    {
+                    VCXLOGLO1("CVCXTestStatsKeeper:: Too many fails, leaving with KErrAbort");
+                    iAbortedBecauseTooManyFails = ETrue;
+                    User::Leave( KErrAbort );
+                    }
+                }            
+            }
+        }
+    CleanupStack::PopAndDestroy( &summaries );
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestCommon/src/VCXTestTimerWait.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,99 @@
+/*
+* 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: 
+*
+*/
+
+
+//  INCLUDES
+#include <e32base.h>
+
+#include "CIptvTestActiveWait.h"
+#include "CIptvTestTimer.h"
+#include "VCXTestTimerWait.h"
+
+// -----------------------------------------------------------------------------
+// CTestTimerWait::NewL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CVCXTestTimerWait* CVCXTestTimerWait::NewL()
+    {
+    CVCXTestTimerWait* self = new (ELeave) CVCXTestTimerWait();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestTimerWait::CVCXTestTimerWait
+// -----------------------------------------------------------------------------
+//
+CVCXTestTimerWait::CVCXTestTimerWait()
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestTimerWait::ConstructL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVCXTestTimerWait::ConstructL()
+    {
+    iWait = CIptvTestActiveWait::NewL();
+    iTimer = CIptvTestTimer::NewL(*this, 0);
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestTimerWait::~CVCXTestTimerWait
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CVCXTestTimerWait::~CVCXTestTimerWait()
+    {
+    if(iTimer != NULL)
+        {
+        iTimer->CancelTimer();
+        delete iTimer;
+        iTimer = NULL;
+        }
+
+    if( iWait )
+        {
+        iWait->Stop();
+        delete iWait;
+        iWait = NULL;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestTimerWait::WaitL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVCXTestTimerWait::WaitL( TUint32 aMicroSeconds )
+    {
+    iTimer->After( aMicroSeconds );
+    iWait->Start();
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestTimerWait::TimerComplete
+// -----------------------------------------------------------------------------
+//
+void CVCXTestTimerWait::TimerComplete( TInt /* aTimerId */, TInt /* aError */ )
+    {
+    if( iWait ) iWait->Stop();
+    }
+
+// EOF
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestMyVideosCollectionClient/BWINS/VCXTestMyVideosCollectionClientu.def	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,23 @@
+EXPORTS
+	?CancelDownloadL@CVCXTestMyVideosCollectionClient@@QAEXI@Z @ 1 NONAME ; void CVCXTestMyVideosCollectionClient::CancelDownloadL(unsigned int)
+	?CompareDownloads@CVCXTestMyVideosCollectionClient@@CAHABVTVCXTestDownload@@0@Z @ 2 NONAME ; int CVCXTestMyVideosCollectionClient::CompareDownloads(class TVCXTestDownload const &, class TVCXTestDownload const &)
+	?CreateMpxCommandLC@CVCXTestMyVideosCollectionClient@@AAEPAVCMPXMedia@@HHH@Z @ 3 NONAME ; class CMPXMedia * CVCXTestMyVideosCollectionClient::CreateMpxCommandLC(int, int, int)
+	?DownloadCount@CVCXTestMyVideosCollectionClient@@QAEHXZ @ 4 NONAME ; int CVCXTestMyVideosCollectionClient::DownloadCount(void)
+	?DownloadL@CVCXTestMyVideosCollectionClient@@QAEXABVTDesC16@@I00@Z @ 5 NONAME ; void CVCXTestMyVideosCollectionClient::DownloadL(class TDesC16 const &, unsigned int, class TDesC16 const &, class TDesC16 const &)
+	?EnsureMediaFilesAreNotInUseL@CVCXTestMyVideosCollectionClient@@QAEXXZ @ 6 NONAME ; void CVCXTestMyVideosCollectionClient::EnsureMediaFilesAreNotInUseL(void)
+	?GetCountOfNewVideos@CVCXTestMyVideosCollectionClient@@QAEHH@Z @ 7 NONAME ; int CVCXTestMyVideosCollectionClient::GetCountOfNewVideos(int)
+	?GetCountOfOngoingDownloads@CVCXTestMyVideosCollectionClient@@QAEHXZ @ 8 NONAME ; int CVCXTestMyVideosCollectionClient::GetCountOfOngoingDownloads(void)
+	?GetVideoL@CVCXTestMyVideosCollectionClient@@QAEPAVCMPXMedia@@I@Z @ 9 NONAME ; class CMPXMedia * CVCXTestMyVideosCollectionClient::GetVideoL(unsigned int)
+	?LevelsL@CVCXTestMyVideosCollectionClient@@QAEHXZ @ 10 NONAME ; int CVCXTestMyVideosCollectionClient::LevelsL(void)
+	?NewL@CVCXTestMyVideosCollectionClient@@SAPAV1@PAVMVCXTestMyVideosObserver@@@Z @ 11 NONAME ; class CVCXTestMyVideosCollectionClient * CVCXTestMyVideosCollectionClient::NewL(class MVCXTestMyVideosObserver *)
+	?OpenCollectionL@CVCXTestMyVideosCollectionClient@@AAEXXZ @ 12 NONAME ; void CVCXTestMyVideosCollectionClient::OpenCollectionL(void)
+	?OpenCollectionLevelL@CVCXTestMyVideosCollectionClient@@AAEXK@Z @ 13 NONAME ; void CVCXTestMyVideosCollectionClient::OpenCollectionLevelL(unsigned long)
+	?PrintMediasL@CVCXTestMyVideosCollectionClient@@AAEXPAVCMPXMediaArray@@@Z @ 14 NONAME ; void CVCXTestMyVideosCollectionClient::PrintMediasL(class CMPXMediaArray *)
+	?RefreshCollectionL@CVCXTestMyVideosCollectionClient@@QAEXXZ @ 15 NONAME ; void CVCXTestMyVideosCollectionClient::RefreshCollectionL(void)
+	?RemoveVideoL@CVCXTestMyVideosCollectionClient@@QAEXI@Z @ 16 NONAME ; void CVCXTestMyVideosCollectionClient::RemoveVideoL(unsigned int)
+	?UpdateDownloadL@CVCXTestMyVideosCollectionClient@@AAEHPAVCMPXMedia@@@Z @ 17 NONAME ; int CVCXTestMyVideosCollectionClient::UpdateDownloadL(class CMPXMedia *)
+	?UpdateDownloadListL@CVCXTestMyVideosCollectionClient@@AAEXXZ @ 18 NONAME ; void CVCXTestMyVideosCollectionClient::UpdateDownloadListL(void)
+	?UpdateMediaArrayL@CVCXTestMyVideosCollectionClient@@AAEXXZ @ 19 NONAME ; void CVCXTestMyVideosCollectionClient::UpdateMediaArrayL(void)
+	?UpdateVideoListL@CVCXTestMyVideosCollectionClient@@AAEXH@Z @ 20 NONAME ; void CVCXTestMyVideosCollectionClient::UpdateVideoListL(int)
+	?VideoCount@CVCXTestMyVideosCollectionClient@@QAEHXZ @ 21 NONAME ; int CVCXTestMyVideosCollectionClient::VideoCount(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestMyVideosCollectionClient/EABI/VCXTestMyVideosCollectionClientu.def	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,25 @@
+EXPORTS
+	_ZTI32CVCXTestMyVideosCollectionClient @ 1 NONAME ; #<TI>#
+	_ZTV32CVCXTestMyVideosCollectionClient @ 2 NONAME ; #<VT>#
+	_ZN32CVCXTestMyVideosCollectionClient10VideoCountEv @ 3 NONAME
+	_ZN32CVCXTestMyVideosCollectionClient12PrintMediasLEP14CMPXMediaArray @ 4 NONAME
+	_ZN32CVCXTestMyVideosCollectionClient12RemoveVideoLEj @ 5 NONAME
+	_ZN32CVCXTestMyVideosCollectionClient13DownloadCountEv @ 6 NONAME
+	_ZN32CVCXTestMyVideosCollectionClient15CancelDownloadLEj @ 7 NONAME
+	_ZN32CVCXTestMyVideosCollectionClient15OpenCollectionLEv @ 8 NONAME
+	_ZN32CVCXTestMyVideosCollectionClient15UpdateDownloadLEP9CMPXMedia @ 9 NONAME
+	_ZN32CVCXTestMyVideosCollectionClient16CompareDownloadsERK16TVCXTestDownloadS2_ @ 10 NONAME
+	_ZN32CVCXTestMyVideosCollectionClient16UpdateVideoListLEi @ 11 NONAME
+	_ZN32CVCXTestMyVideosCollectionClient17UpdateMediaArrayLEv @ 12 NONAME
+	_ZN32CVCXTestMyVideosCollectionClient18CreateMpxCommandLCEiii @ 13 NONAME
+	_ZN32CVCXTestMyVideosCollectionClient18RefreshCollectionLEv @ 14 NONAME
+	_ZN32CVCXTestMyVideosCollectionClient19GetCountOfNewVideosEi @ 15 NONAME
+	_ZN32CVCXTestMyVideosCollectionClient19UpdateDownloadListLEv @ 16 NONAME
+	_ZN32CVCXTestMyVideosCollectionClient20OpenCollectionLevelLEm @ 17 NONAME
+	_ZN32CVCXTestMyVideosCollectionClient26GetCountOfOngoingDownloadsEv @ 18 NONAME
+	_ZN32CVCXTestMyVideosCollectionClient28EnsureMediaFilesAreNotInUseLEv @ 19 NONAME
+	_ZN32CVCXTestMyVideosCollectionClient4NewLEP24MVCXTestMyVideosObserver @ 20 NONAME
+	_ZN32CVCXTestMyVideosCollectionClient7LevelsLEv @ 21 NONAME
+	_ZN32CVCXTestMyVideosCollectionClient9DownloadLERK7TDesC16jS2_S2_ @ 22 NONAME
+	_ZN32CVCXTestMyVideosCollectionClient9GetVideoLEj @ 23 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestMyVideosCollectionClient/conf/VCXTestMyVideosCollectionClient.cfg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,4 @@
+
+[Test]
+title No tests for this module.
+[Endtest]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestMyVideosCollectionClient/group/VCXTestMyVideosCollectionClient.mmp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,69 @@
+/*
+* 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 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 <platform_paths.hrh>
+
+TARGET          vcxtestmyvideoscollectionclient.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E3
+
+CAPABILITY      ALL -TCB
+/* Remove comments and replace 0x00000000 with correct vendor id */
+// VENDORID     0x00000000
+/* Remove comments and replace 0x00000000 with correct secure id */
+// SECUREID     0x00000000
+
+//TARGETPATH      ?target_path
+DEFFILE         VCXTestMyVideosCollectionClient.def
+
+USERINCLUDE     ../inc 
+USERINCLUDE     ../../VCXTestCommon/inc
+
+SYSTEMINCLUDE /Epoc32/include/ecom
+APP_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH      ../src
+
+SOURCE          VCXTestMyVideosCollectionClient.cpp
+
+LIBRARY         euser.lib
+LIBRARY         stiftestinterface.lib
+LIBRARY         stiftestengine.lib
+LIBRARY         mpxcommon.lib
+LIBRARY         mpxcollectionutility.lib
+LIBRARY         estor.lib
+LIBRARY         vcxtestcommon.lib
+LIBRARY         flogger.lib
+LIBRARY         efsrv.lib
+LIBRARY         bafl.lib
+LIBRARY         edbms.lib // rdbstoredatabase
+LIBRARY         centralrepository.lib
+LIBRARY         mediatorclient.lib
+
+LIBRARY         contextengine.lib
+LIBRARY         contextplugininterface.lib
+LIBRARY         harvesterplugininterface.lib
+LIBRARY         mdeclient.lib
+LIBRARY         mdccommon.lib
+LIBRARY         harvestercommon.lib
+LIBRARY		    harvesterdata.lib
+LIBRARY         harvesterclient.lib
+
+LANG            SC
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestMyVideosCollectionClient/group/VCXTestMyVideosCollectionClient.pkg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,58 @@
+;
+; 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 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: 
+;
+;
+
+; Languages
+&EN
+
+; Package header
+#{"VCXTestMyVideosCollectionClient"},(0x101F7961),0,0,0
+
+; Localised Vendor name
+%{"Nokia EN"}
+
+; Unique Vendor name
+:"Nokia"
+
+; Logo
+; None
+
+; Package signature - Optional
+; None
+
+; Start of Package body
+
+; Condition blocks
+; None
+
+; Options list
+; None
+
+; Install files
+  "\epoc32\release\armv5\udeb\VCXTestMyVideosCollectionClient.dll"              -   "!:\Sys\Bin\VCXTestMyVideosCollectionClient.dll"
+  "..\conf\VCXTestMyVideosCollectionClient.cfg"                                 -   "c:\TestFramework\VCXTestMyVideosCollectionClient.cfg"
+  "..\init\TestFramework.ini"                                 -   "c:\TestFramework\TestFramework.ini"
+  
+; Embedded SIS
+; None
+
+; End of Package body
+
+; PKG dependencies
+; None
+
+; PKG capabilities
+; None
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestMyVideosCollectionClient/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,29 @@
+/*
+* 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 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: 
+*
+*/
+
+
+PRJ_PLATFORMS
+	DEFAULT
+
+PRJ_TESTEXPORTS
+
+PRJ_EXPORTS
+
+PRJ_TESTMMPFILES
+	VCXTestMyVideosCollectionClient.mmp
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestMyVideosCollectionClient/inc/VCXTestMyVideosCollectionClient.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,266 @@
+/*
+* 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 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 VCXTESTMYVIDEOSCOLLECTIONCLIENT_H_
+#define VCXTESTMYVIDEOSCOLLECTIONCLIENT_H_
+
+// INCLUDES
+#include <e32base.h>
+#include "VCXTestMyVideosObserver.h"
+#include "MIptvTestTimerObserver.h"
+
+#include <mpxcollectionobserver.h>
+#include <mpxmediabase.h>
+#include <vcxmyvideosdefs.h>
+
+// CONSTANTS
+const TInt KVCXTestMpxLevelRoot          = 1;
+const TInt KVCXTestMpxLevelCategory      = 2;
+const TInt KVCXTestMpxLevelVideo         = 3;
+
+// MACROS
+
+// FORWARD DECLARATIONS
+
+// DATA TYPES
+
+// CLASS DECLARATION
+class MMPXCollectionUtility;
+class CVCXTestCommon;
+class CIptvTestActiveWait;
+class CIptvTestTimer;
+
+class TVCXTestDownload
+    {
+    public:
+        TVCXTestDownload()
+            {
+            iMdsId = 0;
+            iState = 0; 
+            iDownloadId = 0;
+            iProgress = 0;
+            iDownloadError = 0;
+            iGlobalError = 0;                
+            }
+        
+        TInt32 iMdsId;
+        TUint8 iState; 
+        TUint32 iDownloadId;
+        TInt8 iProgress;
+        TInt32 iDownloadError;
+        TInt32 iGlobalError;                
+    };
+
+/**
+*  CVCXTestMyVideosCollectionClient 
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class CVCXTestMyVideosCollectionClient : public CBase, public MMPXCollectionObserver, public MIptvTestTimerObserver
+    {
+
+public:  // Constructors and destructor
+     
+     /**
+     * Two-phased constructor.
+     */
+     IMPORT_C static CVCXTestMyVideosCollectionClient* NewL( MVCXTestMyVideosObserver* aObserver );
+
+     /**
+     * Destructor.
+     */
+     virtual ~CVCXTestMyVideosCollectionClient();
+
+private:
+    
+    /**
+    * C++ default constructor.
+    */
+    CVCXTestMyVideosCollectionClient( MVCXTestMyVideosObserver* aObserver );
+
+    /**
+    * By default Symbian 2nd phase constructor is private.
+    */
+    void ConstructL( );
+    
+public: // Functions from base classes.
+    
+    /**
+    *  From MMPXCollectionObserver->MMPXCollectionMediaObserver
+    *  Handle extended media properties
+    *
+    *  @param aMedia media
+    *  @param aError error code
+    */
+    void HandleCollectionMediaL( const CMPXMedia& aMedia, TInt aError );
+
+    /**
+    *  From MMPXCollectionUtilityObserver.
+    *  Handle collection message
+    *  NOTE: only one of HandleCollectionMessage callback can be implemented
+    *
+    *  @param aMessage collection message, ownership not transferred.
+    *         Please check aMsg is not NULL before using it. If aErr is not
+    *         KErrNone, plugin might still call back with more info in the aMsg.
+    *  @param aErr system error code.
+    */
+    void HandleCollectionMessage( CMPXMessage* aMessage, TInt aError );
+
+    void HandleSingleCollectionMessageL( CMPXMessage* aMessage );
+    
+    void HandleMyVideosMessageL( CMPXMessage* aMessage );
+    void HandleGeneralMessageL( CMPXMessage* aMessage );
+    void HandleItemChangedMessageL( CMPXMessage* aMessage );
+
+    /**
+    *  From MMPXCollectionUtilityObserver.
+    *  Handles the collection entries being opened. Typically called
+    *  when client has Open()'d a folder
+    *
+    *  @param aEntries collection entries opened
+    *  @param aIndex focused entry
+    *  @param aComplete ETrue no more entries. EFalse more entries
+    *                   expected
+    *  @param aError error code
+    */
+    void HandleOpenL( const CMPXMedia& aEntries,
+                      TInt aIndex, TBool aComplete, TInt aError );
+
+    /**
+    *  From MMPXCollectionUtilityObserver.
+    *  Handles the item being opened. Typically called
+    *  when client has Open()'d an item. Client typically responds by
+    *  'playing' the item via the playlist
+    *
+    *  @param aPlaylist collection playlist
+    *  @param aError error code
+    */
+    void HandleOpenL( const CMPXCollectionPlaylist& aPlaylist, TInt aError );
+
+    /**
+    *  From MMPXCollectionUtilityObserver.
+    *  Handle completion of a asynchronous command
+    *  @param aCommandResult result of the command, NULL if error
+    *  @param aError error code
+    */
+    void HandleCommandComplete( CMPXCommand* aCommandResult,
+                                TInt aError);
+
+    /**
+    * From MIptvTestTimerObserver Handles timer completion
+    * @since
+    * @param aTimerId
+    * @param aError
+    */
+    void TimerComplete( TInt aTimerId, TInt aError );
+        
+private: // New functions.
+    
+    IMPORT_C void OpenCollectionL();
+    
+    IMPORT_C void OpenCollectionLevelL( TUint32 aIndex );
+    
+    IMPORT_C void UpdateVideoListL( TBool aComplete );
+    
+    IMPORT_C void UpdateDownloadListL();
+    
+    IMPORT_C void UpdateMediaArrayL();
+    
+    IMPORT_C void PrintMediasL( CMPXMediaArray* aMediaArray );
+    
+    IMPORT_C TBool UpdateDownloadL( CMPXMedia* aMedia );
+    
+    IMPORT_C static TBool CompareDownloads( const TVCXTestDownload& a1, const TVCXTestDownload& a2 );
+
+    IMPORT_C CMPXCommand* CreateMpxCommandLC( TInt aCommandGeneralId, TInt aMyVideosCommandId, TBool aSync );    
+    
+public: // New functions.
+    
+    IMPORT_C void RefreshCollectionL();
+
+    IMPORT_C TInt LevelsL();
+    
+    IMPORT_C TInt VideoCount();
+    
+    IMPORT_C CMPXMedia* GetVideoL( TUint aIndex );
+    
+    IMPORT_C void RemoveVideoL( TUint aIndex );
+    
+    IMPORT_C TInt DownloadCount();    
+    
+    IMPORT_C void DownloadL( const TDesC& aUrl, TUint aIapId, const TDesC& aUserName, const TDesC& aPassword );
+    
+    IMPORT_C void CancelDownloadL( TUint aIndex );
+    
+    IMPORT_C void EnsureMediaFilesAreNotInUseL();
+    
+    IMPORT_C TInt GetCountOfOngoingDownloads();
+    
+    IMPORT_C TInt GetCountOfNewVideos( TBool aIncludeDownloads );
+    
+private: // Data
+    
+    TInt iCollectionUid;
+    
+    MVCXTestMyVideosObserver* iObserver;
+    
+    TInt iOpenLevelIndex;
+    
+    // MMPXCollectionUtility.
+    MMPXCollectionUtility* iCollectionUtility;
+    
+    // Entries from MPX plugin are saved here.
+    CMPXMedia* iCurrentEntries;
+
+    // Media array for iCurrentEntries.
+    CMPXMediaArray* iMediaArray;
+    
+    // Media array for only videos.
+    CMPXMediaArray* iVideos;
+    
+    // Media array for only downloads.
+    CMPXMediaArray* iDownloads;
+    
+    // RFs.
+    RFs iFs;
+
+    // CVCXTestCommon.
+    CVCXTestCommon* iTestCommon;
+
+    // Refresh is already ongoing.
+    TBool iRefreshingCollection;
+
+    // Active wait.
+    CIptvTestActiveWait* iActiveWait;
+
+    // Timer.
+    CIptvTestTimer* iTimer;
+    
+    // IDs of new videos from collection message KMPXMessageIdItemChanged are hold here until 
+    // video list is refreshed.
+    RArray<TInt> iInsertedVideoMdsIds;
+    
+    // Information of ongoing downloads.
+    RArray<TVCXTestDownload> iOngoingDownloads;
+    
+    // Information of completed downloads.
+    RArray<TVCXTestDownload> iCompletedDownloads;
+    };
+
+#endif /* VCXTESTMYVIDEOSCOLLECTIONCLIENT_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestMyVideosCollectionClient/inc/VCXTestMyVideosObserver.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,57 @@
+/*
+* 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 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 VCXTESTMYVIDEOSOBSERVER_H_
+#define VCXTESTMYVIDEOSOBSERVER_H_
+
+// INCLUDES
+
+#include <e32base.h>
+
+// CLASS DECLARATION
+
+/**
+*  MVCXTestMyVideosObserver 
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class MVCXTestMyVideosObserver
+    {
+    public:
+        enum TVCXTestVideoEvent 
+            {
+            EVCXTestVideoGeneral, // aError = error code
+            EVCXTestVideoListRefreshed,
+            EVCXTestVideoVideoAdded, // aParam1 = video id
+            EVCXTestVideoVideoDeleted, // aParam1 = video id
+            EVCXTestVideoDownloadStarted, // aParam1 = video id
+            EVCXTestVideoDownloadPaused, // aParam1 = video id
+            EVCXTestVideoDownloadFailed, // aParam1 = video id, aError = download error.
+            EVCXTestVideoDownloadCompleted, // aParam1 = video id
+            EVCXTestVideoDownloadProgressed, // aParam1 = video id, aParam2 = download progress
+            EVCXTestVideoAllDownloadsCompleted,
+            };
+        
+        /**
+         *   
+         */
+        virtual void VideoEventL( TVCXTestVideoEvent aEvent, TUint32 aParam1, TUint32 aParam2, TInt aError ) = 0;
+    };
+
+#endif /* VCXTESTMYVIDEOSOBSERVER_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestMyVideosCollectionClient/init/TestFramework.ini	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,165 @@
+#
+# This is STIFTestFramework 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.
+
+[Engine_Defaults]
+
+TestReportMode= FullReport    # Possible values are: 
+                              # 'Summary', 'Environment', 'TestCases' or 'FullReport'
+
+CreateTestReport= YES         # Possible values: YES or NO
+
+TestReportFilePath= C:\Logs\Fusion\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT         # Possible values: TXT or HTML
+TestReportOutput= FILE        # Possible values: FILE or RDEBUG
+TestReportFileCreationMode= APPEND # Possible values: OVERWRITE or APPEND
+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\VCXTestMyVideosCollectionClient.cfg
+[End_Module]
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework 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)'#' 
+
+CreateLogDirectories= YES    # Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML         # Possible values: TXT or HTML
+#EmulatorOutput= FILE         # Possible values: FILE or RDEBUG
+
+#HardwareBasePath=  C:\
+#HardwareFormat= TXT			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+FileCreationMode= APPEND  # 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
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestMyVideosCollectionClient/src/VCXTestMyVideosCollectionClient.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,1397 @@
+/*
+* 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 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: 
+*
+*/
+
+
+// INCLUDES
+#include "VCXTestMyVideosCollectionClient.h"
+#include "VCXTestCommon.h"
+#include "VCXTestLog.h"
+#include "CIptvTestTimer.h"
+#include "CIptvTestActiveWait.h"
+
+#include <mpxcollectionutility.h>
+#include <mpxmediacontainerdefs.h>
+#include <mpxmediageneraldefs.h>
+#include <mpxmessagegeneraldefs.h>
+#include <mpxcollectionmessagedefs.h>
+#include <mpxcollectionpath.h>
+#include <mpxmessage2.h>
+#include <mpxcollectionmessage.h>
+#include <mpxmessagecontainerdefs.h>
+#include <mpxmediabase.h>
+#include <mpxcommandgeneraldefs.h>
+#include <mpxcollectioncommanddefs.h>
+
+#include <vcxmyvideosdefs.h>
+#include <vcxmyvideosuids.h>
+
+// CONSTANTS
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CVCXTestMyVideosCollectionClient::NewL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CVCXTestMyVideosCollectionClient* CVCXTestMyVideosCollectionClient::NewL( MVCXTestMyVideosObserver* aObserver )
+    {
+    CVCXTestMyVideosCollectionClient* self = new (ELeave) CVCXTestMyVideosCollectionClient( aObserver );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestMyVideosCollectionClient::~CVCXTestMyVideosCollectionClient
+// -----------------------------------------------------------------------------
+//
+CVCXTestMyVideosCollectionClient::~CVCXTestMyVideosCollectionClient()
+     {
+     VCXLOGLO1(">>>CVCXTestMyVideosCollectionClient::~CVCXTestMyVideosCollectionClient");
+     if( iTimer )
+         {
+         iTimer->CancelTimer();
+         delete iTimer;
+         iTimer = NULL;
+         }
+
+     if( iCollectionUtility )
+         {
+         iCollectionUtility->Close();
+         }
+     iCollectionUtility = NULL;
+     
+     delete iCurrentEntries;
+     iCurrentEntries = NULL;
+     
+     if( iMediaArray )
+         {
+         iMediaArray->Reset();
+         delete iMediaArray;
+         iMediaArray = NULL;
+         }
+
+     iFs.Close();
+
+     iActiveWait->Stop();
+     delete iActiveWait;
+     iActiveWait = NULL;
+     
+     delete iTestCommon;
+     iTestCommon = NULL;
+
+     if( iDownloads )
+         {
+         iDownloads->Reset();
+         delete iDownloads;
+         iDownloads = NULL;
+         }
+     
+     if( iVideos ) 
+         {
+         iVideos->Reset();
+         delete iVideos;
+         iVideos = NULL;
+         }
+     
+     iInsertedVideoMdsIds.Reset();
+     
+     iOngoingDownloads.Reset();
+     
+     iCompletedDownloads.Reset();
+     
+     VCXLOGLO1("<<<CVCXTestMyVideosCollectionClient::~CVCXTestMyVideosCollectionClient");
+     }
+
+ // -----------------------------------------------------------------------------
+ // CVCXTestMyVideosCollectionClient::CVCXTestMyVideosCollectionClient
+ // -----------------------------------------------------------------------------
+ //
+CVCXTestMyVideosCollectionClient::CVCXTestMyVideosCollectionClient( MVCXTestMyVideosObserver* aObserver )
+ : iObserver( aObserver )
+    {
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestMyVideosCollectionClient::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CVCXTestMyVideosCollectionClient::ConstructL( )
+    {
+    VCXLOGLO1(">>>CVCXTestMyVideosCollectionClient::ConstructL");
+    User::LeaveIfError( iFs.Connect() );
+    
+    iCollectionUtility = MMPXCollectionUtility::NewL( this, KMcModeIsolated );
+
+    iTestCommon = CVCXTestCommon::NewL();
+    iActiveWait = CIptvTestActiveWait::NewL();
+    iTimer = CIptvTestTimer::NewL( *this, 0 );
+    
+    iCollectionUid = KVcxUidMyVideosMpxCollection;
+    iOpenLevelIndex = -1;
+    
+    OpenCollectionL();
+    
+    VCXLOGLO1("<<<CVCXTestMyVideosCollectionClient::ConstructL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestMyVideosCollectionClient::OpenCollectionL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVCXTestMyVideosCollectionClient::OpenCollectionL( )
+    {
+    VCXLOGLO1(">>>CVCXTestMyVideosCollectionClient::OpenCollectionL =----->");
+    
+    TInt levels = LevelsL();
+    
+    if( levels == KVCXTestMpxLevelRoot || levels == 0 )
+        {
+        VCXLOGLO1("CVCXTestMyVideosCollectionClient:: Opening collection.");
+        // Open collection.
+        CMPXCollectionPath* path = CMPXCollectionPath::NewL();
+        CleanupStack::PushL( path );
+        path->AppendL( iCollectionUid );
+        iCollectionUtility->Collection().OpenL( *path );
+        CleanupStack::PopAndDestroy( path );
+        }
+    
+    VCXLOGLO1("<<<CVCXTestMyVideosCollectionClient::OpenCollectionL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestMyVideosCollectionClient::OpenCollectionLevelL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVCXTestMyVideosCollectionClient::OpenCollectionLevelL( TUint32 aIndex )
+    {
+    VCXLOGLO1(">>>CVCXTestMyVideosCollectionClient::OpenLevelL =----->");
+    
+    TInt levels = LevelsL();
+    
+    if( levels == KVCXTestMpxLevelCategory )
+        {
+        VCXLOGLO1("CVCXTestMyVideosCollectionClient:: Opening category.");
+        // Open all videos.
+        iOpenLevelIndex = aIndex;
+        iCollectionUtility->Collection().OpenL( iOpenLevelIndex );
+        }
+
+    VCXLOGLO1("<<<CVCXTestMyVideosCollectionClient::OpenLevelL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestMyVideosCollectionClient::RefreshCollectionL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVCXTestMyVideosCollectionClient::RefreshCollectionL( )
+    {
+    VCXLOGLO1(">>>CVCXTestMyVideosCollectionClient::RefreshCollectionL =----->");
+    
+    TInt levels = LevelsL();
+    
+    if( levels >= KVCXTestMpxLevelCategory )
+        {
+        VCXLOGLO1("CVCXTestMyVideosCollectionClient:: Refreshing collection.");
+        // Just refresh
+        iCollectionUtility->Collection().OpenL();
+        }
+    
+    VCXLOGLO1("<<<CVCXTestMyVideosCollectionClient::RefreshCollectionL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestMyVideosCollectionClient::LevelsL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CVCXTestMyVideosCollectionClient::LevelsL()
+    {
+    if ( iCollectionUtility )
+        {
+        CMPXCollectionPath* path = iCollectionUtility->Collection().PathL();
+        TInt levels = path->Levels();
+        delete path;
+        VCXLOGLO2("CVCXTestMyVideosCollectionClient:: levels: %d", levels);
+        return levels;
+        }    
+    return KErrNotFound;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestMyVideosCollectionClient::UpdateVideoListL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVCXTestMyVideosCollectionClient::UpdateVideoListL( TBool aComplete )
+    {
+    if( !iCurrentEntries ) return;
+
+    VCXLOGLO1(">>>CVCXTestMyVideosCollectionClient::UpdateVideoListL =----->");
+    
+    // Create new list.    
+    delete iVideos;
+    iVideos = CMPXMediaArray::NewL();        
+
+    TBool isCategoryList( EFalse );
+    
+    // Add videos to the list.
+    
+    for( TInt i = 0; i < iMediaArray->Count(); i++ )
+        {
+        CMPXMedia* media = (*iMediaArray)[i];
+        
+        TMPXItemId itemId = *(media->Value<TMPXItemId>( KMPXMediaGeneralId ));
+        
+        if( itemId.iId2 != 0 )
+            {
+            isCategoryList = ETrue;
+            }
+        
+        // Add non downloads and completed downloads to the list.
+        if( media->IsSupported( KVcxMediaMyVideosDownloadState ) )
+            {
+            TUint8 state = 0; 
+            state = media->ValueTObjectL<TUint8>( KVcxMediaMyVideosDownloadState );
+            
+            if( state == EVcxMyVideosDlStateDownloaded )
+                {
+                iVideos->AppendL( *media );
+                VCXLOGLO3("CVCXTestMyVideosCollectionClient::UpdateVideoListL media is completed download, id: %d, state: %d", itemId.iId1, state);
+                }
+            else
+                {
+                VCXLOGLO3("CVCXTestMyVideosCollectionClient::UpdateVideoListL media is downloading, id: %d, state: %d", itemId.iId1, state);
+                }
+            }
+        else
+            {
+            VCXLOGLO2("CVCXTestMyVideosCollectionClient::UpdateVideoListL media is video, id: %d", itemId.iId1);
+            iVideos->AppendL( *media );
+            
+            // Send add video event if the video has been just added.
+            if( iInsertedVideoMdsIds.Find( itemId.iId1 ) != -1 )
+                {
+                iObserver->VideoEventL( MVCXTestMyVideosObserver::EVCXTestVideoVideoAdded, itemId.iId1, 0, KErrNone );
+                }
+            }
+        }
+    
+    iInsertedVideoMdsIds.Reset();
+    
+    if( isCategoryList )
+        {
+        VCXLOGLO2("CVCXTestMyVideosCollectionClient::UpdateVideoListL Categories (%d): =----->", iVideos->Count());
+        }
+    else
+        {
+        VCXLOGLO2("CVCXTestMyVideosCollectionClient::UpdateVideoListL Videos (%d): =----->", iVideos->Count());
+        }
+    
+    PrintMediasL( iVideos );
+        
+    if( aComplete )
+        {
+        if( !isCategoryList )
+            {
+            iObserver->VideoEventL( MVCXTestMyVideosObserver::EVCXTestVideoListRefreshed, 0, 0, KErrNone );
+            }
+        
+        // Open category.
+        if( LevelsL() == KVCXTestMpxLevelCategory ) 
+            {
+            OpenCollectionLevelL( 0 );
+            }        
+        }
+    
+    VCXLOGLO1("<<<CVCXTestMyVideosCollectionClient::UpdateVideoListL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestMyVideosCollectionClient::UpdateDownloadListL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVCXTestMyVideosCollectionClient::UpdateDownloadListL()
+    {
+    if( LevelsL() != KVCXTestMpxLevelVideo || !iCurrentEntries ) return;
+
+    VCXLOGLO1(">>>CVCXTestMyVideosCollectionClient::UpdateDownloadListL =----->");
+    
+    TBool ongoingDownloadsChanged( EFalse );    
+    TInt iCompletedDownloadsBefore = iCompletedDownloads.Count();
+    
+    TInt downloadCountBefore( 0 );
+    if( iDownloads )
+        {
+        downloadCountBefore = iDownloads->Count(); 
+        }
+    
+    // Create new list.
+    delete iDownloads;
+    iDownloads = NULL;
+    iDownloads = CMPXMediaArray::NewL();
+    
+    // Add videos to the list.    
+    for( TInt i = 0; i < iMediaArray->Count(); i++ )
+        {
+        CMPXMedia* media = (*iMediaArray)[i];
+        
+        TMPXItemId itemId = *(media->Value<TMPXItemId>( KMPXMediaGeneralId ));
+        
+        // Add only downloads which are not complete to the list.
+        if( media->IsSupported( KVcxMediaMyVideosDownloadState ) )
+            {
+            TUint8 state = 0; 
+            state = media->ValueTObjectL<TUint8>( KVcxMediaMyVideosDownloadState );
+            
+            VCXLOGLO3("CVCXTestMyVideosCollectionClient::UpdateDownloadListL: media mpx id: %d, state: %d", itemId.iId1, state);
+            
+            if( state != EVcxMyVideosDlStateDownloaded )
+                {
+                iDownloads->AppendL( *media );
+                }
+
+            if( UpdateDownloadL( media ) )
+                {
+                ongoingDownloadsChanged = ETrue;
+                }
+            }
+        else
+            {
+            VCXLOGLO2("CVCXTestMyVideosCollectionClient::UpdateDownloadListL: media mpx id %d is not a download.", itemId.iId1);
+            }
+        }
+    
+    VCXLOGLO4("CVCXTestMyVideosCollectionClient::UpdateDownloadListL: ongoing downloads changed: %d, completed downloads before: %d and now: %d", ongoingDownloadsChanged, iCompletedDownloadsBefore, iCompletedDownloads.Count());
+    
+    // Update video list if more downloads have been completed.
+    if( iCompletedDownloadsBefore != iCompletedDownloads.Count() )
+        {
+        UpdateVideoListL( ETrue );
+        
+        // Inform client about new video(s).
+        TInt newCompletedDownloads = iCompletedDownloads.Count() - iCompletedDownloadsBefore;
+        
+        for( TInt i = 0; i < newCompletedDownloads; i++ )
+            {
+            TInt index = ( iCompletedDownloads.Count() - 1 ) - i;
+            TInt32 mdsId = iCompletedDownloads[ index ].iMdsId;
+            iObserver->VideoEventL( MVCXTestMyVideosObserver::EVCXTestVideoVideoAdded, mdsId, 0, KErrNone );
+            }
+        }
+    
+    // Print downloads if they have changed.
+    if( ongoingDownloadsChanged || downloadCountBefore != iDownloads->Count())
+        {
+        VCXLOGLO3("CVCXTestMyVideosCollectionClient:: Downloads (%d, ongoing: %d): =----->", iDownloads->Count(), iOngoingDownloads.Count());
+        PrintMediasL( iDownloads );
+        
+        if( iOngoingDownloads.Count() == 0 && downloadCountBefore > 0 )
+            {
+            iObserver->VideoEventL( MVCXTestMyVideosObserver::EVCXTestVideoAllDownloadsCompleted, 0, 0, KErrNone );
+            }
+        }
+    
+    // Start download update timer if there's downloads.
+    if( iDownloads->Count() > 0 )
+        {
+        iTimer->After( 1000000 );
+        }
+    else
+        {
+        iTimer->Cancel();
+        }
+    
+    VCXLOGLO1("<<<CVCXTestMyVideosCollectionClient::UpdateDownloadListL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestMyVideosCollectionClient::UpdateMediaArrayL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVCXTestMyVideosCollectionClient::UpdateMediaArrayL() 
+    {
+    if( !iCurrentEntries ) return;
+    
+    // Reset old medias.
+    if( iMediaArray )
+        {
+        iMediaArray->Reset();
+        delete iMediaArray;
+        iMediaArray = NULL;
+        }
+    
+    // Create copies of the current medias.    
+    iMediaArray = CMPXMediaArray::NewL();
+    
+    CMPXMediaArray* medias = iCurrentEntries->Value<CMPXMediaArray>( KMPXMediaArrayContents );
+    
+    // Make copies of the medias.
+    for( TInt i=0; i<medias->Count(); i++ )
+        {
+        CMPXMedia* media(NULL);
+        media = (*medias)[i];
+
+        TBool isOnRom( EFalse );
+        if( media->IsSupported( KMPXMediaGeneralUri ) )
+            {
+            const TDesC& url = media->ValueText( KMPXMediaGeneralUri );
+            if( url.FindC( _L("z:" ) ) != KErrNotFound )
+                {
+                isOnRom = ETrue;
+                }
+            }
+        
+        if( !isOnRom )
+            {
+            iMediaArray->AppendL( *media );
+            }
+        }
+    
+    VCXLOGLO2("CVCXTestMyVideosCollectionClient::UpdateMediaArrayL: iMediaCount: %d", iMediaArray->Count());
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestMyVideosCollectionClient::PrintMediasL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVCXTestMyVideosCollectionClient::PrintMediasL( CMPXMediaArray* aMediaArray ) 
+    {
+    for( TInt i = 0; i < aMediaArray->Count(); i++ )
+        {
+        CMPXMedia* media = (*aMediaArray)[i];
+
+        TMPXItemId itemId = *(media->Value<TMPXItemId>( KMPXMediaGeneralId ));
+        
+        // Category.
+        if( itemId.iId2 != 0 )
+            {
+            TBuf<256> title;
+            if( media->IsSupported( KMPXMediaGeneralTitle ) )
+                {
+                title = media->ValueText( KMPXMediaGeneralTitle );
+                }
+
+            TInt itemCount(0);
+            TInt newItemCount(0);
+            TBuf<256> newItemName;
+            if( media->IsSupported( KVcxMediaMyVideosCategoryNewItemName ) )
+                {
+                newItemName = media->ValueText( KVcxMediaMyVideosCategoryNewItemName );
+                }
+            if( media->IsSupported( KVcxMediaMyVideosCategoryItemCount ) )
+                 {
+                 itemCount = *(media->Value<TUint32>( KVcxMediaMyVideosCategoryItemCount ));
+                 }
+            if( media->IsSupported( KVcxMediaMyVideosCategoryNewItemCount ) )
+                 {
+                 newItemCount = *(media->Value<TUint32>( KVcxMediaMyVideosCategoryNewItemCount ));
+                 }
+            VCXLOGLO5("CVCXTestMyVideosCollectionClient: title: %S, medias: %d, new: %d, new media: %S", &title, itemCount, newItemCount, &newItemName);
+            }
+        // Media.
+        else
+            {
+            HBufC* pathBuff = NULL;
+            HBufC* titleBuff = NULL;        
+            TInt size(0);
+            TInt origin(-1);
+    
+            // Download specific.
+            HBufC* urlBuff = NULL;        
+            TUint8 state = 0; 
+            TInt8 progress = 0;
+            TUint32 downloadId = 0;
+            TInt32 downloadError = 0;
+            TInt32 globalError = 0;
+        
+            if( media->IsSupported( KVcxMediaMyVideosDownloadState ) )
+                {
+                state = media->ValueTObjectL<TUint8>( KVcxMediaMyVideosDownloadState );
+                }
+            
+            if( media->IsSupported( KVcxMediaMyVideosDownloadId ) )
+                {
+                downloadId = media->ValueTObjectL<TUint32>( KVcxMediaMyVideosDownloadId );
+                }
+
+            if( media->IsSupported( KMPXMediaGeneralUri ) )
+                {
+                const TDesC& url = media->ValueText( KMPXMediaGeneralUri );
+                pathBuff = url.AllocL();
+                CleanupStack::PushL( pathBuff );
+                }
+        
+            if( media->IsSupported( KMPXMediaGeneralTitle ) )
+                {
+                const TDesC& title = media->ValueText( KMPXMediaGeneralTitle );
+                titleBuff = title.AllocL();
+                CleanupStack::PushL( titleBuff );
+                }
+        
+            if( media->IsSupported( KMPXMediaGeneralSize ) )
+                 {
+                 size = *(media->Value<TInt>( KMPXMediaGeneralSize ));
+                 }
+            
+            if( media->IsSupported( KVcxMediaMyVideosOrigin ) )
+                {
+                origin = *(media->Value<TUint>( KVcxMediaMyVideosOrigin ));
+                }
+            
+            if( media->IsSupported( KVcxMediaMyVideosRemoteUrl ) )
+                {
+                const TDesC& url = media->ValueText( KVcxMediaMyVideosRemoteUrl );
+                urlBuff = url.AllocL();
+                CleanupStack::PushL( urlBuff );
+                }
+            
+            if( media->IsSupported( KVcxMediaMyVideosDownloadProgress ) )
+                {
+                progress = media->ValueTObjectL<TInt8>( KVcxMediaMyVideosDownloadProgress );
+                }
+            
+            if( media->IsSupported( KVcxMediaMyVideosDownloadError ) )
+                {
+                downloadError = media->ValueTObjectL<TInt32>( KVcxMediaMyVideosDownloadError );
+                }
+        
+            if( media->IsSupported( KVcxMediaMyVideosDownloadGlobalError ) )
+                {
+                globalError = media->ValueTObjectL<TInt32>( KVcxMediaMyVideosDownloadGlobalError );
+                }
+            
+            VCXLOGLO3("CVCXTestMyVideosCollectionClient: iId1: %d, iId2: %d", itemId.iId1, itemId.iId2 );
+            VCXLOGLO5("CVCXTestMyVideosCollectionClient: title: %S, size: %d, origin: %d, path: %S", titleBuff, size, origin, pathBuff);
+            if( media->IsSupported( KVcxMediaMyVideosDownloadState ) )        
+                {
+                VCXLOGLO2("CVCXTestMyVideosCollectionClient: url: %S", urlBuff);
+                VCXLOGLO4("CVCXTestMyVideosCollectionClient: state: %d, progress: %d, dl id: %d", state, progress, downloadId);
+                if( downloadError != KErrNone || globalError != KErrNone )
+                    {
+                    VCXLOGLO3("CVCXTestMyVideosCollectionClient: downloadError: %d, globalError: %d, dl id: %d", downloadError, globalError);
+                    }
+                }
+            
+            if( urlBuff )
+                {
+                CleanupStack::PopAndDestroy( urlBuff );
+                }
+            if( titleBuff )
+                {                
+                CleanupStack::PopAndDestroy( titleBuff );
+                }
+            if( pathBuff )
+                {                       
+                CleanupStack::PopAndDestroy( pathBuff );
+                }
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestMyVideosCollectionClient::UpdateDownloadL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CVCXTestMyVideosCollectionClient::UpdateDownloadL( CMPXMedia* aMedia )
+    {
+    if( !aMedia->IsSupported( KVcxMediaMyVideosDownloadState ) || 
+        !aMedia->IsSupported( KVcxMediaMyVideosDownloadId ) )
+        {
+        return EFalse;
+        }
+
+    TMPXItemId itemId = *(aMedia->Value<TMPXItemId>( KMPXMediaGeneralId ));
+    
+    TUint8 state = 0; 
+    TUint32 downloadId = 0;
+    TInt8 progress = 0;
+    TInt32 downloadError = 0;
+    TInt32 globalError = 0;
+    
+    state = aMedia->ValueTObjectL<TUint8>( KVcxMediaMyVideosDownloadState );
+    
+    downloadId = aMedia->ValueTObjectL<TUint32>( KVcxMediaMyVideosDownloadId );
+    
+    if( aMedia->IsSupported( KVcxMediaMyVideosDownloadProgress ) )
+        {
+        progress = aMedia->ValueTObjectL<TInt8>( KVcxMediaMyVideosDownloadProgress );
+        }
+    
+    if( aMedia->IsSupported( KVcxMediaMyVideosDownloadError ) )
+        {
+        downloadError = aMedia->ValueTObjectL<TInt32>( KVcxMediaMyVideosDownloadError );
+        }      
+    
+    if( aMedia->IsSupported( KVcxMediaMyVideosDownloadGlobalError ) )
+        {
+        globalError = aMedia->ValueTObjectL<TInt32>( KVcxMediaMyVideosDownloadGlobalError );
+        }
+    
+    if( downloadError == KErrNone ) 
+        {
+        downloadError = globalError;
+        }    
+    
+    TVCXTestDownload download;
+    download.iMdsId = itemId.iId1;
+    download.iState = state;
+    download.iDownloadId = downloadId;
+    download.iProgress = progress;
+    download.iDownloadError = downloadError;
+    download.iGlobalError = globalError;    
+    
+    TInt index = iOngoingDownloads.Find( download, CVCXTestMyVideosCollectionClient::CompareDownloads );
+    
+    TBool changesMade( EFalse );
+    
+    switch( state )
+        {
+        case EVcxMyVideosDlStateDownloading:
+            {
+            // It's new download if not found, otherwise check for progress.
+            if( index == KErrNotFound )
+                {
+                iOngoingDownloads.AppendL( download );
+                iObserver->VideoEventL( 
+                        MVCXTestMyVideosObserver::EVCXTestVideoDownloadStarted, itemId.iId1, 0, KErrNone );
+                changesMade = ETrue;
+                }
+            else
+                {
+                if( progress >= iOngoingDownloads[index].iProgress+10 || 
+                   ( progress == 100 && iOngoingDownloads[index].iProgress != 100 ) )
+                    {
+                    iOngoingDownloads.Remove( index );
+                    iOngoingDownloads.AppendL( download );
+                    iObserver->VideoEventL( 
+                            MVCXTestMyVideosObserver::EVCXTestVideoDownloadProgressed, itemId.iId1, progress, KErrNone );
+                    changesMade = ETrue;
+                    }
+                }
+            }
+            break;
+            
+        case EVcxMyVideosDlStateFailed:
+            {
+            // Update only if state has changed.
+            if( index != KErrNotFound && iOngoingDownloads[index].iState != state )
+                {
+                iOngoingDownloads.Remove( index );
+                iObserver->VideoEventL( 
+                        MVCXTestMyVideosObserver::EVCXTestVideoDownloadFailed, itemId.iId1, 0, downloadError );
+                changesMade = ETrue;
+                }            
+            }
+            break;
+            
+        case EVcxMyVideosDlStatePaused:
+            {
+            // Update only if state has changed.
+            if( index != KErrNotFound && iOngoingDownloads[index].iState != state )
+                {
+                iOngoingDownloads.Remove( index );
+                iObserver->VideoEventL( 
+                        MVCXTestMyVideosObserver::EVCXTestVideoDownloadPaused, itemId.iId1, 0, KErrNone );
+                changesMade = ETrue;
+                }            
+            }
+            break;
+            
+        case EVcxMyVideosDlStateDownloaded:
+            {
+            // Remove from ongoing dl list.
+            if( index != KErrNotFound )
+                {
+                iOngoingDownloads.Remove( index );
+                iObserver->VideoEventL( 
+                        MVCXTestMyVideosObserver::EVCXTestVideoDownloadCompleted, itemId.iId1, 0, KErrNone );
+                changesMade = ETrue;
+                }
+            
+            // Add to completed dl list.
+            index = iCompletedDownloads.Find( download, CVCXTestMyVideosCollectionClient::CompareDownloads );
+            if( index == KErrNotFound )
+                {
+                iCompletedDownloads.AppendL( download );
+                }
+            }
+            break;
+        
+        default: 
+            break;
+        }
+    
+    return changesMade;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestMyVideosCollectionClient::CompareDownloads
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CVCXTestMyVideosCollectionClient::CompareDownloads( const TVCXTestDownload& a1, const TVCXTestDownload& a2 )
+    {
+    return a1.iMdsId == a2.iMdsId;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestMyVideosCollectionClient::CreateMpxCommandLC
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CMPXCommand* CVCXTestMyVideosCollectionClient::CreateMpxCommandLC( TInt aCommandGeneralId, TInt aMyVideosCommandId, TBool aSync )
+    {
+    CMPXCommand* cmd = CMPXCommand::NewL();
+    CleanupStack::PushL( cmd );
+
+    cmd->SetTObjectValueL( KMPXCommandGeneralId, aCommandGeneralId );
+    if( aCommandGeneralId == KVcxCommandIdMyVideos )
+        {
+        cmd->SetTObjectValueL( KVcxMediaMyVideosCommandId, aMyVideosCommandId );
+        }
+
+    cmd->SetTObjectValueL( KMPXCommandGeneralDoSync, aSync );
+
+    // If async command then set transaction ID.
+    if( !aSync )
+        {
+        cmd->SetTObjectValueL( KVcxMediaMyVideosTransactionId, 0 );
+        }
+
+    cmd->SetTObjectValueL( KMPXCommandGeneralCollectionId, iCollectionUid );
+
+    return cmd;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestMyVideosCollectionClient::VideoCount
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CVCXTestMyVideosCollectionClient::VideoCount() 
+    {
+    if( !iVideos )
+        {
+        return 0;
+        }
+    return iVideos->Count();
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestMyVideosCollectionClient::GetVideoL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CMPXMedia* CVCXTestMyVideosCollectionClient::GetVideoL( TUint aIndex )
+    {   
+    CMPXMedia* media = NULL;
+        
+    if( !iVideos || iVideos->Count() <= aIndex )
+        {
+        User::Leave( KErrArgument );
+        }
+    
+    media = (*iVideos)[aIndex];
+    
+    return media;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::RemoveVideoL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVCXTestMyVideosCollectionClient::RemoveVideoL( TUint aIndex )
+    {
+    VCXLOGLO1(">>>CVCXTestMyVideosCollectionClient::RemoveVideoL");
+
+    if( !iVideos || iVideos->Count() <= aIndex )
+        {
+        User::Leave( KErrNotReady );
+        }
+    
+    CMPXMedia* media = NULL;
+
+    media = (*iVideos)[aIndex];
+    TMPXItemId itemId = *(media->Value<TMPXItemId>( KMPXMediaGeneralId ));
+    
+    VCXLOGLO2("CVCXTestMyVideosCollectionClient::RemoveVideoL: mpxId: %d", itemId.iId1);
+        
+    CMPXCommand* cmd = CreateMpxCommandLC( KMPXCommandIdCollectionRemoveMedia, 0, EFalse );
+    cmd->SetTObjectValueL( KMPXMediaGeneralId, itemId );
+    iCollectionUtility->Collection().CommandL( *cmd );
+    CleanupStack::PopAndDestroy( cmd );
+
+    VCXLOGLO1("<<<CVCXTestMyVideosCollectionClient::RemoveVideoL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestMyVideosCollectionClient::DownloadCount
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CVCXTestMyVideosCollectionClient::DownloadCount() 
+    {
+    if( !iDownloads )
+        {
+        return 0;
+        }
+    return iDownloads->Count();
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::DownloadL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVCXTestMyVideosCollectionClient::DownloadL( const TDesC& aUrl, TUint aIapId, const TDesC& aUserName, const TDesC& aPassword )
+    {
+    VCXLOGLO1(">>>CVCXTestMyVideosCollectionClient::DownloadL");
+    
+    CMPXCommand* cmd = CreateMpxCommandLC( KVcxCommandIdMyVideos, KVcxCommandMyVideosStartDownload, EFalse );
+    
+    CMPXMedia* startDownloadReq(NULL);
+    startDownloadReq = CMPXMedia::NewL();
+    CleanupStack::PushL( startDownloadReq );
+
+    startDownloadReq->SetTObjectValueL( KVcxMediaMyVideosIapId, aIapId );
+    startDownloadReq->SetTObjectValueL( KMPXMediaGeneralFlags, EVcxMyVideosServiceHasReadOnlyIap | EVcxMyVideosSilent );
+    startDownloadReq->SetTextValueL( KMPXMediaGeneralTitle, _L("testdownload") );
+    startDownloadReq->SetTextValueL( KVcxMediaMyVideosRemoteUrl, aUrl );
+    startDownloadReq->SetTextValueL( KVcxMediaMyVideosUsername, aUserName);
+    startDownloadReq->SetTextValueL( KVcxMediaMyVideosPassword, aPassword);
+
+    cmd->SetCObjectValueL<CMPXMedia>( KMPXCommandColAddMedia, startDownloadReq );
+    iCollectionUtility->Collection().CommandL( *cmd );
+    
+    CleanupStack::PopAndDestroy( startDownloadReq );
+    CleanupStack::PopAndDestroy( cmd );
+    
+    VCXLOGLO1("<<<CVCXTestMyVideosCollectionClient::DownloadL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestMyVideosCollectionClient::EnsureMediaFilesAreNotInUseL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVCXTestMyVideosCollectionClient::EnsureMediaFilesAreNotInUseL()
+    {
+    if( iMediaArray->Count() <= 0 ) return;
+    
+    TInt retries = 4;
+    RFile file;
+    TInt error( KErrInUse );
+    
+    // Check all files that they are not in use, retry few times.
+    while( --retries >= 0 && error == KErrInUse ) 
+        {
+        for( TInt i=0; i<iMediaArray->Count(); i++ )
+            {
+            CMPXMedia* media = (*iMediaArray)[i];
+            
+            if( media->IsSupported( KMPXMediaGeneralUri ) )
+                {
+                const TDesC& localFilePath = media->ValueText( KMPXMediaGeneralUri );
+
+                error = file.Open( iFs, localFilePath, EFileShareExclusive );
+                if( error == KErrInUse )
+                    {
+                    User::After( 1000000 * 60 ); // Wait a minute
+                    break;
+                    }
+                file.Close();
+                }
+            }
+        }
+        
+    if( error != KErrNone && error != KErrNotFound )
+        {
+        VCXLOGLO2("CVCXTestMyVideosCollectionClient::EnsureMediaFilesAreNotInUseL: error: %d", error);
+        User::Leave( error );
+        }        
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestMyVideosCollectionClient::GetCountOfOngoingDownloads
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CVCXTestMyVideosCollectionClient::GetCountOfOngoingDownloads()
+    {
+    return iOngoingDownloads.Count();
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestMyVideosCollectionClient::GetCountOfNewVideos
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CVCXTestMyVideosCollectionClient::GetCountOfNewVideos( TBool aIncludeDownloads )
+    {
+    TInt count( 0 );
+    
+    if( iVideos )
+        {
+        for( TInt i = 0; i < iVideos->Count(); i++ )
+            {
+            CMPXMedia* media = (*iVideos)[i];
+            if( media->IsSupported( KMPXMediaGeneralFlags ) )
+                {
+                TUint value = *(*media).Value<TUint>( KMPXMediaGeneralFlags );
+                if( value & EVcxMyVideosVideoNew )
+                    {
+                    count++;
+                    }
+                }
+            }
+        }
+    
+    if( aIncludeDownloads && iDownloads )
+        {
+        for( TInt i = 0; i < iDownloads->Count(); i++ )
+            {
+            CMPXMedia* media = (*iDownloads)[i];
+            if( media->IsSupported( KMPXMediaGeneralFlags ) )
+                {
+                TUint value = *(*media).Value<TUint>( KMPXMediaGeneralFlags );
+                if( value & EVcxMyVideosVideoNew )
+                    {
+                    count++;
+                    }
+                }
+            }
+        }    
+    
+    return count;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::CancelDownloadL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CVCXTestMyVideosCollectionClient::CancelDownloadL( TUint aIndex )
+    {
+    VCXLOGLO1(">>>CVCXTestMyVideosCollectionClient::CancelDownloadL");
+
+    if( !iDownloads || iDownloads->Count() <= aIndex )
+        {
+        User::Leave( KErrNotReady );
+        }
+    
+    CMPXMedia* media = NULL;
+
+    media = (*iDownloads)[aIndex];
+    TMPXItemId itemId = *(media->Value<TMPXItemId>( KMPXMediaGeneralId ));
+    
+    VCXLOGLO2("CVCXTestMyVideosCollectionClient::CancelDownloadL: mpxId: %d", itemId.iId1);
+    
+    if( media->IsSupported( KVcxMediaMyVideosDownloadId ) && media->IsSupported( KMPXMediaGeneralUri ) )
+        {
+        TUint32 downloadId = 0;    
+        downloadId = media->ValueTObjectL<TUint32>( KVcxMediaMyVideosDownloadId );
+        HBufC* path = media->ValueText( KMPXMediaGeneralUri ).AllocL();
+        CleanupStack::PushL( path );
+        
+        CMPXCommand* cmd = CreateMpxCommandLC( KVcxCommandIdMyVideos, KVcxCommandMyVideosCancelDownload, EFalse );        
+        
+        CMPXMedia* cancelDownloadReq = CMPXMedia::NewL();
+        CleanupStack::PushL( cancelDownloadReq );
+
+        cancelDownloadReq->SetTObjectValueL<TMPXItemId>( KMPXMediaGeneralId, TMPXItemId ( itemId.iId1, 0 ) );
+        cancelDownloadReq->SetTObjectValueL<TUint32>( KVcxMediaMyVideosDownloadId, downloadId );
+        cancelDownloadReq->SetTextValueL( KMPXMediaGeneralUri, *path );
+
+        cmd->SetCObjectValueL<CMPXMedia>( KMPXCommandColAddMedia, cancelDownloadReq );
+        
+        CleanupStack::PopAndDestroy( cancelDownloadReq );
+        iCollectionUtility->Collection().CommandL( *cmd );
+        CleanupStack::PopAndDestroy( cmd );
+        CleanupStack::PopAndDestroy( path );
+        }
+    else
+        {    
+        User::Leave( KErrArgument );
+        }
+    
+    VCXLOGLO1("<<<CVCXTestMyVideosCollectionClient::RemoveMediaL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestMyVideosCollectionClient::HandleCollectionMediaL
+// -----------------------------------------------------------------------------
+//
+void CVCXTestMyVideosCollectionClient::HandleCollectionMediaL(const CMPXMedia& aMedia,
+                                        TInt aError)
+    {
+    VCXLOGLO1(">>>CVCXTestMyVideosCollectionClient::HandleCollectionMediaL");
+    VCXLOGLO2("CVCXTestMyVideosCollectionClient:: aError: %d", aError);
+
+    VCXLOGLO1("<<<CVCXTestMyVideosCollectionClient::HandleCollectionMediaL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestMyVideosCollectionClient::HandleCollectionMessage
+// -----------------------------------------------------------------------------
+//
+void CVCXTestMyVideosCollectionClient::HandleCollectionMessage( CMPXMessage* aMessage, TInt aError )
+    {
+    VCXLOGLO1(">>>CVCXTestMyVideosCollectionClient::HandleCollectionMessage");
+    VCXLOGLO2("CVCXTestMyVideosCollectionClient:: aError: %d", aError);
+
+    if( !aMessage ) return;
+    
+    if( aError == KErrNone )
+        {
+        TInt err( KErrNone );
+
+        TMPXMessageId messageId = *(aMessage->Value<TMPXMessageId>( KMPXMessageGeneralId ));
+        
+        TInt myVideosCmd = -1;
+        if ( messageId == KVcxCommandIdMyVideos )
+            {
+            myVideosCmd = aMessage->ValueTObjectL<TInt>( KVcxMediaMyVideosCommandId );
+            }
+
+        // Handle single message.
+        if ( myVideosCmd != KVcxMessageMyVideosMessageArray )
+            {
+            TRAP( err, HandleSingleCollectionMessageL( aMessage ) );
+            }
+        else
+            {
+            // Expand and handle the messages in My Videos message array.
+            if( err == KErrNone && aMessage->IsSupported( KMPXMessageArrayContents ) )
+                {
+                const CMPXMessageArray* messageArray =
+                        aMessage->Value<CMPXMessageArray>(KMPXMessageArrayContents);
+
+                TInt count = messageArray->Count();
+
+                for( TInt i = 0; i < count; i++ )
+                    {
+                    TRAP( err, HandleSingleCollectionMessageL( (*messageArray)[i] ) );
+                    if( err != KErrNone )
+                        {
+                        VCXLOGLO2("CVCXTestMyVideosCollectionClient:: Leave at handling, %d =----->", err);
+                        }
+                    }
+                }
+            }
+        
+        if( err != KErrNone )
+            {
+            aError = err;
+            }
+        }
+    
+    if( aError != KErrNone )
+        {
+        iObserver->VideoEventL( MVCXTestMyVideosObserver::EVCXTestVideoGeneral, 0, 0, aError );
+        }
+    
+    VCXLOGLO1("<<<CVCXTestMyVideosCollectionClient::HandleCollectionMessage");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestMyVideosCollectionClient::HandleSingleCollectionMessageL
+// -----------------------------------------------------------------------------
+//
+void CVCXTestMyVideosCollectionClient::HandleSingleCollectionMessageL( CMPXMessage* aMessage )
+    {    
+    VCXLOGLO1(">>>CVCXTestMyVideosCollectionClient::HandleSingleCollectionMessageL");
+    
+    TMPXMessageId messageId = *(aMessage->Value<TMPXMessageId>( KMPXMessageGeneralId ));
+
+    // Check that message is for open collection.
+    if( aMessage->IsSupported( KMPXMessageCollectionId ) )
+        {
+        TUid uid( *(aMessage->Value<TUid>( KMPXMessageCollectionId )) );
+        if( TUid::Uid( iCollectionUid ) != uid )
+            {
+            VCXLOGLO1("CVCXTestMyVideosCollectionClient:: wrong collection id");
+            VCXLOGLO1("<<<CVCXTestMyVideosCollectionClient::HandleSingleCollectionMessage");
+            return;
+            }
+        }
+    
+    switch( messageId )
+        {
+        case KVcxCommandIdMyVideos:
+            {
+            VCXLOGLO1("CVCXTestMyVideosCollectionClient:: KVcxCommandIdMyVideos =----->");
+            HandleMyVideosMessageL( aMessage );
+            }
+            break;
+            
+        case KMPXMessageGeneral:
+            {
+            VCXLOGLO1("CVCXTestMyVideosCollectionClient:: KMPXMessageGeneral =----->");
+            HandleGeneralMessageL( aMessage );
+            }
+            break;
+        
+        case KMPXMessageIdItemChanged:        
+            {
+            VCXLOGLO1("CVCXTestMyVideosCollectionClient:: KMPXMessageIdItemChanged =----->");
+            HandleItemChangedMessageL( aMessage );
+            }
+            break;
+            
+        default:
+            VCXLOGLO1("CVCXTestMyVideosCollectionClient:: unknown message ID");
+            break;
+        }
+        
+    VCXLOGLO1("<<<CVCXTestMyVideosCollectionClient::HandleSingleCollectionMessageL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestMyVideosCollectionClient::HandleMyVideosMessageL
+// -----------------------------------------------------------------------------
+//
+void CVCXTestMyVideosCollectionClient::HandleMyVideosMessageL( CMPXMessage* aMessage )
+    {   
+    if ( !aMessage->IsSupported( KVcxMediaMyVideosCommandId ) ) 
+        {
+        return;
+        }
+    
+    TInt myVideosCommandId = *(aMessage->Value<TInt>( KVcxMediaMyVideosCommandId ));
+    
+    VCXLOGLO2("CVCXTestMyVideosCollectionClient:: KVcxMediaMyVideosCommandId: %d", myVideosCommandId);
+        
+    switch ( myVideosCommandId )
+        {
+        case KVcxMessageMyVideosDeleteResp:
+        case KVcxMessageMyVideosDeleteStarted:
+        case KVcxMessageMyVideosCopyResp:
+        case KVcxMessageMyVideosMoveResp:
+        case KVcxMessageMyVideosMoveOrCopyStarted:
+        case KVcxMessageMyVideosGetMediasByMpxIdResp:
+            {
+            }
+            break;
+            
+        /** 
+         * This is received when list is open already and the list contains new items
+         */
+        case KVcxMessageMyVideosItemsAppended:
+            {
+            VCXLOGLO1("CVCXTestMyVideosCollectionClient:: KVcxMessageMyVideosItemsAppended =----->");
+
+            if( LevelsL() < KVCXTestMpxLevelCategory )
+                {
+                VCXLOGLO1("CVCXTestMyVideosCollectionClient:: Category list or video list not open, ignoring.");
+                break;
+                }
+
+            UpdateMediaArrayL();
+            UpdateVideoListL( EFalse  );
+            UpdateDownloadListL();
+            // Wait list complete event and do nothing here.
+            }
+            break;
+            
+            
+        /**
+        * Collection sends this message when media list fetching has ended
+        * and no more KVcxMessageMyVideosItemsAppended will be sent.
+        * If client has fetched items with KVcxCommandMyVideosGetMediasByMpxId,
+        * it should refetch items when this event arrives.
+        */
+        case KVcxMessageMyVideosListComplete:
+            {
+            VCXLOGLO1("CVCXTestMyVideosCollectionClient:: KVcxMessageMyVideosListComplete =----->");
+            
+            UpdateMediaArrayL();
+            UpdateVideoListL( ETrue );
+            UpdateDownloadListL();
+            }
+            break;
+            
+        default:
+            break;
+        }   
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestMyVideosCollectionClient::HandleGeneralMessageL
+// -----------------------------------------------------------------------------
+//
+void CVCXTestMyVideosCollectionClient::HandleGeneralMessageL( CMPXMessage* aMessage )
+    {
+    TInt event( *(aMessage->Value<TInt>( KMPXMessageGeneralEvent )) );
+    TInt type( *(aMessage->Value<TInt>( KMPXMessageGeneralType )) );
+    TInt data( *(aMessage->Value<TInt>( KMPXMessageGeneralData )) );
+
+    VCXLOGLO4("CVCXTestMyVideosCollectionClient:: event: %d, type: %d, data: %d", event, type, data);
+    
+    if ( event == TMPXCollectionMessage::EPathChanged && data == EMcContainerOpened ) // 4 & 1
+        {
+        RefreshCollectionL();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestMyVideosCollectionClient::HandleItemChangedMessageL
+// -----------------------------------------------------------------------------
+//
+void CVCXTestMyVideosCollectionClient::HandleItemChangedMessageL( CMPXMessage* aMessage )
+    {   
+    TMPXItemId itemId( *aMessage->Value<TMPXItemId>(KMPXMessageMediaGeneralId) );
+    VCXLOGLO3("CVCXTestMyVideosCollectionClient:: Item Id1: %d, Id2: %d", itemId.iId1, itemId.iId2);
+
+    // Check the IDs for categories
+    if( itemId.iId2 != 0 && ( itemId.iId1 != KVcxMvcCategoryIdAll &&
+            itemId.iId1 != KVcxMvcCategoryIdDownloads &&
+            itemId.iId1 != KVcxMvcCategoryIdTvRecordings &&
+            itemId.iId1 != KVcxMvcCategoryIdCaptured &&
+            itemId.iId1 != KVcxMvcCategoryIdOther ) )
+        {
+        VCXLOGLO1("CVCXTestMyVideosCollectionClient:: Error. INVALID ITEM ID.");
+        return;
+        }
+
+    // Skip message if it's for category but not for the open category.
+    if( itemId.iId2 > 0 && itemId.iId1 != iOpenLevelIndex )
+        {
+        VCXLOGLO1("CVCXTestMyVideosCollectionClient:: Not for open category. Skip.");
+        return;
+        }
+
+    TBool refreshNeeded( EFalse );
+    
+    TMPXChangeEventType changeEvent( *aMessage->Value<TMPXChangeEventType>( KMPXMessageChangeEventType ) );
+    
+    switch( changeEvent )
+        {
+        case EMPXItemInserted:
+            {
+            VCXLOGLO1("CVCXTestMyVideosCollectionClient:: changeEvent EMPXItemInserted =----->");
+            refreshNeeded = ETrue;
+            
+            iInsertedVideoMdsIds.Append( itemId.iId1 );
+            }
+            break;
+    
+        case EMPXItemDeleted:
+            {
+            VCXLOGLO1("CVCXTestMyVideosCollectionClient:: changeEvent EMPXItemDeleted =----->");
+            refreshNeeded = ETrue;
+
+            iObserver->VideoEventL( MVCXTestMyVideosObserver::EVCXTestVideoVideoDeleted, itemId.iId1, 0, KErrNone );
+            }
+            break;
+    
+        case EMPXItemModified:
+            {
+            VCXLOGLO1("CVCXTestMyVideosCollectionClient:: changeEvent EMPXItemModified =----->");
+            
+            if ( aMessage->IsSupported( KVcxMediaMyVideosInt32Value ) )
+                {
+                TInt32 extraInfo = aMessage->ValueTObjectL<TInt32>( KVcxMediaMyVideosInt32Value );
+                if ( extraInfo == EVcxMyVideosVideoListOrderChanged )
+                    {
+                    VCXLOGLO1("CVcxMyVideosCollectionTester:: Received EVcxMyVideosVideoListOrderChanged");
+                    refreshNeeded = ETrue;
+                    }
+                }
+            }
+            break;
+    
+        default:
+            break;
+        }    
+    
+    if( refreshNeeded )
+        {
+        RefreshCollectionL();
+        }
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestMyVideosCollectionClient::HandleOpenL
+// -----------------------------------------------------------------------------
+//
+void CVCXTestMyVideosCollectionClient::HandleOpenL( const CMPXMedia& aEntries,
+        TInt aIndex, TBool aComplete, TInt aError )
+    {
+    VCXLOGLO1(">>>CVCXTestMyVideosCollectionClient::HandleOpenL");
+    VCXLOGLO2("CVCXTestMyVideosCollectionClient:: aError: %d", aError);
+
+    if( aError == KErrNone )
+       {
+       delete iCurrentEntries;
+       iCurrentEntries = NULL;
+       iCurrentEntries = CMPXMedia::NewL( aEntries );
+       }
+    
+    UpdateMediaArrayL();
+    UpdateVideoListL( aComplete );
+    UpdateDownloadListL();
+    
+    if( aError != KErrNone )
+        {
+        iObserver->VideoEventL( MVCXTestMyVideosObserver::EVCXTestVideoGeneral, 0, 0, aError );
+        }    
+    
+    VCXLOGLO1("<<<CVCXTestMyVideosCollectionClient::HandleOpenL");
+    }    
+
+// -----------------------------------------------------------------------------
+// CVCXTestMyVideosCollectionClient::HandleOpenL
+// -----------------------------------------------------------------------------
+//
+void CVCXTestMyVideosCollectionClient::HandleOpenL( const CMPXCollectionPlaylist& aPlaylist, 
+        TInt aError )
+    {
+    VCXLOGLO1(">>>CVCXTestMyVideosCollectionClient::HandleOpenL (playlist)");
+    
+    if( aError != KErrNone )
+        {
+        iObserver->VideoEventL( MVCXTestMyVideosObserver::EVCXTestVideoGeneral, 0, 0, aError );
+        }
+    
+    VCXLOGLO1("<<<CVCXTestMyVideosCollectionClient::HandleOpenL (playlist)");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestMyVideosCollectionClient::HandleCommandComplete
+// -----------------------------------------------------------------------------
+//
+void CVCXTestMyVideosCollectionClient::HandleCommandComplete( CMPXCommand* /* aCommandResult */,
+        TInt aError)
+    {
+    VCXLOGLO1(">>>CVCXTestMyVideosCollectionClient::HandleCommandComplete");
+    VCXLOGLO2("CVCXTestMyVideosCollectionClient:: aError: %d", aError);
+
+    if( aError != KErrNone )
+        {
+        iObserver->VideoEventL( MVCXTestMyVideosObserver::EVCXTestVideoGeneral, 0, 0, aError );
+        }
+    
+    VCXLOGLO1("<<<CVCXTestMyVideosCollectionClient::HandleCommandComplete");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXTestMyVideosCollectionClient::TimerComplete
+// -----------------------------------------------------------------------------
+//
+void CVCXTestMyVideosCollectionClient::TimerComplete(TInt /* aTimerId */, TInt aError)
+    {
+    VCXLOGLO1(">>>CVCXTestMyVideosCollectionClient::TimerComplete");
+    VCXLOGLO2("CVCXTestMyVideosCollectionClient:: aError: %d", aError);
+
+    UpdateDownloadListL();
+    
+    VCXLOGLO1("<<<CVCXTestMyVideosCollectionClient::TimerComplete");
+    }
+
+// EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestUtilModule/Bwins/VCXTestUtilModuleu.def	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * LibEntryL(class CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestUtilModule/EABI/VCXTestUtilModuleu.def	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,34 @@
+EXPORTS
+	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
+	_ZN14CVCXTestCommon10VerifyDataER7TDesC16RN19CIptvTestVerifyData13TVerifyResultE @ 2 NONAME ABSENT
+	_ZN14CVCXTestCommon11GetFileSizeER7TDesC16Rm @ 3 NONAME ABSENT
+	_ZN14CVCXTestCommon11SetTimeZoneER7TDesC16 @ 4 NONAME ABSENT
+	_ZN14CVCXTestCommon13CreateBadIapLER7TDesC16 @ 5 NONAME ABSENT
+	_ZN14CVCXTestCommon13GetPSPropertyE4TUidjR6TDes16 @ 6 NONAME ABSENT
+	_ZN14CVCXTestCommon13GetPSPropertyE4TUidjRi @ 7 NONAME ABSENT
+	_ZN14CVCXTestCommon13SetPSPropertyE4TUidjRK7TDesC16 @ 8 NONAME ABSENT
+	_ZN14CVCXTestCommon13SetPSPropertyE4TUidji @ 9 NONAME ABSENT
+	_ZN14CVCXTestCommon13SetSystemTimeE5TTime @ 10 NONAME ABSENT
+	_ZN14CVCXTestCommon14GetIapNameByIdER6TDes16m @ 11 NONAME ABSENT
+	_ZN14CVCXTestCommon15GetIapIdByNameLERK7TDesC16Rm @ 12 NONAME ABSENT
+	_ZN14CVCXTestCommon15GetIapIdByTypeLENS_16TIptvTestIapTypeERmi @ 13 NONAME ABSENT
+	_ZN14CVCXTestCommon15WriteVerifyDataER7TDesC1611TRefByValueIKS0_Ez @ 14 NONAME ABSENT
+	_ZN14CVCXTestCommon15WriteVerifyDataER7TDesC16S1_ @ 15 NONAME ABSENT
+	_ZN14CVCXTestCommon16CreateVerifyDataER7TDesC16i @ 16 NONAME ABSENT
+	_ZN14CVCXTestCommon16CreateVideoFileLEN21CIptvTestVideoCreator18TIptvTestVideoTypeER7TDesC16i @ 17 NONAME ABSENT
+	_ZN14CVCXTestCommon17CreateVideoFilesLEN21CIptvTestVideoCreator18TIptvTestVideoTypeER7TDesC16iR13RPointerArrayI7HBufC16E @ 18 NONAME ABSENT
+	_ZN14CVCXTestCommon17DeleteDummyFilesLEi @ 19 NONAME ABSENT
+	_ZN14CVCXTestCommon18ParseIntFromStringERiR7TDesC16 @ 20 NONAME ABSENT
+	_ZN14CVCXTestCommon18SetDriveFreeSpaceLEij @ 21 NONAME ABSENT
+	_ZN14CVCXTestCommon20EnsureFileIsNotInUseERK7TPtrC16 @ 22 NONAME ABSENT
+	_ZN14CVCXTestCommon22AdvanceSystemTimeHoursEi @ 23 NONAME ABSENT
+	_ZN14CVCXTestCommon22EnableVerifyTimestampsEi @ 24 NONAME ABSENT
+	_ZN14CVCXTestCommon24AdvanceSystemTimeMinutesEi @ 25 NONAME ABSENT
+	_ZN14CVCXTestCommon24AdvanceSystemTimeSecondsEi @ 26 NONAME ABSENT
+	_ZN14CVCXTestCommon4NewLEv @ 27 NONAME ABSENT
+	_ZN14CVCXTestCommon7ListDirERK7TDesC16i @ 28 NONAME ABSENT
+	_ZN14CVCXTestCommon9GetIapIdLERK7TDesC16Rm @ 29 NONAME ABSENT
+	_ZN14CVCXTestCommon9PrintIapsEv @ 30 NONAME ABSENT
+	_ZTI14CVCXTestCommon @ 31 NONAME ABSENT ; #<TI>#
+	_ZTV14CVCXTestCommon @ 32 NONAME ABSENT ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestUtilModule/conf/VCXTestUtilModule.cfg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,4 @@
+
+[Test]
+title No tests for this module.
+[Endtest]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestUtilModule/group/VCXTestUtilModule.mmp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,56 @@
+/*
+* 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 <platform_paths.hrh>
+
+TARGET          vcxtestutilmodule.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E3
+
+#if defined(EKA2)
+CAPABILITY      CAP_GENERAL_DLL
+VENDORID        0x101FB657
+SECUREID        0x102073DB
+#endif
+
+DEFFILE         VCXTestUtilModule.def
+
+SOURCEPATH      ../src
+SOURCE          IptvTestUtilModule.cpp
+SOURCE          IptvTestUtilModuleBlocks.cpp
+
+USERINCLUDE     ../inc
+USERINCLUDE     ../../VCXTestCommon/inc
+
+APP_LAYER_SYSTEMINCLUDE
+
+LIBRARY         euser.lib
+LIBRARY         stiftestinterface.lib
+LIBRARY         commdb.lib
+LIBRARY         bafl.lib
+LIBRARY         esock.lib
+LIBRARY         flogger.lib
+LIBRARY         downloadmgr.lib
+LIBRARY         efsrv.lib
+LIBRARY			tzclient.lib
+LIBRARY         ezip.lib
+LIBRARY         vcxtestcommon.lib
+
+LANG            SC
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestUtilModule/group/VCXTestUtilModule.pkg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,58 @@
+;
+; 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 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: 
+;
+;
+
+; Languages
+&EN
+
+; Package header
+#{"VCXTestUtilModule"},(0x101F7961),0,0,0
+
+; Localised Vendor name
+%{"Nokia EN"}
+
+; Unique Vendor name
+:"Nokia"
+
+; Logo
+; None
+
+; Package signature - Optional
+; None
+
+; Start of Package body
+
+; Condition blocks
+; None
+
+; Options list
+; None
+
+; Install files
+  "\epoc32\release\armv5\udeb\VCXTestUtilModule.dll"              -   "!:\Sys\Bin\VCXTestUtilModule.dll"
+  "..\conf\VCXTestUtilModule.cfg"                                 -   "c:\TestFramework\VCXTestUtilModule.cfg"
+  "..\init\TestFramework.ini"                                     -   "c:\TestFramework\TestFramework.ini"
+  
+; Embedded SIS
+; None
+
+; End of Package body
+
+; PKG dependencies
+; None
+
+; PKG capabilities
+; None
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestUtilModule/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,33 @@
+/*
+* 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: 
+*
+*/
+
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+
+PRJ_EXPORTS
+
+PRJ_TESTEXPORTS
+
+PRJ_MMPFILES
+
+PRJ_TESTMMPFILES
+VCXTestUtilModule.mmp
+
+//  End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestUtilModule/inc/IptvTestUtilModule.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,455 @@
+/*
+* 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 IPTVTESTUTILMODULE_H
+#define IPTVTESTUTILMODULE_H
+
+//  INCLUDES
+#include <f32file.h>
+#include <BAUTILS.H>
+
+#include <StifLogger.h>
+#include <TestScripterInternal.h>
+#include <StifTestModule.h>
+
+#include "MTestUtilConnectionObserver.h"
+#include "MTestUtilDownloadObserver.h"
+#include "MIptvTestTimerObserver.h"
+
+// CONSTANTS
+const TInt KConnectionTimerId = 500;
+
+// Logging path
+_LIT( KIptvTestUtilModuleLogPath, "\\logs\\testframework\\IptvTestUtilModule\\" );
+// Log file
+_LIT( KIptvTestUtilModuleLogFile, "IptvTestUtilModule.txt" );
+
+// MACROS
+
+// FUNCTION PROTOTYPES
+//?type ?function_name(?arg_list);
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+class CIptvTestUtilModule;
+class CTestUtilConnection;
+class CTestUtilConnectionWaiter;
+class CIptvTestDownloadManager;
+class CIptvTestTimer;
+class CIptvTestMobilecrashWatcher;
+class CIptvTestUtilALR;
+class CVCXTestCommon;
+class CZipFile;
+
+// DATA TYPES
+//enum ?declaration
+//typedef ?declaration
+//extern ?data_type;
+
+// CLASS DECLARATION
+
+/**
+*  CIptvTestUtilModule test class for STIF Test Framework TestScripter.
+*  This class should have no depencies to Video Center code.
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+NONSHARABLE_CLASS(CIptvTestUtilModule) : public CScriptBase, public MTestUtilConnectionObserver, public MTestUtilDownloadObserver, public MIptvTestTimerObserver
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CIptvTestUtilModule* NewL( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CIptvTestUtilModule();
+
+    public: // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    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 );
+
+    	void ConnectionCreated();
+    	void ConnectionClosed();
+    	void ConnectionFailed();
+	    void ConnectionAlreadyExists();
+	    void ConnectionTimeout();
+
+	    void DownloadFinished(TInt aError);
+
+	    void TimerComplete(TInt aTimerId, TInt aError);
+
+    protected:  // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    protected:  // Functions from base classes
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CIptvTestUtilModule( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        // Prohibit copy constructor if not deriving from CBase.
+        // ?classname( const ?classname& );
+        // Prohibit assigment operator if not deriving from CBase.
+        // ?classname& operator=( const ?classname& );
+
+        /**
+        * Frees all resources allocated from test methods.
+        * @since ?Series60_version
+        */
+        void Delete();
+
+        /**
+        * Test methods are listed below.
+        */
+
+        /**
+        * Creates MobilecrashesWatcher
+        * @return Symbian OS error code.
+        */
+        virtual TInt CreateMobilecrashWatcherL( CStifItemParser& aItem );
+
+        /**
+        * Checks if there's any new mobilecrashes since the watcher was created.
+        * @param aItem Script line containing IptvTest Case ID. Required.
+        * @return KErrNone if there's no new mobilecrash files, else KErrAbort.
+        */
+        virtual TInt CheckMobilecrashesL( CStifItemParser& aItem );
+
+        /**
+        * Checks if there's any mobilecrash files.
+        * @param aItem Script line containing IptvTest Case ID. Required.
+        * @return KErrNone if there's no mobilecrash files, else KErrAbort.
+        */
+        virtual TInt CheckMobilecrashesZeroToleranceL( CStifItemParser& aItem );
+
+        /**
+        * Writes line ">>> Case start: <parameters>" using Iptv logging methods.
+        * @param aItem Script line containing IptvTest Case ID. Required.
+        * @return Symbian OS error code.
+        */
+        virtual TInt IptvLogCaseStart( CStifItemParser& aItem );
+
+        /**
+        * Writes line "<<< Case end." using Iptv logging methods.
+        * @param
+        * @return Symbian OS error code.
+        */
+        virtual TInt IptvLogCaseEnd( CStifItemParser& aItem );
+
+        /**
+        * Writes line using Iptv logging methods.
+        * @param aItem Text which is written into the log. Not required.
+        * @return Symbian OS error code.
+        */
+        virtual TInt IptvLogWrite( CStifItemParser& aItem );
+
+        /**
+        * Opens a socket to a specified IAP.
+        * ASYNC.
+        * @param aItem IAP name.
+        * @return Symbian OS error code.
+        */
+        virtual TInt ConnectL( CStifItemParser& aItem );
+
+        /**
+        * Attached to open connection specified by IAP.
+        * SYNC.
+        * @param aItem IAP name.
+        * @return Symbian OS error code.
+        */
+        virtual TInt AttachL( CStifItemParser& aItem );
+
+        /**
+        * Disconnects from the currently open connection.
+        * SYNC.
+        * @param none
+        * @return Symbian OS error code.
+        */
+        virtual TInt DisconnectL( CStifItemParser& aItem );
+
+        /**
+        * Terminates the currently open connection, i.e. closes it immediately.
+        * The connection can be opened by this module or other application.
+        * SYNC.
+        * @param none
+        * @return Symbian OS error code.
+        */
+        virtual TInt TerminateConnectionL( CStifItemParser& aItem );
+
+        /**
+        * Starts observing the connection until it's activated, Signals test script.
+        * @param IAP name
+        * @return Symbian OS error code.
+        */
+		virtual TInt WaitForConnectionActivityL( CStifItemParser& aItem );
+
+        /**
+        * Starts observing the connection until it's closed, Signals test script.
+        * @param IAP name
+        * @return Symbian OS error code.
+        */
+		virtual TInt WaitUntilConnectionIsClosed(CStifItemParser& aItem );
+
+		/**
+        * Start a download.
+        */
+		virtual TInt DownloadL( CStifItemParser& aItem );
+
+        /**
+        * Stop downloads.
+        */
+		virtual TInt StopDownloadsL( CStifItemParser& aItem );
+
+        /**
+        * Advance system time for 1 second.
+        */
+		virtual TInt AdvanceSystemTime1Second( CStifItemParser& aItem );
+
+        /**
+        * Advance system time for X seconds.
+        */
+        virtual TInt AdvanceSystemTimeSeconds( CStifItemParser& aItem );
+
+        /**
+        * Advance system time for X minute.
+        */
+        virtual TInt AdvanceSystemTimeMinutes( CStifItemParser& aItem );
+
+        /**
+        * Advance system time for X hour.
+        */
+        virtual TInt AdvanceSystemTimeHours( CStifItemParser& aItem );
+
+        /**
+        * Advance system time for specified number of days.
+        */
+		virtual TInt AdvanceSystemTimeDays(CStifItemParser& aItem );
+
+        /**
+        * Set the system time.
+        * Must be in format YYYYMMDD:HHMMSS.MMMMMM (First day / month is 0)
+        */
+		virtual TInt SetSystemTime(CStifItemParser& aItem );
+
+        /**
+        * Set the system time within the ongoing day.
+        *
+        */
+		virtual TInt SetSystemTimeToday(CStifItemParser& aItem );
+
+        /**
+        * Set the system timezone.
+        */
+		virtual TInt SetTimeZone(CStifItemParser& aItem );
+
+        /**
+        * Sets the default iap id value to cenrep.
+        */
+		virtual TInt SetDefaultIapCenRepL(CStifItemParser& aItem );
+		
+        /**
+        * Removes the used destination cenrep value.
+        */
+        virtual TInt DeleteUsedDestinationCenRepL( CStifItemParser& aItem );
+
+        /**
+        * Set the used destination cenrep value for Video Center & IPTV_Engine.
+        */
+        virtual TInt SetUsedDestinationL( CStifItemParser& aItem );
+
+        /**
+        * Create new destination (SNAP)
+        */
+        virtual TInt CreateDestinationL( CStifItemParser& aItem );
+
+        /**
+        * Delete a destination (SNAP)
+        */
+        virtual TInt DeleteDestinationL( CStifItemParser& aItem );
+
+        /**
+        * Copy existing connection method to defined SNAP.
+        */
+        virtual TInt CopyMethodL( CStifItemParser& aItem );
+
+        /**
+        * Delete a connection method.
+        */
+        virtual TInt DeleteMethodL( CStifItemParser& aItem );
+
+        /**
+        * Set priority for a connection method.
+        */
+        virtual TInt SetMethodPriorityL( CStifItemParser& aItem );
+
+        /**
+        * Delete the destination when classes destructor is run.
+        */
+        virtual TInt DeleteDestinationAfterwardsL( CStifItemParser& aItem );
+
+        /**
+        * Sets string attribute for connection method.
+        */
+        virtual TInt SetConnectionMethodStringAttributeL( CStifItemParser& aItem );
+
+        /**
+        * Sets integer attribute for connection method.
+        */
+        virtual TInt SetConnectionMethodIntAttributeL( CStifItemParser& aItem );
+
+        /**
+        * Sets boolean attribute for connection method.
+        */
+        virtual TInt SetConnectionMethodBoolAttributeL( CStifItemParser& aItem );
+
+        /**
+         * CreateFileL
+         */
+        virtual TInt CreateFileL( CStifItemParser& aItem );
+
+        /**
+         * DeleteFileL
+         */
+        virtual TInt DeleteFileL( CStifItemParser& aItem );
+
+        /*
+         * CreateFolderL
+         */
+        virtual TInt CreateFolderL( CStifItemParser& aItem );
+
+        /*
+         * DeleteFolderL
+         */
+        virtual TInt DeleteFolderL( CStifItemParser& aItem );
+
+        /*
+         * LockFileL
+         */
+        virtual TInt LockFileL( CStifItemParser& aItem );
+
+        /*
+         * UnlockFileL
+         */
+        virtual TInt UnlockFileL( CStifItemParser& aItem );
+
+        /*
+         * ExtractFile
+         */
+        virtual TInt ExtractFileL( CStifItemParser& aItem );
+
+        /*
+         * FileExistsInZip
+         */
+        virtual TBool FileExistsInZip( CZipFile* aZipFile, const TDesC& aFileName );
+
+        /**
+        * Prints IAPs from commdb to debug output.
+        */
+		virtual void PrintIAPs();
+
+        /**
+        * Gets IAp by name.
+        */
+        virtual void GetIap(TDesC& aIapName, TUint32& aIapId);
+
+        /**
+        * Sets free space on drive.
+        * @param aDriveLetter
+        * @param aDesiredSpace, bytes
+        */
+        virtual TInt SetDriveFreeSpaceL( CStifItemParser& aItem );
+
+    public:     // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    protected:  // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    private:    // Data
+
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+        // Reserved pointer for future extension
+        //TAny* iReserved;
+
+		CTestUtilConnection* iConnect;
+		CTestUtilConnectionWaiter* iConnectionWaiter;
+		TInt iRetryCount;
+		CIptvTestDownloadManager* iDownload;
+		CIptvTestTimer* iTimer;
+		CIptvTestMobilecrashWatcher* iIptvTestMobilecrashWatcher;
+		HBufC* iObservedServicePath;
+		RPointerArray<HBufC> iObservedFiles;
+		RArray<TTime> iFileModifiedDates;
+
+		RPointerArray<HBufC> iToBeDeletedDestinations;
+
+        CIptvTestUtilALR* iTestUtilALR;
+        RFs iFs;
+        RFile iLockedFile;
+        TBool iFileIsLocked;
+
+        TBool iCaseStarted;
+
+        CVCXTestCommon* iTestCommon;
+
+        TBool iDummyFilesCreated;
+    };
+
+#endif      // IPTVTESTUTILMODULE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestUtilModule/init/TestFramework.ini	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,165 @@
+#
+# This is STIFTestFramework 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.
+
+[Engine_Defaults]
+
+TestReportMode= FullReport    # Possible values are: 
+                              # 'Summary', 'Environment', 'TestCases' or 'FullReport'
+
+CreateTestReport= YES         # Possible values: YES or NO
+
+TestReportFilePath= C:\Logs\Fusion\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT         # Possible values: TXT or HTML
+TestReportOutput= FILE        # Possible values: FILE or RDEBUG
+TestReportFileCreationMode= APPEND # Possible values: OVERWRITE or APPEND
+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\VCXTestUtilModule.cfg
+[End_Module]
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework 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)'#' 
+
+CreateLogDirectories= YES    # Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML         # Possible values: TXT or HTML
+#EmulatorOutput= FILE         # Possible values: FILE or RDEBUG
+
+#HardwareBasePath=  C:\
+#HardwareFormat= TXT			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+FileCreationMode= APPEND  # 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
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestUtilModule/src/IptvTestUtilModule.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,129 @@
+/*
+* 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 <Stiftestinterface.h>
+#include "IptvTestUtilModule.h"
+
+#include <commdb.h>
+
+#include "VCXTestCommon.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::CIptvTestUtilModule
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CIptvTestUtilModule::CIptvTestUtilModule(
+    CTestModuleIf& aTestModuleIf ):
+        CScriptBase( aTestModuleIf )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CIptvTestUtilModule::ConstructL()
+    {
+    iLog = CStifLogger::NewL( KIptvTestUtilModuleLogPath,
+                          KIptvTestUtilModuleLogFile,
+                          CStifLogger::ETxt,
+                          CStifLogger::EFile,
+                          EFalse );
+    User::LeaveIfError( iFs.Connect() );
+    iTestCommon = CVCXTestCommon::NewL();
+    TRAP_IGNORE( iTestCommon->DeleteDummyFilesL( EDriveC ) );
+    TRAP_IGNORE( iTestCommon->DeleteDummyFilesL( EDriveE ) );
+    TRAP_IGNORE( iTestCommon->DeleteDummyFilesL( EDriveF ) );
+    TRAP_IGNORE( iTestCommon->DeleteDummyFilesL( EDriveG ) );
+    
+    TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksHandles );
+    
+    CStifItemParser* nullParser( NULL );
+    CreateMobilecrashWatcherL( *nullParser );    
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CIptvTestUtilModule* CIptvTestUtilModule::NewL(
+    CTestModuleIf& aTestModuleIf )
+    {
+    CIptvTestUtilModule* self = new (ELeave) CIptvTestUtilModule( aTestModuleIf );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+// Destructor
+CIptvTestUtilModule::~CIptvTestUtilModule()
+    {
+
+    // Delete resources allocated from test methods
+    Delete();
+
+    // Delete logger
+    delete iLog;
+
+    delete iTestCommon;
+    iTestCommon = NULL;
+
+    iFs.Close();
+    }
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// LibEntryL is a polymorphic Dll entry point.
+// Returns: CScriptBase: New CScriptBase derived object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CScriptBase* LibEntryL(
+    CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
+    {
+
+    return ( CScriptBase* ) CIptvTestUtilModule::NewL( aTestModuleIf );
+
+    }
+
+// -----------------------------------------------------------------------------
+// E32Dll is a DLL entry point function.
+// Returns: KErrNone
+// -----------------------------------------------------------------------------
+//
+#ifndef EKA2 // Hide Dll entry point to EKA2
+GLDEF_C TInt E32Dll(
+    TDllReason /*aReason*/) // Reason code
+    {
+    return(KErrNone);
+
+    }
+#endif // EKA2
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/VCXTestUtilModule/src/IptvTestUtilModuleBlocks.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,1926 @@
+/*
+* 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 <e32svr.h>
+#include <f32fsys.h>
+#include <StifParser.h>
+#include <Stiftestinterface.h>
+
+#include <BADESCA.H>
+#include <COMMDB.H>
+#include <zipfile.h>
+
+#include "VCXTestLog.h"
+#include "IptvTestUtilModule.h"
+#include "TestUtilConnection.h"
+#include "TestUtilConnectionWaiter.h"
+#include "IptvTestDownloadManager.h"
+#include "VCXTestCommon.h"
+#include "CIptvTestMobilecrashWatcher.h"
+#include "CIptvTestTimer.h"
+
+#include "IptvTestUtilALR.h"
+
+// CONSTANTS
+_LIT( KDateTimeString, "%D%M%Y%/0%1%/1%2%/2%3%/3 %-B%:0%H%:1%T%:2%S%.%*C2%:3%-B" );
+
+// MACROS
+
+// LOCAL CONSTANTS AND MACROS
+
+// FORWARD DECLARATIONS
+class CIptvTestTimer;
+class CZipFile;
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::Delete
+// Delete here all resources allocated and opened from test methods.
+// Called from destructor.
+// -----------------------------------------------------------------------------
+//
+void CIptvTestUtilModule::Delete()
+    {
+    VCXLOGLO1(">>>CIptvTestUtilModule::Delete");
+    if(iConnect)
+    	{
+    	delete iConnect;
+    	iConnect = NULL;
+    	}
+
+    if(iConnectionWaiter)
+    	{
+    	delete iConnectionWaiter;
+    	iConnectionWaiter = NULL;
+    	}
+
+	if(iDownload)
+		{
+		delete iDownload;
+		iDownload = NULL;
+		}
+
+	if(iTimer)
+		{
+		delete iTimer;
+		iTimer = NULL;
+		}
+
+    if( iFileIsLocked )
+    	{
+    	VCXLOGLO1("CIptvTestUtilModule:: Release locked file.");
+    	iLockedFile.Close();
+    	}
+	iFileIsLocked = EFalse;
+
+	delete iObservedServicePath;
+	iObservedServicePath = NULL;
+	iObservedFiles.ResetAndDestroy();
+	//iObservedFiles.Close();
+	VCXLOGLO1("CIptvTestUtilModule::Observed array deleted.");
+
+	iFileModifiedDates.Reset();
+	iFileModifiedDates.Close();
+	VCXLOGLO1("CIptvTestUtilModule::File date array deleted.");
+
+	iFs.Close();
+
+	TInt i;
+	for( i = 0; i < iToBeDeletedDestinations.Count(); i++ )
+        {
+        TPtr ptr = iToBeDeletedDestinations[i]->Des();
+        iTestUtilALR->DeleteDestinationL( ptr );
+        }
+
+    iToBeDeletedDestinations.ResetAndDestroy();
+
+    if( iTestUtilALR )
+        {
+        delete iTestUtilALR;
+        iTestUtilALR = NULL;
+        }
+
+    if( iCaseStarted )
+        {
+        VCXLOGLO1("<<< Case end.");
+        iCaseStarted = EFalse;
+        }
+
+    if( iDummyFilesCreated )
+        {
+        TRAP_IGNORE( iTestCommon->DeleteDummyFilesL( EDriveC ) );
+        TRAP_IGNORE( iTestCommon->DeleteDummyFilesL( EDriveE ) );
+        TRAP_IGNORE( iTestCommon->DeleteDummyFilesL( EDriveF ) );
+        TRAP_IGNORE( iTestCommon->DeleteDummyFilesL( EDriveG ) );
+        }
+        
+	if(iIptvTestMobilecrashWatcher)
+		{
+        CStifItemParser* nullParser( NULL );
+        CheckMobilecrashesL( *nullParser );
+
+		delete iIptvTestMobilecrashWatcher;
+		iIptvTestMobilecrashWatcher = NULL;
+		}
+    
+
+	VCXLOGLO1("<<<CIptvTestUtilModule::Delete");
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::RunMethodL
+// Run specified method. Contains also table of test mothods and their names.
+// -----------------------------------------------------------------------------
+//
+TInt CIptvTestUtilModule::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( "IptvLogCaseStart", CIptvTestUtilModule::IptvLogCaseStart ),
+        ENTRY( "IptvLogCaseEnd", CIptvTestUtilModule::IptvLogCaseEnd ),
+        ENTRY( "IptvLogWrite", CIptvTestUtilModule::IptvLogWrite ),
+
+        ENTRY( "Connect", CIptvTestUtilModule::ConnectL ),
+        ENTRY( "Attach", CIptvTestUtilModule::AttachL ),
+        ENTRY( "Disconnect", CIptvTestUtilModule::DisconnectL ),
+		ENTRY( "Terminate", CIptvTestUtilModule::TerminateConnectionL ),
+		ENTRY( "WaitForConnectionActivity", CIptvTestUtilModule::WaitForConnectionActivityL ),
+		ENTRY( "WaitUntilConnectionIsClosed", CIptvTestUtilModule::WaitUntilConnectionIsClosed ),
+		ENTRY( "Download", CIptvTestUtilModule::DownloadL ),
+		ENTRY( "StopDownloads", CIptvTestUtilModule::StopDownloadsL ),
+
+		ENTRY( "CreateMobilecrashWatcher", CIptvTestUtilModule::CreateMobilecrashWatcherL ),
+		ENTRY( "CheckMobilecrashes", CIptvTestUtilModule::CheckMobilecrashesL ),
+		ENTRY( "CheckMobilecrashesZeroTolerance", CIptvTestUtilModule::CheckMobilecrashesZeroToleranceL ),
+
+		ENTRY( "SetDefaultIapCenrep", CIptvTestUtilModule::SetDefaultIapCenRepL ), 
+		ENTRY( "DeleteUsedDestinationCenRep", CIptvTestUtilModule::DeleteUsedDestinationCenRepL ),
+		ENTRY( "SetUsedDestination", CIptvTestUtilModule::SetUsedDestinationL ),
+		ENTRY( "CreateDestination", CIptvTestUtilModule::CreateDestinationL ),
+		ENTRY( "SetConnectionMethodStringAttribute", CIptvTestUtilModule::SetConnectionMethodStringAttributeL ),
+		ENTRY( "SetConnectionMethodIntAttribute", CIptvTestUtilModule::SetConnectionMethodIntAttributeL ),
+		ENTRY( "SetConnectionMethodBoolAttribute", CIptvTestUtilModule::SetConnectionMethodBoolAttributeL ),
+		ENTRY( "DeleteDestination", CIptvTestUtilModule::DeleteDestinationL ),
+		ENTRY( "CopyMethod", CIptvTestUtilModule::CopyMethodL ),
+		ENTRY( "DeleteMethod", CIptvTestUtilModule::DeleteMethodL ),
+		ENTRY( "SetMethodPriority", CIptvTestUtilModule::SetMethodPriorityL ),
+		ENTRY( "DeleteDestinationAfterwards", CIptvTestUtilModule::DeleteDestinationAfterwardsL ),
+
+		ENTRY( "SetSystemTimeToday", CIptvTestUtilModule::SetSystemTimeToday ),
+        ENTRY( "SetSystemTime", CIptvTestUtilModule::SetSystemTime ),
+		ENTRY( "AdvanceSystemTime1Second", CIptvTestUtilModule::AdvanceSystemTime1Second ),
+		ENTRY( "AdvanceSystemTimeSeconds", CIptvTestUtilModule::AdvanceSystemTimeSeconds ),
+		ENTRY( "AdvanceSystemTimeMinutes", CIptvTestUtilModule::AdvanceSystemTimeMinutes ),
+		ENTRY( "AdvanceSystemTimeHours", CIptvTestUtilModule::AdvanceSystemTimeHours ),
+		ENTRY( "AdvanceSystemTimeDays", CIptvTestUtilModule::AdvanceSystemTimeDays ),
+		ENTRY( "SetTimeZone", CIptvTestUtilModule::SetTimeZone ),
+
+		ENTRY( "CreateFile", CIptvTestUtilModule::CreateFileL ),
+		ENTRY( "DeleteFile", CIptvTestUtilModule::DeleteFileL ),
+		ENTRY( "CreateFolder", CIptvTestUtilModule::CreateFolderL ),
+		ENTRY( "DeleteFolder", CIptvTestUtilModule::DeleteFolderL ),
+		ENTRY( "LockFile", CIptvTestUtilModule::LockFileL ),
+		ENTRY( "UnlockFile", CIptvTestUtilModule::UnlockFileL ),
+		ENTRY( "ExtractFile", CIptvTestUtilModule::ExtractFileL ),
+		ENTRY( "SetDriveFreeSpace",  CIptvTestUtilModule::SetDriveFreeSpaceL ),
+        };
+
+    const TInt count = sizeof( KFunctions ) /
+                        sizeof( TStifFunctionInfo );
+
+    return RunInternalL( KFunctions, count, aItem );
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::IptvLogCaseStart
+// -----------------------------------------------------------------------------
+//
+TInt CIptvTestUtilModule::IptvLogCaseStart( CStifItemParser& aItem )
+    {
+    //VCXLOGLO1(">>>CIptvTestUtilModule::IptvLogCaseStart");
+
+    _LIT( KIptvTestUtilModule, "IptvTestUtilModule" );
+    _LIT( KWhere, "In IptvLogCaseStart" );
+    TestModuleIf().Printf( 0, KIptvTestUtilModule, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    TPtrC string;
+
+    if( aItem.GetNextString ( string ) != KErrNone )
+        {
+		VCXLOGLO1("CIptvTestUtilModule::IptvLogCaseStart: Could not read parameter!");
+		return KErrGeneral;
+        }
+
+	VCXLOGLO2(">>> Case start: %S", &string);
+
+	iCaseStarted = ETrue;
+
+    return KErrNone;
+	//VCXLOGLO1("<<<CIptvTestUtilModule::IptvLogCaseStart");
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::IptvLogCaseEnd
+// -----------------------------------------------------------------------------
+//
+TInt CIptvTestUtilModule::IptvLogCaseEnd( CStifItemParser& /* aItem */ )
+    {
+    //VCXLOGLO1(">>>CIptvTestUtilModule::IptvLogCaseEnd");
+
+    _LIT( KIptvTestUtilModule, "IptvTestUtilModule" );
+    _LIT( KWhere, "In IptvLogCaseEnd" );
+    TestModuleIf().Printf( 0, KIptvTestUtilModule, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+	VCXLOGLO1("<<< Case end.");
+	iCaseStarted = EFalse;
+
+    return KErrNone;
+	//VCXLOGLO1("<<<CIptvTestUtilModule::IptvLogCaseEnd");
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::IptvLogWrite
+// -----------------------------------------------------------------------------
+//
+TInt CIptvTestUtilModule::IptvLogWrite( CStifItemParser& aItem )
+    {
+    //VCXLOGLO1(">>>CIptvTestUtilModule::IptvLogWrite");
+
+    _LIT( KIptvTestUtilModule, "IptvTestUtilModule" );
+    _LIT( KWhere, "In IptvLogWrite" );
+    TestModuleIf().Printf( 0, KIptvTestUtilModule, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    TPtrC string;
+
+    aItem.SetParsingType(CStifItemParser::EQuoteStyleParsing);
+
+    if( aItem.GetNextString ( string ) != KErrNone )
+        {
+		VCXLOGLO1("CIptvTestUtilModule::IptvLogWrite: Could not read parameter!");
+		return KErrGeneral;
+        }
+
+	VCXLOGLO2("%S", &string);
+
+    return KErrNone;
+	//VCXLOGLO1("<<<CIptvTestUtilModule::IptvLogWrite");
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::ConnectL
+// -----------------------------------------------------------------------------
+//
+TInt CIptvTestUtilModule::ConnectL( CStifItemParser& aItem )
+	{
+    VCXLOGLO1(">>>CIptvTestUtilModule::ConnectL");
+    // Print to UI
+    _LIT( KIptvTestUtilConnect, "IptvTestUtilModule" );
+    _LIT( KWhere, "In ConnectL" );
+    TestModuleIf().Printf( 0, KIptvTestUtilConnect, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    if(iConnect)
+    	{
+    	VCXLOGLO1("CIptvTestUtilModule:: Connection already exists.");
+    	return KErrAlreadyExists;
+    	}
+
+	aItem.SetParsingType(CStifItemParser::EQuoteStyleParsing);
+
+    TInt err = KErrNone;
+
+	TPtrC iapName;
+
+	if(KErrNone != aItem.GetNextString(iapName) )
+    	{
+	    VCXLOGLO1("** FAIL ** Invalid testcase parameter! Iap name was not specified.");
+        iLog->Log( _L("** FAIL ** Invalid testcase parameter! Iap name was not specified.") );
+        VCXLOGLO1("<<<CIptvTestUtilModule::ConnectL");
+    	return KErrGeneral;
+    	}
+
+	TBufC<256> name(iapName);
+	TUint32 iapId;
+	if(!iTestCommon->GetIapIdL(name, iapId))
+		{
+	    VCXLOGLO2("** FAIL ** Could not find iap with name %S.", &name);
+        iLog->Log( _L("** FAIL ** Could not find specified iap.") );
+        VCXLOGLO1("<<<CIptvTestUtilModule::ConnectL");
+    	return KErrGeneral;
+		}
+
+	iRetryCount = 10;
+
+    iConnect = CTestUtilConnection::NewL(this);
+
+    iConnect->SetConnectionPreferences(KCommDbBearerUnknown, iapId);
+    iConnect->ConnectL();
+
+	if(!iTimer)
+		{
+		iTimer = CIptvTestTimer::NewL(*this, KConnectionTimerId);
+		}
+	iTimer->After(1000000 * 20);
+
+	VCXLOGLO1("<<<CIptvTestUtilModule::ConnectL");
+    return err;
+	}
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::AttachL
+// -----------------------------------------------------------------------------
+//
+TInt CIptvTestUtilModule::AttachL( CStifItemParser& aItem )
+	{
+    VCXLOGLO1(">>>CIptvTestUtilModule::AttachL");
+    // Print to UI
+    _LIT( KIptvTestUtilConnect, "IptvTestUtilModule" );
+    _LIT( KWhere, "In AttachL" );
+    TestModuleIf().Printf( 0, KIptvTestUtilConnect, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    if(iConnect)
+    	{
+    	VCXLOGLO1("<<<CIptvTestUtilModule:: Connection already exists.");
+    	return KErrAlreadyExists;
+    	}
+
+	aItem.SetParsingType(CStifItemParser::EQuoteStyleParsing);
+
+    TInt err = KErrNone;
+
+	TRAP(err, PrintIAPs() );
+
+	TPtrC iapName;
+
+	if(KErrNone != aItem.GetNextString(iapName) )
+    	{
+	    VCXLOGLO1("** FAIL ** Invalid testcase parameter! Iap name was not specified.");
+        iLog->Log( _L("** FAIL ** Invalid testcase parameter! Iap name was not specified.") );
+        VCXLOGLO1("<<<CIptvTestUtilModule::AttachL");
+    	return KErrGeneral;
+    	}
+
+	TBufC<256> name(iapName);
+	TUint32 iapId;
+	if(!iTestCommon->GetIapIdL(name, iapId))
+		{
+	    VCXLOGLO2("** FAIL ** Could not find iap with name %S.", &name);
+        iLog->Log( _L("** FAIL ** Could not find specified iap.") );
+        VCXLOGLO1("<<<CIptvTestUtilModule::AttachL");
+    	return KErrGeneral;
+		}
+
+    iConnect = CTestUtilConnection::NewL(this);
+
+    iConnect->SetConnectionPreferences(KCommDbBearerUnknown, iapId);
+    iConnect->AttachL();
+
+    if(!iTimer)
+        {
+        iTimer = CIptvTestTimer::NewL(*this, KConnectionTimerId);
+        }
+	iTimer->After(1000000 * 20);
+
+	VCXLOGLO1("<<<CIptvTestUtilModule::AttachL");
+    return err;
+	}
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::DisconnectL
+// -----------------------------------------------------------------------------
+//
+TInt CIptvTestUtilModule::DisconnectL( CStifItemParser& /* aItem */ )
+	{
+    VCXLOGLO1(">>>CIptvTestUtilModule::DisconnectL");
+    // Print to UI
+    _LIT( KIptvTestUtilConnect, "IptvTestUtilModule" );
+    _LIT( KWhere, "In DisconnectL" );
+    TestModuleIf().Printf( 0, KIptvTestUtilConnect, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    TInt err = KErrNone;
+
+    if(iTimer)
+    	{
+    	iTimer->CancelTimer();
+    	}
+
+    delete iConnect;
+    iConnect = NULL;
+
+	VCXLOGLO1("<<<CIptvTestUtilModule::DisconnectL");
+    return err;
+	}
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::TerminateConnectionL
+// -----------------------------------------------------------------------------
+//
+TInt CIptvTestUtilModule::TerminateConnectionL( CStifItemParser& /* aItem */ )
+	{
+    VCXLOGLO1(">>>CIptvTestUtilModule::TerminateConnectionL");
+    // Print to UI
+    _LIT( KIptvTestUtilConnect, "IptvTestUtilModule" );
+    _LIT( KWhere, "In TerminateConnectionL" );
+    TestModuleIf().Printf( 0, KIptvTestUtilConnect, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    TInt err = KErrNone;
+
+    if(iConnect)
+    	{
+    	iConnect->TerminateConnectionL();
+
+	    delete iConnect;
+	    iConnect = NULL;
+    	}
+
+    if(iTimer)
+    	{
+    	iTimer->CancelTimer();
+    	}
+
+	VCXLOGLO1("<<<CIptvTestUtilModule::TerminateConnectionL");
+    return err;
+	}
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::DownloadL
+// -----------------------------------------------------------------------------
+//
+TInt CIptvTestUtilModule::DownloadL( CStifItemParser& aItem  )
+	{
+    VCXLOGLO1(">>>CIptvTestUtilModule::DownloadL");
+    // Print to UI
+    _LIT( KIptvTestUtilModule, "IptvTestUtilModule" );
+    _LIT( KWhere, "In DownloadL" );
+    TestModuleIf().Printf( 0, KIptvTestUtilModule, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    TInt err = KErrNone;
+
+ 	aItem.SetParsingType(CStifItemParser::EQuoteStyleParsing);
+
+ 	TPtrC pAddress, pOutFile, pUserName, pPassword, pIapName;
+
+    if( aItem.GetNextString ( pAddress ) != KErrNone )
+        {
+		VCXLOGLO1("CIptvTestUtilModule::DownloadL: Could not read parameter address!");
+		return KErrGeneral;
+        }
+
+    HBufC* heapBuffer = HBufC::NewL(4000);
+    TPtr ptr( heapBuffer->Des() );
+    ptr.Copy( pAddress );
+
+    if( aItem.GetNextString ( pOutFile ) != KErrNone )
+        {
+		VCXLOGLO1("CIptvTestUtilModule::DownloadL: Could not read parameter outputfile!");
+		return KErrGeneral;
+        }
+
+    if( aItem.GetNextString ( pUserName ) != KErrNone )
+        {
+		VCXLOGLO1("CIptvTestUtilModule::DownloadL: no user name specified!");
+        }
+
+    if( aItem.GetNextString ( pPassword ) != KErrNone )
+        {
+		VCXLOGLO1("CIptvTestUtilModule::DownloadL: no password specified!");
+        }
+
+    if( aItem.GetNextString ( pIapName ) != KErrNone )
+        {
+		VCXLOGLO1("CIptvTestUtilModule::DownloadL: no iap specified!");
+        }
+
+	VCXLOGLO2("Address: %S", &pAddress);
+	VCXLOGLO2("OutFile: %S", &pOutFile);
+	VCXLOGLO2("name: %S", &pUserName);
+	VCXLOGLO2("Password: %S", &pPassword);
+	VCXLOGLO2("Iap: %S", &pIapName);
+
+	if(!iDownload)
+		{
+		iDownload = CIptvTestDownloadManager::NewL(this);
+		}
+
+    TUint32 iapId(0);
+    GetIap(pIapName, iapId);
+
+	err = iDownload->DownloadL(ptr, pOutFile, pUserName, pPassword, iapId);
+	if(err != KErrNone)
+		{
+		VCXLOGLO2("iDownload returned: %d", err);
+		}
+
+	VCXLOGLO1("<<<CIptvTestUtilModule::DownloadL");
+    return err;
+	}
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::StopDownloadsL
+// -----------------------------------------------------------------------------
+//
+TInt CIptvTestUtilModule::StopDownloadsL( CStifItemParser& /* aItem */ )
+	{
+
+    VCXLOGLO1(">>>CIptvTestUtilModule::StopDownloads");
+    // Print to UI
+    _LIT( KIptvTestUtilModule, "IptvTestUtilModule" );
+    _LIT( KWhere, "In StopDownloadsL" );
+    TestModuleIf().Printf( 0, KIptvTestUtilModule, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    TInt err = KErrNone;
+
+	if(iDownload)
+		{
+		delete iDownload;
+		iDownload = NULL;
+		}
+
+	VCXLOGLO1("<<<CIptvTestUtilModule::StopDownloads");
+    return err;
+	}
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::ConnectionCreated
+// -----------------------------------------------------------------------------
+//
+void CIptvTestUtilModule::ConnectionCreated()
+	{
+	VCXLOGLO1("CIptvTestUtilModule:: Connection created.");
+    if(iTimer)
+    	{
+    	iTimer->CancelTimer();
+    	}
+	Signal();
+	}
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::ConnectionClosed
+// -----------------------------------------------------------------------------
+//
+void CIptvTestUtilModule::ConnectionClosed()
+	{
+	VCXLOGLO1("CIptvTestUtilModule:: Connection closed.");
+	Signal();
+    if(iTimer)
+    	{
+    	iTimer->CancelTimer();
+    	}
+
+	}
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::ConnectionTimeout
+// -----------------------------------------------------------------------------
+//
+void CIptvTestUtilModule::ConnectionTimeout()
+	{
+	VCXLOGLO1("CIptvTestUtilModule:: Connection timeout!");
+	Signal(KErrTimedOut);
+    if(iTimer)
+    	{
+    	iTimer->CancelTimer();
+    	}
+
+	}
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::ConnectionFailed
+// -----------------------------------------------------------------------------
+//
+void CIptvTestUtilModule::ConnectionFailed()
+	{
+	if(--iRetryCount <= 0)
+		{
+		Signal(KErrGeneral);
+		VCXLOGLO1("CIptvTestUtilModule:: Connection failed!");
+		}
+	else
+		{
+		VCXLOGLO1("CIptvTestUtilModule:: retrying");
+		iConnect->ConnectL();
+		}
+    if(iTimer)
+    	{
+    	iTimer->CancelTimer();
+    	}
+	}
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::ConnectionAlreadyExists
+// -----------------------------------------------------------------------------
+//
+void CIptvTestUtilModule::ConnectionAlreadyExists()
+	{
+	VCXLOGLO1("CIptvTestUtilModule:: Connection already exists.");
+    if(iTimer)
+    	{
+    	iTimer->CancelTimer();
+    	}
+	Signal();
+	}
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::DownloadFinished
+// -----------------------------------------------------------------------------
+//
+void CIptvTestUtilModule::DownloadFinished(TInt aError)
+	{
+	VCXLOGLO1("CIptvTestUtilModule:: Download finished.");
+	Signal(aError);
+	}
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::PrintIAPs
+// -----------------------------------------------------------------------------
+//
+void CIptvTestUtilModule::PrintIAPs()
+    {
+    RArray<TUint32> idArray;
+    CleanupClosePushL( idArray );
+
+    CDesCArrayFlat* nameArray = new (ELeave) CDesCArrayFlat(16);
+    CleanupStack::PushL( nameArray );
+
+    // Get IAP names and ids from the database
+    CCommsDatabase* TheDb = CCommsDatabase::NewL( EDatabaseTypeIAP );
+    CleanupStack::PushL( TheDb );
+
+    TheDb->ShowHiddenRecords();
+
+    CCommsDbTableView* view = TheDb->OpenTableLC( TPtrC(IAP) );
+    //Ethernet with Daemon Dynamic IP
+    TBuf<40> name;
+    TUint32 id;
+    TInt res = view->GotoFirstRecord();
+    while( res == KErrNone )
+    {
+        view->ReadTextL( TPtrC(COMMDB_NAME), name );
+        view->ReadUintL( TPtrC(COMMDB_ID), id );
+
+        idArray.Insert( id, 0 );
+        nameArray->InsertL( 0, name );
+
+        res = view->GotoNextRecord();
+        VCXLOGLO3("IAP name, id: %S, %d", &name, id);
+    }
+
+    CleanupStack::PopAndDestroy( view ); // view
+    CleanupStack::PopAndDestroy( TheDb ); // TheDb
+
+    CleanupStack::PopAndDestroy( 2, &idArray );  // nameArray, idArray
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::GetIap
+// -----------------------------------------------------------------------------
+//
+void CIptvTestUtilModule::GetIap(TDesC& aIapName, TUint32& aIapId)
+    {
+    VCXLOGLO1(">>>CIptvTestUtilModule::GetIap");
+    RArray<TUint32> idArray;
+    CleanupClosePushL( idArray );
+
+    CDesCArrayFlat* nameArray = new (ELeave) CDesCArrayFlat(16);
+    CleanupStack::PushL( nameArray );
+
+    // Get IAP names and ids from the database
+    CCommsDatabase* TheDb = CCommsDatabase::NewL( EDatabaseTypeIAP );
+    CleanupStack::PushL( TheDb );
+
+    TheDb->ShowHiddenRecords();
+
+    CCommsDbTableView* view = TheDb->OpenTableLC( TPtrC(IAP) );
+    //Ethernet with Daemon Dynamic IP
+    TBuf<40> name;
+    TUint32 id;
+    TInt res = view->GotoFirstRecord();
+    while( res == KErrNone )
+    {
+        view->ReadTextL( TPtrC(COMMDB_NAME), name );
+        view->ReadUintL( TPtrC(COMMDB_ID), id );
+
+#ifdef __WINSCW__
+        if(_L("Ethernet with Daemon Dynamic IP") == name)
+            {
+            aIapId = id;
+            VCXLOGLO3("CIptvTestUtilModule:: Found IAP: %d, %S", _L("Ethernet with Daemon Dynamic IP"), &aIapName);
+            }
+#else
+        if(aIapName == name)
+            {
+            aIapId = id;
+            VCXLOGLO3("CIptvTestUtilModule:: Found IAP: %d, %S", aIapId, &aIapName);
+            }
+#endif
+
+        idArray.Insert( id, 0 );
+        nameArray->InsertL( 0, name );
+
+        res = view->GotoNextRecord();
+    }
+
+    CleanupStack::PopAndDestroy( view ); // view
+    CleanupStack::PopAndDestroy( TheDb ); // TheDb
+
+    CleanupStack::PopAndDestroy( 2, &idArray );  // nameArray, idArray
+    VCXLOGLO1("<<<CIptvTestUtilModule::GetIap");
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::WaitForConnectionActivityL
+// -----------------------------------------------------------------------------
+//
+TInt CIptvTestUtilModule::WaitForConnectionActivityL(CStifItemParser& aItem )
+	{
+    VCXLOGLO1(">>>CIptvTestUtilModule::WaitForConnectionActivityL");
+    // Print to UI
+    _LIT( KIptvTestUtilConnect, "IptvTestUtilModule" );
+    _LIT( KWhere, "In WaitForConnectionActivityL" );
+    TestModuleIf().Printf( 0, KIptvTestUtilConnect, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+	aItem.SetParsingType(CStifItemParser::EQuoteStyleParsing);
+
+    TInt err = KErrNone;
+
+	TPtrC iapName;
+
+	if( KErrNone != aItem.GetNextString(iapName) )
+    	{
+	    VCXLOGLO1("** FAIL ** Invalid testcase parameter! Iap name was not specified.");
+        iLog->Log( _L("** FAIL ** Invalid testcase parameter! Iap name was not specified.") );
+        VCXLOGLO1("<<<CIptvTestUtilModule::WaitForConnectionActivityL");
+    	return KErrGeneral;
+    	}
+
+	if( iConnectionWaiter == NULL )
+		{
+		iConnectionWaiter = CTestUtilConnectionWaiter::NewL(this);
+		}
+
+	TUint32 iapId;
+	if( !iTestCommon->GetIapIdL( iapName, iapId ) )
+		{
+	    VCXLOGLO2("** FAIL ** Could not find iap with name %S.", &iapName);
+        iLog->Log( _L("** FAIL ** Could not find specified iap.") );
+        VCXLOGLO1("<<<CIptvTestUtilModule::WaitForConnectionActivityL");
+    	return KErrArgument;
+		}
+	
+	iConnectionWaiter->WaitForConnection(iapId);
+
+	VCXLOGLO1("<<<CIptvTestUtilModule::WaitForConnectionActivityL");
+    return err;
+	}
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::WaitUntilConnectionIsClosed
+// -----------------------------------------------------------------------------
+//
+TInt CIptvTestUtilModule::WaitUntilConnectionIsClosed(CStifItemParser& aItem )
+	{
+    VCXLOGLO1(">>>CIptvTestUtilModule::WaitUntilConnectionIsClosed");
+    // Print to UI
+    _LIT( KIptvTestUtilConnect, "IptvTestUtilModule" );
+    _LIT( KWhere, "In WaitForConnectionActivityL" );
+    TestModuleIf().Printf( 0, KIptvTestUtilConnect, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+	aItem.SetParsingType(CStifItemParser::EQuoteStyleParsing);
+
+    TInt err = KErrNone;
+
+	TRAP(err, PrintIAPs() );
+
+	TPtrC iapName;
+
+	if(KErrNone != aItem.GetNextString(iapName) )
+    	{
+	    VCXLOGLO1("** FAIL ** Invalid testcase parameter! Iap name was not specified.");
+        iLog->Log( _L("** FAIL ** Invalid testcase parameter! Iap name was not specified.") );
+        VCXLOGLO1("<<<CIptvTestUtilModule::WaitUntilConnectionIsClosed");
+    	return KErrGeneral;
+    	}
+
+	if(iConnectionWaiter == NULL)
+		{
+		iConnectionWaiter = CTestUtilConnectionWaiter::NewL(this);
+		}
+
+	TUint32 iapId;
+	if(!iTestCommon->GetIapIdL(iapName, iapId))
+		{
+	    VCXLOGLO2("** FAIL ** Could not find iap with name %S.", &iapName);
+        iLog->Log( _L("** FAIL ** Could not find specified iap.") );
+        VCXLOGLO1("<<<CIptvTestUtilModule::WaitUntilConnectionIsClosed");
+    	return KErrArgument;
+		}
+
+	iConnectionWaiter->WaitUntilConnectionIsClosed(iapId);
+
+	VCXLOGLO1("<<<CIptvTestUtilModule::WaitUntilConnectionIsClosed");
+    return KErrNone;
+	}
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::TimerComplete
+// -----------------------------------------------------------------------------
+//
+void CIptvTestUtilModule::TimerComplete(TInt aTimerId, TInt aError )
+	{
+	VCXLOGLO1(">>>CIptvTestUtilModule::TimerComplete");
+	VCXLOGLO2(">>>CIptvTestUtilModule:: aError: %d", aError);
+
+	if(aError == KErrNone && aTimerId == KConnectionTimerId)
+	{
+		VCXLOGLO1("* ERROR * Connection timedout!");
+		Signal(KErrTimedOut);
+	}
+
+	VCXLOGLO1("<<<CIptvTestUtilModule::TimerComplete");
+	}
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::AdvanceSystemTime1Second
+// -----------------------------------------------------------------------------
+//
+TInt CIptvTestUtilModule::AdvanceSystemTime1Second(CStifItemParser& /* aItem */ )
+	{
+    VCXLOGLO1(">>>CIptvTestUtilModule::AdvanceSystemTime1Second");
+    // Print to UI
+    _LIT( KIptvTestUtilConnect, "IptvTestUtilModule" );
+    _LIT( KWhere, "In AdvanceSystemTime1Second" );
+    TestModuleIf().Printf( 0, KIptvTestUtilConnect, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    TInt err = CVCXTestCommon::AdvanceSystemTimeSeconds(1);
+
+	VCXLOGLO1("<<<CIptvTestUtilModule::AdvanceSystemTime1Second");
+	return err;
+	}
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::AdvanceSystemTimeSeconds
+// -----------------------------------------------------------------------------
+//
+TInt CIptvTestUtilModule::AdvanceSystemTimeSeconds(CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CIptvTestUtilModule::AdvanceSystemTimeSeconds");
+    // Print to UI
+    _LIT( KIptvTestUtilConnect, "IptvTestUtilModule" );
+    _LIT( KWhere, "In AdvanceSystemTimeSeconds" );
+    TestModuleIf().Printf( 0, KIptvTestUtilConnect, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    aItem.SetParsingType(CStifItemParser::EQuoteStyleParsing);
+
+    TInt count;
+    if(aItem.GetNextInt(count) != KErrNone)
+        {
+        VCXLOGLO1("* ERROR * Parameter missing.");
+        VCXLOGLO1("<<<CIptvTestUtilModule::AdvanceSystemTimeDays");
+        return KErrArgument;
+        }
+
+    TInt err = CVCXTestCommon::AdvanceSystemTimeSeconds(count);
+
+    VCXLOGLO1("<<<CIptvTestUtilModule::AdvanceSystemTimeSeconds");
+    return err;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::AdvanceSystemTimeMinutes
+// -----------------------------------------------------------------------------
+//
+TInt CIptvTestUtilModule::AdvanceSystemTimeMinutes(CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CIptvTestUtilModule::AdvanceSystemTimeMinutes");
+    // Print to UI
+    _LIT( KIptvTestUtilConnect, "IptvTestUtilModule" );
+    _LIT( KWhere, "In AdvanceSystemTimeMinutes" );
+    TestModuleIf().Printf( 0, KIptvTestUtilConnect, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    aItem.SetParsingType(CStifItemParser::EQuoteStyleParsing);
+
+    TInt count;
+    if(aItem.GetNextInt(count) != KErrNone)
+        {
+        VCXLOGLO1("* ERROR * Parameter missing.");
+        VCXLOGLO1("<<<CIptvTestUtilModule::AdvanceSystemTimeDays");
+        return KErrArgument;
+        }
+
+    TInt err = CVCXTestCommon::AdvanceSystemTimeMinutes(count);
+
+    VCXLOGLO1("<<<CIptvTestUtilModule::AdvanceSystemTimeMinutes");
+    return err;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::AdvanceSystemTimeHours
+// -----------------------------------------------------------------------------
+//
+TInt CIptvTestUtilModule::AdvanceSystemTimeHours(CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CIptvTestUtilModule::AdvanceSystemTimeHours");
+    // Print to UI
+    _LIT( KIptvTestUtilConnect, "IptvTestUtilModule" );
+    _LIT( KWhere, "In AdvanceSystemTimeHours" );
+    TestModuleIf().Printf( 0, KIptvTestUtilConnect, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    aItem.SetParsingType(CStifItemParser::EQuoteStyleParsing);
+
+    TInt count;
+    if(aItem.GetNextInt(count) != KErrNone)
+        {
+        VCXLOGLO1("* ERROR * Parameter missing.");
+        VCXLOGLO1("<<<CIptvTestUtilModule::AdvanceSystemTimeDays");
+        return KErrArgument;
+        }
+
+    TInt err = CVCXTestCommon::AdvanceSystemTimeHours(count);
+
+    VCXLOGLO1("<<<CIptvTestUtilModule::AdvanceSystemTimeHours");
+    return err;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::AdvanceSystemTimeDays
+// -----------------------------------------------------------------------------
+//
+TInt CIptvTestUtilModule::AdvanceSystemTimeDays(CStifItemParser& aItem )
+	{
+    VCXLOGLO1(">>>CIptvTestUtilModule::AdvanceSystemTimeDays");
+    // Print to UI
+    _LIT( KIptvTestUtilConnect, "IptvTestUtilModule" );
+    _LIT( KWhere, "In AdvanceSystemTimeDays" );
+    TestModuleIf().Printf( 0, KIptvTestUtilConnect, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    aItem.SetParsingType(CStifItemParser::EQuoteStyleParsing);
+
+    TInt daysInt;
+	if(aItem.GetNextInt(daysInt) != KErrNone)
+		{
+		VCXLOGLO1("* ERROR * Parameter days missing.");
+		VCXLOGLO1("<<<CIptvTestUtilModule::AdvanceSystemTimeDays");
+		return KErrArgument;
+    	}
+
+    TTime now;
+    now.HomeTime();
+
+    TTimeIntervalDays days(daysInt);
+    now += days;
+
+    TInt err = CVCXTestCommon::SetSystemTime(now);
+
+	VCXLOGLO1("<<<CIptvTestUtilModule::AdvanceSystemTimeDays");
+
+	return err;
+}
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::SetSystemTime
+// -----------------------------------------------------------------------------
+//
+TInt CIptvTestUtilModule::SetSystemTime(CStifItemParser& aItem )
+	{
+    VCXLOGLO1(">>>CIptvTestUtilModule::SetSystemTime");
+    // Print to UI
+    _LIT( KIptvTestUtilConnect, "IptvTestUtilModule" );
+    _LIT( KWhere, "In SetSystemTime" );
+    TestModuleIf().Printf( 0, KIptvTestUtilConnect, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    aItem.SetParsingType(CStifItemParser::EQuoteStyleParsing);
+
+    TPtrC dayString;
+	if(aItem.GetNextString(dayString) != KErrNone)
+		{
+		VCXLOGLO1("* ERROR * Parameter missing.");
+		VCXLOGLO1("<<<CIptvTestUtilModule::SetSystemTime");
+		return KErrArgument;
+    	}
+
+    TTime time( dayString );
+    TInt err = CVCXTestCommon::SetSystemTime(time);
+
+	VCXLOGLO1("<<<CIptvTestUtilModule::SetSystemTime");
+	return err;
+}
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::SetSystemTimeToday
+// -----------------------------------------------------------------------------
+//
+TInt CIptvTestUtilModule::SetSystemTimeToday(CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CIptvTestUtilModule::SetSystemTimeToday");
+    // Print to UI
+    _LIT( KIptvTestUtilConnect, "IptvTestUtilModule" );
+    _LIT( KWhere, "In SetSystemTimeToday" );
+    TestModuleIf().Printf( 0, KIptvTestUtilConnect, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    TInt hour( 0 );
+    TInt minute( 0 );
+
+    aItem.GetNextInt( hour );
+    aItem.GetNextInt( minute );
+
+    TTime time;
+    TBuf<256> timeString;
+    time.HomeTime();
+    time.FormatL( timeString, KDateTimeString );
+    VCXLOGLO2("CIptvTestUtilModule::SetSystemTimeToday -- HomeTime() %S", &timeString);
+
+    TDateTime dateTime( time.DateTime() );
+    dateTime = time.DateTime();
+    dateTime.SetHour( hour );
+    dateTime.SetMinute( minute );
+
+    time = dateTime;
+    time.FormatL( timeString, KDateTimeString );
+    VCXLOGLO2("CIptvTestUtilModule::SetSystemTimeToday -- System time set to: %S", &timeString);
+
+	/*
+		time.UniversalTime();
+    time.FormatL( timeString, KDateTimeString );
+    VCXLOGLO2("CIptvTestUtilModule::SetSystemTimeToday -- Universal time: %S", &timeString);
+    */
+
+    TInt err = CVCXTestCommon::SetSystemTime(time);
+
+    VCXLOGLO1("<<<CIptvTestUtilModule::SetSystemTimeToday");
+    return err;
+}
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::SetTimeZone
+// -----------------------------------------------------------------------------
+//
+TInt CIptvTestUtilModule::SetTimeZone(CStifItemParser& aItem )
+	{
+    VCXLOGLO1(">>>CIptvTestUtilModule::SetTimeZone");
+    // Print to UI
+    _LIT( KIptvTestUtilConnect, "IptvTestUtilModule" );
+    _LIT( KWhere, "In SetTimeZone" );
+    TestModuleIf().Printf( 0, KIptvTestUtilConnect, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    aItem.SetParsingType(CStifItemParser::EQuoteStyleParsing);
+
+    TPtrC timeZone;
+	if(aItem.GetNextString(timeZone) != KErrNone)
+		{
+		VCXLOGLO1("* ERROR * Parameter missing.");
+		VCXLOGLO1("<<<CIptvTestUtilModule::SetTimeZone");
+		return KErrArgument;
+    	}
+
+    TInt err = CVCXTestCommon::SetTimeZone(timeZone);
+
+	VCXLOGLO1("<<<CIptvTestUtilModule::SetTimeZone");
+	return err;
+}
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::CreateMobilecrashWatcherL
+// -----------------------------------------------------------------------------
+//
+TInt CIptvTestUtilModule::CreateMobilecrashWatcherL(CStifItemParser& /* aItem */ )
+	{
+    VCXLOGLO1(">>>CIptvTestUtilModule::CreateMobilecrashWatcherL");
+    // Print to UI
+    _LIT( KIptvTestUtilConnect, "IptvTestUtilModule" );
+    _LIT( KWhere, "In CreateMobilecrashWatcherL" );
+    TestModuleIf().Printf( 0, KIptvTestUtilConnect, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+	if(iIptvTestMobilecrashWatcher)
+		{
+		delete iIptvTestMobilecrashWatcher;
+		iIptvTestMobilecrashWatcher = NULL;
+		}
+
+	iIptvTestMobilecrashWatcher = CIptvTestMobilecrashWatcher::NewL(EFalse);
+
+	VCXLOGLO1("<<<CIptvTestUtilModule::CreateMobilecrashWatcherL");
+	return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::CheckMobilecrashesL
+// -----------------------------------------------------------------------------
+//
+TInt CIptvTestUtilModule::CheckMobilecrashesL(CStifItemParser& /* aItem */ )
+	{
+    VCXLOGLO1(">>>CIptvTestUtilModule::CheckMobilecrashesL");
+    // Print to UI
+    _LIT( KIptvTestUtilConnect, "IptvTestUtilModule" );
+    _LIT( KWhere, "In CheckMobilecrashesl" );
+    TestModuleIf().Printf( 0, KIptvTestUtilConnect, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+	if(!iIptvTestMobilecrashWatcher)
+		{
+		VCXLOGLO1("<<<CIptvTestUtilModule::CheckMobilecrashesL");
+		return KErrNotReady;
+		}
+
+	RPointerArray<HBufC> crashes;
+	if(iIptvTestMobilecrashWatcher->ReturnNewCrashes(crashes))
+		{
+		VCXLOGLO1("<<<CIptvTestUtilModule::CheckMobilecrashesL");
+		crashes.ResetAndDestroy();
+		return KErrAbort;
+		}
+	crashes.ResetAndDestroy();
+
+	VCXLOGLO1("<<<CIptvTestUtilModule::CheckMobilecrashesL");
+	return KErrNone;
+}
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::CheckMobilecrashesZeroToleranceL
+// -----------------------------------------------------------------------------
+//
+TInt CIptvTestUtilModule::CheckMobilecrashesZeroToleranceL(CStifItemParser& /* aItem */ )
+	{
+    VCXLOGLO1(">>>CIptvTestUtilModule::CheckMobilecrashesZeroToleranceL");
+    // Print to UI
+    _LIT( KIptvTestUtilConnect, "IptvTestUtilModule" );
+    _LIT( KWhere, "In CheckMobilecrashesl" );
+    TestModuleIf().Printf( 0, KIptvTestUtilConnect, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+	if(!iIptvTestMobilecrashWatcher)
+		{
+		iIptvTestMobilecrashWatcher = CIptvTestMobilecrashWatcher::NewL(EFalse);
+		}
+
+	TInt ret = KErrNone;
+	if(iIptvTestMobilecrashWatcher->ReturnMobileCrashCount() > 0)
+		{
+		ret = KErrAbort;
+		}
+
+	VCXLOGLO2("<<<CIptvTestUtilModule:: returning: %d", ret);
+	VCXLOGLO1("<<<CIptvTestUtilModule::CheckMobilecrashesZeroToleranceL");
+	return ret;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::DeleteUsedDestinationCenRepL
+// -----------------------------------------------------------------------------
+//
+TInt CIptvTestUtilModule::DeleteUsedDestinationCenRepL(CStifItemParser& aItem )
+	{
+    VCXLOGLO1(">>>CIptvTestUtilModule::DeleteUsedDestinationCenRepL");
+    // Print to UI
+    _LIT( KIptvTestUtilConnect, "IptvTestUtilModule" );
+    _LIT( KWhere, "In DeleteUsedDestinationCenRepL" );
+    TestModuleIf().Printf( 0, KIptvTestUtilConnect, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    TInt ret( KErrNone );
+
+    if( !iTestUtilALR )
+        {
+        iTestUtilALR = CIptvTestUtilALR::NewL();
+        }
+
+	aItem.SetParsingType(CStifItemParser::EQuoteStyleParsing);
+
+    TRAP( ret, iTestUtilALR->RemoveUsedDestinationCenRepL() );
+
+	VCXLOGLO2("<<<CIptvTestUtilModule:: returning: %d", ret);
+	VCXLOGLO1("<<<CIptvTestUtilModule::DeleteUsedDestinationCenRepL");
+	return ret;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::SetDefaultIapCenRep
+// -----------------------------------------------------------------------------
+//
+TInt CIptvTestUtilModule::SetDefaultIapCenRepL(CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CIptvTestUtilModule::SetDefaultIapCenRep");
+    // Print to UI
+    _LIT( KIptvTestUtilConnect, "IptvTestUtilModule" );
+    _LIT( KWhere, "In SetDefaultIapCenRep" );
+    TestModuleIf().Printf( 0, KIptvTestUtilConnect, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    TInt ret( KErrNone );
+
+    if( !iTestUtilALR )
+        {
+        iTestUtilALR = CIptvTestUtilALR::NewL();
+        }
+
+    aItem.SetParsingType(CStifItemParser::EQuoteStyleParsing);
+
+    TRAP( ret, iTestUtilALR->SetDefaultIapCenRep() );
+
+    VCXLOGLO2("<<<CIptvTestUtilModule:: returning: %d", ret);
+    VCXLOGLO1("<<<CIptvTestUtilModule::SetDefaultIapCenRep");
+    return ret;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::SetUsedDestinationL
+// -----------------------------------------------------------------------------
+//
+TInt CIptvTestUtilModule::SetUsedDestinationL(CStifItemParser& aItem )
+	{
+    VCXLOGLO1(">>>CIptvTestUtilModule::SetUsedDestinationL");
+    // Print to UI
+    _LIT( KIptvTestUtilConnect, "IptvTestUtilModule" );
+    _LIT( KWhere, "In SetUsedDestinationL" );
+    TestModuleIf().Printf( 0, KIptvTestUtilConnect, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    TInt ret( KErrNone );
+
+    if( !iTestUtilALR )
+        {
+        iTestUtilALR = CIptvTestUtilALR::NewL();
+        }
+
+	aItem.SetParsingType(CStifItemParser::EQuoteStyleParsing);
+
+	TPtrC destinationName;
+	User::LeaveIfError( aItem.GetNextString( destinationName ) );
+
+    TRAP( ret, iTestUtilALR->SetUsedDestinationL( destinationName ) );
+
+	VCXLOGLO2("<<<CIptvTestUtilModule:: returning: %d", ret);
+	VCXLOGLO1("<<<CIptvTestUtilModule::SetUsedDestinationL");
+	return ret;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::CreateDestinationL
+// -----------------------------------------------------------------------------
+//
+TInt CIptvTestUtilModule::CreateDestinationL(CStifItemParser& aItem )
+	{
+    VCXLOGLO1(">>>CIptvTestUtilModule::CreateDestinationL");
+    // Print to UI
+    _LIT( KIptvTestUtilConnect, "IptvTestUtilModule" );
+    _LIT( KWhere, "In CreateDestinationL" );
+    TestModuleIf().Printf( 0, KIptvTestUtilConnect, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    TInt ret( KErrNotSupported );
+
+    if( !iTestUtilALR )
+        {
+        iTestUtilALR = CIptvTestUtilALR::NewL();
+        }
+
+    aItem.SetParsingType(CStifItemParser::EQuoteStyleParsing);
+
+	TPtrC destinationName;
+	User::LeaveIfError( aItem.GetNextString( destinationName ) );
+
+    TRAP(ret, iTestUtilALR->CreateDestinationL( destinationName ) );
+
+    VCXLOGLO2("<<<CIptvTestUtilModule:: returning: %d", ret);
+	VCXLOGLO1("<<<CIptvTestUtilModule::CreateDestinationL");
+	return ret;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::DeleteDestinationL
+// -----------------------------------------------------------------------------
+//
+TInt CIptvTestUtilModule::DeleteDestinationL(CStifItemParser& aItem )
+	{
+    VCXLOGLO1(">>>CIptvTestUtilModule::DeleteDestinationL");
+    // Print to UI
+    _LIT( KIptvTestUtilConnect, "IptvTestUtilModule" );
+    _LIT( KWhere, "In DeleteDestinationL" );
+    TestModuleIf().Printf( 0, KIptvTestUtilConnect, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    TInt ret( KErrNotSupported );
+
+    if( !iTestUtilALR )
+        {
+		iTestUtilALR = CIptvTestUtilALR::NewL();
+        }
+
+	aItem.SetParsingType(CStifItemParser::EQuoteStyleParsing);
+
+	TPtrC destinationName;
+	User::LeaveIfError( aItem.GetNextString( destinationName ) );
+
+    TRAP(ret, iTestUtilALR->DeleteDestinationL( destinationName ) );
+
+	VCXLOGLO2("<<<CIptvTestUtilModule:: returning: %d", ret);
+	VCXLOGLO1("<<<CIptvTestUtilModule::DeleteDestinationL");
+	return ret;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::CopyMethodL
+// -----------------------------------------------------------------------------
+//
+TInt CIptvTestUtilModule::CopyMethodL(CStifItemParser& aItem )
+	{
+    VCXLOGLO1(">>>CIptvTestUtilModule::CopyMethodL");
+    // Print to UI
+    _LIT( KIptvTestUtilConnect, "IptvTestUtilModule" );
+    _LIT( KWhere, "In CopyMethodL" );
+    TestModuleIf().Printf( 0, KIptvTestUtilConnect, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    TInt ret( KErrNotSupported );
+
+    if( !iTestUtilALR )
+        {
+        iTestUtilALR = CIptvTestUtilALR::NewL();
+        }
+
+    aItem.SetParsingType(CStifItemParser::EQuoteStyleParsing);
+
+	TPtrC sourceMethodName;
+	TPtrC targetMethodName;
+	TPtrC targetDestinationName;
+
+	User::LeaveIfError( aItem.GetNextString( sourceMethodName ) );
+	User::LeaveIfError( aItem.GetNextString( targetMethodName ) );
+	User::LeaveIfError( aItem.GetNextString( targetDestinationName ) );
+
+	TRAP(ret, iTestUtilALR->CopyMethodL( sourceMethodName, targetMethodName, targetDestinationName ) );
+
+	VCXLOGLO2("<<<CIptvTestUtilModule:: returning: %d", ret);
+	VCXLOGLO1("<<<CIptvTestUtilModule::CopyMethodL");
+	return ret;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::DeleteMethodL
+// -----------------------------------------------------------------------------
+//
+TInt CIptvTestUtilModule::DeleteMethodL(CStifItemParser& aItem )
+	{
+    VCXLOGLO1(">>>CIptvTestUtilModule::DeleteMethodL");
+    // Print to UI
+    _LIT( KIptvTestUtilConnect, "IptvTestUtilModule" );
+    _LIT( KWhere, "In DeleteMethodL" );
+    TestModuleIf().Printf( 0, KIptvTestUtilConnect, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    TInt ret( KErrNotSupported );
+
+    if( !iTestUtilALR )
+        {
+        iTestUtilALR = CIptvTestUtilALR::NewL();
+        }
+
+    aItem.SetParsingType(CStifItemParser::EQuoteStyleParsing);
+
+    TPtrC destinationName;
+	TPtrC methodName;
+
+	User::LeaveIfError( aItem.GetNextString( destinationName ) );
+	User::LeaveIfError( aItem.GetNextString( methodName ) );
+
+	TRAP(ret, iTestUtilALR->DeleteMethodL( destinationName, methodName ) );
+
+	VCXLOGLO2("<<<CIptvTestUtilModule:: returning: %d", ret);
+	VCXLOGLO1("<<<CIptvTestUtilModule::DeleteMethodL");
+	return ret;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::SetMethodPriorityL
+// -----------------------------------------------------------------------------
+//
+TInt CIptvTestUtilModule::SetMethodPriorityL(CStifItemParser& aItem )
+	{
+    VCXLOGLO1(">>>CIptvTestUtilModule::SetMethodPriorityL");
+    // Print to UI
+    _LIT( KIptvTestUtilConnect, "IptvTestUtilModule" );
+    _LIT( KWhere, "In SetMethodPriorityL" );
+    TestModuleIf().Printf( 0, KIptvTestUtilConnect, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    TInt ret( KErrNotSupported );
+
+    if( !iTestUtilALR )
+        {
+        iTestUtilALR = CIptvTestUtilALR::NewL();
+        }
+
+    aItem.SetParsingType(CStifItemParser::EQuoteStyleParsing);
+
+	TPtrC destinationName;
+	TPtrC methodName;
+	TInt priority;
+
+	User::LeaveIfError( aItem.GetNextString( destinationName ) );
+	User::LeaveIfError( aItem.GetNextString( methodName ) );
+	User::LeaveIfError( aItem.GetNextInt( priority ) );
+
+	TRAP(ret, iTestUtilALR->SetMethodPriorityL( destinationName, methodName, priority ) );
+
+	VCXLOGLO2("<<<CIptvTestUtilModule:: returning: %d", ret);
+	VCXLOGLO1("<<<CIptvTestUtilModule::SetMethodPriorityL");
+	return ret;
+	}
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::DeleteDestinationAfterwardsL
+// -----------------------------------------------------------------------------
+//
+TInt CIptvTestUtilModule::DeleteDestinationAfterwardsL(CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CIptvTestUtilModule::DeleteDestinationAfterwardsL");
+    // Print to UI
+    _LIT( KIptvTestUtilConnect, "IptvTestUtilModule" );
+    _LIT( KWhere, "In DeleteDestinationAfterwardsL" );
+    TestModuleIf().Printf( 0, KIptvTestUtilConnect, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    TInt ret( KErrNotSupported );
+
+    if( !iTestUtilALR )
+        {
+        iTestUtilALR = CIptvTestUtilALR::NewL();
+        }
+
+    aItem.SetParsingType(CStifItemParser::EQuoteStyleParsing);
+
+    TPtrC destinationName;
+
+    User::LeaveIfError( aItem.GetNextString( destinationName ) );
+
+    iToBeDeletedDestinations.AppendL( destinationName.AllocL() );
+
+    ret = KErrNone;
+
+    VCXLOGLO2("<<<CIptvTestUtilModule:: returning: %d", ret);
+    VCXLOGLO1("<<<CIptvTestUtilModule::DeleteDestinationAfterwardsL");
+    return ret;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::SetConnectionMethodStringAttributeL
+// -----------------------------------------------------------------------------
+//
+TInt CIptvTestUtilModule::SetConnectionMethodStringAttributeL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CIptvTestUtilModule::SetConnectionMethodStringAttributeL");
+    // Print to UI
+    _LIT( KIptvTestUtilConnect, "IptvTestUtilModule" );
+    _LIT( KWhere, "In SetConnectionMethodStringAttributeL" );
+    TestModuleIf().Printf( 0, KIptvTestUtilConnect, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    TInt ret( KErrNotSupported );
+
+    if( !iTestUtilALR )
+        {
+        iTestUtilALR = CIptvTestUtilALR::NewL();
+        }
+
+    aItem.SetParsingType(CStifItemParser::EQuoteStyleParsing);
+
+    TPtrC destinationName;
+    TPtrC methodName;
+    TInt attribute;
+    TPtrC value;
+
+    User::LeaveIfError( aItem.GetNextString( destinationName ) );
+    User::LeaveIfError( aItem.GetNextString( methodName ) );
+    User::LeaveIfError( aItem.GetNextInt( attribute ) );
+    User::LeaveIfError( aItem.GetNextString( value ) );
+
+    TRAP(ret, iTestUtilALR->SetMethodStringAttributeL( destinationName, methodName, attribute, value ) );
+
+    VCXLOGLO2("<<<CIptvTestUtilModule:: returning: %d", ret);
+    VCXLOGLO1("<<<CIptvTestUtilModule::SetConnectionMethodStringAttributeL");
+    return ret;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::SetConnectionMethodIntAttributeL
+// -----------------------------------------------------------------------------
+//
+TInt CIptvTestUtilModule::SetConnectionMethodIntAttributeL( CStifItemParser& aItem )
+    {
+        VCXLOGLO1(">>>CIptvTestUtilModule::SetConnectionMethodIntAttributeL");
+        // Print to UI
+        _LIT( KIptvTestUtilConnect, "IptvTestUtilModule" );
+        _LIT( KWhere, "In SetConnectionMethodIntAttributeL" );
+        TestModuleIf().Printf( 0, KIptvTestUtilConnect, KWhere );
+        // Print to log file
+        iLog->Log( KWhere );
+
+        TInt ret( KErrNotSupported );
+
+        if( !iTestUtilALR )
+            {
+            iTestUtilALR = CIptvTestUtilALR::NewL();
+            }
+
+        aItem.SetParsingType(CStifItemParser::EQuoteStyleParsing);
+
+        TPtrC destinationName;
+        TPtrC methodName;
+        TInt attribute;
+        TInt value;
+
+        User::LeaveIfError( aItem.GetNextString( destinationName ) );
+        User::LeaveIfError( aItem.GetNextString( methodName ) );
+        User::LeaveIfError( aItem.GetNextInt( attribute ) );
+        User::LeaveIfError( aItem.GetNextInt( value ) );
+
+        TRAP(ret, iTestUtilALR->SetMethodIntAttributeL( destinationName, methodName, attribute, value ) );
+
+        VCXLOGLO2("<<<CIptvTestUtilModule:: returning: %d", ret);
+        VCXLOGLO1("<<<CIptvTestUtilModule::SetConnectionMethodIntAttributeL");
+        return ret;
+        }
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::DeleteDestinationL
+// -----------------------------------------------------------------------------
+//
+TInt CIptvTestUtilModule::SetConnectionMethodBoolAttributeL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CIptvTestUtilModule::SetConnectionMethodBoolAttributeL");
+    // Print to UI
+    _LIT( KIptvTestUtilConnect, "IptvTestUtilModule" );
+    _LIT( KWhere, "In SetConnectionMethodBoolAttributeL" );
+    TestModuleIf().Printf( 0, KIptvTestUtilConnect, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    TInt ret( KErrNotSupported );
+
+    if( !iTestUtilALR )
+        {
+        iTestUtilALR = CIptvTestUtilALR::NewL();
+        }
+
+    aItem.SetParsingType(CStifItemParser::EQuoteStyleParsing);
+
+    TPtrC destinationName;
+    TPtrC methodName;
+    TInt attribute;
+    TInt value;
+
+    User::LeaveIfError( aItem.GetNextString( destinationName ) );
+    User::LeaveIfError( aItem.GetNextString( methodName ) );
+    User::LeaveIfError( aItem.GetNextInt( attribute ) );
+    User::LeaveIfError( aItem.GetNextInt( value ) );
+
+    TRAP(ret, iTestUtilALR->SetMethodBoolAttributeL( destinationName, methodName, attribute, static_cast<TBool>(value) ) );
+
+    VCXLOGLO2("<<<CIptvTestUtilModule:: returning: %d", ret);
+    VCXLOGLO1("<<<CIptvTestUtilModule::SetConnectionMethodBoolAttributeL");
+    return ret;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::CreateFileL
+// -----------------------------------------------------------------------------
+//
+TInt CIptvTestUtilModule::CreateFileL(CStifItemParser& aItem )
+	{
+    VCXLOGLO1(">>>CIptvTestUtilModule::CreateFileL");
+    aItem.SetParsingType(CStifItemParser::EQuoteStyleParsing);
+	TPtrC fileName;
+	User::LeaveIfError( aItem.GetNextString( fileName ) );
+
+    RFile file;
+    CleanupClosePushL(file);
+    TInt err = file.Replace(iFs, fileName, EFileWrite);
+    CleanupStack::PopAndDestroy( &file );
+    VCXLOGLO2("<<<CIptvTestUtilModule:: returning: %d", err);
+    VCXLOGLO1("<<<CIptvTestUtilModule::CreateFileL");
+    return err;
+	}
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::DeleteFileL
+// -----------------------------------------------------------------------------
+//
+TInt CIptvTestUtilModule::DeleteFileL(CStifItemParser& aItem )
+	{
+    VCXLOGLO1(">>>CIptvTestUtilModule::DeleteFileL");
+    aItem.SetParsingType(CStifItemParser::EQuoteStyleParsing);
+	TPtrC fileName;
+	User::LeaveIfError( aItem.GetNextString( fileName ) );
+    TInt err = iFs.Delete( fileName );
+    VCXLOGLO2("<<<CIptvTestUtilModule:: returning: %d", err);
+    VCXLOGLO1("<<<CIptvTestUtilModule::DeleteFileL");
+    return err;
+	}
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::CreateFolderL
+// -----------------------------------------------------------------------------
+//
+TInt CIptvTestUtilModule::CreateFolderL(CStifItemParser& aItem )
+	{
+    VCXLOGLO1(">>>CIptvTestUtilModule::CreateFolderL");
+    aItem.SetParsingType(CStifItemParser::EQuoteStyleParsing);
+	TPtrC path;
+	User::LeaveIfError( aItem.GetNextString( path ) );
+    BaflUtils::EnsurePathExistsL(iFs, path);
+    VCXLOGLO1("<<<CIptvTestUtilModule::CreateFolderL");
+    return KErrNone;
+	}
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::DeleteFolderL
+// -----------------------------------------------------------------------------
+//
+TInt CIptvTestUtilModule::DeleteFolderL(CStifItemParser& aItem )
+	{
+    VCXLOGLO1(">>>CIptvTestUtilModule::DeleteFolderL");
+    aItem.SetParsingType(CStifItemParser::EQuoteStyleParsing);
+	TPtrC path;
+	User::LeaveIfError( aItem.GetNextString( path ) );
+    CFileMan* fileMan = CFileMan::NewL(iFs);
+    CleanupStack::PushL(fileMan);
+	fileMan->RmDir( path );
+	CleanupStack::PopAndDestroy( fileMan );
+    VCXLOGLO1("<<<CIptvTestUtilModule::DeleteFolderL");
+    return KErrNone;
+	}
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::LockFileL
+// -----------------------------------------------------------------------------
+//
+TInt CIptvTestUtilModule::LockFileL(CStifItemParser& aItem )
+	{
+    VCXLOGLO1(">>>CIptvTestUtilModule::LockFileL");
+    aItem.SetParsingType(CStifItemParser::EQuoteStyleParsing);
+	TPtrC fileName;
+	User::LeaveIfError( aItem.GetNextString( fileName ) );
+
+    TInt err( KErrInUse );
+    if( !iFileIsLocked )
+    	{
+    	err = iLockedFile.Open(iFs, fileName, EFileShareExclusive | EFileOpen);
+    	iFileIsLocked = ETrue;
+    	}
+    VCXLOGLO2("<<<CIptvTestUtilModule:: returning: %d", err);
+    VCXLOGLO1("<<<CIptvTestUtilModule::LockFileL");
+    return err;
+	}
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::LockFileL
+// -----------------------------------------------------------------------------
+//
+TInt CIptvTestUtilModule::UnlockFileL(CStifItemParser& /* aItem */ )
+	{
+    VCXLOGLO1(">>>CIptvTestUtilModule::UnlockFileL");
+    if( iFileIsLocked )
+    	{
+    	iLockedFile.Close();
+    	}
+	iFileIsLocked = EFalse;
+    VCXLOGLO1("<<<CIptvTestUtilModule::UnlockFileL");
+    return KErrNone;
+	}
+
+// -----------------------------------------------------------------------------
+// CIptvTestUtilModule::SetDriveFreeSpaceL(TUint size in bytes)
+//
+// Creates dummy file so that the remaining disk space equals to given parameter
+//
+// OLD INFO???
+// Note that the videocenter considers C: drive to be full when there is 10% left,
+// so if "free space" param is 0, this leaves actually 10% of drive space free.
+// -----------------------------------------------------------------------------
+//
+TInt CIptvTestUtilModule::SetDriveFreeSpaceL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CIptvTestUtilModule::SetDriveFreeSpaceL");
+    // Print to UI
+    _LIT( KWhere, "IptvTestUtilModule" );
+    _LIT( KSetCFreeSpace, "In SetDriveFreeSpaceL" );
+    TestModuleIf().Printf( 0, KWhere, KSetCFreeSpace );
+    // Print to log file
+    iLog->Log( KSetCFreeSpace );
+
+    TPtrC driveLetter;
+    User::LeaveIfError(aItem.GetNextString( driveLetter ));
+
+    VCXLOGLO2("CVCXTestCommon:: drive: %S", &driveLetter);
+
+    TInt driveNumber(0);
+    User::LeaveIfError( iFs.CharToDrive( driveLetter[0], driveNumber ) );
+
+    TUint desiredSpace(0);
+    User::LeaveIfError(aItem.GetNextInt( desiredSpace ));
+
+    VCXLOGLO2("CVCXTestCommon:: desired space: %d", desiredSpace);
+
+    iDummyFilesCreated = ETrue;
+
+    iTestCommon->SetDriveFreeSpaceL( driveNumber, desiredSpace );
+
+    VCXLOGLO1("<<<CIptvTestUtilModule::SetDriveFreeSpaceL");
+    return KErrNone;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CIptvTestVerifyData::ExtractFile()
+// -----------------------------------------------------------------------------
+//
+TInt CIptvTestUtilModule::ExtractFileL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CIptvTestUtilModule::ExtractFile");
+
+    aItem.SetParsingType(CStifItemParser::EQuoteStyleParsing);
+
+    TPtrC zipFileName;
+    User::LeaveIfError(aItem.GetNextString( zipFileName ));
+
+    TPtrC sourceFileName;
+    User::LeaveIfError(aItem.GetNextString( sourceFileName ));
+
+    TPtrC destFileName;
+    User::LeaveIfError(aItem.GetNextString( destFileName ));
+
+    iFs.Delete( sourceFileName );
+
+    CZipFile* zipFile;
+    TRAPD(err, zipFile = CZipFile::NewL( iFs, zipFileName ) );
+
+    if( err != KErrNone )
+        {
+        VCXLOGLO2("CIptvTestUtilModule:: error %d", err);
+        delete zipFile;
+        return err;
+        }
+
+    VCXLOGLO2("CIptvTestUtilModule:: zipFileName:    %S", &zipFileName);
+    VCXLOGLO2("CIptvTestUtilModule:: sourceFileName: %S", &sourceFileName);
+    VCXLOGLO2("CIptvTestUtilModule:: destFileName:   %S", &destFileName);
+
+    if( !FileExistsInZip( zipFile, sourceFileName ) )
+        {
+        VCXLOGLO1("CIptvTestUtilModule:: No such file in zip! Leaving..");
+        delete zipFile;
+        User::Leave( KErrNotFound );
+        }
+
+    // Get zip file member from the archive
+    VCXLOGLO1("CIptvTestUtilModule:: Get zip file member from the archive");
+    CZipFileMember* member = zipFile->CaseInsensitiveMemberL( sourceFileName );
+    if( member == NULL )
+        {
+        VCXLOGLO1("CIptvTestUtilModule:: zip member is null.  Leaving..");
+        delete zipFile;
+        User::Leave(KErrGeneral);
+        }
+    CleanupStack::PushL( member );
+
+    // Get read stream for the file
+    VCXLOGLO1("CIptvTestUtilModule:: Get read stream for the file");
+    RZipFileMemberReaderStream* stream;
+    zipFile->GetInputStreamL( member, stream );
+    CleanupStack::PushL( stream );
+
+    // Alloc buffer and read the archived file
+    VCXLOGLO1("CIptvTestUtilModule:: Alloc buffer and read the archived file");
+    HBufC8* buffer = HBufC8::NewLC( member->UncompressedSize() );
+    TPtr8 bufferPtr( buffer->Des() );
+    User::LeaveIfError( stream->Read( bufferPtr, member->UncompressedSize() ) );
+
+    // Write the file to the filesystem
+    VCXLOGLO1("CIptvTestUtilModule:: Write the file to the filesystem");
+    RFile file;
+    User::LeaveIfError( file.Replace( iFs, destFileName, EFileWrite ) );
+    CleanupClosePushL( file );
+    User::LeaveIfError( file.Write(*buffer) );
+
+    delete zipFile;
+    CleanupStack::PopAndDestroy( &file );
+    CleanupStack::PopAndDestroy( buffer );
+    CleanupStack::PopAndDestroy( stream );
+    CleanupStack::PopAndDestroy( member );
+
+    VCXLOGLO1("<<<CIptvTestUtilModule::ExtractFile");
+    return 0;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CIptvTestVerifyData::FileExistsInZip()
+// -----------------------------------------------------------------------------
+//
+TBool CIptvTestUtilModule::FileExistsInZip( CZipFile* aZipFile, const TDesC& aFileName )
+    {
+    VCXLOGLO1(">>>CIptvTestVerifyData::FileExistsInZip");
+
+    CZipFileMember* member = NULL;
+
+    VCXLOGLO1("CIptvTestVerifyData:: list of members");
+    CZipFileMemberIterator* members = aZipFile->GetMembersL();
+
+    VCXLOGLO1("CIptvTestVerifyData:: loop all members");
+
+    while ((member = members->NextL()) != 0)
+        {
+        VCXLOGLO3("CIptvTestVerifyData:: member %S, size: %d", &(*member->Name()), member->CompressedSize());
+
+        if( aFileName == (*member->Name()) )
+            {
+            delete member;
+            delete members;
+            VCXLOGLO1("<<<CIptvTestVerifyData::FileExistsInZip");
+            return ETrue;
+            }
+
+        delete member;
+        }
+
+    delete members;
+    VCXLOGLO1("<<<CIptvTestVerifyData::FileExistsInZip");
+    return EFalse;
+    }
+
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+// None
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/conf/ats_apitests.txt	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,11 @@
+;Run \vado\videoplayer\tsrc\testing\tools\genATSdrop.pl from 
+;the tsrc folder to create ATS3 drop.
+DEVICE INSERT_DEVICE
+EMAIL INSERT_EMAIL
+FLASH INSERT_FLASH_IMAGE
+FLASH INSERT_FLASH_IMAGE
+FLASH INSERT_FLASH_IMAGE
+FLASH INSERT_FLASH_IMAGE
+SIS \VideoApp_Domain\videoplayer\videoplayerapp\mpxvideoplayer\sis\VideoPlayer.sisx
+INC ..\..\videoplayer_plat\video_player_file_details_dialog_api\tsrc\conf\atsconf.txt
+INC ..\..\videoplayer_plat\videoplayer_startup_api\tsrc\conf\atsconf.txt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/conf/ats_moduletests.txt	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,11 @@
+;Run \vado\videoplayer\tsrc\testing\tools\genATSdrop.pl from 
+;the tsrc folder to create ATS3 drop.
+DEVICE INSERT_DEVICE
+EMAIL INSERT_EMAIL
+FLASH INSERT_FLASH_IMAGE
+FLASH INSERT_FLASH_IMAGE
+FLASH INSERT_FLASH_IMAGE
+SIS \VideoApp_Domain\videoplayer\videoplayerapp\mpxvideoplayer\sis\VideoPlayer.sisx
+INC ..\..\mediasettings\mediasettingsengine\tsrc\mediasettingsenginetest\conf\atsconf.txt
+INC ..\..\mediasettings\videoplayersettingsengine\tsrc\vpsettingsenginetest\conf\atsconf.txt
+INC ..\..\videocollection\mpxmyvideoscollection\tsrc\mpxmvcolltest\conf\atsconf.txt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2006 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:    Build information file for API test modules under VADO video*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+PRJ_MMPFILES
+
+PRJ_TESTMMPFILES
+#include "../VCXTestCommon/group/bld.inf"
+#include "../VCXTestMyVideosCollectionClient/group/bld.inf"
+#include "../VCXTestUtilModule/group/bld.inf"
+#include "../../videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/group/bld.inf"
+#include "../../videoplayer_plat/video_player_file_details_dialog_api/tsrc/group/bld.inf"
+#include "../../videoplayer_plat/videoplayer_startup_api/tsrc/group/bld.inf"
+#include "../../mediasettings/mediasettingsengine/tsrc/mediasettingsenginetest/group/bld.inf"
+#include "../../mediasettings/videoplayersettingsengine/tsrc/vpsettingsenginetest/group/bld.inf"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/testing/inc/mpxlog.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,56 @@
+/*
+* 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:    Debug print macros*
+*/
+
+
+
+
+#ifndef MPXLOG_H
+#define MPXLOG_H
+
+// INCLUDES
+#include <e32std.h>
+#include <e32svr.h>
+#include <e32property.h>
+
+#include <mpxvideo_debug.h>
+
+#ifdef _DEBUG
+
+#define MPX_FUNC(fn)                TFunctionTrace _s(_L(fn));
+#define MPX_FUNC_EX(fn)             TFunctionTrace _s(_L(fn), this);
+    
+// print out (index, id) for each level and the first 15 ids at top level
+#define MPX_DEBUG_PATH(aPath)
+#define MPX_DEBUG_THREAD(ss)
+#define MPX_DEBUG_PATH(aPath)
+#define MPX_DEBUG_THREAD(ss)
+
+#else // _DEBUG
+
+#define MPX_FUNC(fn)                
+#define MPX_FUNC_EX(fn)             
+    
+// print out (index, id) for each level and the first 15 ids at top level
+#define MPX_DEBUG_PATH(aPath)
+#define MPX_DEBUG_THREAD(ss)
+#define MPX_DEBUG_PATH(aPath)
+#define MPX_DEBUG_THREAD(ss)
+
+#endif
+
+#endif  // MPXLOG_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/testing/inc/mpxvideo_debug.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,212 @@
+/*
+* 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:    Debug print macros*
+*/
+
+
+
+// Version : %version: 1 %
+
+
+
+
+#ifndef __MPXVIDEO_DEBUG_H__
+#define __MPXVIDEO_DEBUG_H__
+
+// INCLUDES
+#include <e32std.h>
+#include <e32svr.h>
+#include <e32des16.h>
+#include <e32property.h>
+#include <flogger.h>
+#include <e32def.h>
+
+#ifdef _DEBUG
+
+class MPXDebug
+{
+    public:
+        inline static void NullLog( TRefByValue<const TDesC16> /*aFmt*/, ... )
+        {
+        }
+
+        inline static void FileLog( TRefByValue<const TDesC16> aFmt, ... )
+        {
+            VA_LIST list;
+            VA_START(list,aFmt);
+            RFileLogger::WriteFormat( _L("Fusion"), 
+                                      _L("Fusion.txt"),
+                                      EFileLoggingModeAppend,
+                                      aFmt,
+                                      list );
+        }
+};
+
+#define FU_DEBUG MPXDebug::FileLog
+
+// MACROS
+#define MPX_ENTER_EXIT        TEnterExitLog _s
+
+class TFusionLog : public TDes16Overflow
+{
+    public:
+        
+        inline static void FusionLog( TRefByValue<const TDesC16> aFmt, ... )
+        {
+            TBuf< 512 > buffer;
+            
+            VA_LIST list;
+            VA_START( list, aFmt );
+            buffer.AppendFormatList( aFmt, list );
+            VA_END(list);
+            
+            FU_DEBUG(_L("#Fu# %S"), &buffer );
+        }
+};
+
+class TMpxLog : public TDes16Overflow
+{
+    public:
+        
+        inline static void MpxLog( TRefByValue<const TDesC16> aFmt, ... )
+        {
+            TBuf< 512 > buffer;
+            
+            VA_LIST list;
+            VA_START( list, aFmt );
+            buffer.AppendFormatList( aFmt, list );
+            VA_END(list);
+            
+            FU_DEBUG(_L("#Mpx# %S"), &buffer );
+        }
+};
+
+#define MPX_DEBUG TMpxLog::MpxLog
+#define MPX_DEBUG1(s)             MPX_DEBUG(_L(#s))
+#define MPX_DEBUG2(s, a)          MPX_DEBUG(_L(#s), a)
+#define MPX_DEBUG3(s, a, b)       MPX_DEBUG(_L(#s), a, b)
+#define MPX_DEBUG4(s, a, b, c)    MPX_DEBUG(_L(#s), a, b, c)
+#define MPX_DEBUG5(s, a, b, c, d) MPX_DEBUG(_L(#s), a, b, c, d)
+
+class TFunctionTrace
+    {
+    public:
+        TFunctionTrace(TRefByValue<const TDesC> aName, TAny* aThis=NULL):
+            iStr(aName), iThis(aThis)
+            {
+            //iThis ? MPX_DEBUG3("-->%S, 0x%08x",&iStr, iThis) : MPX_DEBUG2("-->%S",&iStr);
+            iThis ? MPX_DEBUG(_L("-->%S, 0x%08x"),&iStr, iThis) : MPX_DEBUG(_L("-->%S"),&iStr);
+            }
+        ~TFunctionTrace()
+            {
+            //iThis ? MPX_DEBUG3("<--%S, 0x%08x",&iStr, iThis) : MPX_DEBUG2("<--%S",&iStr);
+            iThis ? MPX_DEBUG(_L("<--%S, 0x%08x"),&iStr, iThis) : MPX_DEBUG(_L("<--%S"),&iStr);
+            }
+    private:
+        TPtrC iStr;
+        TAny* iThis;
+    };
+    
+class TEnterExitLog : public TDes16Overflow
+{
+    public:
+        
+        void Overflow(TDes16& /*aDes*/)
+        {
+            FU_DEBUG(_L("%S Logging Overflow"), &iFunctionName);
+        }
+
+        TEnterExitLog( TRefByValue<const TDesC> aFunctionName,
+                       TRefByValue<const TDesC> aFmt, ... )
+        {
+            iFunctionName = HBufC::New( TDesC(aFunctionName).Length() );
+            
+            if ( iFunctionName )
+            {
+                iFunctionName->Des().Copy(aFunctionName);
+            }
+            
+            TBuf< 512 > buffer;
+            
+            VA_LIST list;
+            VA_START( list, aFmt );
+            buffer.AppendFormatList( aFmt, list, this );
+            VA_END(list);
+            
+            FU_DEBUG(_L("#Fu# --> %S %S"), iFunctionName, &buffer );
+        }
+        
+        TEnterExitLog( TRefByValue<const TDesC> aFunctionName )
+        {
+            iFunctionName = HBufC::New( TDesC(aFunctionName).Length() );
+            
+            if ( iFunctionName )
+            {
+                iFunctionName->Des().Copy(aFunctionName);
+            }
+            
+            FU_DEBUG(_L("#Fu# --> %S"), iFunctionName );
+        }
+        
+        ~TEnterExitLog()
+        {
+            FU_DEBUG(_L("#Fu# <-- %S"), iFunctionName );
+            delete iFunctionName;
+        }
+        
+    private:
+        HBufC*    iFunctionName;
+};
+
+_LIT(_KMPXErrorInfo, "#Fu# MPXVideo Error : error %d file %s line %d");
+
+#define MPX_S(a) _S(a)
+
+#define MPX_ERROR_LOG(aErr) \
+    {\
+        if (aErr) \
+            FU_DEBUG(_KMPXErrorInfo, aErr, MPX_S(__FILE__), __LINE__);\
+    }
+
+#define MPX_TRAP(_r, _s) TRAP(_r,_s);MPX_ERROR_LOG(_r);
+#define MPX_TRAPD(_r, _s) TRAPD(_r,_s);MPX_ERROR_LOG(_r);
+
+///////////////////////////////////////////////////
+#else // UREL VERSION STARTS HERE
+///////////////////////////////////////////////////
+
+#define FU_DEBUG 
+
+// MACROS
+#define MPX_ENTER_EXIT        
+
+#define MPX_DEBUG 
+#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_S(a) 
+
+#define MPX_ERROR_LOG(aErr) 
+
+#define MPX_TRAP(_r, _s) TRAP(_r,_s);
+#define MPX_TRAPD(_r, _s) TRAPD(_r,_s); 
+
+#endif // _DEBUG
+
+#endif  // __MPXVIDEO_DEBUG_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/testing/ini/01-unit/TestFramework.ini	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,1 @@
+e:\ec_tmpdir\T2a07300: No such file or directory
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/testing/ini/02-settings/TestFramework.ini	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,207 @@
+#
+# 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'.
+#   + XML, Test report will be xml type, for example 'TestReport.xml'.
+#          Note, that xml format is available only when output is set to FILE.
+#
+# 	- 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\Fusion\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT         # Possible values: TXT, HTML or XML
+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= stifmeasurementplugin04  # Possible values are:
+              # 'stifmeasurementdisablenone', 'stifmeasurementdisableall'
+              # 'stifmeasurementplugin01', 'stifmeasurementplugin02',
+              # 'stifmeasurementplugin03', 'stifmeasurementplugin04',
+              # 'stifmeasurementplugin05' or 'stifbappeaprofiler'
+
+Timeout= 0                    # Default timeout value for each test case. In milliseconds
+#UITestingSupport= YES        # Possible values: YES or NO
+#SeparateProcesses= YES       # Possible values: YES or NO (default: NO)
+[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\mpxmediasettingsenginetest.cfg
+TestCaseFile= c:\TestFramework\vcxnssettingsenginetest.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:\LOGS\TestFramework\
+EmulatorFormat= HTML			# Possible values: TXT or HTML
+EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+HardwareBasePath=  C:\
+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]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set filters to be used by ConsoleUI.
+# 	If you want to use filter with ConsoleUI, simply remove comments
+# 	from section below and provide valid filter entries.
+#   Each filter line has to start with "filter= " keyword.
+#   Filter can contain special wildcard characters:
+#     *  which stands for none or any literal;
+#     ?  which stands for single character.
+#   Filters are not case-sensitive.
+
+#[Filters]
+#filter= *math*
+#filter= *radio*
+#[End_Filters]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/testing/ini/03-mv/TestFramework.ini	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,236 @@
+#
+# 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'.
+#   + XML, Test report will be xml type, for example 'TestReport.xml'.
+#          Note, that xml format is available only when output is set to FILE.
+#
+# 	- 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\Fusion\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT         # Possible values: TXT, HTML or XML
+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= stifmeasurementplugin04  # Possible values are:
+              # 'stifmeasurementdisablenone', 'stifmeasurementdisableall'
+              # 'stifmeasurementplugin01', 'stifmeasurementplugin02',
+              # 'stifmeasurementplugin03', 'stifmeasurementplugin04',
+              # 'stifmeasurementplugin05' or 'stifbappeaprofiler'
+
+Timeout= 0                    # Default timeout value for each test case. In milliseconds
+#UITestingSupport= YES        # Possible values: YES or NO
+#SeparateProcesses= YES       # Possible values: YES or NO (default: NO)
+[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\VCXMyVideosCollectionPluginTestDownload.cfg
+TestCaseFile= c:\testframework\VCXMyVideosCollectionPluginTestDownload2.cfg
+TestCaseFile= c:\testframework\VCXMyVideosCollectionPluginTestMoveCopy.cfg
+TestCaseFile= c:\testframework\VCXMyVideosCollectionPluginTestDelete.cfg
+TestCaseFile= c:\testframework\VCXMyVideosCollectionPluginTestSideload.cfg
+TestCaseFile= c:\testframework\VCXMyVideosCollectionPluginTestLists.cfg
+TestCaseFile= c:\testframework\VCXMyVideosCollectionPluginTestSorting.cfg
+TestCaseFile= c:\testframework\VCXMyVideosCollectionPluginTestAttributes.cfg
+TestCaseFile= c:\testframework\VCXMyVideosCollectionPluginTestBigFiles.cfg
+TestCaseFile= c:\testframework\VCXMyVideosCollectionPluginTestMultipleDls.cfg
+TestCaseFile= c:\testframework\VCXMyVideosCollectionPluginTestFullMemory.cfg
+TestCaseFile= c:\testframework\VCXMyVideosCollectionPluginTestMultiDrives.cfg
+[End_Module]
+
+;These are either not needed or not ready
+;TestCaseFile= c:\testframework\VCXMyVideosCollectionPluginTestDownloadSync.cfg
+;TestCaseFile= c:\testframework\VCXMyVideosCollectionPluginTestDownloadWlan.cfg
+;TestCaseFile= c:\testframework\VCXMyVideosCollectionPluginTestEvents.cfg
+;TestCaseFile= c:\testframework\VCXMyVideosCollectionPluginTestSideloadStress.cfg
+;TestCaseFile= c:\testframework\VCXMyVideosCollectionPluginTestDownloadConnUtil.cfg
+;TestCaseFile= c:\testframework\VCXMyVideosCollectionPluginTestDownloadStress.cfg
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+#Load testmoduletestsdkvolumecontrol, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuletestsdkvolumecontrol used initialization file
+#IniFile= init.txt
+
+#TestModuletestsdkvolumecontrol used configuration file(s)
+#TestCaseFile= testcases1.cfg
+#TestCaseFile= testcases2.cfg
+#TestCaseFile= 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:\LOGS\TestFramework\
+EmulatorFormat= TXT			# Possible values: TXT or HTML
+EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+HardwareBasePath=  C:\
+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]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set filters to be used by ConsoleUI.
+# 	If you want to use filter with ConsoleUI, simply remove comments
+# 	from section below and provide valid filter entries.
+#   Each filter line has to start with "filter= " keyword.
+#   Filter can contain special wildcard characters:
+#     *  which stands for none or any literal;
+#     ?  which stands for single character.
+#   Filters are not case-sensitive.
+
+#[Filters]
+#filter= *math*
+#filter= *radio*
+#[End_Filters]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/testing/ini/04-connutil/TestFramework.ini	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,208 @@
+#
+# 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'.
+#   + XML, Test report will be xml type, for example 'TestReport.xml'.
+#          Note, that xml format is available only when output is set to FILE.
+#
+# 	- 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\Fusion\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT         # Possible values: TXT, HTML or XML
+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= stifmeasurementplugin04  # Possible values are:
+              # 'stifmeasurementdisablenone', 'stifmeasurementdisableall'
+              # 'stifmeasurementplugin01', 'stifmeasurementplugin02',
+              # 'stifmeasurementplugin03', 'stifmeasurementplugin04',
+              # 'stifmeasurementplugin05' or 'stifbappeaprofiler'
+
+Timeout= 0                    # Default timeout value for each test case. In milliseconds
+#UITestingSupport= YES        # Possible values: YES or NO
+#SeparateProcesses= YES       # Possible values: YES or NO (default: NO)
+[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\VCXConnUtilTestSNAP.cfg
+TestCaseFile= c:\testframework\VCXConnUtilTestMasterAndSlave.cfg
+TestCaseFile= c:\testframework\VCXConnUtilTestStates.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:\LOGS\TestFramework\
+EmulatorFormat= TXT			# Possible values: TXT or HTML
+EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+HardwareBasePath=  C:\
+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]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set filters to be used by ConsoleUI.
+# 	If you want to use filter with ConsoleUI, simply remove comments
+# 	from section below and provide valid filter entries.
+#   Each filter line has to start with "filter= " keyword.
+#   Filter can contain special wildcard characters:
+#     *  which stands for none or any literal;
+#     ?  which stands for single character.
+#   Filters are not case-sensitive.
+
+#[Filters]
+#filter= *math*
+#filter= *radio*
+#[End_Filters]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/testing/ini/05-startup/TestFramework.ini	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,207 @@
+#
+# 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'.
+#   + XML, Test report will be xml type, for example 'TestReport.xml'.
+#          Note, that xml format is available only when output is set to FILE.
+#
+# 	- 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\Fusion\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT         # Possible values: TXT, HTML or XML
+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= stifmeasurementplugin04  # Possible values are:
+              # 'stifmeasurementdisablenone', 'stifmeasurementdisableall'
+              # 'stifmeasurementplugin01', 'stifmeasurementplugin02',
+              # 'stifmeasurementplugin03', 'stifmeasurementplugin04',
+              # 'stifmeasurementplugin05' or 'stifbappeaprofiler'
+
+Timeout= 0                    # Default timeout value for each test case. In milliseconds
+#UITestingSupport= YES        # Possible values: YES or NO
+#SeparateProcesses= YES       # Possible values: YES or NO (default: NO)
+[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\ui_VideoPlayerStartupApiTest.cfg
+TestCaseFile= c:\testframework\ui_VideoPlayerStartupApiTest2.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:\LOGS\TestFramework\
+EmulatorFormat= TXT			# Possible values: TXT or HTML
+EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+HardwareBasePath=  C:\
+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]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set filters to be used by ConsoleUI.
+# 	If you want to use filter with ConsoleUI, simply remove comments
+# 	from section below and provide valid filter entries.
+#   Each filter line has to start with "filter= " keyword.
+#   Filter can contain special wildcard characters:
+#     *  which stands for none or any literal;
+#     ?  which stands for single character.
+#   Filters are not case-sensitive.
+
+#[Filters]
+#filter= *math*
+#filter= *radio*
+#[End_Filters]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/testing/ini/06-details/TestFramework.ini	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,206 @@
+#
+# 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'.
+#   + XML, Test report will be xml type, for example 'TestReport.xml'.
+#          Note, that xml format is available only when output is set to FILE.
+#
+# 	- 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\Fusion\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT         # Possible values: TXT, HTML or XML
+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= stifmeasurementplugin04  # Possible values are:
+              # 'stifmeasurementdisablenone', 'stifmeasurementdisableall'
+              # 'stifmeasurementplugin01', 'stifmeasurementplugin02',
+              # 'stifmeasurementplugin03', 'stifmeasurementplugin04',
+              # 'stifmeasurementplugin05' or 'stifbappeaprofiler'
+
+Timeout= 0                    # Default timeout value for each test case. In milliseconds
+#UITestingSupport= YES        # Possible values: YES or NO
+#SeparateProcesses= YES       # Possible values: YES or NO (default: NO)
+[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\ui_FileDetailsDialogtest.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:\LOGS\TestFramework\
+EmulatorFormat= TXT			# Possible values: TXT or HTML
+EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+HardwareBasePath=  C:\
+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]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set filters to be used by ConsoleUI.
+# 	If you want to use filter with ConsoleUI, simply remove comments
+# 	from section below and provide valid filter entries.
+#   Each filter line has to start with "filter= " keyword.
+#   Filter can contain special wildcard characters:
+#     *  which stands for none or any literal;
+#     ?  which stands for single character.
+#   Filters are not case-sensitive.
+
+#[Filters]
+#filter= *math*
+#filter= *radio*
+#[End_Filters]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/testing/sis/fusion_engine_tests.pkg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,1 @@
+e:\ec_tmpdir\T2a07428: No such file or directory
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/testing/sis/fusion_unit_tests.pkg	Thu Nov 04 11:16:56 2010 +0200
@@ -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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/testing/sis/make_engine_test_sis.cmd	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,134 @@
+@rem
+@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+@rem All rights reserved.
+@rem This component and the accompanying materials are made available
+@rem under the terms of "Eclipse Public License v1.0"
+@rem which accompanies this distribution, and is available
+@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+@rem
+@rem Initial Contributors:
+@rem Nokia Corporation - initial contribution.
+@rem
+@rem Contributors:
+@rem
+@rem Description: 
+@rem
+
+@echo off
+
+call pushd \VideoApp_Domain
+call \VideoApp_Domain\videoplayer\tsrc\testing\tools\tsrpkgtool.pl -a
+call popd
+
+call del *.sisx
+
+echo ----------------------------------------
+echo VIDEOPLAYER - MEDIASETTINGSENGINETEST
+echo ----------------------------------------
+
+call pushd \VideoApp_Domain\videoplayer\mediasettings\mediasettingsengine\tsrc\mediasettingsenginetest\group
+call makesis mpxmediasettingsenginetest.pkg mediasettingsenginetest.sis
+call copy mediasettingsenginetest.sis \VideoApp_Domain\videoplayer\tsrc\testing\sis
+call popd
+call signsis.exe mediasettingsenginetest.sis mediasettingsenginetest.sisx Nokia_RnDCert_02.der Nokia_RnDCert_02.key
+call del mediasettingsenginetest.sis
+
+echo ----------------------------------------
+echo VIDEOPLAYER - VIDEOPLAYERSETTINGSENGINETEST
+echo ----------------------------------------
+
+call pushd \VideoApp_Domain\videoplayer\mediasettings\videoplayersettingsengine\tsrc\vpsettingsenginetest\group
+call makesis vcxnssettingsenginetest.pkg vcxnssettingsenginetest.sis
+call copy vcxnssettingsenginetest.sis \VideoApp_Domain\videoplayer\tsrc\testing\sis
+call popd
+call signsis.exe vcxnssettingsenginetest.sis vcxnssettingsenginetest.sisx Nokia_RnDCert_02.der Nokia_RnDCert_02.key
+call del vcxnssettingsenginetest.sis
+
+echo ----------------------------------------
+echo VIDEOPLAYER - MPXMYVIDEOSCOLLECTIONTEST
+echo ----------------------------------------
+
+call pushd \VideoApp_Domain\videoplayer\videocollection\mpxmyvideoscollection\tsrc\mpxmvcolltest\group
+call makesis VCXMyVideosCollectionPluginTest.pkg VCXMyVideosCollectionPluginTest.sis
+call copy VCXMyVideosCollectionPluginTest.sis \VideoApp_Domain\videoplayer\tsrc\testing\sis
+call popd
+call signsis.exe VCXMyVideosCollectionPluginTest.sis VCXMyVideosCollectionPluginTest.sisx Nokia_RnDCert_02.der Nokia_RnDCert_02.key
+call del VCXMyVideosCollectionPluginTest.sis
+
+echo ----------------------------------------
+echo VIDEOPLAYER - VIDEOPLAYER_STARTUP_API
+echo ----------------------------------------
+
+call pushd \VideoApp_Domain\videoplayer\videoplayer_plat\videoplayer_startup_api\tsrc\group
+call makesis VideoPlayerStartupApiTest.pkg VideoPlayerStartupApiTest.sis
+call copy VideoPlayerStartupApiTest.sis \VideoApp_Domain\videoplayer\tsrc\testing\sis
+call popd
+call signsis.exe VideoPlayerStartupApiTest.sis VideoPlayerStartupApiTest.sisx Nokia_RnDCert_02.der Nokia_RnDCert_02.key
+call del VideoPlayerStartupApiTest.sis
+
+echo ----------------------------------------
+echo VIDEOPLAYER - UT_MPXVIDEOPLAYER
+echo ----------------------------------------
+
+call pushd \VideoApp_Domain\videoplayer\videoplayerapp\mpxvideoplayer\tsrc\ut_mpxvideoplayertest\group
+call makesis mpxvideoplayertest.pkg mpxvideoplayertest.sis
+call copy mpxvideoplayertest.sis \VideoApp_Domain\videoplayer\tsrc\testing\sis
+call popd
+call signsis.exe mpxvideoplayertest.sis mpxvideoplayertest.sisx Nokia_RnDCert_02.der Nokia_RnDCert_02.key
+call del mpxvideoplayertest.sis
+
+echo ----------------------------------------
+echo VIDEOPLAYER - VIDEOHELIXTEST
+echo ----------------------------------------
+
+call pushd VideoApp_Domain\videoplayer\videoplayback\videohelix\tsrc\ut_videohelixtest\group
+call makesis videohelixtest.pkg videohelixtest.sis
+call copy videohelixtest.sis \VideoApp_Domain\videoplayer\tsrc\testing\sis
+call popd
+call signsis.exe videohelixtest.sis videohelixtest.sisx Nokia_RnDCert_02.der Nokia_RnDCert_02.key
+call del videohelixtest.sis
+
+echo ----------------------------------------
+echo VIDEOPLAYER_PLAT - FILE_DETAILS_DIALOG_API
+echo ----------------------------------------
+
+call pushd \VideoApp_Domain\videoplayer\videoplayer_plat\video_player_file_details_dialog_api\tsrc\group
+call makesis ui_FileDetailsDialogtest.pkg ui_FileDetailsDialogtest.sis
+call copy ui_FileDetailsDialogtest.sis \VideoApp_Domain\videoplayer\tsrc\testing\sis
+call popd
+call signsis.exe ui_FileDetailsDialogtest.sis ui_FileDetailsDialogtest.sisx Nokia_RnDCert_02.der Nokia_RnDCert_02.key
+call del ui_FileDetailsDialogtest.sis
+
+echo ----------------------------------------
+echo VIDEOUTILS - VIDEOSCHEDULER_APITEST
+echo ----------------------------------------
+
+call pushd \VideoApp_Domain\videoutils\videoutils_plat\videoscheduler_api\tsrc\group
+call makesis videoscheduler_apitest.pkg videoscheduler_apitest.sis
+call copy videoscheduler_apitest.sis \VideoApp_Domain\videoplayer\tsrc\testing\sis
+call popd
+call signsis.exe videoscheduler_apitest.sis videoscheduler_apitest.sisx Nokia_RnDCert_02.der Nokia_RnDCert_02.key
+call del videoscheduler_apitest.sis
+
+echo ----------------------------------------
+echo VIDEOUTILS - VIDEOCONNUTILITY_APITEST
+echo ----------------------------------------
+
+call pushd \VideoApp_Domain\videoutils\videoutils_plat\videoconnutility_api\tsrc\group
+call makesis videoconnutility_apitest.pkg videoconnutility_apitest.sis
+call copy videoconnutility_apitest.sis \VideoApp_Domain\videoplayer\tsrc\testing\sis
+call popd
+call signsis.exe videoconnutility_apitest.sis videoconnutility_apitest.sisx Nokia_RnDCert_02.der Nokia_RnDCert_02.key
+call del videoconnutility_apitest.sis
+
+echo ----------------------------------------
+echo WHOLE SET
+echo ----------------------------------------
+
+call makesis fusion_engine_tests.pkg fusion_engine_tests.sis
+call signsis.exe fusion_engine_tests.sis fusion_engine_tests.sisx Nokia_RnDCert_02.der Nokia_RnDCert_02.key
+call del fusion_engine_tests.sis
+
+call pushd \VideoApp_Domain
+call \VideoApp_Domain\videoplayer\tsrc\testing\tools\tsrpkgtool.pl -r
+call popd
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/testing/tools/backslashest2forward.pl	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,126 @@
+#
+# 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 "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: 
+#
+
+
+#------------------------------------------------------------------------------------
+# Includes
+#------------------------------------------------------------------------------------
+#use strict;
+use warnings;
+use Cwd; # for cwd
+use FindBin; # for FindBin:Bin
+use File::Path; # for mkpath
+use Date::Calc;
+
+my @files;
+
+FindFiles(".", "cpp", 1, \@files, "");
+FindFiles(".", "h", 1, \@files, "");
+
+foreach $file ( @files )
+{
+    my $found = 0;
+
+    if(!open(FILE_HANDLE, "$file") )
+    {
+        print("ERROR! Could not open file '$file'\n");
+        die;
+    }
+
+	my @array = <FILE_HANDLE>;
+	close(FILE_HANDLE);
+
+    foreach $line ( @array )
+    {
+        if( $line =~ m/#include/ && $line =~ m/\\/ )
+        {
+            print("\n\nCHANGING: $file\n");
+            $found = 1;
+            if(!open(FILE_HANDLE2, ">$file") )
+            {
+                print("ERROR! Could not open file for writing '$file'\n");
+                die;
+            }
+
+            rename $file,"$file.OLD";
+#            unlink $file;
+        }
+
+    }
+
+    if( $found )
+    {
+        foreach $line ( @array )
+        {
+            if( $line =~ m/#include/ && $line =~ m/\\/ )
+            {
+                print(" - old: $line");
+                $line =~ s/\\/\//g;
+                print(" - new: $line");
+            }
+            print FILE_HANDLE2 ($line);
+        }
+
+        close(FILE_HANDLE2);
+        $found = 0;
+    }
+
+}
+
+
+
+#------------------------------------------------------------------------------------
+# FindFiles
+# Parameters:
+#	$goDir, where to start finding
+#	$fileSearch, filename search
+#	$searchType, 0 = fullname search, 1 = filetype search
+#	$refIncfiles, reference to array which will hold found files
+#------------------------------------------------------------------------------------
+sub FindFiles
+{
+	my ($godir, $fileSearch, $searchType, $refIncfiles, $fileFilter) = @_;
+
+	my $startDir = cwd;
+
+	chdir($godir);
+
+	#print("Now in: " . cwd . "\n");
+
+	opendir(DIR, ".");
+	my @filelist = sort(readdir(DIR));
+	closedir(DIR);
+
+	foreach my $file(@filelist)
+	{
+		if($file eq "." or $file eq "..") {next};
+
+		if (-d $file)
+		{
+		 	FindFiles( $file, $fileSearch, $searchType, $refIncfiles, $fileFilter );
+		} else
+		{
+			if( ($file =~ m/$fileSearch/i and $searchType == 0 and $file =~m/$fileFilter/i) or ($file =~ m/$fileSearch$/i and $searchType == 1 and $file =~m/$fileFilter/i) )
+			{
+                $file = cwd . "/" . $file;
+				push @$refIncfiles, $file;
+				#print("$file\n");
+			}
+		}
+	}
+
+	chdir ($startDir);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/testing/tools/builder.pl	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,1 @@
+e:\ec_tmpdir\T2a07620: No such file or directory
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/testing/tools/copylogheaders.cmd	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,21 @@
+@rem
+@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+@rem All rights reserved.
+@rem This component and the accompanying materials are made available
+@rem under the terms of "Eclipse Public License v1.0"
+@rem which accompanies this distribution, and is available
+@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+@rem
+@rem Initial Contributors:
+@rem Nokia Corporation - initial contribution.
+@rem
+@rem Contributors:
+@rem
+@rem Description:
+@rem
+
+call pushd \VideoApp_Domain\videoplayer\tsrc\testing\inc\
+call copy mpxvideo_debug.h \VideoApp_Domain\videoplayer\inc\mpxvideo_debug.h
+call copy mpxvideo_debug.h \epoc32\include\platform\mw
+call copy mpxlog.h \epoc32\include\platform\mw
+call popd
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/testing/tools/copylogsfromdirs.pl	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,376 @@
+#
+# 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 "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: 
+#
+
+#------------------------------------------------------------------------------------
+# Includes
+#------------------------------------------------------------------------------------
+#use strict;
+use warnings;
+use Cwd; # for cwd
+use FindBin; # for FindBin:Bin
+use File::Path; # for mkpath
+use Date::Calc;
+
+while(scalar(@ARGV) >= 1)
+{
+	my $argument = shift(@ARGV);
+
+	if($argument eq "-release")
+	{
+		#$paramRelease = shift(@ARGV);
+	}
+	else
+	{
+		print "arg: $argument\n";
+		Help();
+	}
+}
+
+sub Help
+{
+    print <<USAGE_EOF;
+
+USAGE_EOF
+
+	exit();
+}
+
+#------------------------------------------------------------------------------------
+# Main code
+#------------------------------------------------------------------------------------
+
+my $startDir = cwd;
+
+print("here: $startDir\n");
+
+opendir(DIR, ".");
+my @dirs = sort( readdir(DIR) );
+closedir(DIR);
+
+foreach my $dir(@dirs)
+{
+	print("search $dir\n");
+	if($dir eq "." or $dir eq "..") {next};
+
+	if (-d $dir)
+	{
+	    if($file eq "." or $file eq "..") {next};
+
+	 	my $log = FindFile($dir, "iptvlog.txt", 0);
+	 	my $report = FindFile($dir, "testreport.txt", 0);
+	 	my $ctcdata = FindFile($dir, "ctcdata.txt", 0);
+	 	$log =~ s/\//\\/;
+	 	$report =~ s/\//\\/;
+	 	$ctcdata =~ s/\//\\/;
+
+	 	print("found $log\n");
+	 	print("found $report\n");
+	 	if($report ne "" and $log ne "")
+	 	{
+            my $file = GetFilename($log);
+            my $pos = rindex($file, ".");
+            my $ext = substr($file, $pos);
+            my $file = substr($file, 0, $pos);
+            $file = $file . "_" . $dir . $ext;
+            my $logdest = $startDir . "\\" . $file;
+	     	$logdest =~ s/\//\\/;
+	     	system("copy \"$log\" \"$logdest\"\n\n");
+
+            $file = GetFilename($report);
+            $pos = rindex($file, ".");
+            $ext = substr($file, $pos);
+            $file = substr($file, 0, $pos);
+            $file = $file . "_" . $dir . $ext;
+            my $reportdest = $startDir . "\\" . $file;
+	     	$reportdest =~ s/\//\\/;
+	     	system("copy \"$report\" \"$reportdest\"\n\n");
+
+            if( $ctcdata ne "" )
+            {
+                $file = GetFilename($ctcdata);
+                $pos = rindex($file, ".");
+                $ext = substr($file, $pos);
+                $file = substr($file, 0, $pos);
+                $file = $file . "_" . $dir . $ext;
+                my $ctcdest = $startDir . "\\" . $file;
+    	     	$ctcdest =~ s/\//\\/;
+    	     	system("copy \"$ctcdata\" \"$ctcdest\"\n\n");
+            }
+	 	}
+	}
+}
+
+chdir ($startDir);
+
+exit();
+
+
+#------------------------------------------------------------------------------------
+# FindFiles
+# Parameters:
+#	$goDir, where to start finding
+#	$fileSearch, filename search
+#	$searchType, 0 = fullname search, 1 = filetype search
+#	$refFiles, reference to array which will hold found files
+#------------------------------------------------------------------------------------
+sub FindFiles
+{
+	my ($godir, $fileSearch, $searchType, $refFiles) = @_;
+
+	my $startDir = cwd;
+
+	chdir($godir);
+
+	#print("Now in: " . cwd . "\n");
+
+	opendir(DIR, ".");
+	my @filelist = sort(readdir(DIR));
+	closedir(DIR);
+
+	foreach my $file(@filelist)
+	{
+		if($file eq "." or $file eq "..") {next};
+
+		if (-d $file)
+		{
+		 	FindFiles( $file, $fileSearch, $searchType, $refFiles );
+		} else
+		{
+			if( ($file =~ m/$fileSearch/i and $searchType == 0) or ($file =~ m/$fileSearch$/i and $searchType == 1) )
+			{
+                $file = cwd . "/" . $file;
+				push @$refFiles, $file;
+				print("$file\n");
+			}
+		}
+	}
+
+	chdir ($startDir);
+}
+
+
+
+#------------------------------------------------------------------------------------
+# FindDirectory
+#
+# Parameters:
+#	$goDir, where to start finding
+#	$fileSearch, filename search
+#	$minSize, minimum size for the directory
+#
+# Returns the directory found.
+#------------------------------------------------------------------------------------
+sub FindDirectory
+{
+	my ($godir, $fileSearch, $dontCheckSubFolders, $minSize) = @_;
+
+	my $startDir = cwd;
+
+    #print("Now in $startDir\n");
+    print("minsize: $minSize for $fileSearch\n") if($minSize);
+
+	chdir($godir);
+
+	opendir(DIR, ".");
+	my @filelist = sort(readdir(DIR));
+	closedir(DIR);
+
+	foreach my $file(@filelist)
+	{
+		if($file eq "." or $file eq "..") {next};
+
+		if (-d $file)
+		{
+			print("($file - $fileSearch)\n");
+			if( $file =~ m/$fileSearch/i  )
+			{
+                if(!$minSize or DirSize($file) > $minSize)
+                {
+                    $file = cwd . "/" . $file;
+    				$file =~ s/\//\\/g;
+    				chdir ($startDir);
+    				return $file;
+    			}
+			}
+		}
+	}
+
+    return "" if($dontCheckSubFolders);
+
+    # Find subfolders
+	foreach my $file(@filelist)
+	{
+		if($file eq "." or $file eq "..") {next};
+
+		if (-d $file)
+		{
+		 	my $found = FindDirectory( $file, $fileSearch );
+		 	if($found ne "")
+		    {
+		        chdir ($startDir);
+		        $found =~ s/\//\\/g;
+		        return $found;
+		    }
+		}
+	}
+
+	chdir ($startDir);
+	return "";
+}
+
+
+#------------------------------------------------------------------------------------
+# FindFile
+#
+# Parameters:
+#	$goDir, where to start finding
+#	$fileSearch, filename search
+#   $minSize, minimum size for the file
+#
+# Returns the file found.
+#------------------------------------------------------------------------------------
+sub FindFile
+{
+	my ($godir, $fileSearch, $dontCheckSubFolders, $minSize) = @_;
+
+	my $startDir = cwd;
+
+    #print("Now in $startDir\n");
+
+	chdir($godir);
+
+	opendir(DIR, ".");
+	my @filelist = sort(readdir(DIR));
+	closedir(DIR);
+
+	foreach my $file(@filelist)
+	{
+		if($file eq "." or $file eq "..") {next};
+
+		if( $file =~ m/$fileSearch/i and !(-d $file) )
+		{
+            if(!$minSize or -s $file > $minSize)
+            {
+                $file = cwd . "/" . $file;
+    			$file =~ s/\//\\/g;
+    			chdir ($startDir);
+    			return $file;
+    		}
+		}
+	}
+
+    return "" if($dontCheckSubFolders);
+
+    # Find subfolders
+	foreach my $file(@filelist)
+	{
+		if($file eq "." or $file eq "..") {next};
+
+		if (-d $file)
+		{
+		 	my $found = FindFile( $file, $fileSearch );
+		 	if($found ne "")
+		    {
+		        chdir ($startDir);
+		        $found =~ s/\//\\/g;
+		        return $found;
+		    }
+		}
+	}
+
+	chdir ($startDir);
+	return "";
+}
+
+#------------------------------------------------------------------------------------
+# DirSize
+#
+# Parameters:
+#	$goDir, directory
+#
+# Returns the size of directory
+#------------------------------------------------------------------------------------
+sub DirSize
+{
+	my ($godir) = @_;
+
+	my $startDir = cwd;
+
+	chdir($godir);
+
+	opendir(DIR, ".");
+	my @filelist = sort(readdir(DIR));
+	closedir(DIR);
+
+    my $size = 0;
+
+	foreach my $file(@filelist)
+	{
+		if($file eq "." or $file eq "..") {next};
+
+		if (-d $file)
+		{
+			$size += DirSize($file);
+		}
+		else
+		{
+		    $size += -s $file;
+		}
+	}
+
+	chdir ($startDir);
+	return $size;
+}
+
+#------------------------------------------------------------------------------------
+# GetFilename
+#
+# Parameters:
+# 	$text
+#------------------------------------------------------------------------------------
+sub GetFilename
+{
+	my ($file) = @_;
+	$file =~ s/\//\\/g; # / -> \
+    my $pos = rindex($file, "\\");
+    die("Invalid path: $file\n") if($pos == -1);
+    return substr($file, $pos+1);
+}
+
+#------------------------------------------------------------------------------------
+# RemoveWhiteSpaces
+#
+# Parameters:
+# 	$text
+#------------------------------------------------------------------------------------
+sub RemoveWhiteSpaces()
+{
+	my ($text) = @_;
+	${$text} =~ s/\s+$//; #whitespaces in the end
+	${$text} =~ s/^\s+//; #whitespaces at the start
+}
+
+#------------------------------------------------------------------------------------
+# Timestamp
+#
+# Parameters:
+#------------------------------------------------------------------------------------
+sub Timestamp
+{
+    my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time);
+
+    return "" . ($year+1900) . "-" . ($mon+1) . "-" . $mday . "-" . $hour . "-" . $min;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/testing/tools/genATSdrop.pl	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,2380 @@
+#
+# 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 "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: 
+#
+
+#------------------------------------------------------------------------------------
+# Includes
+#------------------------------------------------------------------------------------
+use strict;
+use warnings;
+use Cwd; # for cwd
+use FindBin; # for FindBin:Bin
+use File::Path; # for mkpath
+use Date::Calc;
+use File::Copy;
+use lib "$FindBin::Bin/../lib";
+
+{ # No globals.
+    my $cgidir = GetCgiDir();
+    
+    if ( ! -e( $cgidir . "rerunsubs.pl" ) )
+    {
+        $cgidir = cwd;
+        my $domain = "VideoApp_Domain";
+        my $pos = index( $cgidir, $domain );
+        if( $pos != -1 )
+        {
+            $cgidir = substr( $cgidir, 0, $pos + length( $domain ) ) . "\\videoplayer\\tsrc\\testing\\tools\\";
+            
+        }
+    }
+    require( $cgidir . "utils.pl" );
+    require( $cgidir . "rerunsubs.pl" );
+}
+
+#------------------------------------------------------------------------------------
+# GLOBAL CODE
+#------------------------------------------------------------------------------------
+
+my $basePath = "testdrop"; # ATS XML
+my $dropFilePath = "ATS3Drop\\"; # All other files
+my $dropImagePath = "ATS3Drop\\images\\";
+my $dropBinaryPath = "ATS3Drop\\armv5_urel\\"; # Binaries
+
+my $currentPlanId = 0;
+my $currentSessionId = 0;
+my $currentSetId = 0;
+my $currentCaseId = 0;
+my $currentStepId = 0;
+
+# Attributes for files which are copied to device. Or SIS installations.
+my $ATSFILE_NAME = 0;
+my $ATSFILE_HARNESS = 1;
+my $ATSFILE_ENABLED = 2;
+my $ATSFILE_PASSRATE = 3;
+my $ATSFILE_SIGNIFICANT = 4;
+my $ATSFILE_TYPE = 5;
+my $ATSFILE_SRC = 6;
+my $ATSFILE_DST = 7;
+my $ATSFILE_COMMAND = 9;
+my $ATSFILE_DROPFULL_PATH = 10; # Contains the path in drop to the file
+my $ATSFILE_STEP_XML = 11; # XML defining the step
+my $ATSFILE_STEP_TIMEOUT = 12; # only for SIS file
+
+# These must be replaced when writing a step into XML file
+my $ATSXML_DROPPRIORITY = "ATSXML_DROPPRIORITY";
+my $ATSXML_TESTNAME = "ATSXML_TESTNAME";
+my $ATSXML_FLASH_IMAGE_NAME = "ATSXML_FLASH_IMAGE_NAME";
+my $ATSXML_TESTDEVICE = "ATSXML_TESTDEVICE";
+my $ATSXML_TESTPLAN_NAME = "ATSXML_TESTPLAN_NAME";
+my $ATSXML_TESTSESSION_NAME = "ATSXML_TESTSESSION_NAME";
+my $ATSXML_TESTSET_NAME = "ATSXML_TESTSET_NAME";
+my $ATSXML_STEP_NAME = "ATSXML_STEP_NAME";
+my $ATSXML_TESTCASE_NAME = "ATSXML_TESTCASE_NAME";
+my $ATSXML_STEP_HARNESS = "ATSXML_STEP_HARNESS";
+my $ATSXML_STEP_ENABLED = "ATSXML_STEP_ENABLED";
+my $ATSXML_STEP_PASSRATE = "ATSXML_STEP_PASSRATE";
+my $ATSXML_STEP_SIGNIFICANT = "ATSXML_STEP_SIGNIFICANT";
+my $ATSXML_STEP_COMMAND = "ATSXML_STEP_COMMAND";
+my $ATSXML_STEP_PARAM_TYPE = "ATSXML_STEP_PARAM_TYPE";
+my $ATSXML_STEP_PARAM_SRC = "ATSXML_STEP_PARAM_SRC";
+my $ATSXML_STEP_PARAM_DST = "ATSXML_STEP_PARAM_DST";
+my $ATSXML_STEP_RUNCASES_FILENAME = "ATSXML_STEP_RUNCASES_FILENAME";
+my $ATSXML_STEP_RUNCASES_TIMEOUT = "ATSXML_STEP_RUNCASES_TIMEOUT";
+#my $ATSXML_STEP_PARAM_COMPONENT_PATH = "ATSXML_STEP_PARAM_COMPONENT_PATH";
+my $ATSXML_STEP_RUNCASE_CASENAME = "ATSXML_STEP_RUNCASE_CASENAME";
+my $ATSXML_STEP_RUNCASE_FILENAME = "ATSXML_STEP_RUNCASE_FILENAME";
+my $ATSXML_EMAIL = "ATSXML_EMAIL";
+my $ATSXML_SIS_FILENAME = "ATSXML_SIS_FILENAME";
+my $ATSXML_STEP_TIMEOUT = "ATSXML_STEP_TIMEOUT";
+my $ATSXML_FETCH_PATH = "ATSXML_FETCH_PATH";
+my $ATSXML_CTC_PATH = "ATSXML_CTC_PATH";
+
+# These are initialized in the InitXml()
+my $ATSXML_HEADER_START;
+my $ATSXML_HEADER_END;
+my $ATSXML_FOOTER;
+my $ATSXML_PLANSTART;
+my $ATSXML_CREATEDIRS;
+my $ATSXML_FLASH;
+my $ATSXML_FORMAT_DRIVES;
+my $ATSXML_PLANEND;
+my $ATSXML_STEP;
+my $ATSXML_FETCH_STEPS;
+my $ATSXML_FETCH_STEP;
+my $ATSXML_CTCWRITE_STEP;
+my $ATSXML_STEP_DEFAULT;
+my $ATSXML_STEP_BINARY;
+my $ATSXML_STEP_RUNCASES;
+my $ATSXML_STEP_RUNCASES_WITH_BOOT;
+my $ATSXML_STEP_RUNCASES_INI;
+my $ATSXML_STEP_RUNCASES_INI_WITH_BOOT;
+my $ATSXML_STEP_RUNCASE;
+my $ATSXML_STEP_INSTALLSIS;
+my $ATSXML_POSTACTION;
+
+my $atsCfgFileName = "";
+my $atsUsername = "";
+my $atsPassword = "";
+
+my $paramStartDir = "..";
+my $paramVerbose = 1;
+my $paramDebug = 0;
+my $paramFindPkgFilePath = "";
+my $paramExecuteDrop = "";
+my $paramDontDeleteGeneratedFiles = 0;
+my $paramCTC = 0;
+my $paramNameFilter = "";
+my $paramSkipFlashCopy = 0;
+my $paramForcedBuild = "";
+my $paramRerunXml = 0;
+my $paramUseSecondaryIni = 0;
+my $paramCaseClass = "";
+
+my $globalAtsHost = "10.11.2.4";
+my $globalCtcExePath = "xxx";
+my @globalFlashFiles;
+my @globalSisFiles;
+my @globalPkgFiles;
+my $globalDeviceName = "";
+my $globalDeviceVersion = "";
+my $globalDeviceHWID = "";
+my $globalEmail = "";
+my $globalIgnoreSis = 0;
+my @globalFailedCfgs;
+
+# The code
+
+InitXml();
+
+ReadArgs();
+
+if($paramExecuteDrop ne "")
+{
+    ExecuteDrop($paramExecuteDrop, 1);
+}
+else
+{
+    if($atsCfgFileName eq "")
+    {
+        ShowHelp();
+    }
+
+	ParseFile( $atsCfgFileName );
+}
+
+exit();
+
+
+#------------------------------------------------------------------------------------
+# ReadArgs
+#------------------------------------------------------------------------------------
+sub ReadArgs
+    {
+    ShowHelp() if(scalar(@ARGV) == 0);
+
+    while(scalar(@ARGV) >= 1)
+    {
+        my $argument = shift(@ARGV);
+        
+        if($argument eq "-f")
+        {
+            $atsCfgFileName = shift(@ARGV)
+        }
+        elsif($argument eq "-u")
+        {
+            $atsUsername = shift(@ARGV)
+        }
+        elsif($argument eq "-p")
+        {
+            $atsPassword = shift(@ARGV)
+        }
+        elsif($argument eq "-h")
+    	{
+    		ShowHelp();
+    	}
+    	elsif($argument eq "-q")
+    	{
+    		$paramVerbose = 0;
+    	}
+    	elsif($argument eq "-d")
+    	{
+    		$paramVerbose = 1;
+    		$paramDebug = 1;
+    	}
+    	elsif($argument eq -"filepath")
+    	{
+    	    $paramFindPkgFilePath = shift(@ARGV);
+    	}
+    	elsif($argument eq "-run")
+    	{
+    	    $paramExecuteDrop = shift(@ARGV);
+    	    $paramVerbose = 1;
+    	}
+    	elsif($argument eq "-nodelete")
+    	{
+    	    $paramDontDeleteGeneratedFiles = 1;
+    	}
+    	elsif($argument eq "-ctcrom")
+    	{
+    	    $paramCTC = 1;
+    	    $globalCtcExePath = "z:\\sys\\bin\\ctcman.exe";
+    	}
+    	elsif($argument eq "-ctcsis")
+    	{
+    	    $globalCtcExePath = "c:\\sys\\bin\\ctcman.exe";
+    	    $paramCTC = 1;
+    	}
+    	elsif($argument eq "-dropname")
+    	{
+    	    $paramNameFilter = shift(@ARGV);
+    	}
+    	elsif($argument eq "-noflash")
+    	{
+    	    $paramSkipFlashCopy = 1;
+    	}
+    	elsif( $argument eq "-atshost" )
+    	{
+        	$globalAtsHost = shift(@ARGV);
+        }
+    	elsif( $argument eq "-forcebuild" )
+    	{
+        	$paramForcedBuild = shift(@ARGV);
+        	if( !defined($paramForcedBuild) || ( $paramForcedBuild ne "udeb" && $paramForcedBuild ne "urel" ) )
+        	{
+        	    die("\n-forcebuild parameter must be 'udeb' or 'urel'");
+        	}
+        }
+    	elsif( $argument eq "-rerun" )
+    	{
+        	$paramRerunXml = 1;
+        	my $file = shift(@ARGV);
+        	die("Could not read failed cases!") if ( Rerun_ReadFailedCases( $file, \@globalFailedCfgs ) );
+            if( scalar( @globalFailedCfgs ) <= 0 )
+            {
+            	print("No fails to rerun!\n");
+            	exit();
+            }
+        }
+    	elsif( $argument eq "-allini" )
+    	{
+            $paramUseSecondaryIni = 1;
+        }
+        elsif( $argument eq "-caseclass" )
+    	{
+            $paramCaseClass = shift(@ARGV);
+        }
+    	else
+    	{
+    	    die("Unknown command line option: '$argument'.\n");
+    	}
+
+    }
+    
+    die("Parameter -f is required.\n") if( $atsCfgFileName eq "" );
+}
+
+#------------------------------------------------------------------------------------
+# ShowHelp
+#------------------------------------------------------------------------------------
+sub ShowHelp
+{
+print <<USAGE_EOF;
+genATSdrop.pl -f <drop or master cfg.txt> -u <ats username> -p <ats password>
+
+Params:
+-f <filename> Filename of ATS cfg file.
+-u <username> ATS username. not required.
+-p <password> ATS password. not required.
+-q            Quiet mode
+-d            Debug information
+-run xxx      Run xxx drop in the ATS farm. xxx can be a folder or a zip file (w/o .zip)
+-filepath xxx Where files from PKG are searched for, default is the path in PKG file.
+-h            help
+-nodelete     For default the script deletes generated files.
+-noflash      Skip copying flash files to drop.
+-ctcrom       CTC++ is installed in the ROM. Fetches the CTC result files from the device.
+-ctcsis       CTC++ is installed from SIS. Fetches the CTC result files from the device.
+-atshost      Address of ATS host to run the tests.
+-dropname xxx Runs only drops which match with xxx string.
+-forcebuild   udeb or urel -> forces to use the defined build for all executables read from PKGs
+-rerun xxx    Reads results from xml and writes only failed cases into ATS3 drop CFG files.
+-allini       Uses secondary testframework.ini file to run the cases, if it's found from init/all/ folder.
+
+Below is example for the ATS master cfg file. The commands override the 
+ATS drop cfg commands, except PKG command.
+
+[MASTERCFG]
+DEVICE Ivalo
+FLASH \\\\network\\flashimages\\core.fpsx
+FLASH \\\\network\\flashimages\\variant.fpsx
+FLASH \\\\network\\flashimages\\eraseuserdisk.fpsx
+SIS \\\\app\\sis\\app.sisx
+SIS \\\\app\\tsrc\\sistests.sisx
+IGNORESIS 
+PKG \\\\app\\tsrc\\data\\cenrepchanges.pkg
+EMAIL xxx
+; Drop configs must be in tsrc folders and they must be defined after other commands.
+INC /ido/api/module1/tsrc/conf/ats_config.txt
+INC /ido/api2/module/tsrc/conf/ats_config.txt
+[EMDMASTERCFG]
+
+Available commands for the ATS drop cfg file. List order is also the recommended order in the cfg file.
+
+ NAME XXX      Test drop name.
+ PRIORITY xxx  Test drop execution priority, 0 is the highest
+ DEVICE x1 x2 x3  x1 = Device name in the ATS system, x2 = device version (optional), x3 = device HWID (optional)
+ FLASH         File to be flashed. Can be defined with path.
+ PKG xxx       Text file listing the files which are copied into the device by ATS.
+               Uses same format as Symbian PKG files.
+ SIS x1        x1 = SIS/SISX file which needs to be installed.
+ IGNORESIS     Master cfg only, ignores SIS commands afterwards.
+ BOOT          Reboots the device. Testframework.ini must have cfg with cases Dummy1 and Dummy2.
+ INI xxx       Command to execute ini file in ATS system.
+ CFG xxx       Command to execute cfg in ATS system. Cfg files must be listed
+               in the PKG files. No path support.
+ CASELIST xxx  Command to execute invidual STIF cases from CFG files.
+ FETCH xxx     Fetches file(s) from a directory. ( FETCH e:\\analyzetool\\* )
+ EMAIL xxx     Email address(es) where ATS sends the report.
+
+ USERNAME xxx  Username for ATS login
+ PASSWORD xxx  Password for ATS login
+
+Example:
+
+[DROP]
+NAME STIF_TestDrop
+DEVICE Tube B1 1001
+FLASH \\\\network\\flashimages\\core.fpsx
+FLASH \\\\network\\flashimages\\variant.fpsx
+FLASH \\\\network\\flashimages\\eraseuserdisk.fpsx
+PKG \\\\app\\tsrc\\data\cenrepchanges.pkg
+SIS \\\\app\\sis\\app.sisx
+SIS \\\\app\\tsrc\\sis\\tests.sisx
+BOOT
+INI atsconfig\\drop1\\TestFramework.ini 1200
+EMAIL dude\@nokia.com
+[ENDDROP]
+
+USAGE_EOF
+
+	exit();
+}
+
+#------------------------------------------------------------------------------------
+# ParseFile
+# Parameters:
+#   $filename
+#------------------------------------------------------------------------------------
+sub ParseFile
+{
+	my($filename) = @_;
+	
+	# Read the file and check if it's drop conf or master conf file.
+	open(FILE_HANDLE, $filename) or die("ERROR! Could not open config file '" . $filename . "'\n");
+	my @lines = <FILE_HANDLE>;
+	close(FILE_HANDLE);
+
+	my $isDropFile = 0;
+	
+	foreach my $line (@lines)
+	{
+		if( $line =~ m/\[DROP\]/i || $line =~ m/\[ENDDROP\]/i )
+		{
+			$isDropFile++;
+		}
+	}
+	
+	if( $isDropFile >= 2 )
+	{
+    	ParseAtsCfg( $filename );
+    }
+    else
+    {
+    	ParseMasterCfg( $filename );
+    }
+}
+
+#------------------------------------------------------------------------------------
+# ParseMasterCfg
+# Parameters:
+#   $filename
+#------------------------------------------------------------------------------------
+sub ParseMasterCfg
+{
+	my($filename) = @_;
+		
+	my $index = 0;
+	
+	open(FILE_HANDLE, $filename) or die("ERROR! Could not open master config file '" . $filename . "'\n");
+	my @lines = <FILE_HANDLE>;
+	close(FILE_HANDLE);
+	
+    while($index < scalar(@lines))
+    {
+        my $line = $lines[$index];
+
+        my $cmd;
+        my $params;
+		ReadCmdFromLine( \$line, \$cmd, \$params );
+
+        #
+        # CMD FLASH
+        #
+        if($cmd eq "FLASH")
+        {
+            push @globalFlashFiles, $params;
+        }
+		
+		#
+		# CMD DEVICE
+		#
+		if( $cmd eq "DEVICE" )
+		{
+			my @paramArray = split( / /, $params );
+			$globalDeviceName = $paramArray[0] if( defined( $paramArray[0] ) );
+			$globalDeviceVersion = $paramArray[1] if( defined( $paramArray[1] ) );
+			$globalDeviceHWID = $paramArray[2] if( defined( $paramArray[2] ) );
+			print("Global device: $globalDeviceName\n");
+			print("Global device version: $globalDeviceVersion\n");
+			print("Global device HWID: $globalDeviceHWID\n");
+		}
+		
+		#
+		# CMD EMAIL
+		#
+		if( $cmd eq "EMAIL" )
+		{
+			$globalEmail = $params;
+		}
+
+        #
+        # CMD INC
+        #
+        if($cmd eq "INC")
+        {
+			# Forward slashes to backward.
+			$params =~ s/\//\\/g;
+			
+			my $pos = index( $params, "tsrc" );
+			if( $pos != -1 )
+			{
+				print("\nReading config file $params\n");
+				my $path = substr( $params, 0, $pos+4 );
+				my $file = substr( $params, $pos+5 );
+				
+				$pos = index( $file, "conf" );
+				
+				die("INC file must be in conf directory! Incorrect params: $params") if( $pos == -1);
+
+                if( $pos != 0 )
+                {
+                    $path .= "\\" . substr( $file, 0, $pos-1 );
+                    $file = substr( $file, $pos );
+                }
+				
+				my $startDir = cwd;
+				
+				# Change where the master config file is.
+				if( rindex($filename, "\\") != -1 )
+				{
+					chdir( substr($filename, 0, rindex($filename, "\\") ) );
+				}
+				
+				# Go where the drop config file is.
+				chdir( $path );
+				
+				ParseAtsCfg( $file );
+				
+				chdir( $startDir );			
+			}
+			else
+			{
+				die("ERROR! The path $params is invalid, config must be under tsrc folder.\n");
+			}
+		}
+
+        #
+        # CMD SIS
+        #
+        if( $cmd eq "SIS" )
+        {
+            print("Master CFG has SIS: $params\n"); 
+            push @globalSisFiles, $params;
+        }
+        
+        #
+        # CMD SIS
+        #
+        if( $cmd eq "IGNORESIS" )
+        {
+            print("Master CFG ignore sis command.\n"); 
+            $globalIgnoreSis = 1;
+        }
+        
+        #
+        # CMD PKG
+        #
+        if( $cmd eq "PKG" )
+        {
+            print("Master CFG has PKG: $params\n"); 
+            push @globalPkgFiles, $params;
+        }				
+		
+		$index++;
+	}
+}	
+
+#------------------------------------------------------------------------------------
+# ParseAtsCfg
+# Parameters:
+#   $filename
+#------------------------------------------------------------------------------------
+sub ParseAtsCfg
+{
+    my($filename) = @_;
+    
+	open(FILE_HANDLE, $filename) or die("ERROR! Could not open drop config file '" . $filename . "'\n");
+	my @lines = <FILE_HANDLE>;
+	close(FILE_HANDLE);
+	
+    my $index = 0;
+
+    my $testname = "";
+    my $testpriority = 0;
+    my $deviceName = "";
+    my $deviceVersion = "";
+    my $deviceHWID = "";
+    my $testClosed = 1; # is file handle closed?
+    my $planStartWritten = 0;
+    my $installationStepsWritten = 0;
+    my $additionalFilesCopiedToDrop = 0; # have ini and flash files copied to drop already.
+    my @atsFiles;
+    my @flashFiles;
+    my @sisFiles;
+    my @pkgFiles;
+    my @globalPkgFilesForConf;
+    my $startOfDropIndex = 0;
+    my $email = "";
+
+    my $cmdDropStartRead = 0;
+    my $cmdNameRead = 0;
+    my $cmdDeviceRead = 0;
+    my $cmdPkgRead = 0;
+    my $cmdSisRead = 0;
+    my $skipCurrentDrop = 0;
+
+    my $bootDefined = 0;
+    
+    my @preRunCustomXmlData;
+    my @postRunCustomXmlData;
+    
+    if( -e "custom\\prerun_custom.xml" )
+    {
+    	open( FILE_HANDLE, "custom\\prerun_custom.xml" ) or die("ERROR! Could not read conf/prerun_custom.xml.\n");
+    	@preRunCustomXmlData = <FILE_HANDLE>;
+    	close(FILE_HANDLE);
+    }
+    if( -e "custom\\postrun_custom.xml" )
+    {
+    	open( FILE_HANDLE, "custom\\postrun_custom.xml" ) or die("ERROR! Could not read conf/postrun_custom.xml.\n");
+    	@postRunCustomXmlData = <FILE_HANDLE>;
+    	close(FILE_HANDLE);
+    }
+
+    if( $paramCaseClass ne "" )
+    {
+        my $cgiDir = GetCgiDir();
+        system("perl $cgiDir" . "genCfgs.pl -c $paramCaseClass");
+
+        my @newCfgs;
+        FindFiles(".\\conf_temp", "cfg", 1, \@newCfgs);
+        if( scalar(@newCfgs) < 1 )
+        {
+            print("No class in cases. Aborting drop.\n");
+            return;
+        }
+        
+        push @globalPkgFilesForConf, "conf_temp\\cfgs.pkg";
+    }
+    
+    while($index < scalar(@lines))
+    {
+        my $line = $lines[$index];
+        
+        my $cmd;
+        my $params;		
+		ReadCmdFromLine( \$line, \$cmd, \$params );
+
+        #
+        # CMD DROP
+        #
+        if($cmd eq "[DROP]")
+        {
+            $startOfDropIndex = $index;
+            # Reset variables for this drop
+            $testpriority = 10;
+            $testname = "";
+            $deviceName = "";
+            $deviceVersion = "";
+            $deviceHWID = "";
+            $planStartWritten = 0;
+            $installationStepsWritten = 0;
+            $additionalFilesCopiedToDrop = 0;
+            undef( @atsFiles );
+            undef( @flashFiles );
+            undef( @sisFiles );
+            undef( @pkgFiles );
+            $email = "";
+
+            $basePath = "";
+
+            $currentPlanId = 0;
+            $currentSessionId = 0;
+            $currentSetId = 0;
+            $currentCaseId = 0;
+            $currentStepId = 0;
+
+            $cmdDropStartRead = 1;
+            $cmdNameRead = 0;
+            $cmdDeviceRead = 0;
+            $cmdPkgRead = 0;
+            $cmdSisRead = 0;
+        }
+
+        #
+        # CMD NAME
+        #
+        if($cmd eq "NAME" && !$skipCurrentDrop)
+        {
+            die ("Command [DROP] missing or NAME in wrong place. Line $index.") if(!$cmdDropStartRead);
+            $testname = $params;
+            
+            $basePath = $params;
+            $basePath =~ s/ /_/g;
+            
+            if( -e "$basePath.zip" ) 
+            {
+            	print("\ndel $basePath.zip\n");
+            	system("del $basePath.zip");
+            }
+
+			if( -e $basePath )
+			{
+            	print("rmdir /s /q $basePath\n");
+            	system("rmdir /s /q $basePath");
+            }
+
+            $skipCurrentDrop = 0;
+            if( $paramNameFilter ne "" )
+            {
+                if( !($testname =~ m/$paramNameFilter/i) )
+                {
+                    $skipCurrentDrop = 1;
+                    print("Skipping drop: $testname\n");
+                }
+            }
+
+            if( !$skipCurrentDrop )
+            {
+                print("\nCreating testdrop: $testname\n");
+
+                # Create needed directories
+                mkdir($basePath);
+                mkdir($basePath . "\\" . $dropFilePath);
+                mkdir($basePath . "\\" . $dropImagePath);
+                mkdir($basePath . "\\" . $dropBinaryPath);
+
+                # Open XML file for writing
+                my $xmlfilename = "$basePath\\test.xml";
+                if(!open(FILE_HANDLE_XML, ">$xmlfilename") )
+                {
+                    print("ERROR! Could not open file for writing '" . $xmlfilename . "'\n");
+                    return 0;
+                }
+                $cmdNameRead = 1;
+            }
+            $testClosed = 0;
+        }
+
+        #
+        # CMD PRIORITY
+        #
+        if($cmd eq "PRIORITY" && !$skipCurrentDrop)
+        {
+            die ("Command [DROP] missing or PRIORITY in wrong place. Line $index.") if(!$cmdDropStartRead);
+            $testpriority = $params;
+        }
+
+        #
+        # CMD DEVICE
+        #
+        if($cmd eq "DEVICE" && !$skipCurrentDrop)
+        {
+            die ("Command DEVICE in wrong place. Line $index.") if(!$cmdDropStartRead || $cmdPkgRead || $cmdSisRead );
+            # Write XML header with test name and device
+            die("Device must be set in the CFG!") if($params eq "");
+            die("NAME must be set in the cfg!") if($testname eq "");
+
+            my @paramArray = split( / /, $params );
+            $deviceName = $paramArray[0] if( defined( $paramArray[0] ) );
+            $deviceVersion = $paramArray[1] if( defined( $paramArray[1] ) );
+            $deviceHWID = $paramArray[2] if( defined( $paramArray[2] ) );
+            
+            $deviceName = $globalDeviceName if( $globalDeviceName ne "" );
+            $deviceVersion = $globalDeviceVersion if( $globalDeviceVersion ne "" );
+            $deviceHWID = $globalDeviceHWID if( $globalDeviceHWID ne "" );
+
+            my $data = $ATSXML_HEADER_START;
+            $data =~ s/$ATSXML_TESTNAME/$testname/;
+            $data =~ s/$ATSXML_TESTDEVICE/$deviceName/;
+            $data =~ s/$ATSXML_DROPPRIORITY/$testpriority/;
+
+            if( $deviceVersion ne "" )
+            {
+                $data .= "            <property name=\"PROTO_VERSION\" value=\"$deviceVersion\" />\n";
+            }
+            if( $deviceHWID ne "" )
+            {
+                $data .= "            <property name=\"HWID\" value=\"$deviceHWID\" />\n";
+            }
+
+            $data .= $ATSXML_HEADER_END;
+
+            print FILE_HANDLE_XML ($data);
+
+            if($paramVerbose)
+            {
+                print("Device name: '$deviceName'\n");
+                print("Device version: '$deviceVersion'\n");
+                print("Device HWID: '$deviceHWID'\n");
+            }
+            $cmdDeviceRead = 1;
+        }
+
+        #
+        # CMD FLASH
+        #
+        if($cmd eq "FLASH" && !$skipCurrentDrop)
+        {
+            die ("Command FLASH in wrong place. Line $index.") if(!$cmdDropStartRead || !$cmdNameRead || !$cmdDeviceRead || $cmdPkgRead || $cmdSisRead );
+
+            push @flashFiles, $params;
+        }
+
+        #
+        # Write the XML start before test run commands.
+        #
+        if( ( $cmd eq "INI" || $cmd eq "CFG" || $cmd eq "CASELIST" ) && !$skipCurrentDrop )
+        {
+            # Write plan start and flashing commands to XML.
+            if($planStartWritten == 0)
+            {
+                WriteXmlPlanStart(\*FILE_HANDLE_XML, $deviceName);
+                
+                my $refFlashFiles = \@flashFiles;
+                $refFlashFiles = \@globalFlashFiles if( scalar(@globalFlashFiles) > 0 );
+
+                foreach my $flashFile ( @$refFlashFiles )
+              	{
+	            	my $file = GetPathFileName( $flashFile );
+	            	my $data = $ATSXML_FLASH;
+	            	$data =~ s/$ATSXML_FLASH_IMAGE_NAME/$file/;
+	            	print FILE_HANDLE_XML ($data);
+	            	print("Flash file: $file\n") if($paramVerbose);
+                }
+	          
+                # Steps to format drives.
+                #WriteXmlFormatDrives(\*FILE_HANDLE_XML);
+                
+                # Tsrc prerun custom steps.
+                if( scalar(@preRunCustomXmlData) > 0 ) 
+                {
+                    print("Steps from prerun xml.\n");
+                    print FILE_HANDLE_XML (@preRunCustomXmlData) 
+                }
+                
+                $planStartWritten = 1;
+            }
+
+            # Copy files to drop.
+            if( $additionalFilesCopiedToDrop == 0 )
+            {
+                # Copy flash files to drop.
+                my $refFlashFiles = \@flashFiles;
+                $refFlashFiles = \@globalFlashFiles if( scalar(@globalFlashFiles) > 0 );
+            	CopyFlashFilesToDrop( $refFlashFiles, \@atsFiles );
+            	
+            	# Copy SIS files to drop and add to files to install.
+            	my $refSisFiles = \@sisFiles;
+            	$refSisFiles = \@globalSisFiles if( scalar( @globalSisFiles ) > 0 );
+         	    foreach my $sisFile ( @$refSisFiles )
+            	{
+            	    CopySisFileToDrop( $sisFile, \@atsFiles );
+            	}
+
+                my @allPkgFiles = ( @pkgFiles, @globalPkgFiles, @globalPkgFilesForConf );
+
+            	foreach my $pkgFile ( @allPkgFiles )
+            	{
+            	    CopyPkgFilesToDrop( $pkgFile, \@atsFiles );
+            	}
+            	
+            	# Copy testframework.ini of drop to drop. 
+            	CopyTestframeworkIniOfDropToDrop( \@lines, $startOfDropIndex, \@atsFiles ) if( $paramCaseClass eq "" );
+
+                $additionalFilesCopiedToDrop = 1;
+            }
+
+            # XML file installation steps before these commands.
+            if( $cmd eq "INI" || $cmd eq "CFG" || $cmd eq "CASELIST" )
+            {
+                if($installationStepsWritten == 0)
+                {
+                    print("File installation steps.\n") if($paramVerbose);
+                    $installationStepsWritten = 1;
+                    WriteXmlInstallationSteps(\@atsFiles, \*FILE_HANDLE_XML);
+                }
+            }
+        }
+
+        #
+        # CMD PKG
+        #
+        if( $cmd eq "PKG" && !$skipCurrentDrop )
+        {
+            die ("Command PKG in wrong place. Line $index.") if(!$cmdDropStartRead || !$cmdNameRead || !$cmdDeviceRead );
+            push @pkgFiles, $params;
+            $cmdPkgRead = 1;
+        }
+
+        #
+        # CMD BOOT
+        #
+        if( $cmd eq "BOOT" )
+        {
+            $bootDefined = 1;
+        }
+
+        #
+        # CMD INI & CFG
+        #
+        if( ($cmd eq "INI" || $cmd eq "CFG") && !$skipCurrentDrop)
+        {
+            die ("Command $cmd in wrong place. Line $index.") if(!$cmdDropStartRead || !$cmdNameRead || !$cmdDeviceRead );
+            my $refData;
+            if($cmd eq "CFG")
+            {
+                if( !$bootDefined )
+                {
+                    $refData = \$ATSXML_STEP_RUNCASES;
+                }
+                else
+                {
+                    $refData = \$ATSXML_STEP_RUNCASES_WITH_BOOT;
+                }
+
+            }
+            else
+            {
+                if( !$bootDefined )
+                {
+                    $refData = \$ATSXML_STEP_RUNCASES_INI;
+                }
+                else
+                {
+                    $refData = \$ATSXML_STEP_RUNCASES_INI_WITH_BOOT;
+                }
+            }
+
+            my $pos = index($params, " ");
+            my $testfilename = substr($params, 0, $pos);
+            my $timeout = substr($params, $pos);
+
+            RemoveWhiteSpaces(\$testfilename);
+            RemoveWhiteSpaces(\$timeout);
+
+            $testfilename = GetPathFileName($testfilename);
+
+            die("Commands INI and CFG must be have params file and timeout!") if($testfilename eq "" or $timeout eq "");
+
+            WriteXmlRunStepsForFile($testfilename, $timeout, $refData, \*FILE_HANDLE_XML);
+        }
+
+        #
+        # CMD SIS
+        #
+        if( $cmd eq "SIS" && !$skipCurrentDrop && !$globalIgnoreSis )
+        {
+            die ("Command $cmd in wrong place. Line $index.") if(!$cmdDropStartRead || !$cmdNameRead || !$cmdDeviceRead );
+            push @sisFiles, $params;
+            $cmdSisRead = 1;
+        }
+
+        #
+        # CMD CASELIST
+        #
+        if($cmd eq "CASELIST" && !$skipCurrentDrop)
+        {
+            die ("Command CASELIST in wrong place. Line $index.") if(!$cmdDropStartRead || !$cmdNameRead || !$cmdDeviceRead );
+            my @caseListLines;
+            my $caseCount = 0;
+
+        	if( !open(FILE_HANDLE_CASELIST, $params) )
+        	{
+        		die("ERROR! Could not open file '" . $params . "'\n");
+        	}
+        	@caseListLines = <FILE_HANDLE_CASELIST>;
+        	close(FILE_HANDLE_CASELIST);
+
+        	WriteXmlRunStepsForCases(\@caseListLines, \*FILE_HANDLE_XML);
+        }
+
+        #
+        # CMD FETCH
+        #
+        if($cmd eq "FETCH" && !$skipCurrentDrop)
+        {
+            die ("Command FETCH in wrong place. Line $index.") if(!$cmdDropStartRead || !$cmdNameRead || !$cmdDeviceRead );
+            WriteXmlFetchStep(\*FILE_HANDLE_XML, $params);
+        }
+
+        #
+        # CMD EMAIL
+        #
+        if($cmd eq "EMAIL" && !$skipCurrentDrop)
+        {
+			$email = $params;
+			$email = $globalEmail if( $globalEmail ne "" );
+        }
+
+ 		#
+        # CMD ENDDROP
+        #
+        if($cmd eq "[ENDDROP]" && !$skipCurrentDrop)
+        {
+            $skipCurrentDrop = 0;
+            
+            die ("[ENDDROP] in wrong place. Line $index.") if(!$cmdDropStartRead || !$cmdNameRead || !$cmdDeviceRead );
+            
+            # Tsrc prerun custom steps.
+            if( scalar(@postRunCustomXmlData) > 0 ) 
+            {
+                print("Steps from postrun xml.\n");
+                print FILE_HANDLE_XML (@postRunCustomXmlData) 
+            }
+            else
+            {
+                WriteXmlFetchSteps(\*FILE_HANDLE_XML);
+            }
+
+            # End case, set, plan, session
+            print FILE_HANDLE_XML ($ATSXML_PLANEND);
+
+            ## Post action, fetches reports to network drive
+            #print FILE_HANDLE_XML ($ATSXML_POSTACTION);
+
+            WriteFileList(\@atsFiles, \*FILE_HANDLE_XML);
+
+            # Write footer with email address
+            my $data = $ATSXML_FOOTER;
+            $data =~ s/$ATSXML_EMAIL/$email/;
+            $data =~ s/$ATSXML_TESTNAME/$testname/;
+            print FILE_HANDLE_XML ($data);
+
+            if($testClosed == 0)
+            {
+                $testClosed = 1;
+                close(FILE_HANDLE_XML);
+            }
+        	
+        	if( $paramRerunXml )
+        	{
+            	my $failedCaseCount = 0;
+            	
+            	foreach my $pkgFile ( @pkgFiles )
+            	{
+            	    $failedCaseCount += GetFailedCasesCountForPkg( $pkgFile, \@globalFailedCfgs );
+            	}
+            	foreach my $pkgFile ( @globalPkgFiles )
+            	{
+            	    $failedCaseCount += GetFailedCasesCountForPkg( $pkgFile, \@globalFailedCfgs );
+            	}
+            	
+            	if( $failedCaseCount > 0 ) 
+            	{
+            	    ExecuteDrop($basePath, 0);
+            	}
+            	else
+            	{
+            	    print("No fails. Removing the drop.\n");
+                    if( -e "$basePath.zip" ) 
+                    {
+                    	print("\ndel $basePath.zip\n");
+                    	system("del $basePath.zip");
+                    }
+                
+                	if( -e $basePath )
+                	{
+                    	print("rmdir /s /q $basePath\n");
+                    	system("rmdir /s /q $basePath");
+                    }
+            	}
+            }
+            else
+            {
+                ExecuteDrop($basePath, 0);
+            }
+        }
+
+        #
+        # CMD USERNAME
+        #
+        if($cmd eq "USERNAME" && !$skipCurrentDrop)
+        {
+            $atsUsername = $params if( $atsUsername ) eq "";
+        }
+
+        #
+        # CMD PASSWORD
+        #
+        if($cmd eq "PASSWORD" && !$skipCurrentDrop)
+        {
+            $atsPassword = $params if( $atsPassword ) eq "";
+        }
+
+        $index++;
+    }
+
+    if($testClosed == 0)
+    {
+        close(FILE_HANDLE_XML);
+        $testClosed = 1;
+    }
+
+    print("Done.\n");
+}
+
+#------------------------------------------------------------------------------------
+# ReadCmdFromLine
+# Parameters:
+#   $refLine, $refCmd, $refParams
+# Return 
+#  1 if it's a command, otherwise 0.
+#------------------------------------------------------------------------------------
+sub ReadCmdFromLine
+{
+	my ($refLine, $refCmd, $refParams) = @_;
+	
+    RemoveWhiteSpaces($refLine);
+
+	$$refCmd = $$refLine;
+	$$refParams = "";
+    
+    if(index($$refLine, ";") == 0 || index($$refLine, "#") == 0)
+    {
+		return 0;
+    }
+
+    my $pos = index($$refLine, " ");
+    if($pos != -1)
+    {
+        $$refCmd = substr($$refLine, 0, $pos);
+        $$refParams = substr($$refLine, $pos);
+    }
+    RemoveWhiteSpaces($refCmd);
+    RemoveWhiteSpaces($refParams);
+
+    print("CMD: '$$refCmd', Params: '$$refParams'\n") if($paramDebug);
+    return 1;
+}
+
+#------------------------------------------------------------------------------------
+# CopySisFileToDrop
+# Parameters:
+#   $sisFile, $refAtsFiles
+#------------------------------------------------------------------------------------
+sub CopySisFileToDrop
+{
+    my( $sisFile, $refAtsFiles ) = @_;
+    
+    # Copy file to drop.
+    my $pkgline = "\"$sisFile\" - \"c:\\testframework\\$sisFile\"";
+    print("SIS file to drop: $sisFile.\n") if($paramVerbose);
+    CopyFileToDrop($pkgline, $refAtsFiles, 1);
+    
+    $sisFile = GetPathFileName($sisFile);
+    
+    # Installation step.
+    my @atsFile;
+    $atsFile[$ATSFILE_SRC] = "c:\\testframework\\$sisFile";
+    $atsFile[$ATSFILE_STEP_XML] = $ATSXML_STEP_INSTALLSIS;
+    $atsFile[$ATSFILE_STEP_TIMEOUT] = 5000;    
+    push @$refAtsFiles, [ @atsFile ];
+}
+
+#------------------------------------------------------------------------------------
+# CopyTestframeworkIniOfDropToDrop
+# Parameters:
+#   $refAtsConfLines, $refAtsFiles
+#------------------------------------------------------------------------------------
+sub CopyTestframeworkIniOfDropToDrop
+{
+    my( $refAtsConfLines, $startOfDropIndex, $refAtsFiles ) = @_;
+
+    my $index2 = $startOfDropIndex+1;
+    while($index2 < scalar(@$refAtsConfLines))
+    {
+        my $line = @$refAtsConfLines[$index2];
+        RemoveWhiteSpaces(\$line);
+        if($line eq "[ENDDROP]" or $line eq "[DROP]")
+        {
+            last;
+        }
+
+        $index2++;
+        my $cmd = $line;
+        my $filename = "";
+
+        my $pos = index($line, " ");
+        if($pos != -1)
+        {
+            $cmd = substr($line, 0, $pos);
+            $filename = substr($line, $pos);
+            RemoveWhiteSpaces(\$filename);
+        }
+        RemoveWhiteSpaces(\$cmd);
+        RemoveWhiteSpaces(\$filename);
+
+        if( $cmd eq "INI" )
+        {
+            if(index($filename, " ") != -1)
+            {
+                $filename = substr($filename, 0, index($filename, " "));
+            }
+            print("INI file to drop: $filename.\n") if($paramVerbose);
+
+            my $pkgline = "\"$filename\" - \"c:\\testframework\\$filename\"";
+            CopyFileToDrop($pkgline, $refAtsFiles, 1);
+        }
+    }    
+}
+
+#------------------------------------------------------------------------------------
+# CopyFlashFilesToDrop
+# Parameters:
+#   $refFlashFiles, $refAtsFiles
+#------------------------------------------------------------------------------------
+sub CopyFlashFilesToDrop
+{
+	my( $refFlashFiles, $refAtsFiles ) = @_;
+	
+	my $refCopyFlashFiles = $refFlashFiles;
+	
+ 	$refCopyFlashFiles = \@globalFlashFiles if( scalar(@globalFlashFiles) > 0 );
+    foreach my $flashFile ( @$refCopyFlashFiles )
+  	{
+	    # Strip the path from the flash file
+	    my $flashfilename = GetPathFileName($flashFile);
+	    my $dstpath = $basePath . "\\" . $dropImagePath . $flashfilename;
+	
+	    if( !$paramSkipFlashCopy )
+	    {
+	        print("copy $flashFile -> $dstpath\n") if($paramVerbose);;
+	        if(! -e $flashFile)
+	        {
+	            print("File $flashFile does not exist! Must be copied manually to '$dstpath'!\n");
+	        }
+	        else
+	        {
+	            copy($flashFile, $dstpath);
+	            die("Failed to copy '$flashFile' -> '$dstpath'") if(! -e $dstpath);
+	        }
+	    }
+	    my @atsFile;
+	    $atsFile[$ATSFILE_SRC] = $flashfilename;
+	    $atsFile[$ATSFILE_DROPFULL_PATH] = $dropImagePath;
+	    push @$refAtsFiles, [ @atsFile ];
+	}
+}
+
+#------------------------------------------------------------------------------------
+# CopyPkgFilesToDrop
+# Parameters:
+#	$filename, pkg file to be read
+#   $refAtsFiles
+# returns 0 if something fails, otherwise 1
+#------------------------------------------------------------------------------------
+sub CopyPkgFilesToDrop
+{
+    my($filename, $refAtsFiles) = @_;
+
+    print("Reading PKG $filename\n") if($paramDebug);
+
+	if( !open(FILE_HANDLE, $filename) )
+	{
+		print("ERROR! Could not open file '" . $filename . "'\n");
+		#die( cwd );
+		return 0;
+	}
+	my @array = <FILE_HANDLE>;
+	close(FILE_HANDLE);
+
+    mkdir($basePath);
+    mkdir($basePath . "\\" . $dropFilePath);
+    mkdir($basePath . "\\" . $dropImagePath);
+    mkdir($basePath . "\\" . $dropBinaryPath);
+
+    foreach my $line (@array)
+    {
+        my $fileCopied = CopyFileToDrop($line, $refAtsFiles);
+
+        # Error, file was not copied and it was under epoc32 directory
+        if(!$fileCopied and index(lc($line), "\\epoc32\\") != -1)
+        {
+
+        }
+    }
+
+	return 1;
+}
+
+#------------------------------------------------------------------------------------
+# CopyFileToDrop
+# Parameters:
+#	$line from pkg
+#   $refAtsFiles
+#   $force, file is added to drop even if it does not exist
+# returns 0 if something fails, otherwise 1
+#------------------------------------------------------------------------------------
+sub CopyFileToDrop
+{
+    my ($line, $refAtsFiles, $force) = @_;
+
+    my $src; # File location on the workstation
+    my $dst; # Where file would be installed from SIS
+
+	# Change forward slahes to backward.
+	$line =~ s/\//\\/g;
+	
+	# Lets hope there's only one level change.
+	#$line =~ s/\.\./\./g; 
+
+    # SRC                                                                              DST
+    #"\epoc32\data\z\system\data\IptvServiceManagementApiTestIapSelection.cfg"      - "c:\TestFramework\IptvServiceManagementApiTestIapSelection.cfg"
+
+    print("\n") if($paramDebug);
+
+    RemoveWhiteSpaces(\$line);
+    if( index($line, ";") == 0 && !( $line =~ m/testframework.ini/i ) )
+    {
+        print("Skipping, comment: $line\n") if($paramDebug);
+        return 0;
+    }
+
+    if( index($line, "\\") == -1 )
+    {
+        print("Skipping, not a file: $line\n") if($paramDebug);
+        return 0;
+    }
+
+    if( index($line, "http:\\") != -1 )
+    {
+        print("Skipping, url: $line\n") if($paramDebug);
+        return 0;
+    }
+
+    if(substr($line, 0, 9) eq "IF exists")
+    {
+        print("Skipping, not a file: $line\n") if($paramDebug);
+        return 0;
+    }
+
+	# Solve src
+
+    my $startPos = index($line, "\"")+1;
+    my $endPos = index($line, "\"", $startPos+1);
+    
+    return 0 if($startPos == -1 || $endPos == -1);
+    
+    $src = substr($line, $startPos, $endPos - $startPos);
+
+    # We are not in group folder, like the pkg file is written.
+    if( index( $src, "..\\" ) == 0 )
+    {
+        $src = substr( $src, 3 );
+    }
+    
+    if($paramFindPkgFilePath ne "")
+    {
+        my $newsrc = $paramFindPkgFilePath . "\\" . GetPathFileName($src);
+        if(-e $newsrc)
+        {
+            $src = $newsrc;
+        }
+    }
+   
+    # Check for forced builds.
+    if( $paramForcedBuild eq "udeb" && index($src, "\\urel\\") != -1 )
+    {
+        $src =~ s/\\urel\\/\\udeb\\/g;
+    }
+    if( $paramForcedBuild eq "urel" && index($src, "\\udeb\\") != -1 )
+    {
+        $src =~ s/\\udeb\\/\\urel\\/g;
+    }
+
+    print("src $src\n") if($paramDebug);
+
+	# Solve dst
+
+    $startPos = index($line, "\"", $endPos+1)+1;
+    $endPos = index($line, "\"", $startPos);
+
+    return 0 if($startPos == -1 || $endPos == -1);
+
+    $dst = substr($line, $startPos, $endPos - $startPos);
+    print("dst $dst\n") if($paramDebug);
+
+    # Resolve copy directory and construct info for the ATS XML
+
+    my @atsFile;
+    $atsFile[$ATSFILE_NAME] = "";
+    $atsFile[$ATSFILE_HARNESS] = "STIF";
+    $atsFile[$ATSFILE_ENABLED] = "true";
+    $atsFile[$ATSFILE_PASSRATE] = "100";
+    $atsFile[$ATSFILE_SIGNIFICANT] = "false";
+    $atsFile[$ATSFILE_TYPE] = "";
+    $atsFile[$ATSFILE_SRC] = "";
+    $atsFile[$ATSFILE_DST] = "";
+    $atsFile[$ATSFILE_DROPFULL_PATH] = "";
+    $atsFile[$ATSFILE_COMMAND] = "install";
+    $atsFile[$ATSFILE_STEP_XML] = $ATSXML_STEP_DEFAULT;
+    $atsFile[$ATSFILE_STEP_TIMEOUT] = 5000;
+
+    my $copyDest = "";
+
+#\Sys\Bin\
+# -> dropBinaryPath
+
+    my $found = 0;
+
+    if(!$found and index(lc($dst), "\\sys\\bin\\") != -1)
+    {
+        print(" - Binary\n") if($paramDebug);
+        
+        $atsFile[$ATSFILE_NAME] = "Install binary file";
+        $atsFile[$ATSFILE_TYPE] = "binary";
+        $atsFile[$ATSFILE_DST] = "c:\\sys\\bin\\" . GetPathFileName($dst);
+        $atsFile[$ATSFILE_STEP_XML] = $ATSXML_STEP_BINARY;
+        $atsFile[$ATSFILE_DROPFULL_PATH] = $dropBinaryPath;
+
+        $found = 1;
+        $copyDest = $basePath . "\\" . $dropBinaryPath;
+    }
+
+#c:\testing\verifyzip\
+# -> dropFilePath
+
+    if(!$found and index(lc($dst), "c:\\testing\\data\\verifyzip\\") != -1)
+    {
+    	print(" - Verify\n") if($paramDebug);
+        $found = 1;
+        $copyDest = $basePath . "\\" . $dropFilePath;
+
+        $atsFile[$ATSFILE_NAME] = "Install verify file";
+        $atsFile[$ATSFILE_DST] = "c:\\testing\\data\\verifyzip\\" . GetPathFileName($dst);
+        $atsFile[$ATSFILE_DROPFULL_PATH] = $dropFilePath;
+    }
+
+#c:\TestFramework\
+# -> dropFilePath
+
+    if(!$found and index(lc($dst), "c:\\testframework\\") != -1)
+    {
+    	print(" - STIF file\n") if($paramDebug);
+        if( $src =~ m/init\\TestFramework.ini/i && $paramUseSecondaryIni )
+        {
+            my $secIni = "init\\all\\testframework.ini";
+            if( -e $secIni )
+            {
+                $src = $secIni;
+            }
+        }
+        $found = 1;
+        $copyDest = $basePath . "\\" . $dropFilePath;
+
+        $atsFile[$ATSFILE_NAME] = "Install testscript file";
+        $atsFile[$ATSFILE_DST] = "c:\\testframework\\" . GetPathFileName($dst);
+        $atsFile[$ATSFILE_DROPFULL_PATH] = $dropFilePath;
+    }
+
+#c:\
+# -> dropFilePath
+
+    if(!$found and index(lc($dst), "c:\\") != -1 && index(lc($dst), "\\") == rindex(lc($dst), "\\") )
+    {
+        print(" - Other test file\n") if($paramDebug);
+        $found = 1;
+        $copyDest = $basePath . "\\" . $dropFilePath;
+
+        $atsFile[$ATSFILE_NAME] = "Install testscript file";
+        $atsFile[$ATSFILE_DST] = "c:\\" . GetPathFileName($dst);
+        $atsFile[$ATSFILE_DROPFULL_PATH] = $dropFilePath;
+    }
+
+# All other files
+
+    if(!$found)
+    {
+    	print(" - Some other file\n") if($paramDebug);
+        $copyDest = $basePath . "\\" . $dropFilePath;
+
+        $atsFile[$ATSFILE_NAME] = "Install other file";
+        $atsFile[$ATSFILE_DROPFULL_PATH] = $dropFilePath;
+
+        $dst =~ s/!:\\/c:\\/g;
+        $atsFile[$ATSFILE_DST] = $dst;
+    }
+
+    $copyDest .= GetPathFileName($dst);
+    print("-> $copyDest\n")  if($paramDebug);
+
+    my $error = 0;
+    if(! -e $src)
+    {
+        if(!$force)
+        {
+            print("File does not exist: '$src'. File not added.\n");
+            $error = 1;
+        }
+        else
+        {
+            print("File does not exist: '$src'. Must be copied manually!\n");
+        }
+    }
+
+    if( $src =~ m/\.cfg/i && $paramRerunXml )
+    {
+        Rerun_GenerateCfg( $src, $copyDest, \@globalFailedCfgs );
+    }
+    else
+    {
+        copy($src, $copyDest);
+    }
+
+    if(! -e $copyDest and !$error and !$force)
+    {
+        print("Copy failed for some reason. '$src' -> '$copyDest'. File not added.\n");
+        $error = 1;
+    }
+
+    return 1 if($error);
+
+    $atsFile[$ATSFILE_SRC] = GetPathFileName($dst);
+
+    if( $atsFile[$ATSFILE_NAME] ne "" and $atsFile[$ATSFILE_SRC] ne "")
+    {
+        print("ADDING to ATS files\n\n") if($paramDebug);
+        push @$refAtsFiles, [ @atsFile ];
+    }
+
+    return 1;
+}
+
+#------------------------------------------------------------------------------------
+# GetFailedCasesCountForPkg
+# Parameters:
+#	$filename, pkg file to be read
+#   $refFailedCfgs
+# returns count of failed case for a PKGs cfg files.
+#------------------------------------------------------------------------------------
+sub GetFailedCasesCountForPkg
+{
+    my( $filename, $refFailedCfgs ) = @_;
+
+	if( !open(FILE_HANDLE, $filename) )
+	{
+		print("ERROR! Could not open file '" . $filename . "'\n");
+		die( cwd );
+	}
+	my @array = <FILE_HANDLE>;
+	close(FILE_HANDLE);
+
+    my $failedCaseCount = 0;
+
+    foreach my $line (@array)
+    {
+        if( $line =~ m/\.cfg/i )
+        {
+            foreach my $cfg( @$refFailedCfgs )
+            {
+                my $cfgFile = @$cfg[0];
+                
+                if( $line =~ m/$cfgFile/i )
+                {
+                    my $refCases = @$cfg[1];
+                    $failedCaseCount += scalar(@$refCases);
+                }
+            }
+        }
+    }
+
+	return $failedCaseCount;
+}
+
+#------------------------------------------------------------------------------------
+# ExecuteDrop
+# Parameters:
+#   $dropName, $forceNoDelete
+#------------------------------------------------------------------------------------
+sub ExecuteDrop
+{
+    my($dropName, $forceNoDelete) = @_;
+
+    if($atsUsername eq "" or $atsPassword eq "")
+    {
+        print("User credentials not given as params, drop $basePath must be run manually!\n");
+        return;
+    }
+    
+    my $cgidir = GetCgiDir();
+
+	# Create zip if it doesn't exist.
+    if(!-e "$dropName.zip")
+    {
+        if(!-e "$dropName")
+        {
+            die("$dropName.zip or $dropName directory does not exist! Cannot execute.\n");
+        }
+        # Make zip
+        chdir $dropName;
+        my $runcmd = "zip -r ..\\$dropName.zip ATS3Drop test.xml";
+        print($runcmd . "\n") if($paramVerbose);
+        $runcmd .= ">NUL" if($paramDebug == 0);
+        system($runcmd);
+        chdir "..";
+    }
+    else
+    {
+        print("$dropName.zip exists. Executing the drop.\n");
+    }
+
+	my $dropDir = cwd;
+	
+	# Copy file to network.
+	
+	my $dropNetworkPath = "\\\\147.243.252.83\\Groups2\\cats\\";
+	my $dropPath = $dropNetworkPath . "$dropName.zip";
+	
+	my $notifyCmdFile = "";
+	
+	print("Copying drop to network...\n");	
+	if( copy( "$dropName.zip", $dropPath ) )
+	{
+	    $notifyCmdFile = "notifydrop_network.cmd";
+	}
+	else
+	{
+	    print("Could not copy drop to network: $dropPath, sending via web.\n");
+	    $notifyCmdFile = "notifydrop_local.cmd";
+	    $dropPath = "$dropDir/$dropName.zip";
+	}
+#	    $notifyCmdFile = "notifydrop_local.cmd";
+#	    $dropPath = "$dropDir/$dropName.zip";
+	    	
+    # Run the drop
+    my $runcmd = "";
+    my $printcmd = "";
+
+    $runcmd = "$notifyCmdFile $globalAtsHost $dropPath $atsUsername $atsPassword";
+    $printcmd = "$notifyCmdFile $globalAtsHost $dropPath $atsUsername <password>";
+    print($printcmd . "\n") if($paramVerbose);
+    
+    if(!-e "$cgidir$notifyCmdFile")
+    {
+      	print("ATS $cgidir$notifyCmdFile is missing!\n");
+	}
+	else
+	{
+		chdir( $cgidir );
+		system( $runcmd );
+		sleep(5);
+    	chdir( $dropDir );
+    	
+		# Delete generated files.
+	    if( $paramDontDeleteGeneratedFiles == 0 && $forceNoDelete == 0 )
+	    {
+	        print("\ndel $dropName.zip\n");
+	        system("del $dropName.zip");
+	
+	        print("rmdir /s /q $dropName\n");
+	        system("rmdir /s /q $dropName");
+	    }    	
+    }
+}
+
+#------------------------------------------------------------------------------------
+# WriteFileList
+# Parameters:
+#   $refAtsFiles
+#   $fh
+#------------------------------------------------------------------------------------
+sub WriteFileList
+{
+    my ($refAtsFiles, $fh) = @_;
+
+    # Write list of the files
+    print $fh ("<files>\n");
+    foreach my $file (@$refAtsFiles)
+    {
+    	if( defined( @$file[$ATSFILE_DROPFULL_PATH] ) and defined( @$file[$ATSFILE_SRC] ) ) 
+    	{
+        	my $file = @$file[$ATSFILE_DROPFULL_PATH] . @$file[$ATSFILE_SRC];
+	        print $fh ("<file>$file</file>\n");
+	    }
+    }
+    print $fh ("</files>\n");
+}
+
+#------------------------------------------------------------------------------------
+# WriteXmlPlanStart
+# Parameters:
+#   $fh
+#------------------------------------------------------------------------------------
+sub WriteXmlPlanStart
+{
+    my ($fh, $deviceName) = @_;
+
+    my $data = $ATSXML_PLANSTART;
+
+	my $replacement = "$deviceName - ";
+
+	$replacement .= "$paramCaseClass - " if( $paramCaseClass );	
+	
+	if( -e "\\currentRelease.xml" )
+	{
+		if( open(FILE_HANDLE, "\\currentRelease.xml") )
+		{
+			my @lines = <FILE_HANDLE>;
+			close(FILE_HANDLE);
+			
+			foreach my $line ( @lines )
+			{
+				if( $line =~ m/\<release name=\"([[a-z0-9_]+)\"/i )
+				{
+					$replacement .= "$1 - ";
+					last;
+				}
+			}		
+		}
+	}
+	
+	$replacement .= Timestamp();
+	
+    $data =~ s/$ATSXML_TESTPLAN_NAME/$replacement/;
+
+    $replacement = "Session";
+    $data =~ s/$ATSXML_TESTSESSION_NAME/$replacement/;
+
+    $replacement = "Set";
+    $data =~ s/$ATSXML_TESTSET_NAME/$replacement/;
+
+    $replacement = "Case";
+    $data =~ s/$ATSXML_TESTCASE_NAME/$replacement/;
+
+    print $fh ($data);
+}
+
+#------------------------------------------------------------------------------------
+# WriteXmlFormatDrives
+# Parameters:
+#   $fh
+#------------------------------------------------------------------------------------
+sub WriteXmlFormatDrives
+{
+    my ($fh) = @_;
+
+    my $data = $ATSXML_FORMAT_DRIVES;
+
+    print $fh ($data);
+}
+
+#------------------------------------------------------------------------------------
+# WriteXmlCreateDirsSteps
+# Parameters:
+#   $fh
+#------------------------------------------------------------------------------------
+sub WriteXmlCreateDirsSteps
+{
+    my ($fh) = @_;
+
+    my $data = $ATSXML_CREATEDIRS;
+
+    print $fh ($data);
+}
+
+#------------------------------------------------------------------------------------
+# WriteXmlRunStepsForFile
+# Parameters:
+#	$filename
+#   $timeout
+#   $refData
+#   $fh
+#------------------------------------------------------------------------------------
+sub WriteXmlRunStepsForFile
+{
+    my ($filename, $timeout, $refData, $fh) = @_;
+
+    my $data = $$refData;
+
+    my $replacement = $filename;
+    XmlReadyText(\$replacement);
+    $data =~ s/$ATSXML_STEP_NAME/$replacement/;
+
+    print("Run step for '"  . $filename . "'\n") if($paramVerbose);
+
+    $replacement = "C:\\testframework\\" . $filename;
+    XmlReadyText(\$replacement);
+    $data =~ s/$ATSXML_STEP_RUNCASES_FILENAME/$replacement/;
+
+    $replacement = $timeout;
+    XmlReadyText(\$replacement);
+    $data =~ s/$ATSXML_STEP_RUNCASES_TIMEOUT/$replacement/;
+
+    print $fh ($data);
+}
+
+#------------------------------------------------------------------------------------
+# WriteXmlRunStepsForCases
+# Parameters:
+#	$refCaseList
+#   $fh
+#------------------------------------------------------------------------------------
+sub WriteXmlRunStepsForCases
+{
+    my ($refCaseList, $fh) = @_;
+
+    my $caseCount = 0;
+    my $currCfgFileName = "";
+
+	foreach my $line (@$refCaseList)
+	{
+        my $cmd;
+        my $param;
+        my $pos = index($line, " ");
+        die("Case list file should have format: [cfg/case] [filename/casename]!\n") if($pos == -1);
+        $cmd = substr($line, 0, $pos);
+        $pos += 1;
+        $param = substr($line, $pos, length($line) - $pos - 1);
+
+        if($cmd eq "cfg")
+        {
+            $currCfgFileName = $param;
+        }
+        else
+        {
+            die("Case list file first line must be 'cfg [filename]'!") if($currCfgFileName eq "");
+
+    	    my $data = $ATSXML_STEP_RUNCASE;
+
+            #$replacement = "Case $caseCount";
+            my $replacement = $param;
+            XmlReadyText(\$replacement);
+            $data =~ s/$ATSXML_STEP_NAME/$replacement/;
+            $caseCount++;
+
+            $replacement = "c:\\testframework\\$currCfgFileName";
+            XmlReadyText(\$replacement);
+            $data =~ s/$ATSXML_STEP_RUNCASE_FILENAME/$replacement/;
+
+            $replacement = "$param";
+            XmlReadyText(\$replacement);
+            $data =~ s/$ATSXML_STEP_RUNCASE_CASENAME/$replacement/;
+
+            print $fh ($data);
+        }
+
+    }
+}
+
+#------------------------------------------------------------------------------------
+# WriteXmlFetchSteps
+# Parameters:
+#   $refAtsFiles
+#   $fh
+#------------------------------------------------------------------------------------
+sub WriteXmlFetchSteps
+{
+    my ($fh) = @_;
+
+    #
+    # Fetch logs etc. 5 steps
+    #
+
+    my $data = $ATSXML_FETCH_STEPS;
+    my $replacement = "";
+
+    print $fh ($data);
+
+    if($paramCTC)
+    {
+        $data = $ATSXML_CTCWRITE_STEP;
+        $data =~ s/$ATSXML_CTC_PATH/$globalCtcExePath/;
+        print $fh ($data);
+
+        WriteXmlFetchStep($fh, "c:\\data\\ctc\\ctcdata.txt");
+    }
+}
+
+
+#------------------------------------------------------------------------------------
+# WriteXmlFetchStep
+# Parameters:
+#   $refAtsFiles
+#   $fh
+#------------------------------------------------------------------------------------
+sub WriteXmlFetchStep
+{
+    my ($fh, $path) = @_;
+
+    my $data = $ATSXML_FETCH_STEP;
+
+    $data =~ s/$ATSXML_FETCH_PATH/$path/;
+
+    print $fh ($data);
+}
+
+#------------------------------------------------------------------------------------
+# WriteXmlInstallationSteps
+# Parameters:
+#   $refAtsFiles
+#   $fh
+#------------------------------------------------------------------------------------
+sub WriteXmlInstallationSteps
+{
+    my ($refAtsFiles, $fh) = @_;
+
+	if($paramDebug)
+	{
+		print("ATS install file count: " . scalar( @$refAtsFiles ) . "\n") if($paramDebug);
+	}
+
+    my $replacement = "";
+
+    foreach my $file( @$refAtsFiles )
+    {
+        next if( !defined( @$file[$ATSFILE_STEP_XML] ) );
+        
+        my $data = @$file[$ATSFILE_STEP_XML];
+
+		if( $data =~ m/$ATSXML_STEP_NAME/ )
+		{
+			die("ATSFILE_NAME is not defined!") if( !defined( @$file[$ATSFILE_NAME] ) );
+            $replacement = @$file[$ATSFILE_NAME];
+            XmlReadyText(\$replacement);
+            $data =~ s/$ATSXML_STEP_NAME/$replacement/;
+		}
+			
+		if( $data =~ m/$ATSXML_STEP_HARNESS/ )
+		{
+			die("ATSFILE_HARNESS is not defined!") if( !defined( @$file[$ATSFILE_HARNESS] ) );
+	        $replacement = @$file[$ATSFILE_HARNESS];
+	        XmlReadyText(\$replacement);
+	        $data =~ s/$ATSXML_STEP_HARNESS/$replacement/;
+		}
+
+		if( $data =~ m/$ATSXML_STEP_ENABLED/ )
+		{
+			die("ATSFILE_ENABLED is not defined!") if( !defined( @$file[$ATSFILE_ENABLED] ) );
+	        $replacement = @$file[$ATSFILE_ENABLED];
+	        XmlReadyText(\$replacement);
+	        $data =~ s/$ATSXML_STEP_ENABLED/$replacement/;
+		}
+
+		if( $data =~ m/$ATSXML_STEP_PASSRATE/ )
+		{
+			die("ATSFILE_PASSRATE is not defined!") if( !defined( @$file[$ATSFILE_PASSRATE] ) );
+	        $replacement = @$file[$ATSFILE_PASSRATE];
+	        XmlReadyText(\$replacement);
+	        $data =~ s/$ATSXML_STEP_PASSRATE/$replacement/;
+		}
+	
+		if( $data =~ m/$ATSXML_STEP_SIGNIFICANT/ )
+		{
+			die("ATSFILE_SIGNIFICANT is not defined!") if( !defined( @$file[$ATSFILE_SIGNIFICANT] ) );
+	        $replacement = @$file[$ATSFILE_SIGNIFICANT];
+	        XmlReadyText(\$replacement);
+	        $data =~ s/$ATSXML_STEP_SIGNIFICANT/$replacement/;
+		}
+	
+		if( $data =~ m/$ATSXML_STEP_PARAM_TYPE/ )
+		{
+			die("ATSFILE_TYPE is not defined!") if( !defined( @$file[$ATSFILE_TYPE] ) );
+	        $replacement = @$file[$ATSFILE_TYPE];
+	        XmlReadyText(\$replacement);
+	        $data =~ s/$ATSXML_STEP_PARAM_TYPE/$replacement/;
+		}
+	
+		if( $data =~ m/$ATSXML_STEP_PARAM_SRC/ )
+		{
+			die("ATSFILE_NAME is not defined!") if( !defined( @$file[$ATSFILE_SRC] ) );
+	        $replacement = @$file[$ATSFILE_SRC];
+	        XmlReadyText(\$replacement);
+	        $data =~ s/$ATSXML_STEP_PARAM_SRC/$replacement/;
+		}
+	
+		if( $data =~ m/$ATSXML_STEP_PARAM_DST/ )
+		{
+			die("ATSFILE_DST is not defined!") if( !defined( @$file[$ATSFILE_DST] ) );
+	        $replacement = @$file[$ATSFILE_DST];
+	        XmlReadyText(\$replacement);
+	        $data =~ s/$ATSXML_STEP_PARAM_DST/$replacement/;
+		}
+	
+		if( $data =~ m/$ATSXML_STEP_COMMAND/ )
+		{
+			die("ATSFILE_COMMAND is not defined!") if( !defined( @$file[$ATSFILE_COMMAND] ) );
+	        $replacement = @$file[$ATSFILE_COMMAND];
+	        XmlReadyText(\$replacement);
+	        $data =~ s/$ATSXML_STEP_COMMAND/$replacement/;
+		}
+	
+		if( $data =~ m/$ATSXML_STEP_TIMEOUT/ )
+		{
+			die("ATSFILE_STEP_TIMEOUT is not defined!") if( !defined( @$file[$ATSFILE_STEP_TIMEOUT] ) );
+	        $replacement = @$file[$ATSFILE_STEP_TIMEOUT];
+	        XmlReadyText(\$replacement);
+	        $data =~ s/$ATSXML_STEP_TIMEOUT/$replacement/;
+	    }
+
+        print $fh ($data);
+    }
+}
+
+#------------------------------------------------------------------------------------
+# GetNextPlanId
+#------------------------------------------------------------------------------------
+sub GetNextPlanId
+{
+    $currentPlanId++;
+    my $id = "1.$currentPlanId";
+
+    $currentSessionId = 0;
+    $currentSetId = 0;
+    $currentCaseId = 0;
+    $currentStepId = 0;
+
+    return $id;
+}
+
+#------------------------------------------------------------------------------------
+# GetNextSessionId
+#------------------------------------------------------------------------------------
+sub GetNextSessionId
+{
+    $currentSessionId++;
+    my $id = "1.$currentPlanId.$currentSessionId";
+    return $id;
+}
+
+#------------------------------------------------------------------------------------
+# GetNextSetId
+#------------------------------------------------------------------------------------
+sub GetNextSetId
+{
+    $currentSetId++;
+    my $id = "1.$currentPlanId.$currentSessionId.$currentSetId";
+    return $id;
+}
+
+#------------------------------------------------------------------------------------
+# GetNextCaseId
+#------------------------------------------------------------------------------------
+sub GetNextCaseId
+{
+    $currentCaseId++;
+    my $id = "1.$currentPlanId.$currentSessionId.$currentSetId.$currentCaseId";
+    return $id;
+}
+
+#------------------------------------------------------------------------------------
+# GetNextStepId
+#------------------------------------------------------------------------------------
+sub GetNextStepId
+{
+    $currentStepId++;
+    my $id = "1.$currentPlanId.$currentSessionId.$currentSetId.$currentCaseId.$currentStepId";
+    return $id;
+}
+
+#------------------------------------------------------------------------------------
+# Timestamp
+#
+# Parameters:
+#------------------------------------------------------------------------------------
+sub Timestamp
+{
+    my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time);
+
+	$mday = "0$mday" if( length($mday) < 2 );
+	$hour = "0$hour" if( length($hour) < 2 );
+	$min = "0$min" if( length($min) < 2 );
+	
+    return "" . ($year+1900) . "-" . ($mon+1) . "-" . $mday . " " . $hour . ":" . $min;
+}
+
+#------------------------------------------------------------------------------------
+# InitXml
+#
+# Parameters:
+#------------------------------------------------------------------------------------
+sub InitXml
+{
+
+$ATSXML_HEADER_START =
+#"<?xml version=\"1.0\"?>\n" .
+"<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>" .
+"<test>\n" .
+"<priority>ATSXML_DROPPRIORITY</priority>" .
+"    <id>1</id>\n" .
+"   <name>ATSXML_TESTNAME</name>\n" .
+"    <target>\n" .
+"        <device rank=\"none\" alias=\"DEFAULT\">\n" .
+"            <property name=\"HARNESS\" value=\"STIF\" />\n" .
+"            <property name=\"TYPE\" value=\"ATSXML_TESTDEVICE\" />\n";
+
+$ATSXML_HEADER_END =
+"        </device>\n" .
+"    </target>\n";
+
+$ATSXML_PLANSTART =
+"    <plan name=\"ATSXML_TESTPLAN_NAME\" harness=\"STIF\" enabled=\"true\" passrate=\"100\">\n" .
+"        <session name=\"ATSXML_TESTSESSION_NAME\" harness=\"STIF\" enabled=\"true\" passrate=\"100\">\n" .
+"            <set name=\"ATSXML_TESTSET_NAME\" harness=\"STIF\" enabled=\"true\" passrate=\"100\">\n" .
+"                <target>\n" .
+"                    <device rank=\"master\" alias=\"DEFAULT\"/>\n" .
+"                </target>\n" .
+"                <case name=\"ATSXML_TESTCASE_NAME\" harness=\"STIF\" enabled=\"true\" passrate=\"100\">\n";
+
+
+$ATSXML_FLASH = "   <flash target-alias=\"DEFAULT\" images=\"ATS3Drop/images/ATSXML_FLASH_IMAGE_NAME\" />\n";
+
+$ATSXML_FORMAT_DRIVES = 
+"                   <step name=\"Format drive E\" harness=\"STIF\" enabled=\"true\" passrate=\"100\" significant=\"false\">\n" .
+"                       <command>format</command>\n" . 
+"                           <params>\n" .
+"                               <param drive=\"e\"/>" .
+"                               <param mode=\"quick\"/>\n" .
+"                           </params>\n" .
+"                   </step>\n" .
+"                   <step name=\"Format drive F\" harness=\"STIF\" enabled=\"true\" passrate=\"100\" significant=\"false\">\n" .
+"                       <command>format</command>\n" . 
+"                           <params>\n" .
+"                               <param drive=\"f\"/>" .
+"                               <param mode=\"quick\"/>\n" .
+"                           </params>\n" .
+"                   </step>\n" .
+"                   <step name=\"Format drive G\" harness=\"STIF\" enabled=\"true\" passrate=\"100\" significant=\"false\">\n" .
+"                       <command>format</command>\n" . 
+"                           <params>\n" .
+"                               <param drive=\"g\"/>" .
+"                               <param mode=\"quick\"/>\n" .
+"                           </params>\n" .
+"                   </step>\n";
+
+$ATSXML_CREATEDIRS =
+"                    <step name=\"Create log directory for testmodule\" harness=\"STIF\" enabled=\"true\" passrate=\"100\" significant=\"false\">\n" .
+"	                    	<command>makedir</command>\n" .
+"	                    	<params>\n" .
+"	                        <param dir=\"c:\\logs\\testframework\"/>\n" .
+"	                    	</params>\n" .
+"	                </step>\n" .
+"	                <step name=\"Create log directory for iptvlogs\" harness=\"STIF\" enabled=\"true\" passrate=\"100\" significant=\"false\">\n" .
+"	                    	<command>makedir</command>\n" .
+"	                    	<params>\n" .
+"	                        <param dir=\"c:\\logs\\Fusion\"/>\n" .
+"	                    	</params>\n" .
+"	                </step>\n" .
+"	                <step name=\"Create log directory for livetvlogs\" harness=\"STIF\" enabled=\"true\" passrate=\"100\" significant=\"false\">\n" .
+"	                    	<command>makedir</command>\n" .
+"	                    	<params>\n" .
+"	                        <param dir=\"c:\\logs\\Livetv\"/>\n" .
+"	                    	</params>\n" .
+"	                </step>\n" .
+"	                <step name=\"Create directory for verify files\" harness=\"STIF\" enabled=\"true\" passrate=\"100\" significant=\"false\">\n" .
+"	                    	<command>makedir</command>\n" .
+"	                    	<params>\n" .
+"	                        <param dir=\"c:\\testing\\data\\verifyzip\"/>\n" .
+"	                    	</params>\n" .
+"	                </step>\n" .
+"	                <step name=\"Create directory for verify files\" harness=\"STIF\" enabled=\"true\" passrate=\"100\" significant=\"false\">\n" .
+"	                    	<command>makedir</command>\n" .
+"	                    	<params>\n" .
+"	                        <param dir=\"c:\\testing\\data\\verifynew\"/>\n" .
+"	                    	</params>\n" .
+"	                </step>\n" .
+"	                <step name=\"Create directory for TestScripter logs\" harness=\"STIF\" enabled=\"true\" passrate=\"100\" significant=\"false\">\n" .
+"	                    	<command>makedir</command>\n" .
+"	                    	<params>\n" .
+"	                        <param dir=\"c:\\logs\\testframework\\TestScripter\"/>\n" .
+"	                    	</params>\n" .
+"	                </step>\n";
+
+$ATSXML_PLANEND =
+"                </case>\n" .
+"            </set>\n" .
+"        </session>\n" .
+"    </plan>\n";
+
+
+$ATSXML_FOOTER =
+"<postAction>\n" .
+"    	<type>SendEmailAction</type>\n" .
+"    	<params>\n" .
+"    		<param name='type' value='ATS3_REPORT'/>\n" .
+"    		<param name='to' value='ATSXML_EMAIL'/>\n" .
+"    		<param name='subject' value='ATS3 Report - ATSXML_TESTNAME'/>\n" .
+"    		<param name='send-files' value='true'/>\n" .
+"    	</params>\n" .
+"  </postAction>\n" .
+"</test>\n";
+
+$ATSXML_STEP_DEFAULT =
+"                    <step name=\"ATSXML_STEP_NAME\" harness=\"ATSXML_STEP_HARNESS\" enabled=\"ATSXML_STEP_ENABLED\" passrate=\"ATSXML_STEP_PASSRATE\" significant=\"ATSXML_STEP_SIGNIFICANT\">\n" .
+"                           <command>ATSXML_STEP_COMMAND</command>\n" .
+"                           <params>\n" .
+"                           <param src=\"ATSXML_STEP_PARAM_SRC\"/>\n" .
+"                           <param dst=\"ATSXML_STEP_PARAM_DST\"/>\n" .
+#"                          <param component-path=\"ATSXML_STEP_PARAM_COMPONENT_PATH\"/>\n" .
+"                           </params>\n" .
+"                    </step>\n";
+
+$ATSXML_STEP_BINARY =
+"                    <step name=\"ATSXML_STEP_NAME\" harness=\"ATSXML_STEP_HARNESS\" enabled=\"ATSXML_STEP_ENABLED\" passrate=\"ATSXML_STEP_PASSRATE\" significant=\"ATSXML_STEP_SIGNIFICANT\">\n" .
+"                           <command>ATSXML_STEP_COMMAND</command>\n" .
+"                           <params>\n" .
+"    	                    <param type=\"ATSXML_STEP_PARAM_TYPE\"/>\n" .
+"                           <param src=\"ATSXML_STEP_PARAM_SRC\"/>\n" .
+"                           <param dst=\"ATSXML_STEP_PARAM_DST\"/>\n" .
+#"                          <param component-path=\"ATSXML_STEP_PARAM_COMPONENT_PATH\"/>\n" .
+"                           </params>\n" .
+"                    </step>\n";
+
+$ATSXML_STEP_RUNCASES =
+"                    <step name=\"ATSXML_STEP_NAME\" harness=\"STIF\" enabled=\"true\" passrate=\"100\" significant=\"true\">\n" .
+"                           <command>run-cases</command>\n" .
+"                           <params>\n" .
+"	                        <param module=\"TestScripter\"/>\n" .
+"	                        <param testcase-file=\"ATSXML_STEP_RUNCASES_FILENAME\"/>\n" .
+"	                        <param filter=\"*\"/>\n" .
+"	                        <param timeout=\"ATSXML_STEP_RUNCASES_TIMEOUT\"/>\n" .
+"	                        <param component-path=\"ATS3Drop\"/>\n" .
+"                           </params>\n" .
+"                    </step>\n";
+
+$ATSXML_STEP_RUNCASES_WITH_BOOT =
+"                    <step name=\"ATSXML_STEP_NAME\" harness=\"STIF\" enabled=\"true\" passrate=\"100\" significant=\"true\">\n" .
+"                           <command>run-cases</command>\n" .
+"                           <reboot target-alias=\"*\" when=\"before\"/>\n" .
+"                           <params>\n" .
+"	                        <param module=\"TestScripter\"/>\n" .
+"	                        <param testcase-file=\"ATSXML_STEP_RUNCASES_FILENAME\"/>\n" .
+"	                        <param filter=\"*\"/>\n" .
+"	                        <param timeout=\"ATSXML_STEP_RUNCASES_TIMEOUT\"/>\n" .
+"	                        <param component-path=\"ATS3Drop\"/>\n" .
+"                           </params>\n" .
+"                    </step>\n";
+
+$ATSXML_STEP_RUNCASES_INI =
+"                    <step name=\"ATSXML_STEP_NAME\" harness=\"STIF\" enabled=\"true\" passrate=\"100\" significant=\"true\">\n" .
+"                           <command>run-cases</command>\n" .
+"                           <params>\n" .
+"                           <param engineini=\"ATSXML_STEP_RUNCASES_FILENAME\"/>\n" .
+"                           <param filter=\"*\"/>\n" .
+"                           <param timeout=\"ATSXML_STEP_RUNCASES_TIMEOUT\"/>\n" .
+"                           <param repeat=\"1\"/>\n" .
+"                           </params>\n" .
+"                    </step>\n";
+
+$ATSXML_STEP_RUNCASES_INI_WITH_BOOT =
+"                    <step name=\"ATSXML_STEP_NAME\" harness=\"STIF\" enabled=\"true\" passrate=\"100\" significant=\"true\">\n" .
+"                           <command>run-cases</command>\n" .
+"                           <reboot target-alias=\"*\" when=\"before\" />\n" .
+"                           <params>\n" .
+"                           <param engineini=\"ATSXML_STEP_RUNCASES_FILENAME\"/>\n" .
+"                           <param filter=\"*\"/>\n" .
+"                           <param timeout=\"ATSXML_STEP_RUNCASES_TIMEOUT\"/>\n" .
+"                           <param repeat=\"1\"/>\n" .
+"                           </params>\n" .
+"                    </step>\n";
+
+
+$ATSXML_STEP_RUNCASE =
+"                    <step name=\"ATSXML_STEP_NAME\" harness=\"STIF\" enabled=\"true\" passrate=\"100\" significant=\"true\">\n" .
+"                    <command>run-case</command>\n" .
+"                           <params>\n" .
+"                           <param module=\"TestScripter\"/>\n" .
+"                           <param testcase-file=\"ATSXML_STEP_RUNCASE_FILENAME\"/>\n" .
+"                           <param id=\"ATSXML_STEP_RUNCASE_CASENAME\"/>\n" .
+"                           <param timeout=\"600\"/>\n" .
+"                    </params>\n" .
+"                    </step>\n";
+
+$ATSXML_STEP_INSTALLSIS =
+"                    <step name=\"Install SIS\" harness=\"STIF\" enabled=\"true\" passrate=\"100\" significant=\"false\">\n" .
+"                    <command>install-software</command>\n" .
+"                    <params>\n" .
+"                    <param sisPackageName=\"ATSXML_STEP_PARAM_SRC\"/>\n" .
+"                    <param upgradeAllowed=\"true\"/>\n" .
+"                    <param optionalItemsAllowed=\"true\"/>\n" .
+"                    <param OCSP_Done=\"true\"/>\n" .
+"                    <param ignoreOCSPWarnings=\"true\"/>\n" .
+"                    <param untrustedAllowed=\"true\"/>\n" .
+"                    <param packageInfoAllowed=\"true\"/>\n" .
+"                    <param userCapGranted=\"true\"/>\n" .
+"                    <param killApp=\"true\"/>\n" .
+"                    <param overWriteAllowed=\"true\"/>\n" .
+"                    <param downloadAllowed=\"false\"/>\n" .
+"<!--                    <param downloadUsername=\"user\"/>-->\n" .
+"<!--                    <param downloadPassword=\"passwd\"/>-->\n" .
+"                    <param installDrive=\"C\"/>\n" .
+"                    <param upgradeData=\"true\"/>\n" .
+"                    <param timeout=\"ATSXML_STEP_TIMEOUT\"/>\n" .
+"                    </params>\n" .
+"                    </step>\n";
+
+$ATSXML_FETCH_STEPS =
+"                    <step name=\"Fetch Test module Report\" harness=\"STIF\" enabled=\"true\" passrate=\"100\" significant=\"false\">\n" .
+"                           <command>fetch-log</command>\n" .
+"                           <params>\n" .
+"                    	    <param type=\"text\"/>\n" .
+"                    	    <param delete=\"true\"/>\n" .
+"                    	    <param path=\"C:\\Logs\\TestFramework\\*\"/>\n" .
+"                           </params>\n" .
+"                    </step>\n" .
+"                    <step name=\"Fetch TestScripter logs\" harness=\"STIF\" enabled=\"true\" passrate=\"100\" significant=\"false\">\n" .
+"                           <command>fetch-log</command>\n" .
+"                           <params>\n" .
+"                    	    <param type=\"text\"/>\n" .
+"                    	    <param delete=\"true\"/>\n" .
+"                    	    <param path=\"C:\\Logs\\TestFramework\\TestScripter\\*\"/>\n" .
+"                           </params>\n" .
+"                    </step>\n";
+
+$ATSXML_FETCH_STEP =
+"                    <step name=\"Fetch Test module Report\" harness=\"STIF\" enabled=\"true\" passrate=\"100\" significant=\"false\">\n" .
+"                           <command>fetch-log</command>\n" .
+"                           <params>\n" .
+"                    	    <param type=\"text\"/>\n" .
+"                    	    <param delete=\"true\"/>\n" .
+"                    	    <param path=\"ATSXML_FETCH_PATH\"/>\n" .
+"                           </params>\n" .
+"                    </step>\n";
+
+$ATSXML_CTCWRITE_STEP =
+"                   <step name=\"Save CTC data\" harness=\"STIF\" enabled=\"true\" passrate=\"100\" significant=\"false\">\n" .
+"                           <command>execute</command>\n" .
+"                           <params>\n" .
+"                           <param parameters=\"writefile\"/>\n" .
+"                           <param file=\"ATSXML_CTC_PATH\"/>\n" .
+"                           </params>\n" .
+"                   </step>\n";
+
+$ATSXML_POSTACTION =
+"                   <postAction>" .
+"                       <type>FileStoreAction</type>" .
+"                       <params>" .
+#"                       <param name=\"to-folder\" value=\"\\someserver\somefolder\§RUN_NAME§\"/>" .
+"                       <param name=\"to-folder\" value=\"\\\\oucifs1\\cp_sw\\programs\\video_applications_stream\\iptv\\testing\\CI_reports\\§RUN_START_DATE§_§RUN_START_TIME§_§RUN_NAME§\"/>" .
+"                       <param name=\"report type\" value=\"STIF_COMPONENT_REPORT_ALL_CASES\"/>" .
+"                       </params>" .
+"                   </postAction>";
+
+}
+
+
+
+sub GetCgiDir
+  {
+    # Solve where the script is located.
+    $0=~/^(.+[\\\/])[^\\\/]+[\\\/]*$/;
+    my $cgidir= $1 || "./";
+    
+    # And try to solve relative path.
+    if( index( $cgidir, "..\\" ) != -1 )
+    {
+    	my $p = cwd;
+    	$p =~ s/\//\\/g;
+    	$cgidir =~ s/\//\\/g;
+    	while(1) 
+    	{
+    		my $pos = index( $cgidir, "..\\" );
+    		last if( $pos == -1 );
+    		$cgidir = substr( $cgidir, $pos+3 );
+    		
+    		$pos = rindex( $p, "\\" );
+    		last if( $pos == -1 );
+    		$p = substr( $p, 0, $pos);
+    	}
+    	$cgidir = $p . "\\" . $cgidir;
+    }
+    return $cgidir;
+}
+
+
+
+#------------------------------------------------------------------------------------
+# FindFiles
+# Parameters:
+#	$goDir, where to start finding
+#	$fileSearch, filename search
+#	$searchType, 0 = fullname search, 1 = filetype search
+#	$refIncfiles, reference to array which will hold found files
+#------------------------------------------------------------------------------------
+sub FindFiles
+{
+	my ($godir, $fileSearch, $searchType, $refIncfiles) = @_;
+
+	my $startDir = cwd;
+
+	chdir($godir);
+
+	#print("Now in: " . cwd . "\n");
+
+	opendir(DIR, ".");
+	my @filelist = sort(readdir(DIR));
+	closedir(DIR);
+
+	foreach my $file(@filelist)
+	{
+		if($file eq "." or $file eq "..") {next};
+
+		if (-d $file)
+		{
+		 	FindFiles( $file, $fileSearch, $searchType, $refIncfiles);
+		} else
+		{
+			if( ($file =~ m/$fileSearch/i and $searchType == 0 ) or ($file =~ m/$fileSearch$/i and $searchType == 1 ) )
+			{
+                $file = cwd . "/" . $file;
+				push @$refIncfiles, $file;
+				#print("$file\n");
+			}
+		}
+	}
+
+	chdir ($startDir);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/testing/tools/genCfgs.pl	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,534 @@
+#
+# 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 "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: 
+#
+
+
+#------------------------------------------------------------------------------------
+# Includes
+#------------------------------------------------------------------------------------
+#use strict;
+use warnings;
+use Cwd; # for cwd
+use FindBin; # for FindBin:Bin
+use File::Path; # for mkpath
+use Date::Calc;
+
+{ # No globals.
+    # Solve where the script is located.
+    $0=~/^(.+[\\\/])[^\\\/]+[\\\/]*$/;
+    my $cgidir= $1 || "./";
+    
+    # And try to solve relative path.
+    if( index( $cgidir, "..\\" ) != -1 )
+    {
+    	my $p = cwd;
+    	$p =~ s/\//\\/g;
+    	$cgidir =~ s/\//\\/g;
+    	while(1) 
+    	{
+    		my $pos = index( $cgidir, "..\\" );
+    		last if( $pos == -1 );
+    		$cgidir = substr( $cgidir, $pos+3 );
+    		
+    		$pos = rindex( $p, "\\" );
+    		last if( $pos == -1 );
+    		$p = substr( $p, 0, $pos);
+    	}
+    	$cgidir = $p . "\\" . $cgidir;
+    }
+    
+    if ( ! -e( $cgidir . "rerunsubs.pl" ) )
+    {
+        $cgidir = cwd;
+        my $domain = "VideoApp_Domain";
+        my $pos = index( $cgidir, $domain );
+        if( $pos != -1 )
+        {
+            $cgidir = substr( $cgidir, 0, $pos + length( $domain ) ) . "\\videoplayer\\tsrc\\testing\\tools\\";
+            
+        }
+    }
+    require( $cgidir . "utils.pl" );
+}
+
+#------------------------------------------------------------------------------------
+# GLOBAL CODE
+#------------------------------------------------------------------------------------
+
+my @paramClasses;
+
+while(scalar(@ARGV) <= 0)
+{
+    Help();
+    exit;
+}
+
+while(scalar(@ARGV) >= 1)
+{
+	my $argument = shift(@ARGV);
+
+	if($argument eq "-c")
+	{
+		my $class = shift(@ARGV);
+		push @paramClasses, $class;
+	}
+	elsif($argument eq "-h")
+	{
+		Help();
+		exit;
+	}
+	else  {
+        Help();
+		exit;
+	}
+}
+
+sub Help
+{
+    print <<USAGE_EOF;
+
+Creates new STIF CFG files depending if they have the specified class(es) defined. Add line:
+    # CaseClass: <classname> 
+before the case to define the class.
+
+Usage: genCfgs.pl -c <classname> (-c classname2)
+    
+USAGE_EOF
+    
+    exit;
+}
+
+ClassifyCfgs( \@paramClasses );
+
+exit;
+
+sub ClassifyCfgs
+{
+    my ( $refClasses ) = @_;
+    
+    system("rmdir /s /q conf_temp");
+    mkdir("conf_temp");
+    
+    my @cfgFiles;
+    FindFiles( ".", ".cfg", 0, \@cfgFiles );
+    
+    my @testframeworkInis;
+    FindFiles( ".", "testframework.ini", 0, \@testframeworkInis );
+    if( scalar( @testframeworkInis ) < 1 )
+    {
+        die("\nThere must be at least one testframework.ini somewhere in the subpath!\n");
+    }
+    print("Using testframework.ini from: " . $testframeworkInis[0] . "\n");
+    
+    my @pkgFiles;
+    
+    foreach my $file ( @cfgFiles )
+    {
+        my $dst = ".\\conf_temp\\" . GetPathFileName( $file );
+        if( ClassifyCfg( $refClasses, $file, $dst ) )
+        {
+            push @pkgFiles, GetPathFileName( $file );
+            AddCfgToIni( $testframeworkInis[0], ".\\conf_temp\\Testframework.ini", GetPathFileName( $file ) );
+            print("Added: " . GetPathFileName($file) . "\n");
+        }
+    }
+    
+    if( scalar(@pkgFiles) > 0 )
+    {
+        MakeSISX( \@pkgFiles );
+    }
+    else
+    {
+        system("rmdir /s /q conf_temp"); # remove empty dir
+    }
+}
+
+sub ClassifyCfg
+{
+    my ( $refClasses, $sourceFile, $destFile ) = @_;
+    
+    # Read the cfg.
+	open(FILE_HANDLE, $sourceFile) or die ("ERROR! Could not open file $sourceFile\n");
+	my @cfgLines = <FILE_HANDLE>;
+	close(FILE_HANDLE);    
+        
+    my @cfgCases;
+    ReadCfgCasesWithClass( \@cfgLines, \@cfgCases, $refClasses );
+    
+    if( !@cfgCases or scalar(@cfgCases) < 1 )
+    {
+        return 0;
+    }
+    
+    # Write the helium CFG.
+    open(FILE_HANDLE, ">$destFile") or die("Could not write into file $destFile\n");
+    
+    # Write everything from CFG before the first case.
+    foreach my $line ( @cfgLines )
+    {
+        if( $line =~ m/\[Test\]/ )
+        {
+            last; 
+        }
+        print FILE_HANDLE ( $line );
+    }
+    
+    foreach my $refCase ( @cfgCases )
+    {
+        my $refCaseLines = @$refCase[1];
+        print FILE_HANDLE ( @$refCaseLines );
+        print FILE_HANDLE ( "\n" );
+    }
+        
+    close( FILE_HANDLE );
+    
+    return 1;
+}
+
+sub ReadCfgCasesWithClass
+{
+    my ( $refLines, $refCases, $refClasses ) = @_;
+    
+	my $inCase = 0;
+	my @caseLines;
+	my $caseTitle;
+    my @caseClasses = "";
+
+    my $cfgHasClassCases = 0;
+
+	for( my $i = 0; $i < scalar(@$refLines); $i++ )
+	{
+	    my $line = @$refLines[$i];
+	    
+	    # Case has class.
+	    if( $line =~ m/#[ ]+CaseClass:/ )
+	    {
+	        my $pos = index( $line, "CaseClass: " );
+	        if( $pos == -1 )
+	        {
+	            $i++;
+	            die("Invalid CaseClass at line $i. Must be specified exactly as '# CaseClass: clas1(,class2,class3..)'.\n");
+	        }
+	        my $classes = substr( $line, $pos + 11 );
+	        RemoveWhiteSpaces(\$classes);
+	        @caseClasses = split(/,/, $classes);	        
+	    }
+
+	    # Case starts here.
+	    if( $line =~ m/\[Test\]/ )
+	    {
+	        undef( @caseLines );
+	        $caseTitle = "";
+	        $inCase = 1;
+	    }
+	    
+	    # Found title for the case.
+	    if( $line =~ m/^title / )
+	    {
+	        $caseTitle = $line;
+	    }
+	    
+	    # Save case lines.
+	    if( $inCase )
+	    {
+	        push @caseLines, ( $line );
+	    }
+	    
+	    # End of test case.
+	    if( $line =~ m/\[Endtest\]/ )
+	    {
+	        $inCase = 0;
+
+            my $saveCase = 0;
+                    
+            foreach my $class ( @$refClasses )
+            {
+                foreach my $caseClass (@caseClasses)
+                {
+                    if( $caseClass eq $class )
+                    {
+                        $saveCase = 1;
+                        $cfgHasClassCases = 1;
+                        #print("Class case: $caseTitle\n"); 
+                    }
+                }
+            }
+            
+            if( $caseTitle =~ m/Setup/i or $caseTitle =~ m/not a test/i or $caseTitle =~ m/set up/i 
+                or $caseTitle =~m/not test/i or $caseTitle =~m/cleanup/i )
+            {
+                $saveCase = 1;
+                #print("Setup case: $caseTitle\n");
+            }
+            
+            if( $saveCase )
+            {
+                # Yes, save it.
+                my @case;
+                $case[0] = $caseTitle;
+                $case[1] = [ @caseLines ];
+                push @$refCases, [ @case ];
+	        
+	        }
+	        undef( @caseClasses );
+	    }
+	}
+	
+	if( !$cfgHasClassCases )
+	{
+        undef( @$refCases );
+	}
+}
+
+sub FindFiles
+{
+	my ($godir, $fileSearch, $searchType, $refIncfiles) = @_;
+
+	my $startDir = cwd;
+
+	chdir($godir);
+
+	opendir(DIR, ".");
+	my @filelist = sort(readdir(DIR));
+	closedir(DIR);
+
+	foreach my $file(@filelist)
+	{
+		if($file eq "." or $file eq "..") {next};
+
+		if (-d $file)
+		{
+		 	FindFiles( $file, $fileSearch, $searchType, $refIncfiles);
+		} else
+		{
+			if( ($file =~ m/$fileSearch/i and $searchType == 0 ) or ($file =~ m/$fileSearch$/i and $searchType == 1 ) )
+			{
+                $file = cwd . "/" . $file;
+				push @$refIncfiles, $file;
+			}
+		}
+	}
+
+	chdir ($startDir);
+}
+
+sub MakeSISX
+{
+    my ($refFiles) = @_;
+
+    # Continue creating pkg.
+
+    my $startDir = cwd;
+
+    chdir( "conf_temp" );
+
+    my $pkgname = "cfgs.pkg";
+    my $sisname = "cfgs.sis";
+    my $sisnamex = "cfgs.sisx";
+
+    print("Writing pkg $pkgname\n");
+	if( !open(FILE_HANDLE, ">$pkgname") )
+	{
+		print("ERROR: could not write to file: $pkgname\n");
+		return 0;
+	}
+
+    my $lineFeed = "\n";
+
+    print FILE_HANDLE (
+    "&EN" . $lineFeed .
+    "#{\"CFGS\"},(0x10102ae9),0,1,0,TYPE=PU" . $lineFeed .
+    "%{\"Nokia EN\"}" . $lineFeed .
+    ":\"Nokia\"" . $lineFeed
+    );
+
+    foreach my $file (@$refFiles)
+    {
+        print FILE_HANDLE ("\"..\\conf_temp\\$file\" - \"c:\\TestFramework\\$file\"" . $lineFeed );
+    }
+    
+    my $file = "Testframework.ini";
+    print FILE_HANDLE (";\"..\\conf_temp\\$file\" - \"c:\\TestFramework\\$file\"" . $lineFeed );
+
+    close(FILE_HANDLE);
+
+    # Check that we have signing keys.
+    
+    my $derFile = "RDTest_02.der";
+    my $keyFile = "RDTest_02.key";
+
+    if (-e $derFile and -e $keyFile)
+    {
+        # Keys are in current dir
+    }
+    elsif(-e "sis\\$derFile" and -e "sis\\$keyFile")
+    {
+        # Keys are in internal/sis dir
+        $derFile = "sis\\$derFile";
+        $keyFile = "sis\\$keyFile";
+    }
+    elsif(-e "group\\$derFile" and -e "group\\$keyFile")
+    {
+        # Keys are in internal/group dir
+        $derFile = "group\\$derFile";
+        $keyFile = "group\\$keyFile";
+    }    
+    else
+    {
+        # Find em.
+        my @derFiles;
+        my @keyFiles;
+        FindFiles( ".", "$derFile", 0, \@derFiles );
+        FindFiles( ".", "$keyFile", 0, \@keyFiles );
+        $derFile = $derFiles[0] if( scalar(@derFiles) > 0 );
+        $keyFile = $keyFiles[0] if( scalar(@keyFiles) > 0 );
+    }
+       
+    if (!-e $derFile or !-e $keyFile)
+    {
+        print("\nNeed signing keys: $derFile and $keyFile in current or subdirs.\n");
+        return;
+    }
+
+    my $cmd = "makesis $pkgname $sisname";
+    print("$cmd\n");
+    system $cmd;
+
+    $cmd = "signsis $sisname $sisnamex $derFile $keyFile";
+    print("$cmd\n");
+    system $cmd;
+    
+    #system("del $pkgname");
+    system("del $sisname");
+    
+    chdir( $startDir );
+}
+
+
+sub AddCfgToIni
+{
+    my ($sourceFile, $destIniFile, $cfgFile) = @_;
+
+    # Rerun ini does not exist. Create one.
+    if( ! (-e $destIniFile) )
+    {
+    	if( !open(FILE_HANDLE, $sourceFile) )
+    	{
+    		print("ERROR! Could not open file '" . $sourceFile . "'\n");
+    		return 0;
+    	}
+    	my @array = <FILE_HANDLE>;
+    	close(FILE_HANDLE);
+
+    	if( !open(FILE_HANDLE, ">$destIniFile") )
+    	{
+    		print("ERROR! Could not open file '" . $destIniFile . "'\n");
+    		return 0;
+    	}
+
+        my $inNew_Module = 0;
+
+        foreach $line ( @array )
+        {
+            if($line =~ m/\[New_Module\]/)
+            {
+                $inNew_Module = 1;
+                print FILE_HANDLE ($line);
+                print FILE_HANDLE ("ModuleName= TestScripter\n");
+            }
+            if($line =~ m/\[End_Module\]/)
+            {
+                $inNew_Module = 0;
+            }
+
+            if($inNew_Module)
+            {
+                # Copy only setup cfgs if they are found.
+                if($line =~ m/setvalidservices/i)
+                {
+                    print FILE_HANDLE ($line);
+                }
+                if($line =~ m/testprovisioning/i)
+                {
+                    print FILE_HANDLE ($line);
+                }
+            }
+            else
+            {
+                print FILE_HANDLE ($line);
+            }
+        }
+
+    	close(FILE_HANDLE);
+    }
+
+    # Read the existing file.
+
+    if( !open(FILE_HANDLE, $destIniFile) )
+	{
+		print("ERROR! Could not open file '" . $destIniFile . "'\n");
+		return 0;
+	}
+	my @array = <FILE_HANDLE>;
+	close(FILE_HANDLE);
+
+    # Check if CFG is already there.
+
+    my $inNew_Module = 0;
+
+    foreach $line ( @array )
+    {
+        if($line =~ m/\[New_Module\]/)
+        {
+            $inNew_Module = 1;
+        }
+        if($line =~ m/\[End_Module\]/)
+        {
+            $inNew_Module = 0;
+        }
+
+        if($inNew_Module)
+        {
+            if($line =~ m/$cfgFile/i)
+            {
+                return 1;
+            }
+        }
+    }
+
+    # Add the cfg to it.
+
+	if( !open(FILE_HANDLE, ">$destIniFile") )
+	{
+		print("ERROR! Could not open file '" . $destIniFile . "'\n");
+		return 0;
+	}
+
+    $inNew_Module = 0;
+
+    foreach $line ( @array )
+    {
+        if($line =~ m/\[End_Module\]/)
+        {
+            $inNew_Module = 0;
+            print FILE_HANDLE ("TestCaseFile= c:\\TestFramework\\$cfgFile\n");
+        }
+        print FILE_HANDLE ($line);
+    }
+
+	close(FILE_HANDLE);
+
+    return 1;
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/testing/tools/genVideoFeed.pl	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,156 @@
+#
+# 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: 
+#
+
+
+#------------------------------------------------------------------------------------
+# Includes
+#------------------------------------------------------------------------------------
+#use strict;
+use warnings;
+use Cwd; # for cwd
+use FindBin; # for FindBin:Bin
+use File::Path; # for mkpath
+use Date::Calc;
+
+#------------------------------------------------------------------------------------
+# GLOBAL CODE
+#------------------------------------------------------------------------------------
+
+
+my $xmlStart = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" .
+"<rss version=\"2.0\" xmlns:media=\"http://search.yahoo.com/mrss/\">\n" .
+"\t<channel>\n";
+
+my $xmlItem =
+"\t<item>\n" .
+"\t\t<enclosure url=\"XMLURL\" length=\"39567360\" type=\"video/3gpp\"/>\n" .
+"\t\t<title>XMLTITLE</title>\n" .
+"\t\t<guid>XMLURL</guid>\n" .
+"\t</item>\n";
+
+my $xmlEnd =
+"\t</channel>\n" .
+"</rss>\n";
+
+my $argcount = scalar(@ARGV);
+my $paramFileName = "";
+my $paramOutFileName = "";
+
+if(scalar(@ARGV) < 2)
+{
+    print("Usage: perl genVideoFeed.pl <infile> <outfile>\n");
+    print("Infile is list of videos with url and title are separated by comma\n");
+    exit();
+}
+
+while(scalar(@ARGV) >= 1)
+{
+	$paramFileName = shift(@ARGV);
+	$paramOutFileName = shift(@ARGV);
+}
+
+# Read TXT
+
+if( !open(FILE_HANDLE, $paramFileName) )
+{
+	print("ERROR! Could not open file '" . $paramFileName . "'\n");
+	return 0;
+}
+my @array = <FILE_HANDLE>;
+close(FILE_HANDLE);
+
+# Write XML
+
+if(!open(FILE_HANDLE, ">" . "$paramOutFileName") )
+{
+    print("ERROR! Could not open file for writing '" . "$paramOutFileName" . "'\n");
+    return 0;
+}
+
+print FILE_HANDLE ("$xmlStart");
+
+my $line;
+$line = $array[0];
+RemoveWhiteSpaces(\$line);
+print FILE_HANDLE ("<title>$line</title>\n");
+
+for(my $i=1; $i<scalar(@array); $i++)
+{
+    my $pos = index($array[$i], ",");
+    my $url = substr( $array[$i], 0, $pos);
+    my $title = substr( $array[$i], $pos+1);
+
+    RemoveWhiteSpaces(\$url);
+    RemoveWhiteSpaces(\$title);
+
+    my $data = $xmlItem;
+    XmlReadyText(\$title);
+    XmlReadyText(\$url);
+    $data =~ s/XMLTITLE/$title/;
+    $data =~ s/XMLURL/$url/g;
+
+    if($url ne "" and $title ne "")
+    {
+        print FILE_HANDLE ("$data");
+    }
+}
+
+print FILE_HANDLE ("$xmlEnd");
+
+close(FILE_HANDLE);
+
+exit();
+
+#------------------------------------------------------------------------------------
+# RemoveWhiteSpaces
+#
+# Parameters:
+# 	$text
+#------------------------------------------------------------------------------------
+sub RemoveWhiteSpaces
+{
+	my ($text) = @_;
+	${$text} =~ s/\s+$//; #whitespaces in the end
+	${$text} =~ s/^\s+//; #whitespaces at the start
+}
+
+#------------------------------------------------------------------------------------
+# XmlReadyText
+#
+# Parameters:
+# 	$text
+#------------------------------------------------------------------------------------
+sub XmlReadyText
+{
+	my ($text) = @_;
+
+	$txtlt = "&lt;";
+	$txtgt = "&gt;";
+	${$text} =~ s/</$txtlt/g;
+	${$text} =~ s/>/$txtgt/g;
+
+	${$text} =~ s/Ä/&Auml/g;
+	${$text} =~ s/ä/&auml/g;
+	${$text} =~ s/Ö/&Ouml/g;
+	${$text} =~ s/ö/&ouml/g;
+
+	#ä &auml;
+
+#	Ö &Ouml;
+
+#	ö &ouml;
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/testing/tools/genreruncfgs.pl	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,535 @@
+#
+# 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 "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: 
+#
+
+
+#------------------------------------------------------------------------------------
+# Includes
+#------------------------------------------------------------------------------------
+#use strict;
+use warnings;
+use Cwd; # for cwd
+use FindBin; # for FindBin:Bin
+use File::Path; # for mkpath
+use Date::Calc;
+
+{ # No globals.
+    # Solve where the script is located.
+    $0=~/^(.+[\\\/])[^\\\/]+[\\\/]*$/;
+    my $cgidir= $1 || "./";
+    
+    # And try to solve relative path.
+    if( index( $cgidir, "..\\" ) != -1 )
+    {
+    	my $p = cwd;
+    	$p =~ s/\//\\/g;
+    	$cgidir =~ s/\//\\/g;
+    	while(1) 
+    	{
+    		my $pos = index( $cgidir, "..\\" );
+    		last if( $pos == -1 );
+    		$cgidir = substr( $cgidir, $pos+3 );
+    		
+    		$pos = rindex( $p, "\\" );
+    		last if( $pos == -1 );
+    		$p = substr( $p, 0, $pos);
+    	}
+    	$cgidir = $p . "\\" . $cgidir;
+    }
+    
+    if ( ! -e( $cgidir . "rerunsubs.pl" ) )
+    {
+        $cgidir = cwd;
+        my $domain = "VideoApp_Domain";
+        my $pos = index( $cgidir, $domain );
+        if( $pos != -1 )
+        {
+            $cgidir = substr( $cgidir, 0, $pos + length( $domain ) ) . "\\videoplayer\\tsrc\\testing\\tools\\";
+            
+        }
+    }
+    require( $cgidir . "rerunsubs.pl" );
+    require( $cgidir . "utils.pl" );
+}
+
+#------------------------------------------------------------------------------------
+# GLOBAL CODE
+#------------------------------------------------------------------------------------
+
+my $lineFeed = "\n";
+
+my $regexpCaseName = '[<>\x3C\x3E\(\)\w.,\/:_\-&\' ]+';
+
+my $argcount = scalar(@ARGV);
+my $paramStartDir = "..";
+my $paramQuiet = 0;
+my $paramFilename = "";
+my $paramMakeSis = 1;
+my $paramGenCaseList = 0;
+
+if(scalar(@ARGV) <= 0)
+{
+    my @xmlFiles;
+    FindFiles(".", "xml", 1, \@xmlFiles, 0);
+    
+    if( scalar(@xmlFiles) > 1 )
+    {
+    	print("Multiple xml files. Can run without arguments only if there's one testreport xml.\n");
+    	foreach my $file ( @xmlFiles ) 
+    	{
+    	    print("$file\n");
+    	}
+    	ShowHelp();
+    }
+
+    if( scalar(@xmlFiles) <= 0 )
+    {
+    	print("No testreport xml in current directory, cannot run without arguments.\n");
+    	ShowHelp();
+    }
+    
+    $paramFilename = $xmlFiles[0];
+    print("No arguments given. Picked file $paramFilename.\n");
+}
+else
+	{
+	while(scalar(@ARGV) >= 1)
+	{
+		my $argument = shift(@ARGV);
+	
+		if($argument eq "-f")
+		{
+			$paramFilename = shift(@ARGV);
+		}
+		elsif($argument eq "-h")
+		{
+			ShowHelp();
+		}
+		elsif($argument eq "-q")
+		{
+			$paramQuiet = 1;
+		}
+		elsif($argument eq "-sis")
+		{
+			$paramMakeSis = 1;
+		}
+		elsif($argument eq "-caselist")
+		{
+			$paramGenCaseList = 1;
+		}
+		else  {
+			print "arg: $argument\n";
+			ShowHelp();
+		}
+	}
+}
+
+my @incfiles;
+my $startDir = cwd;
+my @failedCfgs;
+
+if( ! -e ".\\init\\testframework.ini" )
+{
+	die("Must be run from tsrc and there must be .\\init\\\testframework.ini!\n");
+}
+
+if( Rerun_ReadFailedCases( $paramFilename, \@failedCfgs ) )
+{
+    die("Reading the Excel file failed!\n");
+}
+
+if( $paramGenCaseList )
+{
+    if(!open(FILE_HANDLE, ">" . "caselist.txt") )
+    {
+        print("ERROR! Could not open file for writing '" . "caselist.txt" . "'\n");
+        return 0;
+    }
+
+    my $currCfg = "";
+    foreach my $cfg( @failedCfgs )
+    {
+        $refCases = @$cfg[1];
+        $file = @$cfg[0];
+
+        if($file ne $currCfg)
+        {
+            print FILE_HANDLE ("cfg $file\n");
+        }
+
+        foreach my $failedCaseName (@$refCases)
+        {
+            print FILE_HANDLE ("case $failedCaseName\n");
+        }
+    }
+
+    close(FILE_HANDLE);
+
+    exit();
+}
+else
+{
+    if(scalar(@failedCfgs) <= 0)
+    {
+    	print("No fails!\n");
+    	exit();
+    }
+    
+    system("rmdir /s /q 1rerun\\\n") if( -e "1rerun" );
+    mkdir("1rerun");
+
+    foreach my $cfg( @failedCfgs )
+    {
+        my $file = @$cfg[0];
+        Rerun_GenerateCfg( ".\\conf\\" . $file, $file, \@failedCfgs );
+    }
+
+    MakeSISX( \@failedCfgs ) if( $paramMakeSis );
+
+    foreach my $cfg( @failedCfgs )
+    {
+        my $file = @$cfg[0];
+        if( -e ".\\conf\\$file" ) 
+        {
+            AddCfgToRerunIni( ".\\init\\testframework.ini", $file );
+            system("move $file 1rerun\\$file");
+        }
+    }
+
+}
+chdir($startDir);
+
+chdir("1rerun");
+system("dir");
+
+exit();
+
+#------------------------------------------------------------------------------------
+# ShowHelp
+#------------------------------------------------------------------------------------
+sub ShowHelp {
+
+print <<USAGE_EOF;
+genreruncfgs.pl
+
+parameter -f <Excel xml testreport> (-sis)
+
+Creates cfg files into the run directory, the cfgs will have cases which have failed or are for setup.
+
+The current directory must be tsrc, there must be testframework.ini in ./init and STIF cfg files in ./cfg.
+
+The testreport can be in current directory and then no parameters are needed.
+
+-sis Creates STIF PU sis of the rerun CFGs.
+-caselist Creates caselist.txt which lists the failed cases
+
+USAGE_EOF
+
+	exit();
+
+};
+
+#------------------------------------------------------------------------------------
+# IniHasCfg
+#------------------------------------------------------------------------------------
+sub IniHasCfg
+{
+    my ($iniFile, $cfgFile) = @_;
+
+	if( !open(FILE_HANDLE, $iniFile) )
+	{
+		print("ERROR! Could not open file '" . $iniFile . "'\n");
+		return 0;
+	}
+	my @array = <FILE_HANDLE>;
+	close(FILE_HANDLE);
+
+	my $inNew_Module = 0; # We are parsing [New_Module] section from INI
+	my $lineCount = scalar(@array);
+	for(my $i=0; $i<$lineCount; $i++ )
+	{
+	    $line = $array[$i];
+
+        $inNew_Module = 1 if($line =~ m/\[New_Module\]/);
+        $inNew_Module = 0 if($line =~ m/\[End_Module\]/);
+
+        if($inNew_Module)
+        {
+            if($line =~ m/$cfgFile/i)
+            {
+                return 1;
+            }
+        }
+    }
+
+    return 0;
+}
+
+sub AddCfgToRerunIni
+{
+    my ($iniFile, $cfgFile) = @_;
+    
+	my $destIniFile = "./1rerun/TestFramework.ini";
+
+    # Create directory for rerun ini
+    mkdir( substr($destIniFile, 0, rindex($destIniFile, "/")) );
+
+    # Rerun ini does not exist. Create one.
+    if( ! (-e $destIniFile) )
+    {
+    	if( !open(FILE_HANDLE, $iniFile) )
+    	{
+    		print("ERROR! Could not open file '" . $iniFile . "'\n");
+    		return 0;
+    	}
+    	my @array = <FILE_HANDLE>;
+    	close(FILE_HANDLE);
+
+    	if( !open(FILE_HANDLE, ">$destIniFile") )
+    	{
+    		print("ERROR! Could not open file '" . $destIniFile . "'\n");
+    		return 0;
+    	}
+
+        my $inNew_Module = 0;
+
+        foreach $line ( @array )
+        {
+            if($line =~ m/\[New_Module\]/)
+            {
+                $inNew_Module = 1;
+                print FILE_HANDLE ($line);
+                print FILE_HANDLE ("ModuleName= TestScripter\n");
+            }
+            if($line =~ m/\[End_Module\]/)
+            {
+                $inNew_Module = 0;
+            }
+
+            if($inNew_Module)
+            {
+                # Copy only setup cfgs if they are found.
+                if($line =~ m/setvalidservices/i)
+                {
+                    print FILE_HANDLE ($line);
+                }
+                if($line =~ m/testprovisioning/i)
+                {
+                    print FILE_HANDLE ($line);
+                }
+            }
+            else
+            {
+                print FILE_HANDLE ($line);
+            }
+        }
+
+    	close(FILE_HANDLE);
+    }
+
+    # Read the existing file.
+
+    if( !open(FILE_HANDLE, $destIniFile) )
+	{
+		print("ERROR! Could not open file '" . $destIniFile . "'\n");
+		return 0;
+	}
+	my @array = <FILE_HANDLE>;
+	close(FILE_HANDLE);
+
+    # Check if CFG is already there.
+
+    my $inNew_Module = 0;
+
+    foreach $line ( @array )
+    {
+        if($line =~ m/\[New_Module\]/)
+        {
+            $inNew_Module = 1;
+        }
+        if($line =~ m/\[End_Module\]/)
+        {
+            $inNew_Module = 0;
+        }
+
+        if($inNew_Module)
+        {
+            if($line =~ m/$cfgFile/i)
+            {
+                return 1;
+            }
+        }
+    }
+
+    # Add the cfg to it.
+
+	if( !open(FILE_HANDLE, ">$destIniFile") )
+	{
+		print("ERROR! Could not open file '" . $destIniFile . "'\n");
+		return 0;
+	}
+
+    $inNew_Module = 0;
+
+    foreach $line ( @array )
+    {
+        if($line =~ m/\[End_Module\]/)
+        {
+            $inNew_Module = 0;
+            print FILE_HANDLE ("TestCaseFile= c:\\TestFramework\\$cfgFile\n");
+        }
+        print FILE_HANDLE ($line);
+    }
+
+	close(FILE_HANDLE);
+
+    return 1;
+}
+
+#------------------------------------------------------------------------------------
+# MakeSISX
+#
+# Parameters:
+# 	$refCfgs
+#------------------------------------------------------------------------------------
+sub MakeSISX
+{
+    my ($refCfgs) = @_;
+
+    my $pkgname = "STIF_failedcases.pkg";
+    my $sisname = "STIF_failedcases.sis";
+    my $sisnamex = "STIF_failedcases.sisx";
+
+    print("Writing pkg $pkgname\n");
+	if( !open(FILE_HANDLE, ">$pkgname") )
+	{
+		print("ERROR: could not write to file: $pkgname\n");
+		return 0;
+	}
+
+    print FILE_HANDLE (
+    "&EN" . $lineFeed .
+    "#{\"RERUN\"},(0x00000000),0,1,0,TYPE=PU" . $lineFeed .
+    "%{\"Nokia EN\"}" . $lineFeed .
+    ":\"Nokia\"" . $lineFeed
+    );
+
+    foreach my $cfg (@$refCfgs)
+    {
+        my $file = @$cfg[0];
+        if( -e $file )
+        {
+            print FILE_HANDLE ("\"$file\" - \"c:\\TestFramework\\$file\"" . $lineFeed );
+        }
+    }
+
+    close(FILE_HANDLE);
+
+    # Check that we have signing keys.
+    
+    my $derFile = "RDTest_02.der";
+    my $keyFile = "RDTest_02.key";
+
+    if (-e $derFile and -e $keyFile)
+    {
+        # Keys are in current dir
+    }
+    elsif(-e "sis\\$derFile" and -e "sis\\$keyFile")
+    {
+        # Keys are in internal/sis dir
+        $derFile = "sis\\$derFile";
+        $keyFile = "sis\\$keyFile";
+    }
+    elsif(-e "group\\$derFile" and -e "group\\$keyFile")
+    {
+        # Keys are in internal/group dir
+        $derFile = "group\\$derFile";
+        $keyFile = "group\\$keyFile";
+    }    
+    else
+    {
+        # Find em.
+        my @derFiles;
+        my @keyFiles;
+        FindFiles( ".", "$derFile", 0, \@derFiles );
+        FindFiles( ".", "$keyFile", 0, \@keyFiles );
+        $derFile = $derFiles[0] if( scalar(@derFiles) > 0 );
+        $keyFile = $keyFiles[0] if( scalar(@keyFiles) > 0 );
+    }
+    
+    if (!-e $derFile or !-e $keyFile)
+    {
+        print("\nNeed signing keys: $derFile and $keyFile in current or subdirs.\n");
+        return;
+    }
+    
+    # Create SISX
+
+    my $cmd = "makesis $pkgname $sisname";
+    print("$cmd\n");
+    system $cmd;
+
+    $cmd = "signsis $sisname $sisnamex $derFile $keyFile";
+    print("$cmd\n");
+    system $cmd;
+
+    system("move $sisnamex 1rerun\\$sisname");
+
+    system("del $pkgname");
+    system("del $sisname");
+}
+
+#------------------------------------------------------------------------------------
+# FindFiles
+# Parameters:
+#	$goDir, where to start finding
+#	$fileSearch, filename search
+#	$searchType, 0 = fullname search, 1 = filetype search
+#	$refIncfiles, reference to array which will hold found files
+#------------------------------------------------------------------------------------
+sub FindFiles
+{
+	my ($godir, $fileSearch, $searchType, $refIncfiles, $recurse) = @_;
+
+	my $startDir = cwd;
+
+	chdir($godir);
+
+	#print("Now in: " . cwd . "\n");
+
+	opendir(DIR, ".");
+	my @filelist = sort(readdir(DIR));
+	closedir(DIR);
+
+	foreach my $file(@filelist)
+	{
+		if($file eq "." or $file eq "..") {next};
+
+		if (-d $file)
+		{
+		 	FindFiles( $file, $fileSearch, $searchType, $refIncfiles) if( $recurse );
+		} else
+		{
+			if( ($file =~ m/$fileSearch/i and $searchType == 0 ) or ($file =~ m/$fileSearch$/i and $searchType == 1 ) )
+			{
+                $file = cwd . "/" . $file;
+				push @$refIncfiles, $file;
+				#print("$file\n");
+			}
+		}
+	}
+
+	chdir ($startDir);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/testing/tools/notifydrop_local.cmd	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,50 @@
+@rem
+@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+@rem All rights reserved.
+@rem This component and the accompanying materials are made available
+@rem under the terms of "Eclipse Public License v1.0"
+@rem which accompanies this distribution, and is available
+@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+@rem
+@rem Initial Contributors:
+@rem Nokia Corporation - initial contribution.
+@rem
+@rem Contributors:
+@rem
+@rem Description:
+@rem
+@echo off
+
+set ats3.username=admin
+set ats3.password=5A3CBBF36BEDD7E99D3606C3F45DD57C
+set ats3.host=%1
+set ats3.pathToDrop=%2
+
+rem If no attributes have been set, show usage.
+if "%1" == "" (goto Usage) else (goto SetCredentials)
+
+rem Set the credentials. If third attribute is set, use given username and password instead of default
+:SetCredentials
+if "%3" == "" (goto Execute)
+set ats3.username=%3
+set ats3.password=%4
+set ats3.schedule=%5
+goto Execute
+
+rem Execute the vbs script that will invoke the web app which will start the test run
+:Execute
+cscript wshTestRun_local.vbs
+goto End
+
+:Usage
+echo.
+echo.
+echo USAGE: notifyimport.cmd ^<ATS3 web server hostname^> ^<path to zip containing ATS3 testrun^> ^[^<username^>^ ^<password^>]
+echo.
+echo NOTE: username is 'admin' and password is default admin password is either plain text or in encrypted form. Both username and password are defined in notifyimport.cmd
+echo.
+echo EXAMPLES:
+echo  notifyimport.cmd someserver.somehost.com c:\the_test_drop.zip
+echo  notifyimport.cmd someserver.somehost.com c:\the_test_drop.zip myUserName myPassword
+
+:End
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/testing/tools/notifydrop_network.cmd	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,49 @@
+@rem
+@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+@rem All rights reserved.
+@rem This component and the accompanying materials are made available
+@rem under the terms of "Eclipse Public License v1.0"
+@rem which accompanies this distribution, and is available
+@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+@rem
+@rem Initial Contributors:
+@rem Nokia Corporation - initial contribution.
+@rem
+@rem Contributors:
+@rem
+@rem Description:
+@rem
+@echo off
+
+set ats3.username=admin
+set ats3.password=5A3CBBF36BEDD7E99D3606C3F45DD57C
+set ats3.host=%1
+set ats3.pathToDrop=%2
+
+rem If no attributes have been set, show usage.
+if "%1" == "" (goto Usage) else (goto SetCredentials)
+
+rem Set the credentials. If third attribute is set, use given username and password instead of default
+:SetCredentials
+if "%3" == "" (goto Execute)
+set ats3.username=%3
+set ats3.password=%4
+goto Execute
+
+rem Execute the vbs script that will invoke the web app which will start the test run
+:Execute
+cscript wshTestRun_network.vbs
+goto End
+
+:Usage
+echo.
+echo.
+echo USAGE: notifydrop.cmd ^<ATS3 web server hostname^> ^<path to zip containing ATS3 testrun^> ^[^<username^>^ ^<password^>]
+echo.
+echo NOTE: username is 'admin' and password is default admin password is either plain text or in encrypted form. Both username and password are defined in notifydrop.cmd
+echo.
+echo EXAMPLES: 
+echo  notifydrop.cmd someserver.somehost.com c:\the_test_drop.zip
+echo  notifydrop.cmd someserver.somehost.com c:\the_test_drop.zip myUserName myPassword
+
+:End
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/testing/tools/rerunsubs.pl	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,369 @@
+#
+# 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: 
+#
+
+my $regexpCaseName = '[<>\x3C\x3E\(\)\w.,\/:_\-&\' ]+';
+
+{ # No globals.
+    # Solve where the script is located.
+    $0=~/^(.+[\\\/])[^\\\/]+[\\\/]*$/;
+    my $cgidir= $1 || "./";
+    
+    # And try to solve relative path.
+    if( index( $cgidir, "..\\" ) != -1 )
+    {
+    	my $p = cwd;
+    	$p =~ s/\//\\/g;
+    	$cgidir =~ s/\//\\/g;
+    	while(1) 
+    	{
+    		my $pos = index( $cgidir, "..\\" );
+    		last if( $pos == -1 );
+    		$cgidir = substr( $cgidir, $pos+3 );
+    		
+    		$pos = rindex( $p, "\\" );
+    		last if( $pos == -1 );
+    		$p = substr( $p, 0, $pos);
+    	}
+    	$cgidir = $p . "\\" . $cgidir;
+    }
+    
+    if ( ! -e( $cgidir . "rerunsubs.pl" ) )
+    {
+        $cgidir = cwd;
+        my $domain = "VideoApp_Domain";
+        my $pos = index( $cgidir, $domain );
+        if( $pos != -1 )
+        {
+            $cgidir = substr( $cgidir, 0, $pos + length( $domain ) ) . "\\videoplayer\\tsrc\\testing\\tools\\";
+            
+        }
+    }
+    
+    require( $cgidir . "utils.pl" );
+}
+
+#------------------------------------------------------------------------------------
+# Rerun_ReadFailedCases
+# Parameters:
+#	$filename, filename of the result IPTV_Engine testreport.
+#	$refCfgs, reference to array which contains failed cases as a result
+#
+# array
+#  {
+#    array { $cfgFilename, @cases },
+#    array { $cfgFilename, @cases },
+#    ...
+#  }
+#
+# returns 1 if something fails, otherwise 0
+#------------------------------------------------------------------------------------
+
+sub Rerun_ReadFailedCases
+{
+    my( $filename, $refCfgs ) = @_;
+
+	if( !open(FILE_HANDLE, $filename) )
+	{
+		print("ERROR! Could not open file '" . $filename . "'\n");
+		return 1;
+	}
+	my @array = <FILE_HANDLE>;
+	close(FILE_HANDLE);
+
+    my $refCfg;
+    my $cfgHasFailedCases = 0;
+
+	my $lineCount = scalar(@array);
+	for($i=0; $i<$lineCount; $i++ )
+	{
+	    $line = $array[$i];
+        XmlToText(\$line);
+	    $line =~ s/\'/\"/g;
+
+        # Read the name of cfg
+	    if($line =~ m/Cell ss:MergeAcross=\"11\" ss:StyleID=\"/ )
+	    {
+	        #<Cell ss:MergeAcross="11" ss:StyleID="m150670304"><Data ss:Type="String">IptvEpgEngineTest.cfg</Data></Cell>
+	        if($line =~ m/>([a-z0-9_\-]+).cfg<\/Data>/i)
+	        {
+                # Add cfg to cfg list if it has failed cases.
+                if( defined( @$refCfg ) and $cfgHasFailedCases )
+                {
+                    push @$refCfgs, [ @$refCfg ];
+                }
+
+                # Initialize new array for new cfg, if the cfg exists.
+                $cfgHasFailedCases = 0;
+     	        
+     	        my $cfgFilename = $1 . ".cfg";
+
+    	        my @cfg;
+    	        $refCfg = \@cfg;
+    	        push @cfg, $cfgFilename;
+    	        my @cases;
+    	        push @cfg, [@cases];
+	        }
+	    }
+
+        #<Cell ss:MergeAcross="5" ss:StyleID="m150670456"><Data ss:Type="String">ET17099 &lt;not a test&gt; Setup EPG tests</Data></Cell>
+        #<Cell ss:MergeAcross="5" ss:StyleID="m150686796"><Data ss:Type="String">ET17001 Update EPG 3G</Data></Cell>
+	    #<Cell ss:StyleID="s57"><Data ss:Type="String">PASSED</Data></Cell>
+
+	    # Read case and the result
+	    if( defined( @$refCfg ) && $line =~ m/Cell ss:MergeAcross=\"5\" ss:StyleID=\"/ )
+	    {
+	        if($line =~ m/>($regexpCaseName)<\/Data><\/Cell>/i)
+	        {
+	            my $caseName = $1;
+                my $saveCase = 0;
+
+	            $line2 = $array[$i+1];
+	            XmlToText(\$line2);
+	            
+	            #print("Found case: $caseName\n");
+	            
+	            if( $line =~ m/Setup/i or $line =~ m/not a test/i or $line =~ m/set up/i or $line =~m/not test/i or $line =~m/cleanup/i)
+	            {
+	                #print(" - is for setup\n");
+	                $saveCase = 1;
+	            }
+
+	            # If case has failed.
+	            if($line2 =~ m/>CRASHED</ or $line2 =~ m/>FAILED</)
+	            {
+	                #print(" - failed\n");
+	                $saveCase = 1;
+	                $cfgHasFailedCases = 1;
+	            }
+
+                # It's marked for rerun.
+	            if($saveCase)
+	            {
+                    my $refCases = @$refCfg[1];
+	                push @$refCases, $caseName;
+	                #print(" - ADDED\n");
+	            }
+	        }
+        }
+	}
+
+    # If cfg has failed cases then add it
+    if(defined(@$refCfg) and $cfgHasFailedCases != 0)
+    {
+        push @$refCfgs, [ @$refCfg ];
+    }
+	return 0;
+}
+
+
+#------------------------------------------------------------------------------------
+# Rerun_GenerateCfg
+# Parameters:
+#   $srcFile, $destFile
+#------------------------------------------------------------------------------------
+sub Rerun_GenerateCfg
+{
+    my($srcFile, $destFile, $refFailedCfgs) = @_;
+    
+    my $refCases = 0;
+    
+    foreach my $cfg( @$refFailedCfgs )
+    {
+        my $cfgFile = GetPathFileName( $srcFile );
+        if( @$cfg[0] =~ m/$cfgFile/i )
+        {
+            $refCases = @$cfg[1];    
+            last;
+        }
+    }
+    
+    if( !$refCases )
+    {
+        my $cfgFile = GetPathFileName( $srcFile );
+        #print("Writing empty cfg for $cfgFile, no fails.\n");
+
+        open(FILE_HANDLE, ">$destFile");
+        close(FILE_HANDLE);
+        
+        return 0;
+    }
+    
+    my @foundFailedCases;
+
+    my @lines;
+
+	if( open(FILE_HANDLE, $srcFile) )
+	{
+		@lines = <FILE_HANDLE>;
+		close(FILE_HANDLE);
+	}
+	else
+	{
+		print("ERROR: could not read file: $srcFile\n");
+		return 0;
+	}
+
+	print("Writing cfg $destFile\n");
+	if( !open(FILE_HANDLE, ">$destFile") )
+	{
+		print("ERROR: could not write to file: $destFile\n");
+		return 0;
+	}
+
+    my $lastLineBeforeCases = 0;
+    for( my $i=0; $i<scalar(@lines); $i++ )
+    {
+        $line = $lines[$i];
+        $lastLineBeforeCases = $i if( $line =~ m/\[Enddefine\]/i or $line =~ m/\[EndSub\]/i );
+    }
+
+    # Write lines before first case
+    foreach my $line(@lines)
+    {
+        print FILE_HANDLE ( $line );
+
+        if($line =~ m/\[Enddefine\]/i)
+        {
+            last;
+        }
+    }
+
+    # Write all subs
+
+    my $inSub = 0;
+    my $refSubLines;
+    foreach my $line (@lines)
+    {
+        RemoveWhiteSpaces(\$line);
+
+        # Sub starts?
+        if($line =~ m/\[Sub [a-zA-Z0-9]+\]/)
+        {
+            $inSub= 1;
+            my @subLines;
+            $refSubLines = \@subLines;
+        }
+
+        # Add lines
+        if($inSub)
+        {
+            push @$refSubLines, $line;
+        }
+
+        # Sub ends?
+        if($line =~ m/\[EndSub\]/)
+        {
+            $inSub = 0;
+
+            foreach $l (@$refSubLines)
+            {
+                print FILE_HANDLE ( "$l" . "\n" );
+            }
+
+            print FILE_HANDLE ( "\n" );
+            print FILE_HANDLE ( "\n" );
+        }
+    }
+
+    print FILE_HANDLE ( "\n" );
+    print FILE_HANDLE ( "\n" );
+
+    my $savedCases = 0;
+
+    # Write cases
+    my $inCase = 0;
+    my $refCaseLines;
+    my $writeCase = 0;
+    foreach my $line(@lines)
+    {
+        RemoveWhiteSpaces(\$line);
+
+        # Case starts?
+        if($line =~ m/\[Test\]/)
+        {
+            $inCase = 1;
+            my @caseLines;
+            $refCaseLines = \@caseLines;
+            $writeCase = 0;
+        }
+
+        # Add lines
+        if($inCase)
+        {
+            push @$refCaseLines, $line;
+        }
+
+        # Case ends?
+        if($line =~ m/\[Endtest\]/)
+        {
+            $inCase = 0;
+
+            # And it had failed. Write into new cfg.
+            if($writeCase)
+            {
+                foreach $l(@$refCaseLines)
+                {
+                    print FILE_HANDLE ( "$l" . "\n" );
+                }
+
+                print FILE_HANDLE ( "\n" );
+                print FILE_HANDLE ( "\n" );
+            }
+        }
+
+        # title line for the case
+        if($inCase and $line =~ m/^title /)
+	    {
+	    	my $caseName = substr($line, length("title "));
+	    	RemoveWhiteSpaces(\$caseName);
+
+            foreach my $failedCaseName (@$refCases)
+            {
+                my $addFoundCase = 0;
+                if( $line =~ m/Setup/i or $line =~ m/not a test/i or $line =~ m/set up/i or $line =~m/not test/i or $line =~m/cleanup/i)
+                {
+                    $addFoundCase = 1;
+                }
+                
+                if($failedCaseName eq $caseName)
+                {
+                    $addFoundCase = 1;
+                }
+                if( $addFoundCase )
+                {
+                    push @foundFailedCases, $caseName;
+                    print(" - Case: $failedCaseName\n");
+                    $writeCase = 1;
+                    $savedCases++;
+                }
+            }
+        }
+    }
+
+    my $caseIsFound = 0;
+    foreach my $failedCaseName (@$refCases)
+    {
+        foreach my $foundCaseName (@foundFailedCases)
+        {
+            $caseIsFound = 1 if($foundCaseName eq $failedCaseName);
+        }
+        if(!$caseIsFound)
+        {
+            print("ERROR: Case '$failedCaseName' couldn't be found from the CFG files!\n");
+        }
+        $caseIsFound = 0;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/testing/tools/s60poliisi.pl	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,230 @@
+#
+# 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 "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: 
+#
+
+
+#------------------------------------------------------------------------------------
+# Includes
+#------------------------------------------------------------------------------------
+#use strict;
+use warnings;
+use Cwd; # for cwd
+use FindBin; # for FindBin:Bin
+use File::Path; # for mkpath
+use Date::Calc;
+use File::Copy;
+
+my @files;
+
+FindDirs(".", "", \@dirs);
+
+my $option = "";
+
+$option = shift(@ARGV) if( scalar(@ARGV) > 0 );
+
+if( $option eq "-check" )
+{
+ 	# Check for missing policy files.
+ 	print("Policy file missing from directories:\n");
+	my $count = 0;
+	foreach $dir ( @dirs )
+	{
+    if( !-e "$dir/distribution.policy.s60" )
+    	{
+    	print("$dir\n");
+    	$count++;
+    	}
+	}
+	print("None!\n") if( $count == 0 );
+}
+elsif( $option eq "-len" )
+{
+	print("Too long filenames:\n");
+	foreach $dir ( @dirs )
+	{
+		my @files;
+		GetAllFiles( $dir, \@files );
+	    foreach $file ( @files )
+	   	{
+	    	if( length( $dir . "/" . $file ) > 140 )
+	    	{
+	    		print("$dir/$file\n");
+	    	}
+	    }
+	}
+}
+elsif( $option eq "-list" )
+{
+	foreach $dir ( @dirs )
+	{
+    	print("$dir\n");
+    	CheckDistri( $dir );
+	}
+}
+elsif( $option eq "" )
+{
+	print("This copies distribution.policy.s60 file from current directory to all subdirectories.\n\n");
+	print("Press CTRL-C to cancel, ENTER key to continue.\n\n");
+	 <>;
+	
+	die("policy file does not exist in current directory!") if( ! -e "distribution.policy.s60" );
+	
+	foreach $dir ( @dirs )
+		{
+	    unlink("$dir/distribution.policy.s60");
+	    copy("distribution.policy.s60", "$dir/distribution.policy.s60");
+		}
+}
+else
+{
+	print("Options:\n");
+	print("  -check checks all directories for policy files.\n");
+	print("  -len checks that any path doesn't go over 140 characters.\n");
+	exit();
+}
+
+# returns if this is internal folder
+sub CheckDistri
+{
+	my ($dir) = @_;
+	
+	#
+	# Check all subdirs but internals
+	#
+	
+	my $isInternal = 0;
+	
+	if( substr($dir, rindex( $dir, "/" )+1 ) =~m/internal$/i )
+	{
+		$isInternal = 1;
+	}
+	return $isInternal;
+}
+
+#------------------------------------------------------------------------------------
+# FindFiles
+# Parameters:
+#	$goDir, where to start finding
+#	$fileSearch, filename search
+#	$searchType, 0 = fullname search, 1 = filetype search
+#	$refIncfiles, reference to array which will hold found files
+#------------------------------------------------------------------------------------
+sub FindFiles
+{
+	my ($godir, $fileSearch, $searchType, $refIncfiles, $fileFilter) = @_;
+
+	my $startDir = cwd;
+
+	chdir($godir);
+
+	#print("Now in: " . cwd . "\n");
+
+	opendir(DIR, ".");
+	my @filelist = sort(readdir(DIR));
+	closedir(DIR);
+
+	foreach my $file(@filelist)
+	{
+		if($file eq "." or $file eq "..") {next};
+
+		if (-d $file)
+		{
+		 	FindFiles( $file, $fileSearch, $searchType, $refIncfiles, $fileFilter );
+		} else
+		{
+			if( ($file =~ m/$fileSearch/i and $searchType == 0 and $file =~m/$fileFilter/i) or ($file =~ m/$fileSearch$/i and $searchType == 1 and $file =~m/$fileFilter/i) )
+			{
+                $file = cwd . "/" . $file;
+				push @$refIncfiles, $file;
+				#print("$file\n");
+			}
+		}
+	}
+
+	chdir ($startDir);
+}
+
+
+#------------------------------------------------------------------------------------
+# GetAllFiles
+# Parameters:
+#	$goDir, where to start finding
+#	$refIncfiles, reference to array which will hold found files
+#------------------------------------------------------------------------------------
+sub GetAllFiles
+{
+	my ($godir, $refIncfiles) = @_;
+
+	my $startDir = cwd;
+
+	chdir($godir);
+
+	#print("Now in: " . cwd . "\n");
+
+	opendir(DIR, ".");
+	my @filelist = sort(readdir(DIR));
+	closedir(DIR);
+
+	foreach my $file(@filelist)
+	{
+		if($file eq "." or $file eq "..") {next};
+		
+		if (! (-d $file) )
+		{
+		 	push @$refIncfiles, $file;
+		}
+	}
+
+	chdir ($startDir);
+}
+
+
+#------------------------------------------------------------------------------------
+# FindDirs
+# Parameters:
+#	$goDir, where to start finding
+#	$fileSearch, filename search
+#	$refIncfiles, reference to array which will hold found files
+#------------------------------------------------------------------------------------
+sub FindDirs
+{
+	my ($godir, $fileSearch, $refIncfiles) = @_;
+
+	my $startDir = cwd;
+
+	chdir($godir);
+
+	#print("Now in: " . cwd . "\n");
+
+	opendir(DIR, ".");
+	my @filelist = sort(readdir(DIR));
+	closedir(DIR);
+
+	foreach my $file(@filelist)
+	{
+		if($file eq "." or $file eq "..") {next};
+
+		if (-d $file)
+		{
+		    if( $file =~ m/$fileSearch/i )
+		    {
+		        push @$refIncfiles, (cwd . "/" . $file);
+		    }
+		 	FindDirs( $file, $fileSearch, $refIncfiles );
+		}
+	}
+
+	chdir ($startDir);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/testing/tools/selgesubdirs.pl	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,156 @@
+#
+# 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 "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: 
+#
+
+
+#------------------------------------------------------------------------------------
+# Includes
+#------------------------------------------------------------------------------------
+#use strict;
+use warnings;
+use Cwd; # for cwd
+use FindBin; # for FindBin:Bin
+use File::Path; # for mkpath
+use Date::Calc;
+
+#------------------------------------------------------------------------------------
+# GLOBAL CODE
+#------------------------------------------------------------------------------------
+
+my $argcount = scalar(@ARGV);
+
+if(scalar(@ARGV) > 0)
+{
+    ShowHelp();
+    exit();
+}
+
+print("This script deletes mobilecrashes and result directory from ./Selge.\nPress CTRL-C to quit, enter to continue.\n");
+$input = <>;
+exit if($input eq "q");
+
+my @dirs;
+my $startDir = cwd;
+
+FindFiles(".", 1, "", \@dirs, "case_*");
+
+foreach my $dir(@dirs)
+{
+    $dir =~ s/\//\\/g; #whitespaces in the end
+    system("del selge\\mobilecrash_*.bin\n");
+
+    print("copy $dir\\mobilecrash_*.bin selge\\\n");
+    system("copy $dir\\mobilecrash_*.bin selge\\");
+
+    print("cd selge\n");
+    chdir("selge");
+
+    print("selge.exe -m\n");
+    system("selge.exe -m");
+
+    print("copy results\\ $dir\\\n");
+    system("copy results\\ $dir\\");
+
+
+    print("del mobilecrash_*.bin\n");
+    system("del mobilecrash_*.bin");
+
+    print("rmdir /s /q results\\\n");
+    system("rmdir /s /q results\\");
+
+    chdir("..");
+}
+
+chdir($startDir);
+
+exit();
+
+#------------------------------------------------------------------------------------
+# ShowHelp
+#------------------------------------------------------------------------------------
+sub ShowHelp {
+
+print <<USAGE_EOF;
+
+selgesubdirs.pl
+
+Copies the mobilecrashes from sub directories into Selge directory and runs Selge there.
+Result files are copied back to the sub directory.
+
+Only directories starting with case_ are processed. Selge and case_* must exist in the current directory.
+
+USAGE_EOF
+
+	exit();
+
+};
+
+#------------------------------------------------------------------------------------
+# RemoveWhiteSpaces
+#
+# Parameters:
+# 	$text
+#------------------------------------------------------------------------------------
+sub RemoveWhiteSpaces()
+{
+	my ($text) = @_;
+	${$text} =~ s/\s+$//; #whitespaces in the end
+	${$text} =~ s/^\s+//; #whitespaces at the start
+}
+
+#------------------------------------------------------------------------------------
+# FindFiles
+# Parameters:
+#	$goDir, where to start finding
+#   $fileType 0 = files, 1 = directories
+#	$fileSearch, filename search
+#	$refIncfiles, reference to array which will hold found files
+#------------------------------------------------------------------------------------
+sub FindFiles
+{
+	my ($godir, $fileType, $fileSearch, $refIncfiles) = @_;
+
+	my $startDir = cwd;
+
+	chdir($godir);
+
+	#print("Now in: " . cwd . "\n");
+
+	opendir(DIR, ".");
+	my @filelist = sort(readdir(DIR));
+	closedir(DIR);
+
+	foreach my $file(@filelist)
+	{
+
+		if($file eq "." or $file eq "..") {next};
+
+		if($file =~ m/$fileSearch/i)
+		{
+
+    		if (!(-d $file) and $fileType == 0)
+    		{
+				push @$refIncfiles, ( cwd . "/" . $file );
+    		}
+    		elsif (-d $file and $fileType == 1)
+    		{
+				push @$refIncfiles, ( cwd . "/" . $file );
+    		}
+        }
+	}
+
+	chdir ($startDir);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/testing/tools/setversion.pl	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,60 @@
+#
+# 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 "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: 
+#
+
+
+#------------------------------------------------------------------------------------
+# Includes
+#------------------------------------------------------------------------------------
+#use strict;
+use warnings;
+use FindBin; # for FindBin:Bin
+
+#------------------------------------------------------------------------------------
+# GLOBAL CODE
+#------------------------------------------------------------------------------------
+
+my $version = 10.1;
+my $file = "";
+
+while(scalar(@ARGV) >= 1)
+{
+	my $argument = shift(@ARGV);
+
+	if($argument eq "-v")
+		{
+		$version = shift(@ARGV);
+		}
+		
+	if($argument eq "-f")
+		{
+		$file = shift(@ARGV);
+		}
+}
+
+open(FILE_HANDLE, $file) or die ("Could not read file '$file'\n");
+my @lines = <FILE_HANDLE>;
+close(FILE_HANDLE);
+
+foreach my $line ( @lines )
+  {
+  if( $line =~ /\/epoc32([^\"]+)\.dll/i )
+   	{
+     	my $filename = "/epoc32" . $1 . ".dll";
+			$filename =~ s/\//\\/g;
+			print $filename . " TO VERSION " . $version . "\n";
+			system("elftran $filename -version $version");
+		}
+	}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/testing/tools/siscreator.pl	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,1 @@
+e:\ec_tmpdir\T2a06296: No such file or directory
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/testing/tools/test_build.cmd	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,116 @@
+@rem
+@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+@rem All rights reserved.
+@rem This component and the accompanying materials are made available
+@rem under the terms of "Eclipse Public License v1.0"
+@rem which accompanies this distribution, and is available
+@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+@rem
+@rem Initial Contributors:
+@rem Nokia Corporation - initial contribution.
+@rem
+@rem Contributors:
+@rem
+@rem Description:
+@rem
+@echo off
+
+echo ----------------------------------------
+echo LOGGING HEADERS
+echo ----------------------------------------
+call \VideoApp_Domain\videoplayer\tsrc\testing\tools\copylogheaders.cmd
+
+echo ----------------------------------------
+echo ADD COMMENTS TO .PKG AND .INF
+echo ----------------------------------------
+call pushd \VideoApp_Domain\
+call \VideoApp_Domain\videoplayer\tsrc\testing\tools\tsrpkgtool.pl -a
+call popd
+
+echo ----------------------------------------
+echo CLEANUP
+echo ----------------------------------------
+call pushd \VideoApp_Domain\videoplayer\tsrc\testing\tools
+call test_clean.cmd
+call popd
+
+echo ----------------------------------------
+echo BUILD VIDEOUTILS
+echo ----------------------------------------
+
+call pushd \VideoApp_Domain\videoutils\group
+call bldmake bldfiles
+call abld build armv5 udeb -k
+call abld build winscw udeb -k
+call popd
+
+echo ----------------------------------------
+echo BUILD VIDEO
+echo ----------------------------------------
+
+call pushd \VideoApp_Domain\videoplayer\group
+call bldmake bldfiles
+call abld build armv5 udeb -k
+call abld build winscw udeb -k
+call popd
+
+echo ----------------------------------------
+echo BUILD VIDEOUTILS/TSRC
+echo ----------------------------------------
+
+call pushd \VideoApp_Domain\videoutils\tsrc\group
+call bldmake bldfiles
+call abld test build armv5 udeb -k
+call abld test build winscw udeb -k
+call popd
+
+echo ----------------------------------------
+echo BUILD VIDEO/TSRC
+echo ----------------------------------------
+
+call pushd \VideoApp_Domain\videoplayer\tsrc\group
+call bldmake bldfiles
+call abld test build armv5 udeb -k
+call abld test build winscw udeb -k
+call popd
+
+echo ----------------------------------------
+echo CREATE VIDEOPLAYER SIS
+echo ----------------------------------------
+call pushd \VideoApp_Domain\videoplayer\videoplayerapp\mpxvideoplayer\sis
+call \VideoApp_Domain\videoplayer\tsrc\testing\tools\setversion.pl -f VideoPlayer.pkg
+call make_videoplayer_sisx.bat
+call popd
+
+echo ----------------------------------------
+echo BUILD VIDEOPLAYER UNIT TESTS
+echo ----------------------------------------
+
+call pushd videoplayer\videoplayback\videohelix\tsrc\ut_videohelixtest\group
+call bldmake bldfiles
+call abld test build
+call popd
+
+call pushd videoplayer\videoplayback\videoplaybackcontrols\tsrc\videoplaybackcontrols_test\group
+call bldmake bldfiles
+call abld test build
+call popd
+
+call pushd videoplayer\videoplayback\videoplaybackviews\tsrc\ut_userinputhandlertest\group
+call bldmake bldfiles
+call abld test build
+call popd
+
+call pushd videoplayer\videoplayerapp\mpxvideoplayer\tsrc\ut_mpxvideoplayertest\group
+call bldmake bldfiles
+call abld test build
+call popd
+
+call popd
+
+echo ----------------------------------------
+echo REMOVE COMMENTS FROM .PKG & .INF
+echo ----------------------------------------
+call pushd \VideoApp_Domain\
+call \VideoApp_Domain\videoplayer\tsrc\testing\tools\tsrpkgtool.pl -r
+call popd
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/testing/tools/test_clean.cmd	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,76 @@
+@rem
+@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+@rem All rights reserved.
+@rem This component and the accompanying materials are made available
+@rem under the terms of "Eclipse Public License v1.0"
+@rem which accompanies this distribution, and is available
+@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+@rem
+@rem Initial Contributors:
+@rem Nokia Corporation - initial contribution.
+@rem
+@rem Contributors:
+@rem
+@rem Description:
+@rem
+@echo off
+
+echo ----------------------------------------
+echo CLEAN VIDEOUTILS
+echo ----------------------------------------
+
+pushd \VideoApp_Domain\videoutils\group
+call bldmake bldfiles
+call abld reallyclean
+popd
+
+echo ----------------------------------------
+echo CLEAN VIDEOPLAYER
+echo ----------------------------------------
+
+pushd \VideoApp_Domain\videoplayer\group
+call bldmake bldfiles
+call abld reallyclean
+popd
+
+echo ----------------------------------------
+echo CLEAN VIDEOUTILS/TSRC
+echo ----------------------------------------
+
+pushd \VideoApp_Domain\videoutils\tsrc\group
+call bldmake bldfiles
+call abld test reallyclean
+popd
+
+echo ----------------------------------------
+echo CLEAN VIDEOPLAYER/TSRC
+echo ----------------------------------------
+
+pushd \VideoApp_Domain\videoplayer\tsrc\group
+call bldmake bldfiles
+call abld test reallyclean
+popd
+
+echo ----------------------------------------
+echo CLEAN VIDEOPLAYER UNIT TESTS
+echo ----------------------------------------
+
+call pushd \VideoApp_Domain\videoplayer\videoplayback\videohelix\tsrc\ut_videohelixtest\group
+call bldmake bldfiles
+call abld test reallyclean
+call popd
+
+call pushd \VideoApp_Domain\videoplayer\videoplayback\videoplaybackcontrols\tsrc\videoplaybackcontrols_test\group
+call bldmake bldfiles
+call abld test reallyclean
+call popd
+
+call pushd \VideoApp_Domain\videoplayer\videoplayback\videoplaybackviews\tsrc\ut_userinputhandlertest\group
+call bldmake bldfiles
+call abld test reallyclean
+call popd
+
+call pushd \VideoApp_Domain\videoplayer\videoplayerapp\mpxvideoplayer\tsrc\ut_mpxvideoplayertest\group
+call bldmake bldfiles
+call abld test reallyclean
+call popd
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/testing/tools/testdoc.pl	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,5437 @@
+#
+# Copyright (c) 2006 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: 
+#
+
+#-----------------------------------------------
+# Sequence
+#-----------------------------------------------
+# Reads parameters -> [if !ok params] ShowHelp
+# ReadConfigFiles
+#	-> ParseCfg
+#	-> ReadCase
+#
+#    for all testreports:
+#       ReadTestRunInfoFromStifReport
+#           GetReportLogFileNames
+#       ParseResultsAndLogs
+#
+#    ParseResultsAndLogs
+#        WriteCaseLog
+#			LogLineTimeMatchesForCase
+#			FormatLogLine
+#        UpdateCase
+#        CheckCaseEntriesInLog
+#
+# OLD:
+#	-> ParseReportFile
+#		-> ReadReportLogs
+#		-> WriteCaseLog
+#			-> LogLineTimeMatchesForCase
+#			-> FormatLogLine
+#		-> CheckCaseEntriesInLog
+#
+# ReportNotDocumentedCases
+# SortCases
+# CalculateStats
+# WriteOfficeXml -> XmlReadyText
+# exit()
+
+#-----------------------------------------------
+# Other functions:
+#-----------------------------------------------
+# RemoveWhiteSpaces
+# SpecialChars
+# ReplaceChar
+# GetCaseField
+# GetCase (id or name)
+# GetCaseDesc (id or name)
+# PrintCases
+# JustFormatLogFile
+
+#
+#
+#
+# STIF CFG:
+#************************************************************************************
+#[IptvETDescription]
+# Testname: <insert text here>
+#
+# Purpose: <insert text here>
+#
+# Means: <insert text here>
+#
+# Required environment settings: <insert text here>
+#
+# Verification: <insert text here>
+#
+# Note: <insert text here>
+#
+# Related requirements: <reqid> <reqid> <reqid> ..
+#
+#[EndIptvETDescription]
+#------------------------------------------------------------------------------------
+#[Test]
+# do stuff here
+#[Endtest]
+
+#------------------------------------------------------------------------------------
+# Includes
+#------------------------------------------------------------------------------------
+#use strict;
+use warnings;
+use Cwd; # for cwd
+use FindBin; # for FindBin:Bin
+use File::Path; # for mkpath
+use File::Copy;
+use Date::Calc;
+
+#------------------------------------------------------------------------------------
+# Globals
+#------------------------------------------------------------------------------------
+
+my $lastCaseLogLine = 0;
+
+my $ALT_RESULTCOUNT = 10; # maximum number of runs in alternative report
+
+my @cases; #references to case arrays
+my @gCfgFiles; # list of cfg files.
+my @caseDescs; # case description and the case itself in text
+my @notDocumentedCases; #array to hold information about the cases without documentation
+
+$regexpCaseName = '[\x3C\x3E\(\)\[\]\w.,\/:_\-&\' ]+';
+
+my $caseDefaultStatus = 			"NOT RUN";
+
+#
+# Case field numerations
+#
+
+my $CASE_NAME = 					0;
+my $CASE_ID = 						1;
+my $CASE_RUN_TIMES = 				2;
+my $CASE_CRASHED = 					3;
+my $CASE_FAILED = 					4;
+my $CASE_PASSED = 					5;
+my $CASE_STATUS = 					6;
+my $CASE_PURPOSE = 					7;
+my $CASE_MEANS = 					8;
+my $CASE_REQUIRED_SETTINGS = 		9;
+my $CASE_RELATED_REQUIREMENTS = 	10;
+my $CASE_VERIFICATION = 			11;
+my $CASE_NOTE = 					12;
+my $CASE_REASON = 					13; # where crashed or what returned the error code
+my $CASE_RESULT = 					14; # error code
+my $CASE_LOG_FILE = 				15; # test case specific log file.
+my $CASE_LOG_FILE_SCRIPTER = 	    16; # test case specific log from STIF testscripter logs.
+my $CASE_CHECK_RESULT_LOG_FILE = 	17; # set if the case is in the log files, if next line is found: >>>Case start: ETxxxxx CaseName
+									# or STIF own trace: Starting testcase [ET1000 Add multiple Iaps] (usually from fasttrace or emulator log)
+my $CASE_CFG_FILE = 				18;
+my $CASE_RUN_TIME_SECONDS = 		19; # how many seconds it took to run the case
+my $CASE_REPORTLINE1 =              20;
+my $CASE_REPORTLINE2 =              21;
+my $CASE_REPORTLINE3 =              22;
+my $CASE_ENTRY_LOG_START =          23;
+
+my $TDTOOLRESULTFILE = ".\\text_file.txt";
+my $XML_OUTPUT_FILE = ".\\test_cases.xml";
+my $XML_BRIEF_OUTPUT_FILE = ".\\test_cases_brief.xml";
+my $NOT_DOCUMENTED_CASES_FILE = ".\\test_cases_notdocumented.txt";
+
+my @globalTempFiles;
+
+#
+# Tags inside the xml, will be replaced by case data when writing the xml file
+#
+
+my $CaseCountMul8 = "CASE_COUNT_MUL8";
+
+my $STYLE_ID_STATUS_TAG = "STYLE_ID_STATUS"; # must be in the xml data
+
+my $STYLE_ID_STATUS_FAILED = "s36";
+my $STYLE_ID_STATUS_PASSED = "s37";
+my $STYLE_ID_STATUS_CRASHED = "s38";
+my $STYLE_ID_STATUS_UNKNOWN = "s401";
+my $STYLE_ID_STATUS_NA = "s39";
+
+my $STYLE_ID_STATUS_FAILED_CENTERED = "s36centered";
+my $STYLE_ID_STATUS_PASSED_CENTERED = "s37centered";
+my $STYLE_ID_STATUS_CRASHED_CENTERED = "s38centered";
+my $STYLE_ID_STATUS_UNKNOWN_CENTERED = "s401centered";
+my $STYLE_ID_STATUS_NA_CENTERED = "s39centered";
+
+# these must be in the xml data to get the results inserted into xml
+my $xmlDataCaseName = "XML_DATA_CASE_NAME";
+my $xmlDataCaseRunTimes = "XML_DATA_CASE_RUN_TIMES";
+my $xmlDataCaseFailed = "XML_DATA_CASE_FAILED";
+my $xmlDataCaseCrashed = "XML_DATA_CASE_CRASHED";
+my $xmlDataCasePassed = "XML_DATA_CASE_PASSED";
+my $xmlDataCaseStatus = "XML_DATA_CASE_STATUS";
+my $xmlDataCasePurpose = "XML_DATA_CASE_PURPOSE";
+my $xmlDataCaseMeans = "XML_DATA_CASE_MEANS";
+my $xmlDataCaseRequiredSettings = "XML_DATA_CASE_REQUIRED_SETTINGS";
+my $xmlDataCaseRelatedRequirements = "XML_DATA_CASE_RELATED_REQUIREMENTS";
+my $xmlDataCaseVerification = "XML_DATA_CASE_VERIFICATION";
+my $xmlDataCaseNote = "XML_DATA_CASE_NOTE";
+my $xmlDataCaseReason = "XML_DATA_CASE_REASON";
+my $xmlDataCaseResult = "XML_DATA_CASE_RESULT";
+my $xmlDataCaseLink1 = "XML_DATA_CASE_LINK1";
+my $xmlDataCaseLink2 = "XML_DATA_CASE_LINK2";
+
+my $xmlDataSummaryCaseCount = "XML_DATA_SUMMARY_TOTAL_CASES";
+my $xmlDataSummaryPassed = "XML_DATA_SUMMARY_PASSED";
+my $xmlDataSummaryFailed = "XML_DATA_SUMMARY_FAILED";
+my $xmlDataSummaryCrashed = "XML_DATA_SUMMARY_CRASHED";
+my $xmlDataSummaryTimeout = "XML_DATA_SUMMARY_TIMEOUT";
+my $xmlDataSummaryPassRateTotal = "XML_DATA_SUMMARY_PASS_RATE_TOTAL";
+my $xmlDataSummaryPassRateRun = "XML_DATA_SUMMARY_PASS_RATE_RUN";
+my $xmlDataSummaryRunRate = "XML_DATA_SUMMARY_RUN_RATE";
+
+my $xmlDataAltDateX = "XML_DATA_ALTDATE";
+
+my $xmlDataAltResultX = "XML_DATA_ALTRESULT";
+
+my $xmlDataCfgFile = "XML_DATA_CFG_FILE";
+
+#
+# Statistics
+#
+
+my $summaryCaseCount = 0;
+my $summaryPassedCases = 0;
+my $summaryFailedCases = 0;
+my $summaryCrashedCases = 0;
+my $summaryTimeoutCases = 0;
+my $summaryPassRateTotal = 0;
+my $summaryPassRateRun = 0;
+my $summaryRunRate = 0;
+
+#
+# Xml data
+#
+
+my $xmlHeader;
+my $xmlHeaderTableColumns;
+my $xmlHeaderTableColumnsBrief;
+my $xmlFooter;
+my $xmlDataEmptyRow;
+my $xmlSummaryData;
+my $xmlData;
+my $xmlDataCaseStatusDisabled;
+my $xmlData2;
+my $xmlDataBriefHeader;
+my $xmlDataBrief;
+my $xmlCfgFileBrief;
+my $xmlHeaderTableColumnsAlt;
+my $xmlCfgFileAltHeader;
+my $xmlCfgFileAltData;
+
+InitXmlData();
+
+#------------------------------------------------------------------------------------
+# GLOBAL CODE
+#------------------------------------------------------------------------------------
+
+my $argcount = scalar(@ARGV);
+
+my $optionSortCases = 0;
+my $optionShowMessages = 0;
+my $optionHtml = 0;
+my $optionLogAllCases = 1;
+my $optionNoLogs = 0;
+my $optionNoSecurityTests = 0;
+my $optionNoLiveTvTests = 0;
+my $optionCaseIncludedInLog = 0;
+my $optionGoodIsBetter = 1;
+my $optionPrintCfgSummaries = 0;
+my $optionCaseRunTimes = 0;
+my $optionFinalDoc = 1;
+my $optionFixFilename = "";
+my $optionDebug = 0;
+my $optionCaseList = "";
+my $optionAltResults = 0;
+my $optionLogFileName = "fusion";
+
+while(scalar(@ARGV) >= 1)
+{
+	my $argument = shift(@ARGV);
+
+	if($argument eq "-h")
+	{
+		ShowHelp();
+	}
+
+	elsif($argument eq "-e")
+	{
+		$optionShowMessages = 1;
+	}
+
+	elsif($argument eq "-s")
+	{
+		$optionSortCases = 1;
+	}
+
+	elsif($argument eq "-html")
+	{
+		$optionHtml = 1;
+	}
+
+	elsif($argument eq "-logall")
+	{
+		$optionLogAllCases = 1;
+	}
+
+	elsif($argument eq "-nologs")
+	{
+		$optionNoLogs = 1;
+	}
+
+	elsif($argument eq "-nosecuritytests")
+	{
+		$optionNoSecurityTests = 1;
+	}
+
+	elsif($argument eq "-nolivetvtests")
+	{
+		$optionNoLiveTvTests = 1;
+	}
+
+	elsif($argument eq "-i")
+	{
+		$optionCaseIncludedInLog = 1;
+	}
+
+	elsif($argument eq "-file")
+	{
+		$file = shift(@ARGV);
+
+		JustFormatLogFile($file);
+		exit;
+	}
+	elsif($argument eq "-runtimes")
+	{
+		$optionCaseRunTimes = 1;
+	}
+
+	elsif($argument eq "-xxx")
+	{
+		$optionCaseIncludedInLog = 1;
+		$optionNoLiveTvTests = 1;
+		$optionNoSecurityTests = 1;
+		$optionHtml = 1;
+	}
+	elsif($argument eq "-good")
+	{
+		$optionGoodIsBetter = 1;
+	}
+	elsif($argument eq "-cfgsum")
+	{
+		$optionPrintCfgSummaries = 1;
+	}
+	elsif($argument eq "-finalize")
+	{
+		$optionFinalDoc = 1;
+	}
+	elsif($argument eq "-fix") {
+		$optionFixFilename = shift(@ARGV);
+		FixExcelLogPaths();
+        exit();
+	}
+	elsif($argument eq "-debug") {
+	    $optionShowMessages = 1;
+	    $optionDebug = 1;
+	}
+	elsif($argument eq "-caselist") {
+	    $optionCaseList = shift(@ARGV);
+	}
+	elsif($argument eq "-alt") {
+	    $optionAltResults = 1;
+	}
+	elsif( $argument eq "-logfile") {
+		$optionLogFileName = shift(@ARGV);
+	}
+	else
+	{
+	    ShowHelp();
+	}
+}
+
+UnzipAndCopyFiles();
+
+my $totalExecutionTime = 0;
+
+my $caseLogOutDir = "testcase_logs\\testcase_logs\\";
+
+my @caseList;
+
+if($optionCaseList ne "")
+{
+    ReadCaseList(\@caseList, $optionCaseList);
+}
+
+# Find cfg files.
+FindCfgFiles( ".", \@gCfgFiles );
+
+# None found from current dir, see one dir lower.
+FindCfgFiles( "..", \@gCfgFiles ) if( scalar( @gCfgFiles ) < 1 );
+
+# Parse results
+if($optionPrintCfgSummaries)
+{
+	PrintCfgSummaries();
+}
+elsif( !$optionAltResults )
+{
+    my $res = ReadTestReports();
+
+	if( $res == 0 )
+	{
+        foreach my $file ( @globalTempFiles )
+        {
+            unlink $file if( -e $file );
+        }
+		print("No reports to read.\n");
+		exit;
+	}
+
+    #ReportNotDocumentedCases($NOT_DOCUMENTED_CASES_FILE);
+
+    if($optionSortCases)
+    {
+	    @cases = sort SortCases @cases;
+    }
+
+    CalculateStats();
+
+    #WriteOfficeXml($XML_OUTPUT_FILE, 0);
+    WriteOfficeXml($XML_BRIEF_OUTPUT_FILE, 1);
+}
+else
+{
+    my @runs;
+    ReadTestReportsAlt(\@runs);
+
+    WriteOfficeXmlAlt($XML_BRIEF_OUTPUT_FILE, \@runs);
+}
+
+#print("Total run time: " . $totalExecutionTime . "\n") if( $optionCaseRunTimes );
+
+foreach my $file ( @globalTempFiles )
+{
+    unlink $file if( defined( $file ) && -e $file );
+}
+
+exit();
+
+#------------------------------------------------------------------------------------
+# UnzipAndCopyFiles
+#------------------------------------------------------------------------------------
+sub UnzipAndCopyFiles
+{
+	my @files;
+	system("rmdir ziptemp /s /q>NUL") if( -e "ziptemp" );
+	
+	# Unzip zips in current directory and one level of subdirectories. -> ATS results.
+	GetAllFiles( ".", \@files, 1 );
+	
+	foreach my $file ( @files )
+	{
+		if( $file =~ m/\.zip/i )
+		{
+			my $fileName = GetPathFileName( $file );
+			
+			mkdir ("ziptemp");
+			my $cmd = "unzip -o \"$file\" -d ziptemp\\$fileName >NUL";
+			print("Unzipping $file\n") if( $optionShowMessages );
+			system( $cmd );
+		}
+	}
+
+	undef( @files );
+	GetAllFiles( ".", \@files, -1 );
+
+	# Copy files to current dir.
+
+	my $currDir = cwd;
+	
+	foreach my $file ( @files )
+	{
+	    next if( -d $file );
+	    
+	    $file =~ s/\//\\/g;
+	    
+    	# Do nothing for files which are in current dir.
+    	my $srcDir = GetPathDir( $file );
+    	my $currpath = cwd;
+    	$currpath =~ s/\//\\/g;
+    	next if( $srcDir eq $currpath );
+	    
+	    my $filename = GetPathFileName( $file );
+	    
+	    # LOOP all testreport*.txt testscripter*.txt
+	    # if file is testreport.txt
+	    #   lastFolder = last folder from the path
+	    #     LOOP all fusion*.txt
+	    #       LOOP remove tailing text from lastFolder starting from last index of '.' until it matches with folder of fusion*.txt
+	    #          pair fusion*.txt with testreport
+	    
+	    
+		if( ( $filename =~ m/testreport/i || $filename =~ m/testscripter/i ) && $filename =~ m/\.txt/i )
+		#if( ( $filename =~ m/$optionLogFileName/i || $filename =~ m/testreport/i || $filename =~ m/testscripter/i ) && $filename =~ m/\.txt/i )
+		{
+		    my $dst = "";
+		    
+		    if( $filename =~ m/testreport/i )
+		    {
+		        # Pair testreports and logs.
+		        CopyTestReportWithLog( $file, \@files );
+		    }
+		    else
+		    {
+		        print("Copying file $file\n") if( $optionDebug );
+		        # For other files we just need unique filename and copy them.
+            	$dst = $filename;
+            	
+            	if( -e $filename )
+            	{
+                	# Separate file's name and extension.
+                	my $name = "";
+                	my $ext = "";
+                	my $pos = index($filename, ".");
+                	if( $pos != -1) 
+                	{
+                		$ext = substr( $filename, $pos );
+                		$name = substr( $filename, 0, $pos );
+                		
+                		my $count = 0;
+                		while( 1 )
+                		{
+                		    $dst = "$name" . "_" . $count . $ext;
+                		    last if( ! -e "$dst" );
+                		    $count++;
+                		    if( $count > 1000 )
+                		    {
+                		        $dst = "";
+                		        last;
+                		    }
+                		}
+                	}
+                }
+    			push @globalTempFiles, $dst;
+    			
+    			print("Dest: $dst\n") if( $optionDebug );
+    			
+    			copy( $file, $dst ) or die "Could not copy '$file' to '$dst'\n";
+		    }
+		}
+	}
+
+	system("rmdir ziptemp /s /q>NUL") if( -e "ziptemp" );
+}
+
+sub CopyTestReportWithLog
+{
+    my ( $reportFileName, $refFiles ) = @_;
+    
+    print("\nTrying to pair: $reportFileName\n") if( $optionDebug );
+    
+    my $reportPath = GetPathDir( $reportFileName );
+    
+    my $logFileName = "";
+    
+#\ResultAndLogFiles_vod\22507.23325.1.4.25129-lab.net\TestReport.txt
+#\ResultAndLogFiles_vod\22507.23325.1.4.25130-lab.net\Fusion.txt
+#                       ^^^^^^^^^^^^^^^ matching part    
+    # Find log file with about same path with the report.
+    while( 1 )
+    {    
+        # Check the log files.
+        foreach $file ( @$refFiles )
+        {
+            $file =~ s/\//\\/g;
+            my $filename = GetPathFileName( $file );
+            
+            if( $filename =~ m/$optionLogFileName/i )
+            {
+                if( index( $file, $reportPath ) == 0 )
+                {
+                    $logFileName = $file;
+                    
+                    print("PAIRED: \n") if( $optionDebug );
+                    print("reportPath: $reportPath\n") if( $optionDebug );
+                    print("report: $reportFileName\n") if( $optionDebug );
+                    print("log   : $logFileName\n") if( $optionDebug );
+                    
+                    print("Report log pair: $logFileName\n") if( $optionShowMessages && !$optionDebug );
+                    last;
+                }
+            }
+        }
+        
+        last if( $logFileName ne "" );
+        
+        # Remove all from last dot in the path.            
+        my $pos = rindex( $reportPath, "." );
+        last if( $pos == -1 );
+        $reportPath = substr( $reportPath, 0, $pos );
+        
+        # The first 4 numbers might be same with multiple reports and logs. Ignore file if match is not found before.
+        last if( rindex( $reportPath, "\\" ) == -1 );
+        my $dotstr = substr( $reportPath, rindex( $reportPath, "\\" )+1 );
+        last if( ! ( $dotstr =~ m/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/ ) );
+        print( "DOT: $dotstr\n" ) if( $optionDebug );
+    }
+
+    if( $logFileName eq "" )
+    {
+        print("Could not find log file for: $reportFileName\n") if( $optionShowMessages );
+    }
+    
+    my $dstReportFileName = "";
+    my $dstReportLogName = "";
+
+    # Find first available name for the report in current directory.
+    my $fileNum = 0;
+
+    my $filename = GetPathFileName( $reportFileName );
+    
+	# Separate file's name and extension.
+	my $name = "";
+	my $ext = "";
+
+	my $pos = index($filename, ".");
+	return if( $pos == -1);
+	
+	$ext = substr( $filename, $pos );
+	$name = substr( $filename, 0, $pos );
+	
+	# Find free filename.
+	while( 1 )
+	{
+	    $dstReportFileName = "$name" . "_" . $fileNum . $ext;
+	    last if( ! -e "$dstReportFileName" );
+	    $fileNum++;
+	    if( $fileNum > 1000 )
+	    {
+	        die("Too many files to copy.");
+	    }
+	}
+	
+	if( $logFileName ne "" )
+	{
+    	# Get new name for the log with same numbering.
+    	
+    	$filename = GetPathFileName( $logFileName );
+    	
+        $pos = index($filename, ".");
+    	return if( $pos == -1);
+    	
+    	$ext = substr( $filename, $pos );
+    	$name = substr( $filename, 0, $pos );
+    	
+    	$dstLogFileName = "$name" . "_" . $fileNum . $ext;
+    	die("Log filename already exists.") if( -e "$dstLogFileName" ); # Shouldn't happen.
+    }
+    
+	# Copy the files.
+	
+    push @globalTempFiles, $dstReportFileName;
+    push @globalTempFiles, $dstLogFileName;
+
+	print("Copying $reportFileName\n") if( $optionShowMessages );
+	print("Dest: $dstReportFileName\n") if( $optionShowMessages );
+	
+	copy( $reportFileName, $dstReportFileName ) or die "Could not copy '$reportFileName' to '$dstReportFileName'\n";	
+	
+	if( $logFileName ne "" )
+	{	
+	    print("Copying $logFileName\n") if( $optionShowMessages );
+	    print("Dest: $dstLogFileName\n") if( $optionShowMessages );
+	    copy( $logFileName, $dstLogFileName ) or die "Could not copy '$logFileName' to '$dstLogFileName'\n";	
+    }
+}
+
+#------------------------------------------------------------------------------------
+# ReadCaseList
+#
+#------------------------------------------------------------------------------------
+sub ReadCaseList
+{
+    my ($refList, $filename) = @_;
+
+	if( open(FILE_HANDLE, ".\\" . $filename) )
+	{
+		my @lines = <FILE_HANDLE>;
+		close(FILE_HANDLE);
+	    foreach $line (@lines)
+	    {
+	        my $caseId;
+
+            if($line =~ m/^case /i)
+            {
+                if($line =~ m/^case ET([0-9]+) /i)
+                {
+                    $caseId = "ET" . $1;
+                }
+                else
+                {
+                    $caseId = substr($line, 4);
+                }
+                RemoveWhiteSpaces(\$caseId);
+                push @$refList, $caseId;
+            }
+	    }
+	}
+}
+
+#------------------------------------------------------------------------------------
+# IsCaseInCaseList
+#
+#------------------------------------------------------------------------------------
+sub IsCaseInCaseList
+{
+    my ($caseNameOrId) = @_;
+
+     return 1 if(scalar(@caseList) <= 0);
+
+    my $caseIdFromName = GetCaseIdFromName($caseNameOrId);
+
+    foreach $caseId (@caseList)
+    {
+        if($caseId eq $caseNameOrId)
+        {
+            return 1;
+        }
+    }
+
+    foreach $caseId (@caseList)
+    {
+        if($caseId eq $caseIdFromName)
+        {
+            return 1;
+        }
+    }
+
+    return 0;
+}
+
+#------------------------------------------------------------------------------------
+# FixExcelLogPaths
+#
+# Changes the paths on lines:
+#<Cell ss:StyleID="s60" ss:HRef="C:\Documents and Settings\senbom\Desktop\testcase_logs\testcase_logs\ET17099_4371843802.txt"><Data>
+# To:
+#<Cell ss:StyleID="s60" ss:HRef="testcase_logs\ET17099_4371843802.txt"><Data>
+#
+# Because the absolute path does not work in Excel.
+#
+#------------------------------------------------------------------------------------
+sub FixExcelLogPaths
+{
+	if( open(FILE_HANDLE, ".\\" . $optionFixFilename) )
+	{
+		my @lines = <FILE_HANDLE>;
+		close(FILE_HANDLE);
+
+		if(!open(FILE_HANDLE, ">" . $optionFixFilename) )
+		{
+			die("Could not write to file $file\n");
+		}
+
+		foreach my $line(@lines)
+		{
+			my $pos = index($line, "\\testcase_logs\\testcase_logs\\");
+			if($pos != -1)
+			{
+				my $start = rindex($line, "\"", $pos);
+				my $remstr = substr($line, $start+1, $pos-$start + length("\\testcase_logs") );
+
+				$line = substr( $line, 0, index($line, $remstr) ) .
+						   substr( $line, index($line, $remstr) + length($remstr) );
+
+			}
+
+			print FILE_HANDLE ($line);
+
+		}
+		close(FILE_HANDLE);
+
+		print("Fixed paths in $optionFixFilename\n");
+	}
+	else
+	{
+	    die("Coult not open file $optionFixFilename\n");
+	}
+}
+
+#------------------------------------------------------------------------------------
+# CalculateStats
+#------------------------------------------------------------------------------------
+sub CalculateStats
+{
+	$summaryCaseCount = scalar( @cases );
+	$summaryPassedCases = 0;
+	$summaryFailedCases = 0;
+	$summaryCrashedCases = 0;
+	$summaryTimeoutCases = 0;
+	$summaryPassRateTotal = 0;
+	$summaryPassRateRun = 0;
+	$summaryRunRate = 0;
+
+	foreach $case(@cases)
+	{
+		if(defined(@{$case}[$CASE_STATUS]))
+		{
+			my $status = @{$case}[$CASE_STATUS];
+
+			$summaryPassedCases++ if($status eq "PASSED");
+			$summaryFailedCases++ if($status eq "FAILED");
+			$summaryCrashedCases++ if($status eq "CRASHED");
+		}
+	}
+	
+	my $runCases = $summaryPassedCases + $summaryFailedCases + $summaryCrashedCases;
+	
+	$summaryPassRateTotal = $summaryPassedCases / $summaryCaseCount * 100;
+	$summaryPassRateRun = $summaryPassedCases / $runCases * 100;
+	$summaryRunRate = $runCases / $summaryCaseCount * 100;
+}
+
+#------------------------------------------------------------------------------------
+# SortCases
+#------------------------------------------------------------------------------------
+sub SortCases()
+{
+	$aprio = 0;
+	$bprio = 0;
+
+	#print @{$a}[$CASE_STATUS] . " - " . $a . " vs " . $b . " - " . @{$b}[$CASE_STATUS] . "\n";
+
+	if(@{$a}[$CASE_STATUS] eq "CRASHED") { $aprio = 5; }
+	elsif(@{$a}[$CASE_STATUS] eq "FAILED") { $aprio = 4; }
+	elsif(@{$a}[$CASE_STATUS] eq "PASSED") { $aprio = 3; }
+
+	if(@{$b}[$CASE_STATUS] eq "CRASHED") { $bprio = 5; }
+	elsif(@{$b}[$CASE_STATUS] eq "FAILED") { $bprio = 4; }
+	elsif(@{$b}[$CASE_STATUS] eq "PASSED") { $bprio = 3; }
+
+	if($aprio == $bprio)
+	{
+		return lc(@{$a}[$CASE_NAME]) cmp lc(@{$b}[$CASE_NAME]);
+	}
+
+	return $bprio cmp $aprio;
+}
+
+
+#------------------------------------------------------------------------------------
+# ShowHelp
+#------------------------------------------------------------------------------------
+sub ShowHelp {
+
+print <<USAGE_EOF;
+testdoc.pl
+
+Create folder to VaDo root folder for STIF results and copy this script and 
+the results there. STIF CFG files are searched from . and .. from the script 
+run folder. The STIF results can be either ATS results zips or multiple 
+TestReport*.txt and fusion*.txt files as long as they have the same ending 
+in the name. Script also parses the STIF testscripter logs it finds.
+
+Options:
+-i: STIF case will be included in the start of the case log
+-s: cases will be sorted by status
+-e: Shows extra information during the tool run
+-html: Case logs are generated in html format instead of text
+-logall: Logs are created for passed cases too.
+-nologs: Logs are not processed.
+-nosecuritytests: Security tests are not included in the reports.
+-nolivetvttests: Live TV tests are not included in the reports.
+-i: Test case from the CFG is included in the log file
+-file <file>: Only formats defined log file into html
+-runtimes: Result of the case will contain the case execution time in seconds.
+-good: If case has passed once it will be marked as passed no matter how many 
+ times it has failed.
+-cfgsum: Prints summary info for cfgs: how many cases and how long the cfg did 
+ take to execute.
+-finalize
+-fix if you save the file in Excel the log paths will come absolute and don't 
+ work if moved to another directory. use this fix it.
+-caselist <file>: Only reports the cases in caselist.txt, see genrerun.pl for 
+ file format.
+-logfile <file>: Sets filter for log filenames. Default is fusion.
+-slogs: Reads STIF testscripter logs instead of custom logs.
+These files will be generated:
+	test_cases.xml
+	test_cases_brief.xml
+	test_cases_notdocumented.txt
+
+Case specific log files are generated in testcase_logs directory and result 
+file has links to them.
+
+USAGE_EOF
+
+	exit();
+
+};
+
+#------------------------------------------------------------------------------------
+# ReadReportLogs
+#
+# Parameters:
+#	$fileName
+#	$refLogLines
+#
+# Reads log file of specific TestReport.
+#
+# The function has two different behaviours:
+#
+# Filenames for test report and log must match. For example
+# if test report file is TestReport_XXX.txt then fusion_XXX.txt is read if found.
+#
+# If fileName is * then *fusion*.txt files will be read one by one and processed by function CheckCaseEntriesInLog()
+#------------------------------------------------------------------------------------
+sub ReadReportLogs
+{
+	my ($fileName, $refLogLines) = @_;
+
+	return if($optionNoLogs || $optionPrintCfgSummaries);
+
+	opendir(DIR, ".");
+	my @filelist = sort(readdir(DIR));
+	closedir(DIR);
+
+	#default mask for logs
+	my $filemask = "^$optionLogFileName\.TXT";
+
+	#create file mask for logs if testreport.txt is in format: testreport_*.txt
+	if(index($fileName, "_") != -1)
+	{
+		my $spos = index($fileName, "_");
+		my $epos = rindex($fileName, ".");
+
+		$filemask = substr($fileName, $spos, $epos - $spos);
+		#print("filemask: $filemask\n");
+
+		#$filemask = "$optionLogFileName" . $filemask . "[a-z\-0-9_]*\.txt"; # this finds $optionLogFileName_xxx*.txt
+		$filemask = "$optionLogFileName" . $filemask . "\.txt"; # this finds only $optionLogFileName_xxx.txt
+		#print("filemask: $filemask\n");
+		#die();
+	}
+
+	my $processLogsHere = 0;
+
+	if($fileName eq "*")
+	{
+		$processLogsHere = 1;
+		$filemask = $optionLogFileName . "[a-z\-0-9_]*\.txt"
+	}
+
+	my $i;
+
+	#read the files into refLogLines array
+	foreach $file(@filelist)
+	{
+		#if($file =~ m/^$optionLogFileName[a-z0-9_]+\.TXT$/i or $file =~ m/^$optionLogFileName\.TXT$/i )
+		if($file =~ m/$filemask/i )
+		{
+			print("Reading log file: " . $file . ".");
+
+			if( open(FILE_HANDLE, ".\\" . $file) )
+			{
+				my @tempArray = <FILE_HANDLE>;
+				close(FILE_HANDLE);
+
+				FormatFasttraceTraces(\@tempArray);
+
+				if($processLogsHere)
+				{
+					FindAndMarkCaseEntriesInLog(\@tempArray, \@cases);
+
+					CheckCaseEntriesInLog(\@tempArray);
+				}
+				else
+				{
+					while(scalar(@tempArray) > 0)
+					{
+						push @$refLogLines, (shift(@tempArray));
+					}
+				}
+			}
+		}
+	}
+
+	FindAndMarkCaseEntriesInLog($refLogLines, \@cases);
+}
+
+#------------------------------------------------------------------------------------
+# GetReportLogFileNames
+#
+# Parameters:
+#	$fileName
+#	$refLogFiles
+#
+# Gets log filenames for specific testreport.
+#
+# The function has two different behaviours:
+#
+# Filenames for test report and log must match. For example
+# if test report file is TestReport_XXX.txt then $optionLogFileName_XXX.txt is read if found.
+#
+# If fileName is * then *$optionLogFileName*.txt files will be read one by one and processed by function CheckCaseEntriesInLog()
+#------------------------------------------------------------------------------------
+sub GetReportLogFileNames
+{
+	my ($fileName, $refLogFiles) = @_;
+
+	return if($optionNoLogs || $optionPrintCfgSummaries);
+
+	opendir(DIR, ".");
+	my @filelist = sort(readdir(DIR));
+	closedir(DIR);
+
+	#default mask for logs
+	my $filemask = "^$optionLogFileName\.TXT";
+
+	#create file mask for logs if testreport.txt is in format: testreport_*.txt
+	if(index($fileName, "_") != -1)
+	{
+		my $spos = index($fileName, "_");
+		my $epos = rindex($fileName, ".");
+
+		$filemask = substr($fileName, $spos, $epos - $spos);
+		$filemask = "$optionLogFileName" . $filemask . "\.txt"; # this finds only $optionLogFileName_xxx.txt
+	}
+
+	if($fileName eq "*")
+	{
+		$filemask = $optionLogFileName . "[a-z0-9_]*\.txt"
+	}
+
+	foreach $file(@filelist)
+	{
+		if($file =~ m/$filemask/i )
+		{
+			push @$refLogFiles, $file;
+		}
+	}
+}
+
+#------------------------------------------------------------------------------------
+# FindAndMarkCaseEntriesInLog
+#
+# Parameters:
+#	$refLogLines
+#
+# Searches for case entries in the log and if found then marks the case in @cases array
+#------------------------------------------------------------------------------------
+sub FindAndMarkCaseEntriesInLog
+{
+	my ($refLogLines, $refCases) = @_;
+
+	my $line;
+
+	print(" - Searching case start entries from log\n") if($optionShowMessages);
+
+    my $startLineIndex = 0;
+
+	# scan the log thru and mark if there's log start entries
+	for( my $i = 0; $i < scalar(@$refLogLines); $i++ )
+	{
+	    my $line = @$refLogLines[$i];
+
+		my $caseStartInLog = 0;
+
+		my $caseId = "";
+
+		if($line =~ m/>>> Case start:/i)
+		{
+			$startLineIndex = $i;
+			$caseStartInLog = 1;
+			$caseId = substr($line, index($line, ">>> Case start:") + length(">>> Case start:"));
+			print("Found case start: $caseId\n") if($optionShowMessages);
+		}
+
+		if($caseStartInLog)
+		{
+			RemoveWhiteSpaces(\$caseId);
+
+			my $refCase = GetCase($caseId, $refCases);
+
+			if(defined($refCase))
+			{
+				@$refCase[$CASE_CHECK_RESULT_LOG_FILE] = 1;
+				@$refCase[$CASE_ENTRY_LOG_START] = $startLineIndex;
+			}
+			else
+			{
+				print("Case start in log found: $caseId\n") if($optionShowMessages);
+				print("ERROR! The start in log found but case is not found from report or cfg.\n");
+			}
+		}
+	}
+}
+
+#------------------------------------------------------------------------------------
+# FormatFasttraceTraces
+#
+# Parameters:
+#	$refLogArray
+#------------------------------------------------------------------------------------
+sub FormatFasttraceTraces
+{
+	my ($refLogArray) = @_;
+
+	my $ftDebug = 0;
+
+	# strip fasttrace logging text from the start of lines
+	#[13:58:17.234] sti: MCU_ASCII_PRINTF; channel:0xE0; msg:$optionLogFileName.TXT 09/10/2006¿1:57:08¿C$optionLogFileName::CheckIsPluginRunning
+
+	my $stripFasttrace = 0;
+	# find first occurance of Musti message, remove anything before that
+	my $i;
+
+	for($i= 0; $i<100; $i++)
+	{
+		if(defined(@$refLogArray[$i]))
+		{
+			if(@$refLogArray[$i] =~ m/MCU_ASCII_PRINTF/i)
+			{
+				$stripFasttrace = 1;
+				last;
+			}
+		}
+	}
+
+	print("fasttrace: end $i, strip: $stripFasttrace\n") if($ftDebug);
+
+	#remove the fasttrace specific lines
+	print("fasttrace: lines before: " . scalar(@$refLogArray) . "\n") if($ftDebug);
+
+	splice(@$refLogArray, 0, $i) if($stripFasttrace);
+
+	return if(!$stripFasttrace);
+
+	print("fasttrace: lines " . scalar(@$refLogArray) . "\n") if($ftDebug);
+
+	#remove the fasttrace line startings and change format of STIF messages
+
+	for($i = 0; $i<scalar(@$refLogArray); $i++)
+	{
+		#before: [14:38:40.641] sti: MCU_ASCII_PRINTF; channel:0xE0; msg:TestCase [ET1024 Sort IapList when it has no IAPs] finished with verdict[0]
+		#after:  [14:38:40.641] sti: MCU_ASCII_PRINTF; channel:0xE0; msg:$optionLogFileName.TXT 18/10/2006¿2:37:37¿TestCase [ET1024 Sort IapList when it has no IAPs] finished with verdict[0]
+		if(@$refLogArray[$i] =~ m/TestCase \[([[a-z0-9_]+) ($regexpCaseName)\] finished with verdict\[[-]?([0-9]+)/i)
+		{
+			#die(@$refLogArray[$i]);
+
+			my $startStr = substr(@$refLogArray[$i], 0, index(@$refLogArray[$i], "TestCase"));
+			my $endStr = substr(@$refLogArray[$i], index(@$refLogArray[$i], "TestCase"));
+
+			my $timeStr = FasttraceLogFindIptvTraceTime($refLogArray, $i);
+
+			@$refLogArray[$i] = $startStr . "$optionLogFileName.TXT " . $timeStr . "\t" . $endStr;
+
+			print("fasttrace: " . @$refLogArray[$i] . "\n") if($ftDebug);
+
+			#print("\n\n" . $startStr . "'\n$optionLogFileName.TXT \n" . $timeStr . "'\n" . $endStr . "'\n" );
+			#die();
+		}
+
+		#change the lines where is STIF message saying starting testcase to "$optionLogFileName.TXT <TIME> >>> Case start: <CASEID>" format, otherwise it will be not be recognized later
+		if(@$refLogArray[$i] =~ m/Starting testcase \[([[a-z0-9_]+) ($regexpCaseName)\]/i)
+		{
+			print("debug: " . @$refLogArray[$i] . "\n");
+			@$refLogArray[$i] = substr(@$refLogArray[$i], 0, index(@$refLogArray[$i], "Starting testcase"));
+
+			my $timeStr = FasttraceLogFindIptvTraceTime($refLogArray, $i);
+
+			@$refLogArray[$i] .= "$optionLogFileName.TXT $timeStr\t>>> Case start: $1" . "\r\n";
+
+			print("fasttrace: '" . @$refLogArray[$i] . "'\n") if($ftDebug);
+
+			#@$refLogArray[$i] = "[14:38:37.953] sti: MCU_ASCII_PRINTF; channel:0xE0; msg:$optionLogFileName.TXT 18/10/2006\t2:37:34\t>>> Case start: $1";
+		}
+
+		if(@$refLogArray[$i] =~ m/channel\:[0-9a-z]+; msg:$optionLogFileName.TXT [0-9]+\/[0-9]+\/[0-9]+/i)
+		{
+			@$refLogArray[$i] = substr(@$refLogArray[$i], index(@$refLogArray[$i], "msg:$optionLogFileName.TXT") + length("msg:$optionLogFileName.TXT") + 1);
+
+			#replace fasttrace tab chars
+			@$refLogArray[$i] =~ s/¿/\t/g;
+			#print(@$refLogArray[$i]);
+
+		}
+		else
+		{
+			# if there's no match then this is not a trace for $optionLogFileName
+			splice(@$refLogArray, $i, 1);
+			$i--;
+		}
+	}
+}
+
+
+#------------------------------------------------------------------------------------
+# FastTraceLogFindIptvTraceTime
+#
+# Parameters:
+#	$refLines: reference to array of the log line
+# 	$startLine: line where to start looking for
+#
+# Finds next time stamp of Iptvengine from Fasttrace log
+#------------------------------------------------------------------------------------
+sub FasttraceLogFindIptvTraceTime
+{
+	my ($refLines, $startLine) = @_;
+
+	#find next trace of iptvengine and get the time and date
+	my $timeStr = "";
+	for(my $e = $startLine+1; $e < scalar(@$refLines); $e++)
+	{
+		if(@$refLines[$e] =~m/msg:$optionLogFileName.TXT/)
+		{
+			my $line = @$refLines[$e];
+			#remove the fasttrace trace from line start, we don't want it's time
+			$line = substr($line, index($line, "msg:$optionLogFileName.TXT"));
+
+			if($line =~ m/([0-9]+\/[0-9]+\/[0-9]+)/i)
+			{
+				$timeStr .= $1 . "\t";
+			}
+
+			if($line =~ m/([0-9]+:[0-9]+:[0-9]+)/i)
+			{
+				$timeStr .= $1;
+			}
+			last if($timeStr ne "");
+		}
+	}
+
+	return $timeStr;
+}
+
+#------------------------------------------------------------------------------------
+# ReportNotDocumentedCases
+#
+# Parameters:
+#	$file
+#
+# Writes the @notDocumentedCases array into a file
+#------------------------------------------------------------------------------------
+sub ReportNotDocumentedCases
+{
+	my ($file) = @_;
+
+	if(scalar(@notDocumentedCases) > 0)
+	{
+		if(!open(FILE_HANDLE, ">" . $file) )
+		{
+			print("ERROR! Could not open file '" . $file . "'\n");
+		} else {
+			print FILE_HANDLE ( @notDocumentedCases );
+			close(FILE_HANDLE);
+			print("Report " . $NOT_DOCUMENTED_CASES_FILE . " written.\n");
+		}
+	} else
+	{
+		print("All cases are documented.");
+	}
+}
+
+#------------------------------------------------------------------------------------
+# ReadTestReports
+#
+# Reads TestReportXX.txt files from the current directory and updates the cases with the results.
+# Reads also logs for the report and creates case specific logs.
+#------------------------------------------------------------------------------------
+sub ReadTestReports
+{
+	# Read filelist of current directory
+	opendir(DIR, ".");
+	my @filelist = sort(readdir(DIR));
+	closedir(DIR);
+
+	my $readSomething = 0;
+
+    my @testScripterLogLines;
+    ReadTestScripterLogs( \@testScripterLogLines );
+    
+    # Read reports and logs in the current directory
+	foreach $file(@filelist)
+	{
+		next if( -d $file or $file eq "." or $file eq "..");
+
+        # Read results STIF testreport
+		if($file =~ m/^TestReport[a-z\-0-9_]+\.txt$/i or $file =~ m/^TestReport\.txt$/i )
+		{
+			if($optionShowMessages) { print("***************************\n"); };
+			print("Report file: " . $file . "\n");
+
+			my @logFiles;
+			my @caseResults;
+
+			ReadTestRunInfoFromStifReport( $file, \@caseResults, \@logFiles );
+			ParseResultsAndLogs( \@caseResults, \@logFiles, \@testScripterLogLines );
+
+			undef(@logFiles);
+			undef(@caseResults);
+
+			$readSomething++;
+		}
+	}
+
+	return if($optionPrintCfgSummaries);
+
+	# No testreports found. Read all logs and parse them.
+	if($readSomething == 0)
+	{
+		print("\nNo test reports found in the current directory. Trying to read all the logs.\n");
+
+		my @logFileLines;
+
+		ReadReportLogs("*", \@logFileLines);
+		
+		if( scalar( @logFileLines ) > 0 )
+		{
+			$readSomething = 1;
+		}
+
+		undef(@logFileLines);
+	}
+
+	return $readSomething;
+}
+
+#------------------------------------------------------------------------------------
+# ReadTestReportsAlt
+#
+# Every test report is one run and those should have as much same cases as possible.
+#------------------------------------------------------------------------------------
+sub ReadTestReportsAlt
+{
+    my ($refRuns) = @_;
+
+	# Read filelist of current directory
+	opendir(DIR, ".");
+	my @filelist = sort(readdir(DIR));
+	closedir(DIR);
+
+    my @runs;
+
+    # Read reports and logs in the current directory
+	foreach $file(@filelist)
+	{
+		if($file eq "." or $file eq "..") {next};
+
+        # Read results STIF testreport
+		if($file =~ m/^TestReport[a-z0-9_]+\.txt$/i or $file =~ m/^TestReport\.txt$/i )
+		{
+			if($optionShowMessages) { print("***************************\n"); };
+			print("Report file: " . $file . "\n");
+
+            # Store report filename, run date and then cases into array
+
+        	# Read date from report
+        	if( !open(FILE_HANDLE, $file) ) {
+        		print("ERROR! Could not open file '" . $file . "'\n");
+        		return;
+        	}
+        	my @array = <FILE_HANDLE>;
+        	close(FILE_HANDLE);
+
+        	#Monday 25th August 2008
+        	my @pieces = split(' ', $array[1]);
+
+            $pieces[1] =~ s/st//;
+            $pieces[1] =~ s/nd//;
+            $pieces[1] =~ s/rd//;
+            $pieces[1] =~ s/th//;
+
+            undef(@array);
+
+            my @runInfo;
+			$runInfo[0] = $file;
+			$runInfo[1] = substr( $pieces[0], 0, 3 ) . " " . $pieces[1] . " " . substr( $pieces[2], 0, 3 );
+
+			my @runResults;
+			my @logFiles;
+			ReadTestRunInfoFromStifReport($file, \@runResults, \@logFiles );
+            $runInfo[2] = \@runResults;
+
+	        push @$refRuns, \@runInfo;
+		}
+	}
+}
+
+#------------------------------------------------------------------------------------
+# ReadTestScripterLogs
+#------------------------------------------------------------------------------------
+sub ReadTestScripterLogs
+{
+    my ( $refLogLines ) = @_;
+    
+    return if($optionNoLogs || $optionPrintCfgSummaries);
+    
+	opendir(DIR, ".");
+	my @filelist = sort(readdir(DIR));
+	closedir(DIR);
+	
+	foreach $file(@filelist)
+	{
+		if($file =~ m/^testscripter[a-z0-9_]+.txt/i )
+		{
+		    print("Reading scripter log: $file\n") if( $optionDebug );
+		    if( open(FILE_HANDLE, $file) )
+    		{
+    			my @tempArray = <FILE_HANDLE>;
+    			close(FILE_HANDLE);
+    
+    			while(scalar(@tempArray) > 0)
+    			{
+    				push @$refLogLines, ( shift( @tempArray ) );
+    			}
+    			undef(@tempArray);
+    		}
+    		else
+    		{
+    		    print("ERROR: Could not open the log file: $file!\n");
+    		}			
+		}
+		else
+		{
+		    print("Not a scripter log: $file\n") if( $optionDebug );
+		}
+	}
+}
+
+
+#------------------------------------------------------------------------------------
+# ReadTestReportDates
+#
+# Reads the date from each testreport in current directory
+#------------------------------------------------------------------------------------
+sub ReadTestReportDates
+{
+    my ($refDates) = @_;
+
+	# Read filelist of current directory
+	opendir(DIR, ".");
+	my @filelist = sort(readdir(DIR));
+	closedir(DIR);
+
+    my @runs;
+
+    # Read reports and logs in the current directory
+	foreach $file(@filelist)
+	{
+		if($file eq "." or $file eq "..") {next};
+
+        # Read results STIF testreport
+		if($file =~ m/^TestReport[a-z0-9_]+\.txt$/i or $file =~ m/^TestReport\.txt$/i )
+		{
+			my @fileDate;
+			$fileDate[0] = $file;
+
+        	if( !open(FILE_HANDLE, $file) ) {
+        		print("ERROR! Could not open file '" . $file . "'\n");
+        		return;
+        	}
+        	my @array = <FILE_HANDLE>;
+        	close(FILE_HANDLE);
+
+        	#Monday 25th August 2008
+        	my @pieces = split(' ', $array[1]);
+
+            $pieces[1] =~ s/st//;
+            $pieces[1] =~ s/nd//;
+            $pieces[1] =~ s/rd//;
+            $pieces[1] =~ s/th//;
+
+        	$fileDate[1] = substr( $pieces[0], 0, 3 ) . " " . $pieces[1] . " " . substr( $pieces[2], 0, 3 );
+
+            undef(@array);
+
+	        push @$refDates, \@fileDate;
+		}
+	}
+}
+
+#------------------------------------------------------------------------------------
+# ParseTimeFromLine
+#
+#------------------------------------------------------------------------------------
+sub ParseTimeFromLine
+{
+    my ($line) = @_;
+
+    my $timestr = "";
+
+    if($line =~ m/([0-9]+)(:[0-9]+:[0-9]+\,[0-9]*)/i || $line =~ m/([0-9]+)(:[0-9]+:[0-9]+\.[0-9]*)/i)
+    {
+        $timestr = "" . $1 . $2;
+        if($1 > 12)
+        {
+            $timestr = "" . ($1-12) . $2;
+        }
+    }
+
+    return $timestr;
+}
+
+#------------------------------------------------------------------------------------
+# ReadTestRunInfoFromStifReport
+#
+# Parameters:
+#	$file, the testreport
+#   $refCaseResults, results for all cases of the testreport
+#   $refLogFiles, filenames for the log files of the testreport
+#------------------------------------------------------------------------------------
+sub ReadTestRunInfoFromStifReport
+{
+	my ($file, $refCaseResults, $refLogFiles) = @_;
+
+	if( !open(FILE_HANDLE, $file) ) {
+		print("ERROR! Could not open file '" . $file . "'\n");
+		return;
+	}
+	my @array = <FILE_HANDLE>;
+	close(FILE_HANDLE);
+
+    # Get log files for the report
+    GetReportLogFileNames($file, $refLogFiles);
+
+	my $index = 0;
+	my $line = "";
+
+	for(my $i = 0; $i < scalar(@array); $i++)
+	{
+		$line = $array[$i];
+		RemoveWhiteSpaces(\$line);
+
+#[testscripter_iptvservicetest][C:\TestFramework\IptvServiceTest.cfg][10] Title:[ET9009 Set id]
+#[testscripter][c:\testframework\iptvvoddlapitest2.cfg][2] Title:[ET12100 Purchase]
+#	StartTime: 8:54:23.5565 PM, EndTime: 8:54:24.3471 PM
+#	Result: 0 [] ==> PASSED
+#	Info: xxx
+
+		# found a start of a result
+		#[1] Title:[ET1000 Add multiple Iaps]
+		my $cfgFile = "";
+
+		if($line =~ m/([a-z_0-9.]+)\]\[[0-9]+\][ ]+Title:\[/i)
+		{
+			$cfgFile = $1;
+			if($optionShowMessages) { print(" - Cfg: $cfgFile\n"); };
+			
+			for( my $e = 0; $e < scalar( @gCfgFiles ); $e++ )
+			{
+			    if( $gCfgFiles[$e] =~ m/$cfgFile/i )
+			    {
+			        my $caseCount = ParseCfg( $gCfgFiles[$e] );
+			        $gCfgFiles[$e] = ""; # We don't want to read it again.
+			    }
+			}
+		}
+
+		if($line =~ m/\[[0-9]+\][ ]+Title:\[($regexpCaseName)\]$/i)
+		{
+			if($optionShowMessages) { print(" - Case: " . $1 . "\n"); };
+
+			#get the case name
+			my $caseName = $1;
+			my $caseId = GetCaseIdFromName($caseName);
+			my $caseRunTime = CountCaseRunTime($array[$i+1]);
+
+            # Save case report lines for later use
+            my $caseLine1 = $array[$i];
+            my $caseLine2 = $array[$i+1];
+            my $caseLine3 = $array[$i+2];
+
+			# Read the case result
+
+			#	StartTime: 3:54:10.1670 PM, EndTime: 3:54:23.8226 PM
+			$line = $array[$i+2];
+			RemoveWhiteSpaces(\$line);
+
+			my $info = "";
+			my $result = "N/A";
+			my $status = "$caseDefaultStatus";
+			my $reason = "";
+
+			# Result: 0 [] ==> PASSED / something
+			if($line =~ m/^Result:[ ]([-]*[0-9]+)[ ]\[[\w]*\][ ]==>[ ]([\w ]+)$/i)
+			{
+				$result = $1;
+				$status = $2;
+			}
+            # Result: -2 [CTestRunner::RunError [CTestRunner::ExecuteCommandL returned error]] ==> FAILED
+			# Result: -2 [CTestRunner::ExecuteCommandL returned error] ==> FAILED
+			elsif($line =~ m/^Result:[ ]([-]*[0-9]+)[ ]\[([\w: ]+)\][ ]==>[ ]([\w]+)$/i or
+			      $line =~ m/^Result:[ ]([-]*[0-9]+)[ ]\[[\w: ]+\[([\w: ]+)\]\][ ]==>[ ]([\w]+)$/i )
+			{
+				$result = $1;
+				$status = $3;
+				$reason = $2;
+			}
+
+			#CaseExecutionResult: Test case execution fails with -15
+			elsif($line =~ m/^CaseExecutionResult:[ ]Test case execution fails with ([-]*[0-9]+)$/i)
+			{
+				$result = $1;
+				$status = "FAILED";
+				$reason = "Test case execution failed.";
+			}
+
+			# CaseExecutionResult: Leave during case: with -4
+			elsif($line =~ m/^CaseExecutionResult:[ ]Leave during case: with ([-]*[0-9]+)$/i)
+			{
+				$result = $1;
+				$status = "FAILED";
+				$reason = "Leave during case";
+			}
+			#CaseExecutionResult: Crash reason:Error in test ca with 69
+			#CaseExecutionResult: Crash reason:IptvEngineServer with 13
+			elsif($line =~ m/^CaseExecutionResult:[ ]Crash reason:([\w_ \-]+)[ ]with[ ]([-]*[0-9]+)$/i)
+			{
+				$result = $2;
+				$status = "CRASHED";
+				$reason = $1;
+			}
+
+			# Result: -2 [Crash reason:KERN-EXEC] ==> FAILED
+			elsif($line =~ m/^Result:[ ]([-]*[0-9]+)[ ]\[Crash reason:([\w\-:\. ]+)\] ==> ([\w]+)/i)
+			{
+				$result = $1;
+				$status = "CRASHED";
+				$reason = $2;
+			}
+
+			# CaseExecutionResult: TestModule loading fails, cannot connect to the TestModule with -2
+			elsif($line =~ m/^CaseExecutionResult: TestModule loading fails, cannot connect to the TestModule with ([-]*[0-9]+)/i)
+			{
+				$result = $1;
+				$status = "FAILED";
+				$reason = "Test module loading failed.";
+			}
+			else
+			{
+				print("Error while parsing case result line: " . $line . "\n");
+			}
+
+			$line = $array[$i+3];
+			RemoveWhiteSpaces(\$line);
+
+			#	Info: xxx
+			if($line =~ m/^Info:/i)
+			{
+				$info = substr($line, 5) . " / ";
+				RemoveWhiteSpaces(\$info);
+				$info .= " ";
+			}
+
+            my @caseResult;
+
+            $caseResult[$CASE_CFG_FILE] = $cfgFile;
+            $caseResult[$CASE_NAME] = $caseName;
+            $caseResult[$CASE_ID] = $caseId;
+            $caseResult[$CASE_RUN_TIME_SECONDS] = $caseRunTime;
+        	$caseResult[$CASE_NOTE] = $info;
+        	$caseResult[$CASE_RESULT] = $result;
+        	$caseResult[$CASE_STATUS] = $status;
+        	$caseResult[$CASE_REASON] = $reason;
+        	$caseResult[$CASE_REPORTLINE1] = $caseLine1;
+        	$caseResult[$CASE_REPORTLINE2] = $caseLine2;
+        	$caseResult[$CASE_REPORTLINE3] = $caseLine3;
+
+            push @$refCaseResults, \@caseResult;
+		}
+	}
+}
+
+#------------------------------------------------------------------------------------
+# ParseResultsAndLogs
+#
+# Parameters:
+#   $refCaseResults
+#	$refLogFiles
+#   $refTestScripterLogLines
+#------------------------------------------------------------------------------------
+sub ParseResultsAndLogs
+{
+	my ($refCaseResults, $refLogFiles, $refTestScripterLogLines) = @_;
+
+    my @logLines;
+
+    # Read log files
+	foreach $file (@$refLogFiles)
+	{
+        $file =~ s/\//\\/g;
+
+    	print("Reading log file: " . $file . " .. ");
+
+		if( open(FILE_HANDLE, $file) )
+		{
+			my @tempArray = <FILE_HANDLE>;
+			close(FILE_HANDLE);
+
+			FormatFasttraceTraces(\@tempArray);
+			print " .. ";
+
+			while(scalar(@tempArray) > 0)
+			{
+				push @logLines, (shift(@tempArray));
+			}
+			print " done.\n";
+
+			undef(@tempArray);
+		}
+		else
+		{
+		    print("ERROR: Could not open the log file: $file!\n");
+		}
+	}
+	
+	FindAndMarkCaseEntriesInLog( \@logLines, $refCaseResults );
+
+    my @caseSpecificLogs;
+
+    foreach $refCaseResult (@$refCaseResults)
+    {
+        my $cfgFile = @$refCaseResult[$CASE_CFG_FILE];
+        my $caseName = @$refCaseResult[$CASE_NAME];
+        my $caseId = @$refCaseResult[$CASE_ID];
+        my $caseRunTime = @$refCaseResult[$CASE_RUN_TIME_SECONDS];
+    	my $info = @$refCaseResult[$CASE_NOTE];
+    	my $result = @$refCaseResult[$CASE_RESULT];
+    	my $status = @$refCaseResult[$CASE_STATUS];
+    	my $reason = @$refCaseResult[$CASE_REASON];
+    	my $reportLine1 = @$refCaseResult[$CASE_REPORTLINE1];
+    	my $reportLine2 = @$refCaseResult[$CASE_REPORTLINE2];
+    	my $reportLine3 = @$refCaseResult[$CASE_REPORTLINE3];
+
+        if($optionShowMessages) { print(" - Case: " . $caseName . "\n"); };
+
+		# Create case specific log into the log directory
+		my $caseLogFile = GetCaseField($caseId, $CASE_LOG_FILE);
+		my $caseScripterLogFile = GetCaseField($caseId, $CASE_LOG_FILE_SCRIPTER);
+        my $refCaseDesc = GetCaseDesc($caseId);
+
+        $caseLogFile = GetFileNameForCaseLog(  $reportLine1, $reportLine2, $reportLine3 );
+        $caseScripterLogFile = GetFileNameForCaseLog(  $reportLine1, $reportLine2, $reportLine3, "_scripter" );
+
+        if( -e $caseLogFile )
+        {
+            unlink ( $caseLogFile );
+        }
+
+        if( -e $caseScripterLogFile )
+        {
+            unlink ( $caseScripterLogFile );
+        }
+
+        my @logInfo;
+        $logInfo[0] = $caseLogFile;
+        if( defined( @$refCaseResult[$CASE_CHECK_RESULT_LOG_FILE] ) )
+        {
+            # Case start entry trace was found from log.
+            $logInfo[1] = @$refCaseResult[$CASE_ENTRY_LOG_START];
+        }
+        else
+        {
+            $logInfo[1] = -1;
+        }
+        $logInfo[2] = $reportLine1;
+        $logInfo[3] = $reportLine2;
+        $logInfo[4] = $reportLine3;
+        $logInfo[5] = $refCaseDesc;
+        $logInfo[6] = $caseScripterLogFile;
+        push @caseSpecificLogs, \@logInfo;
+
+		# Update case
+		my $refCase = GetCase($caseId, \@cases);
+		if(!defined($refCase))
+		{
+			$refCase = GetCaseByNameOnly($caseName);
+		}
+
+		if(defined($refCase))
+		{
+			UpdateCase($refCase, $caseLogFile, $caseScripterLogFile, $result, $status, $info, $reason, $caseRunTime);
+		}
+		else
+		{
+		    # Case doesn't exist yet, add it.		    
+			my @case;
+			$case[$CASE_NAME] = $caseName;
+			$case[$CASE_ID] = $caseId;
+			$case[$CASE_RUN_TIMES] = 0;
+			$case[$CASE_CRASHED] = 0;
+			$case[$CASE_FAILED] = 0;
+			$case[$CASE_PASSED] = 0;
+			$case[$CASE_STATUS] = "$caseDefaultStatus";
+			$case[$CASE_PURPOSE] = "N/A";
+			$case[$CASE_MEANS] = "N/A";
+			$case[$CASE_REQUIRED_SETTINGS] = "N/A";
+			$case[$CASE_RELATED_REQUIREMENTS] = "N/A";
+			$case[$CASE_VERIFICATION] = "N/A";
+			$case[$CASE_NOTE] = "N/A";
+			$case[$CASE_REASON] = "";
+			$case[$CASE_RESULT] = "";
+			$case[$CASE_LOG_FILE] = "";
+			$case[$CASE_LOG_FILE_SCRIPTER] = "";
+			$case[$CASE_CHECK_RESULT_LOG_FILE] = 0;
+			$case[$CASE_CFG_FILE] = $cfgFile;
+			$case[$CASE_RUN_TIME_SECONDS] = 0;
+
+			$refCase = GetCaseByNameOnly($caseName);
+
+			UpdateCase(\@case, $caseLogFile, $caseScripterLogFile, $result, $status, $info, $reason, $caseRunTime);
+
+            # Insert case after other cases from same CFG, if any.
+
+            my $indexToInsert = -1;
+            
+            for( my $i = 0; $i < scalar(@cases); $i++ )
+        	{
+        		my $case = $cases[$i];
+        		
+        		if( defined(@$case[$CASE_CFG_FILE]) )
+		        {
+		            if( @$case[$CASE_CFG_FILE] eq $cfgFile )
+		            {
+		                $indexToInsert = $i;
+		            }
+		        }
+		    }
+		    
+		    if( $indexToInsert == -1 )
+		    {
+		        push @cases, [ @case ];
+		    }
+		    else
+		    {
+		        splice @cases, $indexToInsert+1, 0, [ @case ];
+		    }
+		}
+    }
+
+    my $caseCount = scalar( @$refCaseResults );
+
+    my @testScripterLogCaseLocations;
+    PrepareTestScripterLogs( $refTestScripterLogLines, \@testScripterLogCaseLocations );
+    WriteCaseSpecificScripterLogs( \@caseSpecificLogs, $refTestScripterLogLines, \@testScripterLogCaseLocations );
+    WriteCaseSpecificLogs( \@caseSpecificLogs, $caseCount, \@logLines );    
+
+	if($caseCount >= 10 && $optionShowMessages == 0)
+	{
+	     print("\n"); #line break for the progress bar
+	}
+	elsif($optionShowMessages == 0)
+	{
+	    print("##########\n"); # fake it
+	}
+
+	undef(@logLines);
+}
+
+#------------------------------------------------------------------------------------
+# WriteCaseSpecificLogs
+#
+# Parameters:
+#   $refCaseSpecificLogs 
+#	$caseCount
+#   $refLogLines
+#------------------------------------------------------------------------------------
+sub WriteCaseSpecificLogs
+{
+    my ($refCaseSpecificLogs, $caseCount, $refLogLines ) = @_;
+
+    my $caseLogProgress = 0;
+
+    foreach my $refLogInfo ( @$refCaseSpecificLogs )
+    {
+        #@logInfo[1] = @$refCaseResult[$CASE_ENTRY_LOG_START];
+
+        my $caseLogFile = @$refLogInfo[0];
+        my $reportLine1 = @$refLogInfo[2];
+        my $reportLine2 = @$refLogInfo[3];
+        my $reportLine3 = @$refLogInfo[4];
+        my $refCaseDesc = @$refLogInfo[5];
+
+        my $logWritten = 0;
+        if( @$refLogInfo[1] != -1 )
+        {
+            # Case start entry trace found from log files.
+            $logWritten = WriteCaseLogFromEntry($caseLogFile, $refLogLines, @$refLogInfo[1], $reportLine1, $reportLine2, $reportLine3);
+        }
+
+        if( !$logWritten )
+        {
+		    # Use case start and end times to write case specific log.
+		    WriteCaseLog($caseLogFile, $refLogLines, $refCaseDesc, $reportLine1, $reportLine2, $reportLine3);
+		}
+
+		# Show simple progress bar
+		if($caseCount >= 10 && $optionShowMessages == 0)
+		{
+			$caseLogProgress++;
+			if($caseLogProgress > $caseCount/10)
+			{
+				$caseLogProgress = 0;
+				print("#");
+			}
+		}
+    }
+
+	if($caseCount >= 10 && $optionShowMessages == 0)
+	{
+	     print("\n"); #line break for the progress bar
+	}
+	elsif($optionShowMessages == 0)
+	{
+	    print("##########\n"); # fake it
+	}   
+}
+
+#------------------------------------------------------------------------------------
+# PrepareTestScripterLogs
+#
+# Parameters:
+#	$refTestScripterLogLines
+#   $refTestScripterLogCaseLocations
+#------------------------------------------------------------------------------------
+sub PrepareTestScripterLogs
+{
+    my ($refTestScripterLogLines, $refTestScripterLogCaseLocations ) = @_;
+
+    for( my $i = 0; $i < scalar(@$refTestScripterLogLines); $i++ )
+    {
+        my $line = @$refTestScripterLogLines[$i];
+        
+        if( $line =~ m/RunTest:/ )
+        {
+            push @$refTestScripterLogCaseLocations, ( $i );
+        }
+    }
+}
+
+#------------------------------------------------------------------------------------
+# WriteCaseSpecificScripterLogs
+#
+# Parameters:
+#	$refLogFiles
+#   $refCaseResults
+#   $refTestScripterLogCaseLocations
+#------------------------------------------------------------------------------------
+sub WriteCaseSpecificScripterLogs
+{
+    my ($refCaseSpecificLogs, $refScripterLogLines, $refTestScripterLogCaseLocations ) = @_;
+
+    foreach my $refLogInfo ( @$refCaseSpecificLogs )
+    {        
+        my $caseLogFile = @$refLogInfo[6];
+        my $reportLine1 = @$refLogInfo[2];
+        my $reportLine2 = @$refLogInfo[3];
+        my $reportLine3 = @$refLogInfo[4];
+        my $refCaseDesc = @$refLogInfo[5];
+
+        WriteCaseLogFromTestScripterLogs( $caseLogFile, $refScripterLogLines, $refTestScripterLogCaseLocations, $refCaseDesc, $reportLine1, $reportLine2, $reportLine3);
+    }
+}
+
+#------------------------------------------------------------------------------------
+# WriteCaseLogFromTestScripterLogs
+#
+#------------------------------------------------------------------------------------
+sub WriteCaseLogFromTestScripterLogs
+{ 
+    my ( $caseLogFile, $refLogLines, $refTestScripterLogCaseLocations, $refCaseDesc, $line1, $line2, $line3 ) = @_;
+
+    print("### WriteCaseLogFromTestScripterLogs") if( $optionDebug );
+
+	# Don't generate log files if we only print summary
+	if($optionPrintCfgSummaries)
+	{
+		return;
+	}
+
+	RemoveWhiteSpaces(\$line1);
+	RemoveWhiteSpaces(\$line2);
+	RemoveWhiteSpaces(\$line3);
+
+	my $lineBreak = "\n";
+	$lineBreak = "<br>\n" if($optionHtml);
+
+	my $caseName = "";
+
+	if($line1 =~ m/\[[0-9]+\][ ]+Title:\[([a-z0-9]+$regexpCaseName)\]$/i)
+	{
+		#"' ultraedit
+		$caseName = $1;
+		print(" Writing scripter log for: $caseName.\n") if($optionShowMessages);
+	}
+	else
+	{
+	    return;
+	}
+
+	# Write header for case
+
+	my @writeArray;
+
+	# split the first line
+	push @writeArray, ( "<hr>" ) if($optionHtml);
+	push @writeArray, ( substr($line1, 0, index($line1, "Title:")) . $lineBreak );
+	push @writeArray, ( substr($line1, index($line1, "Title:")) . $lineBreak );
+	my $title = substr($line1, index($line1, "Title:"));
+
+	#($line1 . "\n");
+	push @writeArray, ($line2 . $lineBreak);
+	push @writeArray, ($line3 . $lineBreak);
+	push @writeArray, ("\n");
+	push @writeArray, ( "<hr>" ) if($optionHtml);
+
+	# Include the script for the case in the file?
+
+	if($optionCaseIncludedInLog)
+	{
+		foreach $linexxx (@{$refCaseDesc})
+		{
+			push @writeArray, ("$linexxx");
+			push @writeArray, ($lineBreak) if($optionHtml);
+		}
+		push @writeArray, ( "<hr>" ) if($optionHtml);
+		push @writeArray, ("\n");
+	}
+	
+	# Create log directory
+
+	if ( !(-e "testcase_logs") )
+	{
+  		mkdir("testcase_logs");
+	}
+
+	if ( !(-e "$caseLogOutDir") )
+	{
+		mkdir($caseLogOutDir, 0755);
+	}
+
+    # Find start and end lines for the case.
+    my $startLine = -1;
+    my $endLine = -1;
+
+    my $caseNameRegexp = $caseName;
+    $caseNameRegexp =~s/\)/\\\)/;
+    $caseNameRegexp =~s/\(/\\\(/;
+
+    # Try to find case start from cached locations.
+    foreach my $lineNum ( @$refTestScripterLogCaseLocations )
+    {
+        if( @$refLogLines[$lineNum] =~ m/RunTest: $caseNameRegexp/ )
+        {
+            print("  - found cached start: $lineNum") if( $optionDebug );
+            $startLine = $lineNum;
+            last;
+        }
+    }    
+
+    for( my $i = $startLine; $i < scalar(@$refLogLines); $i++ )
+    {
+        $i++ if( $i < 0 );
+        
+        my $line = @$refLogLines[$i];
+
+        next if( !defined $line );
+        
+        # Case start was not found from cached locations, find it as we go thru the lines.
+        if( $startLine == -1 )
+        {   
+            if( $line =~ m/RunTest: $caseNameRegexp/ )
+            {
+                print("  - found start: $line") if( $optionDebug );
+                $startLine = $i;
+            }
+        }
+        else
+        {
+            if( $line =~ m/\*\*\*Testcase [a-z]+\*\*\*/i )
+            {
+                print("  - found end: $line") if( $optionDebug );
+                $endLine = $i + 1;
+                last;
+            }
+        }
+    }
+
+    if( $startLine == -1 || $endLine == -1 )
+    {
+        return;
+    }
+
+	# Write the log file
+
+	my $fileMode = ">>";
+
+	print(" - Case log file: " . $caseLogFile ."\n") if($optionShowMessages);
+
+	if(	open(FILE_HANDLE, $fileMode . $caseLogFile) )
+	{
+		if($optionHtml)
+		{
+			print FILE_HANDLE (
+			"<html>\n" .
+			"<head>\n" .
+			"<title>$title</title>\n" .
+			"</head>\n" .
+			"<body>\n" .
+			"<basefont color=\"black\" face=\"arial\" size=\"4\">\n"
+			);
+		}
+
+		foreach $line(@writeArray)
+		{
+			print FILE_HANDLE ($line);
+		}
+
+		for( my $i = $startLine; $i < $endLine; $i++ )
+		{
+			my $line = @$refLogLines[$i];
+			FormatLogLine(\$line) if($optionHtml);
+
+			print FILE_HANDLE ($line);
+		}
+
+		if($optionHtml)
+		{
+		print FILE_HANDLE (
+			"</body>\n" .
+			"</html>"
+			);
+		}
+
+        print FILE_HANDLE ( $lineBreak );
+		print FILE_HANDLE ( $lineBreak );
+
+		close FILE_HANDLE;
+
+	} else
+	{
+		print("ERROR: Could not write to file: " . $caseLogFile . "\n");
+	}
+}
+
+#------------------------------------------------------------------------------------
+# CheckCaseEntriesInLog
+#
+# Parameters:
+#	$refLogLines: reference to array of log lines
+#
+# Finds if there's log entries for cases that are not reported in the testreport files
+# and create case specific logs for them
+#------------------------------------------------------------------------------------
+sub CheckCaseEntriesInLog
+{
+	my ($refLogLines) = @_;
+
+	foreach $case(@cases)
+	{
+		if(@{$case}[$CASE_CHECK_RESULT_LOG_FILE] == 1)
+		{
+			@{$case}[$CASE_CHECK_RESULT_LOG_FILE] = 0;
+
+#create the next lines for WriteCaseLog function
+
+#line1: [testscripter_iptvservicemanagementapitestasync][c:\TestFramework\IptvServiceManagementApiTestAsync.cfg][2] Title:[ET08203 Add valid hardcoded service_0 ASYNC]
+#line2:	StartTime: 3:06:14.2212 PM, EndTime: 3:06:18.1037 PM
+#line3:	Result: 0 [] ==> PASSED
+
+			#starttime = case startline
+			#endttime = next case starttline | lastline
+
+			my $line1 = "[unknown.cfg][0] Title:[" . @{$case}[$CASE_NAME] . "]";
+			my $line2 = "";
+			my $line3 = "Result: 0 [] ==> UNKNOWN";
+
+			my $startTime = "";
+			my $endTime = "";
+			my $status = "UNKNOWN";
+			my $caseLogFile = "";
+			my $result = "0";
+			my $info = "";
+			my $reason = "";
+
+			my $caseId = "";
+			foreach $line(@$refLogLines)
+			{
+				# take the times from lines where is case start text
+
+				if($startTime eq "" && $line =~ m/>>> Case start:/i)
+				{
+					$caseId = substr($line, index($line, ">>> Case start:") + length(">>> Case start:"));
+
+					RemoveWhiteSpaces(\$caseId);
+
+					# set start time if case matches
+					#02/08/2006	12:15:42	>>> Case start: ET00000 caseId
+					if($caseId eq @{$case}[$CASE_ID])
+					{
+						#print("*** Reading case name\n\n");
+						if($line =~ m/([0-9]+):([0-9]+):([0-9]+)/)
+						{
+							#print("CASESTART: $line\n");
+							$startTime = "$1:$2:$3.0000";
+							#print("*** READ TIME $startTime\n\n");
+							next; # skip the rest of loop otherwise endtime will be same
+						}
+					}
+				}
+
+				# find endtime for case if starttime is set
+				if($startTime ne "")
+				{
+					#[14:38:40.641] sti: MCU_ASCII_PRINTF; channel:0xE0; msg:TestCase [ET1024 Sort IapList when it has no IAPs] finished with verdict[0]
+
+					#die("$line") if($line =~m/$caseId/i);
+					#die("line: $line\n") if($line =~ m/finished with verdict/);
+
+					if($line =~ m/$caseId/i and $line =~ m/finished with verdict\[([-]*[0-9]+)\]/)
+					{
+
+						$result = $1;
+
+						if($1 eq "0")
+						{
+							$status = "PASSED";
+							$line3 = "Result: $1 [] ==> PASSED";
+						}
+						else
+						{
+							$status = "FAILED";
+							$line3 = "Result: $1 [] ==> FAILED";
+						}
+					}
+
+					#if line has time then grab it
+					if($line =~ m/([0-9]+):([0-9]+):([0-9]+)/)
+					{
+						$endTime = "$1:$2:$3.9999";
+						# stop searching when next case is starting
+						if( ($line =~ m/>>> Case start:/i || $line =~ m/>>> Case end./i) and !($line =~ m/$caseId/) )
+						{
+							#print("CASEEND: $line\n");
+							last;
+						}
+					}
+				}
+
+			}
+
+			$line2 = "StartTime: $startTime PM, EndTime: $endTime PM";
+
+			#print("l1: $line1\nl2: $line2\nl3: $line3\n\n");
+
+			my $refCaseDesc = GetCaseDesc($caseId);
+
+			$caseLogFile = GetFileNameForCaseLog( $line1, $line2, $line3 );
+
+			WriteCaseLog($caseLogFile, $refLogLines, $refCaseDesc, $line1, $line2, $line3);
+
+			my $refCase = GetCase($caseId, \@cases);
+
+			UpdateCase($refCase, $caseLogFile, "", $result, $status, $info, $reason, 0);
+		}
+	}
+}
+
+sub UpdateCase
+{
+	my ($refCase, $caseLogFile, $caseScripterLogFile, $result, $status, $info, $reason, $caseRunTimeSeconds) = @_;
+
+	if($optionShowMessages) { print(" - Case update: $result, $status, $reason, $caseRunTimeSeconds\n\n"); };
+
+	die("Result not defined. Cannot update.\n") if(!defined($result)  );
+	die("Status not defined. Cannot update.\n") if(!defined($status) );
+	die("Info not defined. Cannot update.\n") if( !defined($info) );
+	die("Reason not defined. Cannot update.\n") if( !defined($reason) );
+
+	$caseRunTimeSeconds = 0 if($caseRunTimeSeconds < 0);
+
+	# we have actual result, no need for this anymore
+	@$refCase[$CASE_CHECK_RESULT_LOG_FILE] = 0;
+
+	if(!$optionFinalDoc)
+	{
+		@$refCase[$CASE_RUN_TIMES]++;
+
+		@$refCase[$CASE_RUN_TIME_SECONDS] = $caseRunTimeSeconds;
+
+		if($status eq "CRASHED") {
+			@$refCase[$CASE_CRASHED]++;
+		}
+		elsif($status eq "FAILED") {
+			@$refCase[$CASE_FAILED]++;
+		}
+		elsif($status eq "PASSED") {
+			@$refCase[$CASE_PASSED]++;
+		}
+	}
+	else
+	{
+		if($status eq "PASSED") {
+			@$refCase[$CASE_PASSED] = 1;
+			@$refCase[$CASE_CRASHED] = 0;
+			@$refCase[$CASE_FAILED] = 0;
+		}
+		elsif($status eq "CRASHED" && @$refCase[$CASE_STATUS] ne "PASSED") {
+			@$refCase[$CASE_PASSED] = 0;
+			@$refCase[$CASE_CRASHED] = 1;
+			@$refCase[$CASE_FAILED] = 0;
+		}
+		elsif($status eq "FAILED" && @$refCase[$CASE_STATUS] ne "PASSED" && @$refCase[$CASE_STATUS] ne "CRASHED") {
+			@$refCase[$CASE_PASSED] = 0;
+			@$refCase[$CASE_CRASHED] = 0;
+			@$refCase[$CASE_FAILED] = 1;
+		}
+	}
+
+	my $updateCase = 0;
+
+	if(!$optionGoodIsBetter and !$optionFinalDoc)
+	{
+		# Only update case status if it's more fatal than the current, CRASHED > FAILED > UNKNOWN > PASSED
+		if($status ne "$caseDefaultStatus")
+		{
+			if (@$refCase[$CASE_STATUS] eq "$caseDefaultStatus") {
+				$updateCase = 1;
+			}
+			elsif (@$refCase[$CASE_STATUS] eq "CRASHED" ) {
+
+			}
+			elsif (@$refCase[$CASE_STATUS] eq "FAILED") {
+				$updateCase = 1 if($status eq "CRASHED");
+			}
+			elsif(@$refCase[$CASE_STATUS] eq "PASSED") {
+				$updateCase = 1;
+			}
+		}
+	}
+	else
+	{
+		# Only update case status if it's less fatal than the current, PASSED > FAILED > CRASHED > UNKNOWN
+		if($status ne "$caseDefaultStatus")
+		{
+			if (@$refCase[$CASE_STATUS] eq "$caseDefaultStatus") {
+				$updateCase = 1;
+			}
+			elsif(@$refCase[$CASE_STATUS] eq "UNKNOWN") {
+				$updateCase = 1;
+			}
+			elsif($status eq "PASSED")
+			{
+				$updateCase = 1;
+			}
+			elsif (@$refCase[$CASE_STATUS] eq "CRASHED" ) {
+				$updateCase = 1 if($status eq "FAILED");
+			}
+			elsif (@$refCase[$CASE_STATUS] eq "FAILED") {
+
+			}
+		}
+	}
+
+	if($updateCase)
+	{
+		@$refCase[$CASE_REASON] = $info . $reason;
+		@$refCase[$CASE_RESULT] = $result;
+		@$refCase[$CASE_STATUS] = $status;
+		@$refCase[$CASE_LOG_FILE] = $caseLogFile;
+		@$refCase[$CASE_LOG_FILE_SCRIPTER] = $caseScripterLogFile;
+	}
+	else
+	{
+	    # -1112 overrides other error codes because the case succeeded but verifying has failed.
+	    if(@$refCase[$CASE_RESULT] ne "-1112" and $result eq "-1112")
+	    {
+	        @$refCase[$CASE_RESULT] = $result;
+	    }
+	}
+	#print "case: " . @{$case}[$CASE_NAME] . "\n" . "run: " . @{$case}[$CASE_RUN_TIMES] . ", crash: " . @{$case}[$CASE_CRASHED] . ", fail " . @{$case}[$CASE_FAILED] . ", passed: " . 	@{$case}[$CASE_PASSED] . "\n";
+}
+
+sub CountCaseRunTime
+{
+	my ($line) = @_;
+	my $found = 0;
+	RemoveWhiteSpaces(\$line);
+	#StartTime: 16:12:10,2440, EndTime: 16:12:34,3880
+	#StartTime: 12:02:49.9302 pm, EndTime: 12:03:04.5781 pm
+	if($line =~ m/^StartTime: ([0-9]+):([0-9]+):([0-9]+)\,[0-9]*, Endtime: ([0-9]+):([0-9]+):([0-9]+)\,[0-9]*$/i)
+	{
+		$found = 1;
+	}
+	elsif($line =~ m/^StartTime: ([0-9]+):([0-9]+):([0-9]+)\.[0-9]*[ A-Z]*, Endtime: ([0-9]+):([0-9]+):([0-9]+)\.[0-9]*[ A-Z]*$/i)
+	{
+		$found = 1;
+	}
+
+    my $caseRunTime = 0;
+
+	if($found)
+	{
+		my $startSeconds = ($1 * 60 * 60) + $2 * 60 + $3;
+		my $endSeconds = ($4 * 60 * 60) + $5 * 60 + $6;
+
+		$caseRunTime = $endSeconds - $startSeconds;
+	}
+	$caseRunTime = 0 if($caseRunTime < 0);
+
+    $totalExecutionTime += $caseRunTime;
+	return $caseRunTime;
+}
+
+sub GetFileNameForCaseLog
+{
+    my ($line1, $line2, $line3, $extra) = @_;
+
+	RemoveWhiteSpaces(\$line1);
+	RemoveWhiteSpaces(\$line2);
+	RemoveWhiteSpaces(\$line3);
+
+	my $caseId = "";
+
+	if($line1 =~ m/\[[0-9]+\][ ]+Title:\[([a-z0-9]+)$regexpCaseName\]$/i)
+	{
+		#"' ultraedit
+		$caseId = $1;
+	}
+
+	my $caseTimeStr = "";
+
+	#StartTime: 16:12:10,2440, EndTime: 16:12:34,3880
+	if($line2 =~ m/^StartTime: ([0-9]+):([0-9]+):([0-9]+)\,[0-9]*, Endtime: ([0-9]+):([0-9]+):([0-9]+)\,[0-9]*$/i)
+	{
+		$found = 1;
+	}
+	elsif($line2 =~ m/^StartTime: ([0-9]+):([0-9]+):([0-9]+)\.[0-9]*[ A-Z]*, Endtime: ([0-9]+):([0-9]+):([0-9]+)\.[0-9]*[ A-Z]*$/i)
+	{
+		$found = 1;
+	}
+
+	if( $found )
+	{
+		$caseTimeStr = $1 . $2 . $3 . $4 . $5 . $6;
+	}
+
+	my $fileext = ".txt";
+	$fileext = ".html" if($optionHtml);
+
+    my $caseLogFile;
+    
+     if( !defined( $extra ) )
+     {
+        $caseLogFile = $caseLogOutDir . $caseId . "_" . $caseTimeStr . $fileext;
+    }
+    else
+    {
+        $caseLogFile = $caseLogOutDir . $caseId . "_" . $caseTimeStr . $extra . $fileext;
+    }
+
+	print(" - Case log file: " . $caseLogFile ."\n") if($optionShowMessages);
+	return $caseLogFile;
+}
+
+#------------------------------------------------------------------------------------
+# WriteCaseLog
+#
+# Parameters:
+# 	$caseLogFile: filename to write
+# 	$refLogLines: input where log lines are stored
+# 	$caseDesc: optional text description of case which will be written into the log file
+# 	$line1: [testscripter_iptvservicemanagementapitestasync][c:\TestFramework\IptvServiceManagementApiTestAsync.cfg][2] Title:[ET08203 Add valid hardcoded service_0 ASYNC]
+# 	$line2:	StartTime: 3:06:14.2212 PM, EndTime: 3:06:18.1037 PM
+# 	$line3:	Result: 0 [] ==> PASSED
+#
+# Writes case specific log file into testcase_logs/testcase_logs directory. Reads the lines from @caseLogLines array
+#------------------------------------------------------------------------------------
+sub WriteCaseLog
+{
+#[testscripter_iptvservicemanagementapitestasync][c:\TestFramework\IptvServiceManagementApiTestAsync.cfg][2] Title:[ET08203 Add valid hardcoded service_0 ASYNC]
+#	StartTime: 3:06:14.2212 PM, EndTime: 3:06:18.1037 PM
+#	StartTime: 12:34:41.5407, EndTime: 12:34:41.9687
+#	Result: 0 [] ==> PASSED
+
+	my ($caseLogFile, $refLogLines, $refCaseDesc, $line1, $line2, $line3) = @_;
+
+	# Don't generate log files if we only print summary
+	if($optionPrintCfgSummaries)
+	{
+		return;
+	}
+
+	#print("1: $line1");	print("2: $line2");	print("3: $line3");
+
+	RemoveWhiteSpaces(\$line1);
+	RemoveWhiteSpaces(\$line2);
+	RemoveWhiteSpaces(\$line3);
+
+	my $lineBreak = "\n";
+	$lineBreak = "<br>\n" if($optionHtml);
+
+	my $caseId = "";
+
+	if($line1 =~ m/\[[0-9]+\][ ]+Title:\[([a-z0-9]+)$regexpCaseName\]$/i)
+	{
+		#"' ultraedit
+		$caseId = $1;
+		print("Writing log for: $caseId.\n") if($optionShowMessages);
+	}
+
+	# Write header for case
+
+	my @writeArray;
+
+	# split the first line
+	push @writeArray, ( "<hr>" ) if($optionHtml);
+	push @writeArray, ( substr($line1, 0, index($line1, "Title:")) . $lineBreak );
+	push @writeArray, ( substr($line1, index($line1, "Title:")) . $lineBreak );
+	my $title = substr($line1, index($line1, "Title:"));
+
+	#($line1 . "\n");
+	push @writeArray, ($line2 . $lineBreak);
+	push @writeArray, ($line3 . $lineBreak);
+	push @writeArray, ("\n");
+	push @writeArray, ( "<hr>" ) if($optionHtml);
+
+	# Include the script for the case in the file?
+
+	if($optionCaseIncludedInLog)
+	{
+		foreach $linexxx (@{$refCaseDesc})
+		{
+			push @writeArray, ("$linexxx");
+			push @writeArray, ($lineBreak) if($optionHtml);
+		}
+		push @writeArray, ( "<hr>" ) if($optionHtml);
+		push @writeArray, ("\n");
+	}
+
+	my $passed = 0;
+	$passed = 1 if($line3 =~ m/==> PASSED/);
+
+	# Get the log for the case
+
+	my $startLine = 0;
+	my $endLine = 0;
+
+	my $logLineCount = scalar(@$refLogLines);
+
+	if($logLineCount > 0 && ($optionLogAllCases || !$passed) )
+	{
+		if($lastCaseLogLine >= $logLineCount)
+		{
+			$lastCaseLogLine = 0;
+		}
+
+		# Get the start and end time for the case
+
+		my $found = 0;
+		#StartTime: 16:12:10,2440, EndTime: 16:12:34,3880
+		if($line2 =~ m/^StartTime: ([0-9]+):([0-9]+):([0-9]+)\,[0-9]*, Endtime: ([0-9]+):([0-9]+):([0-9]+)\,[0-9]*$/i)
+		{
+			$found = 1;
+		}
+		elsif($line2 =~ m/^StartTime: ([0-9]+):([0-9]+):([0-9]+)\.[0-9]*[ A-Z]*, Endtime: ([0-9]+):([0-9]+):([0-9]+)\.[0-9]*[ A-Z]*$/i)
+		{
+			$found = 1;
+		}
+		else
+		{
+			print(" *ERROR* Could not parse case run time for case $caseId.  Can not write case log note. Returning.\n");
+			return;
+		}
+
+		my $startSeconds = 0;
+		my $endSeconds = 0;
+
+		if($found)
+		{
+			$startSeconds = ($1 * 60 * 60) + $2 * 60 + $3;
+			$endSeconds = ($4 * 60 * 60) + $5 * 60 + $6;
+
+			my $caseRunTime = $endSeconds - $startSeconds;
+
+			if($caseRunTime < 0)
+			{
+				# It's possible to code solution but it'd slow down the script.
+				print(" *ERROR* Case $caseId has probably passed midnight/midday. Giving up writing case specific log.\n");
+				return;
+			}
+
+			#print " - start:"  . $1 . ":" . $2 . ":" . $3 . " = " . $startSeconds . "\n";
+			#print " - end: " . $4 . ":" . $5 . ":" . $6 . " = " . $endSeconds . "\n";
+		}
+
+		# Find indexes for start and end lines
+
+		$startLine = -1;
+		# If the line at $lastCaseLogLine matches then find backwards the first matching line,
+		# otherwise some lines might be missed from the log note.
+		if(LogLineTimeMatchesForCase(\@$refLogLines[$lastCaseLogLine], $startSeconds, $startSeconds))
+		{
+			#print("find back\n");
+			for(my $i=$lastCaseLogLine; $i > 0; $i--)
+			{
+				if(!LogLineTimeMatchesForCase(\@$refLogLines[$i], $startSeconds, $startSeconds))
+				{
+					$startLine = $i+1;
+					last;
+				}
+			}
+		}
+		# Otherwise try to find match forward.
+		else
+		{
+			$startLine = FindLogLineMatch($refLogLines, $startSeconds, $endSeconds, $lastCaseLogLine, 1);
+		}
+		# If that doesn't succeed then lets go at start of the log. SLOW for huge logs.
+		if($startLine == -1)
+		{
+			$startLine = FindLogLineMatch($refLogLines, $startSeconds, $endSeconds, 0, 1);
+			$lastCaseLogLine = 0;
+		}
+		if($startLine == -1)
+		{
+			print(" *ERROR* startLine not found!\n");
+			return;
+		}
+
+		print(" - StartLine: $startLine\n") if($optionShowMessages);
+
+		# Find forward the last line which does not match.
+		$endLine = FindLogLineMatch($refLogLines, $startSeconds, $endSeconds, $startLine+1, 0);
+
+		if($endLine == -1 || $endLine < $startLine)
+		{
+		    print(" - End line not found, trying alternative method.\n") if($optionShowMessages);
+			# Find first not matching line forward from the case start.
+			$endLine = FindLogLineMatch($refLogLines, $startSeconds, $endSeconds, scalar(@$refLogLines)-1, 0);
+			if( $endLine == -1 || $endLine < $startLine )
+			{
+				# Just take the rest of the log
+				$endLine = scalar(@$refLogLines)-1;
+			}
+		}
+
+		print(" - EndLine: $endLine\n") if($optionShowMessages);
+
+		$lastCaseLogLine = $endLine-1;
+	}
+
+	# Create log directory
+
+	if ( !(-e "testcase_logs") )
+	{
+  		mkdir("testcase_logs");
+	}
+
+	if ( !(-e "$caseLogOutDir") )
+	{
+		mkdir($caseLogOutDir, 0755);
+	}
+
+	# Write the log file
+
+	my $fileMode = ">>";
+
+	print(" - Case log file: " . $caseLogFile ."\n") if($optionShowMessages);
+
+	if(	open(FILE_HANDLE, $fileMode . $caseLogFile) )
+	{
+		if($optionHtml)
+		{
+			print FILE_HANDLE (
+			"<html>\n" .
+			"<head>\n" .
+			"<title>$title</title>\n" .
+			"</head>\n" .
+			"<body>\n" .
+			"<basefont color=\"black\" face=\"arial\" size=\"4\">\n"
+			);
+		}
+
+		foreach $line(@writeArray)
+		{
+			print FILE_HANDLE ($line);
+		}
+
+		for(my $i=$startLine;$i<$endLine;$i++)
+		{
+			my $line = @$refLogLines[$i];
+			FormatLogLine(\$line) if($optionHtml);
+
+			print FILE_HANDLE ($line);
+		}
+
+		if($optionHtml)
+		{
+		print FILE_HANDLE (
+			"</body>\n" .
+			"</html>"
+			);
+		}
+
+        print FILE_HANDLE ( $lineBreak );
+		print FILE_HANDLE ( $lineBreak );
+
+		close FILE_HANDLE;
+
+	} else
+	{
+		print("ERROR: Could not write to file: " . $caseLogFile . "\n");
+	}
+}
+
+# There's case start entry in the log, write case log from there onwards.
+sub WriteCaseLogFromEntry
+{
+ 	my ($caseLogFile, $refLogLines, $caseEntryLogStartLine, $line1, $line2, $line3) = @_;
+
+	# Don't generate log files if we only print summary
+	if($optionPrintCfgSummaries)
+	{
+		return 0;
+	}
+
+	RemoveWhiteSpaces(\$line1);
+	RemoveWhiteSpaces(\$line2);
+	RemoveWhiteSpaces(\$line3);
+
+	my $lineBreak = "\n";
+	$lineBreak = "<br>\n" if($optionHtml);
+
+	my $caseId = "";
+
+	if($line1 =~ m/\[[0-9]+\][ ]+Title:\[([a-z0-9]+)$regexpCaseName\]$/i)
+	{
+		#"' ultraedit
+		$caseId = $1;
+	}
+
+	# Write header for case
+
+	my @writeArray;
+
+	# split the first line
+	push @writeArray, ( "<hr>" ) if($optionHtml);
+	push @writeArray, ( substr($line1, 0, index($line1, "Title:")) . $lineBreak );
+	push @writeArray, ( substr($line1, index($line1, "Title:")) . $lineBreak );
+	my $title = substr($line1, index($line1, "Title:"));
+
+	#($line1 . "\n");
+	push @writeArray, ($line2 . $lineBreak);
+	push @writeArray, ($line3 . $lineBreak);
+	push @writeArray, ("\n");
+	push @writeArray, ( "<hr>" ) if($optionHtml);
+
+	my $passed = 0;
+	$passed = 1 if($line3 =~ m/==> PASSED/);
+
+	# Get the log for the case
+
+	my $logLineCount = scalar(@$refLogLines);
+
+	if($logLineCount > 0 && ($optionLogAllCases || !$passed) )
+	{
+		# Get the start and end time for the case
+
+		my $found = 0;
+		#StartTime: 16:12:10,2440, EndTime: 16:12:34,3880
+		if($line2 =~ m/^StartTime: ([0-9]+):([0-9]+):([0-9]+)\,[0-9]*, Endtime: ([0-9]+):([0-9]+):([0-9]+)\,[0-9]*$/i)
+		{
+			$found = 1;
+		}
+		elsif($line2 =~ m/^StartTime: ([0-9]+):([0-9]+):([0-9]+)\.[0-9]*[ A-Z]*, Endtime: ([0-9]+):([0-9]+):([0-9]+)\.[0-9]*[ A-Z]*$/i)
+		{
+			$found = 1;
+		}
+		else
+		{
+			print(" *ERROR* Could not parse case run time for case $caseId.  Can not write case log note. Returning.\n");
+			return 0;
+		}
+
+		my $startSeconds = 0;
+		my $endSeconds = 0;
+
+		if($found)
+		{
+			$startSeconds = ($1 * 60 * 60) + $2 * 60 + $3;
+			$endSeconds = ($4 * 60 * 60) + $5 * 60 + $6;
+
+			my $caseRunTime = $endSeconds - $startSeconds;
+
+			if($caseRunTime < 0)
+			{
+				# It's possible to code solution but it'd slow down the script.
+				#print(" *ERROR* Case has probably passed midnight/midday. Giving up writing case specific log.\n");
+				#return;
+			}
+		}
+	}
+
+	# Create log directory
+
+	if ( !(-e "testcase_logs") )
+	{
+  		mkdir("testcase_logs");
+	}
+
+	if ( !(-e "$caseLogOutDir") )
+	{
+		mkdir($caseLogOutDir, 0755);
+	}
+
+	# Write the log file
+
+	my $fileMode = ">>";
+
+	print(" - Case log file: " . $caseLogFile ."\n") if($optionShowMessages);
+
+    my $caseEntryLogEndLine = -1;
+    for(my $i=$caseEntryLogStartLine; $i<scalar(@$refLogLines); $i++ )
+    {
+        if(@$refLogLines[$i] =~ m/<<< Case end/i)
+        {
+            $caseEntryLogEndLine = $i;
+            last;
+        }
+    }
+    if( $caseEntryLogEndLine == -1 )
+    {
+        print("ERROR: $caseId is missing case end command in the script?\n");
+        return 0;
+    }
+
+	if(	open(FILE_HANDLE, $fileMode . $caseLogFile) )
+	{
+		if($optionHtml)
+		{
+			print FILE_HANDLE (
+			"<html>\n" .
+			"<head>\n" .
+			"<title>$title</title>\n" .
+			"</head>\n" .
+			"<body>\n" .
+			"<basefont color=\"black\" face=\"arial\" size=\"4\">\n"
+			);
+		}
+
+		for( my $i = $caseEntryLogStartLine; $i < $caseEntryLogEndLine; $i++ )
+		{
+            my $line = @$refLogLines[$i];
+            FormatLogLine(\$line) if($optionHtml);
+            print FILE_HANDLE ($line);
+		}
+
+		if($optionHtml)
+		{
+		    print FILE_HANDLE (
+			    "</body>\n" .
+			    "</html>"
+			    );
+		}
+        print FILE_HANDLE ( $lineBreak );
+		print FILE_HANDLE ( $lineBreak );
+
+		close FILE_HANDLE;
+
+	} else
+	{
+		print("ERROR: Could not write to file: " . $caseLogFile . "\n");
+		return 0;
+	}
+	
+	return 1;
+}
+
+#------------------------------------------------------------------------------------
+# FindLogLineMatchRecurse
+#
+# Parameters:
+# 	$startsSeconds		the min time the log line will match
+# 	$endSeconds			the max time the log line will match
+# 	$refStartLine		index of line to start searching
+# 	$refLogLines		reference to array of the log
+# 	$boolOp				1 = first line with match is returned, 0 = first line with no match is returned
+# 	$inc				increment in the search loop
+#	$recurse			can the function call itself, if yes this will be passed to the new call too
+#	$maxLine			the last line to search
+#
+#------------------------------------------------------------------------------------
+sub FindLogLineMatchRecurse
+{
+	my ($startSeconds, $endSeconds, $refStartLine, $refLogLines, $boolOp, $inc, $recurse, $maxLine) = @_;
+
+    print("IN FindLogLineMatchRecurse\n") if($optionDebug);
+	my $spacer = "";
+	for(my $i = 0;$i<$recurse; $i++)
+	{
+		$spacer .= "-";
+	}
+
+	$maxLine = scalar(@$refLogLines) if(!defined($maxLine) or $maxLine > scalar(@$refLogLines));
+	print("s: $startSeconds, e: $endSeconds, sl: $$refStartLine, b: $boolOp, i: $inc, r: $recurse, ml: $maxLine\n") if($optionDebug);
+	print("$spacer ENTER: range: $$refStartLine - $maxLine, $inc\n") if($optionDebug);
+	print("$spacer rec: $recurse\n") if($optionDebug);
+	print("$spacer prev: $$refStartLine\n") if($optionDebug);
+	print("$spacer inc: $inc\n") if($optionDebug);
+
+	# First try to find the start line without recursion.
+	for(my $i = $$refStartLine; $i < $maxLine; $i += $inc)
+	{
+		if(LogLineTimeMatchesForCase(\@$refLogLines[$i], $startSeconds, $endSeconds) == $boolOp)
+		{
+			# We have exact match.
+			if($inc == 1)
+			{
+				$$refStartLine = $i;
+			}
+			# Not exatch match. Return start of previous block.
+			elsif($i >= $$refStartLine + $inc)
+			{
+				$$refStartLine = $i - $inc;
+			}
+
+			print("MATCH LINE: $i: " . @$refLogLines[$i] . "\n") if($optionDebug);
+			print("return line: " . $$refStartLine . "\n") if($optionDebug);
+			print("EXIT FindLogLineMatchRecurse. return 1\n") if($optionDebug);
+			return 1;
+		}
+	}
+
+	if($recurse && $inc > 500)
+	{
+		# Split the current search block to smaller blocks and do search to them
+		for(my $i = $$refStartLine; $i < $maxLine; $i += $inc)
+		{
+			print("$spacer $i\n") if($inc != 1 && $optionDebug);
+			print("...RECURSING!\n") if($optionDebug);
+
+			# Start search from the start of current block.
+			my $prevPos = $i;
+
+			# New last line to search
+			my $end = $i + $inc;
+			$end = scalar(@$refLogLines)-1 if($end > scalar(@$refLogLines)-1);
+
+			# New increment, twice smaller than now
+			my $newInc = int($inc / 2 + 0.5);
+			$newInc = 200 if($newInc < 200);
+
+			if(FindLogLineMatchRecurse($startSeconds, $endSeconds, \$prevPos, $refLogLines, $boolOp, $newInc, $recurse-1, $end) == 1)
+			{
+				$$refStartLine = $prevPos;
+				print("EXIT FindLogLineMatchRecurse. return 1\n") if($optionDebug);
+				return 1;
+			}
+		}
+	}
+
+	print("EXIT FindLogLineMatchRecurse. return 0\n") if($optionDebug);
+	return 0;
+}
+
+#------------------------------------------------------------------------------------
+# FindLogLineMatch
+#
+# Searches for log line with time between the startSeconds and endSeconds.
+#
+# Parameters:
+# 	$refLogLines		reference to array of the log
+# 	$startsSeconds		the min time the log line will match
+# 	$endSeconds			the max time the log line will match
+# 	$startLine			index of line to start searching
+# 	$boolOp				1 = first line with match is returned, 0 = first line with no match is returned
+#------------------------------------------------------------------------------------
+sub FindLogLineMatch
+{
+	my ($refLogLines, $startSeconds, $endSeconds, $startLine, $boolOp) = @_;
+    print("IN FindLogLineMatch\n") if($optionDebug);
+	my $prevPos = $startLine;
+
+	#print("\n\nSTART: $startLine, boolop: $boolOp \n");
+
+	my $match = 0;
+	$match = FindLogLineMatchRecurse($startSeconds, $endSeconds, \$prevPos, $refLogLines, $boolOp, 6000, 5);
+	$prevPos = 0 if(!$match);
+	# Refine the search to be exact line
+	$match = FindLogLineMatchRecurse($startSeconds, $endSeconds, \$prevPos, $refLogLines, $boolOp, 1, 0);
+
+    print("EXIT FindLogLineMatch\n") if($optionDebug);
+	# Not found.
+	return -1 if(!$match);
+
+	return $prevPos;
+}
+
+#------------------------------------------------------------------------------------
+# JustFormatLogFile
+#
+# Parameters:
+#	$fileName
+#------------------------------------------------------------------------------------
+sub JustFormatLogFile
+{
+	my ($fileName) = @_;
+
+	if( !open(FILE_HANDLE, $fileName) )
+	{
+		die("ERROR! Could not open file '" . $fileName . "'\n");
+	}
+	my @array = <FILE_HANDLE>;
+	close(FILE_HANDLE);
+
+	$fileName = substr($fileName, 0, index($fileName, ".txt")) . ".html";
+
+	if(	open(FILE_HANDLE, ">" . $fileName) )
+	{
+
+		print FILE_HANDLE (
+		"<html>\n" .
+		"<head>\n" .
+		"<title>$fileName</title>\n" .
+		"</head>\n" .
+		"<body>\n" .
+		"<basefont color=\"black\" face=\"arial\" size=\"4\">\n"
+		);
+
+
+		my $i;
+		for($i = 0;$i<scalar(@array); $i++)
+		{
+			my $line = $array[$i];
+			$line =~ s/\t/ /; #remove tabs
+			FormatLogLine(\$line);
+
+			print FILE_HANDLE ($line);
+		}
+
+		print FILE_HANDLE (
+		"</body>\n" .
+		"</html>"
+		);
+
+		close FILE_HANDLE;
+	} else
+	{
+		print("ERROR: Could not write to file: " . $fileName . "\n");
+	}
+
+}
+
+#------------------------------------------------------------------------------------
+# LogLineTimeMatchesForCase
+#
+# Parameters:
+#	$refLine
+#	$startSeconds
+#	$endSeconds
+#------------------------------------------------------------------------------------
+sub LogLineTimeMatchesForCase
+{
+	my ($refLine, $startSeconds, $endSeconds) = @_;
+
+	return 0 if(!defined($$refLine));
+
+	$$refLine =~ s/\t/ /; #remove tabs
+
+	#print($$refLine . "\n");
+	#print(" - $startSeconds, $endSeconds\n");
+
+	if(${$refLine} =~ m/[0-9\/]+ ([0-9]+):([0-9]+):([0-9]+)/i)
+	{
+#			print("YES " . $1 . "\n");
+
+		my $currSeconds = $1 * 60 * 60 + $2 * 60 + $3;
+		#print(" - curr: $currSeconds\n");
+
+		#print("curr: $currSeconds, start: $startSeconds, end: $endSeconds\n");
+
+		if($currSeconds >= $startSeconds and $currSeconds <= $endSeconds)
+		{
+			#print("MATCH curr: " . $1 . ":" . $2 . ":" . $3 . " = " . $currSeconds . "\n");
+			return 1;
+		}
+	}
+	#print("NO MATCH\n");
+	return 0;
+}
+
+#------------------------------------------------------------------------------------
+# FormatLogLine
+# Parameters:
+# 	$line
+#------------------------------------------------------------------------------------
+sub FormatLogLine
+{
+	my ($line) = @_;
+
+#Color
+
+# sisään
+#27/06/2006	9:37:52	>>>*									royalblue #2B60DE
+# pois
+#27/06/2006	9:37:52	<<<*									lightblue #0000FF
+#27/06/2006	9:23:57	* exit
+# destructor
+#27/06/2006	9:23:58	~*										#FF0000
+#27/06/2006	9:23:58	>>>~*
+
+#27/06/2006	9:37:52	CIptv*Test *							GREY #808080
+#27/06/2006	9:37:52	*error/fail								RED #FF0000
+#27/06/2006	9:23:41	CreateServerProcess() 					GREEN #00FF00
+
+#!!	TTestObject::~TTestObject								#800080
+
+my $color = "#000000";
+
+
+if(${$line} =~ m/([0-9\/]+ [0-9]+:[0-9]+:[0-9]+)/i)
+{
+	$date = $1;
+	${$line} = substr(${$line}, length($date));
+
+	$color = "#808080" if(${$line} =~ m/CIptvTest[a-z0-9]+Test/i);
+
+	$color = "#2B60DE" if(${$line} =~ m/^[\t ]*>>>/i);
+	$color = "#2B60DE" if(${$line} =~ m/\(\)$/i);
+	$color = "#2B60DE" if(${$line} =~ m/enter$/i);
+
+	$color = "#0000FF" if(${$line} =~ m/^[\t ]*<<<*/i);
+	$color = "#0000FF" if(${$line} =~ m/ exit$/i);
+
+	$color = "#800080" if(${$line} =~ m/^[\t ]*~/i);
+	$color = "#800080" if(${$line} =~ m/^[\t ]*>>>~/i);
+	$color = "#800080" if(${$line} =~ m/::~/i);
+
+	$color = "#FF0000" if(${$line} =~ m/error|fail/i);
+	
+	$color = "#00AA00" if(${$line} =~ m/passed/i);
+	$color = "#FF0000" if(${$line} =~ m/\*\*\*Testcase[a-z ]+\*\*\*/i);
+	$color = "#00AA00" if(${$line} =~ m/\*\*\*Testcase PASSED+\*\*\*/i);
+	$color = "#0000FF" if(${$line} =~ m/Executing line/i);
+	
+	my $formatStart = "", $formatEnd = "";
+
+	if(${$line} =~ m/Client created semaphore, init/i) { $formatStart = "<b>"; $formatEnd = "</b>"; }
+	if(${$line} =~ m/CIptvEngineServer:: ->Starting server shutdown/i) { $formatStart = "<b>"; $formatEnd = "</b>"; }
+
+	SpecialChars($line);
+
+	$date = "<font color=\"black\" face=\"arial\" size=\"2\">" . $date . "</font>";
+	${$line} = $date . "$formatStart<font color=\"$color\" face=\"arial\" size=\"2\">" . ${$line} . "</font>$formatEnd<br>";
+}
+
+
+#$line = "<font color=\"$color\" face=\"arial\" size=\"2\"> . $line
+
+#$color = "#2B60DE" if($line =~ m/([0-9\/]+ [0-9]+:[0-9]+:[0-9]+) >>>/i)
+
+
+}
+
+sub PrintCfgSummaries
+{
+	my $caseCfgFileName = "";
+	my %cfgCaseCount;
+	my %cfgCaseTotalTime;
+
+	foreach $case(@cases)
+	{
+		$caseCfgFileName = @{$case}[$CASE_CFG_FILE];
+
+		if(!defined($cfgCaseCount{$caseCfgFileName}))
+		{
+			$cfgCaseCount{$caseCfgFileName} = 0;
+			$cfgCaseTotalTime{$caseCfgFileName} = 0;
+		}
+
+		if(defined(@{$case}[$CASE_RUN_TIME_SECONDS]))
+		{
+			$cfgCaseTotalTime{$caseCfgFileName} +=  @{$case}[$CASE_RUN_TIME_SECONDS];
+		}
+
+
+		$cfgCaseCount{$caseCfgFileName}++ if(@{$case}[$CASE_STATUS] ne "$caseDefaultStatus") ;
+	}
+
+	my $totalTime = 0;
+	printf("\n%-50s %10s %10s\n", "CFG", "Case count", "Case run time");
+	foreach $caseCfgFileName (sort keys(%cfgCaseCount))
+	{
+		if($cfgCaseCount{$caseCfgFileName} > 0)
+		{
+			my $mins = ($cfgCaseTotalTime{$caseCfgFileName}/60);
+			$totalTime += $mins;
+			printf("%-50s %10d %10.1f\n", $caseCfgFileName, $cfgCaseCount{$caseCfgFileName}, $mins);
+		}
+	}
+	printf("Total time: %.2f hours\n\n", $totalTime/60 );
+
+	print("No cases run for:\n");
+	foreach $caseCfgFileName (sort keys(%cfgCaseCount))
+	{
+		if($cfgCaseCount{$caseCfgFileName} == 0)
+		{
+			print("$caseCfgFileName\n");
+		}
+	}
+}
+
+#------------------------------------------------------------------------------------
+# WriteOfficeXml
+#
+# Parameters:
+#	$outputFile
+#	$briefSummary
+#
+# Writes the cases into a word formatted xml file.
+#------------------------------------------------------------------------------------
+sub WriteOfficeXml
+{
+	my ($outputFile, $briefSummary) = @_;
+
+	if(	!open(FILE_HANDLE, ">" . $outputFile) )
+	{
+		print("ERROR! Could not open file '" . $outputFile . "'\n");
+		return;
+	}
+
+	my $writeData = $xmlHeader;
+	my $replacement;
+
+	if($briefSummary == 0) {
+		$writeData .= $xmlHeaderTableColumns;
+	}
+	else {
+		$writeData .= $xmlHeaderTableColumnsBrief;
+	}
+
+	$excelRowCount = scalar(@cases) * 9 + 100;
+	$writeData =~ s/$CaseCountMul8/$excelRowCount/;
+
+	print FILE_HANDLE ( $writeData );
+
+	if($briefSummary) {
+		$writeData = $xmlSummaryData;
+
+		$writeData =~ s/$xmlDataSummaryCaseCount/$summaryCaseCount/;
+		$writeData =~ s/$xmlDataSummaryPassed/$summaryPassedCases/;
+		$writeData =~ s/$xmlDataSummaryFailed/$summaryFailedCases/;
+		$writeData =~ s/$xmlDataSummaryCrashed/$summaryCrashedCases/;
+		$writeData =~ s/$xmlDataSummaryTimeout/$summaryTimeoutCases/;
+		$writeData =~ s/$xmlDataSummaryRunRate/$summaryRunRate/;
+		$writeData =~ s/$xmlDataSummaryPassRateTotal/$summaryPassRateTotal/;
+		$writeData =~ s/$xmlDataSummaryPassRateRun/$summaryPassRateRun/;
+
+		print FILE_HANDLE ( $writeData );
+	}
+
+	my $caseCfgFileName = "";
+
+	my %cfgCaseCount;
+
+	# Sort the cases by the config files, cfg's which have no run cases come last
+
+	if(!$optionSortCases)
+	{
+		#print("HASH CREATE\n");
+		#create hash of cfg case counts
+		foreach $case(@cases)
+		{
+			$caseCfgFileName = @{$case}[$CASE_CFG_FILE];
+
+			if(!defined($cfgCaseCount{$caseCfgFileName}))
+			{
+				$cfgCaseCount{$caseCfgFileName} = 0;
+			}
+
+			$cfgCaseCount{$caseCfgFileName}++ if(@{$case}[$CASE_STATUS] ne "$caseDefaultStatus") ;
+		}
+
+		#print("THRU CASES\n");
+
+		foreach $caseCfgFileName (keys(%cfgCaseCount))
+		{
+			# if cfg has zero cases run then it's cases are put back of the array
+			if($cfgCaseCount{$caseCfgFileName} == 0)
+			{
+				#print("ZERO CASES RUN: $caseCfgFileName\n");
+				my @moveCases;
+
+				my $i;
+				for($i=0; $i< scalar(@cases); $i++)
+				{
+					if($cases[$i][$CASE_CFG_FILE] eq $caseCfgFileName)
+					{
+						push @moveCases, splice(@cases, $i, 1);
+						$i--;
+					}
+				}
+
+				push @cases, @moveCases;
+			}
+		}
+	}
+
+	# Write the xml file
+
+	$caseCfgFileName = "";
+
+	foreach $case(@cases)
+	{
+	    if($optionShowMessages || $optionDebug) 
+		{
+			print(" - Case Xml : " . @{$case}[$CASE_NAME]  . ", status: " . @{$case}[$CASE_STATUS] . "\n") if( $optionDebug || @{$case}[$CASE_STATUS] ne "Not planned" );
+		}
+		
+		if($briefSummary == 0)
+		{
+			$writeData = $xmlData;
+			$writeData .= $xmlData2;
+			$writeData .= $xmlDataEmptyRow;
+		}
+		else
+		{
+			$writeData = "";
+
+			# Write cfg file to the brief xml if it has changed for the case
+			if($optionSortCases == 0 && $caseCfgFileName ne @{$case}[$CASE_CFG_FILE])
+			{
+				$caseCfgFileName = @{$case}[$CASE_CFG_FILE];
+
+				$writeData .= $xmlDataEmptyRow;
+				$writeData .= $xmlCfgFileBrief;
+				$writeData .= $xmlDataBriefHeader;
+
+				$replacement = @{$case}[$CASE_CFG_FILE];
+				XmlReadyText(\$replacement);
+				$writeData =~ s/$xmlDataCfgFile/$replacement/;
+			}
+			
+			# Write log file links to xml.
+
+			my $caseHasLog = ( defined(@{$case}[$CASE_LOG_FILE]) and @{$case}[$CASE_LOG_FILE] ne "" );
+			my $caseHasScripterLog = ( defined(@{$case}[$CASE_LOG_FILE_SCRIPTER]) and @{$case}[$CASE_LOG_FILE_SCRIPTER] ne "" );
+			my $caseLogLink1 = "";
+			my $caseLogLink2 = "";
+			
+			if( $caseHasLog && $caseHasScripterLog )
+			{
+			    print("   - Case has both log files\n") if ($optionDebug );
+			    $writeData .= $xmlDataBrief2Links;
+			    $caseLogLink1 = @{$case}[$CASE_LOG_FILE];
+			    $caseLogLink2 = @{$case}[$CASE_LOG_FILE_SCRIPTER];
+			}
+			elsif( $caseHasLog )
+			{
+			    print("   - Case has log file\n") if ($optionDebug );
+			    $writeData .= $xmlDataBrief1Link;
+			    $caseLogLink1 = @{$case}[$CASE_LOG_FILE];
+			}
+			elsif( $caseHasScripterLog )
+			{
+			    print("   - Case has scripter log file\n") if ($optionDebug );
+			    $writeData .= $xmlDataBrief1Link;
+			    $caseLogLink1 = @{$case}[$CASE_LOG_FILE_SCRIPTER];
+		    }
+			else
+			{
+			    print("   - Case has no log files\n") if ($optionDebug );
+			    $writeData .= $xmlDataBriefNoLinks;
+			}
+			
+			if( $caseLogLink1 ne "" )
+			{
+                print("   - Log file 1: $caseLogLink1\n") if ($optionDebug );
+                $replacement = $caseLogLink1;
+				XmlReadyText(\$replacement);
+				
+				#print("wordxml log file 1: $replacement\n";
+
+				#print("repl: " . $replacement . "\n");
+				$replacement = substr($replacement, index($replacement, "\\") + 1);
+				#$replacement = ".\\testcase_logs\\..\\" . $replacement;
+				#print("repl: " . $replacement . "\n");
+
+				$writeData =~ s/$xmlDataCaseLink1/$replacement/;
+			}
+
+			if( $caseLogLink2 ne "" )
+			{
+			    print("   - Log file 2: $caseLogLink2\n") if ($optionDebug );
+                $replacement = $caseLogLink2;
+				XmlReadyText(\$replacement);
+				
+				#print("wordxml log file 2: $replacement\n";
+
+				#print("repl: " . $replacement . "\n");
+				$replacement = substr($replacement, index($replacement, "\\") + 1);
+				#$replacement = ".\\testcase_logs\\..\\" . $replacement;
+				#print("repl: " . $replacement . "\n");
+
+				$writeData =~ s/$xmlDataCaseLink2/$replacement/;
+			}
+			
+			# Write case fail reason to xml.
+			
+			$replacement = @{$case}[$CASE_REASON];
+			XmlReadyText(\$replacement);
+			$writeData =~ s/$xmlDataCaseReason/$replacement/;
+
+            # Write case run time or result to xml.
+
+			if(!$optionCaseRunTimes)
+			{
+				$replacement = @{$case}[$CASE_RESULT];
+			}
+			else
+			{
+				$replacement = @{$case}[$CASE_RUN_TIME_SECONDS];
+			}
+
+			# Write result to xml.
+			
+			XmlReadyText(\$replacement);
+			$writeData =~ s/$xmlDataCaseResult/$replacement/;
+		}
+
+		#$writeData = $xmlData;
+		#if($option_brief_summary == 0) { $writeData .= $xmlData2; }
+		#$writeData .= $xmlDataEmptyRow;
+
+		$replacement = @{$case}[$CASE_NAME];
+		XmlReadyText(\$replacement);
+		$writeData =~ s/$xmlDataCaseName/$replacement/;
+
+		$replacement = @{$case}[$CASE_RUN_TIMES];
+		XmlReadyText(\$replacement);
+		$writeData =~ s/$xmlDataCaseRunTimes/$replacement/;
+
+		$replacement = @{$case}[$CASE_FAILED];
+		XmlReadyText(\$replacement);
+		$writeData =~ s/$xmlDataCaseFailed/$replacement/;
+
+		$replacement = @{$case}[$CASE_CRASHED];
+		XmlReadyText(\$replacement);
+		$writeData =~ s/$xmlDataCaseCrashed/$replacement/;
+
+		$replacement = @{$case}[$CASE_PASSED];
+		XmlReadyText(\$replacement);
+		$writeData =~ s/$xmlDataCasePassed/$replacement/;
+
+		$replacement = @{$case}[$CASE_STATUS];
+		XmlReadyText(\$replacement);
+		$writeData =~ s/$xmlDataCaseStatus/$replacement/;
+
+		$replacement = @{$case}[$CASE_PURPOSE];
+		XmlReadyText(\$replacement);
+		$writeData =~ s/$xmlDataCasePurpose/$replacement/;
+
+		$replacement = @{$case}[$CASE_MEANS];
+		XmlReadyText(\$replacement);
+		$writeData =~ s/$xmlDataCaseMeans/$replacement/;
+
+		$replacement = @{$case}[$CASE_REQUIRED_SETTINGS];
+		XmlReadyText(\$replacement);
+		$writeData =~ s/$xmlDataCaseRequiredSettings/$replacement/;
+
+		$replacement = @{$case}[$CASE_RELATED_REQUIREMENTS];
+		XmlReadyText(\$replacement);
+		$writeData =~ s/$xmlDataCaseRelatedRequirements/$replacement/;
+
+		$replacement = @{$case}[$CASE_VERIFICATION];
+		XmlReadyText(\$replacement);
+		$writeData =~ s/$xmlDataCaseVerification/$replacement/;
+
+		$replacement = @{$case}[$CASE_NOTE];
+		XmlReadyText(\$replacement);
+		$writeData =~ s/$xmlDataCaseNote/$replacement/;
+
+		if(@{$case}[$CASE_STATUS] eq "UNKNOWN") {
+			$replacement = $STYLE_ID_STATUS_UNKNOWN;
+		}
+		elsif(@{$case}[$CASE_STATUS] eq "CRASHED") {
+			$replacement = $STYLE_ID_STATUS_CRASHED;
+		}
+		elsif(@{$case}[$CASE_STATUS] eq "FAILED") {
+			$replacement = $STYLE_ID_STATUS_FAILED;
+		}
+		elsif(@{$case}[$CASE_STATUS] eq "PASSED") {
+			$replacement = $STYLE_ID_STATUS_PASSED;
+		}
+		else {
+			$replacement = $STYLE_ID_STATUS_NA;
+		}
+
+		$writeData =~ s/$STYLE_ID_STATUS_TAG/$replacement/;
+
+		print FILE_HANDLE ( $writeData );
+	}
+
+	print FILE_HANDLE ( $xmlFooter );
+
+	close(FILE_HANDLE);
+
+	print("Report " . $outputFile . " written.\n");
+}
+
+#------------------------------------------------------------------------------------
+# WriteOfficeXmlAlt
+#
+# Parameters:
+#	$outputFile
+#
+# Writes the cases into a word formatted xml file.
+#------------------------------------------------------------------------------------
+sub WriteOfficeXmlAlt
+{
+	my ($outputFile, $refRuns) = @_;
+
+	CalculateStats();
+
+	if(	!open(FILE_HANDLE, ">" . $outputFile) )
+	{
+		print("ERROR! Could not open file '" . $outputFile . "'\n");
+		return;
+	}
+
+	my $writeData = $xmlHeader;
+	my $replacement;
+
+    $writeData .= $xmlHeaderTableColumnsAlt;
+
+    my $xRefRunInfo = @$refRuns[0];
+    my $xRefCases = @$xRefRunInfo[2];
+    my $caseCount = scalar( @$xRefCases ) + 1000;
+
+	$excelRowCount = $caseCount * 9 + 100;
+	$writeData =~ s/$CaseCountMul8/$excelRowCount/;
+
+	print FILE_HANDLE ( $writeData );
+
+	my $caseCfgFileName = "";
+
+	my %cfgCaseCount;
+
+	# Sort the cases by the config files, cfg's which have no run cases come last
+
+	if(!$optionSortCases)
+	{
+		#print("HASH CREATE\n");
+		#create hash of cfg case counts
+		foreach $case(@cases)
+		{
+			$caseCfgFileName = @{$case}[$CASE_CFG_FILE];
+
+			if(!defined($cfgCaseCount{$caseCfgFileName}))
+			{
+				$cfgCaseCount{$caseCfgFileName} = 0;
+			}
+
+			$cfgCaseCount{$caseCfgFileName}++ if(@{$case}[$CASE_STATUS] ne "$caseDefaultStatus") ;
+		}
+
+		#print("THRU CASES\n");
+
+		foreach $caseCfgFileName (keys(%cfgCaseCount))
+		{
+			# if cfg has zero cases run then it's cases are put back of the array
+			if($cfgCaseCount{$caseCfgFileName} == 0)
+			{
+				#print("ZERO CASES RUN: $caseCfgFileName\n");
+				my @moveCases;
+
+				my $i;
+				for($i=0; $i< scalar(@cases); $i++)
+				{
+					if($cases[$i][$CASE_CFG_FILE] eq $caseCfgFileName)
+					{
+						push @moveCases, splice(@cases, $i, 1);
+						$i--;
+					}
+				}
+
+				push @cases, @moveCases;
+			}
+		}
+	}
+
+    my @sortedRuns;
+
+    #Monday 25th August 2008
+    while( 1 )
+    {
+        my $maxTotal = 0;
+        my $refWinner;
+        for( my $i=0; $i<scalar(@$refRuns); $i++ )
+        {
+            my $refRunInfo = @$refRuns[$i];
+            my $date = @$refRunInfo[1];
+            my @parts = split(" ", $date);
+            my $total = 0 + $parts[1];
+
+            if( $parts[2] eq "Jan" )
+            {
+                $total += 1 * 30;
+            }
+            elsif( $parts[2] eq "Feb" )
+            {
+                $total += 2 * 30;
+            }
+            elsif( $parts[2] eq "Mar" )
+            {
+                $total += 3 * 30;
+            }
+            elsif( $parts[2] eq "Apr" )
+            {
+                $total += 4 * 30;
+            }
+            elsif( $parts[2] eq "May" )
+            {
+                $total += 5 * 30;
+            }
+            elsif( $parts[2] eq "Jun" )
+            {
+                $total += 6 * 30;
+            }
+            elsif( $parts[2] eq "Jul" )
+            {
+                $total += 7 * 30;
+            }
+            elsif( $parts[2] eq "Aug" )
+            {
+                $total += 8 * 30;
+            }
+            elsif( $parts[2] eq "Sep" )
+            {
+                $total += 9 * 30;
+            }
+            elsif( $parts[2] eq "Oct" )
+            {
+                $total += 10 * 30;
+            }
+            elsif( $parts[2] eq "Nov" )
+            {
+                $total += 11 * 30;
+            }
+            elsif( $parts[2] eq "Dec" )
+            {
+                $total += 12 * 30;
+            }
+
+            if( $maxTotal < $total )
+            {
+                my $foundAlready = 0;
+                foreach my $xrun ( @sortedRuns )
+                {
+                    if( $xrun == @$refRuns[$i] )
+                    {
+                        $foundAlready = 1;
+                    }
+
+                }
+
+                if( !$foundAlready )
+                {
+                    $maxTotal = $total;
+                    $winner = @$refRuns[$i];
+                }
+            }
+        }
+        push @sortedRuns, $winner;
+        if( scalar(@sortedRuns) == scalar(@$refRuns) )
+        {
+            last;
+        }
+    }
+
+    foreach $run ( @sortedRuns )
+    {
+        #print("sorted: " . @$run[1] . "\n");
+    }
+    foreach $run ( @$refRuns )
+    {
+        #print("orig: " . @$run[1] . "\n");
+    }
+
+    my $refMainRunInfo = $sortedRuns[0];
+    my $refMainCases = @$refMainRunInfo[2];
+
+	$caseCfgFileName = "";
+    $replacement = "";
+
+    # This prints only cases which are in first run. Build list of cases in all runs and use that.
+    foreach $mainCase ( @$refMainCases )
+    {
+        $writeData = "";
+
+        # Status of the current case in different runs
+        my @statuses;
+        my @results;
+        for( my $i = 0; $i<100; $i++ )
+        {
+            $statuses[$i] = "UNKNOWN";
+            $results[$i] = "";
+        }
+
+        for( my $i = 0; $i<scalar( @sortedRuns ); $i++ )
+        {
+            my $refRunInfo = $sortedRuns[$i];
+
+            my $refCases = @$refRunInfo[2];
+
+            foreach $case ( @$refCases )
+            {
+                if( @$case[$CASE_ID] eq @$mainCase[$CASE_ID] )
+                {
+                    $statuses[$i] = @$case[$CASE_STATUS];
+                    $results[$i] = @$case[$CASE_RESULT];
+                }
+            }
+        }
+
+		# If cfg changes, write xml header for it
+		if($caseCfgFileName ne @$mainCase[$CASE_CFG_FILE])
+		{
+			$caseCfgFileName = @$mainCase[$CASE_CFG_FILE];
+
+			$writeData .= $xmlDataEmptyRow;
+			$writeData .= $xmlCfgFileBrief;
+			$writeData .= $xmlCfgFileAltHeader;
+
+			$replacement = @$mainCase[$CASE_CFG_FILE];
+			XmlReadyText(\$replacement);
+			$writeData =~ s/$xmlDataCfgFile/$replacement/;
+
+
+            for( $i = 0; $i<$ALT_RESULTCOUNT; $i++ )
+            {
+                $replacement = "";
+                if( defined( $sortedRuns[$i] ) )
+                {
+                    $refRunInfo = $sortedRuns[$i];
+                    $replacement = @$refRunInfo[1];
+                }
+                my $field = $xmlDataAltDateX . ($i+1);
+                $writeData =~ s/$field/$replacement/;
+            }
+		}
+
+        # Write xml for X cases
+
+        $writeData .= $xmlCfgFileAltData;
+
+	    $replacement = @$mainCase[$CASE_NAME];
+	    XmlReadyText(\$replacement);
+	    $writeData =~ s/$xmlDataCaseName/$replacement/;
+
+        # Replace the X fields for runs
+        for( my $i = 0; $i<$ALT_RESULTCOUNT; $i++ )
+        {
+            $replacement = $statuses[$i];
+            $replacement = $results[$i];
+            my $field = $xmlDataAltResultX . ($i+1);
+            $writeData =~ s/$field/$replacement/;
+
+    		$replacement = $STYLE_ID_STATUS_NA_CENTERED;
+    		if($statuses[$i] eq "CRASHED") {
+    			$replacement = $STYLE_ID_STATUS_CRASHED_CENTERED;
+    		}
+    		elsif($statuses[$i] eq "FAILED") {
+    			$replacement = $STYLE_ID_STATUS_FAILED_CENTERED;
+    		}
+    		elsif($statuses[$i] eq "PASSED") {
+    			$replacement = $STYLE_ID_STATUS_PASSED_CENTERED;
+    		}
+    		else {
+    			$replacement = $STYLE_ID_STATUS_NA_CENTERED;
+    		}
+
+    		$writeData =~ s/$STYLE_ID_STATUS_TAG/$replacement/;
+        }
+        print FILE_HANDLE ( $writeData );
+    }
+
+	print FILE_HANDLE ( $xmlFooter );
+	close(FILE_HANDLE);
+	print("Alternative report " . $outputFile . " written.\n");
+	return;
+}
+
+#------------------------------------------------------------------------------------
+# WriteTDToolResultFile
+#
+# Parameters:
+#	$outputFile
+#
+# Writes the cases into TDTool formatted file which can be exported into Quality Center
+#------------------------------------------------------------------------------------
+sub WriteTDToolResultFile
+{
+	my ($outputFile) = @_;
+
+	if(	!open(FILE_HANDLE, ">" . $outputFile) )
+	{
+		print("ERROR! Could not open file '" . $outputFile . "'\n");
+		return;
+	}
+
+	my $writeData;
+	my $replacement;
+
+	my %cfgCaseCount;
+
+	# sort the cases by the config files, cfg's which have no run cases come last
+	if(!$optionSortCases)
+	{
+		foreach $case(@cases)
+		{
+			$caseCfgFileName = @{$case}[$CASE_CFG_FILE];
+
+			if(!defined($cfgCaseCount{$caseCfgFileName}))
+			{
+				$cfgCaseCount{$caseCfgFileName} = 0;
+			}
+
+			$cfgCaseCount{$caseCfgFileName}++ if(@{$case}[$CASE_STATUS] ne "$caseDefaultStatus") ;
+		}
+
+		#print("THRU CASES\n");
+
+		foreach $caseCfgFileName (keys(%cfgCaseCount))
+		{
+			# if cfg has zero cases run then it's cases are put back of the array
+			if($cfgCaseCount{$caseCfgFileName} == 0)
+			{
+				#print("ZERO CASES RUN: $caseCfgFileName\n");
+				my @moveCases;
+
+				my $i;
+				for($i=0; $i< scalar(@cases); $i++)
+				{
+					if($cases[$i][$CASE_CFG_FILE] eq $caseCfgFileName)
+					{
+						push @moveCases, splice(@cases, $i, 1);
+						$i--;
+					}
+				}
+
+				push @cases, @moveCases;
+			}
+		}
+	}
+
+#test_set_name_here
+#[1]APES PTSW_WBA_TS -1.1. - Server Version - (01) - COMM_SERVER_VERSION_GET_REQ
+#Passed&Actual result:  Info: 0
+
+	print FILE_HANDLE ( "IPTV_Engine test set\n" );
+
+	foreach $case(@cases)
+	{
+		$writeData = "[1]";
+
+		my $caseName = @{$case}[$CASE_NAME];
+		$writeData .= $caseName;
+
+		$writeData .= "\n";
+
+		my $result;
+
+		if(@{$case}[$CASE_STATUS] eq "UNKNOWN") {
+			$result = "N/A";
+		}
+		elsif(@{$case}[$CASE_STATUS] eq "CRASHED") {
+			$result = "Failed";
+		}
+		elsif(@{$case}[$CASE_STATUS] eq "FAILED") {
+			$result = "Failed";
+		}
+		elsif(@{$case}[$CASE_STATUS] eq "PASSED") {
+			$result = "Passed";
+		}
+		else {
+			$result = "No Run";
+		}
+
+		$writeData .= $result;
+
+
+
+		my $comments = "&Info";
+
+		#$comments = "CFG file: @{$case}[$CASE_CFG_FILE];
+
+		#$comments .= "Actual result = " . @{$case}[$CASE_RESULT] . ", Info = " . @{$case}[$CASE_REASON];
+
+		$writeData .= $comments;
+
+		$writeData .= "\n";
+
+		# Replace bad characters for QC
+		$writeData =~ s/\\/-/g;
+		$writeData =~ s/\//-/g;
+		$writeData =~ s/:/-/g;
+		$writeData =~ s/\"/-/g;
+		$writeData =~ s/\?/-/g;
+		$writeData =~ s/\'/-/g;
+		$writeData =~ s/\|/-/g;
+		$writeData =~ s/\*/-/g;
+		$writeData =~ s/\%/-/g;
+		$writeData =~ s/ä/a/g;
+		$writeData =~ s/ö/o/g;
+		$writeData =~ s/\å/a/g;
+		$writeData =~ s/</(/g;
+		$writeData =~ s/>/)/g;
+
+		if($result eq "Passed" or $result eq "Failed")
+		{
+			print FILE_HANDLE ( $writeData );
+		}
+	}
+
+	close(FILE_HANDLE);
+
+	print("Report " . $outputFile . " written.\n");
+}
+
+
+#------------------------------------------------------------------------------------
+# FindCfgFiles
+# Parameters:
+#	$godir, $refFiles
+#
+# Finds cfg files from the the specified directory and it's sub directories.
+#------------------------------------------------------------------------------------
+sub FindCfgFiles
+{
+	my ($godir, $refFiles) = @_;
+	
+    my $startDir = cwd;
+
+	chdir($godir) or die("Could not change dir to $godir");
+	
+	opendir(DIR, ".");
+	my @files = sort(readdir(DIR));
+	closedir(DIR);
+	
+	foreach $file(@files)
+	{
+		if($file eq "." or $file eq "..") {next};
+
+		if (-d $file)
+		{
+		 	FindCfgFiles( $file, $refFiles );
+		} else {
+			if($file =~ m/\.cfg$/i)
+			{
+				next if($file =~ m/livetv/i and $optionNoLiveTvTests);
+
+				next if(
+						($file =~ m/IptvSecurityServicesTest/i or
+						 $file =~ m/IptvRssSecurityTest/i or
+						 $file =~ m/IptvLiveTvSep/i or
+						 $file =~ m/IptvRssDownloadSecurityTest/i)
+
+						 and $optionNoSecurityTests
+						);
+
+				next if($file =~ m/example.cfg/i);
+
+				push @$refFiles, ( cwd . "/" . $file );
+			}
+		}
+	}
+
+	chdir("$startDir") or die("Could not change dir to $startDir");
+}
+
+#------------------------------------------------------------------------------------
+# ParseCfg
+# Parameters:
+#	$file
+#------------------------------------------------------------------------------------
+sub ParseCfg
+{
+	my ($file) = @_;
+
+	my $fileCaseCount = 0;
+
+	if( !open(FILE_HANDLE, $file) )
+	{
+		print("ERROR! Could not open file '" . $file . "'\n");
+		return 0;
+	}
+	my @array = <FILE_HANDLE>;
+	close(FILE_HANDLE);
+
+	my $lineCount = scalar(@array);
+	my $i;
+	my $cfgFileWritten = 0;
+	my $caseDocumentationStart = -1;
+	my $line;
+
+	my @caseDesc; # lines for case desc and case itself
+
+	for($i=0; $i<$lineCount; $i++ ) {
+		$line = $array[$i];
+
+		RemoveWhiteSpaces(\$line);
+
+		#print("           $line\n");
+
+		if($line =~ m/^\#\[IptvETDescription\]/)
+		{
+			$caseDocumentationStart = $i;
+		}
+
+		if($line =~ m/\[Test\]/)
+		{
+			if($caseDocumentationStart >= 0)
+			{
+				ReadCaseAndDescText(\@array, \@caseDesc, $caseDocumentationStart-1)
+			}
+			else
+			{
+				ReadCaseAndDescText(\@array, \@caseDesc, $i);
+			}
+
+			#print("readcase desc: " . scalar(@caseDesc) . "\n");
+		}
+		else
+		{
+		    #print("NOT READ readcase desc: " . scalar(@caseDesc) . "\n");
+		}
+
+	    #test case starts here
+	    if($line =~ m/^title /)
+	    {
+	    	#print("COUNT: " . scalar(@caseDesc) . "\n\n");
+
+			if($caseDocumentationStart >= 0)
+			{
+				#print(">>> Case start: " . $line . "\n");
+				#$i +=
+				ReadCase(\@array, $caseDocumentationStart, $file);
+				$caseDocumentationStart = -1;
+			}
+
+	    	my $caseName = substr($line, length("title "));
+	    	my $caseId = GetCaseIdFromName($caseName);
+
+	    	RemoveWhiteSpaces(\$caseName);
+	    	#SpecialChars(\$caseName);
+
+	    	my $documentationExists = GetCase($caseId, \@cases);
+
+			$caseDesc[0] = $caseName;
+			push @caseDescs, [ @caseDesc ];
+			@caseDesc = (); #new case starts
+
+	    	# create empty array for case
+	    	if(!$documentationExists)
+	    	{
+	    		if($cfgFileWritten == 0)
+	    		{
+	    			$cfgFileWritten = 1;
+	    			push @notDocumentedCases, ("\n\n" . $file .
+"\n************************************************************************************************\n"
+						);
+
+	    		}
+	    		push @notDocumentedCases, ($caseName . "\n");
+
+				#create dummy case
+				my @case;
+				$case[$CASE_NAME] = $caseName;
+
+				$case[$CASE_ID] = $caseId;
+
+				$case[$CASE_RUN_TIMES] = 0;
+				$case[$CASE_CRASHED] = 0;
+				$case[$CASE_FAILED] = 0;
+				$case[$CASE_PASSED] = 0;
+				$case[$CASE_STATUS] = "$caseDefaultStatus";
+				$case[$CASE_PURPOSE] = "N/A";
+				$case[$CASE_MEANS] = "N/A";
+				$case[$CASE_REQUIRED_SETTINGS] = "N/A";
+				$case[$CASE_RELATED_REQUIREMENTS] = "N/A";
+				$case[$CASE_VERIFICATION] = "N/A";
+				$case[$CASE_NOTE] = "N/A";
+				$case[$CASE_REASON] = "";
+				$case[$CASE_RESULT] = "";
+				$case[$CASE_LOG_FILE] = "";
+				$case[$CASE_LOG_FILE_SCRIPTER] = "";
+				$case[$CASE_CHECK_RESULT_LOG_FILE] = 0;
+				$case[$CASE_CFG_FILE] = lc( GetPathFileName($file) );
+				$case[$CASE_RUN_TIME_SECONDS] = 0;
+
+                if( IsCaseInCaseList( $case[$CASE_ID] ) )
+    			{
+        			push @cases, [ @case ];
+    		    }
+	    	}
+
+	    	$fileCaseCount++;
+	    	if($optionShowMessages) { print(" - Case: " . $caseName . "\n"); };
+	    }
+	}
+
+	return $fileCaseCount;
+}
+
+
+#------------------------------------------------------------------------------------
+# ReadCaseAndDescText
+#
+# Parameters:
+#	$lines
+#	$caseInfo
+#	$startIndex
+#------------------------------------------------------------------------------------
+sub ReadCaseAndDescText
+{
+	my ($lines, $caseInfo, $startIndex) = @_;
+	my $lineCount = @{$lines};
+
+	my $readLines = 0;
+	my $i = 0;
+
+	@{$caseInfo}[0] = "N/A";
+
+	for($i=$startIndex; $i<$lineCount; $i++)
+	{
+		my $line = @{$lines}[$i];
+
+		@{$caseInfo}[ scalar(@{$caseInfo}) ] = $line;
+
+		#print($line . "\n");
+
+		if($line =~ m/\[Endtest\]/i)
+		{
+#				push @cases, [ @case ];
+
+			#foreach $xxx (@{$caseInfo})	{		print("XXX: " . $xxx . "");	}
+
+			return $readLines;
+		}
+
+		$readLines++;
+	}
+
+	return $readLines;
+}
+
+#------------------------------------------------------------------------------------
+# ReadCase
+#
+# Parameters:
+#	$lines
+#	$startIndex
+#	$file
+#------------------------------------------------------------------------------------
+sub ReadCase
+{
+	my ($lines, $startIndex, $file) = @_;
+	my $lineCount = @{$lines};
+
+	my $readLines = 0;
+	my $i = 0;
+
+	my $caseName = "";
+	my $casePurpose = "";
+	my $caseMeans = "";
+	my $caseRequiredSettings = "";
+	my $caseRelatedRequirements = "";
+	my $caseVerification = "";
+	my $caseNote = "";
+
+	#this is where text is appended if it's on a line which has no description tag
+	# -> multiline descriptions can be specified
+	my $refAppend = 0;
+
+	for($i=$startIndex; $i<$lineCount; $i++)
+	{
+		my $line = @{$lines}[$i];
+
+		#print($line . "\n");
+
+		RemoveWhiteSpaces(\$line);
+		#$line =~ s/\s+$//; #whitespaces in the end
+		#$line =~ s/^\s+//; #whitespaces at the start
+
+		if($line =~ m/^\#\[EndIptvETDescription\]/)
+		{
+			#print(" ***** End case\n");
+
+			my @case;
+
+			$case[$CASE_NAME] = $caseName;
+			$case[$CASE_ID] = GetCaseIdFromName($caseName);
+
+			$case[$CASE_RUN_TIMES] = 0;
+			$case[$CASE_CRASHED] = 0;
+			$case[$CASE_FAILED] = 0;
+			$case[$CASE_PASSED] = 0;
+			$case[$CASE_STATUS] = "$caseDefaultStatus";
+			$case[$CASE_PURPOSE] = $casePurpose;
+			$case[$CASE_MEANS] = $caseMeans;
+			$case[$CASE_REQUIRED_SETTINGS] = $caseRequiredSettings;
+			$case[$CASE_RELATED_REQUIREMENTS] = $caseRelatedRequirements;
+			$case[$CASE_VERIFICATION] = $caseVerification;
+			$case[$CASE_NOTE] = $caseNote;
+			$case[$CASE_REASON] = "";
+			$case[$CASE_RESULT] = "";
+			$case[$CASE_LOG_FILE] = "";
+			$case[$CASE_LOG_FILE_SCRIPTER] = "";
+			$case[$CASE_CHECK_RESULT_LOG_FILE] = 0;
+			$case[$CASE_CFG_FILE] = $file;
+			$case[$CASE_RUN_TIME_SECONDS] = 0;
+
+            if( IsCaseInCaseList( $case[$CASE_ID] ) )
+			{
+    			push @cases, [ @case ];
+			}
+
+			return $readLines;
+		}
+
+		elsif($line =~ m/^\# Testname:/)
+		{
+			$caseName = substr($line, length("# Testname:"));
+			RemoveWhiteSpaces(\$caseName);
+			#SpecialChars(\$caseName);
+			$refAppend = \$caseName;
+		}
+
+		elsif($line =~ m/^\# Purpose:/)
+		{
+			$casePurpose = substr($line, length("# Purpose:"));
+			RemoveWhiteSpaces(\$casePurpose);
+			#SpecialChars(\$casePurpose);
+			$refAppend = \$casePurpose;
+		}
+
+		elsif($line =~ m/^\# Means:/)
+		{
+			$caseMeans = substr($line, length("# Means:"));
+			RemoveWhiteSpaces(\$caseMeans);
+			#SpecialChars(\$caseMeans);
+			$refAppend = \$caseMeans;
+		}
+
+		elsif($line =~ m/^\# Required environment settings:/)
+		{
+			$caseRequiredSettings = substr($line, length("# Required environment settings:"));
+			RemoveWhiteSpaces(\$caseRequiredSettings);
+			#SpecialChars(\$caseRequiredSettings);
+			$refAppend = \$caseRequiredSettings;
+		}
+
+		elsif($line =~ m/^\# Related requirements:/)
+		{
+			$caseRelatedRequirements = substr($line, length("# Related requirements:"));
+			RemoveWhiteSpaces(\$caseRelatedRequirements);
+			$refAppend = \$caseRelatedRequirements;
+		}
+
+		elsif($line =~ m/^\# Verification:/)
+		{
+			$caseVerification = substr($line, length("# Verification:"));
+			RemoveWhiteSpaces(\$caseVerification);
+			$refAppend = \$caseVerification;
+		}
+
+		elsif($line =~ m/^\# Note:/)
+		{
+			$caseNote = substr($line, length("# Note:"));
+			RemoveWhiteSpaces(\$caseNote);
+			$refAppend = \$caseNote;
+		}
+
+		elsif($line =~ m/^\#/)
+		{
+			my $text = substr($line, length("#"));
+			RemoveWhiteSpaces(\$text);
+			#print(" ***** JOTTAI MUuTA: " . $text. "\n");
+			${$refAppend} .= " " . $text;
+
+			RemoveWhiteSpaces($refAppend);
+
+		}
+
+		$readLines++;
+	}
+
+	return $readLines;
+}
+
+#------------------------------------------------------------------------------------
+# GetCaseIdFromName
+#
+# Parameters:
+#	$caseName
+#------------------------------------------------------------------------------------
+sub GetCaseIdFromName
+{
+	my ($caseName) = @_;
+
+	return "NOID" if(!defined($caseName) || $caseName eq "");
+
+	RemoveWhiteSpaces(\$caseName);
+	#SpecialChars(\$caseName);
+
+	if($caseName =~ m/(ET[0-9]+)[ ]+/)
+	{
+		return $1;
+	}
+
+	return $caseName;
+}
+
+#------------------------------------------------------------------------------------
+# GetCaseField
+#
+# Parameters:
+#	$caseName
+#	$caseField
+#------------------------------------------------------------------------------------
+sub GetCaseField
+{
+	my ($caseNameOrId, $caseField) = @_;
+
+	my $ret = "";
+
+	foreach my $case(@cases)
+	{
+		if(@{$case}[$CASE_NAME] eq $caseNameOrId or @{$case}[$CASE_ID] eq $caseNameOrId)
+		{
+			if( defined(@{$case}[$caseField]) )
+			{
+				$ret = @{$case}[$caseField];
+			}
+		}
+	}
+
+	return $ret;
+}
+
+#------------------------------------------------------------------------------------
+# GetCaseByNameOnly
+#
+# Parameters:
+#	$caseName
+#
+# Removes the case IDs from case names and tries to find case from @cases array
+#------------------------------------------------------------------------------------
+sub GetCaseByNameOnly
+{
+	my ($caseName) = @_;
+
+	my $startPos = index($caseName, " ");
+	$caseName  = substr($caseName, $startPos) if($startPos != -1);
+
+	RemoveWhiteSpaces(\$caseName);
+
+	for(my $i = 0; $i<scalar(@cases); $i++)
+	{
+		my $name = $cases[$i][$CASE_NAME];
+		$startPos = index($name, " ");
+		return if($startPos == -1);
+		$name  = substr($name, $startPos);
+		RemoveWhiteSpaces(\$name);
+
+		return $cases[$i] if($name eq $caseName);
+	}
+	return;
+}
+
+#------------------------------------------------------------------------------------
+# GetCase
+#
+# Parameters:
+#	$caseNameOrID
+#
+# Returns reference to case
+#------------------------------------------------------------------------------------
+sub GetCase
+{
+	my ($caseNameOrID, $refCases) = @_;
+
+	for(my $i = 0; $i<scalar(@$refCases); $i++)
+	{
+        $case = @$refCases[$i];
+		if(@$case[$CASE_NAME] eq $caseNameOrID or @$case[$CASE_ID] eq $caseNameOrID)
+		{
+			return $case;
+		}
+	}
+	return;
+}
+
+#------------------------------------------------------------------------------------
+# GetCaseDesc
+#
+# Parameters:
+#	$caseNameOrID
+#
+# Returns reference to casedesc
+#------------------------------------------------------------------------------------
+sub GetCaseDesc
+{
+	my ($caseNameOrID) = @_;
+
+	for(my $i=0; $i<scalar(@caseDescs); $i++)
+	{
+		if($caseDescs[$i][0] eq $caseNameOrID || $caseDescs[$i][0] eq $caseNameOrID)
+		{
+			return $caseDescs[$i];
+		}
+	}
+	return;
+}
+
+#------------------------------------------------------------------------------------
+# RemoveWhiteSpaces
+#
+# Parameters:
+# 	$text
+#------------------------------------------------------------------------------------
+sub RemoveWhiteSpaces()
+{
+	my ($text) = @_;
+	${$text} =~ s/\s+$//; #whitespaces in the end
+	${$text} =~ s/^\s+//; #whitespaces at the start
+}
+
+#------------------------------------------------------------------------------------
+# XmlReadyText
+#
+# Parameters:
+# 	$text
+#------------------------------------------------------------------------------------
+sub XmlReadyText
+{
+	my ($text) = @_;
+
+	$txtlt = "&lt;";
+	$txtgt = "&gt;";
+	${$text} =~ s/</$txtlt/g;
+	${$text} =~ s/>/$txtgt/g;
+
+	${$text} =~ s/Ä/&Auml/g;
+	${$text} =~ s/ä/&auml/g;
+	${$text} =~ s/Ö/&Ouml/g;
+	${$text} =~ s/ö/&ouml/g;
+
+	#ä &auml;
+
+#	Ö &Ouml;
+
+#	ö &ouml;
+
+}
+
+#------------------------------------------------------------------------------------
+# SpecialChars
+#
+# Parameters:
+# 	$text
+#------------------------------------------------------------------------------------
+sub SpecialChars
+{
+	my ($text) = @_;
+
+
+	ReplaceChar($text, "etmerkki#39;", "'" );
+	ReplaceChar($text, "etmerkkiamp;", "&" );
+	ReplaceChar($text, "etmerkkiacute;", "´" );
+
+	ReplaceChar($text, "etmerkkilsquo;", "‘" );
+	ReplaceChar($text, "etmerkkirsquo;", "’" );
+	ReplaceChar($text, "etmerkkisbquo;", "‚" );
+	ReplaceChar($text, "etmerkkildquo;", "“" );
+	ReplaceChar($text, "etmerkkirdquo;", "”" );
+	ReplaceChar($text, "etmerkkibdquo;", "„" );
+	ReplaceChar($text, "etmerkki#34;", "\"" );
+
+	ReplaceChar($text, "etmerkki#40;", "(" );
+	ReplaceChar($text, "etmerkki#41;", ")" );
+
+	ReplaceChar($text, "etmerkkifrasl;", "/" );
+	ReplaceChar($text, "etmerkkilt;", "<" );
+	ReplaceChar($text, "etmerkkigt;", ">" );
+	ReplaceChar($text, "etmerkki#166;" , "¦" );
+
+	ReplaceChar($text, "etmerkkipara;", "¶" );
+	ReplaceChar($text, "etmerkkimiddot;", "·" );
+	ReplaceChar($text, "etmerkkifrac14;", "¼" );
+	ReplaceChar($text, "etmerkkifrac12;", "½" );
+	ReplaceChar($text, "etmerkkifrac34;" , "¾" );
+
+
+	${$text} =~ s/etmerkki/&/g;
+
+	#	print("TEXT: " . ${$text} . "\n");
+}
+
+#------------------------------------------------------------------------------------
+# ReplaceChar
+#
+# Parameters:
+# 	$text
+#	$replacement
+#	$char
+#------------------------------------------------------------------------------------
+sub ReplaceChar
+{
+	my ($text, $replacement, $char) = @_;
+
+#	print("txt: " . ${$text} . "char: " . $char . ", repl: " . $replacement . "\n");
+
+	while(index(${$text}, $char)  != -1)
+	{
+		my $pos = index(${$text}, $char);
+		if($pos < 0) { $pos = 0 };
+
+		$str1 = substr(${$text}, 0, $pos);
+		$str2 = substr(${$text}, $pos+1);
+
+#		print "STR: '" .  $str1 . "' - '" . $str2 . "'\n";
+
+#		print "XXX: " . $str1 . $replacement .  $str2 . "\n";
+
+		${$text} = $str1 . $replacement . $str2;;
+	}
+}
+
+#------------------------------------------------------------------------------------
+# PrintCases
+#------------------------------------------------------------------------------------
+sub PrintCases
+{
+
+	my ($fileName) = @_;
+
+	my @buff;
+
+	push @buff, ("Name, Status, LogFile\n");
+
+	my $i;
+
+	push @buff, ("----------------------------------------\nCASES\n--------------------------------------\n");
+	foreach $case(@cases)
+	{
+
+		#	my $case = $cases[$i];
+		if(0 or @{$case}[$CASE_STATUS] ne "$caseDefaultStatus")
+			{
+
+			push @buff, (@{$case}[$CASE_NAME] . " ");
+			#@{$case}[$CASE_RUN_TIMES]
+			#@{$case}[$CASE_CRASHED]
+			#@{$case}[$CASE_FAILED]
+			#@{$case}[$CASE_PASSED]
+			push @buff, (@{$case}[$CASE_STATUS] . " ");
+			#@{$case}[$CASE_PURPOSE]
+			#@{$case}[$CASE_MEANS]
+			#@{$case}[$CASE_REQUIRED_SETTINGS]
+			#@{$case}[$CASE_RELATED_REQUIREMENTS]
+			#@{$case}[$CASE_VERIFICATION]
+			#@{$case}[$CASE_NOTE]
+			#@{$case}[$CASE_REASON]
+			#@{$case}[$CASE_RESULT]
+			push @buff, ("file: " . @{$case}[$CASE_LOG_FILE]  . " ");
+
+			push @buff, ("check log: " . @{$case}[$CASE_CHECK_RESULT_LOG_FILE]  . " ");
+
+			push @buff, ("\n");
+
+			}
+	}
+
+	open(XXX, ">" . $fileName);
+	print XXX ( @buff );
+	close(XXX);
+
+}
+
+#------------------------------------------------------------------------------------
+# FindFiles
+# Parameters:
+#	$goDir, where to start finding
+#	$fileSearch, filename search
+#	$searchType, 0 = fullname search, 1 = filetype search
+#	$refIncfiles, reference to array which will hold found files
+#------------------------------------------------------------------------------------
+sub FindFiles
+{
+	my ($godir, $fileSearch, $searchType, $refIncfiles) = @_;
+
+	my $startDir = cwd;
+
+	chdir($godir) or die("Could not change dir to $godir");
+
+	#print("Now in: " . cwd . "\n");
+
+	opendir(DIR, ".");
+	my @filelist = sort(readdir(DIR));
+	closedir(DIR);
+
+	foreach my $file(@filelist)
+	{
+		if($file eq "." or $file eq "..") {next};
+
+		if (-d $file)
+		{
+		 	FindFiles( $file, $fileSearch, $searchType, $refIncfiles);
+		} else
+		{
+			if( ($file =~ m/$fileSearch/i and $searchType == 0 ) or ($file =~ m/$fileSearch$/i and $searchType == 1 ) )
+			{
+                $file = cwd . "/" . $file;
+				push @$refIncfiles, $file;
+				#print("$file\n");
+			}
+		}
+	}
+
+	chdir ($startDir) or die("Could not change dir to $startDir");
+}
+
+
+#------------------------------------------------------------------------------------
+# GetAllFiles
+# Parameters:
+#	$goDir, where to start finding
+#	$refIncfiles, reference to array which will hold found files
+#   $subDirLevel, how deep in the directories we go to search files. < 0 is no limit.
+#------------------------------------------------------------------------------------
+sub GetAllFiles
+{
+	my ($godir, $refIncfiles, $subDirLevel) = @_;
+
+	my $startDir = cwd;
+
+	chdir($godir) or die("Could not change dir to $godir");
+
+	#print("Now in: " . cwd . "\n");
+
+	opendir(DIR, ".");
+	my @filelist = sort(readdir(DIR));
+	closedir(DIR);
+
+	foreach my $file(@filelist)
+	{
+		if($file eq "." or $file eq "..") {next};
+		
+		if (! (-d $file) )
+		{
+		 	my $path = $startDir . "/" . $file;
+		 	push @$refIncfiles, $path;		 	
+		} elsif( $subDirLevel > 0 || $subDirLevel < 0 )
+		{
+			my $backupDir = cwd;
+			chdir( $file ) or die("Could not change dir to $file");
+			GetAllFiles( $godir, $refIncfiles, $subDirLevel-1 );
+			chdir( $backupDir ) or die("Could not change dir to $backupDir");
+		}
+	}
+
+	chdir ($startDir) or die("Could not change dir to $startDir");
+}
+
+#------------------------------------------------------------------------------------
+# FindDirs
+# Parameters:
+#	$goDir, where to start finding
+#	$fileSearch, filename search
+#	$refIncfiles, reference to array which will hold found files
+#------------------------------------------------------------------------------------
+sub FindDirs
+{
+	my ($godir, $fileSearch, $refIncfiles) = @_;
+
+	my $startDir = cwd;
+
+	chdir($godir) or die("Could not change dir to $godir");
+
+	#print("Now in: " . cwd . "\n");
+
+	opendir(DIR, ".");
+	my @filelist = sort(readdir(DIR));
+	closedir(DIR);
+
+	foreach my $file(@filelist)
+	{
+		if($file eq "." or $file eq "..") {next};
+
+		if (-d $file)
+		{
+		    if( $file =~ m/$fileSearch/i )
+		    {
+		        push @$refIncfiles, (cwd . "/" . $file);
+		    }
+		 	FindDirs( $file, $fileSearch, $refIncfiles );
+		}
+	}
+
+	chdir ($startDir) or die("Could not change dir to $startDir");
+}
+
+#------------------------------------------------------------------------------------
+# GetPathFileName
+#
+# Parameters:
+# 	$str
+#------------------------------------------------------------------------------------
+sub GetPathFileName
+{
+    my ($str) = @_;
+
+    my $startPos = rindex($str, "\\");
+    if($startPos == -1)
+    {
+        $startPos = rindex($str, "/");
+        return $str if($startPos == -1);
+    }
+
+    my $filename = substr($str, $startPos+1);
+
+    return $filename;
+}
+
+#------------------------------------------------------------------------------------
+# GetPathDir
+#
+# Parameters:
+# 	$str
+#------------------------------------------------------------------------------------
+sub GetPathDir
+{
+    my ($str) = @_;
+
+    my $startPos = rindex($str, "\\");
+    if($startPos == -1)
+    {
+        $startPos = rindex($str, "/");
+        return $str if($startPos == -1);
+    }
+
+    my $filename = substr($str, 0, $startPos);
+
+    return $filename;
+}
+
+sub InitXmlData
+{
+
+$xmlHeader =
+"<?xml version='1.0'?>" .
+"<?mso-application progid='Excel.Sheet'?>" .
+"<Workbook xmlns='urn:schemas-microsoft-com:office:spreadsheet'" .
+" xmlns:o='urn:schemas-microsoft-com:office:office'" .
+" xmlns:x='urn:schemas-microsoft-com:office:excel'" .
+" xmlns:ss='urn:schemas-microsoft-com:office:spreadsheet'" .
+" xmlns:html='http://www.w3.org/TR/REC-html40'>" .
+" <DocumentProperties xmlns='urn:schemas-microsoft-com:office:office'>" .
+"  <Author>Senbom Petri</Author>" .
+"  <LastAuthor>Senbom Petri</LastAuthor>" .
+"  <Created>2006-06-09T11:08:05Z</Created>" .
+"  <Company>Nokia Oyj</Company>" .
+"  <Version>11.6568</Version>" .
+" </DocumentProperties>" .
+" <ExcelWorkbook xmlns='urn:schemas-microsoft-com:office:excel'>" .
+"  <WindowHeight>12210</WindowHeight>" .
+"  <WindowWidth>18780</WindowWidth>" .
+"  <WindowTopX>360</WindowTopX>" .
+"  <WindowTopY>255</WindowTopY>" .
+"  <ProtectStructure>False</ProtectStructure>" .
+"  <ProtectWindows>False</ProtectWindows>" .
+" </ExcelWorkbook>" .
+" <Styles>" .
+"  <Style ss:ID='Default' ss:Name='Normal'>" .
+"   <Alignment ss:Vertical='Bottom'/>" .
+"   <Borders/>" .
+"   <Font/>" .
+"   <Interior/>" .
+"   <NumberFormat/>" .
+"   <Protection/>" .
+"  </Style>" .
+"  <Style ss:ID='m155260432'>" .
+"   <Alignment ss:Vertical='Top' ss:WrapText='1'/>" .
+"   <Borders>" .
+"    <Border ss:Position='Bottom' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Left' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Right' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Top' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"   </Borders>" .
+"   <Interior ss:Color='#FFFFFF' ss:Pattern='Solid'/>" .
+"  </Style>" .
+"  <Style ss:ID='m155260442'>" .
+"   <Alignment ss:Vertical='Top' ss:WrapText='1'/>" .
+"   <Borders>" .
+"    <Border ss:Position='Bottom' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Left' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Right' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Top' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"   </Borders>" .
+"   <Interior ss:Color='#FFFFFF' ss:Pattern='Solid'/>" .
+"  </Style>" .
+"  <Style ss:ID='m155266416'>" .
+"   <Alignment ss:Vertical='Bottom'/>" .
+"   <Borders>" .
+"    <Border ss:Position='Bottom' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Left' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Right' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Top' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"   </Borders>" .
+"   <Font x:Family='Swiss' ss:Bold='1'/>" .
+"   <Interior ss:Color='#FFFFFF' ss:Pattern='Solid'/>" .
+"  </Style>" .
+"  <Style ss:ID='m155266426'>" .
+"   <Alignment ss:Vertical='Top' ss:WrapText='1'/>" .
+"   <Borders>" .
+"    <Border ss:Position='Bottom' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Left' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Right' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Top' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"   </Borders>" .
+"   <Interior ss:Color='#FFFFFF' ss:Pattern='Solid'/>" .
+"  </Style>" .
+"  <Style ss:ID='m155266436'>" .
+"   <Alignment ss:Vertical='Top' ss:WrapText='1'/>" .
+"   <Borders>" .
+"    <Border ss:Position='Bottom' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Left' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Right' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Top' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"   </Borders>" .
+"   <Interior ss:Color='#FFFFFF' ss:Pattern='Solid'/>" .
+"  </Style>" .
+"  <Style ss:ID='m155266446'>" .
+"   <Alignment ss:Vertical='Top' ss:WrapText='1'/>" .
+"   <Borders>" .
+"    <Border ss:Position='Bottom' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Left' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Right' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Top' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"   </Borders>" .
+"   <Interior ss:Color='#FFFFFF' ss:Pattern='Solid'/>" .
+"  </Style>" .
+"  <Style ss:ID='s21'>" .
+"   <Alignment ss:Horizontal='Right' ss:Vertical='Bottom'/>" .
+"   <Borders>" .
+"    <Border ss:Position='Bottom' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Right' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Top' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"   </Borders>" .
+"   <Interior ss:Color='#99CCFF' ss:Pattern='Solid'/>" .
+"  </Style>" .
+"  <Style ss:ID='s25'>" .
+"   <Alignment ss:Horizontal='Right' ss:Vertical='Bottom'/>" .
+"   <Borders>" .
+"    <Border ss:Position='Right' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"   </Borders>" .
+"   <Interior ss:Color='#99CCFF' ss:Pattern='Solid'/>" .
+"  </Style>" .
+"  <Style ss:ID='s26'>" .
+"   <Borders>" .
+"    <Border ss:Position='Left' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Top' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"   </Borders>" .
+"   <Interior ss:Color='#FFFFFF' ss:Pattern='Solid'/>" .
+"  </Style>" .
+"  <Style ss:ID='s27'>" .
+"   <Alignment ss:Horizontal='Center' ss:Vertical='Bottom'/>" .
+"   <Borders>" .
+"    <Border ss:Position='Top' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"   </Borders>" .
+"   <Interior ss:Color='#99CCFF' ss:Pattern='Solid'/>" .
+"  </Style>" .
+"  <Style ss:ID='s28'>" .
+"   <Borders>" .
+"    <Border ss:Position='Top' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"   </Borders>" .
+"   <Interior ss:Color='#FFFFFF' ss:Pattern='Solid'/>" .
+"  </Style>" .
+"  <Style ss:ID='s29'>" .
+"   <Borders>" .
+"    <Border ss:Position='Right' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Top' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"   </Borders>" .
+"   <Interior ss:Color='#FFFFFF' ss:Pattern='Solid'/>" .
+"  </Style>" .
+"  <Style ss:ID='s30'>" .
+"   <Alignment ss:Horizontal='Right' ss:Vertical='Top'/>" .
+"   <Borders>" .
+"    <Border ss:Position='Right' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"   </Borders>" .
+"   <Interior ss:Color='#99CCFF' ss:Pattern='Solid'/>" .
+"  </Style>" .
+"  <Style ss:ID='s34'>" .
+"   <Alignment ss:Horizontal='Right' ss:Vertical='Top'/>" .
+"   <Borders>" .
+"    <Border ss:Position='Bottom' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Right' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"   </Borders>" .
+"   <Interior ss:Color='#99CCFF' ss:Pattern='Solid'/>" .
+"  </Style>" .
+"  <Style ss:ID='s35'>" .
+"   <Interior ss:Color='#FFFFFF' ss:Pattern='Solid'/>" .
+"  </Style>" .
+
+#failed
+
+"  <Style ss:ID='s36'>" .
+"   <Alignment ss:Vertical='Top' ss:WrapText='1'/>" .
+"   <Borders>" .
+"    <Border ss:Position='Bottom' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Left' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Right' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Top' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"   </Borders>" .
+"   <Interior ss:Color='#FFFF00' ss:Pattern='Solid'/>" .
+"  </Style>" .
+
+#passed style
+
+"  <Style ss:ID='s37'>" .
+"   <Alignment ss:Vertical='Top' ss:WrapText='1'/>" .
+"   <Borders>" .
+"    <Border ss:Position='Bottom' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Left' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Right' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Top' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"   </Borders>" .
+"   <Interior ss:Color='#CCFFCC' ss:Pattern='Solid'/>" .
+"  </Style>" .
+
+#crashed style
+
+"  <Style ss:ID='s38'>" .
+"   <Alignment ss:Vertical='Top' ss:WrapText='1'/>" .
+"   <Borders>" .
+"    <Border ss:Position='Bottom' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Left' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Right' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Top' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"   </Borders>" .
+"   <Interior ss:Color='#FF6600' ss:Pattern='Solid'/>" .
+"  </Style>" .
+
+# UNKNOWN style
+
+"  <Style ss:ID='s401'>" .
+"   <Alignment ss:Vertical='Top' ss:WrapText='1'/>" .
+"   <Borders>" .
+"    <Border ss:Position='Bottom' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Left' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Right' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Top' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"   </Borders>" .
+"   <Interior ss:Color='#FF6600' ss:Pattern='Solid'/>" .
+"  </Style>" .
+
+
+#NA style
+"  <Style ss:ID='s39'>" .
+"   <Alignment ss:Vertical='Top' ss:WrapText='1'/>" .
+"   <Borders>" .
+"    <Border ss:Position='Bottom' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Left' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Right' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Top' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"   </Borders>" .
+"  </Style>" .
+
+
+#failed centered
+
+"  <Style ss:ID='s36centered'>" .
+"   <Alignment ss:Horizontal=\"Center\" ss:Vertical='Top' ss:WrapText='1'/>" .
+"   <Borders>" .
+"    <Border ss:Position='Bottom' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Left' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Right' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Top' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"   </Borders>" .
+"   <Interior ss:Color='#FFFF00' ss:Pattern='Solid'/>" .
+"  </Style>" .
+
+#passed style centered
+
+"  <Style ss:ID='s37centered'>" .
+"   <Alignment ss:Horizontal=\"Center\" ss:Vertical='Top' ss:WrapText='1'/>" .
+"   <Borders>" .
+"    <Border ss:Position='Bottom' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Left' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Right' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Top' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"   </Borders>" .
+"   <Interior ss:Color='#CCFFCC' ss:Pattern='Solid'/>" .
+"  </Style>" .
+
+#crashed style centered
+
+"  <Style ss:ID='s38centered'>" .
+"   <Alignment ss:Horizontal=\"Center\" ss:Vertical='Top' ss:WrapText='1'/>" .
+"   <Borders>" .
+"    <Border ss:Position='Bottom' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Left' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Right' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Top' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"   </Borders>" .
+"   <Interior ss:Color='#FF6600' ss:Pattern='Solid'/>" .
+"  </Style>" .
+
+# UNKNOWN style centered
+
+"  <Style ss:ID='s401centered'>" .
+"   <Alignment ss:Horizontal=\"Center\" ss:Vertical='Top' ss:WrapText='1'/>" .
+"   <Borders>" .
+"    <Border ss:Position='Bottom' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Left' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Right' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Top' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"   </Borders>" .
+"   <Interior ss:Color='#FF6600' ss:Pattern='Solid'/>" .
+"  </Style>" .
+
+
+#NA style centered
+"  <Style ss:ID='s39centered'>" .
+"   <Alignment ss:Horizontal=\"Center\" ss:Vertical='Top' ss:WrapText='1'/>" .
+"   <Borders>" .
+"    <Border ss:Position='Bottom' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Left' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Right' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Top' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"   </Borders>" .
+"  </Style>" .
+
+#summary style
+"  <Style ss:ID='summary'>" .
+"   <Alignment ss:Vertical='Top' ss:WrapText='1'/>" .
+"   <Borders>" .
+"    <Border ss:Position='Bottom' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Left' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Right' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Top' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"   </Borders>" .
+"   <Interior ss:Color='#FFFFFF' ss:Pattern='Solid'/>" .
+"  </Style>" .
+
+#summary real number style
+"  <Style ss:ID='summaryreal'>" .
+"   <NumberFormat ss:Format='Fixed'/> ".
+"   <Alignment ss:Vertical='Top' ss:WrapText='1'/>" .
+"   <Borders>" .
+"    <Border ss:Position='Bottom' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Left' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Right' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Top' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"   </Borders>" .
+"   <Interior ss:Color='#FFFFFF' ss:Pattern='Solid'/>" .
+"  </Style>" .
+
+#summary header
+"  <Style ss:ID='summary_header'>" .
+"   <Alignment ss:Horizontal='Left' ss:Vertical='Bottom'/>" .
+"   <Borders>" .
+"    <Border ss:Position='Bottom' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Right' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Top' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"   </Borders>" .
+"   <Font x:Family='Swiss' ss:Bold='1'/>" .
+"  </Style>" .
+
+#brief header
+"  <Style ss:ID='brief_header'>" .
+"   <Alignment ss:Horizontal='Center' ss:Vertical='Bottom'/>" .
+"   <Borders>" .
+"    <Border ss:Position='Bottom' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Right' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Top' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"   </Borders>" .
+"   <Interior ss:Color='#99CCFF' ss:Pattern='Solid'/>" .
+"  </Style>" .
+
+"  <Style ss:ID='brief_heading_cfgfilename'>" .
+"   <Alignment ss:Vertical='Bottom'/>" .
+"   <Borders>" .
+"    <Border ss:Position='Bottom' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Left' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Right' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"    <Border ss:Position='Top' ss:LineStyle='Continuous' ss:Weight='1'/>" .
+"   </Borders>" .
+"   <Font x:Family='Swiss' ss:Bold='1'/>" .
+"   <Interior ss:Color='#CCFFCC' ss:Pattern='Solid'/>" .
+"  </Style>" .
+
+#link
+"  <Style ss:ID='urlparent' ss:Name='Hyperlink'>" .
+"   <Font ss:Color='#0000FF' ss:Underline='Single'/>" .
+"  </Style>" .
+
+"  <Style ss:ID='url' ss:Parent='urlparent'>" .
+"   <Interior ss:Color='#FFFFFF' ss:Pattern='Solid'/>" .
+"  </Style>" .
+
+" </Styles>" .
+" <Worksheet ss:Name='Sheet1'>";
+
+$xmlHeaderTableColumns =
+"  <Table ss:ExpandedColumnCount='18' ss:ExpandedRowCount='CASE_COUNT_MUL8' x:FullColumns='1'" .
+"   x:FullRows='1'>" .
+"   <Column ss:AutoFitWidth='0' ss:Width='138.75'/>" .
+"   <Column ss:Index='3' ss:AutoFitWidth='0' ss:Width='39'/>" .
+"   <Column ss:Index='5' ss:AutoFitWidth='0' ss:Width='39'/>" .
+"   <Column ss:Index='7' ss:AutoFitWidth='0' ss:Width='39'/>" .
+"   <Column ss:Index='16' ss:AutoFitWidth='0' ss:Width='26.25'/>" .
+"   <Column ss:AutoFitWidth='0' ss:Width='15'/>" .
+"   <Column ss:AutoFitWidth='0' ss:Width='525.75'/>\n\n";
+
+$xmlHeaderTableColumnsBrief =
+"  <Table ss:ExpandedColumnCount='25' ss:ExpandedRowCount='CASE_COUNT_MUL8' x:FullColumns='1'" .
+"   x:FullRows='1'>" .
+"   <Column ss:AutoFitWidth='0' ss:Width='138.75'/>" .
+"   <Column ss:Index='2' ss:AutoFitWidth='0' ss:Width='39'/>" .
+"   <Column ss:Index='3' ss:AutoFitWidth='0' ss:Width='39'/>" .
+"   <Column ss:Index='4' ss:AutoFitWidth='0' ss:Width='39'/>" .
+"   <Column ss:Index='5' ss:AutoFitWidth='0' ss:Width='39'/>" .
+"   <Column ss:Index='6' ss:AutoFitWidth='0' ss:Width='39'/>" .
+"   <Column ss:Index='7' ss:AutoFitWidth='0' ss:Width='65'/>" . #status
+"   <Column ss:Index='8' ss:AutoFitWidth='0' ss:Width='39'/>" .
+"   <Column ss:Index='9' ss:AutoFitWidth='0' ss:Width='39'/>" .
+"   <Column ss:Index='12' ss:AutoFitWidth='0' ss:Width='260'/>" . # info
+"   <Column ss:Index='13' ss:AutoFitWidth='0' ss:Width='26.25'/>" . # link1
+"   <Column ss:Index='14' ss:AutoFitWidth='0' ss:Width='26.25'/>" . # link2
+"   <Column ss:Index='16' ss:AutoFitWidth='0' ss:Width='26.25'/>" .
+"   <Column ss:AutoFitWidth='0' ss:Width='15'/>" .
+"   <Column ss:AutoFitWidth='0' ss:Width='525.75'/>\n\n";
+
+$xmlHeaderTableColumnsAlt =
+"  <Table ss:ExpandedColumnCount='25' ss:ExpandedRowCount='CASE_COUNT_MUL8' x:FullColumns='1'" .
+"   x:FullRows='1'>" .
+"   <Column ss:AutoFitWidth=\"0\" ss:Width=\"138.75\"/>" .
+"   <Column ss:AutoFitWidth=\"0\" ss:Width=\"30\" ss:Span=\"4\"/>" .
+"   <Column ss:Index=\"7\" ss:AutoFitWidth=\"0\" ss:Width=\"60.00\" ss:Span=\"9\"/>" .
+"   <Column ss:Index=\"17\" ss:AutoFitWidth=\"0\" ss:Width=\"15\"/>" .
+"   <Column ss:AutoFitWidth=\"0\" ss:Width=\"525.75\"/>";
+
+$xmlFooter =
+
+"  </Table>" .
+"  <WorksheetOptions xmlns='urn:schemas-microsoft-com:office:excel'>" .
+
+#splitted panes
+#"  <Selected/>" .
+#"   <SplitHorizontal>3060</SplitHorizontal>" .
+#"   <TopRowBottomPane>11</TopRowBottomPane>" .
+#"   <ActivePane>2</ActivePane>" .
+#"   <Panes>" .
+#"    <Pane>" .
+#"     <Number>3</Number>" .
+#"    </Pane>" .
+#"    <Pane>" .
+#"     <Number>2</Number>" .
+#"     <RangeSelection>R12C1:R12C8</RangeSelection>" .
+#"    </Pane>" .
+#"   </Panes>" .
+
+#not splitted
+"   <Selected/>" .
+"   <Panes>" .
+"    <Pane>" .
+"     <Number>3</Number>" .
+"     <ActiveRow>7</ActiveRow>" .
+"     <ActiveCol>2</ActiveCol>" .
+"    </Pane>" .
+"   </Panes>" .
+
+"   <ProtectObjects>False</ProtectObjects>" .
+"   <ProtectScenarios>False</ProtectScenarios>" .
+"  </WorksheetOptions>" .
+" </Worksheet>" .
+" <Worksheet ss:Name='Sheet2'>" .
+"  <WorksheetOptions xmlns='urn:schemas-microsoft-com:office:excel'>" .
+"   <ProtectObjects>False</ProtectObjects>" .
+"   <ProtectScenarios>False</ProtectScenarios>" .
+"  </WorksheetOptions>" .
+" </Worksheet>" .
+" <Worksheet ss:Name='Sheet3'>" .
+"  <WorksheetOptions xmlns='urn:schemas-microsoft-com:office:excel'>" .
+"   <ProtectObjects>False</ProtectObjects>" .
+"   <ProtectScenarios>False</ProtectScenarios>" .
+"  </WorksheetOptions>" .
+" </Worksheet>" .
+"</Workbook>\n\n";
+
+$xmlDataEmptyRow =
+"   <Row>" .
+"    <Cell ss:StyleID='s35'><Data ss:Type='String'></Data></Cell>" .
+"    <Cell ss:StyleID='s35'/>" .
+"    <Cell ss:StyleID='s35'/>" .
+"    <Cell ss:StyleID='s35'/>" .
+"    <Cell ss:StyleID='s35'/>" .
+"    <Cell ss:StyleID='s35'/>" .
+"    <Cell ss:StyleID='s35'/>" .
+"    <Cell ss:StyleID='s35'/>" .
+"    <Cell ss:StyleID='s35'/>" .
+"    <Cell ss:StyleID='s35'/>" .
+"    <Cell ss:StyleID='s35'/>" .
+"    <Cell ss:StyleID='s35'/>" .
+"    <Cell ss:StyleID='s35'/>" .
+"    <Cell ss:StyleID='s35'/>" .
+"    <Cell ss:StyleID='s35'/>" .
+"    <Cell ss:StyleID='s35'/>" .
+"    <Cell ss:StyleID='s35'/>" .
+"    <Cell ss:StyleID='s35'/>" .
+"   </Row>\n\n";
+
+$xmlSummaryData =
+
+$xmlDataEmptyRow .
+
+"   <Row>" .
+"    <Cell ss:StyleID='s35' ss:MergeAcross='20'>" . "<Data ss:Type='String'>INSERT TEST SOFTWARE HERE</Data></Cell>" .
+"   </Row>\n\n" .
+
+"   <Row>" .
+"    <Cell ss:StyleID='s35' ss:MergeAcross='20'>" . "<Data ss:Type='String'>INSERT TEST DEVICE HERE</Data></Cell>" .
+"   </Row>\n\n" .
+
+$xmlDataEmptyRow .
+
+"   <Row>\n" .
+"    <Cell ss:MergeAcross='4' ss:StyleID='summary_header'><Data ss:Type='String'>Test Execution Metrics</Data></Cell>" .
+"    <Cell ss:MergeAcross='12' ss:StyleID='s35'/>\n" .
+"   </Row>\n" .
+"   <Row>\n" .
+"    <Cell ss:StyleID='s25'><Data ss:Type='String'>Total cases:</Data></Cell>" .
+"    <Cell ss:MergeAcross='3' ss:StyleID='summary'><Data ss:Type='Number'>$xmlDataSummaryCaseCount</Data></Cell>" .
+"    <Cell ss:MergeAcross='12' ss:StyleID='s35'/>\n" .
+"   </Row>\n" .
+"   <Row>\n" .
+"    <Cell ss:StyleID='s25'><Data ss:Type='String'>Passed:</Data></Cell>" .
+"    <Cell ss:MergeAcross='3' ss:StyleID='summary'><Data ss:Type='Number'>$xmlDataSummaryPassed</Data></Cell>" .
+"    <Cell ss:MergeAcross='12' ss:StyleID='s35'/>\n" .
+"   </Row>\n" .
+"   <Row>\n" .
+"    <Cell ss:StyleID='s25'><Data ss:Type='String'>Failed:</Data></Cell>" .
+"    <Cell ss:MergeAcross='3' ss:StyleID='summary'><Data ss:Type='Number'>$xmlDataSummaryFailed</Data></Cell>" .
+"    <Cell ss:MergeAcross='12' ss:StyleID='s35'/>\n" .
+"   </Row>\n" .
+"   <Row>\n" .
+"    <Cell ss:StyleID='s25'><Data ss:Type='String'>Crashed:</Data></Cell>" .
+"    <Cell ss:MergeAcross='3' ss:StyleID='summary'><Data ss:Type='Number'>$xmlDataSummaryCrashed</Data></Cell>" .
+"    <Cell ss:MergeAcross='12' ss:StyleID='s35'/>\n" .
+"   </Row>\n" .
+"   <Row>\n" .
+"    <Cell ss:StyleID='s25'><Data ss:Type='String'>Timeout:</Data></Cell>" .
+"    <Cell ss:MergeAcross='3' ss:StyleID='summary'><Data ss:Type='Number'>$xmlDataSummaryTimeout</Data></Cell>" .
+"    <Cell ss:MergeAcross='12' ss:StyleID='s35'/>\n" .
+"   </Row>\n" .
+"   <Row>\n" .
+"    <Cell ss:StyleID='s25'><Data ss:Type='String'>Pass rate % (total cases):</Data></Cell>" .
+"    <Cell ss:MergeAcross='3' ss:StyleID='summaryreal'><Data ss:Type='Number'>$xmlDataSummaryPassRateTotal</Data></Cell>" .
+"    <Cell ss:MergeAcross='12' ss:StyleID='s35'/>\n" .
+"   </Row>\n" .
+"   <Row>\n" .
+"    <Cell ss:StyleID='s25'><Data ss:Type='String'>Pass rate % (run cases):</Data></Cell>" .
+"    <Cell ss:MergeAcross='3' ss:StyleID='summaryreal'><Data ss:Type='Number'>$xmlDataSummaryPassRateRun</Data></Cell>" .
+"    <Cell ss:MergeAcross='12' ss:StyleID='s35'/>\n" .
+"   </Row>\n" .
+"   <Row>\n" .
+"    <Cell ss:StyleID='s25'><Data ss:Type='String'>Run rate %:</Data></Cell>" .
+"    <Cell ss:MergeAcross='3' ss:StyleID='summaryreal'><Data ss:Type='Number'>$xmlDataSummaryRunRate</Data></Cell>" .
+"    <Cell ss:MergeAcross='12' ss:StyleID='s35'/>\n" .
+"   </Row>\n" .
+ $xmlDataEmptyRow;
+
+$xmlData =
+"   <Row>" .
+"    <Cell ss:StyleID='s21'><Data ss:Type='String'>Name:</Data></Cell>" .
+"    <Cell ss:MergeAcross='15' ss:StyleID='m155266416'><Data ss:Type='String'>XML_DATA_CASE_NAME</Data></Cell>" .
+"    <Cell ss:StyleID='s35'/>" .
+"   </Row>";
+
+# not included in the case documentation report
+$xmlDataCaseStatusDisabled =
+"   <Row>" .
+"    <Cell ss:StyleID='s25'><Data ss:Type='String'>Run times:</Data></Cell>" .
+"    <Cell ss:StyleID='s26'><Data ss:Type='Number'>XML_DATA_CASE_RUN_TIMES</Data></Cell>" .
+#
+"    <Cell ss:StyleID='s27'><Data ss:Type='String'>Crashed</Data></Cell>" .
+"    <Cell ss:StyleID='s28'><Data ss:Type='Number'>XML_DATA_CASE_CRASHED</Data></Cell>" .
+
+"    <Cell ss:StyleID='s27'><Data ss:Type='String'>Failed</Data></Cell>" .
+"    <Cell ss:StyleID='s28'><Data ss:Type='Number'>XML_DATA_CASE_FAILED</Data></Cell>" .
+"    <Cell ss:StyleID='s27'><Data ss:Type='String'>Passed</Data></Cell>" .
+"    <Cell ss:StyleID='s28'><Data ss:Type='Number'>XML_DATA_CASE_PASSED</Data></Cell>" .
+"    <Cell ss:StyleID='s27'><Data ss:Type='String'>Status</Data></Cell>" .
+#orig status style id s28
+"    <Cell ss:StyleID='STYLE_ID_STATUS'><Data ss:Type='String'>XML_DATA_CASE_STATUS</Data></Cell>" .
+"    <Cell ss:StyleID='s28'/>" .
+"    <Cell ss:StyleID='s28'/>" .
+"    <Cell ss:StyleID='s28'/>" .
+"    <Cell ss:StyleID='s28'/>" .
+"    <Cell ss:StyleID='s28'/>" .
+"    <Cell ss:StyleID='s28'/>" .
+"    <Cell ss:StyleID='s28'/>" .
+#"    <Cell ss:StyleID='s28'/>" .
+#"    <Cell ss:StyleID='s29'/>" .
+"    <Cell ss:StyleID='s35'/>" .
+"   </Row>\n\n";
+$xmlDataCaseStatusDisabled .= "";
+
+$xmlData2 =
+"   <Row ss:AutoFitHeight='0' ss:Height='30'>" .
+"    <Cell ss:StyleID='s30'><Data ss:Type='String'>Purpose:</Data></Cell>" .
+"    <Cell ss:MergeAcross='15' ss:StyleID='m155266426'><Data ss:Type='String'>XML_DATA_CASE_PURPOSE</Data></Cell>" .
+"    <Cell ss:StyleID='s35'/>" .
+"   </Row>" .
+"   <Row ss:AutoFitHeight='0' ss:Height='30'>" .
+"    <Cell ss:StyleID='s30'><Data ss:Type='String'>Means:</Data></Cell>" .
+"    <Cell ss:MergeAcross='15' ss:StyleID='m155266436'><Data ss:Type='String'>XML_DATA_CASE_MEANS</Data></Cell>" .
+"    <Cell ss:StyleID='s35'/>" .
+"   </Row>" .
+"   <Row ss:AutoFitHeight='0' ss:Height='30'>" .
+"    <Cell ss:StyleID='s30'><Data ss:Type='String'>Required environment settings:</Data></Cell>" .
+"    <Cell ss:MergeAcross='15' ss:StyleID='m155266446'><Data ss:Type='String'>XML_DATA_CASE_REQUIRED_SETTINGS</Data></Cell>" .
+"    <Cell ss:StyleID='s35'/>" .
+"   </Row>" .
+"   <Row ss:AutoFitHeight='0' ss:Height='30'>" .
+"    <Cell ss:StyleID='s30'><Data ss:Type='String'>Related requirements:</Data></Cell>" .
+"    <Cell ss:MergeAcross='15' ss:StyleID='m155266446'><Data ss:Type='String'>XML_DATA_CASE_RELATED_REQUIREMENTS</Data></Cell>" .
+"    <Cell ss:StyleID='s35'/>" .
+"   </Row>" .
+
+"   <Row ss:AutoFitHeight='0' ss:Height='30'>" .
+"    <Cell ss:StyleID='s30'><Data ss:Type='String'>Verification:</Data></Cell>" .
+"    <Cell ss:MergeAcross='15' ss:StyleID='m155260432'><Data ss:Type='String'>XML_DATA_CASE_VERIFICATION</Data></Cell>" .
+"    <Cell ss:StyleID='s35'/>" .
+"   </Row>" .
+"   <Row ss:AutoFitHeight='0' ss:Height='30'>" .
+"    <Cell ss:StyleID='s34'><Data ss:Type='String'>Note:</Data></Cell>" .
+"    <Cell ss:MergeAcross='15' ss:StyleID='m155260442'><Data ss:Type='String'>XML_DATA_CASE_NOTE</Data></Cell>" .
+"    <Cell ss:StyleID='s35'/>" .
+"   </Row>\n\n";
+
+
+$xmlDataBriefHeader =
+"   <Row>" .
+"    <Cell ss:MergeAcross='5' ss:StyleID='brief_header'><Data ss:Type='String'>Name</Data></Cell>" .
+"    <Cell ss:StyleID='brief_header'><Data ss:Type='String'>Status</Data></Cell>" .
+"    <Cell ss:StyleID='brief_header'><Data ss:Type='String'>Passes</Data></Cell>" .
+"    <Cell ss:StyleID='brief_header'><Data ss:Type='String'>Fails</Data></Cell>" .
+"    <Cell ss:StyleID='brief_header'><Data ss:Type='String'>Crashes</Data></Cell>" .
+"    <Cell ss:StyleID='brief_header'><Data ss:Type='String'>Result</Data></Cell>" .
+"    <Cell ss:StyleID='brief_header'><Data ss:Type='String'>Info</Data></Cell>" .
+"    <Cell ss:MergeAcross='6' ss:StyleID='s35'/>" .
+"   </Row>\n\n";
+
+$xmlDataBriefNoLinks =
+"   <Row>\n" .
+"    <Cell ss:MergeAcross='5' ss:StyleID='m155266416'><Data ss:Type='String'>XML_DATA_CASE_NAME</Data></Cell>\n" .
+"    <Cell ss:StyleID='STYLE_ID_STATUS'><Data ss:Type='String'>XML_DATA_CASE_STATUS</Data></Cell>\n" .
+"    <Cell ss:StyleID='s39'><Data ss:Type='Number'>XML_DATA_CASE_PASSED</Data></Cell>\n" .
+"    <Cell ss:StyleID='s39'><Data ss:Type='Number'>XML_DATA_CASE_FAILED</Data></Cell>\n" .
+"    <Cell ss:StyleID='s39'><Data ss:Type='Number'>XML_DATA_CASE_CRASHED</Data></Cell>\n" .
+"    <Cell ss:StyleID='s39'><Data ss:Type='Number'>XML_DATA_CASE_RESULT</Data></Cell>\n" .
+"    <Cell ss:StyleID='s39'><Data ss:Type='String'>XML_DATA_CASE_REASON</Data></Cell>\n" .
+"    <Cell ss:MergeAcross='7' ss:StyleID='s35'/>\n" .
+"   </Row>\n\n";
+
+$xmlDataBrief1Link =
+"   <Row>\n" .
+"    <Cell ss:MergeAcross='5' ss:StyleID='m155266416'><Data ss:Type='String'>XML_DATA_CASE_NAME</Data></Cell>\n" .
+"    <Cell ss:StyleID='STYLE_ID_STATUS'><Data ss:Type='String'>XML_DATA_CASE_STATUS</Data></Cell>\n" .
+"    <Cell ss:StyleID='s39'><Data ss:Type='Number'>XML_DATA_CASE_PASSED</Data></Cell>\n" .
+"    <Cell ss:StyleID='s39'><Data ss:Type='Number'>XML_DATA_CASE_FAILED</Data></Cell>\n" .
+"    <Cell ss:StyleID='s39'><Data ss:Type='Number'>XML_DATA_CASE_CRASHED</Data></Cell>\n" .
+"    <Cell ss:StyleID='s39'><Data ss:Type='Number'>XML_DATA_CASE_RESULT</Data></Cell>\n" .
+"    <Cell ss:StyleID='s39'><Data ss:Type='String'>XML_DATA_CASE_REASON</Data></Cell>\n" .
+"    <Cell ss:StyleID='url' ss:HRef='XML_DATA_CASE_LINK1'><Data ss:Type='String'>Link</Data></Cell>\n" .
+"    <Cell ss:MergeAcross='6' ss:StyleID='s35'/>\n" .
+"   </Row>\n\n";
+
+$xmlDataBrief2Links =
+"   <Row>\n" .
+"    <Cell ss:MergeAcross='5' ss:StyleID='m155266416'><Data ss:Type='String'>XML_DATA_CASE_NAME</Data></Cell>\n" .
+"    <Cell ss:StyleID='STYLE_ID_STATUS'><Data ss:Type='String'>XML_DATA_CASE_STATUS</Data></Cell>\n" .
+"    <Cell ss:StyleID='s39'><Data ss:Type='Number'>XML_DATA_CASE_PASSED</Data></Cell>\n" .
+"    <Cell ss:StyleID='s39'><Data ss:Type='Number'>XML_DATA_CASE_FAILED</Data></Cell>\n" .
+"    <Cell ss:StyleID='s39'><Data ss:Type='Number'>XML_DATA_CASE_CRASHED</Data></Cell>\n" .
+"    <Cell ss:StyleID='s39'><Data ss:Type='Number'>XML_DATA_CASE_RESULT</Data></Cell>\n" .
+"    <Cell ss:StyleID='s39'><Data ss:Type='String'>XML_DATA_CASE_REASON</Data></Cell>\n" .
+"    <Cell ss:StyleID='url' ss:HRef='XML_DATA_CASE_LINK1'><Data ss:Type='String'>Link</Data></Cell>\n" .
+"    <Cell ss:StyleID='url' ss:HRef='XML_DATA_CASE_LINK2'><Data ss:Type='String'>Link</Data></Cell>\n" .
+"    <Cell ss:MergeAcross='5' ss:StyleID='s35'/>\n" .
+"   </Row>\n\n";
+
+$xmlCfgFileBrief =
+"   <Row>" .
+"    <Cell ss:MergeAcross='11' ss:StyleID='brief_heading_cfgfilename'><Data ss:Type='String'>XML_DATA_CFG_FILE</Data></Cell>" .
+"    <Cell ss:MergeAcross='6' ss:StyleID='s35'/>" .
+"   </Row>\n\n";
+
+
+$xmlCfgFileAltHeader =
+"   <Row>" .
+"    <Cell ss:MergeAcross='5' ss:StyleID='brief_header'><Data ss:Type='String'>Name</Data></Cell>" .
+"    <Cell ss:StyleID='brief_header'><Data ss:Type='String'>XML_DATA_ALTDATE1</Data></Cell>" .
+"    <Cell ss:StyleID='brief_header'><Data ss:Type='String'>XML_DATA_ALTDATE2</Data></Cell>" .
+"    <Cell ss:StyleID='brief_header'><Data ss:Type='String'>XML_DATA_ALTDATE3</Data></Cell>" .
+"    <Cell ss:StyleID='brief_header'><Data ss:Type='String'>XML_DATA_ALTDATE4</Data></Cell>" .
+"    <Cell ss:StyleID='brief_header'><Data ss:Type='String'>XML_DATA_ALTDATE5</Data></Cell>" .
+"    <Cell ss:StyleID='brief_header'><Data ss:Type='String'>XML_DATA_ALTDATE6</Data></Cell>" .
+"    <Cell ss:StyleID='brief_header'><Data ss:Type='String'>XML_DATA_ALTDATE7</Data></Cell>" .
+"    <Cell ss:StyleID='brief_header'><Data ss:Type='String'>XML_DATA_ALTDATE8</Data></Cell>" .
+"    <Cell ss:StyleID='brief_header'><Data ss:Type='String'>XML_DATA_ALTDATE9</Data></Cell>" .
+"    <Cell ss:StyleID='brief_header'><Data ss:Type='String'>XML_DATA_ALTDATE10</Data></Cell>" .
+"    <Cell ss:MergeAcross='6' ss:StyleID='s35'/>" .
+"   </Row>\n\n";
+
+
+$xmlCfgFileAltData =
+"   <Row>" .
+"    <Cell ss:MergeAcross='5' ss:StyleID='m155266416'><Data ss:Type='String'>XML_DATA_CASE_NAME</Data></Cell>\n" .
+"    <Cell ss:StyleID='STYLE_ID_STATUS'><Data ss:Type='Number'>XML_DATA_ALTRESULT1</Data></Cell>" .
+"    <Cell ss:StyleID='STYLE_ID_STATUS'><Data ss:Type='Number'>XML_DATA_ALTRESULT2</Data></Cell>" .
+"    <Cell ss:StyleID='STYLE_ID_STATUS'><Data ss:Type='Number'>XML_DATA_ALTRESULT3</Data></Cell>" .
+"    <Cell ss:StyleID='STYLE_ID_STATUS'><Data ss:Type='Number'>XML_DATA_ALTRESULT4</Data></Cell>" .
+"    <Cell ss:StyleID='STYLE_ID_STATUS'><Data ss:Type='Number'>XML_DATA_ALTRESULT5</Data></Cell>" .
+"    <Cell ss:StyleID='STYLE_ID_STATUS'><Data ss:Type='Number'>XML_DATA_ALTRESULT6</Data></Cell>" .
+"    <Cell ss:StyleID='STYLE_ID_STATUS'><Data ss:Type='Number'>XML_DATA_ALTRESULT7</Data></Cell>" .
+"    <Cell ss:StyleID='STYLE_ID_STATUS'><Data ss:Type='Number'>XML_DATA_ALTRESULT8</Data></Cell>" .
+"    <Cell ss:StyleID='STYLE_ID_STATUS'><Data ss:Type='Number'>XML_DATA_ALTRESULT9</Data></Cell>" .
+"    <Cell ss:StyleID='STYLE_ID_STATUS'><Data ss:Type='Number'>XML_DATA_ALTRESULT10</Data></Cell>" .
+"    <Cell ss:MergeAcross='6' ss:StyleID='s35'/>" .
+"   </Row>\n\n";
+
+} # sub InitXml
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/testing/tools/tsrpkgtool.pl	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,152 @@
+#
+# 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 "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: 
+#
+
+
+#------------------------------------------------------------------------------------
+# Includes
+#------------------------------------------------------------------------------------
+#use strict;
+use warnings;
+use Cwd; # for cwd
+use FindBin; # for FindBin:Bin
+use File::Path; # for mkpath
+use Date::Calc;
+
+#------------------------------------------------------------------------------------
+# GLOBAL CODE
+#------------------------------------------------------------------------------------
+
+my $option = "";
+$option = shift(@ARGV) if( scalar(@ARGV) > 0 );
+
+if( $option =~ m/\-h/i )
+{
+    print(
+    "tsrcpkgtool.pl\n" . 
+    " Toggles comments in all pkgs under tsrc folders for lines \n" .
+    " which have testframework.ini or cccccc00.cre cenrep.\n" . 
+    " Options:\n" . 
+    "  -h help\n  -r remove only\n  -a add only\n" );    
+    exit;
+} 
+
+my @files;
+FindFiles(".", ".pkg", 1, \@files);
+FindFiles(".", ".inf", 1, \@files);
+
+my $comment = ";TEMPCOMMENT ";
+my $comment_inf = "//TEMPCOMMENT ";
+
+
+foreach my $file ( @files )
+{
+    if( $file =~ m/\/tsrc\//i )
+    {
+        open(FILE_HANDLE, $file) or die ("Could not read file '$file'\n");
+        my @lines = <FILE_HANDLE>;
+	    close(FILE_HANDLE);
+	    
+	    open(FILE_HANDLE, ">$file") or die ("Could not write file '$file'\n");
+	    foreach my $line ( @lines )
+	    {
+	        if( $line =~ /\.\.\/init\/testframework\.ini/i or $line =~ /\/cccccc00\.cre/i or
+	            $line =~ /\.\.\\init\\testframework\.ini/i or $line =~ /\\cccccc00\.cre/i )
+	        {
+	            my $filename = $file;
+	            $filename =~ s/\//\\/g;
+	            $filename = substr( $filename, rindex( $filename, "\\" )+1 );
+	            	            
+	            if( $line =~ /$comment/ )
+	            {
+	                if( $option ne "-a" )
+	                {
+	                    # Remove comment.
+	                    $line = substr( $line, length( $comment ) );
+	                    print("Removed comment: $filename.\n");
+	                }
+	            }
+	            elsif( $line =~ /$comment_inf/ )
+	            {
+	                if( $option ne "-a" )
+	                {
+	                    # Remove comment.
+	                    $line = substr( $line, length( $comment_inf ) );
+	                    print("Removed comment: $filename.\n");
+	                }
+	            }
+	            else
+	            {
+	                if( $option ne "-r" )
+	                {
+    	                # Add comment.
+    	                if( $filename =~ /\.inf/ ) {
+												$line = $comment_inf . $line;
+											}
+											else {
+												$line = $comment . $line;
+											}
+	                    print("Added comment: $filename.\n");
+	                }
+	            }
+	        }
+	        print FILE_HANDLE $line;
+	    }	    
+	    close(FILE_HANDLE);
+    }
+}
+
+#------------------------------------------------------------------------------------
+# FindFiles
+# Parameters:
+#	$goDir, where to start finding
+#	$fileSearch, filename search
+#	$searchType, 0 = fullname search, 1 = filetype search
+#	$refIncfiles, reference to array which will hold found files
+#------------------------------------------------------------------------------------
+sub FindFiles
+{
+	my ($godir, $fileSearch, $searchType, $refIncfiles) = @_;
+
+	my $startDir = cwd;
+
+	chdir($godir);
+
+	#print("Now in: " . cwd . "\n");
+
+	opendir(DIR, ".");
+	my @filelist = sort(readdir(DIR));
+	closedir(DIR);
+
+	foreach my $file(@filelist)
+	{
+		if($file eq "." or $file eq "..") {next};
+
+		if (-d $file)
+		{
+		 	FindFiles( $file, $fileSearch, $searchType, $refIncfiles);
+		} else
+		{
+			if( ($file =~ m/$fileSearch/i and $searchType == 0 ) or ($file =~ m/$fileSearch$/i and $searchType == 1 ) )
+			{
+                $file = cwd . "/" . $file;
+				push @$refIncfiles, $file;
+				#print("$file\n");
+			}
+		}
+	}
+
+	chdir ($startDir);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/testing/tools/updateHeliumCfgs.pl	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,423 @@
+#
+# 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 "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: 
+#
+
+
+#------------------------------------------------------------------------------------
+# Includes
+#------------------------------------------------------------------------------------
+#use strict;
+use warnings;
+use Cwd; # for cwd
+use FindBin; # for FindBin:Bin
+use File::Path; # for mkpath
+use Date::Calc;
+
+{ # No globals.
+    # Solve where the script is located.
+    $0=~/^(.+[\\\/])[^\\\/]+[\\\/]*$/;
+    my $cgidir= $1 || "./";
+    
+    # And try to solve relative path.
+    if( index( $cgidir, "..\\" ) != -1 )
+    {
+    	my $p = cwd;
+    	$p =~ s/\//\\/g;
+    	$cgidir =~ s/\//\\/g;
+    	while(1) 
+    	{
+    		my $pos = index( $cgidir, "..\\" );
+    		last if( $pos == -1 );
+    		$cgidir = substr( $cgidir, $pos+3 );
+    		
+    		$pos = rindex( $p, "\\" );
+    		last if( $pos == -1 );
+    		$p = substr( $p, 0, $pos);
+    	}
+    	$cgidir = $p . "\\" . $cgidir;
+    }
+    
+    if ( ! -e( $cgidir . "rerunsubs.pl" ) )
+    {
+        $cgidir = cwd;
+        my $domain = "VideoApp_Domain";
+        my $pos = index( $cgidir, $domain );
+        if( $pos != -1 )
+        {
+            $cgidir = substr( $cgidir, 0, $pos + length( $domain ) ) . "\\videoplayer\\tsrc\\testing\\tools\\";
+            
+        }
+    }
+    require( $cgidir . "utils.pl" );
+}
+
+#------------------------------------------------------------------------------------
+# GLOBAL CODE
+#------------------------------------------------------------------------------------
+
+my $argcount = scalar(@ARGV);
+
+while(scalar(@ARGV) >= 1)
+{
+	my $argument = shift(@ARGV);
+
+	if($argument eq "-h")
+	{
+		Help();
+		die;
+	}
+	else  {
+        Help();
+		die;
+	}
+}
+
+sub Help
+{
+    print("\nThis script updates test cases in *Helium.cfg files. First it reads all the CFGs from the same folder and then writes new *Helium.CFG\n");
+    exit;
+}
+
+
+UpdateHeliumCfgs();
+
+exit;
+
+sub UpdateHeliumCfgs
+{
+    my @cfgFiles;
+    
+    FindFiles( ".", "Helium.cfg", 0, \@cfgFiles );
+    
+    foreach my $file ( @cfgFiles )
+    {
+        print("Updating $file.\n");
+        UpdateHeliumCfg( $file );
+    }
+}
+
+sub UpdateHeliumCfg
+{
+    my ( $fileName ) = @_;
+    
+    my $file = GetPathFileName( $fileName );
+    my $path = GetPathDir( $fileName );
+    
+    # Read the cfg.
+	open(FILE_HANDLE, $fileName) or die ("ERROR! Could not open file $fileName\n");
+	my @heliumCfgLines = <FILE_HANDLE>;
+	close(FILE_HANDLE);    
+
+    # Find all cases in the cfg.
+    my @heliumCases;
+
+    foreach my $line ( @heliumCfgLines )
+    {
+        if( $line =~ m/^title /i )
+        {
+            push @heliumCases, ( $line );
+        }
+    }
+    
+    # Get all cfgs in same dir as the Helium cfg.
+    my @cfgs;
+    FindFiles( $path, ".cfg", 0, \@cfgs );
+    
+    # Get all cfgs that have cases in Helium cfg.
+    my @cfgsWithHeliumCases;
+    
+    foreach my $cfg ( @cfgs )
+    {
+        # Do not read cases again from helium cfg.
+        next if( $cfg =~ /helium\.cfg/i );
+        
+        my $cfgHasCasesForHelium = 0;
+        
+        foreach my $heliumCase ( @heliumCases )
+        {
+            if( CfgHasCase( $cfg, $heliumCase ) )
+            {
+                $cfgHasCasesForHelium = 1;
+                last;
+            }
+        }
+        
+        if( $cfgHasCasesForHelium )
+        {
+            push @cfgsWithHeliumCases, ( $cfg );
+        }
+    }
+    
+    # Read cases, defs and subs 
+    my @cfgDefsAndIncludes;
+    my @cfgSubs;
+    my @cfgCases;
+
+    foreach my $cfg ( @cfgsWithHeliumCases )
+    {
+        print("Reading: " . GetPathFileName($cfg) . "\n");
+        ReadCfgDefs( $cfg, \@cfgDefsAndIncludes );
+        ReadCfgSubs( $cfg, \@cfgSubs );
+        ReadCfgCases( $cfg, \@cfgCases, \@heliumCases );
+    }
+    
+    # Write the helium CFG.
+    open(FILE_HANDLE, ">$fileName") or die("Could not write into file $fileName\n");
+    
+    # Write everything from helium CFG before the first defs.
+    foreach my $line ( @heliumCfgLines )
+    {
+        if( $line =~ m/\[Define\]/ )
+        {
+            last; 
+        }
+        print FILE_HANDLE ( $line );
+    }
+    
+    # Write defs, includes and subs.
+    print FILE_HANDLE ( @cfgDefsAndIncludes );
+    print FILE_HANDLE ( "\n" );
+    print FILE_HANDLE ( @cfgSubs );
+    print FILE_HANDLE ( "\n" );
+    
+    # Write cases, in same order as they were.
+    foreach my $heliumCase ( @heliumCases )
+    {
+        my $caseFound = 0;
+        
+        foreach my $refCase ( @cfgCases )
+        {
+            if( @$refCase[0] eq $heliumCase )
+            {
+                my $refCaseLines = @$refCase[1];
+                print FILE_HANDLE ( @$refCaseLines );
+                $caseFound = 1;
+                last;
+            }
+        }
+        
+        if( $caseFound )
+        {
+            print FILE_HANDLE ( "\n" );
+        }
+        else
+        {
+            print(" - the cfg has following case but it was not found from other CFGs: $heliumCase\n");
+        }
+    }
+    
+    close( FILE_HANDLE );
+}
+
+sub CfgHasCase
+{
+    my ( $cfgFileName, $case ) = @_;
+    
+	open(FILE_HANDLE, $cfgFileName) or die ("ERROR! Could not open file $cfgFileName\n");
+	my @lines = <FILE_HANDLE>;
+	close(FILE_HANDLE);    
+	
+	foreach my $line ( @lines )
+	{
+	    if( $line =~ m/$case/i )
+	    {
+	        return 1;
+	    }
+	}	
+	return 0;
+}
+
+sub ReadCfgDefs
+{
+    my ( $cfgFileName, $refDefsAndIncludes ) = @_;
+    
+	open(FILE_HANDLE, $cfgFileName) or die ("ERROR! Could not open file $cfgFileName\n");
+	my @lines = <FILE_HANDLE>;
+	close(FILE_HANDLE);    
+
+	my $readLines = 0;
+	foreach my $line ( @lines )
+	{
+	    # Defs starts here.
+	    if( $line =~ m/\[Define\]/ )
+	    {
+	        $readLines = 1;
+	    }
+	    
+	    # Reading the defs.
+	    if( $readLines )
+	    {
+	        my $alreadyHaveThisLine = 0;
+	        
+	        # Check if we got the line already.
+	        foreach my $defLine ( @$refDefsAndIncludes )
+	        {
+	            if( $defLine eq $line )
+	            {
+	                $alreadyHaveThisLine = 1;
+	            }
+	        }
+	        
+	        # If not, save it.
+	        if( !$alreadyHaveThisLine )
+	        {
+	            print(" - Def: $line");
+	            push @$refDefsAndIncludes, ( $line );
+	        }
+	    }
+	    
+	    # End of defs.
+	    if( $line =~ m/\[Enddefine\]/ )
+	    {
+	        return;
+	    }
+	}
+}
+
+sub ReadCfgSubs
+{
+    my ( $cfgFileName, $refSubs ) = @_;
+    
+	open(FILE_HANDLE, $cfgFileName) or die ("ERROR! Could not open file $cfgFileName\n");
+	my @lines = <FILE_HANDLE>;
+	close(FILE_HANDLE);
+	
+	my $inSub = 0;
+	foreach my $line ( @lines )
+	{
+	    # A sub function starts here.
+	    if( $line =~ m/\[Sub/ )
+	    {
+	        $inSub = 1;
+            # Check if we got it already.
+	        foreach my $subLine ( @$refSubs )
+	        {
+	            if( $subLine =~ m/\[Sub/ && $subLine eq $line )
+	            {
+	                $inSub = 0; # Sub with same name has been already read.
+	                last; # Breakout from checking.
+	            }
+	        }
+	        if( $inSub )
+	        {
+	            print(" - Sub: $line");
+	        }
+	    }
+	    
+	    # Reading sub.
+	    if( $inSub )
+	    {
+	        push @$refSubs, ( $line );
+	    }
+	    
+	    # Sub ends here.
+	    if( $line =~ m/\[EndSub\]/ )
+	    {
+	        $inSub = 0;
+	    }
+	}
+}
+
+sub ReadCfgCases
+{
+    my ( $cfgFileName, $refCases, $refCasesToRead ) = @_;
+    
+	open(FILE_HANDLE, $cfgFileName) or die ("ERROR! Could not open file $cfgFileName\n");
+	my @lines = <FILE_HANDLE>;
+	close(FILE_HANDLE);
+	
+	my $inCase = 0;
+	my @caseLines;
+	my $caseTitle;
+
+	foreach my $line ( @lines )
+	{
+	    # Case starts here.
+	    if( $line =~ m/\[Test\]/ )
+	    {
+	        undef( @caseLines );
+	        $caseTitle = "";
+	        $inCase = 1;
+	    }
+	    
+	    # Found title for the case.
+	    if( $line =~ m/^title / )
+	    {
+	        $caseTitle = $line;
+	    }
+	    
+	    # Save case lines.
+	    if( $inCase )
+	    {
+	        push @caseLines, ( $line );
+	    }
+	    
+	    # End of test case.
+	    if( $line =~ m/\[Endtest\]/ )
+	    {
+	        $inCase = 0;
+	        
+	        # Was the case in list of cases to read.
+	        foreach my $heliumCases ( @$refCasesToRead )
+	        {
+	            if( $caseTitle eq $heliumCases )
+	            {
+    	            print(" - Case: $caseTitle");
+
+	                # Yes, save it.
+	                my @case;
+	                $case[0] = $caseTitle;
+	                $case[1] = [ @caseLines ];
+	                push @$refCases, [ @case ];
+	            }
+	        }
+	    }
+	}
+}
+
+sub FindFiles
+{
+	my ($godir, $fileSearch, $searchType, $refIncfiles) = @_;
+
+	my $startDir = cwd;
+
+	chdir($godir);
+
+	#print("Now in: " . cwd . "\n");
+
+	opendir(DIR, ".");
+	my @filelist = sort(readdir(DIR));
+	closedir(DIR);
+
+	foreach my $file(@filelist)
+	{
+		if($file eq "." or $file eq "..") {next};
+
+		if (-d $file)
+		{
+		 	FindFiles( $file, $fileSearch, $searchType, $refIncfiles);
+		} else
+		{
+			if( ($file =~ m/$fileSearch/i and $searchType == 0 ) or ($file =~ m/$fileSearch$/i and $searchType == 1 ) )
+			{
+                $file = cwd . "/" . $file;
+				push @$refIncfiles, $file;
+				#print("$file\n");
+			}
+		}
+	}
+
+	chdir ($startDir);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/testing/tools/utils.pl	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,116 @@
+#
+# 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: 
+#
+
+my $utils_PL_Included = 1; 
+
+#------------------------------------------------------------------------------------
+# GetPathFileName
+#
+# Parameters:
+# 	$str
+#------------------------------------------------------------------------------------
+sub GetPathFileName
+{
+    my ($str) = @_;
+
+    my $startPos = rindex($str, "\\");
+    if($startPos == -1)
+    {
+        $startPos = rindex($str, "/");
+        return $str if($startPos == -1);
+    }
+
+    my $filename = substr($str, $startPos+1);
+
+    return $filename;
+}
+
+#------------------------------------------------------------------------------------
+# GetPathDir
+#
+# Parameters:
+# 	$str
+#------------------------------------------------------------------------------------
+sub GetPathDir
+{
+    my ($str) = @_;
+
+    my $startPos = rindex($str, "\\");
+    if($startPos == -1)
+    {
+        $startPos = rindex($str, "/");
+        return $str if($startPos == -1);
+    }
+
+    my $filename = substr($str, 0, $startPos+1);
+
+    return $filename;
+}
+
+#------------------------------------------------------------------------------------
+# RemoveWhiteSpaces
+#
+# Parameters:
+# 	$text
+#------------------------------------------------------------------------------------
+sub RemoveWhiteSpaces
+{
+	my ($text) = @_;
+	${$text} =~ s/\s+$//; #whitespaces in the end
+	${$text} =~ s/^\s+//; #whitespaces at the start
+}
+
+#------------------------------------------------------------------------------------
+# XmlReadyText
+#
+# Parameters:
+# 	$text
+#------------------------------------------------------------------------------------
+sub XmlReadyText
+{
+	my ($text) = @_;
+
+	my $txtlt = "&lt;";
+	my $txtgt = "&gt;";
+	${$text} =~ s/</$txtlt/g;
+	${$text} =~ s/>/$txtgt/g;
+
+	${$text} =~ s/Ä/&Auml/g;
+	${$text} =~ s/ä/&auml/g;
+	${$text} =~ s/Ö/&Ouml/g;
+	${$text} =~ s/ö/&ouml/g;
+}
+
+#------------------------------------------------------------------------------------
+# XmlToText
+#
+# Parameters:
+# 	$text
+#------------------------------------------------------------------------------------
+sub XmlToText
+{
+	my ($text) = @_;
+
+	$txtlt = "&lt;";
+	$txtgt = "&gt;";
+	${$text} =~ s/$txtlt/</g;
+	${$text} =~ s/$txtgt/>/g;
+
+	${$text} =~ s/&Auml/Ä/g;
+	${$text} =~ s/&auml/ä/g;
+	${$text} =~ s/&Ouml/Ö/g;
+	${$text} =~ s/&ouml/ö/g;
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/testing/tools/wshTestRun_local.vbs	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,129 @@
+'
+' WScript that will invoke the test run execute functionality at ATS3 web server without installing any ATS3
+' specific programs on the local PC.
+'
+' Copies the test run zip into ATS3 server over HTTP before starting the test run
+'
+' Usage cscript wshRunX.vbs <username> <password> <server hostname> <path to testDrop.zip>
+'
+
+' Get the command line arguments
+set args = WScript.Arguments
+
+' Check that all arguments have been specified
+Set objShell = WScript.CreateObject("WScript.Shell")
+Set env = objShell.Environment("Process")
+checkEnvVars(env)
+
+' Invoke the web application and write the result to stdOut
+WScript.StdOut.Write doTestRunX(env("ats3.username"), env("ats3.password"), env("ats3.host"), env("ats3.pathToDrop"), URLEncode( env("ats3.schedule") ))
+
+' Quit the script
+Wscript.Quit
+
+Function checkEnvVars(env)
+	if env("ats3.username") = "" then
+		WScript.Echo "Environment variable ats3.username not specified"
+		WScript.Quit 1
+	elseif env("ats3.password") = "" then
+		WScript.Echo "Environment variable ats3.password not specified"
+		WScript.Quit 1
+	elseif env("ats3.host") = "" then
+		WScript.Echo "Environment variable ats3.host not specified"
+		WScript.Quit 1		
+	elseif env("ats3.pathToDrop") = "" then
+		WScript.Echo "Environment variable ats3.pathToDrop not specified"
+		WScript.Quit 1	
+	end if
+End Function
+
+' Invoke the ATS3 web application in given host with the specified username, password and file path
+Function doTestRunX(uname, password, hostName, pathToDrop, schedule)
+	Set objxmlHTTP = CreateObject("MSXML2.ServerXMLHTTP.3.0")
+	objxmlHTTP.setTimeouts 0,60000,3600000,3600000
+	
+	Call objxmlHTTP.open("POST", "http://" & hostName & "/ats3/XTestRunExecute.do?username=" & uname & "&password=" & password & "&schedule=" & schedule, False)
+	objxmlHTTP.setRequestHeader "Content-Type", "multipart/form-data; boundary=AaB03x"
+	
+	Set BinaryStream = CreateObject("ADODB.Stream")
+	BinaryStream.Type = 1
+	BinaryStream.Open
+	BinaryStream.LoadFromFile pathToDrop
+	
+	objxmlHTTP.Send BuildFormData(BinaryStream.Read,"AaB03x","testDrop.zip","testDrop")
+
+	doTestRunX = objxmlHTTP.ResponseText
+	
+	BinaryStream.Close
+End Function
+
+Function BuildFormData(FileContents, Boundary, FileName, FieldName)
+  Dim FormData, Pre, Po
+  Const ContentType = "application/upload"
+  
+  'The two parts around file contents In the multipart-form data.
+  Pre = "--" + Boundary + vbCrLf + mpFields(FieldName, FileName, ContentType)
+  Po = vbCrLf + "--" + Boundary + "--" + vbCrLf
+  
+  'Build form data using recordset binary field
+  Const adLongVarBinary = 205
+  Dim RS: Set RS = CreateObject("ADODB.Recordset")
+  RS.Fields.Append "b", adLongVarBinary, Len(Pre) + LenB(FileContents) + Len(Po)
+  RS.Open
+  RS.AddNew
+    Dim LenData
+    'Convert Pre string value To a binary data
+    LenData = Len(Pre)
+    RS("b").AppendChunk (StringToMB(Pre) & ChrB(0))
+    Pre = RS("b").GetChunk(LenData)
+    RS("b") = ""
+    
+    'Convert Po string value To a binary data
+    LenData = Len(Po)
+    RS("b").AppendChunk (StringToMB(Po) & ChrB(0))
+    Po = RS("b").GetChunk(LenData)
+    RS("b") = ""
+    
+    'Join Pre + FileContents + Po binary data
+    RS("b").AppendChunk (Pre)
+    RS("b").AppendChunk (FileContents)
+    RS("b").AppendChunk (Po)
+  RS.Update
+  FormData = RS("b")
+  RS.Close
+  BuildFormData = FormData
+End Function
+
+Function mpFields(FieldName, FileName, ContentType)
+  Dim MPTemplate 'template For multipart header
+  MPTemplate = "Content-Disposition: form-data; name=""{field}"";" + _
+   " filename=""{file}""" + vbCrLf + _
+   "Content-Type: {ct}" + vbCrLf + vbCrLf
+  Dim Out
+  Out = Replace(MPTemplate, "{field}", FieldName)
+  Out = Replace(Out, "{file}", FileName)
+  mpFields = Replace(Out, "{ct}", ContentType)
+End Function
+
+Function StringToMB(S)
+  Dim I, B
+  For I = 1 To Len(S)
+    B = B & ChrB(Asc(Mid(S, I, 1)))
+  Next
+  StringToMB = B
+End Function
+
+Function URLEncode(data)
+	data = replace(data,"\","/")
+	data = replace(data,"$","%24")
+	data = replace(data,"&","%26")
+	data = replace(data,"+","%2B")
+	data = replace(data,",","%2C")
+	data = replace(data,"/","%2F")
+	data = replace(data,":","%3A")
+	data = replace(data,";","%3B")
+	data = replace(data,"=","%3D")
+	data = replace(data,"?","%3F")
+	data = replace(data,"@","%40")
+	URLEncode = data
+End Function
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/testing/tools/wshTestRun_network.vbs	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,63 @@
+'
+' WScript that will invoke the test run execute functionality at ATS3 web server without installing any ATS3
+' specific programs on the local PC.
+'
+' Password must be given in encrypted format and the path to test drop must be in URLEncoded
+'
+' Usage cscript wshRunX.vbs <username> <password> <server hostname> <path to testDrop.zip>
+'
+
+' Get the command line arguments
+set args = WScript.Arguments
+
+' Check that all arguments have been specified
+Set objShell = WScript.CreateObject("WScript.Shell")
+Set env = objShell.Environment("Process")
+checkEnvVars(env)
+
+' Invoke the web application and write the result to stdOut
+WScript.StdOut.Write doTestRunX(env("ats3.username"), env("ats3.password"), env("ats3.host"), URLEncode( env("ats3.pathToDrop") ))
+
+' Quit the script
+Wscript.Quit
+
+Function checkEnvVars(env)
+	if env("ats3.username") = "" then
+		WScript.Echo "Environment variable ats3.username not specified"
+		WScript.Quit 1
+	elseif env("ats3.password") = "" then
+		WScript.Echo "Environment variable ats3.password not specified"
+		WScript.Quit 1
+	elseif env("ats3.host") = "" then
+		WScript.Echo "Environment variable ats3.host not specified"
+		WScript.Quit 1		
+	elseif env("ats3.pathToDrop") = "" then
+		WScript.Echo "Environment variable ats3.pathToDrop not specified"
+		WScript.Quit 1	
+	end if
+End Function
+
+' Invoke the ATS3 web application in given host with the specified username, password and file path
+Function doTestRunX(uname, password, hostName, pathToDrop)
+	Set objxmlHTTP = CreateObject("Microsoft.XMLHTTP")
+	
+	Call objxmlHTTP.open("GET", "http://" & hostName & "/ats3/XTestRunExecute.do?username=" & uname & "&password=" & password & "&testrunpath=" & pathToDrop, False)
+	objxmlHTTP.Send()
+
+	doTestRunX = objxmlHTTP.ResponseText
+End Function
+
+Function URLEncode(data)
+	data = replace(data,"\","/")
+	data = replace(data,"$","%24")
+	data = replace(data,"&","%26")
+	data = replace(data,"+","%2B")
+	data = replace(data,",","%2C")
+	data = replace(data,"/","%2F")
+	data = replace(data,":","%3A")
+	data = replace(data,";","%3B")
+	data = replace(data,"=","%3D")
+	data = replace(data,"?","%3F")
+	data = replace(data,"@","%40")
+	URLEncode = data
+End Function
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,30 @@
+/*
+* 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:   Build information file for Ipvideo
+*
+*
+*/
+
+
+
+#include <bldvariant.hrh>
+#include <platform_paths.hrh> // for conf file export macros
+
+/* mpx my videos collection */
+#include "../mpxmyvideoscollection/group/bld.inf"
+
+/* Ganes MpxMyVideos UX 2.0 */
+#include "../myvideosindicatorplugin/group/bld.inf"
+#include "../hgmyvideos/group/bld.inf"
+#include "../hgmyvideosplugin/group/bld.inf"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/BWINS/vcxhgmyvideosu.def	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,5 @@
+EXPORTS
+	??1CVcxHgMyVideosMainView@@UAE@XZ @ 1 NONAME ; CVcxHgMyVideosMainView::~CVcxHgMyVideosMainView(void)
+	?NewL@CVcxHgMyVideosMainView@@SAPAV1@XZ @ 2 NONAME ; class CVcxHgMyVideosMainView * CVcxHgMyVideosMainView::NewL(void)
+	?NewLC@CVcxHgMyVideosMainView@@SAPAV1@XZ @ 3 NONAME ; class CVcxHgMyVideosMainView * CVcxHgMyVideosMainView::NewLC(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/EABI/vcxhgmyvideosu.def	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,11 @@
+EXPORTS
+	_ZN22CVcxHgMyVideosMainView4NewLEv @ 1 NONAME
+	_ZN22CVcxHgMyVideosMainView5NewLCEv @ 2 NONAME
+	_ZN22CVcxHgMyVideosMainViewD0Ev @ 3 NONAME
+	_ZN22CVcxHgMyVideosMainViewD1Ev @ 4 NONAME
+	_ZN22CVcxHgMyVideosMainViewD2Ev @ 5 NONAME
+	_ZTI22CVcxHgMyVideosMainView @ 6 NONAME ; #<TI>#
+	_ZTV22CVcxHgMyVideosMainView @ 7 NONAME ; #<VT>#
+	_ZTI31CVcxHgMyVideosMainViewContainer @ 8 NONAME ; #<TI>#
+	_ZTV31CVcxHgMyVideosMainViewContainer @ 9 NONAME ; #<VT>#
+
Binary file videocollection/hgmyvideos/conf/hgmyvideos.confml has changed
Binary file videocollection/hgmyvideos/conf/hgmyvideos_20021191.crml has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/data/vcxhgmyvideos.rss	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,877 @@
+/*
+* 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:   Resource file definition for hgmyvideos*
+*/
+
+
+
+
+//  RESOURCE IDENTIFIER
+NAME    VCHG // 4 letter ID
+
+#include <bldvariant.hrh>
+#include <eikon.rh>
+#include <eikon.rsg>
+#include <avkon.rh>
+#include <avkon.hrh>
+#include <avkon.rsg>
+#include <avkon.loc>
+#include <avkon.mbg>
+#include <CommonDialogs.hrh>
+#include <CommonDialogs.rh>
+#ifdef RD_VIDEO_AS_RINGING_TONE
+#include <AiwCommon.hrh>
+#include <AiwCommon.rh>
+#endif
+
+#include <vcxhgmyvideos.mbg>
+
+#include "vcxhgmyvideos.hrh"
+#include <ipvideo.loc>
+
+// RESOURCE DEFINITIONS 
+
+RESOURCE RSS_SIGNATURE { }
+
+// -----------------------------------------------------------------------------
+// DRM related rerouces are in own file for clarity.
+// -----------------------------------------------------------------------------
+//
+#include "vcxhgmyvideosdrm.rss"
+
+// -----------------------------------------------------------------------------
+// Defines My Videos main view.
+// -----------------------------------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_vcxhgmyvideos_mainview
+    {
+    menubar = r_vcxhgmyvideos_mainview_menubar;
+    cba = r_vcxhgmyvideos_softkeys_options_back__open;
+    }
+
+// -----------------------------------------------------------------------------
+// Main view menu title definition.
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_vcxhgmyvideos_mainview_menubar
+    {
+    titles =
+        {
+        MENU_TITLE 
+            { 
+            menu_pane = r_vcxhgmyvideos_mainview_menu; 
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+// Main view "Options" menu definition.
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_vcxhgmyvideos_mainview_menu 
+    {
+    items =
+        {
+        MENU_ITEM 
+            { 
+            command = EVcxHgMyVideosCmdOpen; 
+            txt = qtn_iptv_open_folder;
+            flags = EEikMenuItemAction;
+	    },
+        MENU_ITEM 
+            { 
+            command = EVcxHgMyVideosCmdPlay; 
+            txt = qtn_iptv_play;
+            flags = EEikMenuItemAction;
+	    },
+        MENU_ITEM 
+            { 
+            command = EVcxHgMyVideosCmdDelete; 
+            txt = qtn_iptv_delete_video_clip;
+            flags = EEikMenuItemSpecific;
+            },
+        MENU_ITEM 
+            { 
+            command = EVcxHgMyVideosCmdVideoDetails;
+            txt = qtn_iptv_video_details;
+            flags = EEikMenuItemSpecific;
+            },
+        MENU_ITEM 
+            { 
+            command = EVcxHgMyVideosCmdCopy; 
+            txt = qtn_iptv_copy_submenu;
+            flags = EEikMenuItemSpecific;
+            },
+        MENU_ITEM
+            {
+            command = EVcxHgMyVideosCmdMove; 
+            txt = qtn_iptv_move_submenu;
+            flags = EEikMenuItemSpecific;
+            },    
+        MENU_ITEM 
+            { 
+            command = EVcxHgMyVideosCmdShowViaHomenet;
+            txt = qtn_iptv_show_via_homenet;
+            },
+        MENU_ITEM 
+            { 
+            command = EVcxHgMyVideosCmdStopShowViaHomenet;
+            txt = qtn_iptv_stop_showing;
+            },
+        MENU_ITEM 
+            {
+            command = EVcxHgMyVideosCmdMemoryStatus;
+            txt = qtn_iptv_memory_status;
+            },
+        MENU_ITEM 
+            { 
+            command = EVcxHgMyVideosCmdSortSubMenu; 
+            cascade = r_vcxhgmyvideos_sort_submenu;
+            txt = qtn_iptv_sort_by; 
+            },
+        MENU_ITEM 
+            { 
+            command = EVcxHgMyVideosCmdMarkUnmarkSubMenu;
+            cascade = r_vcxhgmyvideos_mark_submenu;
+            txt = qtn_options_list;
+            },
+#ifdef RD_VIDEO_AS_RINGING_TONE
+            // AIW assign (Use video as)
+        MENU_ITEM
+            {
+            command = EVcxHgMyVideosCmdAiwAssign;
+            cascade = r_vcxhgmyvideos_use_as_submenu;
+            txt = qtn_vcx_hg_options_use_video_as;
+            flags = EEikMenuItemSpecificListQuery;
+            },
+#endif
+        MENU_ITEM 
+            { 
+            command = EVcxHgMyVideosCmdOpenSettings; 
+            txt = qtn_vcx_options_settings;
+            },
+        MENU_ITEM 
+            { 
+            command = EVcxHgMyVideosCmdHelp; 
+            txt = qtn_options_help;
+            },
+        MENU_ITEM 
+            { 
+            command = EVcxHgMyVideosCmdExit; 
+            txt = qtn_options_exit;
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+// "Sort" submenu definition
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_vcxhgmyvideos_sort_submenu
+  {
+  items =
+      {
+      MENU_ITEM
+            {
+            command = EVcxHgMyVideosCmdSortByDate;
+            txt = qtn_iptv_sort_by_date;
+            flags = EEikMenuItemRadioStart | EEikMenuItemSymbolOn;
+            },
+      MENU_ITEM
+            {
+            command = EVcxHgMyVideosCmdSortByName;
+            txt = qtn_iptv_sort_by_name;
+            },
+      MENU_ITEM
+            {
+            command = EVcxHgMyVideosCmdSortBySize;
+            txt = qtn_iptv_sort_by_size;
+            flags = EEikMenuItemRadioEnd;
+            }
+      };
+  }
+
+// -----------------------------------------------------------------------------
+// "Mark/Unmark" submenu definition
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_vcxhgmyvideos_mark_submenu
+  {
+  items =
+      {
+#ifndef RD_VIDEO_AS_RINGING_TONE            
+    MENU_ITEM
+         {
+         command = EVcxHgMyVideosCmdMarkContext;
+         txt = qtn_options_list_mark_one;
+         flags = EEikMenuItemSpecific;
+         },
+#endif            
+      MENU_ITEM
+          {
+          command = EVcxHgMyVideosCmdToggleMultipleMarking;
+          txt = qtn_iptv_menuitem_markmultiple;            
+          },
+      MENU_ITEM
+            {
+            command = EVcxHgMyVideosCmdMarkAll;
+            txt = qtn_options_list_mark_all;
+            },
+      MENU_ITEM
+            {
+            command = EVcxHgMyVideosCmdUnmarkAll;
+            txt = qtn_options_list_unmark_all;
+            }
+       };
+   }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA r_vcxhgmyvideos_softkeys_options_back__open
+    {
+    buttons =
+        {
+        CBA_BUTTON { id = EAknSoftkeyOptions; txt = text_softkey_option; },
+        CBA_BUTTON { id = EAknSoftkeyBack; txt = text_softkey_back; },
+        CBA_BUTTON { id = EAknSoftkeyOpen; txt = qtn_msk_open; }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA_BUTTON r_vcxhgmyvideos_msk_open
+    { 
+    id = EAknSoftkeyOpen; 
+    txt = qtn_msk_open; 
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA_BUTTON r_vcxhgmyvideos_rsk_cancel
+    { 
+    id = EAknSoftkeyCancel; 
+    txt = text_softkey_cancel; 
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA_BUTTON r_vcxhgmyvideos_rsk_back
+    { 
+    id = EAknSoftkeyBack; 
+    txt = text_softkey_back; 
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA_BUTTON r_vcxhgmyvideos_rsk_exit
+    { 
+    id = EAknSoftkeyExit; 
+    txt = text_softkey_exit; 
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA_BUTTON r_vcxhgmyvideos_msk_nothing
+    { 
+    id = EVcxHgMyVideosCmdNothing;
+    txt = "";
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA_BUTTON r_vcxhgmyvideos_msk_contextmenu
+    {
+    id = EAknSoftkeyContextOptions;
+    txt = text_softkey_option;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA_BUTTON r_vcxhgmyvideos_msk_play
+    {
+    id = EVcxHgMyVideosCmdPlay;
+    txt = qtn_msk_play;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//  
+RESOURCE DIALOG r_vcxhgmyvideos_memory_status_message_query
+    {
+    flags = EGeneralQueryFlags | EEikDialogFlagNoBorder | EEikDialogFlagNoShadow;
+    buttons = R_AVKON_SOFTKEYS_OK_EMPTY; 
+    items =
+        {
+        DLG_LINE 
+            {
+            type = EAknCtPopupHeadingPane;
+            id = EAknMessageQueryHeaderId;
+            control = AVKON_HEADING
+                {
+                label = qtn_iptv_memory_status_header;
+                headinglayout = R_AVKON_WML_SIGN_QUERY_HEADING_PANE;
+                };
+            },
+        DLG_LINE
+            {
+            type = EAknCtMessageQuery;
+            id = EAknMessageQueryContentId;
+            control = AVKON_MESSAGE_QUERY
+                {
+                };
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//  
+RESOURCE DIALOG r_vcxhgmyvideos_video_details_message_query
+    {
+    flags = EGeneralQueryFlags | EEikDialogFlagNoBorder | EEikDialogFlagNoShadow;
+    buttons = R_AVKON_SOFTKEYS_OK_EMPTY; 
+    items =
+        {
+        DLG_LINE 
+            {
+            type = EAknCtPopupHeadingPane;
+            id = EAknMessageQueryHeaderId;
+            control = AVKON_HEADING
+                {
+                label = qtn_iptv_video_details;
+                headinglayout = R_AVKON_WML_SIGN_QUERY_HEADING_PANE;
+                };
+            },
+        DLG_LINE
+            {
+            type = EAknCtMessageQuery;
+            id = EAknMessageQueryContentId;
+            control = AVKON_MESSAGE_QUERY
+                {
+                };
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//    
+RESOURCE DIALOG r_vcxhgmyvideos_delete_confirmation_query
+    {
+    flags = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_YES_NO;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtQuery;
+            id = EGeneralQuery;
+            control = AVKON_CONFIRMATION_QUERY 
+                { 
+                layout = EConfirmationLayout;
+                };
+            }
+        };
+    }  
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//  
+RESOURCE DIALOG r_vcxhgmyvideos_deleting_wait_note
+    {
+    flags = EAknWaitNoteFlags;
+    buttons = R_AVKON_SOFTKEYS_CANCEL;
+    items=
+        {
+        DLG_LINE
+            {
+            type = EAknCtNote;
+            id = EGeneralQuery;
+            control= AVKON_NOTE 
+                { 
+                layout = EWaitLayout;
+                singular_label = qtn_fldr_deleting_wait_note;
+                imagefile = AVKON_BITMAP_FILE;
+                imageid = EMbmAvkonQgn_note_erased;
+                imagemask = EMbmAvkonQgn_note_erased_mask;
+                animation = R_QGN_GRAF_WAIT_BAR_ANIM;
+                };
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//  
+RESOURCE DIALOG r_vcxhgmyvideos_move_wait_note
+    {
+    flags = EAknWaitNoteFlags;
+    buttons = R_AVKON_SOFTKEYS_CANCEL;
+    items=
+        {
+        DLG_LINE
+            {
+            type = EAknCtNote;
+            id = EGeneralQuery;
+            control= AVKON_NOTE 
+                { 
+                layout = EWaitLayout;
+                singular_label = ""; // Text is set dynamically.
+                imagefile = AVKON_BITMAP_FILE;
+                imageid = EMbmAvkonQgn_note_move;
+                imagemask = EMbmAvkonQgn_note_move_mask;
+                animation = R_QGN_GRAF_WAIT_BAR_ANIM;
+                };
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//  
+RESOURCE DIALOG r_vcxhgmyvideos_copy_wait_note
+    {
+    flags = EAknWaitNoteFlags;
+    buttons = R_AVKON_SOFTKEYS_CANCEL;
+    items=
+        {
+        DLG_LINE
+            {
+            type = EAknCtNote;
+            id = EGeneralQuery;
+            control= AVKON_NOTE 
+                { 
+                layout = EWaitLayout;
+                singular_label = ""; // Text is set dynamically.
+                imagefile = AVKON_BITMAP_FILE;
+                imageid = EMbmAvkonQgn_note_copy;
+                imagemask = EMbmAvkonQgn_note_copy_mask;
+                animation = R_QGN_GRAF_WAIT_BAR_ANIM;
+                };
+            }
+        };
+    }
+
+// --------------------------------------------------------------------------
+//
+// --------------------------------------------------------------------------
+//
+RESOURCE MEMORYSELECTIONDIALOG r_vcxhgmyvideos_memory_selection_dialog
+    {
+    softkey_1 = text_softkey_select;
+    softkey_2 = text_softkey_cancel;
+    }
+
+#ifdef RD_VIDEO_AS_RINGING_TONE
+//------------------------------------------------------------------------------
+//
+//      r_vcxhgmyvideos_aiw_assign_interest
+//      AIW interest criteria for "Use video as" menu
+//
+//------------------------------------------------------------------------------
+//
+RESOURCE AIW_INTEREST r_vcxhgmyvideos_aiw_assign_interest
+    {
+    items=
+        {
+        AIW_CRITERIA_ITEM
+            {
+            id = EVcxHgMyVideosCmdAiwAssign;
+            serviceCmd = KAiwCmdAssign;
+            contentType = "*";
+            serviceClass = KAiwClassMenu;
+            }
+        };
+    }
+
+//----------------------------------------------------
+//
+//    r_vcxhgmyvideos_use_as_submenu
+//
+//----------------------------------------------------
+//
+RESOURCE MENU_PANE r_vcxhgmyvideos_use_as_submenu
+    {
+    items =
+        {
+        MENU_ITEM
+            {
+            command = EVcxHgMyVideosCmdAiwAssign;
+            txt = "";
+            }
+        };
+    }
+#endif
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//  
+RESOURCE TBUF r_vcxhgmyvideos_video_details_name { buf = qtn_iptv_video_name; }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//  
+RESOURCE TBUF r_vcxhgmyvideos_video_details_size_kb { buf = qtn_iptv_size_kb; }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//  
+RESOURCE TBUF r_vcxhgmyvideos_video_details_size_mb { buf = qtn_iptv_size_mb; }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//  
+RESOURCE TBUF r_vcxhgmyvideos_video_details_size_gb { buf = qtn_iptv_size_gb; }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//  
+RESOURCE TBUF r_vcxhgmyvideos_video_details_author { buf = qtn_iptv_author; }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//  
+RESOURCE TBUF r_vcxhgmyvideos_video_details_copyright { buf = qtn_iptv_copyright; }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//  
+RESOURCE TBUF r_vcxhgmyvideos_free_memory { buf = qtn_iptv_free_memory; }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//  
+RESOURCE TBUF r_vcxhgmyvideos_used_memory { buf = qtn_iptv_used_memory; }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//  
+RESOURCE TBUF r_vcxhgmyvideos_size_kb_short { buf = qtn_iptv_size_kb_short; }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//  
+RESOURCE TBUF r_vcxhgmyvideos_size_mb_short { buf = qtn_iptv_size_mb_short; }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//  
+RESOURCE TBUF r_vcxhgmyvideos_size_gb_short { buf = qtn_iptv_size_gb_short; }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//  
+RESOURCE TBUF r_vcxhgmyvideos_memory_percentage { buf = qtn_iptv_memory_percentage; }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//  
+RESOURCE TBUF r_vcxhgmyvideos_opening_categories { buf = " "; }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//  
+RESOURCE TBUF r_vcxhgmyvideos_opening_videos { buf = " "; }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//  
+RESOURCE TBUF r_vcxhgmyvideos_empty_empty_text { buf = " "; }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//  
+RESOURCE TBUF r_vcxhgmyvideos_no_videos { buf = qtn_iptv_no_videos; }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//  
+RESOURCE TBUF r_vcxhgmyvideos_my_videos_title { buf = qtn_vcx_title_suite; }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//  
+RESOURCE TBUF r_vcxhgmyvideos_one_new_video { buf = qtn_vcx_hg_list_one_new_video; }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//  
+RESOURCE TBUF r_vcxhgmyvideos_n_new_videos { buf = qtn_vcx_hg_list_n_new_videos; }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//  
+RESOURCE TBUF r_vcxhgmyvideos_no_videos_in_category { buf = qtn_vcx_hg_list_no_videos_in_category; }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//  
+RESOURCE TBUF r_vcxhgmyvideos_one_video_in_category { buf = qtn_vcx_hg_list_one_video_in_category; }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//  
+RESOURCE TBUF r_vcxhgmyvideos_videos_in_category { buf = qtn_vcx_hg_list_videos_in_category; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//  
+RESOURCE TBUF r_vcxhgmyvideos_storage_all_list { buf = qtn_iptv_storage_all_list; }
+    
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//  
+RESOURCE TBUF r_vcxhgmyvideos_storage_downloads_list { buf = qtn_vcx_hg_storage_downloads_list; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//  
+RESOURCE TBUF r_vcxhgmyvideos_storage_tv_recordings_list 
+    { buf = qtn_iptv_storage_tv_recordings_list; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//  
+RESOURCE TBUF r_vcxhgmyvideos_storage_captured_list { buf = qtn_vcx_hg_list_storage_captured; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//  
+RESOURCE TBUF r_vcxhgmyvideos_storage_other_list { buf = qtn_vcx_hg_list_storage_other; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//  
+RESOURCE TBUF r_vcxhgmyvideos_all_videos_title { buf = qtn_iptv_all_videos_title; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//  
+RESOURCE TBUF r_vcxhgmyvideos_downloads_title { buf = qtn_vcx_downloads_title; }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//  
+RESOURCE TBUF r_vcxhgmyvideos_tv_recordings_title { buf = qtn_iptv_tv_recordings_title; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//  
+RESOURCE TBUF r_vcxhgmyvideos_captured_title { buf = qtn_vcx_captured_title; }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//  
+RESOURCE TBUF r_vcxhgmyvideos_other_title { buf = qtn_iptv_other_title; }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//  
+RESOURCE TBUF r_vcxhgmyvideos_list_size_kb { buf = qtn_iptv_list_size_kb; } 
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//  
+RESOURCE TBUF r_vcxhgmyvideos_size_list_mb { buf = qtn_iptv_size_list_mb; }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//  
+RESOURCE TBUF r_vcxhgmyvideos_size_list_gb { buf = qtn_iptv_size_list_gb; }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//  
+RESOURCE TBUF r_vcxhgmyvideos_video_list_length_sec { buf = qtn_vcx_hg_video_list_length_sec; }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//  
+RESOURCE TBUF r_vcxhgmyvideos_video_list_length_min_sec { buf = qtn_vcx_hg_video_list_length_min_sec; }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//  
+RESOURCE TBUF r_vcxhgmyvideos_video_list_length_h_min { buf = qtn_iptv_video_list_length_full; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_download_canceled { buf = qtn_iptv_download_canceled; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_query_common_conf_delete { buf = qtn_query_common_conf_delete; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_fldr_del_items_query { buf = qtn_fldr_del_items_query; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_cant_delete_items { buf = qtn_iptv_cant_delete_items; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_fldr_cant_delete_file_open { buf = qtn_fldr_cant_delete_file_open; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+// 
+RESOURCE TBUF r_vcxhgmyvideos_copying_one { buf = qtn_iptv_copying_one; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+// 
+RESOURCE TBUF r_vcxhgmyvideos_copying_many { buf = qtn_iptv_copying_many; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+// 
+RESOURCE TBUF r_vcxhgmyvideos_moving_one { buf = qtn_iptv_moving_one; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+// 
+RESOURCE TBUF r_vcxhgmyvideos_moving_many { buf = qtn_iptv_moving_many; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+// 
+RESOURCE TBUF r_vcxhgmyvideos_fldr_item_cannot_be_copied
+    { buf = qtn_fldr_item_cannot_be_copied; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+// 
+RESOURCE TBUF r_vcxhgmyvideos_fldr_some_items_cant_copy
+    { buf = qtn_fldr_some_items_cant_copy; }    
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+// 
+RESOURCE TBUF r_vcxhgmyvideos_fldr_item_cannot_be_moved
+    { buf = qtn_fldr_item_cannot_be_moved; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+// 
+RESOURCE TBUF r_vcxhgmyvideos_fldr_some_items_cant_move
+    { buf = qtn_fldr_some_items_cant_move; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_resume_not_possible
+    { buf = qtn_iptv_resume_not_possible; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_last_watched
+    { buf = qtn_vcx_hg_list_last_watched; }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_ovi_store
+    { buf =  qtn_vcx_hg_list_ovi_store; }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_ovi_store_videos
+    { buf = qtn_vcx_hg_list_ovi_store_videos; }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/data/vcxhgmyvideosdrm.rss	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,324 @@
+/*
+* 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:   Resource file definition for hgmyvideos*
+*/
+
+
+
+
+// RESOURCE DEFINITIONS 
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_mgr_det_utl_x { buf = qtn_iptv_drm_mgr_det_utl_x; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_mgr_det_1_count { buf = qtn_iptv_drm_mgr_det_1_count; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_mgr_det_n_counts { buf = qtn_iptv_drm_mgr_det_n_counts; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_nbr_of_years_one { buf = qtn_iptv_drm_nbr_of_years_one; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_nbr_of_years_one_final
+    { buf = qtn_iptv_drm_nbr_of_years_one_final; }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_nbr_of_years_two_four
+    { buf = qtn_iptv_drm_nbr_of_years_two_four; }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_nbr_of_years_five_zero
+    { buf = qtn_iptv_drm_nbr_of_years_five_zero; }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_nbr_of_months_one { buf = qtn_iptv_drm_nbr_of_months_one; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_nbr_of_months_two_four
+    { buf = qtn_iptv_drm_nbr_of_months_two_four; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_nbr_of_months_five_zero
+    { buf = qtn_iptv_drm_nbr_of_months_five_zero; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_nbr_of_days_one { buf = qtn_iptv_drm_nbr_of_days_one; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_nbr_of_days_one_final
+    { buf = qtn_iptv_drm_nbr_of_days_one_final; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_nbr_of_days_two_four { buf = qtn_iptv_drm_nbr_of_days_two_four; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_nbr_of_days_five_zero
+    { buf = qtn_iptv_drm_nbr_of_days_five_zero; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_nbr_of_hours_one { buf = qtn_iptv_drm_nbr_of_hours_one; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_nbr_of_hours_one_final
+    { buf = qtn_iptv_drm_nbr_of_hours_one_final; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_nbr_of_hours_two_four
+    { buf = qtn_iptv_drm_nbr_of_hours_two_four; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_nbr_of_hours_five_zero
+    { buf = qtn_iptv_drm_nbr_of_hours_five_zero; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_nbr_of_mins_one { buf = qtn_iptv_drm_nbr_of_mins_one; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_nbr_of_mins_one_final
+    { buf = qtn_iptv_drm_nbr_of_mins_one_final; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_nbr_of_mins_two_four { buf = qtn_iptv_drm_nbr_of_mins_two_four; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_nbr_of_mins_five_zero
+    { buf = qtn_iptv_drm_nbr_of_mins_five_zero; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_nbr_of_secs_one { buf = qtn_iptv_drm_nbr_of_secs_one; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_nbr_of_secs_one_final
+    { buf = qtn_iptv_drm_nbr_of_secs_one_final; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_nbr_of_secs_two_four { buf = qtn_iptv_drm_nbr_of_secs_two_four; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_nbr_of_secs_five_zero
+    { buf = qtn_iptv_drm_nbr_of_secs_five_zero; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_mgr_det_inter { buf = qtn_iptv_drm_mgr_det_inter; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_mgr_det_inter_two { buf = qtn_iptv_drm_mgr_det_inter_two; }
+    
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_mgr_det_accum_time_left
+    { buf = qtn_iptv_drm_mgr_det_accum_time_left; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_mgr_det_udl_x { buf = qtn_iptv_drm_mgr_det_udl_x; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_mgr_det_uts_x { buf = qtn_iptv_drm_mgr_det_uts_x; }
+    
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_mgr_det_not_act { buf = qtn_iptv_drm_mgr_det_not_act; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_mgr_det_rvf_x { buf = qtn_iptv_drm_mgr_det_rvf_x; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_mgr_det_rvt_x { buf = qtn_iptv_drm_mgr_det_rvt_x; }
+    
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_mgr_det_full_x { buf = qtn_iptv_drm_mgr_det_full_x; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_mgr_det_unlimited { buf = qtn_iptv_drm_mgr_det_unlimited; }
+    
+    
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_mgr_det_stat { buf = qtn_iptv_drm_mgr_det_stat; }
+    
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_wmdrm_valid { buf = qtn_iptv_wmdrm_valid; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_wmdrm_invalid { buf = qtn_iptv_wmdrm_invalid; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_mgr_det_cs { buf = qtn_iptv_drm_mgr_det_cs; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_mgr_det_allowed { buf = qtn_iptv_drm_mgr_det_allowed; }
+    
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_mgr_det_exp { buf = qtn_iptv_drm_mgr_det_exp; }
+    
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_mgr_det_valid { buf = qtn_iptv_drm_mgr_det_valid; }
+    
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_mgr_det_forbid { buf = qtn_iptv_drm_mgr_det_forbid; }        
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_mgr_det2_play { buf = qtn_iptv_drm_mgr_det2_play; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_mgr_det2_display { buf = qtn_iptv_drm_mgr_det2_display; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_mgr_det2_execute { buf = qtn_iptv_drm_mgr_det2_execute; }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_vcxhgmyvideos_drm_mgr_det2_print { buf = qtn_iptv_drm_mgr_det2_print; }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,67 @@
+/*
+* 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:      Build information file for Hg My Videos view.*
+*/
+
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+WINSCW ARMV5
+
+PRJ_EXPORTS
+
+ 
+../rom/hgmyvideos.iby CORE_APP_LAYER_IBY_EXPORT_PATH(hgmyvideos.iby)
+../rom/hgmyvideosrsc.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(hgmyvideosrsc.iby)
+
+// Generic configuration interface for component cenrep settings  
+../conf/hgmyvideos.confml           APP_LAYER_CONFML(hgmyvideos.confml)
+../conf/hgmyvideos_20021191.crml    APP_LAYER_CRML(hgmyvideos_20021191.crml)
+
+PRJ_EXTENSIONS
+START EXTENSION s60/mifconv
+  OPTION TARGETFILE vcxhgmyvideos.mif
+  OPTION HEADERFILE vcxhgmyvideos.mbg
+  OPTION SOURCES \
+    -c8,1 qgn_indi_vdc_video_new_add.svg \
+    -c8,1 qgn_indi_memc_mass_add.svg \
+    -c8,1 qgn_indi_mmc_add \
+    -c8,1 qgn_indi_phone_add \
+    -c8,1 qgn_indi_vdc_rec_tv_add.svg \
+    -c8,1 qgn_indi_drm_rights_exp_add \
+    -c8,1 qgn_indi_drm_rights_add \
+    -c8,1 qgn_indi_mpttv_tb_unmark \
+    -c8,1 qgn_indi_mptv_tb_mark \
+    -c8,1 qgn_indi_mup_tb_play \
+    -c8,1 qgn_indi_tb_remove
+END
+
+START EXTENSION s60/mifconv
+  OPTION TARGETFILE vcxhgmyvideosicons.mif
+  OPTION HEADERFILE vcxhgmyvideosicons.mbg
+  OPTION SOURCEDIR ../icons
+  OPTION SOURCES \
+    -c8,1 qgn_prop_mtv_prog_clip.svg \
+    -c8,1 qgn_prop_captured_thumbnail_video.svg \
+    -c8,1 qgn_prop_download_thumbnail_video.svg \
+    -c8,1 qgn_prop_ovi_thumbnail_video.svg \
+    -c8,1 qgn_prop_recent_thumbnail_video.svg \
+    -c8,1 qgn_prop_service_thumbnail_video.svg
+END
+
+PRJ_MMPFILES
+vcxhgmyvideos.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/group/vcxhgmyvideos.mmp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,115 @@
+/*
+* 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:   vcxhgmyvideos.dll build file*
+*/
+
+
+// Version : %version: 31 %
+
+#include <platform_paths.hrh>
+#include <bldvariant.hrh>
+#include <data_caging_paths.hrh>
+
+//OPTION ARMCC --asm --interleave
+ALWAYS_BUILD_AS_ARM
+
+TARGET                  vcxhgmyvideos.dll
+TARGETTYPE              dll
+UID                     0x00000000 0x20021191
+
+CAPABILITY              CAP_GENERAL_DLL -AllFiles
+VENDORID                VID_DEFAULT
+
+SOURCEPATH              ../src
+SOURCE                  vcxhgmyvideosmainview.cpp
+SOURCE                  vcxhgmyvideosmainviewcontainer.cpp
+SOURCE                  vcxhgmyvideosmodel.cpp 
+SOURCE                  vcxhgmyvideoscollectionclient.cpp
+SOURCE                  vcxhgmyvideosdownloadclient.cpp
+SOURCE                  vcxhgmyvideoslistbase.cpp
+SOURCE                  vcxhgmyvideoscategorylistimpl.cpp
+SOURCE                  vcxhgmyvideoscategorymodelhandler.cpp 
+SOURCE                  vcxhgmyvideosvideolistimpl.cpp
+SOURCE                  vcxhgmyvideosvideomodelhandler.cpp 
+SOURCE                  vcxhgmyvideosvideodataupdater.cpp
+SOURCE                  vcxhgmyvideosvideodata.cpp
+SOURCE                  vcxhgmyvideosvideolistitem.cpp
+SOURCE                  vcxhgmyvideosfulldrminfo.cpp
+SOURCE                  vcxhgmyvideosmemorystatus.cpp
+SOURCE                  vcxhgmyvideosindicatorhelper.cpp
+SOURCE                  vcxhgmyvideosvideodetailsdialog.cpp
+SOURCE                  vcxhgmyvideosvideolist.cpp
+SOURCE                  vcxhgmyvideosvideocopier.cpp
+SOURCE                  vcxhgmyvideosupnpinterface.cpp
+#ifdef RD_VIDEO_AS_RINGING_TONE 
+SOURCE                  vcxhgmyvideosaiwmenuhandler.cpp
+#endif
+SOURCE                  vcxhgmyvideosthumbnailmanager.cpp
+SOURCE                  CIptvResourceLoader.cpp
+SOURCE                  CIptvDriveMonitor.cpp
+SOURCE                  TIptvDriveInfo.cpp
+SOURCE                  TIptvDriveMonitorEvent.cpp
+
+USERINCLUDE             ../inc
+USERINCLUDE    ../../../inc
+
+APP_LAYER_SYSTEMINCLUDE
+
+START RESOURCE          ../data/vcxhgmyvideos.rss
+HEADER
+TARGETPATH              APP_RESOURCE_DIR
+#ifdef WINSCW
+LANG sc 01 02 03
+#else
+LANGUAGE_IDS
+#endif
+END // RESOURCE
+
+LIBRARY                 euser.lib
+LIBRARY                 apparc.lib
+LIBRARY                 cone.lib
+LIBRARY                 eikctl.lib             
+LIBRARY                 eikcoctl.lib
+LIBRARY                 eikcore.lib  
+LIBRARY                 egul.lib 
+LIBRARY                 avkon.lib
+LIBRARY                 aknicon.lib         
+LIBRARY                 bafl.lib                  // CDesCArray 
+LIBRARY                 commonengine.lib          // String loader
+LIBRARY                 flogger.lib               // RFileLogger
+LIBRARY                 hlplch.lib                // HlpLauncher
+LIBRARY                 efsrv.lib
+LIBRARY                 ws32.lib                  // RWsSession
+LIBRARY                 estor.lib
+LIBRARY                 aknskins.lib
+LIBRARY                 mpxcommon.lib             // MPX
+LIBRARY                 mpxcollectionutility.lib  // MPX
+LIBRARY                 commondialogs.lib         // Memory selection dialog
+LIBRARY                 drmhelper.lib             // DRM
+LIBRARY                 centralrepository.lib	  // Upnp
+LIBRARY                 thumbnailmanager.lib      // CThumbnailManager
+LIBRARY                 caf.lib                   // CAF
+LIBRARY                 cafutils.lib              // CAF Utils
+LIBRARY                 sendui.lib                // For send video
+LIBRARY                 drmutility.lib            // DRM
+LIBRARY                 playbackhelper.lib        // Recognizer
+LIBRARY                 upnpcommand.lib
+LIBRARY                 ganes.lib                 // for HgList
+LIBRARY                 ecom.lib
+LIBRARY                 apgrfx.lib                // RApaLsSession
+#ifdef RD_VIDEO_AS_RINGING_TONE
+LIBRARY                 servicehandler.lib        // AIW Service Handler
+#endif
+LIBRARY                 platformenv.lib
+LIBRARY                 fbscli.lib                // CFbsBitmap
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/inc/CIptvDriveMonitor.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,338 @@
+/*
+* 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 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:    Helper class for Video Center for drive operations/monitoring.*
+*/
+
+
+
+
+
+#ifndef CIPTVDRIVEMONITOR_H
+#define CIPTVDRIVEMONITOR_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <f32file.h>
+#include "TIptvDriveInfo.h"
+#include "TIptvDriveMonitorEvent.h"
+#include "MIptvDriveMonitorObserver.h"
+#include "IptvDebug.h"
+
+// CONSTANTS
+
+// MACROS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+ * Helper class for Video Center for drive operations/monitoring.
+ * User can get available drives (through iAvailableDrives public member)
+ * and be notified when drives change (through MIptvDriveMonitorObserver interface).
+ */
+NONSHARABLE_CLASS (  CIptvDriveMonitor ) : public CActive
+    {                
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        */
+        static CIptvDriveMonitor* NewL();
+
+        /**
+        * Two-phased constructor. Use this is owner object already has a file session open.
+        *
+        * @param aFileSession file session.
+        */
+        static CIptvDriveMonitor* NewL( const RFs& aFileSession );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CIptvDriveMonitor();
+        
+    public:
+        
+        /**
+        * Registers observer for drive events.
+        * iAvailableDrives is updated automatically if there are any
+        * observers registered, ie there is no need to call RefreshAvailableDrivesL
+        * when observing.
+        * Don't keep observers around if they do not need events. Observing should be used
+        * when user needs to know immedetially about memory card insertion/removed events,
+        * or drive locked/unlocked events.
+        *
+        * @param aObserver observer, ownership does not move.
+        */
+        void RegisterObserverL( MIptvDriveMonitorObserver* aObserver );
+        
+        /**
+        * Removes observer, ownership does not move.
+        * @param aObserver observer to be removed from observers list.
+        */ 
+        void RemoveObserverL( MIptvDriveMonitorObserver* aObserver );
+
+        /**
+        * Updates iAvailableDrives member variable from File server.
+        * This is called in ConstructL() also.
+        */ 
+        void RefreshAvailableDrivesL();
+
+        /**
+        * Returns the position index of aDrive in iAvailableDrives.
+        *
+        * @param aDrive drive to search.
+        * @return Position index of aDrive in iAvailableDrives. If not found,
+        *         KErrNotFound is returned.
+        */        
+        TInt ArrayPos( TInt aDrive );
+
+        /**
+        * Returns the position index of aDrive in iAvailableDrives. If not
+        * found, leaves with KErrNotFound code.
+        *
+        * @param aDrive drive to search.
+        * @return Position index of aDrive in iAvailableDrives.
+        */        
+        TInt ArrayPosL( TInt aDrive );
+
+        /**
+        * Returns the default removable drive (= memory card drive) from iAvailableDrives
+        * array. Leaves with KErrNotFound if not found.
+        */        
+        TInt MemoryCardDriveL();
+
+        /**
+        * Returns the default removable drive (= memory card drive) from iAvailableDrives
+        * array. Returns KErrNotFound if not found.
+        *
+        * @return drive number, or KErrNotFound if not found.
+        */        
+        TInt MemoryCardDrive();
+
+        /**
+        * Returns the default mass memory drive if found from iAvailableDrives.
+        * Mass storege drive means the drive which is preferred for storing large
+        * files in the device, the drive itself can be anything, usually not c though.
+        * Leaves with KErrNotFound if not found.
+        *
+        * @return Drive number.
+        */
+        TInt MassStorageDriveL();
+
+        /**
+        * Returns the default mass memory drive if found from iAvailableDrives.
+        * Mass storege drive means the drive which is preferred for storing large
+        * files in the device, the drive itself can be anything except c-drive.
+        * Returns KErrNotFound if not found.
+        *
+        * @return Drive number, or KErrNotFound if not found.
+        */
+        TInt MassStorageDrive();
+
+        /**
+        * Returns the phone memory drive from iAvailableDrives array.
+        * Leaves with KErrNotFound if not found.
+        *
+        * @return Drive number.
+        */
+        TInt PhoneMemoryDriveL();
+
+        /**
+        * Returns the PhoneMemory drive from iAvailableDrives array.
+        * Returns KErrNotFound if not found.
+        *
+        * @return Drive number, or KErrNotFound if not found.
+        */
+        TInt PhoneMemoryDrive();
+
+        /**
+        * Returns the first fixed (= non removable) drive from iAvailableDrives array.
+        * Leaves with KErrNotFound if not found.
+        *
+        * @param aExcludeCDrive If ETrue, then C-drive is excluded.
+        * @return Drive number.
+        */
+        TInt FixedDriveL( TBool aExcludeCDrive );
+
+        /**
+        * Returns the first fixed (= non removable) drive from iAvailableDrives array.
+        * Returns KErrNotFound if not found.
+        *
+        * @param aExcludeCDrive If ETrue, then C-drive is excluded.
+        * @return Drive number, or KErrNotFound if not found.
+        */
+        TInt FixedDrive( TBool aExcludeCDrive );
+
+        /**
+        * @return ETrue if aDrive is the preferred mass storage drive for the large files.
+        */
+        TBool IsMassStorageDriveL( TInt aDrive );
+
+        /**
+        * @return ETrue if aDrive is memory card type.
+        */
+        TBool IsMemoryCardDriveL( TInt aDrive );
+
+        /**
+        * @return ETrue media is present in the drive. (Memory card is inserted and drive is not locked).
+        */
+        TBool IsPresentL( TInt aDrive );
+
+        /**
+        * @return The system drive. Might not be in iAvailableDrives.
+        */
+        TInt SystemDrive();
+        
+        /**
+        * Finds out if memory card is inserted and not locked.
+        *
+        * @return Returns ETrue is memory card is inserted and usable (not locked), EFalse otherwise.
+        */
+        TBool IsMmcInserted();
+        
+        /**
+        * Gets the used memory from cenrep. If cenrep contains invalid drive or value is not found,
+        * chooses the preferred drive in the following order: 1. mass storage 2. memory card
+        * 3. EDriveC. If cenrep value was not usable, the chosen drive is written to cenrep.
+        * Leaves with system-wide error code if wasn't able to get the used memory.
+        *
+        * @param aUsedMemory The used memory drive is written here.
+        */        
+        void GetUsedMemoryL( TInt& aUsedMemory );
+
+
+    protected: // Functions from base classes
+
+        /**
+        * From CActive, RunL.
+        * Called when operation completes.
+        */
+        void RunL();
+
+        /**
+        * From CActive, cancels request.
+        */
+        void DoCancel();
+
+        /**
+        * From CActive, handles leaves from RunL.
+        */
+        TInt RunError( TInt aError );
+         
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CIptvDriveMonitor();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        *
+        * @param aFileSession
+        */
+        void ConstructL( const RFs& aFileSession );
+
+        /**
+        * Sends event to observers.
+        *
+        * @param aEvent event to send.
+        * @param aDrive drive which caused the event.
+        */
+        void SendEvent( TIptvDriveMonitorEvent::TEvent aEvent, TInt aDrive );
+
+        /**
+        * Compares iPreviousAvailableDrives and iAvailableDrives arrays and
+        * sends appropriate events if they differ.
+        */
+        void CompareOldAndNewAvailableDrives();
+        
+        /**
+        * Returns drive type as a descriptor. For debugging only.
+        * @param aType Drive type, see valid values from e32const.h TMediaType enum.
+        */
+        const TDesC& DriveTypeDes( TInt aType );
+
+        /**
+        * Prints available drives. For debugging only.
+        */
+        void PrintAvailableDrives();
+
+    public:
+    
+        /**
+        * Array of currently available drives. These are updated
+        * with RefreshAvailableDrivesL -method or from file
+        * server event. RefreshAvailableDrivesL is also called upon creation
+        * of this object.
+        * iAvailableDrives array contains drives which are available for mass
+        * storaging videos. If there is hard disk and memory card
+        * available(both e and f-drives), then c-drive is excluded from the array.
+        */
+        RArray<TIptvDriveInfo> iAvailableDrives;
+
+        
+    private:
+
+        /**
+        * Used to detect if refresh had any effect.
+        */
+        RArray<TIptvDriveInfo> iPreviousAvailableDrives;
+
+        /**
+        * Array of observers. Pointers not owned.
+        */
+        RArray<MIptvDriveMonitorObserver*> iObservers;
+        
+        /**
+        * Session to file server.
+        */
+        RFs iFs;
+        
+        /**
+        * ETrue if iFs is provided by the user of this class.
+        */
+        TBool iIfsIsProvidedByUser;
+        
+        /**
+        * Default memory for storing large files.
+        */
+        TInt iDefaultMassStorageDrive;
+        
+        /**
+        * Default memory card.
+        */
+        TInt iDefaultMemoryCardDrive;
+        
+        /**
+        * System drive.
+        */
+        TInt iSystemDrive;
+
+    };
+
+#endif      // CIPTVDRIVEMONITOR_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/inc/CIptvResourceLoader.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,102 @@
+/*
+* 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 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 CIPTVRESOURCELOADER_H
+#define CIPTVRESOURCELOADER_H
+
+// INCLUDES
+#include <e32std.h>
+
+class CCoeEnv;
+class RFs;
+
+// CLASS DECLARATION
+NONSHARABLE_CLASS ( CIptvResourceLoader ) : public CBase
+    {
+    public:
+        /**
+         * Two-phased constructor.
+         * @param 
+         */
+        static CIptvResourceLoader* NewL( CCoeEnv& aCoeEnv );
+
+        /**
+         * Destructor.
+         */
+        virtual ~CIptvResourceLoader();
+
+        /**
+         * Add resource.
+         *
+         * @param aResourceFile Descriptor containing the resource file to be loaded
+         */
+        void AddResourceL( const TDesC& aResourceFile );
+                                
+    private: // New functions           
+
+        /**
+        * C++ default constructor.
+        */
+        CIptvResourceLoader( CCoeEnv& aCoeEnv );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        * @param 
+        */
+        void ConstructL();
+
+        /**
+        * Search resource file.
+        *
+        * @param aFile Buffer descriptor to the resource file
+        * @return System wide error code
+        */
+        TInt SearchResourceFile( const TDesC& aFile );
+                  
+        /**
+        * Add resource file.
+        *
+        * @param aFile Buffer descriptor to the resource file
+        * @return System wide error code
+        */
+        TInt AddResourceFile( const TDesC& aFile );
+                  
+    private:     // Data members
+
+        /**
+        * Resource file offset.
+        */      
+        TInt        iOffset;
+
+        /**
+        * Is resource added
+        */ 
+        TBool       iAdded;
+
+        /**
+        * Reference to CCoeEnv.
+        */ 
+        CCoeEnv&    iCoeEnv;
+
+    };
+
+#endif  // CIPTVRESOURCELOADER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/inc/MIptvDriveMonitorObserver.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,42 @@
+/*
+* 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 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 __MIPTVDRIVEMONITOROBSERVER_H__
+#define __MIPTVDRIVEMONITOROBSERVER_H__
+
+#include "TIptvDriveMonitorEvent.h"
+
+// CLASS DECLARATION
+
+/**
+* Observer for CIptvDriveMonitor class.
+*/
+class MIptvDriveMonitorObserver
+    {
+        
+    public:
+        /**
+        * Handles drive monitor event.
+        *
+        * @param aEvent Event.
+        */
+        virtual void HandleDriveMonitorEvent( TIptvDriveMonitorEvent& aEvent ) = 0;
+    };
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/inc/TIptvDriveInfo.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,103 @@
+/*
+* 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 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:    header file for TIptvDriveInfo class*
+*/
+
+
+
+
+
+#ifndef TIPTVDRIVEINFO_H
+#define TIPTVDRIVEINFO_H
+
+//  INCLUDES
+#include <e32base.h>
+
+const TInt KIptvDriveNameMaxLength = 256;
+
+// CLASS DECLARATION
+/**
+* Container class for storing drive info relevant for Video Center.
+*/
+class TIptvDriveInfo
+    {
+    public:
+
+        /*
+        * Attribute flags used in iFlags member.
+        */
+        enum TDriveAttributes
+            {
+            /**
+            * Media can be removed from the drive, (E or F, depending on hw configuration).
+            * If not set (= 0) then the drive is fixed.
+            */
+            ERemovable = 1 << 0,
+
+            /**
+            * Default mass storage drive.
+            */
+            EMassStorage = 1 << 1,
+            
+            /**
+            * Media is locked.
+            */
+            ELocked = 1 << 2,
+            
+            /**
+            * Media is removed from the drive.
+            */
+            EMediaNotPresent = 1 << 3            
+            };
+            
+        /**
+        * Constructor, clears member variables to zero.
+        */
+        TIptvDriveInfo();
+
+        /**
+        * Destructor.
+        */
+        ~TIptvDriveInfo();
+            
+    public:
+    
+        /**
+        * Drive ID number, 0 points to A:, 1 to B:, 2 to C: and so on.
+        */
+        TInt iDrive;
+
+        /**
+        * Drive char.
+        */
+        TChar iDriveChar;
+        
+        /**
+        * Drive type, same as TDriveInfo::iType.
+        */
+        TInt iType;
+
+        /**
+        * Properties of the drive, see TDriveAttributes -enum for flag values.
+        */
+        TUint32 iFlags;
+        
+        /**
+        * Volume name. Removable drive can contain different volumes (mmc cards). This name
+        * refers to removable item (card label), not the drive. 
+        */
+        TBuf<KIptvDriveNameMaxLength> iVolumeName;
+    };
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/inc/TIptvDriveMonitorEvent.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,124 @@
+/*
+* 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 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:    Drive monitor event object*
+*/
+
+
+
+
+
+#ifndef TIPTVDRIVEMONITOREVENT_H
+#define TIPTVDRIVEMONITOREVENT_H
+
+//  INCLUDES
+#include <e32base.h>
+
+// CONSTANTS
+_LIT( KIptvEmptyDes, "" );
+
+// MACROS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*  Used for sending events from CIptvDriveMonitor to client.
+*/
+class TIptvDriveMonitorEvent
+    {
+    public:
+    
+        /**
+        * Events, used in iEvent member variable.
+        */
+        enum TEvent
+            {
+            /**
+            * Value used at construction.
+            */                
+            ENone,
+            
+            /**
+            * Media was removed (typically memory card).
+            */                
+            EMediaRemoved,
+
+            /**
+            * Media was inserted (typically memory card).
+            */
+            EMediaInserted,
+            
+            /**
+            * Drive was locked.
+            */
+            EDriveLocked,
+            
+            /**
+            * Drive was unlocked.
+            */
+            EDriveUnlocked,
+
+            /**
+            * Drive was mounted.
+            */            
+            EDriveMounted,
+
+            /**
+            * Drive was dismounted.
+            */            
+            EDriveDismounted,
+            
+            /**
+            * Drive volume name was changed.
+            */
+            EDriveVolumeNameChanged
+            };
+            
+    public:  // Constructors and destructor
+        
+        /**
+        * C++ default constructor.
+        */
+        TIptvDriveMonitorEvent();
+
+        /**
+        * Returns event as a descriptor. Used for debugging purposes.
+        *
+        * @param aEvent Event as enum.
+        * @return       Event as a descriptor.
+        */
+        static const TDesC& EventDes( TEvent aEvent );
+
+    public:
+    
+        /**
+        * Identifies the event, see TEvent for values.
+        */
+        TInt  iEvent;
+        
+        /**
+        * The drive which caused the event (a = 0, b = 1, ... etc).
+        */
+        TInt iDrive;
+
+    };
+
+#endif      // TIPTVDRIVEMONITOREVENT_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/inc/vcxhgmyvideos.hrh	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,66 @@
+/*
+* 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:  TVcxHgMyVideosOptionsCmds structure definition*
+*/
+
+
+
+
+#ifndef VCXHGMYVIDEOS_HRH
+#define VCXHGMYVIDEOS_HRH
+
+enum TVcxHgMyVideosOptionsCmds // Options menu in My Videos 
+    {
+    EVcxHgMyVideosCmdPlay = 700,             // Play video
+    EVcxHgMyVideosCmdOpen,                   // Open video view
+    EVcxHgMyVideosCmdDelete,                 // Delete video
+    EVcxHgMyVideosCmdVideoDetails,           // Video details
+    EVcxHgMyVideosCmdShowViaHomenet,         // Show video via Homenet (UPnP renderer)
+    EVcxHgMyVideosCmdStopShowViaHomenet,     // Stop show via Homenet
+    EVcxHgMyVideosCmdMemoryStatus,           // Memory status (Free memory/Used memory)
+    EVcxHgMyVideosCmdSortSubMenu,            // Sort videos sub-menu
+    EVcxHgMyVideosCmdSortByDate,             // Sort submenu: Sort by date
+    EVcxHgMyVideosCmdSortByName,             // Sort submenu: Sort by name
+    EVcxHgMyVideosCmdSortBySize,             // Sort submenu: Sort by size
+    EVcxHgMyVideosCmdCopy,                   // Copy video(s)
+    EVcxHgMyVideosCmdMove,                   // Move video(s)
+    EVcxHgMyVideosCmdMarkUnmarkSubMenu,      // Mark or unmark videos sub-menu
+    EVcxHgMyVideosCmdMark,                   // Mark/Unmark submenu: Mark video
+    EVcxHgMyVideosCmdUnmark,                 // Mark/Unmark submenu: Unmark video 
+    EVcxHgMyVideosCmdMarkAll,                // Mark/Unmark submenu: Mark all videos
+    EVcxHgMyVideosCmdUnmarkAll,              // Mark/Unmark submenu: Unmark all videos
+    EVcxHgMyVideosCmdMarkContext,            // Mark video (context menu)
+#ifdef RD_VIDEO_AS_RINGING_TONE    
+    EVcxHgMyVideosCmdAiwAssign,              // Submenu: Placeholder for "Use video as"
+#endif
+    EVcxHgMyVideosCmdHelp,                   // Help
+    EVcxHgMyVideosCmdExit,                   // Exit Video Storage
+    EVcxHgMyVideosCmdToggleMultipleMarking,  // Toggle marking mode state
+    EVcxHgMyVideosCmdSend,                   // Send video
+    EVcxHgMyVideosCmdNothing,                // Non-functional command
+    EVcxHgMyVideosCmdStartMarking,           // Sets marking mode on
+    EVcxHgMyVideosCmdStopMarking,             // Sets marking mode off
+    EVcxHgMyVideosCmdOpenSettings            // Opens Settings application
+#ifdef RD_VIDEO_AS_RINGING_TONE
+    ,EVcxHgMyVideosCmdAiwBase = 800           // Base number for AIW commands
+#endif
+    };
+
+enum TVcxHgMyVideosMarkButtonStates
+    {
+    EVcxHgMyVideosMarkButtonNormalMode = 0,   // First mark button state (normal)
+    EVcxHgMyVideosMarkButtonMarkingMode       // Second mark button state (latched)
+    };
+
+#endif // VCXHGMYVIDEOS_HRH
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/inc/vcxhgmyvideosaiwmenuhandler.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,157 @@
+/*
+* 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 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:  A class to manage AIW provided menu items*
+*/
+
+
+#ifndef VCXHGMYVIDEOSAIWMENUHANDLER_H
+#define VCXHGMYVIDEOSAIWMENUHANDLER_H
+
+#include <e32std.h>
+
+class CAiwServiceHandler;
+class CEikMenuPane;
+class CMediaRecognizer;
+class CAiwGenericParamList;
+
+/**
+ *  A class to manage AIW provided menu items
+ *
+ */
+NONSHARABLE_CLASS(CHgMyVideosAiwMenuHandler) : public CBase
+    {
+    public:
+
+        CHgMyVideosAiwMenuHandler();
+
+        virtual ~CHgMyVideosAiwMenuHandler();
+
+        /**
+         * Attach AIW menu items to a menu pane.
+         *
+         * @param aMenuPaneId    Menu pane ID where to add AIW menu items
+         */
+        void AttachMenuL( TInt aMenuPaneId );
+
+        /**
+         * Detach AIW menu items from a menu pane.
+         *
+         * @param aMenuPaneId    Menu pane ID where to add AIW menu items
+         */
+        void DetachMenu( TInt aMenuPaneId );
+
+        /**
+         * Pass a submenu to AIW for dynamic initialization.
+         *
+         * @param aMenuPane      Menu pane where to add AIW menu items
+         * @return               ETrue if this menu was handled by AIW
+         */
+        TBool TryHandleSubmenuL( CEikMenuPane* aMenuPane );
+
+        /**
+         * Initialize an AIW provided menu pane.
+         *
+         * @param aResourceId    Resource ID for this menu
+         * @param aMenuPane      Menu pane ID where to add AIW menu items
+         * @param aPath          Full file path
+         * @param aMimeType      MIME type or KNullDesC for autodetect
+         */
+        void InitializeMenuPaneL(
+            TInt aResourceId,
+            CEikMenuPane* aMenuPane,
+            const TDesC& aPath,
+            const TDesC& aMimeType );
+
+        /**
+         * Check if a given command ID is for an AIW command
+         *
+         * @param aCommand       Command ID
+         * @return               ETrue if this is an AIW command
+         */
+        TBool IsAiwCommand( TInt aCommand );
+
+        /**
+         * Execute an AIW command
+         *
+         * @param aCommand       Command ID
+         * @param aPath          Full file path
+         * @param aMimeType      MIME type for track or KNullDesC for autodetect
+         */
+        void HandleAiwCommandL(
+            TInt aCommand,
+            const TDesC& aPath,
+            const TDesC& aMimeType );
+
+        /**
+        *  Closes any potential open AIW menus
+        *
+        */
+        void CloseOpenAiwMenuL();
+        
+        /**
+         *  Verify if AIW menu is active
+         *
+         * @return ETrue if AIW menu is active or EFalse
+         */
+        TBool IsMenuActive();        
+
+    private:
+
+        /**
+        * Fill file path and MIME type generic parameters for AIW.
+        */
+        void FillAiwParamsL(
+            CAiwGenericParamList& aAiwParamsList,
+            const TDesC& aPath,
+            const TDesC& aMimeType );
+
+    private: // data
+
+        /**
+         * AIW service handler implementation.
+         * Own.
+         */
+        CAiwServiceHandler* iAiwServiceHandler;
+
+        /**
+         * Media recognizer for autodetecting MIME types.
+         * Own.
+         */
+        CMediaRecognizer* iMediaRecognizer;
+
+        /**
+         * Flag for active AIW menu, ETrue if active or EFalse if not
+         * 
+         */
+        TBool     iMenuActive;
+        
+        /**
+         * Active AIW command ID when executing AIW command
+         */
+        TInt      iCommand;
+        
+        /**
+         * AIW parameter filepath string
+         * 
+         */
+        HBufC*    iPath;
+        
+        /**
+         * AIW parameter mimetype string
+         * 
+         */
+        HBufC*    iMimeType;
+    };
+
+#endif // VCXHGMYVIDEOSAIWMENUHANDLER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/inc/vcxhgmyvideoscategorylistimpl.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,150 @@
+/*
+* 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 of UI functionality for category list.*
+*/
+
+
+
+
+#ifndef VCXHGMYVIDEOSCATEGORYLISTIMPL_H
+#define VCXHGMYVIDEOSCATEGORYLISTIMPL_H
+
+// INCLUDE FILES
+#include <ganes/HgSelectionObserverIface.h> 
+#include "vcxhgmyvideoslistbase.h"
+
+// FORWARD DECLARATIONS
+class CVcxHgMyVideosCategoryModelHandler;
+class CVcxHgMyVideosModel;
+class CVcxHgMyVideosMainView;
+class CHgScroller;
+
+// CLASS DECLARATION
+
+/**
+ * Implementation of UI functionality for category list.
+ * 
+ * @lib vcxhgmyvideos.lib
+ */
+NONSHARABLE_CLASS( CVcxHgMyVideosCategoryListImpl ) : public CVcxHgMyVideosListBase,
+                                                      public MHgSelectionObserver
+    {
+    public:
+
+        /**
+         * Two-phased constructor.
+         *
+         * @param aModel Component model
+         * @param aView Component view
+         * @param aScroller Hg list control
+         * @return Pointer to newly created instance
+         */
+        static CVcxHgMyVideosCategoryListImpl* NewL(
+            CVcxHgMyVideosModel& aModel,
+            CVcxHgMyVideosMainView& aView,
+            CHgScroller& aScroller );
+
+        /**
+         * Two-phased constructor.
+         *
+         * @param aModel Component model 
+         * @param aView Component view
+         * @param aScroller Hg list control
+         * @return Pointer to newly created instance
+         */
+        static CVcxHgMyVideosCategoryListImpl* NewLC(
+            CVcxHgMyVideosModel& aModel,
+            CVcxHgMyVideosMainView& aView,
+            CHgScroller& aScroller );
+    
+        /**
+        * Destructor.
+        */
+        virtual ~CVcxHgMyVideosCategoryListImpl();
+
+        /**
+         * Activate
+         * 
+         * @param aIndex Index of video list to activate.
+         */
+        void DoListActivateL( TInt aIndex = KErrNotFound );
+
+        /**
+         * Deactivate
+         */
+        void DoListDeactivate();
+
+        /**
+         * Gets list highlight.
+         * 
+         * @return Highlight.
+         */
+        TInt Highlight();     
+
+    public: // From MHgSelectionObserver
+        
+        /**
+         * Handle selection.
+         * 
+         * @param aIndex Selected item index.
+         */
+        void HandleSelectL( TInt aIndex );
+        
+        /**
+         * Handle opening.
+         * 
+         * @param aIndex Opened item index.
+         */
+        void HandleOpenL( TInt aIndex );
+        
+    protected:    
+
+        /**
+         * Default constructor
+         *
+         * @param aModel Component model
+         * @param aView Component view
+         * @param aScroller Hg list control
+         */
+        CVcxHgMyVideosCategoryListImpl( CVcxHgMyVideosModel& iModel,
+                                        CVcxHgMyVideosMainView& aView,
+                                        CHgScroller& aScroller );
+    
+        /**
+         * 2nd phase constructor.
+         */
+        void ConstructL();
+
+        /**
+         * Set empty list text for list control. 
+         */
+        void SetEmptyListTextL();
+
+        /**
+         * Set title text for view.
+         * 
+         * @param aIndex Index of active video list.
+         */
+        void SetTitleTextL( TInt aIndex );
+
+    protected:
+
+        /**
+         * Category model handler.
+         * Own.
+         */
+        CVcxHgMyVideosCategoryModelHandler* iCategoryModel;
+    };
+
+#endif // VCXHGMYVIDEOSCATEGORYLISTIMPL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/inc/vcxhgmyvideoscategorymodelhandler.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,427 @@
+/*
+* 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:      UI level handler for category data.*
+*/
+
+
+
+
+#ifndef VCXHGMYVIDEOSCATEGORYMODELHANDLER_H
+#define VCXHGMYVIDEOSCATEGORYMODELHANDLER_H
+
+// INCLUDE FILES
+#include "vcxhgmyvideoscategorymodelobserver.h"
+
+
+#include <thumbnailmanager.h>
+#include <thumbnailmanagerobserver.h>
+
+// FORWARD DECLARATIONS
+class CMPXMedia;
+class CVcxHgMyVideosModel;
+class CHgScroller;
+class CMPXMedia;
+class CMyVideosIndicator;
+class CVcxHgMyVideosThumbnailManager;
+class TAknsItemID;
+
+// ENUMERATIONS
+enum TVcxHgMyVideosCategoryItemType
+    {
+    TVcxHgMyVideosCategoryItemTypeUndefined = 0,
+    TVcxHgMyVideosCategoryItemTypeUid,
+    TVcxHgMyVideosCategoryItemTypeUrl
+    };
+
+// CONSTANTS
+const TInt KMyVideosTitleStringMaxLength = 256;
+const TInt KMyVideosTitleUrlMaxLength    = 256;
+
+// CLASS DECLARATION
+
+/**
+ * UI level handler for category data.
+ * 
+ * @lib vcxhgmyvideos.lib
+ */
+NONSHARABLE_CLASS( CVcxHgMyVideosCategoryModelHandler ) : 
+        public CBase,
+        public MVcxHgMyVideosCategoryModelObserver,
+        public MThumbnailManagerObserver
+    {
+    public:
+        
+        /**
+         * Default constructor
+         *
+         * @param aModel Application model
+         * @param aScroller Hg list component.
+         */
+        static CVcxHgMyVideosCategoryModelHandler* NewL(
+            CVcxHgMyVideosModel& aModel,
+            CHgScroller& aScroller );  
+        
+        /**
+         * Destructor.
+         */
+        virtual ~CVcxHgMyVideosCategoryModelHandler();
+    
+        /**
+         * Activates category model.
+         */
+        void DoModelActivateL();
+        
+        /**
+         * Deactivates category model.
+         */
+        void DoModelDeactivate();        
+
+        /**
+         * Makes sure model has correct category list.
+         */
+        void GetCategoryListL();        
+        
+        /**
+         * Gets list highlight.
+         * 
+         * @return Highlight.
+         */
+        TInt Highlight();   
+        
+        /**
+         * Returns category index corresponding the Ganes index.
+         * 
+         * @param Ganes scroller list index
+         * @return Index of category
+         */
+        TInt ResolveCategoryId( TInt aScrollerIndex );
+        
+        /**
+         * Plays last watched videdo.
+         * 
+         * @param Ganes scroller list index
+         * @return Index of category
+         */
+        void PlayLastWatchedVidedoL();
+        
+        /**
+         * Returns video indicator.
+         * 
+         * @return Reference to video indicator.
+         */
+        CMyVideosIndicator& VideoIndicatorL();
+        
+        /**
+         * Handles "ExtraItem" list item selection.
+		 *
+		 * @param aCategoryId  Selected category id
+		 * @param aItemType    On return, item type. If both UID and URL were found,
+		 *                     UID type will be returned.
+		 *
+		 * @param aUid         On return, UID if selected item contains UID 
+		 * @param aUrl         On return, URL string if selected item contains URL
+         */
+        void HandleExtraItemSelectionL( TInt aCategoryId,
+                                        TVcxHgMyVideosCategoryItemType& aItemType,
+                                        TUid& aUid,
+                                        TDes& aUrl );
+
+        /**
+         * Create empty icon to be used as category list default icon
+         * 
+         * @return empty icon
+         */
+        CGulIcon* CreateEmptyHgListIconL();
+        
+    public: // From MVcxHgMyVideosCategoryModelObserver
+
+        /**
+         * Called when a list of categories is available.
+         * Ownership of array is transferred.
+         * 
+         * @param aCategoryList List of categories
+         * @param aIsPartial    ETrue if list fetching continues, and KVcxMessageMyVideosListComplete 
+         *                      message will arrive. EFalse if this is last event of list fetching.
+         */
+        void NewCategoryListL( CMPXMediaArray* aCategoryList, TBool aIsPartial );
+        
+        /**
+         * Called when the list of categories has been modified.
+         */
+        void CategoryListModifiedL();         
+
+        /**
+         * Called when a single category has been modified (add/remove/modify).
+         * 
+         * @param aEventType Type of modification event (add/remove/modify).
+         * @param aMpxItemId MPX Item Id of the modified item.
+         */
+        void CategoryModifiedL( TMPXChangeEventType aEventType,
+                                TMPXItemId& aMpxItemId );
+        
+        /**
+         * Called when category list items have been fetched.
+		 */
+        void CategoryListFetchingCompletedL();
+
+    public: // From MThumbnailManagerObserver)
+
+        /**
+         * Preview thumbnail generation or loading is complete.
+         *
+         * @param aThumbnail     An object representing the resulting thumbnail.
+         * @param aId            Request ID for the operation
+         */
+        void ThumbnailPreviewReady( MThumbnailData& aThumbnail,
+            TThumbnailRequestId aId );
+
+        /**
+         * Final thumbnail bitmap generation or loading is complete.
+         *
+         * @param aError         Error code.
+         * @param aThumbnail     An object representing the resulting thumbnail.
+         * @param aId            Request ID for the operation.
+         */
+        void ThumbnailReady( TInt aError, MThumbnailData& aThumbnail,
+            TThumbnailRequestId aId );
+
+    private:    
+        
+        /**
+         * C++ constructor
+         *
+         * @param aModel Application model
+         * @param aScroller Hg list component.
+         */
+        CVcxHgMyVideosCategoryModelHandler(
+            CVcxHgMyVideosModel& aModel,
+            CHgScroller& aScroller );  
+
+        /**
+         * Loads name of category from resources.
+         * 
+         * @param aCategoryId Index of category.
+         * @return Name of category.
+         */
+        HBufC* GetCategoryNameLC( TInt aCategoryId );
+
+        /**
+         * Loads icon for category
+         * 
+         * @param aCategoryId Id of category
+         * @return Category icon
+         */
+        CGulIcon* GetCategoryIconL( TInt aCategoryId );
+
+        /**
+         * Formats second row text for categories.
+         * 
+         * @param aMedia MPX media object for row.
+         * @return Second row text for category.
+         */
+        HBufC* FormatCategorySecondRowLC( CMPXMedia& aMedia );        
+        
+        /**
+         * Formats second row text for categories.
+         * 
+		 * @param   aCategoryId Category id.
+		 * @return  Second row text for category.
+         */
+        HBufC* FormatCategorySecondRowLC( TInt aCategoryId );
+        
+        /**
+         * Translates MPX Item Id to index on UI list. 
+         * 
+         * @param aMpxItemId MPX Item Id.
+         * @return Index on UI, or KErrNotFound.
+         */
+        TInt UiIndexFromMpxItemId( TMPXItemId& aMpxItemId );
+
+        /**
+         * Updates the whole category list.
+         */
+        void UpdateCategoryListL();
+        
+        /**
+         * Updates list item from specified index.
+         *
+         * @param aListIndex Item's index on UI list.
+         */
+        void UpdateCategoryListItemL( TInt aListIndex );
+        
+        /**
+         * Removes list item from specefied index.
+         *
+         * @param aListIndex Item's index on UI list.
+         */
+        void RemoveCategoryListItem( TInt aListIndex );
+
+        /**
+         * Goes through given number of categories and
+         * fills iCategoryIdArray from the accepted ones
+         */
+        void MakeCategoryIdArrayL();
+        
+        /**
+         * Checks if the given category is accepted or not.
+         *
+         * @param aCategoryId category id
+         * @return TBool if accepted
+         */
+        TBool AcceptCategory( TInt aCategoryId );
+        
+        /**
+         * Finds correct array index for given category id
+         * from iCategoryIdAraay
+         *
+         * @param aCategoryId category id to be found
+         * @return Array index
+         */
+        TInt ResolveCategoryArrayIndexById( TInt aCategoryId );
+        
+        /**
+         * @param aCategoryId Category id to be found
+         * @return CMPXMedia
+         */
+        CMPXMedia* GetCategoryDataL( TInt aCategoryId );
+		
+        /**
+         * Gets the last watched videos icon from tbn server.
+		 * Result is returned asynchronously to ThumbnailReady callback.
+         */
+        void LoadLastWatchedIconL();
+        
+        /**
+         * Clears the last watched videos icon and indicator.
+         */
+        void ClearLastWatchedIconL();
+
+        /**
+         * Set indicator for last watched item
+         */
+        void SetLastWatchedIndicatorL();
+
+        /**
+         * Final thumbnail bitmap generation or loading is complete.
+         * @param aError         Error code.
+         * @param aThumbnail     An object representing the resulting thumbnail.
+         * @param aId            Request ID for the operation.
+         */
+        void ThumbnailReadyL( TInt aError, MThumbnailData& aThumbnail,
+            TThumbnailRequestId aId );
+        
+        /**
+         * Create hg list icon from file
+         * 
+         * @param aSkinId Skin-Id of the icon
+         * @param aFileName mif file name
+         * @param aBitmapId bitmap index in mif file (used if skin-Id is not found)
+         * @param aMaskId mask index in mif file (used if skin-Id is not found)
+         * @return Icon
+         */
+        CGulIcon* CreateHgListIconL(
+                const TAknsItemID& aSkinId,
+                const TFileName& aFileName,
+                TInt aBitmapId,
+                TInt aMaskId );
+        
+        /**
+         * Check, if the last watched cenrep key is set
+         * 
+         * @return ETrue if the key has been set, otherwise EFalse
+         */
+        TBool LastWatchedSetL();
+        
+        /**
+         * Check, if the preloaded video exists
+         * If the key exists, but the file is missing, it is considered, 
+         * as it does not exist.
+         *  
+         * @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:
+    
+        /**
+         * Application model.
+         * Not own.
+         */
+        CVcxHgMyVideosModel& iModel;
+        
+        /**
+         * Reference to Hg list component.
+         * Not own.
+         */
+        CHgScroller& iScroller;
+        
+        /**
+         * Array of categories.
+         * Own.
+         */
+        CMPXMediaArray* iCategoryList;
+        
+        /**
+         * TArray containing category ID's. Each index 
+         * corresponds to the scroller list (eg. correct
+         * category ID for the 1st item in scroller list can
+         * be found from index 0).  
+         */
+        RArray<TInt> iCategoryIdArray;
+        
+        /**
+         * CVcxHgMyVideosThumbnailManager instance, not own.
+         */
+        CVcxHgMyVideosThumbnailManager& iTnManager;
+        
+        /**
+         * Request ID of ongoing thumbnail request, or KErrNotFound.
+         */
+        TThumbnailRequestId iTnRequestId;
+        
+        /**
+         * 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/inc/vcxhgmyvideoscategorymodelobserver.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,75 @@
+/*
+* 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:      Observer interface for category data changes.*
+*/
+
+
+
+
+#ifndef VCXHGMYVIDEOSCATEGORYMODELOBSERVER_H
+#define VCXHGMYVIDEOSCATEGORYMODELOBSERVER_H
+
+// INCLUDES
+
+#include <mpxcollectionmessagedefs.h>
+#include <mpxitemid.h>
+
+// FORWARD DECLARATIONS
+
+class CMPXMediaArray;
+class CMPXMedia;
+
+// CLASS DECLARATION
+
+/**
+ * Observer interface for category data changes.
+ * 
+ * @lib vcxhgmyvideos.lib
+ */
+NONSHARABLE_CLASS( MVcxHgMyVideosCategoryModelObserver )
+    {
+    public:
+    
+        /**
+         * Called when a list of categories is available.
+         * Ownership of array is transferred.
+         * 
+         * @param aCategoryList List of categories
+         * @param aIsPartial    ETrue if list fetching continues, and KVcxMessageMyVideosListComplete 
+         *                      message will arrive. EFalse if this is last event of list fetching.
+         */
+        virtual void NewCategoryListL( CMPXMediaArray* aCategoryList, TBool aIsPartial ) = 0;
+
+        /**
+         * Called when the list of categories has been modified.
+         */
+        virtual void CategoryListModifiedL() = 0;
+
+        /**
+         * Called when a single category has been modified (add/remove/modify).
+         * 
+         * @param aEventType Type of modification event (add/remove/modify).
+         * @param aMpxItemId MPX Item Id of the modified item.
+         */
+        virtual void CategoryModifiedL( TMPXChangeEventType aEventType, 
+                                        TMPXItemId& aMpxItemId ) = 0;
+        
+        /**
+         * Called when category list items have been fetched.
+         */
+        virtual void CategoryListFetchingCompletedL() = 0;
+
+    };
+
+#endif // VCXHGMYVIDEOSCATEGORYMODELOBSERVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/inc/vcxhgmyvideoscenrepkeys.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,75 @@
+
+/*
+* 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 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 VCXHGMYVIDEOSMAINVIEWCENREPKEYS_H
+#define VCXHGMYVIDEOSMAINVIEWCENREPKEYS_H
+
+
+enum TMyVideosListItemType
+	{
+	EMyVideosListItemTypeEmpty = 0,
+	EMyVideosListItemTypeLastWatched,
+	EMyVideosListItemTypeCapturedVideos,
+	EMyVideosListItemTypeOtherVideos,
+	EMyVideosListItemTypeExtra1,
+	EMyVideosListItemTypeExtra2,
+	EMyVideosListItemTypeExtra3
+	};
+
+// CONSTANTS 
+
+// CenRep: UID
+const TUid KMyVideosMainViewCenRepUid = { 0x20021191 };
+
+// CenRep: Keys
+const TInt KCRVideoPlayerItemLocation1            = 0x01;
+const TInt KCRVideoPlayerItemLocation2            = 0x02;
+const TInt KCRVideoPlayerItemLocation3            = 0x03;
+const TInt KCRVideoPlayerItemLocation4            = 0x04;
+const TInt KCRVideoPlayerItemLocation5            = 0x05;
+const TInt KCRVideoPlayerItemLocation6            = 0x06;
+const TInt KCRVideoPlayerItemLocation7            = 0x07;
+
+const TInt KCRVideoPlayerCapturedVideosIconPath   = 0x0A;
+const TInt KCRVideoPlayerOtherVideosIconPath      = 0x0B;
+const TInt KCRVideoPlayerPreloadedVideoPath       = 0x0C;
+const TInt KCRVideoPlayerPreloadedVideoName       = 0x0D;
+const TInt KCRVideoPlayerPreloadedVideoDescription= 0x0E;
+
+const TInt KCRVideoPlayerExtraItem1IconPath       = 0x10;
+const TInt KCRVideoPlayerExtraItem1Title          = 0x11;
+const TInt KCRVideoPlayerExtraItem1Text           = 0x12;
+const TInt KCRVideoPlayerExtraItem1Url            = 0x13;
+const TInt KCRVideoPlayerExtraItem1Uid            = 0x14;
+
+const TInt KCRVideoPlayerExtraItem2IconPath       = 0x20;
+const TInt KCRVideoPlayerExtraItem2Title          = 0x21;
+const TInt KCRVideoPlayerExtraItem2Text           = 0x22;
+const TInt KCRVideoPlayerExtraItem2Url            = 0x23;
+const TInt KCRVideoPlayerExtraItem2Uid            = 0x24;
+
+const TInt KCRVideoPlayerExtraItem3IconPath       = 0x30;
+const TInt KCRVideoPlayerExtraItem3Title          = 0x31;
+const TInt KCRVideoPlayerExtraItem3Text           = 0x32;
+const TInt KCRVideoPlayerExtraItem3Url            = 0x33;
+const TInt KCRVideoPlayerExtraItem3Uid            = 0x34;
+
+#endif //VCXHGMYVIDEOSMAINVIEWCENREPKEYS_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/inc/vcxhgmyvideoscollectionclient.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,414 @@
+/*
+* 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:      Client class for My Videos MPX Collection.*
+*/
+
+
+
+
+#ifndef VCXHGMYVIDEOSCOLLECTIONCLIENT_H
+#define VCXHGMYVIDEOSCOLLECTIONCLIENT_H
+
+// INCLUDE FILES
+#include <coemain.h>
+#include <mpxcollectionobserver.h>
+
+// FORWARD DECLARATIONS
+class MMPXCollectionUtility;
+class MVcxHgMyVideosCategoryModelObserver;
+class MVcxHgMyVideosVideoModelObserver;
+class CVcxHgMyVideosDownloadClient;
+
+// CLASS DECLARATION
+
+/**
+ * Client class for My Videos MPX Collection.
+ *
+ * @lib vcxhgmyvideos.lib
+ */
+NONSHARABLE_CLASS( CVcxHgMyVideosCollectionClient ) : public CBase,
+                                                      public MMPXCollectionObserver
+    {
+    public:
+        
+        enum TVcxHgMyVideosCollectionCommand
+            {
+            EVcxHgMyVideosCollectionCommandNone = 0,
+            EVcxHgMyVideosCollectionCommandMultiDelete_Starting,
+            EVcxHgMyVideosCollectionCommandMultiDelete_Started,
+            EVcxHgMyVideosCollectionCommandMultiDelete_Finished,
+            EVcxHgMyVideosCollectionCommandCancelDelete_Requested,
+            EVcxHgMyVideosCollectionCommandCancelDelete_Completed,
+            EVcxHgMyVideosCollectionCommandResort,
+            EVcxHgMyVideosCollectionCommandMoveCopy_Starting,
+            EVcxHgMyVideosCollectionCommandMoveCopy_Started,
+            EVcxHgMyVideosCollectionCommandMoveCopy_Finished,
+            EVcxHgMyVideosCollectionCommandCancelMoveCopy_Requested,
+            EVcxHgMyVideosCollectionCommandCancelMoveCopy_Completed,
+            EVcxHgMyVideosCollectionCommandVideoDetails_Requested
+            };
+        
+    public: // Constructors and destructor
+
+        /**
+         * Two-phased constructor.
+         *
+         * @return New object.
+         */
+        static CVcxHgMyVideosCollectionClient* NewL();
+
+        /**
+         * Two-phased constructor.
+         *
+         * @return New object.
+         */
+        static CVcxHgMyVideosCollectionClient* NewLC();
+
+        /**
+         * Destructor.
+         */
+        virtual ~CVcxHgMyVideosCollectionClient();
+
+    public:
+
+        /**
+         * Returns Download client.
+         *
+         * @return Reference to Download client.
+         */
+        CVcxHgMyVideosDownloadClient& DownloadClient();
+        
+        /**
+         * Returns true if object has pending command for MPX Collection Utility.
+         * 
+         * @return ETrue if command is pending.
+         */
+        TBool HasPendingCommand();        
+        
+        /**
+         * Called to set category data observer. Can be called with NULL to
+         * reset the observer.
+         * 
+         * @param aCategoryModelObserver Observer.
+         */
+        void SetCategoryModelObserver(
+                MVcxHgMyVideosCategoryModelObserver* aCategoryModelObserver ); 
+
+        /**
+         * Called to set video data observer. Can be called with NULL to
+         * reset the observer.
+         * 
+         * @param aVideoModelObserver Observer.
+         */
+        void SetVideoModelObserver(
+                MVcxHgMyVideosVideoModelObserver* aVideoModelObserver );
+        
+        /**
+         * When called, starts fetching category list. Category list is returned
+         * through callback interface MVcxHgMyVideosCategoryModelObserver.
+         */
+        void GetCategoryListL();        
+        
+        /**
+         * When called, starts fetching video list. Video list is returned
+         * through callback interface MVcxHgMyVideosVideoModelObserver.
+         * 
+         * @param aIndex Index of video list to fetch.
+         */
+        void GetVideoListL( TInt aIndex );
+                
+        /**
+         * Translates array index to MPX item id by reading the value from array.
+         *
+         * @param aArrayIndex Index in array.
+         * @param aArray Array of MPX Media objects.
+         * @return MPX item id
+         */
+        TMPXItemId ArrayIndexToMpxItemIdL( TInt aArrayIndex, CMPXMediaArray* aArray );
+ 
+        /**
+         * Deletes an array of videos.
+         * 
+         * @param aMediasToDelete Array of MPX Media objects to delete.
+         */
+        void DeleteVideosL( CMPXMediaArray* aMediasToDelete );
+
+        /**
+         * Cancels ongoing deletion of videos. See DeleteVideosL().
+         */
+        void CancelDeleteVideosL();
+
+        /**
+         * Moves or copies array of videos.
+         * 
+         * @param mediasToMoveOrCopy Array of MPX Media objects to move/copy.
+         * @param aTargetDrive Target drive.
+         * @param aCopy ETrue of copy operation, EFalse if move.
+         */
+        void MoveOrCopyVideosL( CMPXMediaArray* mediasToMoveOrCopy,
+                                TInt aTargetDrive,
+                                TBool aCopy );
+        
+        /**
+         * Cancels ongoing move/copy operation of videos. See MoveOrCopyVideosL().
+         */
+        void CancelMoveOrCopyVideosL();
+
+        /**
+         * Play a video with given MPX item id.
+         *
+         * @param aMpxItemId MPX item id
+         */
+        void PlayVideoL( TMPXItemId aMpxItemId );
+       
+        /**
+         * Fetches MPX Media object based on MPX ID. Fetched MPX Media object
+         * is returned through callback interface MVcxHgMyVideosVideoModelObserver.
+         * 
+         * @param aMpxId MPX ID.
+         */
+        void FetchMpxMediaByMpxIdL( TMPXItemId& aMpxId );
+        
+        /**
+         * Gets all details for the selected MPX Media object.
+		 * Result will be returned in HandleCommandComplete().
+         * 
+         * @param aMpxId MPX ID.
+         */
+        void GetVideoDetailsL( TMPXItemId& aMpxId );
+                
+        /**
+         * Sets new general flags to given MPX Media object.
+         * 
+         * @param aMpxItemId MpxId of media object for which flags are set.
+         * @param aFlags New flags to be set.         
+         */
+        void SetFlagsL( TMPXItemId aMpxItemId, TUint32 aFlags );
+
+    public: // From MMPXCollectionObserver
+
+        /**
+         * From MMPXCollectionObserver->MMPXCollectionMediaObserver
+         * Handle extended media properties
+         *
+         * @param aMedia media 
+         * @param aError error code    
+         */
+        void HandleCollectionMediaL( const CMPXMedia& aMedia, TInt aError );
+
+        /** 
+         * From MMPXCollectionUtilityObserver.
+         * Handle collection message
+         * NOTE: only one of HandleCollectionMessage callback can be implemented
+         * 
+         * @param aMessage collection message, ownership not transferred. 
+         *        Please check aMsg is not NULL before using it. If aErr is not 
+         *        KErrNone, plugin might still call back with more info in the aMsg.
+         * @param aErr system error code.
+         */
+        void HandleCollectionMessage( CMPXMessage* aMsg, TInt aErr ); 
+
+        /**
+         * From MMPXCollectionUtilityObserver.
+         * Handles the collection entries being opened. Typically called
+         * when client has Open()'d a folder
+         *
+         * @param aEntries collection entries opened
+         * @param aIndex focused entry
+         * @param aComplete ETrue no more entries. EFalse more entries
+         *                  expected
+         * @param aError error code   
+         */
+        void HandleOpenL( const CMPXMedia& aEntries,
+                          TInt aIndex,
+                          TBool aComplete,
+                          TInt aError );
+    
+        /**
+         * From MMPXCollectionUtilityObserver.
+         * Handles the item being opened. Typically called
+         * when client has Open()'d an item. Client typically responds by
+         * 'playing' the item via the playlist
+         *
+         * @param aPlaylist collection playlist
+         * @param aError error code   
+         */                         
+        void HandleOpenL( const CMPXCollectionPlaylist& aPlaylist, TInt aError );
+
+        /**
+         * From MMPXCollectionUtilityObserver.
+         * Handle completion of a asynchronous command
+         *
+         * @param aCommandResult result of the command, NULL if error
+         * @param aError error code    
+         */
+        void HandleCommandComplete( CMPXCommand* aCommandResult, TInt aError );
+
+    protected: // Constructors
+
+        /**
+         * Default C++ constructor. 
+         */
+        CVcxHgMyVideosCollectionClient();
+
+        /**
+         * Symbian 2nd phase constructor.
+         */
+        void ConstructL();
+
+        /** 
+         * Called by HandleCollectionMessage(). Handles collection messages.
+         * 
+         * @param aMessage collection message.
+         * @param aError system error code.
+         */
+        void HandleCollectionMessageL( CMPXMessage* aMessage, TInt aError );
+
+        /** 
+         * Called by HandleCollectionMessageL(). Handles single collection message.
+         * 
+         * @param aMessage collection message.
+         * @param aError system error code.
+         */
+        void HandleSingleCollectionMessageL( CMPXMessage* aMessage, TInt aError );
+        
+        /**
+         * Returns the current level of collection.
+         */
+        TInt CollectionLevelL();
+        
+        /**
+         * Handles item addition message, called by HandleSingleCollectionMessageL().
+         * 
+         * @param aMessage collection message.
+         * @param aError system error code. 
+         */
+        void HandleMyVideosItemsAppendedL( CMPXMessage* aMessage, TInt aError );        
+        
+        /**
+         * Handles item changed message, called by HandleSingleCollectionMessageL().
+         * 
+         * @param aMessage collection message.
+         * @param aError system error code. 
+         */
+        void HandleMyVideosItemsChangedL( CMPXMessage* aMessage, TInt aError );        
+        
+        /**
+         * Handles delete related messages, called by HandleSingleCollectionMessageL().
+         * 
+         * @param aMessage collection message.
+         * @param aError system error code. 
+         */
+        void HandleMyVideosDeleteMessageL( CMPXMessage* aMessage, TInt aError );        
+
+        /**
+         * Handles move or copy related messages, called by HandleSingleCollectionMessageL().
+         * 
+         * @param aMessage collection message.
+         * @param aError system error code. 
+         */
+        void HandleMyVideosMoveOrCopyMessageL( CMPXMessage* aMessage, TInt aError );        
+
+        /**
+         * Handles response message when MPX Media object requested.
+         *
+         * @param aMessage collection message.
+         * @param aError system error code.
+         */
+        void HandleGetMediasByMpxIdRespL( CMPXMessage* aMessage, TInt aError );
+        
+        /**
+         * Handles list complete message, called by HandleSingleCollectionMessageL().
+         * 
+         * @param aMessage collection message.
+         * @param aError system error code. 
+         */
+        void HandleMyVideosListCompleteL( CMPXMessage* aMessage, TInt aError );
+        
+        /**
+         * Handles response message when video details requested.
+         * 
+         * @param aMessage collection message.
+         * @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:
+        
+        enum TVcxHgCollectionOpenStatus
+            {
+            EVcxHgCollectionNotOpen = 0,
+            EVcxHgCollectionOpening,
+            EVcxHgCollectionOpened            
+            };
+        
+    protected:
+
+        /**
+         * Pointer to MPX Collection utility.
+         * Own.
+         */
+        MMPXCollectionUtility* iCollectionUtility;
+        
+        /**
+         * Pointer to Download client.
+         * Own.
+         */
+        CVcxHgMyVideosDownloadClient* iDownloadClient;
+                
+        /**
+         * Pointer to observer of category model.
+         * Not own.
+         */
+        MVcxHgMyVideosCategoryModelObserver* iCategoryModelObserver;
+        
+        /**
+         * Pointer to observer of video model.
+         * Not own.
+         */
+        MVcxHgMyVideosVideoModelObserver* iVideoModelObserver;
+        
+        /**
+         * Variable for storing My Videos collection opening status.
+         */
+        TVcxHgCollectionOpenStatus iCollectionOpenStatus;
+        
+        /**
+         * Variable for storing pending collection command.
+         */
+        TVcxHgMyVideosCollectionCommand iPendingCommand;
+
+		/**
+		 * Variable for storing current collection level.
+		 */
+        TInt iCollectionLevel;
+        
+#if defined(_DEBUG) && IPTV_LOGGING_METHOD != 0
+    private:
+        /**
+         * Debug only: Prints list of videos to debug output.
+         */
+        void DebugPrintVideoListL( CMPXMediaArray* aVideoArray );
+#endif // _DEBUG && IPTV_LOGGING_METHOD        
+
+    };
+
+#endif // VCXHGMYVIDEOSCOLLECTIONCLIENT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/inc/vcxhgmyvideosdownloadclient.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,143 @@
+/*
+* 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:   CVcxHgMyVideosDownloadClient class definition*
+*/
+
+
+
+
+#ifndef VCXHGMYVIDEOSDOWNLOADCLIENT_H
+#define VCXHGMYVIDEOSDOWNLOADCLIENT_H
+
+// INCLUDE FILES
+#include <coemain.h>
+#include "vcxhgmyvideoscollectionclient.h"
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+ * 
+ *
+ * @lib vcxhgmyvideos.lib
+ */
+NONSHARABLE_CLASS( CVcxHgMyVideosDownloadClient ) : public CBase
+    {
+    public:
+        
+        enum TVcxHgMyVideosDownloadCommand
+            {
+            EVcxHgMyVideosDownloadCommandNone   = 0,
+            EVcxHgMyVideosDownloadCommandResume = 1,
+            EVcxHgMyVideosDownloadCommandCancel = 2            
+            };
+        
+    public: // Constructors and destructor
+
+        /**
+         * Two-phased constructor.
+         *
+         * @param aCollectionClient Reference to MPX Collection client.
+         * @param aCollectionUtility Reference to MPX Collection Utility.
+         * @return New object.
+         */
+        static CVcxHgMyVideosDownloadClient* NewL(
+                   CVcxHgMyVideosCollectionClient& aCollectionClient,
+                   MMPXCollectionUtility& aCollectionUtility);
+
+        /**
+         * Two-phased constructor.
+         *
+         * @param aCollectionClient Reference to MPX Collection client.
+         * @param aCollectionUtility Reference to MPX Collection Utility.
+         * @return New object.
+         */
+        static CVcxHgMyVideosDownloadClient* NewLC(
+                   CVcxHgMyVideosCollectionClient& aCollectionClient,
+                   MMPXCollectionUtility& aCollectionUtility);
+
+        /**
+         * Destructor.
+         */
+        virtual ~CVcxHgMyVideosDownloadClient();
+
+    public:
+        
+        /**
+         * Resumes a paused or failed video download.
+         * 
+         * @param aMpxMedia Reference to MPX media object to resume.
+         */
+        void ResumeDownloadL( const CMPXMedia& aMpxMedia );
+        
+        /**
+         * Cancels an ongoing video download.
+         * 
+         * @param aMpxMedia Reference to MPX media object to cancel.
+         */
+        void CancelDownloadL( const CMPXMedia& aMpxMedia );
+
+        /**
+         * Returns true if object has pending command for MPX Collection Utility.
+         * 
+         * @return ETrue if command is pending.
+         */
+        TBool HasPendingCommand();
+        
+        /**
+         * Handles completion of MPX Collection Utility command.
+         * 
+         * @param aError Error code about command completion.
+         */
+        void CommandCompleteL( TInt aError );
+        
+    protected: // Constructors
+
+        /**
+         * Default C++ constructor. 
+         *
+         * @param aCollectionClient Reference to MPX Collection client.
+         * @param aCollectionUtility Reference to MPX Collection Utility.
+         */
+        CVcxHgMyVideosDownloadClient(
+            CVcxHgMyVideosCollectionClient& aCollectionClient,
+            MMPXCollectionUtility& aCollectionUtility);
+
+        /**
+         * Symbian 2nd phase constructor.
+         */
+        void ConstructL();
+        
+    protected:
+
+		/**
+		 * Reference to MPX Collection client.
+		 * Not own.
+		 */
+		CVcxHgMyVideosCollectionClient& iCollectionClient;
+
+		/**
+		 * Reference to MPX Collection Utility.
+		 * Not own.
+		 */
+		MMPXCollectionUtility& iCollectionUtility;
+		
+		/**
+		 * Variable for storing pending download command.
+		 */
+		TVcxHgMyVideosDownloadCommand iPendingCommand;
+    };
+
+#endif // VCXHGMYVIDEOSDOWNLOADCLIENT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/inc/vcxhgmyvideosfulldrminfo.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,61 @@
+/*
+* 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:   TVcxHgMyVideosFullDrmInfo class definition*
+*/
+
+
+
+
+#ifndef VCXHGMYVIDEOSFULLDRMINFO_H
+#define VCXHGMYVIDEOSFULLDRMINFO_H
+
+// INCLUDE FILES
+#include <e32base.h>
+#include <badesca.h>
+#include <coemain.h>
+
+/**
+ * Collects the drm info of item and puts strings to given array
+ *
+ * @lib 
+ */
+class TVcxHgMyVideosFullDrmInfo
+    {
+    public: // Constructors and destructor
+
+        /**
+         * Static method for getting full OMA or WM DRM information of video clip.
+         *
+         * @param aArray Array which is filled with DRM information, to be 
+         *               displayed in info popup.
+         * @param aFullPath Full path to item which DRM info is needed.
+         */
+        static void GetFullDrmInfoL( CDesCArray& aArray,
+                                     const TDesC& aFullPath );
+
+    protected:
+
+        /**
+         * C++ default constructor.
+         */
+        TVcxHgMyVideosFullDrmInfo();
+        
+
+        /**
+         * Destructor.
+         */
+        ~TVcxHgMyVideosFullDrmInfo();
+    };
+
+#endif // VCXHGMYVIDEOSFULLDRMINFO_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/inc/vcxhgmyvideosindicatorhelper.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,83 @@
+/*
+* 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:   TVcxHgMyVideosIndicatorHelper class definition*
+*/
+
+
+
+
+#ifndef VCXHGMYVIDEOSINDICATORHELPER_H
+#define VCXHGMYVIDEOSINDICATORHELPER_H
+
+// INCLUDE FILES
+#include <coemain.h>
+ 
+// FORWARD DECLARATIONS
+class CVcxHgMyVideosModel;
+class CFbsBitmap;
+
+// CLASS DECLARATION
+
+/**
+ *
+ * @lib vcxhgmyvideos.lib
+ */
+NONSHARABLE_CLASS( TVcxHgMyVideosIndicatorHelper )  
+    {
+    public:
+
+        /**
+         * DRM status of video, for indicator selection.
+         */
+        enum TIndicatorDrmStatus
+            {
+            EIndicatorDrmStatusUnknown = 0,
+            EIndicatorDrmStatusValid,
+            EIndicatorDrmStatusExpired
+            };
+
+    public:        
+        
+        /**
+         * Default constructor
+         *
+         */
+        TVcxHgMyVideosIndicatorHelper();
+
+        /**
+         * Destructor.
+         */
+        virtual ~TVcxHgMyVideosIndicatorHelper();        
+
+        /**
+         * Selectes which indicators should be shown for a video.
+         * 
+         * @param aModel Reference to component's model.
+         * @param aNewVideo ETrue if video is new.
+         * @param aRecordingOngoing ETrue if video is recording.
+         * @param aPath Path to video.
+         * @param aDrmStatus TIndicatorDrmStatus.
+         * @param aIndicator1 On return, indicator 1.
+         * @param aIndicator2 On return, indicator 2.
+         */
+        void GetIndicatorsForVideoL( CVcxHgMyVideosModel& aModel,
+                                     TBool aNewVideo,
+                                     TBool aRecordingOngoing,
+                                     const TDesC& aPath,
+                                     TIndicatorDrmStatus aDrmStatus,
+                                     TInt& aIndicator1,
+                                     TInt& aIndicator2 );           
+    };
+
+#endif // VCXHGMYVIDEOSINDICATORHELPER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/inc/vcxhgmyvideoslistbase.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,150 @@
+/*
+* 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:      Base class for Hg based video list implementations.*
+*/
+
+
+
+
+#ifndef VCXHGMYVIDEOSLISTBASE_H
+#define VCXHGMYVIDEOSLISTBASE_H
+
+// INCLUDE FILES
+#include <e32def.h>
+#include <e32base.h>
+#include <eikmenup.h>
+ 
+// FORWARD DECLARATIONS
+class CVcxHgMyVideosModel;
+class CVcxHgMyVideosMainView;
+class CHgScroller;
+
+// CLASS DECLARATION
+
+/**
+ * Base class for video list implementations.
+ * 
+ * @lib vcxhgmyvideos.lib
+ */
+NONSHARABLE_CLASS( CVcxHgMyVideosListBase ) : public CBase
+    {
+    public:
+    
+        /**
+        * Destructor.
+        */
+        virtual ~CVcxHgMyVideosListBase();
+
+        /**
+         * Activate.
+         * 
+         * @param aIndex Index of parent list item to activate.
+         */
+        void DoListActivateL( TInt aIndex = KErrNotFound );
+
+        /**
+         * Deactivate.
+         */
+        void DoListDeactivate();
+        
+        /**
+         * Update control layout.
+         *
+         * @param aRect New rectangle.
+         */
+        void UpdateLayout( TRect& aRect );
+        
+        /**
+         * Gets list highlight.
+         * 
+         * @return Highlight.
+         */
+        TInt Highlight();
+
+        /**
+         * Set empty list text for list control. 
+         *
+         * @param aResourceId Resource id
+         */
+        void SetEmptyListTextByResourceL( TInt aResourceId );        
+
+        /**
+         * Set title text for view.
+         * 
+         * @param aResourceId Resource id
+         */
+        void SetTitleTextByResourceL( TInt aResourceId );
+
+        /**
+         * Handles dynamic initialisation of menu items specific to video list.
+         * 
+         * @param aResourceId Resource ID of menu to be activated.
+         * @param aMenuPane Pointer to menu pane.
+         */
+        void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );        
+        
+    public:
+        
+        /**
+         * Set empty list text for list control. Deriving class must implement. 
+         */        
+        virtual void SetEmptyListTextL() = 0;
+    
+        /**
+         * Set title text for view. Deriving class must implement.
+         * 
+         * @param aIndex Index of parent list item (title based on parent).
+         */      
+        virtual void SetTitleTextL( TInt aIndex ) = 0;
+                
+    protected:    
+
+        /**
+         * Default constructor
+         *
+         * @param aModel Component model
+         * @param aView Component view
+         * @param aScroller Hg list control
+         */
+        CVcxHgMyVideosListBase( CVcxHgMyVideosModel& iModel,
+                                CVcxHgMyVideosMainView& aView,
+                                CHgScroller& aScroller );
+
+        /**
+         * 2nd phase constructor.
+         */
+        void ConstructL();
+
+    protected:
+
+        /**
+         * Reference to component model.
+         * Not Own.
+         */
+        CVcxHgMyVideosModel& iModel;
+
+        /**
+         * Reference to component view.
+         * Not own.
+         */
+        CVcxHgMyVideosMainView& iView;
+        
+        /**
+         * Hg list component.
+         * Own.
+         */
+        CHgScroller* iScroller;            
+    };
+
+#endif // VCXHGMYVIDEOSLISTBASE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/inc/vcxhgmyvideosmainview.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,300 @@
+/*
+* 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:      My Videos UI main view.*
+*/
+
+
+// Version : %version: 18 %
+
+#ifndef VCXHGMYVIDEOSMAINVIEW_H
+#define VCXHGMYVIDEOSMAINVIEW_H
+
+// INCLUDE FILES
+#include <coemain.h>
+#include <aknappui.h>
+#include <aknViewAppUi.h> 
+#include <aknview.h>
+#include <akntitle.h>
+
+// FORWARD DECLARATIONS
+
+class CVcxHgMyVideosModel;
+class CVcxHgMyVideosMainViewContainer;
+class CIptvResourceLoader;
+class CVcxHgMyVideosCategoryListImpl;
+class CVcxHgMyVideosVideoListImpl;
+class TVcxHgMyVideosMemoryStatusDialog;
+class CHgScroller;
+class CAknsBasicBackgroundControlContext;
+
+// CLASS DECLARATION
+
+/**
+ * My Videos UI main view.
+ *
+ * @lib vcxhgmyvideos.lib
+ */
+class CVcxHgMyVideosMainView : public CAknView
+    {
+    public: // Constructors and destructor
+
+        /**
+         * Creates main view. 
+         *
+         * @return New main view object.
+         */
+        IMPORT_C static CVcxHgMyVideosMainView* NewL();
+
+        /**
+         * Creates main view. 
+         *
+         * @return New main view object.
+         */
+        IMPORT_C static CVcxHgMyVideosMainView* NewLC();
+
+        /**
+         * Destructor.
+         */
+        IMPORT_C virtual ~CVcxHgMyVideosMainView();
+
+    public:
+
+        /** 
+         * Accessor for the application's AppUi.
+         *
+         * @return Pointer to AppUi.
+         */
+    	CAknViewAppUi* AppUi() const { return CAknView::AppUi(); }
+
+    	/**
+    	 * Returns pointer to button group container.
+    	 * 
+    	 * @return Button group container.
+    	 */
+    	CEikButtonGroupContainer* Cba();
+    	
+    	/**
+    	 * Accessor for the view's title pane.
+    	 * 
+    	 * @return Pointer to title pane.
+    	 */ 
+    	CAknTitlePane* TitlePaneL();
+    	   	
+        /**
+         * Accessor for category list. Creates the category list if not already
+         * created. Can only leave if not created yet.
+         * 
+         * @return Pointer to category list.
+         */
+    	CVcxHgMyVideosCategoryListImpl* CategoryListL();
+    	
+        /**
+         * Accessor for video list. Creates the video list if not already
+         * created. Can only leave if not created yet.
+         * 
+         * @return Pointer to video list.
+         */
+    	CVcxHgMyVideosVideoListImpl* VideoListL();
+    	
+    	/**
+         * Activates category list.
+         */
+        void ActivateCategoryListL();
+        
+        /**
+         * Activates video list.
+         * 
+         * @param aIndex Index of video list to activate.
+         */
+        void ActivateVideoListL( TInt aIndex );    	
+
+        /**
+         * Handles commands for the view.
+         *
+         * @param aCommand Command ID.
+         */
+        void HandleCommandL( TInt aCommand );        
+
+        /**
+         * Handles key events from container.
+         * 
+         * @param aKeyEvent Key event.
+         * @param aType     Key event type.
+         * @return Response, tells if key was handled or not.
+         */
+        TKeyResponse HandleKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
+
+        /**
+         * Sets correct resource to MSK. Call whenever app state changes to that
+         * MSK could be affected.
+         */
+        void DynInitMskL();
+        
+        /**
+         * Sets correct resource to RSK. Call whenever app state changes to that
+         * RSK could be affected.
+         */
+        void DynInitRskL();
+        
+        /**
+         * Updates layout for controls.
+         */ 
+        void UpdateLayout();
+        
+        /**
+         * Launches external application.
+         * 
+         * @param aAppUid Application UID
+         * @param aMsg    Message to send
+         */
+        void LaunchAppL( const TUid aAppUid, const TDesC& aMsg = KNullDesC() );
+
+        /**
+         * Launches standalone browser application.
+         * 
+         * @param aUrl  URL to open.
+         */
+        void LaunchBrowserL( const TDesC& aUrl );        
+        
+        /**
+         * Launches Ovi store.
+         *
+         * @param aAppUid Ovi Store Launcher application UID
+         * @param aMsg    command line arguments
+         */
+        void LaunchOviStoreL( const TUid aAppUid, const TDesC& aArgs = KNullDesC() );
+
+    private: // Constructors
+
+        /**
+         * Default C++ constructor. 
+         */
+        CVcxHgMyVideosMainView();
+
+        /**
+         * Symbian 2nd phase constructor.
+         */
+        void ConstructL();
+        
+    private:
+
+        /**
+         * Returns Uid of View.
+         *
+         * @return TUid uid of the view
+         */
+        TUid Id() const;
+
+        /**
+         * Gets an object whose type is encapsulated by the specified 
+         * TTypeUid object.
+         * 
+         * @param aId Encapsulates the Uid that identifies the type of 
+         *            object required.
+         * @return TTypeUid::Ptr Encapsulates the pointer to the object provided. 
+         *                       Note that the encapsulated pointer may be NULL.
+         */
+        TTypeUid::Ptr MopSupplyObject( TTypeUid aId );
+        
+        /*
+         * Called by the framework when the application status pane
+         * size is changed.
+         */
+        void HandleStatusPaneSizeChange();
+        
+        /**
+         * Activate the view.
+         *
+         * @param aPrevViewId      Id of previous view.
+         * @param aCustomMessageId Id of custom message for view.
+         * @param aCustomMessage   Custom message for view.
+         */
+        void DoActivateL( const TVwsViewId& aPrevViewId,
+                          TUid  aCustomMessageId,
+                          const TDesC8& aCustomMessage );
+
+        /**
+         * Deactivate the view (free resources).
+         */
+        void DoDeactivate();
+        
+        /**
+         * Disables menu items which are not available.
+         *
+         * @param  aResourceId Menu resource Id.
+         * @param  aMenuPane   Menu resource.
+         */
+        void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
+		
+        /**
+         * Handles cancel command from RSK while in marking mode.
+         */
+        void HandleCancelL();
+                        
+    private:
+
+        /**
+         * Memory status dialog.
+         * Own.
+         */
+        TVcxHgMyVideosMemoryStatusDialog* iMemoryStatus;
+        
+        /**
+         * Component model.
+         * Own.
+         */
+        CVcxHgMyVideosModel* iModel;
+        
+        /**
+         * View container.
+         * Own.
+         */
+        CVcxHgMyVideosMainViewContainer* iContainer;
+                
+        /**
+         * Resource loader.
+         * Own.
+         */
+        CIptvResourceLoader* iResourceLoader;
+        
+        /**
+         * Category list implementation.
+         * Own. 
+         */
+        CVcxHgMyVideosCategoryListImpl* iCategoryList;
+
+        /**
+         * Video list implementation.
+         * Own.
+         */
+        CVcxHgMyVideosVideoListImpl* iVideoList;
+        
+        /**
+         * Background context.
+         * Own.
+         */
+        CAknsBasicBackgroundControlContext* iBgContext;
+                        
+        /**
+         * Resource ID of current MSK resource.
+         */
+        TInt iCurrentMskResource;
+        
+        /**
+         * Resource ID of current RSK resource.
+         */
+        TInt iCurrentRskResource;
+    };
+
+#endif // VCXHGMYVIDEOSMAINVIEW_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/inc/vcxhgmyvideosmainviewcontainer.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,109 @@
+/*
+* 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:      My Videos UI main view container.*
+*/
+
+
+
+
+#ifndef VCXHGMYVIDEOSMAINVIEWCONTAINER_H
+#define VCXHGMYVIDEOSMAINVIEWCONTAINER_H
+
+//INCLUDES
+
+#include <coecntrl.h>
+#include <aknview.h>
+ 
+
+// FORWARD DECLARATION
+
+class CVcxHgMyVideosMainView;
+
+// CLASS DECLARATION
+
+/**
+ * My Videos UI main view container.
+ *
+ * @lib vcxhgmyvideos.lib
+ */
+class CVcxHgMyVideosMainViewContainer : public CCoeControl
+    {
+    public: // Constructors and destructor
+
+        /**
+         * Creates main view container.
+         *
+         * @param aParentView Parent view of container.    
+         * @return New container object.
+         */
+        static CVcxHgMyVideosMainViewContainer* NewL( 
+                CVcxHgMyVideosMainView& aParentView );
+
+        /**
+         * Creates main view container.
+         *
+         * @param aParentView Parent view of container.
+         * @return New container object.        
+         */
+        static CVcxHgMyVideosMainViewContainer* NewLC( 
+                CVcxHgMyVideosMainView& aParentView );
+
+        /**
+         * Destructor.
+         */
+        virtual ~CVcxHgMyVideosMainViewContainer();
+
+    public: // From CCoeControl
+
+        /**
+         * Key event handler. 
+         *
+         * @param aKeyEvent Key event.
+         * @param aType     Key event type.
+         * @return Response, tells if key was handled or not.
+         */
+        TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, 
+                                     TEventCode aType );
+        
+        /**
+         * Returns control's help context.
+         * 
+         * @param aContext On return help context.
+         */
+        void GetHelpContext( TCoeHelpContext &aContext ) const;
+        
+    private: // Constructors
+
+        /**
+         * C++ default constructor.
+         *
+         * @param aParentView Parent view for this container.
+         */
+        CVcxHgMyVideosMainViewContainer( CVcxHgMyVideosMainView& aParentView );
+   
+        /**
+         * Symbian 2nd phase constructor.
+         */
+        void ConstructL();
+
+    private: // Data
+
+        /**
+	     * This container's parent view
+	     * Not own.
+	     */
+        CVcxHgMyVideosMainView& iParentView;
+    };
+
+#endif // VCXHGMYVIDEOSMAINVIEWCONTAINER_H   
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/inc/vcxhgmyvideosmemorystatus.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,46 @@
+/*
+* 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 of UI functionality for category list.*
+*/
+
+
+
+
+#ifndef VCXHGMYVIDEOSMEMORYSTATUS_H_
+#define VCXHGMYVIDEOSMEMORYSTATUS_H_
+
+// FORWARD DECLARATIONS
+class CVcxHgMyVideosModel;
+
+// INCLUDES
+
+NONSHARABLE_CLASS( TVcxHgMyVideosMemoryStatusDialog )
+    {
+    public:
+
+        /**
+         * Displays memory status dialog.
+         * 
+         * @param aModel Reference to document model.
+         */
+        void ShowMemoryStatusDialogL( CVcxHgMyVideosModel& aModel );       
+
+    private:
+    
+        /**
+         * Default C++ constructor. By default it is private
+         */
+        TVcxHgMyVideosMemoryStatusDialog();
+    };
+#endif /*VCXHGMYVIDEOSMEMORYSTATUS_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/inc/vcxhgmyvideosmodel.h	Thu Nov 04 11:16:56 2010 +0200
@@ -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:      Common model class for component.*
+*/
+
+
+
+
+#ifndef VCXHGMYVIDEOSMODEL_H
+#define VCXHGMYVIDEOSMODEL_H
+
+// INCLUDE FILES
+#include <coemain.h>
+#include <vcxmyvideosdefs.h>
+#include <thumbnailmanager.h>
+
+#include "CIptvDriveMonitor.h"
+
+// FORWARD DECLARATIONS
+
+class CVcxHgMyVideosCollectionClient;
+class CRepository;
+class CVcxHgMyVideosThumbnailManager;
+
+// CONSTANTS
+
+const TInt KVcxHgMyVideosCategoryControlGroupId(500);
+const TInt KVcxHgMyVideosVideoControlGroupId(600);
+
+// CLASS DECLARATION
+
+/**
+ * Common model class for component.
+ *
+ * @lib vcxhgmyvideos.lib
+ */
+NONSHARABLE_CLASS( CVcxHgMyVideosModel ) : public CBase,
+                                           public MIptvDriveMonitorObserver
+    {
+    public:
+        
+        /**
+         * Application / view states.
+         */
+        enum TVcxMyVideosAppState
+            {
+            EVcxMyVideosAppStateUnknown = 0,
+            EVcxMyVideosAppStateCategoryBusy,
+            EVcxMyVideosAppStateCategoryIdle,
+            EVcxMyVideosAppStateVideoBusy,
+            EVcxMyVideosAppStateVideoIdle,
+            EVcxMyVideosAppStatePlayer
+            };
+        
+        /**
+         * Screen resolutions.
+         */
+        enum TVcxScreenResolution
+            {
+            EVcxScreenResolutionUnknown = 0,
+            EVcxScreenResolutionQVGA,
+            EVcxScreenResolutionQHD,
+            EVcxScreenResolutionVGA
+            };        
+        
+    public: // Constructors and destructor
+
+        /**
+         * Two-phased constructor.
+         *
+         * @return New object.
+         */
+        static CVcxHgMyVideosModel* NewL();
+
+        /**
+         * Two-phased constructor.
+         *
+         * @return New object.
+         */
+        static CVcxHgMyVideosModel* NewLC();
+
+        /**
+         * Destructor.
+         */
+        virtual ~CVcxHgMyVideosModel();
+
+    public:
+        
+        /**
+         * Returns true if device has touch support.
+         * 
+         * @return ETrue if device supports touch.
+         */
+        TBool TouchSupport();
+        
+        /**
+         * Returns current screen resolution (QVGA,QHD,VGA).
+         * 
+         * @param aCoeEnv Pointer to Coe Env.
+         * @return Screen resolution.
+         */
+        TVcxScreenResolution GetScreenResolution( CCoeEnv* aCoeEnv );
+
+        /**
+         * Returns MPX Collection Client.
+         *
+         * @return Reference to Collection client.
+         */
+        CVcxHgMyVideosCollectionClient& CollectionClient();
+
+        /**
+         * Returns reference to component's File Server session.
+         * 
+         * @return Reference to File Server session.
+         */
+        RFs& FileServerSessionL();
+        
+        /**
+         * Returns reference to component's drive monitor.
+         * 
+         * @return Reference to drive monitor.
+         */
+        CIptvDriveMonitor& DriveMonitorL();
+
+        /**
+         * Sets application state.
+         *
+         * @param aAppState New application state.
+         */
+        void SetAppState( TVcxMyVideosAppState aAppState );
+        
+        /**
+         * Gets application state.
+         *
+         * @return Application state.
+         */
+        TVcxMyVideosAppState AppState();
+
+        /**
+         * Returns previous application state.
+         *
+         * @return Previous application state.
+         */
+        TVcxMyVideosAppState PreviousAppState();
+
+        /**
+         * Sets video list sort order (to CenRep).
+         * 
+         * @param aSortOrder New video list sort order.
+         */
+        void SetVideolistSortOrderL( TVcxMyVideosSortingOrder aSortOrder );
+        
+        /**
+         * Gets the last watched video id from CenRep.
+         * 
+         * @param aId Video's mpx id (iId1).
+         * @return System wide error code
+         */
+        TInt GetLastWatchedIdL( TInt& aId );
+
+        /**
+         * Gets the last watched video name from CenRep.
+         * 
+         * @param aPath On return Video's path.
+         * @return System wide error code
+         */
+        TInt GetLastWatchedNameL( TDes& aName );
+        
+        /**
+         * Gets the last watched video path from CenRep.
+         * 
+         * @param aPath On return Video's path.
+         * @return System wide error code
+         */
+        TInt GetLastWatchedPathL( TDes& aPath );
+        
+        /**
+         * Gets the last watched video indicator from CenRep.
+         * 
+         * @param aValue On return Video's indicator value.
+         * @return System wide error code
+         */
+        TInt GetLastWatchedIndicatorL( TInt& aValue );
+        
+        /**
+         * Gets video list sort order (from CenRep).
+         * 
+         * @return Video list sort order.
+         */
+        TVcxMyVideosSortingOrder VideolistSortOrderL();
+
+        /**
+         * Gets the My Videos customization integer from CenRep.
+         * 
+         * @param aKey   CenRep key for the value to be fetched.
+         * @param aValue On return, fetched value.
+         * @return System wide error code
+         */
+        TInt GetMyVideosCustomizationInt( const TInt& aKey, TInt& aValue );
+
+        /**
+         * Gets the My Videos customization string from CenRep.
+         * 
+         * @param aKey   CenRep key for the value to be fetched.
+         * @param aValue On return, fetched value.
+         * @return System wide error code
+         */
+        TInt GetMyVideosCustomizationString( const TInt& aKey, TDes& aValue );
+        /**
+         * Returns reference to Thumbnail Manager.
+         *
+         * @return Reference to Thumbnail Manager.
+         */
+        CVcxHgMyVideosThumbnailManager& ThumbnailManager() const;
+
+    public: // from MIptvDriveMonitorObserver
+        
+        /**
+        * Empty handler for drive monitor events.
+        *
+        * @aEvent  The Event.
+        */
+        void HandleDriveMonitorEvent( TIptvDriveMonitorEvent& aEvent );
+        
+    private: // Constructors
+
+        /**
+         * Default C++ constructor. 
+         */
+        CVcxHgMyVideosModel();
+
+        /**
+         * Symbian 2nd phase constructor.
+         */
+        void ConstructL();
+        
+        /**
+         * Initializes MyVideos customization CenRep session.
+         */
+        TInt InitMyVideosCenRepL();
+        
+    private:
+
+        /**
+         * Client class for My Videos MPX Collection.
+         * Own.
+         */
+        CVcxHgMyVideosCollectionClient* iCollection;
+
+        /**
+         * Application state.
+         */
+        TVcxMyVideosAppState iAppState;
+        
+        /**
+         * Previous application state.
+         */
+        TVcxMyVideosAppState iPreviousAppState;        
+        
+        /**
+         * Internal flag for storing touch support information.
+         */
+        TBool iTouchSupport;
+        
+        /**
+         * Component's File Server session.
+         * Own.
+         */
+        RFs iFsSession;
+        
+        /**
+         * Component's drive monitor.
+         * Own.
+         */
+        CIptvDriveMonitor* iDriveMonitor;
+        
+        /**
+         * Session to MPX Collection CenRep.
+         * Own.
+         */
+        CRepository* iCollectionCenRep;
+        
+        /**
+         * Session to My Videos customization CenRep.
+         * Own.
+         */
+        CRepository* iMyVideosCenRep;
+    
+        /**
+         * Video list sort order.
+         */
+        TVcxMyVideosSortingOrder iSortOrder;
+
+		/**
+         * Thumbnail Manager.
+         * Own.
+         */
+        CVcxHgMyVideosThumbnailManager* iTnManager;
+    };
+
+#endif // VCXHGMYVIDEOSMODEL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/inc/vcxhgmyvideospanics.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,40 @@
+/*
+* 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:      Panic literal and codes for component*
+*/
+
+
+
+
+#ifndef VCXHGMYVIDEOSPANICS_H
+#define VCXHGMYVIDEOSPANICS_H
+
+/**
+ * Panic literal for all MPX My Videos UI panics.
+ */
+_LIT( KVcxHgMyVideosPanic, "MPX My Videos UI" );
+
+/**
+ * Panic codes for MPX My Videos UI panics.
+ */
+enum KVcxHgMyVideosPanicCodes
+    {
+    EVcxHgMyVideosPanicLogicalCategory = 800,
+    EVcxHgMyVideosPanicLogicalObserver,
+    EVcxHgMyVideosPanicLogicalVideo,
+    EVcxHgMyVideosPanicLogicalDownload,
+    EVcxHgMyVideosPanicLogicalSearch
+    };
+
+#endif // VCXHGMYVIDEOSPANICS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/inc/vcxhgmyvideosthumbnailmanager.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,155 @@
+/*
+* 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 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:   CVcxHgMyVideosThumbnailManager class definition*
+*/
+
+
+#ifndef VCXHGMYVIDEOSTHUMBNAILMANAGER_H
+#define VCXHGMYVIDEOSTHUMBNAILMANAGER_H
+
+// INCLUDE FILES
+#include <thumbnailmanager.h>
+#include <thumbnailmanagerobserver.h>
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+ *
+ * @lib vcxhgmyvideos.lib
+ */
+NONSHARABLE_CLASS( CVcxHgMyVideosThumbnailManager ) :
+        public CBase,
+        public MThumbnailManagerObserver 
+    {
+    public:
+
+        /**
+         * Two-phased constructor.
+         * 
+         * @return New object.
+         */
+        static CVcxHgMyVideosThumbnailManager* NewL();
+
+        /**
+         * Two-phased constructor.
+         * 
+         * @return New object. 
+         */
+        static CVcxHgMyVideosThumbnailManager* NewLC();
+
+        /**
+         * Destructor.
+         */
+        virtual ~CVcxHgMyVideosThumbnailManager();
+
+    private: // From MThumbnailManagerObserver
+        
+        /**
+         * Preview thumbnail generation or loading is complete.
+         *
+         * @param aThumbnail An object representing the resulting thumbnail.
+         * @param aId Request ID for the operation
+         */
+        void ThumbnailPreviewReady( MThumbnailData& aThumbnail, TThumbnailRequestId aId );
+    
+        /**
+         * Final thumbnail bitmap generation or loading is complete.
+         *
+         * @param aError         Error code.
+         * @param aThumbnail     An object representing the resulting thumbnail.
+         * @param aId            Request ID for the operation.
+         */
+        void ThumbnailReady( TInt aError, MThumbnailData& aThumbnail, TThumbnailRequestId aId );
+
+    public: // New methods
+        /**
+         * Peeks if there is thumbnail and fetches it if it exist.
+         * No thumbnail creation is started when thumbnail does not exist.
+         *
+         * @param aSource 
+         * @return TThumbnailRequestId.
+         */
+        TThumbnailRequestId PeekL( CThumbnailObjectSource& aSource );
+
+        /**
+         * Gets thumbnail and creates it if it does not exist.
+         *
+         * @param aSource 
+         * @return TThumbnailRequestId.
+         */
+        TThumbnailRequestId GetL( CThumbnailObjectSource& aSource );
+
+        /**
+         * Cancels thumbnail request
+         *
+         * @param aRequestId
+         */
+        void Cancel( TThumbnailRequestId aRequestId );
+        
+        /**
+         * Reset the generated thumbnails from given source
+         * 
+         * aSource Thumbnail source
+         */
+        void Reset( CThumbnailObjectSource& aSource );
+
+        /**
+         * Adds observer.
+         *
+         * @param aObserver 
+         */
+        void AddObserverL( MThumbnailManagerObserver& aObserver );
+
+        /**
+         * Removes observer.
+         *
+         * @param aObserver 
+         */
+        void RemoveObserver( MThumbnailManagerObserver& aObserver );
+
+    private:    
+
+        /**
+         * Default constructor
+         */
+        CVcxHgMyVideosThumbnailManager();
+
+        /**
+         * SessionL
+         * @return CThumbnailManager ref.
+         */
+        CThumbnailManager& SessionL();
+
+    private:
+
+        /**
+         * S60 Thumbnail Manager.
+         * Own.
+         */
+        CThumbnailManager* iTnManager;
+
+        /** 
+         * Used for storing the observers. Pointers are not own.
+         */ 
+        RPointerArray<MThumbnailManagerObserver> iTnObservers;
+
+        /** 
+         * Stores current thumbnail generation flags
+         */ 
+        CThumbnailManager::TThumbnailFlags iCurrentFlags;
+    };
+
+#endif // VCXHGMYVIDEOSTHUMBNAILMANAGER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/inc/vcxhgmyvideosupnpinterface.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,171 @@
+/*
+* 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:      CVcxuPnPInterface class declaration*
+*/
+
+
+
+
+#ifndef CVCXHGUPNPINTERFACE_H
+#define CVCXHGUPNPINTERFACE_H
+
+// INCLUDE FILES
+#include <e32std.h>
+#include <e32base.h>
+#include <upnpcommandobserver.h>
+
+// FORWARD DECLARATIONS
+class CUpnpShowCommand;
+
+
+// CLASS DECLARATION
+
+/**
+ * CVcxHgMyVideosUPnPInterface declares an interface for myvideos UI 
+ * to show videos and images via upnp framework's command api
+ * 
+ */
+NONSHARABLE_CLASS( CVcxHgMyVideosUPnPInterface ) : public CBase,
+                                                   public MUpnpCommandObserver
+    {
+public: // Constructors and destructor
+
+    /**
+     * Destructor.
+     */
+    ~CVcxHgMyVideosUPnPInterface();
+
+    /**
+     * Two-phased constructor.
+     * 
+     * @param aExtObserver pointer to external command observer
+     */
+    static CVcxHgMyVideosUPnPInterface* NewL( MUpnpCommandObserver* aExtObserver = 0 );
+
+    /**
+     * Two-phased constructor.
+     * 
+     * @param aExtObserver pointer to external command observer
+     */
+    static CVcxHgMyVideosUPnPInterface* NewLC( MUpnpCommandObserver* aExtObserver = 0 );
+    
+public: // new methods
+    
+    /**
+     * Returns ETrue, if home network functionality
+     * is usable via upnp
+     * 
+     * @return TBool ETrue is usable
+     */
+    TBool IsApplicable();
+    
+    /**
+     * Returns ETrue, upnp has been started succesfully
+     * by the Strat() -call
+     * 
+     * @return TBool ETrue if started
+     */
+    TBool IsStarted();
+    
+    /**
+     * Starts upnp framework for video / image showing
+     * 
+     * @return TInt     KErrNone if ok, KErrGeneral if start is not yet called 
+     *                  succesfully. Otherwise a systemwide error code.
+     */
+    TInt Start( );
+    
+    /**
+     * Shows a video in remote upnp device.
+     * 
+     * @param aVideoPath full path for the video including video file name
+     * 
+     * @return TInt     KErrNone if ok, KErrGeneral if start is not yet called 
+     *                  succesfully. Otherwise a systemwide error code.
+     */
+    TInt ShowVideo( const TDesC& aVideoPath );
+    
+    /**
+     * Shows an image in remote upnp device.
+     * 
+     * @param aPath full path for the image including image file name
+     * 
+     * @return TInt KErrNone if ok, other a systemwide error
+     */
+    TInt ShowThumbnail( const TDesC& aPath );
+    
+    /**
+     * Notifies framework to stop showing
+     * 
+     * @return TInt KErrNone if ok, otherwise a systemwide error
+     */
+    TInt Stop();
+    
+public: // from MUpnpCommandObserver
+
+    /**
+     * Upnp framework calls this to return a result from 
+     * Asynchronous method -calls. Only async methods are the one 
+     * related to showing of image of video. In case there is external
+     * observer defined, message is to it.
+     * This method handles only KErrDisconnected status, where 
+     * we set iStarted flag EFalse. 
+     * 
+     * @param aStatusCode  statuscode from the upnp framework
+     */
+    void CommandComplete( TInt aStatusCode );
+    
+private:
+
+    /**
+     * Constructor for performing 1st stage construction
+     */
+    CVcxHgMyVideosUPnPInterface();
+
+    /**
+     * EPOC default constructor for performing 2nd stage construction
+     */
+    void ConstructL();
+    
+    /**
+     * Method creates CUpnpShowCommand object if not yet created.
+     * Creation unsuuceeds, if platform does not yet support home networking
+     * via upnp (Home media setup not yet done). In this case pointer to
+     * CUpnpShowCommand remains NULL.  
+     * 
+     * @return TBool  ETrue, creation ok
+     */
+    TBool TryCreateCmd();
+
+private:
+    
+    /**
+     * pointer to Upnp Show -command interface. Owned.
+     */
+    CUpnpShowCommand* iShowCommand;
+    
+    /**
+     * pointer to external Upnp command observer. Not Owned.
+     */
+    MUpnpCommandObserver* iExtObserver;
+    
+    /**
+     * ETrue:  Start has been called succesfully.
+     * EFalse: Start not yet called succesfully
+     */
+    TBool iStarted;
+    
+    };
+
+#endif // CVCXHGUPNPINTERFACE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/inc/vcxhgmyvideosvideocopier.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,165 @@
+/*
+* 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:      Class for handling move/copy related notes and operations.*
+*/
+
+
+
+
+#ifndef VCXHGMYVIDEOSVIDEOCOPIER_H
+#define VCXHGMYVIDEOSVIDEOCOPIER_H
+
+// INCLUDE FILES
+#include <e32base.h>
+#include <AknProgressDialog.h>
+
+// FORWARD DECLARATIONS
+class CVcxHgMyVideosVideoListImpl;
+class CVcxHgMyVideosVideoModelHandler;
+class CVcxHgMyVideosModel;
+class CAknWaitDialog;
+
+/**
+ * Class for handling move/copy related notes and operations.
+ * 
+ * @lib vcxhgmyvideos.lib 
+ */
+NONSHARABLE_CLASS( CVcxHgMyVideosVideoCopier ) : public CBase,
+                                                 public MProgressDialogCallback
+    {
+    public:
+
+        /**
+         * Two-phased constructor.
+         * 
+         * @param aVideoList Video list implementation.
+         * @param aVideoModel Video model handler.
+         * @param aModel Component's model.
+         */
+        static CVcxHgMyVideosVideoCopier* NewL( CVcxHgMyVideosVideoListImpl& aVideoList,
+                                                CVcxHgMyVideosVideoModelHandler& aVideoModel,
+                                                CVcxHgMyVideosModel& aModel );
+
+        /**
+         * Destructor.
+         */
+        virtual ~CVcxHgMyVideosVideoCopier();
+    
+        /**
+         * Cheks status of currently selected items and UI list. Returns
+         * flags that tell which move/copy realted menu items can be shown. 
+         * 
+         * @param aOperationTargets List of operation targets on UI.
+         * @param aShowMoveAndCopySubmenu On return, ETrue if move/copy submenu can be shown.
+         * @param aShowCopy On return, ETrue if copy menu item can be shown.
+         * @param aShowMove On return, ETrue if move menu item can be shown.
+         */
+        void ShowMenuItemsL( 
+                const RArray<TInt>& aOperationTargets,
+                TBool& aShowMoveAndCopySubmenu,
+                TBool& aShowCopy,
+                TBool& aShowMove );
+
+        /**
+         * Moves or copies videos. Also shows memory selection dialog and
+         * move/copy wait note.
+         *
+         * @param aOperationTargets List of operation targets on UI.
+         * @param aCopy ETrue for copy operation, EFalse for move. 
+         */        
+        void MoveOrCopyL( 
+                const RArray<TInt>& aOperationTargets,
+                TBool aCopy );
+
+        /**
+         * Called by video list impl when move or copy command is completed.
+         * 
+         * @param aFailedCount Count of items that could not be moved/copied.
+         * @param aFailedName Name of video where move/copy failed, if there was only one.
+         */
+        void VideoMoveOrCopyCompletedL( TInt aFailedCount, const TDesC& aFailedName );           
+
+    public: // From MProgressDialogCallback
+
+        /**
+         * Called when (move/copy) wait dialog is dismissed.
+         *
+         * @aButtonId Button with which dialog was dismissed.
+         */     
+        void DialogDismissedL( TInt aButtonId );           
+        
+    protected:
+
+        CVcxHgMyVideosVideoCopier( CVcxHgMyVideosVideoListImpl& aVideoList,
+                                   CVcxHgMyVideosVideoModelHandler& aVideoModel,
+                                   CVcxHgMyVideosModel& aModel );                
+
+        void ConstructL();
+
+        /**
+         * Queries user for target drive.
+         * 
+         * @param aCopy ETrue for copy operation, EFalse for move.
+         * @param aTargetDrive On return, target drive.
+         * @return ETrue if user accepted target.
+         */
+        TBool QueryTargetDriveL( TBool aCopy, TInt& aTargetDrive );
+        
+        /**
+         * Opens the move/copy wait note.
+         * 
+         * @param aOperationTargets Operation targets.
+         * @param aCopy ETrue for copy operation, EFalse for move.
+         */
+        void OpenMoveCopyWaitNoteL( const RArray<TInt>& aOperationTargets,
+                                    TBool aCopy );
+
+        /**
+         * Closes the move/copy wait note.
+         */
+        void CloseMoveCopyWaitNote();         
+
+    protected: // data
+
+        /**
+         * Reference to video list implementation.
+         * Not own.
+         */
+        CVcxHgMyVideosVideoListImpl& iVideoList;
+        
+        /**
+         * Reference to video model handler.
+         * Not own.
+         */        
+        CVcxHgMyVideosVideoModelHandler& iVideoModel;
+        
+        /**
+         * Reference to component's model.
+         * Not own.
+         */
+        CVcxHgMyVideosModel& iModel;
+
+        /**
+         * Move/copy wait dialog.
+         * Own.
+         */
+        CAknWaitDialog* iMoveCopyWaitDialog;
+        
+        /**
+         * Flag telling if latest operation was copy (ETrue) or move (EFalse).
+         */
+        TBool iCopy;
+    };
+
+#endif // VCXHGMYVIDEOSVIDEOCOPIER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/inc/vcxhgmyvideosvideodata.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,201 @@
+/*
+* 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:   CVcxHgMyVideosVideoData class definition*
+*/
+
+
+
+
+#ifndef VCXHGMYVIDEOSVIDEODATA_H
+#define VCXHGMYVIDEOSVIDEODATA_H
+
+// INCLUDE FILES
+#include <coemain.h>
+#include <mpxitemid.h>
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+ *
+ * @lib vcxhgmyvideos.lib
+ */
+NONSHARABLE_CLASS( CVcxHgMyVideosVideoData ) :
+        public CBase
+    {
+    public:
+
+        enum TVideoDataState
+            {
+            EVideoDataStateNone = 0,
+            EVideoDataStateThumbnailPeekStarted,
+            EVideoDataStateThumbnailPeekFinished,
+            EVideoDataStateThumbnailStarted,
+            EVideoDataStateThumbnailFinished
+            };
+
+    public:
+
+        /**
+         * Two-phased constructor.
+         * 
+         * @return New object.
+         */
+        static CVcxHgMyVideosVideoData* NewL();
+
+        /**
+         * Two-phased constructor.
+         * 
+         * @return New object. 
+         */
+        static CVcxHgMyVideosVideoData* NewLC();
+
+        /**
+         * Destructor.
+         */
+        virtual ~CVcxHgMyVideosVideoData();
+        
+        /**
+         * Returns MPX item id of video item.
+         */
+        TMPXItemId MPXItemId();
+
+        /**
+         * Returns data fetching state of video item.
+         * 
+         * @return State.
+         */        
+        TVideoDataState State();
+
+        /**
+         * Retuns thumbnail conversion Id of video item.
+         * 
+         * @return Thumbnail conversion Id.
+         */        
+        TInt ThumbnailConversionId();
+
+        /**
+         * Returns thumbnail bitmap of video item. Ownership transfer
+         * depends on method parameter.
+         * 
+         * @param aGiveOwnership If ETrue, ownership is transferred.
+         * @return Pointer to bitmap.
+         */
+        CFbsBitmap* Thumbnail( TBool aGiveOwnership = EFalse );
+
+        /**
+         * Return DRM protection status of video item.
+         * 
+         * @return DRM protection status.
+         */
+        TBool DrmProtected();
+
+        /**
+         * Return DRM key validity status for video item.
+         * 
+         * @return DRM key validity status for video item.
+         */        
+        TBool ValidDrmRights();        
+        
+        /**
+         * Sets MPX item id.
+         * 
+         * @param aMPXItemId MPX item id.
+         */
+        void SetMPXItemId( TMPXItemId aMPXItemId ); 
+
+        /**
+         * Sets data fetching state of video item.
+         * 
+         * @param aState State.
+         */
+        void SetState( TVideoDataState aState );
+        
+        /**
+         * Sets thumbnail conversion Id of video item.
+         * 
+         * @param aConversionId Thumbnail conversion Id.
+         */        
+        void SetThumbnailConversionId( TInt aConversionId );        
+
+        /**
+         * Sets thumbnail bitmap of video item. Ownership is transferred.
+         * 
+         * @param aThumbnail Pointer to bitmap.
+         */
+        void SetThumbnail( CFbsBitmap* aThumbnail );
+        
+        /**
+         * Sets DRM protection status of video item.
+         * 
+         * @param aDrmProtected DRM protection status.
+         */        
+        void SetDrmProtected( TBool aDrmProtected );
+        
+        /**
+         * Sets DRM key validity status for video item.
+         * 
+         * @param aDrmProtected DRM key validity status for video item.
+         */        
+        void SetValidDrmRights( TBool aValidDrmRights );        
+        
+    protected:
+
+        /**
+         * Default constructor
+         *
+         */
+        CVcxHgMyVideosVideoData();
+
+        /**
+         * 2nd phase constructor.
+         */
+        void ConstructL();
+
+    protected:
+        
+        /**
+         * MPX item id.
+         */
+        TMPXItemId iMPXItemId;
+
+        /**
+         * Data fetching state of this item.
+         */        
+        TVideoDataState iState;
+
+        /**
+         * Thumbnail conversion ID for this item.
+         */
+        TInt iConversionId;
+
+        /**
+         * Thumbnail.
+         * Own.
+         */
+        CFbsBitmap* iThumbnail;
+        
+        /**
+         * DRM protection status.
+         */
+        TBool iDrmProtected;
+        
+        /**
+         * DRM key validity status.
+         */
+        TBool iValidDrmRights;        
+    };
+
+#endif // VCXHGMYVIDEOSVIDEODATA_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/inc/vcxhgmyvideosvideodataupdater.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,418 @@
+/*
+* 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:   CVcxHgMyVideosVideoData class definition*
+*/
+
+
+
+
+#ifndef VCXHGMYVIDEOSVIDEODATAUPDATER_H
+#define VCXHGMYVIDEOSVIDEODATAUPDATER_H
+
+// INCLUDE FILES
+#include <coemain.h>
+ 
+#include <thumbnailmanager.h>
+#include <thumbnailmanagerobserver.h>
+#include "vcxhgmyvideosvideodata.h"
+
+// FORWARD DECLARATIONS
+class CVcxHgMyVideosModel;
+class CHgScroller;
+class CMPXMediaArray;
+class CThumbnailManager;
+class CVcxHgMyVideosVideoList;
+class CPeriodic;
+class CMyVideosIndicator;
+
+// CLASS DECLARATION
+
+/**
+ *
+ * @lib vcxhgmyvideos.lib
+ */
+NONSHARABLE_CLASS( CVcxHgMyVideosVideoDataUpdater ) :
+        public CActive,
+        public MThumbnailManagerObserver 
+    {
+    public:
+
+        /**
+         * Two-phased constructor.
+         * 
+         * @param aModel Reference to component model.
+         * @param aScroller Reference to Hg list control.
+         * @param aVideoArray Reference to video array.
+         * @return New object.
+         */
+        static CVcxHgMyVideosVideoDataUpdater* NewL( 
+                CVcxHgMyVideosModel& aModel,
+                CHgScroller& aScroller,
+                CVcxHgMyVideosVideoList& aVideoArray,
+                CMyVideosIndicator& aVideosIndicator );
+
+        /**
+         * Two-phased constructor.
+         * 
+         * @param aModel Reference to component model.
+         * @param aScroller Reference to Hg list control.
+         * @param aVideoArray Reference to video array.
+         * @return New object. 
+         */
+        static CVcxHgMyVideosVideoDataUpdater* NewLC( 
+                CVcxHgMyVideosModel& aModel,
+                CHgScroller& aScroller,
+                CVcxHgMyVideosVideoList& aVideoArray,
+                CMyVideosIndicator& aVideosIndicator );
+
+        /**
+         * Destructor.
+         */
+        virtual ~CVcxHgMyVideosVideoDataUpdater();
+
+        /**
+         * Sets data updater to pause or normal mode.
+         * 
+         * @param aPaused If ETrue, updater is paused.
+         */
+        void SetPausedL( TBool aPaused );
+
+        /**
+         * Called to inform video data updater that info array has changed.
+         * Causes re-setting of all data as info array is the bases for fetched
+         * additional video data.  
+         */
+        void InfoArrayChanged();        
+
+        /**
+         * Called by video list implementation when new data is needed.
+         * Appends data item into buffer and flushes it to start fetching.
+         * 
+         * @param aMPXItemId MPX item id of video data.
+         */
+        void RequestDataL( TMPXItemId aMPXItemId );
+
+        /**
+         * Called by video list implementation when new data is needed.
+         * Appends data item into buffer that needs to be flushed using 
+         * FlushRequestBufferL() to start fetching.
+         * 
+         * @param aMPXItemId MPX item id of video data.
+         */
+        void AddToRequestBufferL( TMPXItemId aMPXItemId );
+
+        /**
+         * Called by video list implementation when new data is needed.
+         * Flushes fetch requests from buffer.
+         */
+        void FlushRequestBufferL();
+
+        /**
+         * Called by video list implementation when data is not needed anymore.
+         * Removes data item from buffer.
+         * 
+         * @param aMPXItemId MPX item id of video data.
+         */
+        void ReleaseData( TMPXItemId aMPXItemId );
+        
+        /**
+         * Called when user wants to move or delete video from UI. Removes
+         * data item from buffer and cancels ongoing thumbnail generation.
+         * 
+         * @param aMPXItemId MPX item id of video data.         
+         */
+        void PrepareForMoveOrDelete( TMPXItemId aMPXItemId );
+        
+    public: // From MThumbnailManagerObserver
+        
+        /**
+         * Preview thumbnail generation or loading is complete.
+         *
+         * @param aThumbnail An object representing the resulting thumbnail.
+         * @param aId Request ID for the operation
+         */
+        void ThumbnailPreviewReady( MThumbnailData& aThumbnail, TThumbnailRequestId aId );
+    
+        /**
+         * Final thumbnail bitmap generation or loading is complete.
+         *
+         * @param aError         Error code.
+         * @param aThumbnail     An object representing the resulting thumbnail.
+         * @param aId            Request ID for the operation.
+         */
+        void ThumbnailReady( TInt aError, MThumbnailData& aThumbnail, TThumbnailRequestId aId );
+                
+    public: // From CActive
+
+        /**
+         * From CActive.
+         */
+        void RunL();
+
+        /**
+         * From CActive. 
+         * 
+         * @param aError Error code.
+         * @return KErrNone if continuing is ok.
+         */        
+        TInt RunError( TInt aError );
+        
+        /**
+         * From CActive.
+         */        
+        void DoCancel();
+
+    protected:    
+        
+        /**
+         * Default constructor
+         *
+         * @param aModel Reference to component model.
+         * @param aScroller Reference to Hg list control.
+         * @param aVideoArray Reference to video array.
+         */
+        CVcxHgMyVideosVideoDataUpdater( 
+                CVcxHgMyVideosModel& aModel,
+                CHgScroller& aScroller,
+                CVcxHgMyVideosVideoList& aVideoArray,
+                CMyVideosIndicator& aVideosIndicator );
+    
+        /**
+         * 2nd phase constructor.
+         */
+        void ConstructL();
+		
+		/**
+         * Returns index of fetch array based on MPX Item Id.
+         * 
+         * @param aMpxItemId MPX Item Id.
+         * @return Index of array or KErrNotFound.
+         */
+        TInt IndexByMPXItemId( TMPXItemId aMpxItemId );
+        
+        /**
+         * Selects next index to be fetched.
+         * 
+         * @param aSelectForPeekOnly    Select for peek only.
+         * @return ETrue if selected otherwise EFalse.
+         */
+        TBool SelectNextIndexL( TBool aSelectForPeekOnly );
+        
+        /**
+         * Removes item from fetch array.
+         * 
+         * @param aIndex Index of fetch array.
+         */
+        void RemoveItem( TInt aIndex );
+        
+        /**
+         * Removes item from fetch array and cancel thumbnail generation.
+         * 
+         * @param aIndex Index of fetch array.         
+         */
+        void RemoveAndCancelThumbnailGeneration( TInt aIndex );
+                
+        /**
+         * Cancels possibly ongoing activities (thumbnail generation, DRM check).
+         *
+         * @param aIndex Index of fetch array.
+         */
+        void CancelActivities( TInt aIndex );
+                
+        /**
+         * Adds item into fetch array. 
+         * 
+         * @param aMPXItemId MPX item id.
+         */
+        void AddItemToFetchArrayL( TMPXItemId aMPXItemId );
+        
+        /**
+         * Cancels any on-going video data operations and deletes fetch array.
+         */
+        void CancelAndDeleteFetchArray();
+        
+        /**
+         * Makes sure that video data fetching continues.
+         */
+        void ContinueVideoDataFetchingL();
+        
+        /**
+         * Updates fetched video data to UI.
+         */
+        void UpdateVideoDataToUiL( CVcxHgMyVideosVideoData& aVideoData );
+        
+        /**
+         * Checks if list refreshing is needed.
+		 * 
+		 * @param aIndex The item index on the Ganes list that was modified last.
+         * @return ETrue if refreshing is needed, otherwise EFalse.
+		 */
+        TBool ListRefreshNeeded( TInt aIndex );
+        
+        /**
+         * Callback method for RefreshTimer.  
+         */
+        static TInt RefreshTimerCallBack( TAny* aAny );
+        
+        /**
+         * Refreshes the ganes list.
+         */
+        void RefreshScreen();
+
+        /**
+         * Checks DRM properties
+		 *
+		 * @param aVideoData	Reference to video data.
+         */
+        void CheckDrmL( CVcxHgMyVideosVideoData& aVideoData );
+
+        /**
+         * Gets active request count
+         *
+		 * @param aPeekRequests	On return number of peek requests.
+		 * @param aGetRequests	On return number of get requests.
+		 */
+        void GetActiveRequestCount( TInt& aPeekRequests, TInt& aGetRequests );
+
+        /**
+         * Starts thumbnail fetch
+         */
+        void StartThumbnailL( CVcxHgMyVideosVideoData& aItem, TBool aPeek );
+
+        /**
+         * Tries to select item for fetch.
+		 * 
+		 * @param aIndex				Index
+		 * @param aSelectForPeekOnly	ETrue
+		 * @return ETrue if selected, otherwise EFalse
+         */
+        TBool TrySelectL( TInt aIndex, TBool aSelectForPeekOnly );
+
+        /**
+         * Tries to select item for fetch.
+		 *
+		 * @param aPos                Scroller position.
+		 * @param aSelectForPeekOnly  Select for peek only status.
+		 * @return ETrue if selected, otherwise EFalse.
+         */
+        TBool TrySelectFromScrollerL( TInt aPos, TBool aSelectForPeekOnly );
+
+        /**
+         * Tries to select item for fetch.
+		 *
+		 * @param aStartPos           Start position.
+         * @param aEndPos             End position.
+		 * @param aSelectForPeekOnly  Select for peek only status.
+		 * @return ETrue if selected, otherwise EFalse.
+         */
+        TBool TrySelectFromScrollerAreaL( TInt aStartPos, 
+                                          TInt aEndPos,
+                                          TBool aSelectForPeekOnly );
+
+        /**
+         * Starts final actions for finished thumbnails
+         */
+        void StartFinalActions();
+
+        /**
+         * Checks if cancellation of activities is needed for item
+		 *
+		 * @param aItem		Reference to data item.
+		 * @return ETrue if cancel is needed, otherwise EFalse.
+         */
+        TBool CancelNeeded( CVcxHgMyVideosVideoData& aItem );
+
+        /**
+         * Callback method for RetryTimer.  
+         */
+        static TInt RetryTimerCallBack( TAny* aAny );
+
+        /**
+         * Gets scroller area
+		 *
+		 * @param aFirstIndexOnScreen     First index on screen.
+ 		 * @param aLastIndexOnScreen      Last index on screen.
+		 * @param aLastIndex              Last index.
+         */
+        void GetScrollerArea( TInt& aFirstIndexOnScreen, 
+							  TInt& aLastIndexOnScreen,
+        					  TInt& aLastIndex );
+
+    protected:
+
+        /**
+         * Reference to component's model.
+         * Not own.
+         */
+        CVcxHgMyVideosModel& iModel;
+        
+        /**
+         * Hg list component.
+         * Not own.
+         */
+        CHgScroller& iScroller;
+        
+        /**
+         * Array of videos that need data fetching.
+         * Own
+         */
+        RPointerArray<CVcxHgMyVideosVideoData> iFetchArray; 
+        
+        /**
+         * Reference to video array.
+         * Not own.
+         */
+        CVcxHgMyVideosVideoList& iVideoArray; 
+                        
+        /** 
+         * Used for indicating that list needs to be refreshed.         
+         * Own.
+         */ 
+        CPeriodic* iRefreshTimer;
+        
+        /**
+         * Flag for pause state.
+         */
+        TBool iPaused;
+
+        /**
+         * Stores previous first scroller index for checking scroll direction 
+         */
+        TInt iPreviousFirstScrollerIndex;
+
+        /**
+         * Stores time of previous scroller first index update
+         */
+        TInt64 iPreviousFirstScrollerIndexTime;
+
+        /** 
+         * Used for restarting thumbnail creation after scroll
+         * Own.
+         */
+        CPeriodic* iRetryTimer;
+
+        /**
+         * For refresh logic
+         */
+        TBool iPreviousModifiedIndexOnScreen;
+
+        /**
+         * Reference to overlay indicator handler
+         * Not own.
+         */
+        CMyVideosIndicator& iVideosIndicator;
+
+    };
+
+#endif // VCXHGMYVIDEOSVIDEODATAUPDATER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/inc/vcxhgmyvideosvideodetailsdialog.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,94 @@
+/*
+* 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:      My Videos Video Details Dialog.*
+*/
+
+
+
+
+#ifndef VCXHGMYVIDEOSVIDEODETAILS_H_
+#define VCXHGMYVIDEOSVIDEODETAILS_H_
+
+
+#include <mpxmedia.h>
+
+NONSHARABLE_CLASS ( CVcxHgMyVideosVideoDetailsDialog ) : public CBase
+    {
+    public:// Constructors and destructor
+
+        /**
+        * Two-phased constructor.        
+        */
+        static CVcxHgMyVideosVideoDetailsDialog* NewL();
+        
+        /**
+        * C+ destructor
+        */
+        virtual ~CVcxHgMyVideosVideoDetailsDialog();        
+
+    public:        
+        
+        /**
+         *  Provides the static function for the callback to show file details.
+         *  Called by CIdle iDetailsAo.
+         *
+         *  @param aPtr Pointer to callback class
+         */
+        static TInt ShowDetailsL( TAny* aPtr );
+                
+        
+    public:
+        
+        /**
+         * Displays video details dialog.
+         * 
+         * @param aMedia MPX media object that contains video details.
+         */
+        void ShowVideoDetailsDialogL( const CMPXMedia& aMedia );      
+
+    private:
+    
+        /**
+         * Default C++ constructor. By default it is private
+         */
+        CVcxHgMyVideosVideoDetailsDialog();
+      
+        /**
+         * Symbian 2nd phase constructor.
+         */        
+        void ConstructL();
+
+        /*
+         *  Activates an active object to display details.
+         */    
+        void ActivateDetailsActiveObject();
+
+        /*
+         *  Called to display file details.
+         */   
+        void DoShowDetailsL();
+
+        /*
+         *  Pointer to MPX media for which details are displayed. Own.
+         */   
+        CMPXMedia* iDetailsMedia;
+
+        /*
+         *  Active object to cut call stack and display details. Own.
+         */  
+        CIdle* iDetailsAo;
+        
+    };
+
+#endif /*VCXHGMYVIDEOSVIDEODETAILS_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/inc/vcxhgmyvideosvideolist.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,179 @@
+/*
+* 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:      Class for providing video list.*
+*/
+
+
+
+
+#ifndef VCXHGMYVIDEOSVIDEOLIST_H
+#define VCXHGMYVIDEOSVIDEOLIST_H
+
+// INCLUDE FILES
+#include <coemain.h>
+#include <e32cmn.h>
+#include <vcxmyvideosdefs.h>
+
+// FORWARD DECLARATIONS
+class CMPXMedia;
+class CMPXMediaArray;
+class CVcxHgMyVideosVideoListItem;
+class TMPXItemId;
+
+// CLASS DECLARATION
+
+/**
+ * Class for providing video list.
+ * 
+ * @lib vcxhgmyvideos.lib
+ */
+NONSHARABLE_CLASS( CVcxHgMyVideosVideoList ) :
+        public CBase
+    {
+    public: // Constructing and destructing.
+
+        /**
+         * Two-phased constructor.
+         * 
+         * @return New object.
+         */
+        static CVcxHgMyVideosVideoList* NewL();
+
+        /**
+         * Two-phased constructor.
+         * 
+         * @return New object. 
+         */
+        static CVcxHgMyVideosVideoList* NewLC();
+
+        /**
+         * Destructor.
+         */
+        virtual ~CVcxHgMyVideosVideoList();
+
+    public: // Data changes.
+        
+        /**
+         * Removes all items from the video list.
+         */
+        void RemoveVideoList();
+        
+        /**
+         * Replaces video list with new one.
+         * 
+         * @param aVideoList Reference to new video list.
+         */
+        void ReplaceVideoListL( CMPXMediaArray& aVideoList );
+                
+    public: // Data fetching and status information.
+               
+        /**
+         * Checks whether the new list has the same items as the old one.
+         * 
+		 * @param aVideoList The new video list.
+         * @return ETrue/EFalse.
+         */        
+        TBool HasSameItemsL( const CMPXMediaArray& aVideoList );
+
+        /**
+         * Returns count of video items.
+         * 
+         * @return Count of items.
+         */        
+        TInt VideoCount();
+		
+        /**
+         * Removes MPX Media object from video array.
+         * 
+         * @param aMpxItemId MPX Item Id.
+         * @return Removed index number if succeeded, otherwise KErrNotFound.
+         */
+        TInt RemoveVideo( TMPXItemId aMpxItemId );
+        
+        /**
+         * Resorts the video list. The list can be sorted by date, 
+		 * size or name.
+         *
+         * @param aSortingOrder Sorting order used.
+         */
+        void ResortVideoListL( const TVcxMyVideosSortingOrder& aSortingOrder );
+        
+        /**
+         * Adds video to video list to the correct position, 
+         * according to sorting order. Ownership of video 
+         * is transferred to video list.
+         *
+         * @param aVideo Video to add.
+         * @param aSortingOrder Sorting order used.
+         */
+        void AddToCorrectPlaceL( CMPXMedia* aVideo,
+                TVcxMyVideosSortingOrder aSortingOrder );
+        
+        /**
+         * Returns MPX Media object based on index.
+         * 
+         * @param aIndex Index to video list.
+         * @return MPX Media object or NULL.
+         */
+        CMPXMedia* MPXMedia( TInt aIndex );
+        
+        /**
+         * Returns MPX Media object based on MPX Item Id.
+         * 
+         * @pararm aMpxItemId MPX Item Id.
+         * @return MPX Media object or NULL.
+         */
+        CMPXMedia* MPXMediaByMPXItemId( TMPXItemId aMpxItemId );
+        
+        /**
+         * Returns correct list index based on MPX Item Id.
+         * 
+         * @param aMpxItemId MPX Item Id.
+         * @return List index.
+         */
+        TInt IndexByMPXItemId( TMPXItemId aMpxItemId );
+        
+        /**
+         * Translates array index to MPX item id by reading the value from array.
+         *
+         * @param aArrayIndex Index in array.
+         * @return MPX item id
+         */
+        TMPXItemId ArrayIndexToMpxItemIdL( TInt aArrayIndex );
+        
+        /**
+         * Returns MPX Media object based on URI.
+         * 
+         * @param aUri Video's URI.
+         * @return MPX Media object or NULL.
+         */        
+        CMPXMedia* MPXMediaByUri( const TDesC& aUri );
+
+    private:
+
+        /**
+         * Constructor.
+         */
+        CVcxHgMyVideosVideoList();
+                
+    private:
+
+        /**
+         * Array of videos.
+         * Own.
+         */
+        RPointerArray<CVcxHgMyVideosVideoListItem> iVideoList;
+    };
+
+#endif // VCXHGMYVIDEOSVIDEOLIST_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/inc/vcxhgmyvideosvideolistimpl.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,449 @@
+/*
+* 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 of UI functionality for video list.*
+*/
+
+
+
+
+#ifndef VCXHGMYVIDEOSVIDEOLISTIMPL_H
+#define VCXHGMYVIDEOSVIDEOLISTIMPL_H
+
+// INCLUDE FILES
+#include <e32cmn.h>
+#include <ganes/HgSelectionObserverIface.h>
+#include <ganes/HgMarkingObserverIface.h>
+#include <AknProgressDialog.h>
+#include <upnpcommandobserver.h>
+#include "vcxhgmyvideoslistbase.h"
+
+// FORWARD DECLARATIONS
+class CVcxHgMyVideosVideoModelHandler;
+class TViaPlayerCustomMessage;
+class CAknWaitDialog;
+class CVcxHgMyVideosVideoCopier;
+class CVcxHgMyVideosUPnPInterface;
+class CHgScroller;
+class CSendUi;
+class CDRMHelper;
+#ifdef RD_VIDEO_AS_RINGING_TONE
+class CHgMyVideosAiwMenuHandler;
+#endif
+
+namespace DRM
+    {
+    class CDrmUtility;
+    }
+
+// CLASS DECLARATION
+
+/**
+ * Implementation of UI functionality for video list.
+ * 
+ * @lib vcxhgmyvideos.lib
+ */
+NONSHARABLE_CLASS( CVcxHgMyVideosVideoListImpl ) : public CVcxHgMyVideosListBase,
+                                                   public MProgressDialogCallback,
+                                                   public MUpnpCommandObserver,
+                                                   public MHgSelectionObserver,
+                                                   public MHgMarkingObserver
+    {
+    public:
+
+        /**
+         * Two-phased constructor.
+         *
+         * @param aModel Component model
+         * @param aView Component view
+         * @param aScroller Hg list control 
+    
+         * @return Pointer to newly created instance
+         */
+        static CVcxHgMyVideosVideoListImpl* NewL(
+            CVcxHgMyVideosModel& aModel,
+            CVcxHgMyVideosMainView& aView,
+            CHgScroller& aScroller );
+
+        /**
+         * Two-phased constructor.
+         *
+         * @param aModel Component model 
+         * @param aView Component view
+         * @param aScroller Hg list control
+         *
+         * @return Pointer to newly created instance
+         */
+        static CVcxHgMyVideosVideoListImpl* NewLC( 
+             CVcxHgMyVideosModel& aModel,
+             CVcxHgMyVideosMainView& aView,
+             CHgScroller& aScroller );
+    
+        /**
+        * Destructor.
+        */
+        virtual ~CVcxHgMyVideosVideoListImpl();
+    
+        /**
+         * Activate.
+         * 
+         * @param aIndex Index of video list to activate.
+         */
+        void DoListActivateL( TInt aIndex );
+    
+        /**
+         * Deactivate
+         */
+        void DoListDeactivate();
+
+        /**
+         * Returns reference to the video model.
+         * 
+         * @return Reference to video model.
+         */
+        CVcxHgMyVideosVideoModelHandler& VideoModel();
+        
+        /**
+         * Returns reference to the uPnP interface
+         * 
+         * @return Reference to uPnP interface
+         */
+        CVcxHgMyVideosUPnPInterface& UPnPInterface();
+
+        /**
+         * Gets list highlight.
+         * 
+         * @return Highlight.
+         */
+        TInt Highlight();
+
+        /**
+         * Returns the index(es) of video(s) that are operation targets.
+         * 
+         * @param aOperationTargets On return, index(es) of the video(s).
+         */
+        void GetOperationTargetIndexesL( RArray<TInt>& aOperationTargets );        
+
+        /**
+         * Starts playback of currently focused video.
+         */
+        void PlayCurrentVideoL();
+                        
+        /**
+         * Deletes currently selected video(s).
+         */
+        void DeleteVideosL();
+
+        /**
+         * Plays currently selected video.
+         */
+        void PlayVideoL();
+        
+        /**
+         * Handles sort command to list.
+         * 
+         * @param aSortCommand Sort command.
+         */
+        void HandleSortCommandL( TInt aSortCommand );
+        
+        /**
+         * Checks the UI and list status and returns information to show
+         * correct mark-menu items.
+         * 
+         * @param aShowMarkSubmenu On return, ETrue if mark sub-menu can be shown.
+         * @param showStartMarking On return, ETrue if start marking menu item can be shown.
+         * @param showEndMarking On return, ETrue if stop marking menu item can be shown.
+         * @param aShowMarkAll On return, ETrue if mark all menu item can be shown.
+         * @param aShowUnmarkAll On return, ETrue if unmark all menu item can be shown.
+         */
+        void ShowMarkMenuItemsL( 
+                 TBool& aShowMarkSubmenu, TBool& showStartMarking, TBool& showEndMarking, 
+                 TBool& aShowMarkAll, TBool& aShowUnmarkAll );
+
+        /**
+         * Handles mark command to list.
+         * 
+         * @param aMarkCommand Mark command.
+         */
+        void HandleMarkCommandL( TInt aMarkCommand );
+        
+        /**
+         * Handles move and copy commands to list.
+         * 
+         * @param aCopy ETrue if copy command was given. EFalse if move.
+         */
+        void HandleMoveOrCopyCommandL( TBool aCopy );
+        
+        /**
+         * Set empty list text for list control. 
+         */
+        void SetEmptyListTextL();        
+
+        /**
+         * Set title text for view.
+         * 
+         * @param aIndex Index of active video list.
+         */
+        void SetTitleTextL( TInt aIndex );
+
+        /**
+         * Handles dynamic initialisation of menu items specific to video list.
+         * 
+         * @param aResourceId Resource ID of menu to be activated.
+         * @param aMenuPane Pointer to menu pane.
+         */
+        void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
+        
+        /**
+         * Returns correct MSK resource Id based on current state of video list.
+         *
+         * @return MSK resource Id.
+         */
+        TInt GetMskResourceL();
+        
+        /**
+         * Called by video model when video deletion is completed.
+         * 
+         * @param aFailedCount Count of items that could not be deleted.
+         * @param aFailedName Name of video where deletion failed, if there was only one.
+         */
+        void VideoDeletionCompletedL( TInt aFailedCount, const TDesC& aFailedName );
+        
+        /**
+         * Called by video model when move or copy command is completed.
+         * 
+         * @param aFailedCount Count of items that could not be moved/copied.
+         * @param aFailedName Name of video where move/copy failed, if there was only one.
+         */
+        void VideoMoveOrCopyCompletedL( TInt aFailedCount, const TDesC& aFailedName );
+        
+        /**
+         * Displays note about resume starting from beginning.
+         */
+        void ShowResumeStartsFromBeginningNoteL();
+        
+        /**
+         * Begins multimarking mode.
+         */
+        void StartMarkingMode();
+        
+        /**
+         * Ends multimarking mode.
+         */
+        void EndMarkingMode();
+        
+        /**
+         * Send video using SendUI
+         */
+        void HandleSendL();
+
+#ifdef RD_VIDEO_AS_RINGING_TONE        
+        /**
+         * Handles command if aCommand is an Aiw command
+         * 
+         * @param aCommand Menu command ID
+         */
+        void TryHandleAiwCommandL( TInt aCommand );
+#endif
+        
+        /**
+         * Checks if we are at marking mode and returns
+         * corresponding value.
+		 *
+		 * @return ETrue if in marking mode else EFalse.
+         *  
+         */
+        TBool IsMarking();
+        
+    public: // From MProgressDialogCallback
+
+        /**
+         * Called when (delete) wait dialog is dismissed.
+         *
+         * @aButtonId Button with which dialog was dismissed.
+         */     
+        void DialogDismissedL( TInt aButtonId ); 
+    
+    public: // From MHgSelectionObserver
+            
+        /**
+         * Handle selection.
+         * 
+         * @param aIndex Selected item index.
+         */
+        void HandleSelectL( TInt aIndex );
+            
+        /**
+         * Handle opening.
+         * 
+         * @param aIndex Opened item index.
+         */
+        void HandleOpenL( TInt aIndex );
+    
+    public: // From MHgMarkingObserver
+        
+        /**
+         * Handle marking.
+         * 
+         * @param aIndex Selected item index.
+         * @param aMarked ETrue if item marked, EFalse if item is unmarked.
+         */
+        void HandleMarkingL( TInt aIndex, TBool aMarked ); 
+        
+    public:
+        
+       /**
+        * Handles async reposnses from CVcxHgMyVideosuPnPInterface::ShowVideo
+        * In case we receive KErrNone or value below it (error), video playback 
+        * has been ended due error or succesfully. 
+        * 
+        * Status might also be positive, which refers some undocumented additional
+        * information. According to UPnP documentation, those status values should 
+        * be ignored. 
+        * 
+        * @param aStatusCode  statuscode from the CVcxHgMyVideosUPnPInterface
+        */
+       void CommandComplete( TInt aStatusCode );
+        
+    protected:    
+        
+        /**
+         * Default constructor
+         *
+         * @param aModel Component model
+         * @param aView Component view
+         * @param aScroller Hg list control
+         */
+        CVcxHgMyVideosVideoListImpl( CVcxHgMyVideosModel& iModel,
+                                     CVcxHgMyVideosMainView& aView,
+                                     CHgScroller& aScroller );
+
+        /**
+         * 2nd phase constructor.
+         */
+        void ConstructL();
+
+        /**
+         * Confirms video deletion from user.
+         * 
+         * @param aTargetCount Count of deletion targets.
+         * @param aTargetName Name of deletion target, if there is only one.
+         * @return ETrue if user confirmed deletion.
+         */
+        TBool ConfirmDeleteVideosL( TInt aTargetCount, const TDesC& aTargetName );
+
+        /**
+         * Opens the deletion wait note.
+         */
+        void OpenDeleteWaitNoteL();
+
+        /**
+         * Closes the deletion wait note.
+         */
+        void CloseDeleteWaitNote();
+        
+        /**
+         * Fetch SendUI messaging configuration from CenRep
+         * 
+         * @return Messaging configuration from CenRep
+         */
+        TInt MessagingConfL();
+
+        /**
+         * Returns pointer to instance of CSendUi
+         * 
+         * @return Pointer to CSendUi
+         */
+        CSendUi* SendUiL();
+
+#ifdef RD_VIDEO_AS_RINGING_TONE
+        /**
+         * Returns pointer to instance of CHgMyVideosAiwMenuHandler.
+         * First call creates handler and attaches AIW menu.
+         * 
+         * @return Pointer to CHgMyVideosAiwMenuHandler
+         */
+        CHgMyVideosAiwMenuHandler* AiwMenuHandlerL();
+#endif
+
+        /**
+         * OperationTargetsToMpxIdsL
+         * Translates the target ui indexes to mpx ids. Needed for targeting 
+         * list items if list may change while the requested operation is ongoing.
+         *
+         * @param operationTargetIndexes IN: Ui idexes of the target items
+         * @param operationTargetIds OUT: Mpx ids of the target items
+         */
+        void OperationTargetsToMpxIdsL( RArray<TInt>& operationTargetIndexes,  
+                                        RArray<TInt>& operationTargetIds );
+
+        /**
+         * Add "Send" menu item to menu.
+         *
+         * @param aMenuPane Add the menu item to this menu pane
+         */
+        void AddSendItemToMenuPaneL( CEikMenuPane* aMenuPane );
+
+        /**
+         * Handles dynamic initialisation of Move, Copy and Delete menu items
+         *
+         * @param aMenuPane Pointer to menu pane.
+         * @param aItemsMarked If true, also add to Options menu. If false, only add to context menu.
+         */
+        void DynInitMenuPaneFileOperationsL(
+                CEikMenuPane* aMenuPane,
+                TBool aItemsMarked );
+
+    protected:
+    
+        /**
+         * Video model handler.
+         * Own.
+         */
+        CVcxHgMyVideosVideoModelHandler* iVideoModel;    
+        
+        /**
+         * Delete wait dialog.
+         * Own.
+         */
+        CAknWaitDialog* iDeleteWaitDialog;
+        
+        /**
+         * Class for handling copying and moving of videos.
+         * Own.
+         */
+        CVcxHgMyVideosVideoCopier* iVideoCopier; 
+        
+        /**
+         * UPnP handler interface
+         * Own.
+         */
+        CVcxHgMyVideosUPnPInterface* iUPnP;
+
+        /**
+         * SendUI
+         * Own
+         */
+        CSendUi* iSendUi;
+
+#ifdef RD_VIDEO_AS_RINGING_TONE
+        /** 
+         * Aiw Menu Handler
+         * Own
+         */
+        CHgMyVideosAiwMenuHandler* iAiwMenuHandler;
+#endif
+
+    };
+
+#endif // VCXHGMYVIDEOSVIDEOLISTIMPL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/inc/vcxhgmyvideosvideolistitem.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,122 @@
+/*
+* 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:   CVcxHgMyVideosVideoListItem class definition*
+*/
+
+
+
+
+#ifndef VCXHGMYVIDEOSVIDEOLISTITEM_H
+#define VCXHGMYVIDEOSVIDEOLISTITEM_H
+
+// INCLUDE FILES
+#include <coemain.h>
+#include <mpxitemid.h>
+#include "vcxmyvideosdefs.h"
+
+// FORWARD DECLARATIONS
+class CMPXMedia;
+
+// CLASS DECLARATION
+
+/**
+ *
+ * @lib vcxhgmyvideos.lib
+ */
+NONSHARABLE_CLASS( CVcxHgMyVideosVideoListItem ) : public CBase
+    {
+    public:
+
+        /**
+         * Two-phased constructor.
+		 *
+         * @param aMPXMedia MPX Media object, ownership is transferred.
+         * @return New object.
+         */
+        static CVcxHgMyVideosVideoListItem* NewL( CMPXMedia* aMPXMedia );
+
+        /**
+         * Two-phased constructor.
+		 *
+         * @param aMPXMedia MPX Media object, ownership is transferred.
+         * @return New object. 
+         */
+        static CVcxHgMyVideosVideoListItem* NewLC( CMPXMedia* aMPXMedia );
+
+        /**
+		 * Compares aNewVideo and aVideoInArray objects by size.
+		 * 
+		 * @param aNewVideo Video to be added to the list. 
+		 * @param aVideoInArray Video in array which is currently compared against aNewVideo.
+		 * @return 1 if aNewVideo size is greater, -1 if smaller and 0 if equal.
+		 */
+		static TInt CompareBySize( const CVcxHgMyVideosVideoListItem& aNewVideo,
+                                   const CVcxHgMyVideosVideoListItem& aVideoInArray );
+        
+		/**
+		 * Compares aNewVideo and aVideoInArray objects by name.
+		 * 
+		 * @param aNewVideo Video to be added to the list. 
+		 * @param aVideoInArray Video in array which is currently compared against aNewVideo.
+		 * @return -1 if aVideoInArray has smaller value, 1 if greater and 0 if equal.
+		 */
+		static TInt CompareByName( const CVcxHgMyVideosVideoListItem& aNewVideo,
+                                   const CVcxHgMyVideosVideoListItem& aVideoInArray );
+        
+        /**
+		 * Compares aNewVideo and aVideoInArray objects by date.
+		 * 
+		 * @param aNewVideo Video to be added to the list. 
+		 * @param aVideoInArray Video in array which is currently compared against aNewVideo.
+		 * @return -1 if aVideoInArray has smaller value, 1 if greater and 0 if equal.
+		 */
+		static TInt CompareByDate( const CVcxHgMyVideosVideoListItem& aNewVideo,
+                                   const CVcxHgMyVideosVideoListItem& aVideoInArray );
+		
+	    /**
+         * Returns MPX Media object.
+		 *
+		 * @return MPX Media object.
+         */
+		CMPXMedia* Media();
+                
+        /**
+         * Destructor.
+         */
+        virtual ~CVcxHgMyVideosVideoListItem();                      
+        
+    private: // Constructors
+
+        /**
+         * Default constructor.
+		 *
+		 * @param aMPXMedia MPX Media object, ownership is transferred.
+         */
+        CVcxHgMyVideosVideoListItem( CMPXMedia* aMPXMedia );
+
+        /**
+         * 2nd phase constructor.
+         */
+        void ConstructL();       
+    
+    private: // Data
+        
+        /**
+		 * MPX media object.
+         * Own.
+		 */
+        CMPXMedia*                      iMedia;
+    };
+
+#endif // VCXHGMYVIDEOSVIDEOLISTITEM_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/inc/vcxhgmyvideosvideomodelhandler.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,551 @@
+/*
+* Copyright (c) 2008-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:      UI level handler for video data.*
+*/
+
+
+
+
+#ifndef VCXHGMYVIDEOSVIDEOMODELHANDLER_H
+#define VCXHGMYVIDEOSVIDEOMODELHANDLER_H
+
+// INCLUDE FILES
+#include "vcxmyvideosdefs.h"
+#include "vcxhgmyvideosvideomodelobserver.h"
+
+#include <e32cmn.h>
+#include <ganes/HgScrollBufferObserverIface.h>
+
+// FORWARD DECLARATIONS
+class CVcxHgMyVideosVideoListImpl;
+class CVcxHgMyVideosModel;
+class CVcxHgMyVideosMainView;
+class CMPXMedia;
+class CVcxHgMyVideosVideoDataUpdater;
+class CVcxHgMyVideosVideoDetailsDialog;
+class CVcxHgMyVideosVideoList;
+class CHgScroller;
+class CMyVideosIndicator;
+class CRepository;
+
+// CLASS DECLARATION
+
+/**
+ * UI level handler for video data.
+ * @lib vcxhgmyvideos.lib
+ */
+NONSHARABLE_CLASS(  CVcxHgMyVideosVideoModelHandler ) :
+        public CBase,
+        public MVcxHgMyVideosVideoModelObserver,
+        public MHgScrollBufferObserver
+    {
+    public:
+    
+        /**
+         * Two-phased constructor.
+         * 
+         * @param aVideoListImpl Video list implementation
+         * @param aModel Application model
+         * @param aView Application view
+         * @param aScroller Hg list control   
+         * @return New object.
+         */
+        static CVcxHgMyVideosVideoModelHandler* NewL( 
+            CVcxHgMyVideosVideoListImpl& aVideoListImpl,
+            CVcxHgMyVideosModel& aModel,
+            CVcxHgMyVideosMainView& aView,
+            CHgScroller& aScroller );
+
+        /**
+         * Two-phased constructor.
+         * 
+         * @param aVideoListImpl Video list implementation
+         * @param aModel Application model
+         * @param aView Application view
+         * @param aScroller Hg list control   
+         * @return New object. 
+         */
+        static CVcxHgMyVideosVideoModelHandler* NewLC( 
+            CVcxHgMyVideosVideoListImpl& aVideoListImpl, 
+            CVcxHgMyVideosModel& aModel,
+            CVcxHgMyVideosMainView& aView,
+            CHgScroller& aScroller );
+
+        /**
+         * Destructor.
+         */
+        virtual ~CVcxHgMyVideosVideoModelHandler();
+    
+        /**
+         * Activates video model.
+         */
+        void DoModelActivateL();
+        
+        /**
+         * Deactivates video model.
+         */
+        void DoModelDeactivate();        
+
+        /**
+         * Makes sure model has correct video list.
+         * 
+         * @param aCategoryIndex of video list in MPX collection.
+         */
+        void UpdateVideoListL( TInt aCategoryIndex );
+        
+        /**
+         * Resorts current video list, called when list sort-order changes.
+         */
+        void ResortVideoListL();
+        
+        /**
+         * Gets list highlight.
+         * 
+         * @return Highlight.
+         */
+        TInt Highlight();        
+        
+        /**
+         * Returns the count of videos in UI list model.
+         *
+         * @return Count of videos in UI list model.
+         */
+        TInt VideoCount();
+
+        /**
+         * Returns the index of currently open video list, or KErrNotFound.
+         * 0=All videos, 1=Downloads, 2=...
+         * 
+         * @return Index of currently open video list.
+         */
+        TInt CurrentCategoryIndex();
+
+        /**
+         * Returns a list of currently marked videos.
+         * 
+         * @return List of currently marked video indexes.
+         */
+        void MarkedVideosL( RArray<TInt>& aMarkedVideos );
+
+        /**
+         * Handles mark command to video list.
+         * 
+         * @param aMarkCommand Mark command.
+         */
+        void HandleMarkCommandL( TInt aMarkCommand );
+
+        /**
+         * Returns video's name.
+         * 
+         * @param aId Video's unique id.
+         * @return Video's name or empty string.
+         */
+        const TDesC& GetVideoName( TInt aId );
+        
+        /**
+         * Returns video's URI.
+         * 
+         * @param aIndex Video's index on UI list.
+         * @return Video's URI or empty string.
+         */        
+        const TDesC& GetVideoUri( TInt aIndex );
+        
+        /**
+         * Returns video's unique mpx id.
+         * 
+         * @param aIndex Video's index on UI list.
+         * @return Video's id or KErrNotFound.
+         */  
+        TInt GetVideoId( TInt aIndex );
+        
+        /**
+         * Returns video size in bytes
+         * 
+         * @param aIndex Video's index on UI list.
+         * @return Video size in bytes or zero.
+         */
+        TInt64 GetVideoSize( TInt aIndex );
+
+        /**
+         * Deletes videos with requested ids.
+         * 
+         * @param aOperationTargets Videos' mpx ids.
+         */
+        void DeleteVideosL( const RArray<TInt>& aOperationTargets );
+
+        /**
+         * Moves or copies videos with requested ids to given target.
+         * 
+         * @param aOperationTargets Videos' mpx ids.
+         * @param aTargetDrive Target drive.
+         * @param aCopy If ETrue, copy is performed. If EFalse, move.
+         */
+        void MoveOrCopyVideosL( const RArray<TInt>& aOperationTargets,
+                                TInt aTargetDrive,
+                                TBool aCopy );
+
+        /**
+         * Play a video from requested index.
+         * 
+         * @param aIndex Video's index on UI list.
+         */
+        void PlayVideoL( TInt aIndex );
+        
+        /**
+         * Returns age profile of a video.
+         * 
+         * @param aIndex Video's index on UI list.
+         * @return Age profile, or 0 if not defined.
+         */
+        TInt32 VideoAgeProfileL( TInt aIndex );
+
+        /**
+         * Returns age profile of a video.
+         * 
+         * @param aId TMPXItemId for the video.
+         * @return Age profile, or 0 if not defined.
+         */
+        TInt32 VideoAgeProfileL( TMPXItemId aId );
+
+        /**
+         * Returns age profile of a video.
+         * 
+         * @param aMedia MPX media for the video.
+         * @return Age profile, or 0 if not defined.
+         */
+        TInt32 VideoAgeProfileL( CMPXMedia* aMedia );
+
+        /*
+         * Tries to find MPX Item Id of unknown video.
+         *
+         * @param aVideoPath Path of the video.
+         * @param aMpxItemId On return, MPX Item Id if found.
+         * @return ETrue if video was found.
+         */
+        TBool FindVideoMpxIdL( const TDesC& aVideoPath, TMPXItemId& aMpxItemId );
+
+        /**
+         * Gets data of currently highlighted video, and passes it to
+         * TVcxHgMyVideosVideoDetailsDialog::ShowVideoDetailsDialogL().
+         */
+        void ShowVideoDetailsDialogL();
+        
+        /**
+         * Returns video indicator.
+         * 
+         * @return Reference to video indicator.
+         */
+        CMyVideosIndicator& VideoIndicator();
+        
+    public: // From MVcxHgMyVideosVideoModelObserver
+        
+        /**
+         * Called when a list of videos is available.
+         * 
+         * @param aVideoList List of videos
+         */
+        void NewVideoListL( CMPXMediaArray& aVideoList );
+         
+        /**
+         * Called when the whole video list has been modified.
+         * Normally this means that new items have been appended to list.
+         */
+        void VideoListModifiedL();
+         
+        /**
+         * Called when a single video item has been modified (add/remove/modify).
+         * 
+         * @param aEventType Type of modification event (add/remove/modify).
+         * @param aMpxItemId MPX Item Id of the modified item.
+         * @param aExtraInfo Extra information for modification event.
+         * @param aSimulated If ETrue, event is not originated from MPX Collection.
+         */
+        void VideoModifiedL( TMPXChangeEventType aEventType,
+                              TMPXItemId aMpxItemId,
+                              TInt32 aExtraInfo,
+                              TBool aSimulated );
+        
+        /*
+         * Called when a single video item has fetched.
+         * Ownership of video is transferred.
+         * 
+         * @param aVideo Video item.
+         */
+        void VideoFetchingCompletedL( CMPXMedia* aVideo );
+        
+        /**
+         * Called when multiple video deletion command is completed.
+         * 
+         * @param aFailedCount Count of failed deletions, if any.
+         * @param aFailedMpxId If above 1, MPXItemId of failed deletion.
+         */
+        void VideoDeletionCompletedL( TInt aFailedCount, TMPXItemId aFailedMpxId );         
+         
+        /**
+         * Called when move or copy command is completed.
+         * 
+         * @param aFailedCount Count of failed moves/copies, if any.
+         * @param aFailedMpxId If above 1, MPXItemId of failed move/copy.
+         */
+        void VideoMoveOrCopyCompletedL( TInt aFailedCount, TMPXItemId aFailedMpxId );
+        
+        /**
+         * Called when all details for a video have been fetched.
+         * 
+         * @param aMedia MPX Media that contains all details.
+         */
+        void VideoDetailsCompletedL( const CMPXMedia& aMedia );
+		
+    public: // From MHgScrollBufferObserver
+        
+        /**
+         * Buffer position changed. 
+         * The items between the aBufferStart and aBufferEnd should be released.
+         * 
+         * @param aBufferStart The index of the first item in buffer.
+         * @param aBufferEnd The index of the last item in buffer.
+         */
+        void Release( TInt aReleaseStart, TInt aReleaseEnd );
+    
+        /**
+         * Buffer position changed. 
+         * The items between the aBufferStart and aBufferEnd should be loaded as soon as possible.
+         * 
+         * @param aBufferStart The index of the first item in buffer.
+         * @param aBufferEnd The index of the last item in buffer.
+         * @param aDirection The direction of request.
+         */
+        void Request( TInt aRequestStart, TInt aRequestEnd, THgScrollDirection aDirection );
+        
+    private:    
+        
+        /**
+         * Default constructor
+         *
+         * @param aVideoListImpl Video list implementation
+         * @param aModel Application model
+         * @param aView Application view
+         * @param aScroller Hg list control
+         */
+        CVcxHgMyVideosVideoModelHandler( 
+            CVcxHgMyVideosVideoListImpl& aVideoListImpl,
+            CVcxHgMyVideosModel& aModel,
+            CVcxHgMyVideosMainView& aView,
+            CHgScroller& aScroller );            
+    
+        /**
+         * 2nd phase constructor.
+         */
+        void ConstructL( );
+    
+        /**
+         * Replaces old video array with new one. Old array is deleted. 
+         * 
+         * @param aVideoList Reference to new video array.
+         */
+        void ReplaceVideoArrayL( CMPXMediaArray& aVideoList );
+
+        /**
+         * Formats the second row string for video item.
+         * 
+         * @param aMedia MPX Media object (video).
+         * @return Second row string.
+         */
+        HBufC* FormatVideoSecondRowLC( CMPXMedia& aMedia );
+        
+        /**
+         * Updates video list item at given list index.
+         * @param aListIndex Index.
+         */
+        void UpdateVideoListItemL( TInt aListIndex );
+          
+        /**
+         * Deletes item from video array and UI list.
+         * @param aMpxItemId MPX Item Id of the deleted item.
+         */
+        void DeleteItemL( TMPXItemId aMpxItemId );
+        
+        /**
+         * List control calls this when it needs new buffer of data.
+         * 
+         * @param aRequestStart The index of the first item in buffer.
+         * @param aRequestEnd The index of the last item in buffer.
+         * @param aDirection The direction of request.
+         */
+        void HandleRequestL( TInt aRequestStart, 
+                             TInt aRequestEnd, 
+                             THgScrollDirection aDirection );
+        
+        /**
+         * Inserts new video to video array and UI list.  
+         *  
+         * @param aVideo Video item. Ownership of video is transferred. 
+         */ 
+        void InsertVideoL( CMPXMedia* aVideo );
+        
+        /**
+         * Compares MPX origin information to currently displayed category. 
+         * 
+         * @return ETrue if media belongs to category, otherwise EFalse.
+         */
+        TBool ValidOrigin( CMPXMedia& aMedia );
+
+        /** 
+         * Saves MPX id of first (topmost) visible item.
+         */
+        void SaveFirstListItemIdL();
+
+        /**
+         * Update scrollbar strip type depending on sort order
+         */
+        void UpdateScrollbarTypeL( const TVcxMyVideosSortingOrder& aSortingOrder );
+
+        /**
+         * Resets scroller items for refetch only
+         */
+        void ResetScrollerItemsL();
+
+        /** 
+         * Resets scroller buffer and items for refetch
+         * This is fastest way to reset scroller when item count is unchanged
+         */
+        void ResetScrollerBufferAndItemsL();
+
+        /** 
+         * Resizes scroller with refetch
+         * This is faster way to reset scroller than CHgScroller::Reset() and 
+         * CHgScroller::ResizeL() calls combined
+         * @param aNewItemCount New item count
+         */
+        void ResizeScrollerL( TInt aNewItemCount );
+		
+        /**
+         * Sets video as last watched.
+         *    
+         * @param aMedia Media that will be last watched.    
+         */
+        void SetVideoLastWatchedL( CMPXMedia& aMedia );
+        
+        /**
+         * Clears new video tag from the file.
+         * 
+         * @param aMedia Media from which new video tag will be cleared.         
+         */
+        void ClearNewVideoFlagL( CMPXMedia& aMedia );
+
+        /**
+         * Saves the marked MPXMedia items to iMarkedMediaList. This is called before
+         * re-sorting the videos list if marking mode is enabled to preserve the
+         * marking status of marked items.
+         */
+        void SaveMarkingsL();
+
+        /**
+         * Restores the marking status of the MPXMedia items from iMarkedMediaList.
+         * This is called after re-sorting the list if marking mode is enabled to
+         * restore the marking status of the marked items.
+         * 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:
+        
+        /**
+         * Video details dialog.
+         * Own.
+         */
+        CVcxHgMyVideosVideoDetailsDialog* iVideoDetails;
+        
+        /**
+         * Reference to video list implementation.
+         * Not own.
+         */
+        CVcxHgMyVideosVideoListImpl& iVideoListImpl;
+        
+        /**
+         * Reference to application model.
+         * Not own.
+         */
+        CVcxHgMyVideosModel& iModel;
+
+        /**
+         * Reference to application view.
+         * Not own.
+         */        
+        CVcxHgMyVideosMainView& iView;
+        
+        /**
+         * Array of videos.
+         * Own.
+         */
+        CVcxHgMyVideosVideoList* iVideoArray;
+                
+        /**
+         * Class for updating video data (thumbnail, DRM status) asynchronously.
+         * Own.
+         */
+        CVcxHgMyVideosVideoDataUpdater* iDataUpdater;
+
+        /**
+         * Hg list component.
+         * Not own.
+         */
+        CHgScroller& iScroller;
+        
+        /**
+         * Index of MPX collection video list currently displayed.
+         */
+        TInt iCurrentCategoryIndex;
+
+        /**
+         * Flag for indicating that list should restore to the position
+         * where it was before model deactivating. 
+         */ 
+        TBool iRestoreListPosition;
+        
+        /**
+         * MPX id of first (topmost) visible item in a video list.
+         */
+        TMPXItemId iFirstListItemId;
+
+        /**
+         * Video indicator gives an overlay icon for video thumbnails.
+         */
+        CMyVideosIndicator* iVideoIndicator;
+
+        /**
+         * Array of marked MPXMedia items to temporarily hold a list of marked items in video list.
+         * The array is temporarily filled with pointers to marked media items prior to re-sorting
+         * the video list and is cleared after sorting.
+         */
+        RPointerArray<CMPXMedia> iMarkedMediaList;
+		
+        /**
+         * Cenrep session.
+         */
+        CRepository* iRepository;
+
+    };
+
+#endif // VCXHGMYVIDEOSVIDEOMODELHANDLER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/inc/vcxhgmyvideosvideomodelobserver.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,102 @@
+/*
+* 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:      Observer interface for video data changes.*
+*/
+
+
+
+
+#ifndef VCXHGMYVIDEOSVIDEOMODELOBSERVER_H
+#define VCXHGMYVIDEOSVIDEOMODELOBSERVER_H
+
+// INCLUDE FILES
+#include <mpxcollectionmessagedefs.h>
+#include <mpxitemid.h>
+
+// FORWARD DECLARATIONS
+class CMPXMediaArray;
+class CMPXMedia;
+
+// CLASS DECLARATION
+
+/**
+ * Observer interface for video data changes.
+ *
+ * @lib vcxhgmyvideos.lib
+ */
+NONSHARABLE_CLASS( MVcxHgMyVideosVideoModelObserver )
+    {
+    public:
+
+        /**
+         * Called when a list of videos is available.
+         * 
+         * @param aVideoList List of videos
+         */
+        virtual void NewVideoListL( CMPXMediaArray& aVideoList ) = 0;
+        
+        /**
+         * Called when the whole video list has been modified.
+         * Normally this means that new items have been appended to list.
+         */
+        virtual void VideoListModifiedL() = 0;
+        
+        /*
+         * Called when a single video item has fetched.
+         * Ownership of video is transferred.
+         * 
+         * @param aVideo Video item.
+         */
+        virtual void VideoFetchingCompletedL( CMPXMedia* aVideo ) = 0;
+                
+        /**
+         * Called when a single video item has been modified (add/remove/modify).
+         * 
+         * @param aEventType Type of modification event (add/remove/modify).
+         * @param aMpxItemId MPX Item Id of the modified item.
+         * @param aExtraInfo Extra information for modification event.
+         * @param aSimulated If ETrue, event is not originated from MPX Collection.
+         */
+        virtual void VideoModifiedL( TMPXChangeEventType aEventType,
+                                     TMPXItemId aMpxItemId,
+                                     TInt32 aExtraInfo,
+                                     TBool aSimulated = EFalse ) = 0;
+        
+        /**
+         * Called when multiple video deletion command is completed.
+         * 
+         * @param aFailedCount Count of failed deletions, if any.
+         * @param aFailedMpxId If above 1, MPXItemId of failed deletion.
+         */
+        virtual void VideoDeletionCompletedL( TInt aFailedCount,
+                                              TMPXItemId aFailedMpxId ) = 0;
+
+        /**
+         * Called when move or copy command is completed.
+         * 
+         * @param aFailedCount Count of failed moves/copies, if any.
+         * @param aFailedMpxId If above 1, MPXItemId of failed move/copy.
+         */
+        virtual void VideoMoveOrCopyCompletedL( TInt aFailedCount,
+                                                TMPXItemId aFailedMpxId ) = 0;
+        
+        /**
+         * Called when all details for a video have been fetched.
+         * 
+         * @param aMedia MPX Media that contains all details.
+         */
+        virtual void VideoDetailsCompletedL( const CMPXMedia& aMedia ) = 0;
+    };
+
+#endif // VCXHGMYVIDEOSVIDEOMODELOBSERVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/install/hgmyvideosview.pkg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,65 @@
+;
+; 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 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:    Pkg file.;
+
+;Language - standard language definitions
+&EN
+
+; standard SIS file header
+#{"hgmyvideosview"},(0xE4D0A8D5),1,1,0
+
+;Localised Vendor name
+%{"Nokia"}
+
+;Unique Vendor name
+:"Nokia"
+
+
+;Files to install
+;You should change the source paths to match that of your environment
+;<source> <destination>
+
+;<source> <destination>
+; ODE
+"\Epoc32\release\armv5\urel\ODE.DLL"		-"!:\sys\bin\ODE.DLL"
+
+;Ganes, remove after ganes in in platform
+"\Epoc32\release\armv5\urel\ganes.DLL"		-"!:\sys\bin\ganes.DLL"
+"\Epoc32\data\z\resource\apps\ganes.mif" -"!:\resource\apps\ganes.mif"
+
+;VIEW PLUGINS
+"\epoc32\release\ARMV5\UREL\vcxhgmyvideosplugin.dll"                     -"!:\sys\bin\vcxhgmyvideosplugin.dll"
+"\epoc32\data\z\resource\plugins\vcxhgmyvideosplugin.rsc"                -"!:\resource\plugins\vcxhgmyvideosplugin.rsc"
+
+
+;VIEWS
+"\Epoc32\release\ARMV5\UREL\vcxhgmyvideos.dll"                           -"!:\sys\bin\vcxhgmyvideos.dll"
+"\Epoc32\data\z\resource\apps\vcxhgmyvideos.rsc"                         -"!:\resource\apps\vcxhgmyvideos.rsc"
+"\Epoc32\data\z\resource\apps\vcxhgmyvideos.r01"                         -"!:\resource\apps\vcxhgmyvideos.r01"
+"\Epoc32\data\z\resource\apps\vcxhgmyvideos.r03"                         -"!:\resource\apps\vcxhgmyvideos.r03"
+"\Epoc32\data\z\resource\apps\vcxhgmyvideos.r27"                         -"!:\resource\apps\vcxhgmyvideos.r27"
+
+
+; Test app, ensure that it is in build
+"\epoc32\release\armv5\urel\hgmyvideostest_0xE4D0A8D5.exe" - "!:\sys\bin\hgmyvideostest_0xE4D0A8D5.exe"
+"\epoc32\data\Z\private\10003a3f\apps\hgmyvideostest_0xE4D0A8D5_reg.rsc" - "!:\private\10003a3f\import\apps\hgmyvideostest_0xE4D0A8D5_reg.rsc"
+"\epoc32\data\Z\resource\apps\hgmyvideostest_0xE4D0A8D5.mif" - "!:\resource\apps\hgmyvideostest_0xE4D0A8D5.mif"
+"\epoc32\data\z\resource\apps\hgmyvideostest_0xE4D0A8D5.rsc" - "!:\resource\apps\hgmyvideostest_0xE4D0A8D5.rsc"
+
+
+;GRAPHIC
+"\epoc32\data\z\resource\apps\vcxhgmyvideos.mif"                                    -"!:\resource\apps\vcxhgmyvideos.mif"
+"\epoc32\data\z\resource\apps\vcxhgmyvideosicons.mif"                               -"!:\resource\apps\vcxhgmyvideosicons.mif"
+;"\epoc32\winscw\c\resource\apps\alfmpxcollectionviewgraphics\default_cd.mbm"       -"c:\resource\apps\alfmpxcollectionviewgraphics\default_cd.mbm"
+;"\epoc32\winscw\c\resource\apps\alfmpxcollectionviewgraphics\shuffle_cd.png"       -"c:\resource\apps\alfmpxcollectionviewgraphics\shuffle_cd.png"
Binary file videocollection/hgmyvideos/install/hgmyvideosview.sisx has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/install/make_sisx.bat	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,26 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of the License "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:  Sis creation bat file
+rem
+
+
+call makesis hgmyvideosview.pkg
+ 
+
+call signsis hgmyvideosview.sis hgmyvideosview.sisx Nokia_RnDCert_01.der Nokia_RnDCert_01.key
+ 
+
+call del hgmyvideosview.sis
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/rom/hgmyvideos.iby	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2006-2009 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:      Image description file for project .*
+*/
+
+
+
+
+#ifndef HGMYVIDEOS_IBY
+#define HGMYVIDEOS_IBY
+
+#include <data_caging_paths_for_iby.hrh>
+
+file=ABI_DIR\BUILD_DIR\vcxhgmyvideos.dll      SHARED_LIB_DIR\vcxhgmyvideos.dll
+
+#endif // HGMYVIDEOS_IBY
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/rom/hgmyvideosrsc.iby	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2006-2009 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:      Image description file for project .*
+*/
+
+
+
+
+#ifndef HGMYVIDEOSRSC_IBY
+#define HGMYVIDEOSRSC_IBY
+
+#include <data_caging_paths_for_iby.hrh>
+
+data=DATAZ_\APP_RESOURCE_DIR\vcxhgmyvideos.rsc        APP_RESOURCE_DIR\vcxhgmyvideos.rsc
+data=DATAZ_\APP_RESOURCE_DIR\vcxhgmyvideos.mif        APP_RESOURCE_DIR\vcxhgmyvideos.mif
+data=DATAZ_\APP_RESOURCE_DIR\vcxhgmyvideosicons.mif   APP_RESOURCE_DIR\vcxhgmyvideosicons.mif
+
+#endif // HGMYVIDEOSRSC_IBY
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/src/CIptvDriveMonitor.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,828 @@
+/*
+* 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 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 "CIptvDriveMonitor.h"
+#include "MIptvDriveMonitorObserver.h"
+#include "TIptvDriveMonitorEvent.h"
+#include <bldvariant.hrh>
+#ifdef RD_MULTIPLE_DRIVE_ENABLERS
+#include <driveinfo.h>
+#endif
+#include <centralrepository.h>
+
+// EXTERNAL DATA STRUCTURES
+
+// EXTERNAL FUNCTION PROTOTYPES  
+
+// CONSTANTS
+#if IPTV_LOGGING_METHOD != 0
+_LIT( KIptvMediaNotPresentDes, "EMediaNotPresent");
+_LIT( KIptvMediaUnknownDes, "EMediaUnknown");
+_LIT( KIptvMediaFloppyDes, "EMediaFloppy");
+_LIT( KIptvMediaHardDiskDes, "EMediaHardDisk");
+_LIT( KIptvMediaCdRomDes, "EMediaCdRom");
+_LIT( KIptvMediaRamDes, "EMediaRam");
+_LIT( KIptvMediaFlashDes, "EMediaFlash");
+_LIT( KIptvMediaRomDes, "EMediaRom");
+_LIT( KIptvMediaRemoteDes, "EMediaRemote");
+_LIT( KIptvMediaNANDFlashDes, "EMediaNANDFlash");
+#endif
+
+// MACROS
+
+// LOCAL CONSTANTS AND MACROS
+
+// MODULE DATA STRUCTURES
+
+// LOCAL FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CIptvDriveMonitor::CIptvDriveMonitor
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CIptvDriveMonitor::CIptvDriveMonitor()
+: CActive( EPriorityStandard )
+    {
+    IPTVLOGSTRING_HIGH_LEVEL("CIptvDriveMonitor::CIptvDriveMonitor() start");
+    IPTVLOGSTRING_HIGH_LEVEL("CIptvDriveMonitor::CIptvDriveMonitor() exit");
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvEvents::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CIptvDriveMonitor::ConstructL( const RFs& aFileSession )
+    {
+    iFs                  = aFileSession;
+    iIfsIsProvidedByUser = ETrue;
+   
+    ConstructL();    
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvEvents::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CIptvDriveMonitor::ConstructL()
+    {
+    iObservers.Reset();
+    iAvailableDrives.Reset();
+    iPreviousAvailableDrives.Reset();
+    
+    if ( !iIfsIsProvidedByUser )
+        {
+        User::LeaveIfError( iFs.Connect() );
+        }
+
+    iSystemDrive = iFs.GetSystemDrive();
+    TInt err = DriveInfo::GetDefaultDrive( DriveInfo::EDefaultMassStorage, iDefaultMassStorageDrive );
+    if ( err != KErrNone )
+        {
+        iDefaultMassStorageDrive = KErrNotFound;        
+        }
+    err = DriveInfo::GetDefaultDrive( DriveInfo::EDefaultRemovableMassStorage, iDefaultMemoryCardDrive );
+    if ( err != KErrNone )
+        {
+        iDefaultMassStorageDrive = KErrNotFound;        
+        }
+            
+    CActiveScheduler::Add( this );
+    RefreshAvailableDrivesL();
+
+    IPTVLOGSTRING2_HIGH_LEVEL("CIptvDriveMonitor:: PhoneMemoryDrive() returns %d",
+        PhoneMemoryDrive());
+    IPTVLOGSTRING2_HIGH_LEVEL("CIptvDriveMonitor:: MemoryCardDrive() returns %d",
+        MemoryCardDrive());
+    IPTVLOGSTRING2_HIGH_LEVEL("CIptvDriveMonitor:: MassStorageDrive() returns %d",
+        MassStorageDrive());
+    IPTVLOGSTRING2_HIGH_LEVEL("CIptvDriveMonitor:: FixedDrive(c-drive excluded) returns %d",
+        FixedDrive( ETrue ));
+    
+#if IPTV_LOGGING_METHOD != 0
+    PrintAvailableDrives();
+#endif
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvDriveMonitor::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CIptvDriveMonitor* CIptvDriveMonitor::NewL()
+    {
+    IPTVLOGSTRING_HIGH_LEVEL("CIptvDriveMonitor::NewL() start");
+
+    CIptvDriveMonitor* self = new( ELeave ) CIptvDriveMonitor();
+        
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop(self);
+
+    IPTVLOGSTRING_HIGH_LEVEL("CIptvDriveMonitor::NewL() exit");
+
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvDriveMonitor::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CIptvDriveMonitor* CIptvDriveMonitor::NewL( const RFs& aFileSession )
+    {
+    IPTVLOGSTRING_HIGH_LEVEL("CIptvDriveMonitor::NewL(RFs&) start");
+
+    CIptvDriveMonitor* self = new( ELeave ) CIptvDriveMonitor();
+        
+    CleanupStack::PushL( self );
+    self->ConstructL( aFileSession );
+    CleanupStack::Pop(self);
+
+    IPTVLOGSTRING_HIGH_LEVEL("CIptvDriveMonitor::NewL(RFs&) exit");
+
+    return self;
+    }
+    
+// Destructor
+CIptvDriveMonitor::~CIptvDriveMonitor()
+    {
+    iObservers.Close();
+    iAvailableDrives.Close();
+    iPreviousAvailableDrives.Close();
+    Cancel();
+    
+    if ( !iIfsIsProvidedByUser )
+        {
+        iFs.Close();
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CIptvDriveMonitor::RegisterObserverL
+// -----------------------------------------------------------------------------
+//
+void CIptvDriveMonitor::RegisterObserverL( MIptvDriveMonitorObserver* aObserver )
+    {
+    iObservers.AppendL( aObserver );
+
+    if ( !IsActive() )
+        {
+        iFs.NotifyChange( ENotifyDisk, iStatus );
+        SetActive();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvDriveMonitor::RemoveObserverL
+// -----------------------------------------------------------------------------
+//
+void CIptvDriveMonitor::RemoveObserverL( MIptvDriveMonitorObserver* aObserver )
+    {
+    TInt i;
+    for ( i = 0; i < iObservers.Count(); i++ )
+        {
+        if ( aObserver == iObservers[i] )
+            {
+            iObservers.Remove( i );
+            iObservers.Compress();
+            break;
+            }
+        }
+        
+    if ( iObservers.Count() == 0 )
+        {
+        iFs.NotifyChangeCancel();
+        }    
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvDriveMonitor::RefreshAvailableDrivesL
+// -----------------------------------------------------------------------------
+//
+void CIptvDriveMonitor::RefreshAvailableDrivesL()
+    {
+    IPTVLOGSTRING_LOW_LEVEL("CIptvDriveMonitor::RefreshAvailableDrivesL() start");
+    
+    TDriveList driveList;
+    User::LeaveIfError( iFs.DriveList( driveList ) );
+
+    iPreviousAvailableDrives.Reset();
+    TInt i;
+    for ( i = 0; i < iAvailableDrives.Count(); i++ )
+        {
+        iPreviousAvailableDrives.Append( iAvailableDrives[i] );
+        }
+            
+    iAvailableDrives.Reset();
+    
+    for ( i = 0; i < driveList.Length(); i++ )
+        {
+        if ( driveList[i] != 0 )
+            {
+            TDriveInfo driveInfo;
+            User::LeaveIfError( iFs.Drive( driveInfo, i ) );
+            
+            IPTVLOGSTRING3_LOW_LEVEL("CIptvDriveMonitor:: drive[%d]: type = %S",
+                                     i,
+                                     &DriveTypeDes( driveInfo.iType ));
+
+            IPTVLOGSTRING3_LOW_LEVEL(
+                "CIptvDriveMonitor::           MediaAtt flags = %x DriveAtt flags = %x",
+                    driveInfo.iMediaAtt,
+                    driveInfo.iDriveAtt );
+
+#ifdef __WINSCW__
+            // (2) c-drive is EMediaRam
+            // (3) d-drive is EMediaHardDisk
+            // (4) e-drive is EMediaHardDisk or EMediaNotPresent
+            // (25) z-drive is EMediaRom
+            if ( (driveInfo.iType == EMediaRam) ||                                     // c
+                 ((driveInfo.iType == EMediaHardDisk) && i != EDriveD /* skip d */) || // e
+                 (driveInfo.iType == EMediaNANDFlash) ||                               // nothing
+                 (driveInfo.iType == EMediaNotPresent) )                               // e
+#else
+            // (2) c-drive is EMediaNANDFlash
+            // (3) d-drive is EMediaRam
+            // (4) e-drive is EMediaHardDisk or EMediaNotPresent
+            // (5) f-drive is EMediaHardDisk or EMediaNotPresent
+            // (25) z-drive is EMediaRom
+            if ( (driveInfo.iType == EMediaHardDisk) ||  // e,f
+                 (driveInfo.iType == EMediaNANDFlash) || // c
+                 (driveInfo.iType == EMediaNotPresent) ) // e,f
+#endif // __WINSCW__
+                {                
+                if ( !(driveInfo.iMediaAtt & KMediaAttWriteProtected) &&
+                      (driveInfo.iDriveAtt & KDriveAttLocal) )
+                    {
+                    TIptvDriveInfo iptvDriveInfo;
+                    TVolumeInfo volumeInfo;
+                    TChar ch;
+
+                    iFs.DriveToChar( i, ch );
+
+                    iptvDriveInfo.iDrive     = i;
+                    iptvDriveInfo.iDriveChar = ch;
+                    iptvDriveInfo.iType      = driveInfo.iType;
+                    
+                    TUint driveStatus;
+                    TInt err = DriveInfo::GetDriveStatus( iFs, i, driveStatus );
+                    if ( err == KErrNone )
+                        {
+                        if ( driveStatus & DriveInfo::EDriveRemovable )
+                            {
+                            iptvDriveInfo.iFlags |= TIptvDriveInfo::ERemovable;
+                            }
+                        }
+
+                    TInt massStorageDrive;
+                    err = DriveInfo::GetDefaultDrive( DriveInfo::EDefaultMassStorage,
+                                                      massStorageDrive );
+                    if ( err == KErrNone )
+                        {
+                        if ( i == massStorageDrive )
+                            {
+                            iptvDriveInfo.iFlags |= TIptvDriveInfo::EMassStorage;
+                            }                        
+                        }
+
+                    if ( driveInfo.iMediaAtt & KMediaAttLocked )
+                        {
+                        iptvDriveInfo.iFlags |= TIptvDriveInfo::ELocked;
+                        }
+                    if ( driveInfo.iType == EMediaNotPresent )
+                        {
+                        iptvDriveInfo.iFlags |= TIptvDriveInfo::EMediaNotPresent;
+                        }
+
+                    // When mass storage mode is activated while application is running,
+                    // the only hint about that is the TVolumeInfo not being available. 
+                    // Therefore we mark drive as EMediaNotPresent if that structure
+                    // is not available.
+                    if ( iFs.Volume( volumeInfo, i ) != KErrNone )
+                        {
+                        iptvDriveInfo.iFlags |= TIptvDriveInfo::EMediaNotPresent;
+                        iptvDriveInfo.iVolumeName.Zero();
+                        }
+                    else
+                        {
+                        iptvDriveInfo.iVolumeName = volumeInfo.iName;
+                        }
+
+                    if ( iptvDriveInfo.iFlags & TIptvDriveInfo::EMediaNotPresent )
+                        {
+                        iptvDriveInfo.iFlags |= TIptvDriveInfo::ERemovable;
+                        }
+                                            
+                    iAvailableDrives.AppendL( iptvDriveInfo );
+                    }
+                }
+            }
+        } // for
+
+    // if e and f-drives are available, then c-drive is removed from the available drives list
+    if ( ArrayPos( EDriveE ) != KErrNotFound &&
+         ArrayPos( EDriveF ) != KErrNotFound )
+        {
+        TInt cDrivePos = ArrayPos( EDriveC );
+        if ( cDrivePos != KErrNotFound )
+            {
+            IPTVLOGSTRING_LOW_LEVEL(
+                "CIptvDriveMonitor:: e & f-drives available -> removing c from available drives");
+            iAvailableDrives.Remove( cDrivePos );
+            iAvailableDrives.Compress();
+            }
+        }
+    
+    IPTVLOGSTRING_LOW_LEVEL("CIptvDriveMonitor::RefreshAvailableDrivesL() exit");
+    }
+    
+// -----------------------------------------------------------------------------
+// CIptvDriveMonitor::ArrayPos
+// -----------------------------------------------------------------------------
+//
+TInt CIptvDriveMonitor::ArrayPos( TInt aDrive )
+    {
+    TInt i;
+    for (i = 0; i < iAvailableDrives.Count(); i++ )
+        {
+        if ( iAvailableDrives[i].iDrive == aDrive )
+            {
+            return i;
+            }
+        }
+    return KErrNotFound;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvDriveMonitor::ArrayPosL
+// -----------------------------------------------------------------------------
+//
+TInt CIptvDriveMonitor::ArrayPosL( TInt aDrive )
+    {
+    TInt pos;
+    User::LeaveIfError( pos = ArrayPos( aDrive ) );
+    return pos;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvDriveMonitor::MemoryCardDriveL
+// -----------------------------------------------------------------------------
+//
+TInt CIptvDriveMonitor::MemoryCardDriveL()
+    {
+    TInt drive;
+    User::LeaveIfError( drive = MemoryCardDrive() );
+    return drive;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvDriveMonitor::MemoryCardDrive
+// -----------------------------------------------------------------------------
+//
+TInt CIptvDriveMonitor::MemoryCardDrive()
+    {
+    TInt i;
+    for ( i = 0; i < iAvailableDrives.Count(); i++ )
+        {
+        if ( iAvailableDrives[i].iDrive == iDefaultMemoryCardDrive )
+            {
+            return iAvailableDrives[i].iDrive;
+            }
+        }
+    return KErrNotFound;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvDriveMonitor::MassStorageDriveL
+// -----------------------------------------------------------------------------
+//
+TInt CIptvDriveMonitor::MassStorageDriveL()
+    {
+    TInt drive;
+    User::LeaveIfError( drive = MassStorageDrive() );
+    return drive;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvDriveMonitor::MassStorageDrive
+// -----------------------------------------------------------------------------
+//
+TInt CIptvDriveMonitor::MassStorageDrive()
+    {
+    TInt i;
+    for ( i = 0; i < iAvailableDrives.Count(); i++ )
+        {
+        if ( iAvailableDrives[i].iDrive == iDefaultMassStorageDrive )
+            {
+            return iAvailableDrives[i].iDrive;
+            }
+        }
+    return KErrNotFound;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvDriveMonitor::PhoneMemoryDriveL
+// -----------------------------------------------------------------------------
+//
+TInt CIptvDriveMonitor::PhoneMemoryDriveL()
+    {
+    TInt drive;
+    User::LeaveIfError( drive = PhoneMemoryDrive() );
+    return drive;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvDriveMonitor::PhoneMemoryDrive
+// -----------------------------------------------------------------------------
+//
+TInt CIptvDriveMonitor::PhoneMemoryDrive()
+    {
+    TInt i;
+    for ( i = 0; i < iAvailableDrives.Count(); i++ )
+        {
+        if ( iAvailableDrives[i].iDrive == iSystemDrive )
+            {
+            return iAvailableDrives[i].iDrive;
+            }
+        }
+    return KErrNotFound;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvDriveMonitor::FixedDriveL
+// -----------------------------------------------------------------------------
+//
+TInt CIptvDriveMonitor::FixedDriveL( TBool aExcludeCDrive )
+    {
+    TInt drive;
+    User::LeaveIfError( drive = FixedDrive( aExcludeCDrive ) );
+    return drive;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvDriveMonitor::FixedDrive
+// -----------------------------------------------------------------------------
+//
+TInt CIptvDriveMonitor::FixedDrive( TBool aExcludeCDrive )
+    {
+    TInt i;
+    for ( i = 0; i < iAvailableDrives.Count(); i++ )
+        {
+        IPTVLOGSTRING2_LOW_LEVEL("CIptvDriveMonitor:: iAvailableDrives[%d]", i);
+
+        if ( !(iAvailableDrives[i].iFlags & TIptvDriveInfo::ERemovable) )
+            {
+            if ( iAvailableDrives[i].iDrive != EDriveC )
+                {
+                IPTVLOGSTRING2_LOW_LEVEL("CIptvDriveMonitor:: FixedDrive() returning drive %d", iAvailableDrives[i].iDrive);
+                return iAvailableDrives[i].iDrive;
+                }
+            else
+                {
+                if ( !aExcludeCDrive )
+                    {
+                    IPTVLOGSTRING2_LOW_LEVEL("CIptvDriveMonitor:: FixedDrive() returning drive %d", iAvailableDrives[i].iDrive);
+                    return iAvailableDrives[i].iDrive;
+                    }   
+                }
+            }
+        }
+    IPTVLOGSTRING_LOW_LEVEL("CIptvDriveMonitor:: FixedDrive() fixed drive not found");
+    return KErrNotFound;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvDriveMonitor::IsMassStorageDriveL
+// -----------------------------------------------------------------------------
+//
+TBool CIptvDriveMonitor::IsMassStorageDriveL( TInt aDrive )
+    {
+    if ( aDrive == iDefaultMassStorageDrive )
+        {
+        return ETrue;
+        }
+    return EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvDriveMonitor::IsMemoryCardDriveL
+// -----------------------------------------------------------------------------
+//
+TBool CIptvDriveMonitor::IsMemoryCardDriveL( TInt aDrive )
+    {
+    TInt pos = ArrayPosL( aDrive );
+    if ( iAvailableDrives[pos].iFlags & TIptvDriveInfo::ERemovable )
+        {
+        return ETrue;
+        }
+    return EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvDriveMonitor::IsPresentL()
+// -----------------------------------------------------------------------------
+//
+TBool CIptvDriveMonitor::IsPresentL( TInt aDrive )
+    {
+    TInt pos = ArrayPosL( aDrive );
+    TUint32 flags = iAvailableDrives[pos].iFlags;
+    if ( (flags & TIptvDriveInfo::ELocked) || (flags & TIptvDriveInfo::EMediaNotPresent) )
+        {
+        return ETrue;
+        }
+    return EFalse;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CIptvDriveMonitor::SystemDrive()
+// -----------------------------------------------------------------------------
+//
+TInt CIptvDriveMonitor::SystemDrive()
+    {
+    return iSystemDrive;
+    }
+    
+// -----------------------------------------------------------------------------
+// CIptvDriveMonitor::IsMmcInserted()
+// -----------------------------------------------------------------------------
+//
+TBool CIptvDriveMonitor::IsMmcInserted()
+    {   
+    TInt drive = MemoryCardDrive();
+    
+    if ( drive == KErrNotFound )
+        {
+        return EFalse;
+        }
+        
+    TInt arrayPos = ArrayPos( drive );
+    
+    if ( arrayPos == KErrNotFound )
+        {
+        return EFalse;
+        }
+    
+    TUint32 flags = iAvailableDrives[arrayPos].iFlags;
+    
+    if ( (flags & TIptvDriveInfo::ELocked) || (flags & TIptvDriveInfo::EMediaNotPresent) )
+        {
+        return EFalse;
+        } 
+    
+    return ETrue;
+    }
+    
+// -----------------------------------------------------------------------------
+// CIptvDriveMonitor::RunL()
+// -----------------------------------------------------------------------------
+//
+void CIptvDriveMonitor::RunL()
+    {
+    IPTVLOGSTRING_HIGH_LEVEL("CIptvDriveMonitor::RunL() start");
+    
+    if ( iStatus == KErrNone )
+        {        
+        iFs.NotifyChange( ENotifyDisk, iStatus );
+        
+        TRAPD( err, RefreshAvailableDrivesL() );
+        if ( err != KErrNone )
+            {
+            IPTVLOGSTRING2_HIGH_LEVEL("CIptvDriveMonitor:: RefreshAvailableDrivesL leaved with error code %d, ignoring", err);
+            } 
+        CompareOldAndNewAvailableDrives();
+        SetActive();
+        }
+    else
+        {
+        iFs.NotifyChange( ENotifyDisk, iStatus );
+        SetActive();
+        }
+
+    IPTVLOGSTRING_HIGH_LEVEL("CIptvDriveMonitor::RunL() exit");
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvDriveMonitor::DoCancel()
+// -----------------------------------------------------------------------------
+//
+void CIptvDriveMonitor::DoCancel()
+    {
+    iFs.NotifyChangeCancel( iStatus );
+    }       
+
+// -----------------------------------------------------------------------------
+// CIptvDriveMonitor::RunError()
+// -----------------------------------------------------------------------------
+//
+TInt CIptvDriveMonitor::RunError( TInt /* aError */ )
+    {
+    IPTVLOGSTRING_HIGH_LEVEL("CIptvDriveMonitor::RunL() leaved (should never happen).");
+    return KErrNone;
+    }       
+
+// -----------------------------------------------------------------------------
+// CIptvDriveMonitor::SendEvent()
+// -----------------------------------------------------------------------------
+//
+void CIptvDriveMonitor::SendEvent( TIptvDriveMonitorEvent::TEvent aEvent,
+    TInt aDrive )
+    {
+    IPTVLOGSTRING4_HIGH_LEVEL("CIptvDriveMonitor:: Sending event: %S(%d), drive: %d",
+        &TIptvDriveMonitorEvent::EventDes( aEvent ),
+        aEvent,
+        aDrive );
+
+    TIptvDriveMonitorEvent event;
+        
+    for ( TInt i = 0; i < iObservers.Count(); i++ )
+        {
+        event.iEvent = static_cast<TInt>(aEvent);
+        event.iDrive = aDrive;
+        iObservers[i]->HandleDriveMonitorEvent( event );
+        }
+
+#if IPTV_LOGGING_METHOD != 0
+    PrintAvailableDrives();
+#endif
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvDriveMonitor::CompareOldAndNewAvailableDrives
+// -----------------------------------------------------------------------------
+//
+void CIptvDriveMonitor::CompareOldAndNewAvailableDrives()
+    {
+    // Run through old drives list to detect changes
+    TInt i;
+    for ( i = 0; i < iPreviousAvailableDrives.Count(); i++ )
+        {
+        TInt pos = ArrayPos( iPreviousAvailableDrives[i].iDrive );
+        if ( pos == KErrNotFound )
+            {
+            // drive was dismounted
+            SendEvent( TIptvDriveMonitorEvent::EDriveDismounted,
+                iPreviousAvailableDrives[i].iDrive );
+            }
+        else 
+            {
+            // drive still present
+            if ( iPreviousAvailableDrives[i].iFlags != iAvailableDrives[pos].iFlags )
+                {
+                // drive was changed
+                if ( (iPreviousAvailableDrives[i].iFlags & TIptvDriveInfo::EMediaNotPresent) && 
+                     !(iAvailableDrives[pos].iFlags & EMediaNotPresent) )
+                    {
+                    SendEvent( TIptvDriveMonitorEvent::EMediaInserted,
+                        iAvailableDrives[pos].iDrive );
+                    }
+                    
+                if ( !(iPreviousAvailableDrives[i].iFlags & TIptvDriveInfo::EMediaNotPresent) && 
+                     (iAvailableDrives[pos].iFlags & TIptvDriveInfo::EMediaNotPresent) )
+                    {
+                    SendEvent( TIptvDriveMonitorEvent::EMediaRemoved,
+                        iAvailableDrives[pos].iDrive );
+                    }
+
+                if ( !(iPreviousAvailableDrives[i].iFlags & TIptvDriveInfo::ELocked) && 
+                     (iAvailableDrives[pos].iFlags & TIptvDriveInfo::ELocked) )
+                    {
+                    SendEvent( TIptvDriveMonitorEvent::EDriveLocked,
+                        iAvailableDrives[pos].iDrive );
+                    }
+
+                if ( (iPreviousAvailableDrives[i].iFlags & TIptvDriveInfo::ELocked) && 
+                     !(iAvailableDrives[pos].iFlags & TIptvDriveInfo::ELocked) )
+                    {
+                    SendEvent( TIptvDriveMonitorEvent::EDriveUnlocked,
+                        iAvailableDrives[pos].iDrive );
+                    }               
+                }
+            // drive volume name was changed
+            if ( iPreviousAvailableDrives[i].iVolumeName.Compare( 
+                 iAvailableDrives[pos].iVolumeName ) != 0 )
+                {
+                SendEvent( TIptvDriveMonitorEvent::EDriveVolumeNameChanged, 
+                    iAvailableDrives[pos].iDrive ); 
+                }
+            }
+        }
+
+    // Run through new drives list to detect mounted drives
+    for ( i = 0; i < iAvailableDrives.Count(); i++ )
+        {
+        TBool found = EFalse;
+        for ( TInt j = 0; j < iPreviousAvailableDrives.Count(); j++ )
+            {
+            if ( iPreviousAvailableDrives[j].iDrive == iAvailableDrives[i].iDrive )
+                {
+                found = ETrue;
+                break;
+                }
+            }
+        if ( !found )
+            {
+            SendEvent( TIptvDriveMonitorEvent::EDriveMounted,
+                iAvailableDrives[i].iDrive );
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvDriveMonitor::DriveType()
+// -----------------------------------------------------------------------------
+//
+#if IPTV_LOGGING_METHOD != 0 
+const TDesC& CIptvDriveMonitor::DriveTypeDes( TInt aType )
+    {
+    switch (aType)
+        {     
+        case EMediaNotPresent:
+            return KIptvMediaNotPresentDes;
+	      case EMediaUnknown:
+            return KIptvMediaUnknownDes;
+        case EMediaFloppy:
+            return KIptvMediaFloppyDes;
+        case EMediaHardDisk:
+            return KIptvMediaHardDiskDes;
+        case EMediaCdRom:
+            return KIptvMediaCdRomDes;
+        case EMediaRam:
+            return KIptvMediaRamDes;
+        case EMediaFlash:
+            return KIptvMediaFlashDes;
+        case EMediaRom:
+            return KIptvMediaRomDes;
+        case EMediaRemote:
+            return KIptvMediaRemoteDes;
+        case EMediaNANDFlash:
+            return KIptvMediaNANDFlashDes;
+        default:
+            return KIptvMediaUnknownDes;
+        }
+    }
+#else
+const TDesC& CIptvDriveMonitor::DriveTypeDes( TInt /*aType*/ )
+    {
+    return KIptvEmptyDes;
+    }
+#endif
+    
+// -----------------------------------------------------------------------------
+// CIptvDriveMonitor::PrintAvailableDrives()
+// -----------------------------------------------------------------------------
+//
+void CIptvDriveMonitor::PrintAvailableDrives()
+    {
+#if IPTV_LOGGING_METHOD != 0 
+    for ( TInt i = 0; i < iAvailableDrives.Count(); i++ )
+        {
+        IPTVLOGSTRING3_HIGH_LEVEL("CIptvDriveMonitor:: iAvailableDrives[%d].iDrive = %d",
+            i, iAvailableDrives[i].iDrive);
+        IPTVLOGSTRING2_HIGH_LEVEL("    ERemovableDrive  = %d",
+            !!(iAvailableDrives[i].iFlags & TIptvDriveInfo::ERemovable));
+        IPTVLOGSTRING2_HIGH_LEVEL("    EMassStorage     = %d",
+            !!(iAvailableDrives[i].iFlags & TIptvDriveInfo::EMassStorage));
+        IPTVLOGSTRING2_HIGH_LEVEL("    ELockedDrive     = %d",
+            !!(iAvailableDrives[i].iFlags & TIptvDriveInfo::ELocked));
+        IPTVLOGSTRING2_HIGH_LEVEL("    EMediaNotPresent = %d",
+            !!(iAvailableDrives[i].iFlags & TIptvDriveInfo::EMediaNotPresent));
+        }
+#endif
+    }
+    
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/src/CIptvResourceLoader.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,214 @@
+/*
+* 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 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:    Resource file loader for components that cannot use the*
+*/
+
+
+
+
+#include <e32base.h>
+#include <bautils.h>
+#include <coemain.h>
+#include "IptvDebug.h"
+#include "CIptvResourceLoader.h"
+
+_LIT( KIptvEDrive, "E:" );
+_LIT( KIptvFDrive, "F:" );
+_LIT( KIptvZDrive, "Z:" );
+_LIT( KIptvRsc, ".RSC" );
+_LIT( KIptvRxx, ".R" );
+const TInt KIptvLangCodeWidth2( 2 );
+const TInt KIptvLangExtLength( 10 );
+
+// ---------------------------------------------------------
+// CIptvResourceLoader::NewL
+// Two-phased constructor.
+// ---------------------------------------------------------
+//
+CIptvResourceLoader* CIptvResourceLoader::NewL( CCoeEnv& aCoeEnv )
+    {
+    IPTVLOGSTRING_LOW_LEVEL( "CIptvResourceLoader::NewL" );
+
+    CIptvResourceLoader* self = new( ELeave ) CIptvResourceLoader( aCoeEnv );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------
+// CIptvResourceLoader::CIptvResourceLoader
+// C++ default constructor
+// ---------------------------------------------------------
+//
+CIptvResourceLoader::CIptvResourceLoader( CCoeEnv& aCoeEnv )
+  : iCoeEnv( aCoeEnv )
+    {
+    // None
+    }
+
+// ---------------------------------------------------------
+// CIptvResourceLoader::ConstructL
+// Symbian 2nd phase constructor can leave.
+// ---------------------------------------------------------
+//
+void CIptvResourceLoader::ConstructL()
+    {    
+    // None
+    }
+
+// ---------------------------------------------------------
+// CIptvResourceLoader::~CIptvResourceLoader
+// Destructor
+// -----------------------------------------------------------------------------
+//
+CIptvResourceLoader::~CIptvResourceLoader()
+    {        
+    IPTVLOGSTRING_LOW_LEVEL( "CIptvResourceLoader::~CIptvResourceLoader" );
+    
+    if ( iAdded )
+        {
+        iCoeEnv.DeleteResourceFile( iOffset );    
+        }
+    }
+
+// ---------------------------------------------------------
+// CIptvResourceLoader::AddResourceL
+// 
+// ---------------------------------------------------------
+//
+void CIptvResourceLoader::AddResourceL(
+    const TDesC& aResourceFile )
+    {
+    IPTVLOGSTRING_LOW_LEVEL( "CIptvResourceLoader::AddResourceL()" );
+
+    // Language
+    TLanguage language = User::Language();
+    IPTVLOGSTRING2_LOW_LEVEL( "CIptvResourceLoader::AddResourceL(), language: %d", language );
+    TBuf<KIptvLangExtLength> langExt( KNullDesC );
+    if ( language <= ELangOther ) // Langs 0 - 99
+        {
+        langExt.NumFixedWidth( language, EDecimal, KIptvLangCodeWidth2 );
+        }
+    else // Languages 100 - ELangMaximum
+        {
+        langExt.Num( language, EDecimal );
+        }
+
+    // File parser 
+    TParse* fp = new( ELeave ) TParse();
+    CleanupStack::PushL( fp );
+    User::LeaveIfError( fp->Set( aResourceFile, NULL, NULL ) );
+
+    // Search with language code
+    TFileName file( fp->Path() );
+    file.Append( fp->Name() );
+    file.Append( KIptvRxx );
+    file.Append( langExt );
+    TInt error( SearchResourceFile( file ) );
+
+    // If no language file found, change ext to .RSC
+    if ( error )
+        {
+        file.Copy( fp->Path() );
+        file.Append( fp->Name() );
+        file.Append( KIptvRsc );
+        file.ZeroTerminate();
+        error = SearchResourceFile( file );
+        }
+
+    // See result
+    if ( error )
+        {
+        IPTVLOGSTRING_LOW_LEVEL( "CIptvResourceLoader::AddResourceL(), NO RESOURCE FILE ADDED!" );
+        iAdded = EFalse;
+        }                   
+    else
+        {
+        iAdded = ETrue;
+        }
+    
+    CleanupStack::PopAndDestroy( fp );
+    User::LeaveIfError( error );
+    }
+
+// ---------------------------------------------------------
+// CIptvResourceLoader::SearchResourceFile
+// 
+// ---------------------------------------------------------
+//
+TInt CIptvResourceLoader::SearchResourceFile( const TDesC& aFile )
+    {
+    // Try to load resource file without drive letter
+    TInt error( AddResourceFile( aFile ) );
+
+    if ( error )
+        {
+        // Try to load resource file from E-drive
+        TFileName eDrive( KIptvEDrive );
+        eDrive.Append( aFile );
+        error = AddResourceFile( eDrive );
+        }
+
+    if ( error )
+        {
+        // Try to load resource file from F-drive
+        TFileName fDrive( KIptvFDrive);
+        fDrive.Append( aFile );
+        error = AddResourceFile( fDrive );
+        }
+
+    if ( error )
+        {
+        // Try to load resource file from Z-drive
+        TFileName zDrive( KIptvZDrive);
+        zDrive.Append( aFile );
+        error = AddResourceFile( zDrive );
+        }
+
+    // If language variant was not found, next try to find nearest one
+    if ( error )
+        {
+        TFileName tempFile( aFile );
+        BaflUtils::NearestLanguageFile( iCoeEnv.FsSession(), tempFile );
+        // Did BaflUtil change the file
+        if ( tempFile.Compare( aFile ) != 0 )
+            {
+            error = AddResourceFile( tempFile );
+            }
+        }
+    
+    return error;
+    }
+
+// ---------------------------------------------------------
+// CIptvResourceLoader::AddResourceFile
+// 
+// ---------------------------------------------------------
+//
+TInt CIptvResourceLoader::AddResourceFile( const TDesC& aFile )
+    {
+    TInt error( KErrNotFound );
+    if ( BaflUtils::FileExists( iCoeEnv.FsSession(), aFile ) )
+        {
+        TRAP( error, iOffset = iCoeEnv.AddResourceFileL( aFile ) );
+        if ( error == KErrNone )
+            {
+            IPTVLOGSTRING2_LOW_LEVEL( "CIptvResourceLoader::AddResourceFile(), Added: %S", &aFile );    
+            }
+        }    
+
+    return error;
+    }
+            
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/src/TIptvDriveInfo.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,34 @@
+/*
+* 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 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 "TIptvDriveInfo.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+TIptvDriveInfo::TIptvDriveInfo()
+    : iDrive( 0 )
+    , iFlags( 0 )
+    {
+    }
+    
+TIptvDriveInfo::~TIptvDriveInfo()
+    {
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/src/TIptvDriveMonitorEvent.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,88 @@
+/*
+* 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 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 "TIptvDriveMonitorEvent.h"
+#include "IptvDebug.h"
+
+#if IPTV_LOGGING_METHOD != 0 
+_LIT(KIptvDmeMediaRemovedDes, "EMediaRemoved");
+_LIT(KIptvDmeMediaInsertedDes, "EMediaInserted");
+_LIT(KIptvDmeDriveLockedDes, "EDriveLocked");
+_LIT(KIptvDmeDriveUnlockedDes, "EDriveUnlocked");
+_LIT(KIptvDmeDriveMountedDes, "EDriveMounted");
+_LIT(KIptvDmeDriveDismountedDes, "EDriveDismounted");
+_LIT(KIptvDmeDriveVolumeNameChangedDes, "EDriveVolumeNameChanged");
+_LIT(KIptvDmeUnknownDes, "Unknown");
+#endif
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+TIptvDriveMonitorEvent::TIptvDriveMonitorEvent()
+    : iEvent( ENone )
+    , iDrive( -1 )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// TIptvDriveMonitorEvent::EventDes()
+// -----------------------------------------------------------------------------
+//
+#if IPTV_LOGGING_METHOD != 0
+
+const TDesC& TIptvDriveMonitorEvent::EventDes( TIptvDriveMonitorEvent::TEvent aEvent )
+    {
+    switch ( aEvent )
+        {
+        case EMediaRemoved:
+            return KIptvDmeMediaRemovedDes;
+            
+        case EMediaInserted:
+            return KIptvDmeMediaInsertedDes;
+
+        case EDriveLocked:
+            return KIptvDmeDriveLockedDes;
+
+        case EDriveUnlocked:
+            return KIptvDmeDriveUnlockedDes;
+
+        case EDriveMounted:
+            return KIptvDmeDriveMountedDes;
+
+        case EDriveDismounted:
+            return KIptvDmeDriveDismountedDes;
+        
+        case EDriveVolumeNameChanged:
+            return KIptvDmeDriveVolumeNameChangedDes;
+
+        default:
+            return KIptvDmeUnknownDes;
+        }
+    }
+    
+#else
+
+const TDesC& TIptvDriveMonitorEvent::EventDes( TIptvDriveMonitorEvent::TEvent /*aEvent*/ )
+    {
+    return KIptvEmptyDes;
+    }
+
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/src/vcxhgmyvideosaiwmenuhandler.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,257 @@
+/*
+* 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 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:  A class to manage AIW provided menu items*
+*/
+
+
+#include <AiwServiceHandler.h>
+#include <eikmenup.h>
+#include <mediarecognizer.h>
+#include <vcxhgmyvideos.rsg>
+
+#include "vcxhgmyvideosaiwmenuhandler.h"
+#include "vcxhgmyvideos.hrh"
+#include "IptvDebug.h"
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CHgMyVideosAiwMenuHandler::CHgMyVideosAiwMenuHandler()
+// ---------------------------------------------------------------------------
+//
+CHgMyVideosAiwMenuHandler::CHgMyVideosAiwMenuHandler()
+    {
+    IPTVLOGSTRING_LOW_LEVEL(
+            "CHgMyVideosAiwMenuHandler::CHgMyVideosAiwMenuHandler()");
+    }
+
+// ---------------------------------------------------------------------------
+// CHgMyVideosAiwMenuHandler::~CHgMyVideosAiwMenuHandler()
+// ---------------------------------------------------------------------------
+//
+CHgMyVideosAiwMenuHandler::~CHgMyVideosAiwMenuHandler()
+    {
+    IPTVLOGSTRING_LOW_LEVEL(
+            "CHgMyVideosAiwMenuHandler::~CHgMyVideosAiwMenuHandler()");
+
+    delete iMediaRecognizer;
+    delete iAiwServiceHandler;
+    delete iPath;
+    delete iMimeType;
+    }
+
+// ---------------------------------------------------------------------------
+// CHgMyVideosAiwMenuHandler::AttachMenuL()
+// ---------------------------------------------------------------------------
+//
+void CHgMyVideosAiwMenuHandler::AttachMenuL( TInt aMenuPaneId )
+    {
+    IPTVLOGSTRING2_LOW_LEVEL(
+            "CHgMyVideosAiwMenuHandler::AttachMenuL(%d)", aMenuPaneId );
+
+    if ( ! iAiwServiceHandler )
+        {
+        iAiwServiceHandler = CAiwServiceHandler::NewL();
+        }
+
+    iAiwServiceHandler->AttachMenuL(
+            aMenuPaneId, R_VCXHGMYVIDEOS_AIW_ASSIGN_INTEREST );
+    }
+
+// ---------------------------------------------------------------------------
+// CHgMyVideosAiwMenuHandler::DetachMenu()
+// ---------------------------------------------------------------------------
+//
+void CHgMyVideosAiwMenuHandler::DetachMenu( TInt aMenuPaneId )
+    {
+    IPTVLOGSTRING2_LOW_LEVEL(
+            "CHgMyVideosAiwMenuHandler::DetachMenu(%d)", aMenuPaneId );
+
+    iAiwServiceHandler->DetachMenu(
+            aMenuPaneId, R_VCXHGMYVIDEOS_AIW_ASSIGN_INTEREST );
+    }
+
+// ---------------------------------------------------------------------------
+// CHgMyVideosAiwMenuHandler::TryHandleSubmenuL()
+// ---------------------------------------------------------------------------
+//
+TBool CHgMyVideosAiwMenuHandler::TryHandleSubmenuL( CEikMenuPane* aMenuPane )
+    {
+    IPTVLOGSTRING_LOW_LEVEL("CHgMyVideosAiwMenuHandler::HandleSubmenuL()");
+    return iAiwServiceHandler->HandleSubmenuL( *aMenuPane );
+    }
+
+// ---------------------------------------------------------------------------
+// CHgMyVideosAiwMenuHandler::InitializeMenuPaneL()
+// ---------------------------------------------------------------------------
+//
+void CHgMyVideosAiwMenuHandler::InitializeMenuPaneL(
+        TInt aResourceId,
+        CEikMenuPane* aMenuPane,
+        const TDesC& aPath,
+        const TDesC& aMimeType )
+    {
+    IPTVLOGSTRING_LOW_LEVEL("CHgMyVideosAiwMenuHandler::InitializeMenuPaneL()");
+
+    // Let provider add its menu items to the view menu.
+    // If placeholder has been deleted, no AIW option is displayed.
+    // Note! Filehandles are not used, only file paths.
+    CAiwGenericParamList& paramList = iAiwServiceHandler->InParamListL();
+
+    FillAiwParamsL( paramList, aPath, aMimeType );
+
+    iAiwServiceHandler->InitializeMenuPaneL(
+            *aMenuPane,
+            aResourceId,
+            EVcxHgMyVideosCmdAiwBase,
+            paramList );
+    }
+
+// ---------------------------------------------------------------------------
+// CHgMyVideosAiwMenuHandler::IsAiwCommand()
+// ---------------------------------------------------------------------------
+//
+TBool CHgMyVideosAiwMenuHandler::IsAiwCommand( TInt aCommand )
+    {
+    TBool res = EFalse;
+
+    if ( iAiwServiceHandler )
+        {
+        res = iAiwServiceHandler->ServiceCmdByMenuCmd( aCommand ) != KAiwCmdNone;
+        }
+
+    IPTVLOGSTRING2_LOW_LEVEL("CHgMyVideosAiwMenuHandler::IsAiwCommand(%d)", res);
+
+    return res;
+    }
+
+// ---------------------------------------------------------------------------
+// CHgMyVideosAiwMenuHandler::HandleAiwCommandL()
+// ---------------------------------------------------------------------------
+//
+void CHgMyVideosAiwMenuHandler::HandleAiwCommandL(
+        TInt aCommand,
+        const TDesC& aPath,
+        const TDesC& aMimeType )
+    {
+    IPTVLOGSTRING_LOW_LEVEL("CHgMyVideosAiwMenuHandler::HandleAiwCommandL()");
+
+    //
+    //  Save the command parameters so they can be used to cancel
+    //  menu if needed
+    //
+    iCommand = aCommand;
+
+    HBufC* newPath = aPath.AllocL();
+    if ( iPath )
+        {
+        delete iPath;
+        iPath = NULL;
+        }
+    iPath = newPath;
+
+    HBufC* newMimeType = aMimeType.AllocL();
+    if ( iMimeType )
+        {
+        delete iMimeType;
+        iMimeType = NULL;
+        }
+    iMimeType = newMimeType;
+
+    CAiwGenericParamList& paramList = iAiwServiceHandler->InParamListL();
+    FillAiwParamsL( paramList, aPath, aMimeType );
+
+    iMenuActive = ETrue;
+    // Call AIW service handler
+    iAiwServiceHandler->ExecuteMenuCmdL(
+            aCommand,
+            paramList,
+            iAiwServiceHandler->OutParamListL() );
+    iMenuActive = EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+// CHgMyVideosAiwMenuHandler::IsMenuActive()
+// ---------------------------------------------------------------------------
+//
+TBool CHgMyVideosAiwMenuHandler::IsMenuActive()
+    {
+    return iMenuActive;
+    }
+
+// ---------------------------------------------------------------------------
+// CHgMyVideosAiwMenuHandler::FillAiwParamsL()
+// ---------------------------------------------------------------------------
+//
+void CHgMyVideosAiwMenuHandler::FillAiwParamsL(
+        CAiwGenericParamList& aAiwParamsList,
+        const TDesC& aPath,
+        const TDesC& aMimeType )
+    {
+    IPTVLOGSTRING_LOW_LEVEL("CHgMyVideosAiwMenuHandler::FillAiwParamsL()");
+
+    HBufC* path = aPath.AllocLC();
+    TAiwVariant varMime( aMimeType );
+    if ( ! aMimeType.Length() )
+        {
+        if ( ! iMediaRecognizer )
+            {
+            iMediaRecognizer = CMediaRecognizer::NewL();
+            }
+        varMime.Set( iMediaRecognizer->MimeTypeL( *path ) );
+        }
+
+    TAiwGenericParam paramMime( EGenericParamMIMEType, varMime );
+    aAiwParamsList.AppendL( paramMime );
+
+    TAiwVariant varFile( *path );
+    TAiwGenericParam paramFile( EGenericParamFile, varFile );
+    aAiwParamsList.AppendL( paramFile );
+
+    CleanupStack::PopAndDestroy( path );
+    }
+
+//------------------------------------------------------------------------------
+// CHgMyVideosAiwMenuHandler::CloseOpenAiwMenuL()
+//------------------------------------------------------------------------------
+//
+void CHgMyVideosAiwMenuHandler::CloseOpenAiwMenuL()
+    {
+    IPTVLOGSTRING_LOW_LEVEL("CHgMyVideosAiwMenuHandler::CloseOpenAiwMenuL()");
+
+    if ( iMenuActive )
+        {
+        CAiwGenericParamList& paramList = iAiwServiceHandler->InParamListL();
+
+        FillAiwParamsL( paramList, iPath->Des(), iMimeType->Des() );
+
+        //  Call AIW service handler to cancel the menu
+        iAiwServiceHandler->ExecuteMenuCmdL(
+                iCommand,
+                paramList,
+                iAiwServiceHandler->OutParamListL(),
+                KAiwOptCancel );
+
+        // Reset the member variables so command will not be reset
+        iMenuActive = EFalse;
+        iCommand    = 0;
+        delete iPath;
+        iPath = NULL;
+        delete iMimeType;
+        iMimeType = NULL;
+        }
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/src/vcxhgmyvideoscategorylistimpl.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,235 @@
+/*
+* 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 of UI functionality for category list.*
+*/
+
+
+
+
+// INCLUDE FILES
+#include <ganes/HgScroller.h>
+#include <vcxhgmyvideos.rsg>
+#include <myvideosindicator.h>
+#include <ganes/HgDoubleGraphicList.h>
+
+#include "vcxhgmyvideoscategorylistimpl.h"
+#include "vcxhgmyvideoscategorymodelhandler.h"
+#include "vcxhgmyvideosmodel.h"
+#include "vcxhgmyvideosmainview.h"
+#include "vcxhgmyvideoscollectionclient.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCategoryListImpl::NewL()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosCategoryListImpl* CVcxHgMyVideosCategoryListImpl::NewL(
+        CVcxHgMyVideosModel& aModel,
+        CVcxHgMyVideosMainView& aView,
+        CHgScroller& aScroller )
+    {
+    CVcxHgMyVideosCategoryListImpl* self = 
+        CVcxHgMyVideosCategoryListImpl::NewLC( aModel, aView, aScroller );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCategoryListImpl::NewLC()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosCategoryListImpl* CVcxHgMyVideosCategoryListImpl::NewLC(
+        CVcxHgMyVideosModel& aModel,
+        CVcxHgMyVideosMainView& aView,
+        CHgScroller& aScroller )
+    {
+    CVcxHgMyVideosCategoryListImpl* self = 
+        new (ELeave) CVcxHgMyVideosCategoryListImpl( aModel, aView, aScroller );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+    
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCategoryListImpl::CVcxHgMyVideosCategoryListImpl()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosCategoryListImpl::CVcxHgMyVideosCategoryListImpl( 
+        CVcxHgMyVideosModel& aModel,
+        CVcxHgMyVideosMainView& aView,
+        CHgScroller& aScroller )
+    : CVcxHgMyVideosListBase( aModel, aView, aScroller ) 
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCategoryListImpl::ConstructL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosCategoryListImpl::ConstructL()
+    {
+    CVcxHgMyVideosListBase::ConstructL();
+    iCategoryModel = CVcxHgMyVideosCategoryModelHandler::NewL( iModel, *iScroller );
+
+    // Load indicator
+    CGulIcon* ind = iCategoryModel->VideoIndicatorL().VideoOverlayIndicatorL();
+    if ( ind )
+        {
+        CleanupStack::PushL( ind );
+        // Ownership of the icon is transferred
+        static_cast<CHgDoubleGraphicList*>( iScroller )->SetIconOverlayIndicator( ind );
+        CleanupStack::Pop( ind );
+        }
+
+    // Set default icon as empty
+    iScroller->SetDefaultIconL( iCategoryModel->CreateEmptyHgListIconL() );
+
+    iScroller->SetFlags( CHgScroller::EHgScrollerKeyMarkingDisabled );
+    iScroller->SetSelectionObserver( *this );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCategoryListImpl::~CVcxHgMyVideosCategoryListImpl()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosCategoryListImpl::~CVcxHgMyVideosCategoryListImpl()
+    {
+    delete iCategoryModel;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCategoryListImpl::DoListActivateL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosCategoryListImpl::DoListActivateL( TInt aIndex )
+    {  
+    iCategoryModel->DoModelActivateL();
+    CVcxHgMyVideosListBase::DoListActivateL( aIndex );
+    iCategoryModel->GetCategoryListL();
+    iScroller->SetFocus( ETrue );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCategoryListImpl::DoListDeactivate()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosCategoryListImpl::DoListDeactivate()
+    {    
+    CVcxHgMyVideosListBase::DoListDeactivate();
+    iCategoryModel->DoModelDeactivate();
+    iScroller->SetFocus( EFalse );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCategoryListImpl::Highlight() 
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosCategoryListImpl::Highlight()
+    {
+    return iCategoryModel->Highlight();
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCategoryListImpl::HandleSelectL()
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosCategoryListImpl::HandleSelectL( TInt /* aIndex */ )
+    {    
+    iView.DynInitMskL();
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCategoryListImpl::HandleOpenL()
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosCategoryListImpl::HandleOpenL( TInt /*aIndex*/ )
+    {
+    // Reset the visible selection of the list.
+    iScroller->DrawDeferred();
+
+    TInt highlight = Highlight();
+    TInt categoryId = iCategoryModel->ResolveCategoryId( highlight );
+    
+    switch ( categoryId )
+        {
+        case KVcxMvcCategoryIdAll:
+        case KVcxMvcCategoryIdDownloads:
+        case KVcxMvcCategoryIdCaptured:
+        case KVcxMvcCategoryIdOther:
+            {
+            if ( highlight >= 0 && iModel.TouchSupport() )
+                {
+                iView.ActivateVideoListL( iCategoryModel->ResolveCategoryId( highlight ) );
+                }
+            }
+            break;
+            
+        case KCategoryIdLastWatched:
+            {
+            iCategoryModel->PlayLastWatchedVidedoL();
+            }
+            break;
+            
+        case KCategoryIdExtraItem1:
+        case KCategoryIdExtraItem2:
+        case KCategoryIdExtraItem3:
+            {
+            // Handle item according to type (open web link or start app).
+            
+            TVcxHgMyVideosCategoryItemType itemType;
+            TUid appUid;
+            TBuf<KMyVideosTitleUrlMaxLength> urlString( KNullDesC );
+                        
+            iCategoryModel->HandleExtraItemSelectionL( categoryId, itemType, appUid, urlString );
+            
+            // ExtraItem1 is Ovi Store
+            if ( categoryId == KCategoryIdExtraItem1 )
+                {
+                iView.LaunchOviStoreL( appUid, urlString );
+                }
+            else if ( itemType == TVcxHgMyVideosCategoryItemTypeUid )
+                {
+                iView.LaunchAppL( appUid, urlString );
+                }
+            else if ( itemType == TVcxHgMyVideosCategoryItemTypeUrl )
+                {
+                iView.LaunchBrowserL( urlString );
+                }
+            }
+            break;
+            
+        default:
+            ASSERT( 0 );
+            break;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCategoryListImpl::SetEmptyListTextL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosCategoryListImpl::SetEmptyListTextL()
+    {
+    CVcxHgMyVideosListBase::SetEmptyListTextByResourceL( R_VCXHGMYVIDEOS_OPENING_CATEGORIES );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCategoryListImpl::SetTitleTextL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosCategoryListImpl::SetTitleTextL( TInt /*aIndex*/ )
+    {
+    CVcxHgMyVideosListBase::SetTitleTextByResourceL( R_VCXHGMYVIDEOS_MY_VIDEOS_TITLE );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/src/vcxhgmyvideoscategorymodelhandler.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,1340 @@
+/*
+* 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:      UI level handler for category data.*
+*/
+
+
+
+
+// INCLUDE FILES
+#include <StringLoader.h>
+
+#include <mpxmediageneraldefs.h>
+#include <mpxmedia.h>
+#include <mpxmediaarray.h>
+
+#include <ganes/HgScroller.h>
+#include <ganes/HgItem.h>
+#include <ganes/HgDoubleGraphicList.h>
+
+#include <thumbnailmanager.h>
+#include <thumbnailmanagerobserver.h>
+#include <thumbnailobjectsource.h>
+#include <thumbnaildata.h>
+#include <gulicon.h>
+#include <AknsUtils.h>
+#include <AknUtils.h>
+#include <aknlayoutscalable_avkon.cdl.h>
+#include <coemain.h>
+#include <aknappui.h>
+#include <bautils.h>
+#include <apgcli.h>
+
+#include <vcxhgmyvideosicons.mbg>
+#include <myvideosindicator.h>
+#include <vcxhgmyvideos.rsg>
+#include <vcxmyvideosdefs.h>
+#include <vcxmyvideosuids.h>
+#include "IptvDebug.h"
+
+#include "vcxhgmyvideoscategorymodelhandler.h"
+#include "vcxhgmyvideosmodel.h"
+#include "vcxhgmyvideoscollectionclient.h"
+#include "vcxhgmyvideosthumbnailmanager.h"
+#include "vcxhgmyvideoscenrepkeys.h"
+
+_LIT( KVcxHgMyVideosMifFile, "\\resource\\apps\\vcxhgmyvideosicons.mif" );
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCategoryModelHandler::NewL()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosCategoryModelHandler* CVcxHgMyVideosCategoryModelHandler::NewL(
+        CVcxHgMyVideosModel& aModel,
+        CHgScroller& aScroller )
+    {
+    CVcxHgMyVideosCategoryModelHandler* self = 
+        new (ELeave) CVcxHgMyVideosCategoryModelHandler( aModel, aScroller );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCategoryModelHandler::CVcxHgMyVideosCategoryModelHandler()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosCategoryModelHandler::CVcxHgMyVideosCategoryModelHandler(
+        CVcxHgMyVideosModel& aModel, CHgScroller& aScroller )
+    : iModel( aModel ),
+      iScroller( aScroller ),
+      iTnManager( aModel.ThumbnailManager() ),
+      iTnRequestId( KErrNotFound )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCategoryModelHandler::ConstructL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosCategoryModelHandler::ConstructL()
+    {
+    CheckIfExtraItemsExistsL();
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCategoryModelHandler::CheckIfExtraItemsExistsL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosCategoryModelHandler::CheckIfExtraItemsExistsL()
+    {
+    TInt value = 0;
+    TBuf<KMyVideosTitleUrlMaxLength> 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()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosCategoryModelHandler::~CVcxHgMyVideosCategoryModelHandler()
+    {
+    delete iCategoryList;
+    delete iVideoIndicator;
+    
+    iCategoryIdArray.Reset();
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCategoryModelHandler::DoModelActivateL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosCategoryModelHandler::DoModelActivateL()
+    {
+    IPTVLOGSTRING_LOW_LEVEL( 
+        "MPX My Videos UI # CVcxHgMyVideosCategoryModelHandler::DoModelActivateL() - Enter" );
+
+	UpdateCategoryListL();
+	
+    iModel.CollectionClient().SetCategoryModelObserver( this );
+
+    iTnManager.AddObserverL( *this );
+    
+    IPTVLOGSTRING_LOW_LEVEL( 
+        "MPX My Videos UI # CVcxHgMyVideosCategoryModelHandler::DoModelActivateL() - Exit" );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCategoryModelHandler::DoModelDeactivate()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosCategoryModelHandler::DoModelDeactivate()
+    {
+    IPTVLOGSTRING_LOW_LEVEL( 
+        "MPX My Videos UI # CVcxHgMyVideosCategoryModelHandler::DoModelDeactivate() - Enter" );
+
+    iModel.CollectionClient().SetCategoryModelObserver( NULL );
+
+    iTnManager.RemoveObserver( *this );
+	
+    TRAP_IGNORE( ClearLastWatchedIconL() )
+    
+    IPTVLOGSTRING_LOW_LEVEL( 
+        "MPX My Videos UI # CVcxHgMyVideosCategoryModelHandler::DoModelDeactivate() - Exit" );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCategoryModelHandler::GetCategoryListL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosCategoryModelHandler::GetCategoryListL()
+    {
+    IPTVLOGSTRING_LOW_LEVEL( 
+        "MPX My Videos UI # CVcxHgMyVideosCategoryModelHandler::GetCategoryListL() - Enter" );
+    
+    iModel.CollectionClient().GetCategoryListL();
+    
+    IPTVLOGSTRING_LOW_LEVEL( 
+        "MPX My Videos UI # CVcxHgMyVideosCategoryModelHandler::GetCategoryListL() - Exit" );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCategoryModelHandler::Highlight()
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosCategoryModelHandler::Highlight()
+    {
+    return iScroller.SelectedIndex();
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCategoryModelHandler::GetCategoryNameLC()
+// -----------------------------------------------------------------------------
+// 
+HBufC* CVcxHgMyVideosCategoryModelHandler::GetCategoryNameLC( TInt aCategoryId )
+    {
+    HBufC* name = NULL;
+
+    switch ( aCategoryId )
+        {
+        case KVcxMvcCategoryIdAll:
+            name = StringLoader::LoadLC( R_VCXHGMYVIDEOS_STORAGE_ALL_LIST );
+            break;
+        case KVcxMvcCategoryIdDownloads:
+            name = StringLoader::LoadLC( R_VCXHGMYVIDEOS_STORAGE_DOWNLOADS_LIST );
+            break;        
+        case KVcxMvcCategoryIdCaptured:
+            name = StringLoader::LoadLC( R_VCXHGMYVIDEOS_STORAGE_CAPTURED_LIST );
+            break;            
+        case KVcxMvcCategoryIdOther:
+            name = StringLoader::LoadLC( R_VCXHGMYVIDEOS_STORAGE_OTHER_LIST );
+            break;            
+        case KCategoryIdLastWatched:
+            if ( LastWatchedSetL() )
+                {
+                name = StringLoader::LoadLC( R_VCXHGMYVIDEOS_LAST_WATCHED );
+                }
+            else 
+                {
+                if ( PreloadedExistsL() )
+                    {
+                    TBuf<KMyVideosTitleStringMaxLength> string;
+                    TInt error = iModel.GetMyVideosCustomizationString( 
+					                 KCRVideoPlayerPreloadedVideoName, string );
+                    name = error ? KNullDesC().AllocLC() : string.AllocLC();                
+                    }
+                else
+                    {
+                    name = StringLoader::LoadLC( R_VCXHGMYVIDEOS_LAST_WATCHED );
+                    }
+                }
+            break;            
+        case KCategoryIdExtraItem1:
+            // ExtraItem1 is always interpreted as Ovi Store
+            name = StringLoader::LoadLC( R_VCXHGMYVIDEOS_OVI_STORE ); 
+			break;
+        case KCategoryIdExtraItem2:
+        case KCategoryIdExtraItem3:
+            {
+            TInt key = 0;
+            if ( aCategoryId == KCategoryIdExtraItem2 )
+                {
+                key = KCRVideoPlayerExtraItem2Title;
+                }
+            else if ( aCategoryId == KCategoryIdExtraItem3 )
+                {
+                key = KCRVideoPlayerExtraItem3Title;
+                }
+
+            TBuf<KMyVideosTitleStringMaxLength> titleString;
+            TInt error = iModel.GetMyVideosCustomizationString( key, titleString );
+            if ( error == KErrNone )
+                {
+                name = titleString.AllocLC();
+                }
+            else 
+                {
+                name = KNullDesC().AllocLC();
+                }
+            }
+            break;
+            
+        default:
+            {
+            name = KNullDesC().AllocLC();
+            IPTVLOGSTRING_LOW_LEVEL( 
+                "MPX My Videos UI # GetCategoryNameLC() Unexpected category!" );
+            }
+            break;
+        }
+    return name;    
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCategoryModelHandler::GetCategoryIconL()
+// -----------------------------------------------------------------------------
+// 
+CGulIcon* CVcxHgMyVideosCategoryModelHandler::GetCategoryIconL( TInt aCategoryId )
+    {
+    IPTVLOGSTRING2_LOW_LEVEL( "CVcxHgMyVideosCategoryModelHandler::GetCategoryIconL() Enter! Category id = %d", aCategoryId );
+
+    CGulIcon* icon( NULL );
+    TAknsItemID skinId = KAknsIIDNone;
+    TInt bitmapId( 0 );
+    TInt maskId( 0 );
+    TInt key( KErrNotFound );
+    TFileName iconFile( KNullDesC() );
+    
+    // Find icon file & bitmap IDs or cenrep keys
+    switch ( aCategoryId )
+        {
+        case KVcxMvcCategoryIdDownloads:    // fall through
+        case KVcxMvcCategoryIdAll:          // fall through
+        case KVcxMvcCategoryIdOther:
+            skinId.Set( KAknsIIDQgnPropDownloadThumbnailVideo );
+            iconFile = KVcxHgMyVideosMifFile;
+            bitmapId = EMbmVcxhgmyvideosiconsQgn_prop_download_thumbnail_video;
+            maskId = EMbmVcxhgmyvideosiconsQgn_prop_download_thumbnail_video_mask;
+            break;
+        case KVcxMvcCategoryIdCaptured:
+            skinId.Set( KAknsIIDQgnPropCapturedThumbnailVideo );
+            iconFile = KVcxHgMyVideosMifFile;
+            bitmapId = EMbmVcxhgmyvideosiconsQgn_prop_captured_thumbnail_video;
+            maskId = EMbmVcxhgmyvideosiconsQgn_prop_captured_thumbnail_video_mask;
+            break;
+        case KCategoryIdLastWatched:
+			 LoadLastWatchedIconL();
+			 if ( iTnRequestId == KErrNotFound )
+			     {
+                 // Last watched or preloaded not found => show default icon
+                 skinId.Set( KAknsIIDQgnPropRecentThumbnailVideo );
+                 iconFile = KVcxHgMyVideosMifFile;
+                 bitmapId = EMbmVcxhgmyvideosiconsQgn_prop_recent_thumbnail_video;
+                 maskId = EMbmVcxhgmyvideosiconsQgn_prop_recent_thumbnail_video_mask;
+			     }
+            break;
+        case KCategoryIdExtraItem1:
+            // ExtraItem1 is always interpreted as Ovi Store
+            skinId.Set( KAknsIIDQgnPropOviThumbnailVideo );
+            iconFile = KVcxHgMyVideosMifFile;
+            bitmapId = EMbmVcxhgmyvideosiconsQgn_prop_ovi_thumbnail_video;
+            maskId = EMbmVcxhgmyvideosiconsQgn_prop_ovi_thumbnail_video_mask;
+            break;
+        case KCategoryIdExtraItem2:
+            key = KCRVideoPlayerExtraItem2IconPath;
+            break;
+        case KCategoryIdExtraItem3:
+            key = KCRVideoPlayerExtraItem3IconPath;
+            break;
+        default:
+            {
+            IPTVLOGSTRING_LOW_LEVEL( 
+                "MPX My Videos UI # GetCategoryIconLC() Unexpected category!" );
+            }
+            break;
+        }
+
+    if ( key != KErrNotFound ) 
+        {
+        // Extra item 2 or 3, get icon file from cenrep
+        TInt error = iModel.GetMyVideosCustomizationString( key, iconFile );
+        if ( error == KErrNone && iconFile.Length() > 0 )
+            {
+            IPTVLOGSTRING3_LOW_LEVEL( "CVcxHgMyVideosCategoryModelHandler::GetCategoryIconL() cenrep key %d iconFile %S", key, &iconFile );
+            bitmapId = 0x4000;
+            maskId = 0x4001;
+            }
+        else
+            { // Use default service icon
+            skinId.Set( KAknsIIDQgnPropServiceThumbnailVideo );
+            iconFile = KVcxHgMyVideosMifFile;
+            bitmapId = EMbmVcxhgmyvideosiconsQgn_prop_service_thumbnail_video;
+            maskId = EMbmVcxhgmyvideosiconsQgn_prop_service_thumbnail_video_mask;
+            }
+        }
+
+    if ( bitmapId && iconFile.Length() > 0 )
+        {
+        // find mif file
+        TFindFile findFile( iModel.FileServerSessionL() );
+        TInt error = findFile.FindByDir( iconFile, KNullDesC );
+
+        // Create icon if icon file was found
+        if ( KErrNone == error )
+            {
+            TParse parse;
+            parse.Set( findFile.File(), NULL, NULL );
+            iconFile = parse.FullName();
+            IPTVLOGSTRING3_LOW_LEVEL( "CVcxHgMyVideosCategoryModelHandler::GetCategoryIconLC() get %d from file %S", bitmapId, &iconFile );
+
+            icon = CreateHgListIconL( skinId, iconFile, bitmapId, maskId );
+            }
+        else
+            {
+            IPTVLOGSTRING2_LOW_LEVEL( "CVcxHgMyVideosCategoryModelHandler::GetCategoryIconL() FindByDir() returned %d", error );
+            }
+        }
+    else
+        {
+        IPTVLOGSTRING_LOW_LEVEL( "CVcxHgMyVideosCategoryModelHandler::GetCategoryIconLC() no icon file or id" );
+        }
+
+    return icon;    
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCategoryModelHandler::FormatCategorySecondRowLC()
+// -----------------------------------------------------------------------------
+// 
+HBufC* CVcxHgMyVideosCategoryModelHandler::FormatCategorySecondRowLC( CMPXMedia& aMedia )
+    {    
+    HBufC* details = NULL;
+    TInt newVideos = 0;
+    TInt videos = 0;
+
+    if ( aMedia.IsSupported( KVcxMediaMyVideosCategoryNewItemCount ) )
+        {
+        newVideos = *( aMedia.Value<TInt>( KVcxMediaMyVideosCategoryNewItemCount ) );
+        }
+    if ( aMedia.IsSupported( KVcxMediaMyVideosCategoryItemCount ) )
+        {
+        videos = *( aMedia.Value<TInt>( KVcxMediaMyVideosCategoryItemCount ) );
+        }
+
+    if ( newVideos > 0 )
+        {
+        if ( newVideos == 1 )
+            {
+            details = StringLoader::LoadL( R_VCXHGMYVIDEOS_ONE_NEW_VIDEO );
+            }
+        else
+            {
+            details = StringLoader::LoadL( R_VCXHGMYVIDEOS_N_NEW_VIDEOS, newVideos );
+            }
+        CleanupStack::PushL( details );
+        }
+    else
+        {
+        if ( videos == 0 )
+            {
+            details = StringLoader::LoadLC( R_VCXHGMYVIDEOS_NO_VIDEOS_IN_CATEGORY );
+            }
+        else if ( videos == 1 )
+            {
+            details = StringLoader::LoadLC( R_VCXHGMYVIDEOS_ONE_VIDEO_IN_CATEGORY );            
+            }
+        else
+            {
+            details = StringLoader::LoadLC( R_VCXHGMYVIDEOS_VIDEOS_IN_CATEGORY, videos );
+            }        
+        }
+
+    return details;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCategoryModelHandler::FormatCategorySecondRowLC()
+// -----------------------------------------------------------------------------
+// 
+HBufC* CVcxHgMyVideosCategoryModelHandler::FormatCategorySecondRowLC( TInt aCategoryId )
+    {
+    HBufC* secondRow = NULL;
+   
+    switch ( aCategoryId )
+        {
+        case KVcxMvcCategoryIdAll:
+        case KVcxMvcCategoryIdDownloads:
+        case KVcxMvcCategoryIdTvRecordings:
+        case KVcxMvcCategoryIdCaptured:
+        case KVcxMvcCategoryIdOther:
+            {
+            CMPXMedia* media = GetCategoryDataL( aCategoryId );
+            if ( media )
+                {
+                secondRow = FormatCategorySecondRowLC( *media );
+                }
+			else
+			    {
+				secondRow = KNullDesC().AllocLC();
+				}
+            }
+            break;
+        case KCategoryIdLastWatched:
+            {
+            if ( LastWatchedSetL() )
+                {
+                TBuf<KMaxPath> path;
+                TInt error = iModel.GetLastWatchedPathL( path );
+                if ( BaflUtils::FileExists( iModel.FileServerSessionL(), path ) )
+                    {
+                    TBuf<KMyVideosTitleStringMaxLength> string;
+                    TInt error = iModel.GetLastWatchedNameL( string );
+                    secondRow = error ? KNullDesC().AllocLC() : string.AllocLC();
+                    }
+                else
+                    {
+                    secondRow = StringLoader::LoadLC( R_VCXHGMYVIDEOS_NO_VIDEOS_IN_CATEGORY );
+                    }
+                }
+            else    
+                {
+                if ( PreloadedExistsL() )
+                    {
+                    TBuf<KMyVideosTitleStringMaxLength> string;
+                    TInt error = iModel.GetMyVideosCustomizationString( 
+					                        KCRVideoPlayerPreloadedVideoDescription, string );
+                    secondRow = error ? KNullDesC().AllocLC() : string.AllocLC();
+                    }
+                else
+                    {
+                    secondRow = StringLoader::LoadLC( R_VCXHGMYVIDEOS_NO_VIDEOS_IN_CATEGORY );
+                    }
+                }
+            }
+            break;
+
+        case KCategoryIdExtraItem1:
+            // ExtraItem1 is always interpreted as Ovi Store
+            secondRow = StringLoader::LoadLC( R_VCXHGMYVIDEOS_OVI_STORE_VIDEOS ); 
+            break;
+            
+        case KCategoryIdExtraItem2:
+        case KCategoryIdExtraItem3:
+            {
+            TInt key = 0;
+            if ( aCategoryId == KCategoryIdExtraItem2 )
+                {
+                key = KCRVideoPlayerExtraItem2Text;
+                }
+            else if ( aCategoryId == KCategoryIdExtraItem3 )
+                {
+                key = KCRVideoPlayerExtraItem3Text;
+                }
+            
+            TBuf<KMyVideosTitleStringMaxLength> detailsString;
+            TInt error = iModel.GetMyVideosCustomizationString( key, detailsString );
+            if ( error == KErrNone )
+                {
+                secondRow = detailsString.AllocLC();
+                }
+            else 
+                {
+                secondRow = KNullDesC().AllocLC();
+                }
+            break;
+            }
+        default:
+            {
+            secondRow = KNullDesC().AllocLC();
+            IPTVLOGSTRING_LOW_LEVEL( 
+                "MPX My Videos UI # FormatCategorySecondRowLC() Unexpected category!" );
+            break;
+            }
+        }
+    return secondRow;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCategoryModelHandler::UiIndexFromMpxItemId()
+// -----------------------------------------------------------------------------
+// 
+TInt CVcxHgMyVideosCategoryModelHandler::UiIndexFromMpxItemId( TMPXItemId& aMpxItemId )
+    {
+    IPTVLOGSTRING_LOW_LEVEL( "MPX My Videos UI # UiIndexFromMpxItemId() - Enter" );
+    
+    TInt index ( KErrNotFound );
+    
+    if ( iCategoryList )
+        {
+        CMPXMedia* media = NULL;
+        TMPXItemId mpxItemId;
+
+        for ( TInt i = 0; i < iCategoryList->Count(); i++ )
+            {
+            media = (*iCategoryList)[i];
+
+            if ( media && media->IsSupported( KMPXMediaGeneralId ) )
+                {
+                mpxItemId = *media->Value<TMPXItemId>( KMPXMediaGeneralId );
+            
+                if ( mpxItemId == aMpxItemId )
+                    {
+                    index = ResolveCategoryArrayIndexById( i );
+                    break;
+                    }
+                }
+            }
+        }
+    
+    IPTVLOGSTRING2_LOW_LEVEL( "MPX My Videos UI # UiIndexFromMpxItemId(), index = %d - Exit", index );
+    return index;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCategoryModelHandler::ResolveCategoryArrayIndexById()
+// -----------------------------------------------------------------------------
+// 
+TInt CVcxHgMyVideosCategoryModelHandler::ResolveCategoryArrayIndexById( TInt aCategoryId )
+    {
+    TInt ret( KErrNotFound );
+    
+    for(TInt i = 0; i < iCategoryIdArray.Count(); i++ )
+        {
+        if( iCategoryIdArray[ i ] == aCategoryId )
+            {
+            ret = i;
+            break;
+            }
+        }  
+    
+    return ret;
+    }
+    
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCategoryModelHandler::NewCategoryListL()
+// MPX Collection calls this callback when new category list is available.
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosCategoryModelHandler::NewCategoryListL( 
+        CMPXMediaArray* aCategoryList, TBool aIsPartial )
+    {
+    IPTVLOGSTRING2_LOW_LEVEL( "MPX My Videos UI # NewCategoryListL() - Enter. IsPartial=%d", aIsPartial );
+
+    delete iCategoryList;
+    iCategoryList = aCategoryList;
+    
+    UpdateCategoryListL();
+	
+    if ( !aIsPartial )
+        {
+        // KVcxMessageMyVideosListComplete does not come, finish list fetching now
+        CategoryListFetchingCompletedL();
+        }
+    
+    IPTVLOGSTRING_LOW_LEVEL( "MPX My Videos UI # NewCategoryListL() - Exit" );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCategoryModelHandler::CategoryListModifiedL()
+// MPX Collection calls this callback when the category list is modified.
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosCategoryModelHandler::CategoryListModifiedL()
+    { 
+    IPTVLOGSTRING_LOW_LEVEL( "MPX My Videos UI # CategoryListModifiedL() - Enter" );
+    
+    UpdateCategoryListL();
+    
+    IPTVLOGSTRING_LOW_LEVEL( "MPX My Videos UI # CategoryListModifiedL() - Exit" );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCategoryModelHandler::CategoryModifiedL()
+// MPX Collection calls this callback when single category is modified.
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosCategoryModelHandler::CategoryModifiedL( TMPXChangeEventType aEventType, 
+                                                            TMPXItemId& aMpxItemId )
+    {
+    IPTVLOGSTRING2_LOW_LEVEL( 
+        "MPX My Videos UI # CategoryModifiedL(event=%d)", aEventType );
+
+    switch ( aEventType )
+        {
+        case EMPXItemModified:
+            {
+            TInt uiIndex = UiIndexFromMpxItemId( aMpxItemId );
+            UpdateCategoryListItemL( uiIndex );
+            iScroller.RefreshScreen( uiIndex );
+            }
+            break;
+            
+        case EMPXItemInserted:
+            {
+            TInt id1( 0 );
+            TInt ret = iModel.GetLastWatchedIdL( id1 );
+
+            if (  ret == KErrNone &&
+                  id1 == aMpxItemId.iId1 )
+                {
+                ClearLastWatchedIconL();
+                UpdateCategoryListItemL( ResolveCategoryArrayIndexById( KCategoryIdLastWatched ) );
+				iScroller.RefreshScreen( ResolveCategoryArrayIndexById( KCategoryIdLastWatched ) );
+				}
+            }
+            break;
+        case EMPXItemDeleted:
+            {
+            TInt id1( 0 );
+            TInt ret = iModel.GetLastWatchedIdL( id1 );
+
+            if (  ret == KErrNone &&
+                  id1 == aMpxItemId.iId1 )
+                {
+                ClearLastWatchedIconL();
+                UpdateCategoryListItemL( ResolveCategoryArrayIndexById( KCategoryIdLastWatched ) );
+				iScroller.RefreshScreen( ResolveCategoryArrayIndexById( KCategoryIdLastWatched ) );
+                }
+            }
+            break;
+        default:
+            {
+            IPTVLOGSTRING_LOW_LEVEL( 
+                "MPX My Videos UI # CategoryModifiedL() Unexpected event!" );
+            }
+            break;
+        } 
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCategoryModelHandler::UpdateCategoryListL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosCategoryModelHandler::UpdateCategoryListL()
+    {
+    IPTVLOGSTRING_LOW_LEVEL( "MPX My Videos UI # UpdateCategoryListL() - Enter" );
+    
+    MakeCategoryIdArrayL();
+    
+    if ( iCategoryIdArray.Count() != iScroller.ItemCount() )
+        {
+        iScroller.ResizeL( iCategoryIdArray.Count() );
+        }
+        
+    if ( iCategoryIdArray.Count() > 0 )
+        {                    
+        for ( TInt i = 0; i < iCategoryIdArray.Count(); i++ )
+            {
+            UpdateCategoryListItemL( i );
+            }
+        if ( iScroller.SelectedIndex() < 0 || 
+                iScroller.SelectedIndex() >= iScroller.ItemCount() )
+            {
+            iScroller.SetSelectedIndex( 0 );    
+            }           
+        }        
+    
+    // Refresh the whole list.
+    iScroller.DrawDeferred();
+
+    IPTVLOGSTRING_LOW_LEVEL( "MPX My Videos UI # UpdateCategoryListL() - Exit" );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCategoryModelHandler::UpdateCategoryListItemL()
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosCategoryModelHandler::UpdateCategoryListItemL( TInt aListIndex )
+    {
+    IPTVLOGSTRING2_LOW_LEVEL( 
+            "MPX My Videos UI # UpdateCategoryListItemL (index=%d)", aListIndex );
+    
+    if( aListIndex >= 0 && 
+        aListIndex < iScroller.ItemCount() &&
+        aListIndex < iCategoryIdArray.Count() )
+        {
+        CHgItem& listItem = iScroller.ItemL( aListIndex );
+        
+        HBufC* categoryName( NULL );     
+        categoryName = GetCategoryNameLC( iCategoryIdArray[ aListIndex ] );
+        listItem.SetTitleL( *categoryName );
+        CleanupStack::PopAndDestroy( categoryName );
+
+        HBufC* secondRow( NULL );
+        secondRow = FormatCategorySecondRowLC( iCategoryIdArray[ aListIndex ] );
+        listItem.SetTextL( *secondRow );
+        CleanupStack::PopAndDestroy( secondRow );
+
+        // Set icon for category
+        if ( !listItem.Icon() )
+            {
+            listItem.SetIcon( GetCategoryIconL( iCategoryIdArray[ aListIndex ] ) );
+            }
+        }
+        
+    IPTVLOGSTRING_LOW_LEVEL( 
+        "MPX My Videos UI # UpdateCategoryListItemL() - Exit" );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCategoryModelHandler::RemoveCategoryListItem()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosCategoryModelHandler::RemoveCategoryListItem( TInt aListIndex )
+    {
+    if ( aListIndex >= 0 && aListIndex < iScroller.ItemCount() )
+        {
+        iScroller.RemoveItem( aListIndex );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCategoryModelHandler::ResolveCategoryId()
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosCategoryModelHandler::ResolveCategoryId( TInt aScrollerIndex )
+    {
+    TInt ret( -1 );
+    if ( aScrollerIndex >= 0 &&
+         aScrollerIndex <= iCategoryIdArray.Count() )
+        {
+        ret = iCategoryIdArray[ aScrollerIndex ];
+        }  
+    return ret;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCategoryModelHandler::MakeCategoryIdArrayL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosCategoryModelHandler::MakeCategoryIdArrayL()
+    {
+    IPTVLOGSTRING_LOW_LEVEL("CVcxHgMyVideosCategoryModelHandler::MakeCategoryIdArrayL");
+    
+    iCategoryIdArray.Reset();    
+    
+    TInt error = KErrNone;
+    TInt value = KErrNotFound;
+    TInt categoryId = KErrNotFound;
+    
+    // Check that cenrep exists and has some valid data
+    error = iModel.GetMyVideosCustomizationInt( KCRVideoPlayerItemLocation1, value );
+    
+    if ( error == KErrNone && value > EMyVideosListItemTypeEmpty )
+        {
+        IPTVLOGSTRING_LOW_LEVEL( "MPX My Videos UI # MakeCategoryIdArrayL() Getting category items from cenrep" ); 
+
+        for ( TInt i=KCRVideoPlayerItemLocation1; i<=KCRVideoPlayerItemLocation7; i++ )    
+            {
+            error = iModel.GetMyVideosCustomizationInt( i , value );
+            if ( error == KErrNone )
+                {
+                switch ( value )
+                    {
+                    case EMyVideosListItemTypeLastWatched:
+                        categoryId = KCategoryIdLastWatched;
+                        break;        
+                    case EMyVideosListItemTypeCapturedVideos:
+                        categoryId = KVcxMvcCategoryIdCaptured;
+                        break;
+                    case EMyVideosListItemTypeOtherVideos:
+                        categoryId = KVcxMvcCategoryIdOther;
+                        break;                        
+                    case EMyVideosListItemTypeExtra1:
+                        categoryId = KCategoryIdExtraItem1;
+                        break;                        
+                    case EMyVideosListItemTypeExtra2:
+                        categoryId = KCategoryIdExtraItem2;
+                        break;                        
+                    case EMyVideosListItemTypeExtra3:
+                        categoryId = KCategoryIdExtraItem3;
+                        break;
+                    case EMyVideosListItemTypeEmpty:
+                        categoryId = KErrNotFound;
+                        break;
+                    default:
+                        categoryId = KErrNotFound;
+                        break;
+                    }
+                
+                if ( AcceptCategory( categoryId ) )
+                    {
+                    iCategoryIdArray.AppendL( categoryId );
+                    }
+                }
+            }
+        }
+    else
+        {
+		iCategoryIdArray.AppendL( KCategoryIdLastWatched );
+		iCategoryIdArray.AppendL( KVcxMvcCategoryIdCaptured );	    
+        iCategoryIdArray.AppendL( KVcxMvcCategoryIdOther );  
+        iCategoryIdArray.AppendL( KCategoryIdExtraItem1 );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCategoryModelHandler::AcceptCategory()
+// -----------------------------------------------------------------------------
+//
+TBool CVcxHgMyVideosCategoryModelHandler::AcceptCategory( TInt aCategoryId )
+    {
+    TBool ret(EFalse);
+    switch ( aCategoryId )
+        {
+        case KVcxMvcCategoryIdAll:
+        case KVcxMvcCategoryIdCaptured:
+        case KVcxMvcCategoryIdOther:
+        case KCategoryIdLastWatched:
+        case KCategoryIdExtraItem1:
+            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 );
+            break;            
+        }
+    
+    return ret;
+    }
+
+// -----------------------------------------------------------------------------
+// MPX Collection calls this callback when category list items have been fetched.
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosCategoryModelHandler::CategoryListFetchingCompletedL()
+    {
+    IPTVLOGSTRING_LOW_LEVEL( "MPX My Videos UI # CategoryListFetchingCompletedL()" ); 
+
+    // Send custom command to appui that signals that the 
+    // my videos main view is constructed.
+    CAknAppUi* appui = static_cast<CAknAppUi*>( CCoeEnv::Static()->AppUi() );
+    
+    if ( appui )
+        {
+        appui->HandleCommandL( KVcxMyVideosCmdDoLateConstruct );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::GetCategoryDataL()
+// 
+// -----------------------------------------------------------------------------
+// 
+CMPXMedia* CVcxHgMyVideosCategoryModelHandler::GetCategoryDataL( TInt aCategoryId )
+    {
+    if ( iCategoryList && aCategoryId >= 0 && iCategoryList->Count() > aCategoryId )
+        {
+        return (*iCategoryList)[ aCategoryId ];
+        }
+    
+    return NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::PlayLastWatchedVidedoL()
+// 
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosCategoryModelHandler::PlayLastWatchedVidedoL()
+    {
+    TBuf<KMaxPath> path;
+    TInt error( KErrNotFound );
+	if ( LastWatchedSetL() )
+        {
+        error = iModel.GetLastWatchedPathL( path );
+        }
+    else if ( PreloadedExistsL() )
+        {
+        error = iModel.GetMyVideosCustomizationString( 
+                     KCRVideoPlayerPreloadedVideoPath, path );
+        }
+
+    if ( !error && path.Length() && BaflUtils::FileExists( iModel.FileServerSessionL(), path ) )
+        {
+        CAknAppUi* appui = static_cast<CAknAppUi*>( CCoeEnv::Static()->AppUi() );
+    
+        if ( appui )
+            {
+            appui->OpenFileL( path );
+            iModel.SetAppState( CVcxHgMyVideosModel::EVcxMyVideosAppStatePlayer );
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::LoadLastWatchedIconL()
+// 
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosCategoryModelHandler::LoadLastWatchedIconL()
+    {
+    if ( LastWatchedSetL() )
+        {    
+        TBuf<KMaxPath> path;
+        TInt error = iModel.GetLastWatchedPathL( path );
+        
+        if ( BaflUtils::FileExists( iModel.FileServerSessionL(), path ) )
+            {
+            CThumbnailObjectSource* source = CThumbnailObjectSource::NewLC( 
+                        path, 
+                        KNullDesC );
+            iTnRequestId = iTnManager.GetL( *source );
+            CleanupStack::PopAndDestroy( source );
+            }
+        }
+    else 
+        {
+        if ( PreloadedExistsL() )
+            {
+            TBuf<KMaxPath> path;
+            TInt error = iModel.GetMyVideosCustomizationString( 
+			                        KCRVideoPlayerPreloadedVideoPath, path );
+            CThumbnailObjectSource* source = CThumbnailObjectSource::NewLC( 
+                            path,
+                            KNullDesC );
+            
+            iTnRequestId = iTnManager.GetL( *source );
+            CleanupStack::PopAndDestroy( source );
+            }
+        }
+	}
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::ClearLastWatchedIconL()
+// 
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosCategoryModelHandler::ClearLastWatchedIconL()
+    {        
+    CHgItem& item = iScroller.ItemL( ResolveCategoryArrayIndexById( KCategoryIdLastWatched ) );
+    item.ClearFlags( CHgItem::EHgItemFlagsIconOverlayIndicator );
+    item.SetIcon( NULL );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::SetLastWatchedIndicatorL()
+// 
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosCategoryModelHandler::SetLastWatchedIndicatorL()
+    {
+    if ( KErrNotFound != ResolveCategoryArrayIndexById( KCategoryIdLastWatched ) ) 
+        {
+        CHgItem& lastWatchedItem = iScroller.ItemL(
+                ResolveCategoryArrayIndexById( KCategoryIdLastWatched ) );
+        TInt isIndicator( 0 );
+        iModel.GetLastWatchedIndicatorL( isIndicator );
+		
+        TBuf<KMaxPath> path;
+        TInt error = iModel.GetLastWatchedPathL( path );
+		TBool exist = BaflUtils::FileExists( iModel.FileServerSessionL(), path );
+        if ( isIndicator && path.Length() && exist )
+            {
+            lastWatchedItem.SetFlags( CHgItem::EHgItemFlagsIconOverlayIndicator );
+            }
+        else
+            {
+            lastWatchedItem.ClearFlags( CHgItem::EHgItemFlagsIconOverlayIndicator );
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::VideoIndicatorL()
+// 
+// -----------------------------------------------------------------------------
+// 
+CMyVideosIndicator& CVcxHgMyVideosCategoryModelHandler::VideoIndicatorL()
+    {
+    if ( !iVideoIndicator )
+        {
+        iVideoIndicator = CMyVideosIndicator::NewL();
+        }
+    return *iVideoIndicator;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::ThumbnailPreviewReady()
+// 
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosCategoryModelHandler::ThumbnailPreviewReady( 
+                MThumbnailData& /*aThumbnail*/,
+                TThumbnailRequestId /*aId*/ )
+    {
+    // No implementation
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::ThumbnailReady()
+// 
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosCategoryModelHandler::ThumbnailReady( 
+                TInt aError, 
+                MThumbnailData& aThumbnail,
+                TThumbnailRequestId aId )
+    {
+    if ( aId == iTnRequestId )
+        {
+        iTnRequestId = KErrNotFound;
+        
+        TRAP_IGNORE( ThumbnailReadyL( aError, aThumbnail, aId ) );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::ThumbnailReady()
+// 
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosCategoryModelHandler::ThumbnailReadyL( 
+                TInt aError, 
+                MThumbnailData& aThumbnail,
+                TThumbnailRequestId /*aId*/ )
+    {
+    TInt lastWatchedIndex = ResolveCategoryArrayIndexById( KCategoryIdLastWatched );
+    if ( lastWatchedIndex != KErrNotFound )
+        {
+        CHgItem& listItem = iScroller.ItemL( lastWatchedIndex );
+        CGulIcon* thumbnail( NULL );
+        
+        if ( !aError )
+            {
+            thumbnail = CGulIcon::NewL( aThumbnail.DetachBitmap() );
+            CleanupStack::PushL( thumbnail );
+            SetLastWatchedIndicatorL();
+            }
+        else
+            {
+            TFileName iconFile( KVcxHgMyVideosMifFile );
+            thumbnail = CreateHgListIconL( 
+                KAknsIIDQgnPropRecentThumbnailVideo,
+                iconFile, 
+                EMbmVcxhgmyvideosiconsQgn_prop_recent_thumbnail_video, 
+                EMbmVcxhgmyvideosiconsQgn_prop_recent_thumbnail_video_mask );
+
+            CleanupStack::PushL( thumbnail );
+            }
+        
+        listItem.SetIcon( thumbnail ); // Takes ownership
+        CleanupStack::Pop( thumbnail );
+        iScroller.RefreshScreen( lastWatchedIndex );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::HandleExtraItemSelectionL()
+// 
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosCategoryModelHandler::HandleExtraItemSelectionL( 
+        TInt categoryId,
+        TVcxHgMyVideosCategoryItemType& aItemType,
+        TUid& aUid,
+        TDes& aUrl )
+    {
+    TInt uidKey = 0;
+    TInt urlKey = 0;
+   
+    aItemType = TVcxHgMyVideosCategoryItemTypeUndefined;
+    
+    switch ( categoryId )
+        {
+        case KCategoryIdExtraItem1:
+            {
+            uidKey = KCRVideoPlayerExtraItem1Uid;
+            urlKey = KCRVideoPlayerExtraItem1Url;                   
+            break;
+            }
+        case KCategoryIdExtraItem2:
+            {
+            uidKey = KCRVideoPlayerExtraItem2Uid;
+            urlKey = KCRVideoPlayerExtraItem2Url;                    
+            break;
+            }
+        case KCategoryIdExtraItem3:
+            {
+            uidKey = KCRVideoPlayerExtraItem3Uid;
+            urlKey = KCRVideoPlayerExtraItem3Url;                   
+            break;
+            }
+        default:
+            return;
+        }
+    
+    TBuf<KMyVideosTitleUrlMaxLength> urlString;
+    TInt uidInt( 0 ) ;
+    
+    // Try to get URL.
+    TInt error = iModel.GetMyVideosCustomizationString( urlKey, urlString );
+    if ( error == KErrNone && urlString.Size() > 0 )
+        {
+        aUrl = urlString;
+        aItemType = TVcxHgMyVideosCategoryItemTypeUrl;
+        }
+
+    // Try to fetch application UID.
+    error = iModel.GetMyVideosCustomizationInt( uidKey, uidInt );
+    if ( error == KErrNone && uidInt != 0 )
+        {
+        aUid = TUid::Uid( uidInt );
+        aItemType = TVcxHgMyVideosCategoryItemTypeUid;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::CreateHgListIconL()
+// 
+// -----------------------------------------------------------------------------
+// 
+CGulIcon* CVcxHgMyVideosCategoryModelHandler::CreateHgListIconL(
+        const TAknsItemID& aSkinId,
+        const TFileName& aFileName,
+        TInt aBitmapId,
+        TInt aMaskId )
+    {
+    IPTVLOGSTRING3_LOW_LEVEL( "CVcxHgMyVideosCategoryModelHandler::CreateHgListIconL() skin major=%d, skin minor=%d", aSkinId.iMajor, aSkinId.iMinor );
+    IPTVLOGSTRING4_LOW_LEVEL( "CVcxHgMyVideosCategoryModelHandler::CreateHgListIconL() bitmap=%d mask=%d file %S", aBitmapId, aMaskId, &aFileName );
+    
+    CFbsBitmap* bitmap( NULL );
+    CFbsBitmap* mask( NULL );
+    CGulIcon* icon( NULL );
+
+    // Create default icon for Hg list.
+    AknsUtils::CreateIconLC(
+            AknsUtils::SkinInstance(),
+            aSkinId,
+            bitmap,
+            mask,
+            aFileName, 
+            aBitmapId,
+            aMaskId );
+
+    TInt error( KErrNone );
+    error = AknIconUtils::SetSize(
+            bitmap, 
+            CHgDoubleGraphicList::PreferredImageSize(), 
+            EAspectRatioPreservedAndUnusedSpaceRemoved );
+    User::LeaveIfError( error );
+
+    error = AknIconUtils::SetSize(
+            mask, 
+            CHgDoubleGraphicList::PreferredImageSize(), 
+            EAspectRatioPreservedAndUnusedSpaceRemoved );
+    User::LeaveIfError( error );
+
+    // Ownership of bitmap and mask is transferred to icon.
+    icon = CGulIcon::NewL( bitmap, mask );
+    CleanupStack::Pop( 2 ); // mask and bitmap
+
+    IPTVLOGSTRING2_LOW_LEVEL( "CVcxHgMyVideosCategoryModelHandler::CreateHgListIconL() icon=0x%08x", icon );
+
+    return icon;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::CreateEmptyHgListIconL()
+// 
+// -----------------------------------------------------------------------------
+// 
+CGulIcon* CVcxHgMyVideosCategoryModelHandler::CreateEmptyHgListIconL()
+    {
+    IPTVLOGSTRING_LOW_LEVEL( "CVcxHgMyVideosCategoryModelHandler::CreateEmptyHgListIconL()" );
+    CGulIcon* icon( NULL );
+    CFbsBitmap* bitmap = new (ELeave) CFbsBitmap;
+
+    bitmap->Create( CHgDoubleGraphicList::PreferredImageSize(), ENone );
+    CleanupStack::PushL( bitmap );
+    icon = CGulIcon::NewL( bitmap );
+    CleanupStack::Pop( bitmap );
+
+    return icon;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::LastWatchedSetL()
+// -----------------------------------------------------------------------------
+//
+TBool CVcxHgMyVideosCategoryModelHandler::LastWatchedSetL()
+    {
+    TBuf<KMaxPath> path;
+    TInt error = iModel.GetLastWatchedPathL( path );
+    TInt length = path.Length();
+    
+    if ( error == KErrNone && length > 0 )
+        {
+        return ETrue;
+        }
+    else
+        {
+        return EFalse;
+        }
+    }
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::PreloadedExistsL()
+// -----------------------------------------------------------------------------
+//
+TBool CVcxHgMyVideosCategoryModelHandler::PreloadedExistsL()
+    {
+    TBuf<KMaxPath> path;
+    TInt error = iModel.GetMyVideosCustomizationString( KCRVideoPlayerPreloadedVideoPath, path );
+    if ( !error && path.Length() && BaflUtils::FileExists( iModel.FileServerSessionL(), path ) )
+        {
+        return ETrue;
+        }
+    else
+        {
+        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;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/src/vcxhgmyvideoscollectionclient.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,1206 @@
+/*
+* 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:      Client class for My Videos MPX Collection.*
+*/
+
+
+
+
+// INCLUDE FILES
+#include <bldvariant.hrh>
+#include <mpxcollectionutility.h>
+#include <mpxcollectionpath.h>
+#include <mpxmediageneraldefs.h>
+#include <mpxmessagegeneraldefs.h>
+#include <mpxmessage2.h>
+#include <mpxcollectionmessagedefs.h>
+#include <mpxcollectionmessage.h>
+#include <mpxmessagecontainerdefs.h>
+#include <mpxmediacontainerdefs.h>
+#include <mpxcommandgeneraldefs.h>
+#include <mpxcollectioncommanddefs.h>
+#include <StringLoader.h>
+#include <aknnotewrappers.h>
+#include <vcxmyvideosdefs.h>
+#include <vcxhgmyvideos.rsg>
+#include <vcxmyvideosuids.h>
+#include "IptvDebug.h"
+#include "vcxhgmyvideoscollectionclient.h"
+#include "vcxhgmyvideosdownloadclient.h"
+#include "vcxhgmyvideoscategorymodelobserver.h"
+#include "vcxhgmyvideosvideomodelobserver.h"
+
+
+// CONSTANTS
+const TInt KVcxHgEventLevelRoot     = 1;
+const TInt KVcxHgEventLevelCategory = 2;
+const TInt KVcxHgEventLevelVideo    = 3;
+
+const TInt KVcxMpxLevelRoot       = 1;
+const TInt KVcxMpxLevelCategories = 2;
+const TInt KVcxMpxLevelVideos     = 3;
+
+const TUint32 KVcxHgMyVideosTransactionId = 5;
+
+const TInt KMpxMediaId2 = 0;
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCollectionClient::CVcxHgMyVideosCollectionClient()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosCollectionClient::CVcxHgMyVideosCollectionClient()
+  : iCollectionOpenStatus( EVcxHgCollectionNotOpen ),
+    iPendingCommand( EVcxHgMyVideosCollectionCommandNone ),
+    iCollectionLevel( KErrNotFound ) 
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCollectionClient::NewL()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosCollectionClient* CVcxHgMyVideosCollectionClient::NewL()
+    {
+    CVcxHgMyVideosCollectionClient* self = 
+    CVcxHgMyVideosCollectionClient::NewLC();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCollectionClient::NewLC()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosCollectionClient* CVcxHgMyVideosCollectionClient::NewLC()
+    {
+    CVcxHgMyVideosCollectionClient* self = 
+        new (ELeave) CVcxHgMyVideosCollectionClient();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCollectionClient::ConstructL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosCollectionClient::ConstructL()
+    {
+    iCollectionUtility = MMPXCollectionUtility::NewL( this, KMcModeDefault );
+    iDownloadClient = CVcxHgMyVideosDownloadClient::NewL( *this, *iCollectionUtility );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCollectionClient::~CVcxHgMyVideosCollectionClient()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosCollectionClient::~CVcxHgMyVideosCollectionClient()
+    {
+    delete iDownloadClient;
+    if ( iCollectionUtility )
+        {
+        iCollectionUtility->Close();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCollectionClient::DownloadClient()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosDownloadClient& CVcxHgMyVideosCollectionClient::DownloadClient()
+    {
+    return *iDownloadClient;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCollectionClient::HasPendingCommand()
+// -----------------------------------------------------------------------------
+//
+TBool CVcxHgMyVideosCollectionClient::HasPendingCommand()
+    {
+    return iPendingCommand != EVcxHgMyVideosCollectionCommandNone;
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxHgMyVideosCollectionClient::SetCategoryModelObserver()
+// ---------------------------------------------------------------------------
+//
+void CVcxHgMyVideosCollectionClient::SetCategoryModelObserver(
+        MVcxHgMyVideosCategoryModelObserver* aCategoryModelObserver )
+    {
+    iCategoryModelObserver = aCategoryModelObserver;
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxHgMyVideosCollectionClient::SetVideoModelObserver()
+// ---------------------------------------------------------------------------
+//
+void CVcxHgMyVideosCollectionClient::SetVideoModelObserver(
+        MVcxHgMyVideosVideoModelObserver* aVideoModelObserver )
+    {
+    iVideoModelObserver = aVideoModelObserver;
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxHgMyVideosCollectionClient::CollectionLevelL()
+// ---------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosCollectionClient::CollectionLevelL()
+    {
+    CMPXCollectionPath* path = iCollectionUtility->Collection().PathL();
+    CleanupStack::PushL( path );
+    TInt collectionLevel = path->Levels();
+    CleanupStack::PopAndDestroy( path );
+
+    return collectionLevel;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCollectionClient::GetCategoryListL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosCollectionClient::GetCategoryListL()
+    {
+    IPTVLOGSTRING_LOW_LEVEL( 
+        "MPX My Videos UI # GetCategoryListL()" );
+
+    if ( iCollectionOpenStatus == EVcxHgCollectionNotOpen )
+        {
+        CMPXCollectionPath* collectionPath = CMPXCollectionPath::NewL();
+        CleanupStack::PushL( collectionPath );     
+        collectionPath->AppendL( KVcxUidMyVideosMpxCollection );
+        iCollectionUtility->Collection().OpenL( *collectionPath );
+        CleanupStack::PopAndDestroy( collectionPath );  
+
+        iCollectionOpenStatus = EVcxHgCollectionOpening;
+        }
+    else
+        {
+        if ( iCollectionLevel == KErrNotFound )
+            {
+            iCollectionLevel = CollectionLevelL();
+            }
+        if ( iCollectionLevel == KVcxMpxLevelVideos )
+            {
+            iCollectionUtility->Collection().BackL();
+            iCollectionLevel = KErrNotFound;
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCollectionClient::GetVideoListL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosCollectionClient::GetVideoListL( TInt aIndex )
+    {
+    IPTVLOGSTRING2_LOW_LEVEL( 
+        "MPX My Videos UI # GetVideoListL(%d)", aIndex );
+
+    if ( iCollectionLevel == KErrNotFound )
+        {
+        iCollectionLevel = CollectionLevelL();
+        }
+    if ( iCollectionLevel == KVcxMpxLevelCategories )
+        {    
+        iCollectionUtility->Collection().OpenL( aIndex );
+        iCollectionLevel = KErrNotFound;
+        }
+    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;
+            }
+        }
+    else
+        {
+        // NOP
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCollectionClient::ArrayIndexToMpxItemIdL()
+// -----------------------------------------------------------------------------
+//
+TMPXItemId CVcxHgMyVideosCollectionClient::ArrayIndexToMpxItemIdL( TInt aArrayIndex,
+                                                                   CMPXMediaArray* aArray )
+    {
+    if ( aArrayIndex < 0 || aArrayIndex >= aArray->Count() )
+        {
+        User::Leave( KErrArgument );
+        }
+
+    return (*aArray)[aArrayIndex]->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCollectionClient::DeleteVideosL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosCollectionClient::DeleteVideosL( CMPXMediaArray* aMediasToDelete )
+    {
+    IPTVLOGSTRING_LOW_LEVEL( 
+        "MPX My Videos UI # CVcxHgMyVideosCollectionClient::DeleteVideosL()" );
+
+    if ( ! HasPendingCommand() && ! iDownloadClient->HasPendingCommand() )
+        {
+        CMPXCommand* cmd = CMPXMedia::NewL();
+        CleanupStack::PushL( cmd );
+
+        cmd->SetTObjectValueL( KMPXCommandGeneralId, KVcxCommandIdMyVideos );
+        cmd->SetTObjectValueL( KVcxMediaMyVideosCommandId, KVcxCommandMyVideosDelete );    
+        cmd->SetTObjectValueL( KMPXCommandGeneralDoSync, EFalse );
+        cmd->SetTObjectValueL( KMPXCommandGeneralCollectionId, 
+                               TUid::Uid( KVcxUidMyVideosMpxCollection ) );
+        cmd->SetCObjectValueL( KMPXMediaArrayContents, aMediasToDelete );
+
+        iCollectionUtility->Collection().CommandL( *cmd );
+
+        iPendingCommand = EVcxHgMyVideosCollectionCommandMultiDelete_Starting;
+        CleanupStack::PopAndDestroy( cmd );    
+        }
+    else
+        {
+        IPTVLOGSTRING_LOW_LEVEL( 
+            "MPX My Videos UI # CVcxHgMyVideosCollectionClient::DeleteVideosL() LEAVE: KErrNotReady" );
+        User::Leave( KErrNotReady );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCollectionClient::CancelDeleteVideosL()
+// -----------------------------------------------------------------------------
+//    
+void CVcxHgMyVideosCollectionClient::CancelDeleteVideosL()
+    {
+    IPTVLOGSTRING_LOW_LEVEL( 
+        "MPX My Videos UI # CVcxHgMyVideosCollectionClient::CancelDeleteVideosL()" );
+
+    // Deletion can be cancelled right away if deletion has already started. If we
+    // are only waiting for it, we modify the pending command to indicate cancellation.
+    if ( iPendingCommand == EVcxHgMyVideosCollectionCommandMultiDelete_Started ||
+         iPendingCommand == EVcxHgMyVideosCollectionCommandMultiDelete_Finished )
+        {
+        CMPXCommand* cmd = CMPXMedia::NewL();
+        CleanupStack::PushL( cmd );
+        cmd->SetTObjectValueL( KMPXCommandGeneralId, KVcxCommandIdMyVideos );
+        cmd->SetTObjectValueL( KVcxMediaMyVideosCommandId, KVcxCommandMyVideosCancelDelete );
+        cmd->SetTObjectValueL( KMPXCommandGeneralDoSync, ETrue );
+        cmd->SetTObjectValueL( KMPXCommandGeneralCollectionId, 
+                               TUid::Uid( KVcxUidMyVideosMpxCollection ) );
+        iCollectionUtility->Collection().CommandL( *cmd );
+        CleanupStack::PopAndDestroy( cmd );
+
+        iPendingCommand = EVcxHgMyVideosCollectionCommandCancelDelete_Completed;
+        }
+    else if ( iPendingCommand == EVcxHgMyVideosCollectionCommandMultiDelete_Starting )
+        {
+        iPendingCommand = EVcxHgMyVideosCollectionCommandCancelDelete_Requested;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCollectionClient::MoveOrCopyVideosL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosCollectionClient::MoveOrCopyVideosL( CMPXMediaArray* mediasToMoveOrCopy,
+                                                        TInt aTargetDrive,
+                                                        TBool aCopy )
+    {
+    CMPXCommand* cmd = CMPXMedia::NewL();
+    CleanupStack::PushL( cmd );
+
+    cmd->SetTObjectValueL( KMPXCommandGeneralId, KVcxCommandIdMyVideos );
+    if ( aCopy )
+        {
+        cmd->SetTObjectValueL( KVcxMediaMyVideosCommandId, KVcxCommandMyVideosCopy );
+        }
+    else
+        {
+        cmd->SetTObjectValueL( KVcxMediaMyVideosCommandId, KVcxCommandMyVideosMove );
+        }
+    cmd->SetTObjectValueL( KVcxMediaMyVideosInt32Value, aTargetDrive );
+    cmd->SetTObjectValueL( KMPXCommandGeneralDoSync, EFalse );
+    cmd->SetTObjectValueL( KMPXCommandGeneralCollectionId, 
+                           TUid::Uid( KVcxUidMyVideosMpxCollection ) );
+    cmd->SetCObjectValueL( KMPXMediaArrayContents, mediasToMoveOrCopy );
+
+    iCollectionUtility->Collection().CommandL(*cmd);
+    iPendingCommand = EVcxHgMyVideosCollectionCommandMoveCopy_Starting;
+    CleanupStack::PopAndDestroy( cmd );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCollectionClient::CancelMoveOrCopyVideosL()
+// -----------------------------------------------------------------------------
+//    
+void CVcxHgMyVideosCollectionClient::CancelMoveOrCopyVideosL()
+    {
+    IPTVLOGSTRING_LOW_LEVEL( 
+        "MPX My Videos UI # CVcxHgMyVideosCollectionClient::CancelMoveOrCopyVideosL()" );
+
+    if ( iPendingCommand == EVcxHgMyVideosCollectionCommandMoveCopy_Started ||
+         iPendingCommand == EVcxHgMyVideosCollectionCommandMoveCopy_Finished )
+        {
+        CMPXCommand* cmd = CMPXMedia::NewL();
+        CleanupStack::PushL( cmd );
+        cmd->SetTObjectValueL( KMPXCommandGeneralId, KVcxCommandIdMyVideos );
+        cmd->SetTObjectValueL( KVcxMediaMyVideosCommandId, KVcxCommandMyVideosCancelMoveOrCopy );
+        cmd->SetTObjectValueL( KMPXCommandGeneralDoSync, ETrue );
+        cmd->SetTObjectValueL( KMPXCommandGeneralCollectionId, 
+                               TUid::Uid( KVcxUidMyVideosMpxCollection ) );
+        iCollectionUtility->Collection().CommandL( *cmd );
+        CleanupStack::PopAndDestroy( cmd );
+
+        iPendingCommand = EVcxHgMyVideosCollectionCommandCancelMoveCopy_Completed;
+        }
+    else if ( iPendingCommand == EVcxHgMyVideosCollectionCommandMoveCopy_Starting )
+        {
+        iPendingCommand = EVcxHgMyVideosCollectionCommandCancelMoveCopy_Requested;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCollectionClient::PlayVideoL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosCollectionClient::PlayVideoL( TMPXItemId aMpxItemId )
+    {
+    IPTVLOGSTRING2_LOW_LEVEL( 
+                "CVcxHgMyVideosCollectionClient::PlayVideoL: Play video at collection index %d", aMpxItemId.iId1 );
+        
+    CMPXCollectionPath* collectionPath = CMPXCollectionPath::NewL();
+    CleanupStack::PushL( collectionPath );
+    
+    collectionPath->AppendL( KVcxUidMyVideosMpxCollection );
+    collectionPath->AppendL( KVcxMvcCategoryIdAll );
+    collectionPath->AppendL( aMpxItemId );
+    collectionPath->SelectL( aMpxItemId );
+   
+    iCollectionUtility->Collection().OpenL( *collectionPath );
+    
+    CleanupStack::PopAndDestroy( collectionPath );
+
+    IPTVLOGSTRING_LOW_LEVEL( 
+           "MPX My Videos UI # CVcxHgMyVideosCollectionClient::PlayVideoL() - Exit" );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCollectionClient::FetchMpxMediaByMpxIdL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosCollectionClient::FetchMpxMediaByMpxIdL( TMPXItemId& aMpxId )
+    {
+    if ( ! iDownloadClient->HasPendingCommand() )
+        {    
+        CMPXCommand* cmd = CMPXCommand::NewL();
+        CleanupStack::PushL( cmd );
+    
+        cmd->SetTObjectValueL( KMPXCommandGeneralId, KVcxCommandIdMyVideos );
+        cmd->SetTObjectValueL( KVcxMediaMyVideosCommandId, KVcxCommandMyVideosGetMediasByMpxId );
+        cmd->SetTObjectValueL( KMPXCommandGeneralCollectionId,
+                               TUid::Uid( KVcxUidMyVideosMpxCollection ) );
+        cmd->SetTObjectValueL( KVcxMediaMyVideosTransactionId, KVcxHgMyVideosTransactionId );        
+        CMPXMediaArray* idMediaArray = CMPXMediaArray::NewL();
+        CleanupStack::PushL( idMediaArray );
+        CMPXMedia* media = CMPXMedia::NewL();
+        CleanupStack::PushL( media );
+        media->SetTObjectValueL( KMPXMessageMediaGeneralId, aMpxId );
+        idMediaArray->AppendL( *media );
+        CleanupStack::PopAndDestroy( media );
+        cmd->SetCObjectValueL<CMPXMediaArray>( KMPXMediaArrayContents, idMediaArray );
+        cmd->SetTObjectValueL( KMPXMediaArrayCount, idMediaArray->Count() );
+
+        iCollectionUtility->Collection().CommandL( *cmd );
+
+        CleanupStack::PopAndDestroy( idMediaArray );
+        CleanupStack::PopAndDestroy( cmd );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCollectionClient::GetVideoDetailsL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosCollectionClient::GetVideoDetailsL( TMPXItemId& aMpxId )
+    {
+    if ( ! HasPendingCommand() && ! iDownloadClient->HasPendingCommand() )
+        {
+        CMPXCommand* cmd = CMPXCommand::NewL();
+        CleanupStack::PushL( cmd );
+        
+        cmd->SetTObjectValueL( KMPXCommandGeneralId, KVcxCommandIdMyVideos );
+        cmd->SetTObjectValueL( KVcxMediaMyVideosCommandId, KVcxCommandMyVideosGetMediaFullDetailsByMpxId );
+        cmd->SetTObjectValueL( KMPXMediaGeneralId, aMpxId );
+        
+        iCollectionUtility->Collection().CommandL( *cmd );
+        iPendingCommand = EVcxHgMyVideosCollectionCommandVideoDetails_Requested;
+        CleanupStack::PopAndDestroy( cmd );
+        }
+	}
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCollectionClient::HandleCollectionMediaL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosCollectionClient::HandleCollectionMediaL( 
+        const CMPXMedia& /*aMedia*/,
+        TInt /*aError*/ )
+    {
+    // No implemetation required.
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCollectionClient::HandleCollectionMessage()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosCollectionClient::HandleCollectionMessage( 
+        CMPXMessage* aMessage,
+        TInt aError )
+    {
+    TRAP_IGNORE( HandleCollectionMessageL( aMessage, aError ) );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCollectionClient::HandleCollectionMessageL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosCollectionClient::HandleCollectionMessageL( 
+        CMPXMessage* aMessage,
+        TInt aError )
+    {
+    TInt myVideosCmd( KErrNotFound ); 
+    if ( aMessage->ValueTObjectL<TMPXMessageId>( KMPXMessageGeneralId ) == KVcxCommandIdMyVideos )
+        {
+        myVideosCmd = aMessage->ValueTObjectL<TInt>( KVcxMediaMyVideosCommandId );
+        }
+
+    if ( myVideosCmd == KVcxMessageMyVideosMessageArray )
+        {
+        if ( aMessage->IsSupported( KMPXMessageArrayContents ) )
+            {
+            const CMPXMessageArray* messageArray =
+                aMessage->Value<CMPXMessageArray>(KMPXMessageArrayContents);
+            for ( TInt i = 0; i < messageArray->Count(); i++ )
+                {
+                HandleSingleCollectionMessageL( (*messageArray)[i], KErrNone );
+                }    
+            }
+        }
+    else
+        {
+        HandleSingleCollectionMessageL( aMessage, aError );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCollectionClient::HandleSingleCollectionMessageL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosCollectionClient::HandleSingleCollectionMessageL( 
+        CMPXMessage* aMessage,
+        TInt aError )
+    {
+#ifdef _DEBUG
+    if ( aMessage->IsSupported( KVcxMediaMyVideosMessageId ) )
+        {
+        IPTVLOGSTRING3_LOW_LEVEL(
+            "MPX My Videos UI # HandleSingleCollectionMessageL(xxx,%d) MessageId: %d",
+            aError,
+            static_cast<TUint32>( *( aMessage->Value<TUint32>( KVcxMediaMyVideosMessageId ) ) ) );
+        }
+    else
+#endif // _DEBUG
+        {
+        IPTVLOGSTRING2_LOW_LEVEL(
+            "MPX My Videos UI # HandleSingleCollectionMessageL(xxx,%d)", aError );
+        }
+
+    if ( aMessage && aError == KErrNone )
+        {
+        switch ( *( aMessage->Value<TMPXMessageId>( KMPXMessageGeneralId ) ) )
+            {
+            case KVcxCommandIdMyVideos:
+                {
+                if ( aMessage->IsSupported( KVcxMediaMyVideosCommandId ) )
+                    {
+                    TInt mvMsgId = *(aMessage->Value<TInt>( KVcxMediaMyVideosCommandId ) );
+
+                    switch ( mvMsgId )
+                        {
+                        case KVcxMessageMyVideosGetMediasByMpxIdResp:
+                            HandleGetMediasByMpxIdRespL( aMessage, aError );
+                            break;
+                        case KVcxMessageMyVideosItemsAppended:
+                            HandleMyVideosItemsAppendedL( aMessage, aError );
+                            break;
+                        case KVcxMessageMyVideosListComplete:
+                            HandleMyVideosListCompleteL( aMessage, aError );
+                            break;
+                        case KVcxMessageMyVideosDeleteStarted:
+                        case KVcxMessageMyVideosDeleteResp:
+                            HandleMyVideosDeleteMessageL( aMessage, aError );
+                            break;
+                        case KVcxMessageMyVideosMoveOrCopyStarted:
+                        case KVcxMessageMyVideosMoveResp:
+                        case KVcxMessageMyVideosCopyResp:
+                            HandleMyVideosMoveOrCopyMessageL( aMessage, aError );
+                            break;
+                        default:
+                            break;
+                        }
+                    }
+                }
+                break;
+            case KMPXMessageGeneral:
+                {
+                IPTVLOGSTRING_LOW_LEVEL( 
+                    "MPX My Videos UI # KMPXMessageGeneral" );
+                
+                TInt event( *(aMessage->Value<TInt>( KMPXMessageGeneralEvent )) );
+                TInt data( *(aMessage->Value<TInt>( KMPXMessageGeneralData )) );
+
+                switch ( event )
+                    {
+                    case TMPXCollectionMessage::EPathChanged:
+                        {
+                        if ( data == EMcContainerOpened  )
+                            {
+                            if ( iCollectionOpenStatus == EVcxHgCollectionOpening )
+                                {
+                                iCollectionOpenStatus = EVcxHgCollectionOpened;
+                                }
+                            iCollectionUtility->Collection().OpenL();
+                            }
+                        iCollectionLevel = CollectionLevelL();
+                        }
+                        break;                        
+                    case TMPXCollectionMessage::ECollectionChanged:
+                        {
+                        // NOP, called when My Videos collection initially opened.
+                        }
+                        break;                        
+                    case TMPXCollectionMessage::EBroadcastEvent:
+                    case TMPXCollectionMessage::ENoEvent:
+                    case TMPXCollectionMessage::EError:
+                    case TMPXCollectionMessage::EMediaChanged:
+                    case TMPXCollectionMessage::EItemChanged:
+                    case TMPXCollectionMessage::EFocusChanged:
+                    case TMPXCollectionMessage::EAsyncOpComplete:
+                    case TMPXCollectionMessage::EExtendedMessage:
+                    default:
+                        break;                        
+                    }
+                }
+                break;
+            case KMPXMessageIdItemChanged:
+                {
+                IPTVLOGSTRING_LOW_LEVEL( 
+                    "MPX My Videos UI # HandleSingleCollectionMessageL() KMPXMessageIdItemChanged" );                
+                // Handle messages from our plugin only, this check skips also array messages (KMPXMessageArrayContents) 
+                if ( aMessage->IsSupported( KMPXMessageCollectionId ) )
+                    {
+                    TUid collectionUid( *(aMessage->Value<TUid>( KMPXMessageCollectionId )) );
+                    IPTVLOGSTRING2_LOW_LEVEL( 
+                        "MPX My Videos UI # HandleMyVideosItemsChangedL() CollectionUid=%X", collectionUid.iUid );                
+                    if ( collectionUid.iUid == KVcxUidMyVideosMpxCollection )
+                        {
+                        HandleMyVideosItemsChangedL( aMessage, aError );
+                        }
+                    }
+                }
+                break;
+            default:
+                {
+                IPTVLOGSTRING_LOW_LEVEL( 
+                    "MPX My Videos UI # HandleSingleCollectionMessageL() ???" );                
+                }
+                break;
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCollectionClient::HandleOpenL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosCollectionClient::HandleOpenL( 
+        const CMPXMedia& aEntries,
+        TInt /*aIndex*/,
+        TBool /*aComplete*/,
+        TInt aError )
+    {
+    IPTVLOGSTRING2_LOW_LEVEL( 
+        "MPX My Videos UI # HandleOpenL(aError=%d)", aError );
+
+    if ( aError == KErrNone )
+        {
+        TInt levels = CollectionLevelL();
+
+        if ( levels == KVcxMpxLevelCategories )
+            {
+            // Check that entry has an array of contents.
+            if ( aEntries.IsSupported( KMPXMediaArrayContents ) )
+                {
+                CMPXMediaArray* pointerArray = 
+                    aEntries.Value<CMPXMediaArray>(KMPXMediaArrayContents);
+                CMPXMediaArray* categoryArray = CMPXMediaArray::NewL( *pointerArray );
+                CleanupStack::PushL( categoryArray );
+
+                if ( iCategoryModelObserver )
+                    {
+                    TBool isPartial( EFalse );
+                    if ( aEntries.IsSupported( KVcxMediaMyVideosVideoListIsPartial ) )
+                        {
+                        isPartial = aEntries.ValueTObjectL<TBool>( KVcxMediaMyVideosVideoListIsPartial );
+                        }
+                    iCategoryModelObserver->NewCategoryListL( categoryArray, isPartial );
+                    CleanupStack::Pop( categoryArray );
+                    }
+                else
+                    {
+                    CleanupStack::PopAndDestroy( categoryArray );
+                    }
+                }
+            }
+        else if ( levels == KVcxMpxLevelVideos )
+            {
+            // Check that entry has an array of contents.
+            if ( aEntries.IsSupported( KMPXMediaArrayContents ) )
+                {
+                CMPXMediaArray* pointerArray = 
+                    aEntries.Value<CMPXMediaArray>(KMPXMediaArrayContents);
+                CMPXMediaArray* videoArray = CMPXMediaArray::NewL( *pointerArray );
+                CleanupStack::PushL( videoArray );
+
+#if defined(_DEBUG) && IPTV_LOGGING_METHOD != 0
+                DebugPrintVideoListL( videoArray );
+#endif // _DEBUG && IPTV_LOGGING_METHOD
+
+                if ( iVideoModelObserver )
+                    {
+                    iVideoModelObserver->NewVideoListL( *videoArray );
+                    }
+                CleanupStack::PopAndDestroy( videoArray );
+                }
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCollectionClient::HandleOpenL()
+// -----------------------------------------------------------------------------
+//                      
+void CVcxHgMyVideosCollectionClient::HandleOpenL( 
+        const CMPXCollectionPlaylist& /*aPlaylist*/,
+        TInt /*aError*/ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCollectionClient::HandleCommandComplete()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosCollectionClient::HandleCommandComplete( 
+        CMPXCommand* aCommandResult,
+        TInt aError )
+    {
+    IPTVLOGSTRING2_LOW_LEVEL( 
+        "MPX My Videos UI # HandleCommandComplete(xxx,%d)", aError );
+
+    if ( iDownloadClient->HasPendingCommand() )
+        {
+        TRAP_IGNORE( iDownloadClient->CommandCompleteL( aError ) );
+        }
+    else if ( HasPendingCommand() )
+        {
+        // If "HandleCommandComplete" is received before our state has moved to
+        // "Operation_Finished", MPX has mixed the events asynchronously. In those
+        // cases we don't clear the pending command yet, but instead we mark what
+        // happened and the "Operation_Finished" handler will clear the command.
+        if ( iPendingCommand == EVcxHgMyVideosCollectionCommandMoveCopy_Started )
+            {
+            iPendingCommand = EVcxHgMyVideosCollectionCommandMoveCopy_Finished;
+            }
+        else if ( iPendingCommand == EVcxHgMyVideosCollectionCommandMultiDelete_Started )
+            {
+            iPendingCommand = EVcxHgMyVideosCollectionCommandMultiDelete_Finished;
+            }
+        else if ( iPendingCommand == EVcxHgMyVideosCollectionCommandVideoDetails_Requested )
+            {
+            TRAP_IGNORE( HandleGetVideoDetailsRespL( aCommandResult, aError ) );
+            iPendingCommand = EVcxHgMyVideosCollectionCommandNone;
+            }
+        else if ( iPendingCommand != EVcxHgMyVideosCollectionCommandCancelDelete_Completed &&
+		          iPendingCommand != EVcxHgMyVideosCollectionCommandCancelMoveCopy_Completed )
+            {
+            iPendingCommand = EVcxHgMyVideosCollectionCommandNone;
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCollectionClient::HandleMyVideosItemsAppendedL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosCollectionClient::HandleMyVideosItemsAppendedL( CMPXMessage* aMessage,
+                                                                   TInt /*aError*/ )
+    {
+    IPTVLOGSTRING_LOW_LEVEL( "MPX My Videos UI # HandleMyVideosItemsAppendedL()" );
+
+    TInt levels = CollectionLevelL();
+    TBool categoryEvent( EFalse );
+
+    if ( aMessage->IsSupported( KMPXMessageGeneralId ) )
+        {
+        categoryEvent = ( aMessage->Value<TMPXItemId>( KMPXMessageGeneralId )->iId2 == 1 );
+        }
+
+    // Check that necessary events are not filtered out.
+    
+    if ( levels == KVcxMpxLevelCategories )
+        {
+        if ( iCategoryModelObserver && categoryEvent )
+            {
+            iCategoryModelObserver->CategoryListModifiedL();
+            }        
+        }
+    else if ( levels == KVcxMpxLevelVideos )
+        {
+        if ( iVideoModelObserver && ! categoryEvent )
+            {
+            iVideoModelObserver->VideoListModifiedL();
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCollectionClient::HandleMyVideosItemsChangedL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosCollectionClient::HandleMyVideosItemsChangedL( CMPXMessage* aMessage,
+                                                                   TInt /*aError*/ )
+    {
+    IPTVLOGSTRING_LOW_LEVEL( 
+        "MPX My Videos UI # HandleMyVideosItemsChangedL()" );
+
+    TMPXChangeEventType eventType( 
+        *aMessage->Value<TMPXChangeEventType>( KMPXMessageChangeEventType ) );
+    TMPXItemId eventData( 
+        *aMessage->Value<TMPXItemId>( KMPXMessageMediaGeneralId ) );
+
+    TInt levels = CollectionLevelL();
+    TInt eventlevel( KVcxHgEventLevelVideo );
+
+    if ( eventData.iId2 == KVcxUidMyVideosMpxCollection )
+        {
+        eventlevel = KVcxHgEventLevelRoot;
+        }
+    else if ( eventData.iId2 == 1 )
+        {
+        eventlevel = KVcxHgEventLevelCategory;
+        }
+    else
+        {
+        eventlevel = KVcxHgEventLevelVideo;
+        }
+
+    // Check that necessary events are not filtered out.
+
+    // If root level is modified, it means that MMC has been plugged / 
+    // unplugged. For video view the changed video list will be retrieved
+    // based on change of parent category, but for category view we need
+    // to re-open the list.
+    if ( eventlevel == KVcxHgEventLevelRoot )
+        {
+        IPTVLOGSTRING_LOW_LEVEL( 
+            "MPX My Videos UI # HandleMyVideosItemsChangedL() - MMC plugged/unplugged." );
+        
+        if ( levels == KVcxMpxLevelCategories )
+            {
+            iCollectionUtility->Collection().OpenL();
+            }
+        }
+    else
+        {
+        if ( levels == KVcxMpxLevelCategories )
+            {
+            if ( iCategoryModelObserver )
+                {
+                iCategoryModelObserver->CategoryModifiedL( eventType, eventData );
+                }        
+            }
+        else if ( levels == KVcxMpxLevelVideos )
+            {
+            TInt32 extraInfo( EVcxMyVideosListNoInfo );
+            if ( aMessage->IsSupported( KVcxMediaMyVideosInt32Value ) )
+                {
+                extraInfo = aMessage->ValueTObjectL<TInt32>( KVcxMediaMyVideosInt32Value );
+                }
+
+            if ( iVideoModelObserver && 
+                 ( eventlevel == KVcxHgEventLevelVideo ||
+                   extraInfo == EVcxMyVideosVideoListOrderChanged ) ) 
+                {
+                iVideoModelObserver->VideoModifiedL( eventType, eventData, extraInfo );
+                }
+            }
+        }   
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCollectionClient::HandleMyVideosDeleteMessageL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosCollectionClient::HandleMyVideosDeleteMessageL( CMPXMessage* aMessage,
+                                                                   TInt aError )
+    {
+    IPTVLOGSTRING2_LOW_LEVEL( 
+        "MPX My Videos UI # HandleMyVideosDeleteMessageL() aError = %d", aError );
+
+    TInt mvMsgId( aMessage->ValueTObjectL<TInt>( KVcxMediaMyVideosCommandId ) );
+
+    // CancelDelete_Requested is used to indicate that user wanted to cancel the deletion
+    // when we still hadn't received KVcxMessageMyVideosDeleteStarted message. Therefore
+    // we needed to wait until now to cancel the deletion.
+    if ( iPendingCommand == EVcxHgMyVideosCollectionCommandCancelDelete_Requested )
+        {
+        IPTVLOGSTRING_LOW_LEVEL( 
+            "MPX My Videos UI # HandleMyVideosDeleteMessageL() - Cancelling." );
+
+        // Use convenient value so that CancelDeleteVideosL() will perform immediate cancel.
+        iPendingCommand = EVcxHgMyVideosCollectionCommandMultiDelete_Started;
+
+        CancelDeleteVideosL();
+        return;
+        }
+    // CancelDelete_Completed is used to indicate that cancellation of deletion is now
+    // completed. Cancel never shows error notes, that's why special handling is needed.
+    else if ( iPendingCommand == EVcxHgMyVideosCollectionCommandCancelDelete_Completed )
+        {
+        IPTVLOGSTRING_LOW_LEVEL( 
+            "MPX My Videos UI # HandleMyVideosDeleteMessageL() - Cancelled." );
+
+        if ( iVideoModelObserver )
+            {
+            TMPXItemId emptyMpxItemId;
+            iVideoModelObserver->VideoDeletionCompletedL( 0, emptyMpxItemId );
+            }
+        iPendingCommand = EVcxHgMyVideosCollectionCommandNone;
+        return;
+        }
+
+    if ( mvMsgId == KVcxMessageMyVideosDeleteStarted )
+        {
+        IPTVLOGSTRING_LOW_LEVEL( 
+            "MPX My Videos UI # HandleMyVideosDeleteMessageL() - Delete started." );
+
+        iPendingCommand = EVcxHgMyVideosCollectionCommandMultiDelete_Started;
+        }
+    else // aMessage == KVcxMessageMyVideosDeleteResp
+        {
+        IPTVLOGSTRING_LOW_LEVEL( 
+            "MPX My Videos UI # HandleMyVideosDeleteMessageL() - Delete Resp (finished)." );
+
+        // See HandleCommandComplete().
+        if ( iPendingCommand == EVcxHgMyVideosCollectionCommandMultiDelete_Finished )
+            {
+            iPendingCommand = EVcxHgMyVideosCollectionCommandNone;
+            }
+        else
+            {
+            iPendingCommand = EVcxHgMyVideosCollectionCommandMultiDelete_Finished;
+            }        
+
+        CMPXMediaArray* messageArray = aMessage->Value<CMPXMediaArray>(
+                KMPXMediaArrayContents );
+
+        TInt32 failedCount( 0 );
+        TMPXItemId latestMpxItemId;
+
+        for ( TInt i = 0; i < messageArray->Count(); i++ )
+            {
+            if ( messageArray->AtL( i )->ValueTObjectL<TInt32>( KVcxMediaMyVideosInt32Value )
+                 != KErrNone )
+                {
+                failedCount++;
+                latestMpxItemId = 
+                    messageArray->AtL( i )->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId );
+                }
+            else
+                {
+                if ( iVideoModelObserver )
+                    {
+                    // Sending remove request to video list model. This ensures that
+                    // the deleted videos has removed from a video list before the 
+                    // progress bar disappears.
+                    TMPXItemId removedItemId = 
+                        messageArray->AtL( i )->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId );
+                    iVideoModelObserver->VideoModifiedL( 
+                        EMPXItemDeleted, removedItemId, EVcxMyVideosListNoInfo );
+                    }
+                }
+            }
+
+        if ( iVideoModelObserver )
+            {
+            iVideoModelObserver->VideoDeletionCompletedL( failedCount, latestMpxItemId );
+            }        
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCollectionClient::HandleMyVideosMoveOrCopyMessageL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosCollectionClient::HandleMyVideosMoveOrCopyMessageL( CMPXMessage* aMessage,
+                                                                       TInt aError )
+    {
+    IPTVLOGSTRING2_LOW_LEVEL( 
+        "MPX My Videos UI # HandleMyVideosMoveOrCopyMessageL() aError = %d", aError );
+
+    TInt mvMsgId( aMessage->ValueTObjectL<TInt>( KVcxMediaMyVideosCommandId ) );
+
+    if ( iPendingCommand == EVcxHgMyVideosCollectionCommandCancelMoveCopy_Requested )
+        {
+        IPTVLOGSTRING_LOW_LEVEL( 
+            "MPX My Videos UI # HandleMyVideosMoveOrCopyMessageL() - Cancelling." );
+        iPendingCommand = EVcxHgMyVideosCollectionCommandMoveCopy_Started;
+        CancelMoveOrCopyVideosL();
+        return;        
+        }
+    else if ( iPendingCommand == EVcxHgMyVideosCollectionCommandCancelMoveCopy_Completed )
+        {
+        IPTVLOGSTRING_LOW_LEVEL( 
+            "MPX My Videos UI # HandleMyVideosMoveOrCopyMessageL() - Cancelled." );
+        if ( iVideoModelObserver )
+            {
+            TMPXItemId emptyMpxItemId;
+            iVideoModelObserver->VideoMoveOrCopyCompletedL( 0, emptyMpxItemId );
+            }
+        iPendingCommand = EVcxHgMyVideosCollectionCommandNone; 
+        return;
+        }
+
+    if ( mvMsgId == KVcxMessageMyVideosMoveOrCopyStarted )
+        {
+        IPTVLOGSTRING_LOW_LEVEL( 
+            "MPX My Videos UI # HandleMyVideosMoveOrCopyMessageL() - Move/copy started." );
+
+        iPendingCommand = EVcxHgMyVideosCollectionCommandMoveCopy_Started;
+        }
+    else // KVcxMessageMyVideosMoveResp || KVcxMessageMyVideosCopyResp
+        {
+        IPTVLOGSTRING_LOW_LEVEL( 
+            "MPX My Videos UI # HandleMyVideosMoveOrCopyMessageL() - Move/copy finished." );        
+
+        // See HandleCommandComplete().
+        if ( iPendingCommand == EVcxHgMyVideosCollectionCommandMoveCopy_Finished )
+            {
+            iPendingCommand = EVcxHgMyVideosCollectionCommandNone;
+            }
+        else if ( iPendingCommand != EVcxHgMyVideosCollectionCommandNone )
+            {
+            iPendingCommand = EVcxHgMyVideosCollectionCommandMoveCopy_Finished;
+            }
+
+        CMPXMediaArray* messageArray = aMessage->Value<CMPXMediaArray>(
+                KMPXMediaArrayContents );
+
+        TInt32 failedCount( 0 );
+        TMPXItemId latestMpxItemId;
+
+        for ( TInt i = 0; i < messageArray->Count(); i++ )
+            {
+            TInt err = messageArray->AtL( i )->ValueTObjectL<TInt32>( KVcxMediaMyVideosInt32Value );
+            if ( err != KErrNone && err != KErrAlreadyExists )
+                {
+                failedCount++;
+
+                latestMpxItemId = 
+                    messageArray->AtL( i )->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId );
+                }
+            }
+        
+        if ( iVideoModelObserver )
+            {
+            iVideoModelObserver->VideoMoveOrCopyCompletedL( failedCount, latestMpxItemId );
+            }        
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCollectionClient::HandleGetMediasByMpxIdRespL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosCollectionClient::HandleGetMediasByMpxIdRespL( CMPXMessage* aMessage,
+                                                                  TInt aError )
+    {
+    IPTVLOGSTRING_LOW_LEVEL( "MPX My Videos UI # HandleGetMediasByMpxIdRespL()" );
+
+    if ( aError == KErrNone )
+        {
+        CMPXMedia* entries = CMPXMedia::NewL( *aMessage );
+        CleanupStack::PushL( entries );
+        CMPXMediaArray* array = entries->Value<CMPXMediaArray>( KMPXMediaArrayContents );
+        if ( array->Count() >= 1 )
+            {
+            TUint32 transactionId( 0 );
+            
+            if ( aMessage->IsSupported( KVcxMediaMyVideosTransactionId ) )
+                {
+                transactionId = aMessage->ValueTObjectL<TUint32>( KVcxMediaMyVideosTransactionId );
+                }
+            
+            if ( transactionId == KVcxHgMyVideosTransactionId )
+                {
+                if ( iVideoModelObserver )
+            	    {
+            	    CMPXMedia* media = CMPXMedia::NewL( *( ( *array )[0] ) );
+                    // Ownership is transferred.
+            	    iVideoModelObserver->VideoFetchingCompletedL( media );  
+            	    }
+                }
+			}
+        CleanupStack::PopAndDestroy( entries );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosCollectionClient::HandleMyVideosListCompleteL( CMPXMessage* /*aMessage*/,
+                                                                  TInt aError )
+    {
+    IPTVLOGSTRING_LOW_LEVEL( "MPX My Videos UI # HandleMyVideosListCompleteL()" );
+    if ( aError == KErrNone )
+        {
+        if ( iCategoryModelObserver )
+            {
+            iCategoryModelObserver->CategoryListFetchingCompletedL();
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCollectionClient::SetFlagsL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosCollectionClient::SetFlagsL( TMPXItemId aMpxItemId, TUint32 aFlags )
+{    
+    CMPXMedia* msg = CMPXMedia::NewL();
+    CleanupStack::PushL( msg );
+    
+    msg->SetTObjectValueL<TMPXItemId>( KMPXMediaGeneralId, TMPXItemId( aMpxItemId, KMpxMediaId2 ));
+    msg->SetTObjectValueL<TInt32>( KMPXMediaGeneralFlags, aFlags );
+    
+    CMPXCommand* cmd = CMPXCommand::NewL();
+    CleanupStack::PushL( cmd );
+    
+    cmd->SetTObjectValueL( KMPXCommandGeneralId, KMPXCommandIdCollectionSet );
+    cmd->SetTObjectValueL( KMPXCommandGeneralDoSync, ETrue );
+    cmd->SetCObjectValueL( KMPXCommandColSetMedia, msg );
+    cmd->SetTObjectValueL( KMPXCommandGeneralCollectionId, KVcxUidMyVideosMpxCollection );
+    
+    iCollectionUtility->Collection().CommandL( *cmd );
+    
+    CleanupStack::PopAndDestroy( cmd );    
+    CleanupStack::PopAndDestroy( msg );
+}
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCollectionClient::HandleGetVideoDetailsRespL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosCollectionClient::HandleGetVideoDetailsRespL( CMPXMessage* aMessage,
+                                                                 TInt aError )
+    {
+    IPTVLOGSTRING_LOW_LEVEL( "MPX My Videos UI # HandleGetVideoDetailsRespL()" );
+
+    CMPXMedia* media( NULL );
+    
+    if ( aError == KErrNone && aMessage && 
+            aMessage->IsSupported( KMPXCommandColAddMedia ) )
+        {
+        media = aMessage->Value<CMPXMedia>( KMPXCommandColAddMedia );
+        }
+    
+    if ( iVideoModelObserver && media )
+        {
+        iVideoModelObserver->VideoDetailsCompletedL( *media );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCollectionClient::CategoryIndexL()
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosCollectionClient::CategoryIndexL()
+    {
+    CMPXCollectionPath* path = iCollectionUtility->Collection().PathL();
+    TInt index ( KErrNotFound );
+    if ( path )
+        {
+        if ( path->Levels() > KVcxMpxLevelCategories )
+            {
+            index = path->Index( KVcxMpxLevelRoot );
+            }
+        delete path;
+        }
+    return index;
+    }
+
+#if defined(_DEBUG) && IPTV_LOGGING_METHOD != 0
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosCollectionClient::DebugPrintVideoListL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosCollectionClient::DebugPrintVideoListL( CMPXMediaArray* aVideoArray )
+    {
+    CMPXMedia* media = NULL;
+    IPTVLOGSTRING_LOW_LEVEL( 
+        "MPX My Videos UI # --------------------------------------------------------" );
+    for ( TInt i = 0; i < aVideoArray->Count(); i++ )
+        {
+        media = (*aVideoArray)[i]; 
+        
+        if ( media->IsSupported( KMPXMediaGeneralTitle ) && 
+             media->IsSupported( KMPXMediaGeneralUri ) &&
+             media->IsSupported( KMPXMediaGeneralId ) )
+            {
+            IPTVLOGSTRING4_LOW_LEVEL( 
+                "Video: %S / %S / %d",
+                &media->ValueText( KMPXMediaGeneralUri ),
+                &media->ValueText( KMPXMediaGeneralTitle ),
+                ( media->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId ) ).iId1 ); 
+            }
+        }
+    IPTVLOGSTRING_LOW_LEVEL( 
+        "MPX My Videos UI # --------------------------------------------------------" );
+    }
+#endif // _DEBUG && IPTV_LOGGING_METHOD
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/src/vcxhgmyvideosdownloadclient.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,182 @@
+/*
+* 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:   CVcxHgMyVideosDownloadClient implementation*
+*/
+
+
+
+
+// INCLUDE FILES
+#include <bldvariant.hrh>
+#include <mpxcollectionutility.h>
+#include <mpxcommandgeneraldefs.h>
+#include <mpxcollectioncommanddefs.h>
+#include <vcxmyvideosuids.h>
+#include <mpxmediageneraldefs.h>
+#include <vcxmyvideosdefs.h>
+#include <vcxhgmyvideos.rsg>
+#include <StringLoader.h>
+#include <aknnotewrappers.h> 
+
+#include "IptvDebug.h"
+#include "vcxhgmyvideosdownloadclient.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosDownloadClient::CVcxHgMyVideosDownloadClient()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosDownloadClient::CVcxHgMyVideosDownloadClient( 
+        CVcxHgMyVideosCollectionClient& aCollectionClient,
+        MMPXCollectionUtility& aCollectionUtility )
+  : iCollectionClient( aCollectionClient ),
+    iCollectionUtility( aCollectionUtility ),
+    iPendingCommand( EVcxHgMyVideosDownloadCommandNone )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosDownloadClient::NewL()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosDownloadClient* CVcxHgMyVideosDownloadClient::NewL(
+        CVcxHgMyVideosCollectionClient& aCollectionClient,
+        MMPXCollectionUtility& aCollectionUtility )
+    {
+    CVcxHgMyVideosDownloadClient* self = 
+    CVcxHgMyVideosDownloadClient::NewLC( aCollectionClient, aCollectionUtility );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosDownloadClient::NewLC()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosDownloadClient* CVcxHgMyVideosDownloadClient::NewLC( 
+        CVcxHgMyVideosCollectionClient& aCollectionClient,
+        MMPXCollectionUtility& aCollectionUtility )
+    {
+    CVcxHgMyVideosDownloadClient* self = 
+        new (ELeave) CVcxHgMyVideosDownloadClient( aCollectionClient, aCollectionUtility );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosDownloadClient::ConstructL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosDownloadClient::ConstructL()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosDownloadClient::~CVcxHgMyVideosDownloadClient()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosDownloadClient::~CVcxHgMyVideosDownloadClient()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosDownloadClient::HasPendingCommand()
+// -----------------------------------------------------------------------------
+//
+TBool CVcxHgMyVideosDownloadClient::HasPendingCommand()
+    {
+    return iPendingCommand != EVcxHgMyVideosDownloadCommandNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosDownloadClient::ResumeDownloadL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosDownloadClient::ResumeDownloadL( const CMPXMedia& aMpxMedia )
+    {
+    if ( ! HasPendingCommand() && ! iCollectionClient.HasPendingCommand() )
+        {    
+        CMPXCommand* cmd = CMPXCommand::NewL();
+        CleanupStack::PushL( cmd );
+    
+        CMPXMedia* media = CMPXMedia::NewL( aMpxMedia );
+        CleanupStack::PushL( media );
+        media->SetTObjectValueL( KVcxMediaMyVideosIapId, 0 );
+
+        cmd->SetTObjectValueL( KMPXCommandGeneralId, KVcxCommandIdMyVideos );
+        cmd->SetTObjectValueL( KVcxMediaMyVideosCommandId, KVcxCommandMyVideosStartDownload );
+        cmd->SetTObjectValueL( KMPXCommandGeneralDoSync, EFalse ); // asynch
+        cmd->SetTObjectValueL( KMPXCommandGeneralCollectionId,
+                               TUid::Uid( KVcxUidMyVideosMpxCollection ) );
+        cmd->SetCObjectValueL<CMPXMedia>( KMPXCommandColAddMedia, media );
+    
+        iCollectionUtility.Collection().CommandL( *cmd );
+        iPendingCommand = EVcxHgMyVideosDownloadCommandResume;
+        
+        CleanupStack::PopAndDestroy( media );
+        CleanupStack::PopAndDestroy( cmd );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosDownloadClient::CancelDownloadL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosDownloadClient::CancelDownloadL( const CMPXMedia& aMpxMedia )
+    {
+    if ( ! HasPendingCommand() && ! iCollectionClient.HasPendingCommand() )
+        {
+        CMPXCommand* cmd = CMPXCommand::NewL();
+        CleanupStack::PushL( cmd );
+
+        CMPXMedia* cancelDownloadReq = CMPXMedia::NewL( aMpxMedia );
+        CleanupStack::PushL( cancelDownloadReq );
+
+        cmd->SetTObjectValueL( KMPXCommandGeneralId, KVcxCommandIdMyVideos );
+        cmd->SetTObjectValueL( KVcxMediaMyVideosCommandId, KVcxCommandMyVideosCancelDownload ); 
+        cmd->SetTObjectValueL( KMPXCommandGeneralDoSync, EFalse ); // asynch
+        cmd->SetTObjectValueL( KMPXCommandGeneralCollectionId, 
+                               TUid::Uid( KVcxUidMyVideosMpxCollection ) );
+        cmd->SetCObjectValueL<CMPXMedia>( KMPXCommandColAddMedia, cancelDownloadReq );    
+
+        iCollectionUtility.Collection().CommandL( *cmd );
+        iPendingCommand = EVcxHgMyVideosDownloadCommandCancel;
+
+        CleanupStack::PopAndDestroy( cancelDownloadReq );
+        CleanupStack::PopAndDestroy( cmd );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosDownloadClient::CommandCompleteL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosDownloadClient::CommandCompleteL( TInt aError )
+    {
+    if ( iPendingCommand == EVcxHgMyVideosDownloadCommandCancel && aError == KErrNone )
+    	{
+    	// Display cancel confirmation note. 
+        HBufC* text = StringLoader::LoadLC( R_VCXHGMYVIDEOS_DOWNLOAD_CANCELED );
+        CAknConfirmationNote* note = new (ELeave) CAknConfirmationNote( ETrue );
+        note->ExecuteLD( *text );
+        CleanupStack::PopAndDestroy( text );  
+    	}
+    else
+    	{
+    	// Is there need to handle failed command?
+    	}
+    iPendingCommand = EVcxHgMyVideosDownloadCommandNone;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/src/vcxhgmyvideosfulldrminfo.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,811 @@
+/*
+* 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:   DRM related function definitions for hgmyvideos*
+*/
+
+
+
+
+// INCLUDE FILES
+#include <StringLoader.h>
+#include <DRMCommon.h>
+#include <DRMHelper.h>
+
+#include "IptvDebug.h"
+#include <vcxhgmyvideos.rsg>
+#include "vcxhgmyvideosfulldrminfo.h"
+
+// CONSTANTS
+_LIT( KVcxHgExtensionWmWithDot,".wm" );
+_LIT( KVcxHgExtensionWmvWithDot,".wmv" );
+_LIT( KVcxHgExtensionAsfWithDot,".asf" );
+_LIT( KVcxHgSeparator, ": " ); // IPTV: Changed from "\t" to ": "
+_LIT( KVcxHgDateFormat1, "%1" );
+_LIT( KVcxHgDateFormat2, "%2" );
+_LIT( KVcxHgDateFormat3, "%3" );
+_LIT( KVcxHgTimeFormatBefore, " %-B %J:%T" );
+_LIT( KVcxHgTimeFormatAfter, " %J:%T %+B" );
+_LIT( KVcxHgEmptyChar, " " );
+const TUint KVcxHgSecondSeparator = 1;
+const TUint KVcxHgThirdSeparator  = 2;
+
+// ============================ LOCAL FUNCTIONS ===============================
+
+namespace // unnamed namespace for local definitions
+    {
+    // ------------------------------------------------------------------------
+    // AppendLabelAndDataToArrayL
+    // ------------------------------------------------------------------------
+    //
+    void AppendLabelAndDataToArrayL( CDesCArray& aArray,
+                                     const TDesC& aLabel,
+                                     const TDesC& aData )
+        {
+        HBufC* dataStr = HBufC::NewLC( aLabel.Length() +
+                                       KVcxHgSeparator().Length() +
+                                       aData.Length() );
+
+        TPtr dataPtr( dataStr->Des() );
+        dataPtr.Append( aLabel );
+        dataPtr.Append( KVcxHgSeparator );
+        dataPtr.Append( aData );
+        aArray.AppendL( dataPtr );
+
+        IPTVLOGSTRING2_LOW_LEVEL("Video Storage UI ## CVcxHgMyVideosFullDrmInfo/AppendLabelAndDataToArrayL - %S", dataStr);
+
+        CleanupStack::PopAndDestroy( dataStr );
+        }
+
+    // ------------------------------------------------------------------------
+    // DateTimeStringLC
+    // ------------------------------------------------------------------------
+    //
+    HBufC* DateTimeStringLC( const TTime& aTime )
+        {
+        TBuf<20> dateStr;
+        TBuf<20> timeStr;
+        TBuf<20> dateStrFormat;
+
+        // Localized date separator form
+        TLocale local;
+        dateStrFormat.Append( KVcxHgDateFormat1 );
+        dateStrFormat.Append( local.DateSeparator( KVcxHgSecondSeparator ) );
+        dateStrFormat.Append( KVcxHgDateFormat2 );
+        dateStrFormat.Append( local.DateSeparator( KVcxHgThirdSeparator ) );
+        dateStrFormat.Append( KVcxHgDateFormat3 );
+        aTime.FormatL( dateStr, dateStrFormat );
+
+        if ( local.AmPmSymbolPosition() == ELocaleBefore )
+            {
+            aTime.FormatL( timeStr, KVcxHgTimeFormatBefore );
+            }
+        else
+            {
+            aTime.FormatL( timeStr, KVcxHgTimeFormatAfter );
+            }
+
+        HBufC* buf = HBufC::NewLC( dateStr.Length() +
+                                   KVcxHgEmptyChar().Length() +
+                                   timeStr.Length() );
+        TPtr ptrBuffer( buf->Des() );
+        ptrBuffer.Append( dateStr );
+        ptrBuffer.Append( KVcxHgEmptyChar );
+        ptrBuffer.Append( timeStr );
+
+        return buf;
+        }
+
+    // ------------------------------------------------------------------------
+    // DateTimeL
+    // ------------------------------------------------------------------------
+    //
+    void DateTimeL( CDesCArray& aArray,
+                    const TTime& aTime,
+                    TInt aResourceId,
+                    const TDesC& aType )
+        {
+        HBufC* label = StringLoader::LoadLC( aResourceId, aType );
+        HBufC* dateTime = DateTimeStringLC( aTime );
+
+        AppendLabelAndDataToArrayL( aArray, *label, *dateTime );
+
+        CleanupStack::PopAndDestroy( dateTime );
+        CleanupStack::PopAndDestroy( label );
+        }
+
+    // ------------------------------------------------------------------------
+    // FillCounterInfoL
+    // ------------------------------------------------------------------------
+    //
+    void FillCounterInfoL( CDesCArray& aArray,
+                           CDRMHelperRightsConstraints& aRights,
+                           const TDesC& aType )
+        {
+        TUint32 count( 0 );
+        TUint32 timedCount( 0 );
+        TUint32 ignore1( 0 );
+        TUint32 ignore2( 0 );
+        TTimeIntervalSeconds ignore3( 0 );
+        TInt err( KErrNone );
+
+        TRAPD( errCount, aRights.GetCountersL( count, ignore1 ) );
+        TRAPD( errTimedCount, aRights.GetTimedCountL( timedCount, ignore2,
+            ignore3 ) );
+
+        if ( errCount == KErrNone && errTimedCount == KErrNone )
+            {
+            // Both counts present, use minimum
+            count = Min( count, timedCount );
+            err = KErrNone;
+            }
+        else if ( errCount == KErrNone )
+            {
+            // Use count
+            err = KErrNone;
+            }
+        else if ( errTimedCount == KErrNone )
+            {
+            // Use timed count
+            count = timedCount;
+            err = KErrNone;
+            }
+        else
+            {
+            // Neither regular nor timed count constraint
+            // present, return error
+            err = KErrNotFound;
+            }
+
+        if ( err == KErrNone )
+            {
+            // "Times left (%U)"
+            HBufC* label =
+                    StringLoader::LoadLC( R_VCXHGMYVIDEOS_DRM_MGR_DET_UTL_X, aType );
+
+            HBufC* data = NULL;
+
+            if ( count == 1 )
+                {
+                // "1 count"
+                data = StringLoader::LoadLC( R_VCXHGMYVIDEOS_DRM_MGR_DET_1_COUNT );
+                }
+            else
+                {
+                // "%N counts"
+                data = StringLoader::LoadLC( R_VCXHGMYVIDEOS_DRM_MGR_DET_N_COUNTS, count );
+                }
+
+            AppendLabelAndDataToArrayL( aArray, *label, *data );
+
+            CleanupStack::PopAndDestroy( data );
+            CleanupStack::PopAndDestroy( label );
+            }
+        }
+
+    // ---------------------------------------------------------
+    // SplitTime
+    // ---------------------------------------------------------
+    //
+    void SplitTime( const TTimeIntervalSeconds& aInterval,
+            TInt& aIntYrs, TInt& aIntMon, TInt& aIntDay,
+            TInt& aIntHrs, TInt& aIntMin, TInt& aIntSec )
+        {
+        TInt temp( 0 );
+        TInt i( 0 );
+        const TInt secsInMin( 60 );
+        const TInt secsInHour( secsInMin * 60 );
+        const TInt secsInDay( secsInHour * 24 );
+
+        // includes leap year day
+        const TInt maxDaysInMonths[12] = {  31,  62,  92, 123, 153, 184, 
+                                            215, 245, 276, 306, 337, 366 };
+
+        // calculate full days
+        temp = aInterval.Int() / secsInDay;
+
+        // calculate full years, calculate without leap year for user to get the 
+        // longest time possible
+        aIntYrs = temp / ( maxDaysInMonths[11] - 1 );
+
+        // calc remainder days
+        temp = temp % ( maxDaysInMonths[11] - 1 );
+
+        aIntMon = 0;
+
+        i = 0;
+        if ( temp >= maxDaysInMonths[0] )
+            {
+            for ( i = 0; i < 11; i++ )
+                {
+                // found correct amount of months
+                if ( temp >= maxDaysInMonths[i] && temp < maxDaysInMonths[i+1] )
+                    {
+                    // i now contains amount of full months (+1 because of table index)
+                    aIntMon = i + 1;
+                    break;
+                    }
+                }
+            }
+
+        // calc remainder days = allSecs - secsInFullYears - secsInFullMonts
+        if( temp >= maxDaysInMonths[i] )
+            {
+            aIntDay = temp - maxDaysInMonths[i];
+            }
+        else
+            {
+            aIntDay = temp;
+            }
+
+        // calculate remainder secs
+        temp = aInterval.Int() % secsInDay;
+
+        aIntHrs = temp / secsInHour;
+
+        // calculate remainder secs
+        temp = temp % secsInHour;
+
+        aIntMin = temp / secsInMin;
+
+        // calculate remainder secs
+        aIntSec = temp % secsInMin;
+        }
+
+    // ---------------------------------------------------------
+    // AddSinglePartOfTimeL
+    // ---------------------------------------------------------
+    //
+    void AddSinglePartOfTimeL( TInt aNumOfElements,
+            TInt aResourceIdSingle,
+            TInt aResourceIdOneFinal, 
+            TInt aResourceIdTwoFour,
+            TInt aResourceIdFiveZero, 
+            CDesCArrayFlat* aStrings )
+        {
+        HBufC* stringHolder = NULL;
+        TInt finalOneDigit( aNumOfElements % 10 );
+        TInt finalTwoDigits( aNumOfElements % 100 );
+
+        if ( aNumOfElements == 1 )
+            {
+            stringHolder = StringLoader::LoadLC( aResourceIdSingle );
+            }
+        else if ( finalOneDigit == 1 && finalTwoDigits != 11 )
+            {
+            stringHolder = StringLoader::LoadLC( aResourceIdOneFinal, 
+                aNumOfElements );
+            }
+        else if ( finalOneDigit == 0 || 
+                 ( finalOneDigit >= 5 && finalOneDigit <= 9 ) ||
+                 ( finalTwoDigits >= 11 && finalTwoDigits <= 14 ) )
+            {
+            stringHolder = StringLoader::LoadLC( aResourceIdFiveZero,
+                aNumOfElements );
+            }
+        else
+            {
+            stringHolder = StringLoader::LoadLC( aResourceIdTwoFour,
+                aNumOfElements );
+            }
+
+        if ( aStrings )
+            {
+            aStrings->AppendL( *stringHolder );
+            }
+
+        CleanupStack::PopAndDestroy ( stringHolder );
+        }
+
+    // ---------------------------------------------------------
+    // AddPartsOfTimeLC
+    // ---------------------------------------------------------
+    //
+    HBufC* AddPartsOfTimeLC( TInt aIntYrs, TInt aIntMon, TInt aIntDay, 
+                             TInt aIntHrs, TInt aIntMin, TInt aIntSec )
+        {
+        // Only the two most meaningful data will be showed
+        TInt numOfData( 0 );
+
+        CDesCArrayFlat* strings = new ( ELeave ) CDesCArrayFlat( 2 );
+        CleanupStack::PushL( strings );
+
+        if ( aIntYrs > 0 )
+            {
+            AddSinglePartOfTimeL( aIntYrs, 
+                R_VCXHGMYVIDEOS_DRM_NBR_OF_YEARS_ONE,
+                R_VCXHGMYVIDEOS_DRM_NBR_OF_YEARS_ONE_FINAL,
+                R_VCXHGMYVIDEOS_DRM_NBR_OF_YEARS_TWO_FOUR,
+                R_VCXHGMYVIDEOS_DRM_NBR_OF_YEARS_FIVE_ZERO,
+                strings );
+            numOfData++;
+            }
+
+        if ( aIntMon > 0 )
+            {
+            //  Second type not provided because 11 is the maximum!
+            AddSinglePartOfTimeL( aIntMon, 
+                R_VCXHGMYVIDEOS_DRM_NBR_OF_MONTHS_ONE,
+                0,       
+                R_VCXHGMYVIDEOS_DRM_NBR_OF_MONTHS_TWO_FOUR, 
+                R_VCXHGMYVIDEOS_DRM_NBR_OF_MONTHS_FIVE_ZERO, 
+                strings );
+            numOfData++;
+            }
+
+        // Only if years or months were missing!
+        if ( aIntDay > 0 && numOfData < 2 )
+            {
+            AddSinglePartOfTimeL( aIntDay, 
+                R_VCXHGMYVIDEOS_DRM_NBR_OF_DAYS_ONE,
+                R_VCXHGMYVIDEOS_DRM_NBR_OF_DAYS_ONE_FINAL,
+                R_VCXHGMYVIDEOS_DRM_NBR_OF_DAYS_TWO_FOUR, 
+                R_VCXHGMYVIDEOS_DRM_NBR_OF_DAYS_FIVE_ZERO, 
+                strings );
+            numOfData++;
+            }
+
+        if ( aIntHrs > 0 && numOfData < 2 )
+            {
+            AddSinglePartOfTimeL( aIntHrs, 
+                R_VCXHGMYVIDEOS_DRM_NBR_OF_HOURS_ONE, 
+                R_VCXHGMYVIDEOS_DRM_NBR_OF_HOURS_ONE_FINAL,
+                R_VCXHGMYVIDEOS_DRM_NBR_OF_HOURS_TWO_FOUR, 
+                R_VCXHGMYVIDEOS_DRM_NBR_OF_HOURS_FIVE_ZERO, 
+                strings );
+            numOfData++;
+            }
+
+        if ( aIntMin > 0 && numOfData < 2 )
+            {
+            AddSinglePartOfTimeL( aIntMin, 
+                R_VCXHGMYVIDEOS_DRM_NBR_OF_MINS_ONE,
+                R_VCXHGMYVIDEOS_DRM_NBR_OF_MINS_ONE_FINAL,
+                R_VCXHGMYVIDEOS_DRM_NBR_OF_MINS_TWO_FOUR, 
+                R_VCXHGMYVIDEOS_DRM_NBR_OF_MINS_FIVE_ZERO, 
+                strings );
+            numOfData++;
+            }
+
+        // If interval is 0, then it shows "0 seconds" anyway
+        if ( ( aIntSec > 0 && numOfData < 2 ) || numOfData == 0 )
+            {
+            AddSinglePartOfTimeL( aIntSec, 
+                R_VCXHGMYVIDEOS_DRM_NBR_OF_SECS_ONE, 
+                R_VCXHGMYVIDEOS_DRM_NBR_OF_SECS_ONE_FINAL,
+                R_VCXHGMYVIDEOS_DRM_NBR_OF_SECS_TWO_FOUR, 
+                R_VCXHGMYVIDEOS_DRM_NBR_OF_SECS_FIVE_ZERO, 
+                strings );
+            numOfData++;
+            }
+
+        HBufC* stringHolder = NULL;
+        if ( numOfData == 1 )
+            {
+            stringHolder = StringLoader::LoadL( R_VCXHGMYVIDEOS_DRM_MGR_DET_INTER,
+                strings->MdcaPoint(0) );
+            }
+        else
+            {
+            stringHolder = StringLoader::LoadL( R_VCXHGMYVIDEOS_DRM_MGR_DET_INTER_TWO,
+                *strings );
+            }
+
+        CleanupStack::PopAndDestroy( strings );
+        
+        CleanupStack::PushL( stringHolder );
+    
+        return stringHolder;
+        }
+
+    // ------------------------------------------------------------------------
+    // FillUsageTimeLeftInfoL
+    // ------------------------------------------------------------------------
+    //
+    void FillUsageTimeLeftInfoL( CDesCArray& aArray,
+                                 const TTimeIntervalSeconds& aInterval,
+                                 const TDesC& aType,
+                                 TBool aIsAccumulatedTime )
+        {
+        TInt years( 0 );
+        TInt months( 0 );
+        TInt days( 0 );
+        TInt hours( 0 );
+        TInt minutes( 0 );
+        TInt seconds( 0 );
+        HBufC* label = NULL;
+        HBufC* data = NULL;
+
+        if ( aIsAccumulatedTime )
+            {
+            // "Usage time left"
+            label = StringLoader::LoadLC( R_VCXHGMYVIDEOS_DRM_MGR_DET_ACCUM_TIME_LEFT  );
+            }
+        else
+            {
+            // "Time left (%U)"
+            label = StringLoader::LoadLC( R_VCXHGMYVIDEOS_DRM_MGR_DET_UDL_X, aType );
+            }
+
+        SplitTime( aInterval, years, months, days, hours, minutes, seconds );
+        data = AddPartsOfTimeLC( years, months, days, hours, minutes, seconds );
+
+        AppendLabelAndDataToArrayL( aArray, *label, *data );
+
+        CleanupStack::PopAndDestroy( data );
+        CleanupStack::PopAndDestroy( label );
+        }
+
+    // ------------------------------------------------------------------------
+    // FillIntervalInfoL
+    // ------------------------------------------------------------------------
+    //
+    void FillIntervalInfoL( CDesCArray& aArray,
+                            CDRMHelperRightsConstraints& aRights,
+                            const TDesC& aType,
+                            TTime& aStartTime,
+                            TTime& aEndTime )
+        {
+        TTimeIntervalSeconds intervalSeconds( 0 );
+
+        TRAPD( err, aRights.GetIntervalL( intervalSeconds ) );
+
+        if ( err != KErrNotFound && err != KErrNone )
+            {
+            User::Leave( err );
+            }
+
+        if ( err == KErrNone )
+            {
+            TTime intervalStartTime( 0 );
+
+            TRAP( err, aRights.GetIntervalStartL( intervalStartTime ) );
+
+            if ( ( err != KErrNotFound ) && ( err != KErrNone ) )
+                {
+                User::Leave( err );
+                }
+
+            if ( err == KErrNotFound )
+                {
+                // "Times status (%U)"
+                HBufC* label =
+                    StringLoader::LoadLC( R_VCXHGMYVIDEOS_DRM_MGR_DET_UTS_X, aType );
+
+                // "Not activated"
+                HBufC* data = StringLoader::LoadLC( R_VCXHGMYVIDEOS_DRM_MGR_DET_NOT_ACT );
+
+                AppendLabelAndDataToArrayL( aArray, *label, *data );
+
+                CleanupStack::PopAndDestroy( data );
+                CleanupStack::PopAndDestroy( label );
+
+                // "Time left (%U)"
+                FillUsageTimeLeftInfoL( aArray, intervalSeconds, aType, EFalse );
+                }
+            else
+                {
+                TTime endTime( intervalStartTime );
+                endTime += intervalSeconds;
+
+                // "Valid from (%U)"
+                DateTimeL( aArray, intervalStartTime,
+                                            R_VCXHGMYVIDEOS_DRM_MGR_DET_RVF_X, aType );
+
+                // "Valid until (%U)"
+                DateTimeL( aArray, endTime, R_VCXHGMYVIDEOS_DRM_MGR_DET_RVT_X, aType );
+                
+                // IPTV: Caller will need the start and end time for activated interval.
+                aStartTime = intervalStartTime;
+                aEndTime   = endTime;                
+                }
+            }
+        }
+
+    // ------------------------------------------------------------------------
+    // FillTimeInfoL
+    // ------------------------------------------------------------------------
+    //
+    void FillTimeInfoL( CDesCArray& aArray,
+                        CDRMHelperRightsConstraints& aRights,
+                        const TDesC& aType,
+                        TTime& aStartTime,
+                        TTime& aEndTime )
+        {
+        TTime startTime;
+        TTime endTime;
+
+        TRAPD( startErr, aRights.GetStartTimeL( startTime ) );
+        if ( startErr != KErrNotFound && startErr != KErrNone )
+            {
+            User::Leave( startErr );
+            }
+        
+        TRAPD( endErr, aRights.GetEndTimeL( endTime ) );
+        if ( endErr != KErrNotFound && endErr != KErrNone )
+            {
+            User::Leave( endErr );
+            }
+            
+        // IPTV: In case we got start & end time, we need to check if they match 
+        // the start & end time of activated interval constraint (as parameter).
+        // If they match, we should not display the same information twice.            
+        if ( startErr == KErrNone && endErr == KErrNone )
+            {
+            if ( startTime == aStartTime && endTime == aEndTime )
+                {
+                IPTVLOGSTRING_LOW_LEVEL("Video Storage UI ## CVcxHgMyVideosFullDrmInfo/FillTimeInfoL - DateTime matches Interval.");
+                return;
+                }
+            }
+
+        if ( startErr == KErrNone )
+            {
+            // "Valid from (%U)"
+            DateTimeL( aArray, startTime, R_VCXHGMYVIDEOS_DRM_MGR_DET_RVF_X, aType );
+            }
+
+        if ( endErr == KErrNone )
+            {
+            // "Valid until (%U)"
+            DateTimeL( aArray, endTime, R_VCXHGMYVIDEOS_DRM_MGR_DET_RVT_X, aType );
+            }
+        }
+
+    // ------------------------------------------------------------------------
+    // FillAccumulatedTimeInfoL
+    // ------------------------------------------------------------------------
+    //
+    void FillAccumulatedTimeInfoL( CDesCArray& aArray,
+                                   CDRMHelperRightsConstraints& aRights,
+                                   const TDesC& aType )
+        {
+        TTimeIntervalSeconds accumSeconds( 0 );
+        TRAPD( err, aRights.GetAccumulatedTimeL( accumSeconds ));
+        if ( err != KErrNotFound && err != KErrNone )
+            {
+            User::Leave( err );
+            }
+        if ( err == KErrNone )
+            {
+            // "Usage time left"
+            FillUsageTimeLeftInfoL( aArray, accumSeconds, aType, ETrue );
+            }
+        }
+
+    // ------------------------------------------------------------------------
+    // FillDrmInfoL
+    // ------------------------------------------------------------------------
+    //
+    void FillDrmInfoL( CDesCArray& aArray,
+                       CDRMHelperRightsConstraints* aRights,
+                       TInt aResourceId )
+        {
+        IPTVLOGSTRING_LOW_LEVEL("Video Storage UI ## CVcxHgMyVideosFullDrmInfo::FillDrmInfoL - Enter");
+        
+        // Check if no rights at all
+        if ( !aRights )
+            {
+            IPTVLOGSTRING_LOW_LEVEL("Video Storage UI ## CVcxHgMyVideosFullDrmInfo::FillDrmInfoL - Exit1");
+            return;
+            }
+
+        // Rights type is either "Play", "Display", "Execute" or "Print"
+        HBufC* type = StringLoader::LoadLC( aResourceId );
+
+        // Check if full rights
+        if ( aRights->FullRights() )
+            {
+            // "Rights (%U)"
+            HBufC* label =
+                    StringLoader::LoadLC( R_VCXHGMYVIDEOS_DRM_MGR_DET_FULL_X, *type );
+
+            // "Unlimited"
+            HBufC* data = StringLoader::LoadLC( R_VCXHGMYVIDEOS_DRM_MGR_DET_UNLIMITED );
+
+            AppendLabelAndDataToArrayL( aArray, *label, *data );
+
+            CleanupStack::PopAndDestroy( data );
+            CleanupStack::PopAndDestroy( label );
+            CleanupStack::PopAndDestroy( type );
+            IPTVLOGSTRING_LOW_LEVEL("Video Storage UI ## CVcxHgMyVideosFullDrmInfo::FillDrmInfoL - Exit2");
+            return;                           // full rights -> return
+            }
+
+        IPTVLOGSTRING_LOW_LEVEL("Video Storage UI ## CVcxHgMyVideosFullDrmInfo::FillDrmInfoL - Fill counter info.");
+
+        // Get detailed counter constraint information
+        FillCounterInfoL( aArray, *aRights, *type );
+
+        IPTVLOGSTRING_LOW_LEVEL("Video Storage UI ## CVcxHgMyVideosFullDrmInfo::FillDrmInfoL - Fill interval info.");
+
+        // Get detailed interval constraint information (start time + duration)
+        // IPTV: Get start and end time of activated interval.
+        TTime startTime( (TInt64) 0 );
+        TTime endTime( (TInt64) 0 );
+        FillIntervalInfoL( aArray, *aRights, *type, startTime, endTime );
+
+        IPTVLOGSTRING_LOW_LEVEL("Video Storage UI ## CVcxHgMyVideosFullDrmInfo::FillDrmInfoL - Fill time info.");
+
+        // Get detailed time constraint information (start time + end time)
+        // IPTV: Pass the start and end time of activated interval to algorithm.
+        FillTimeInfoL( aArray, *aRights, *type, startTime, endTime );
+
+        IPTVLOGSTRING_LOW_LEVEL("Video Storage UI ## CVcxHgMyVideosFullDrmInfo::FillDrmInfoL - Fill accumulated time info.");
+
+        // Get detailed accumulated time constraint information (duration)
+        FillAccumulatedTimeInfoL( aArray, *aRights, *type );
+
+        CleanupStack::PopAndDestroy( type );
+        
+        IPTVLOGSTRING_LOW_LEVEL("Video Storage UI ## CVcxHgMyVideosFullDrmInfo::FillDrmInfoL - Exit3");
+        }
+        
+    // -----------------------------------------------------------------------------
+    // ResetAndDestroy
+    // -----------------------------------------------------------------------------
+    //
+    void ResetAndDestroy( TAny* aItem )
+        {
+        static_cast< RPointerArray<CDRMHelperRightsConstraints>* >( aItem )->ResetAndDestroy();
+        }
+
+    } // namespace
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// TVcxHgMyVideosFullDrmInfo::TVcxHgMyVideosFullDrmInfo()
+// -----------------------------------------------------------------------------
+//
+TVcxHgMyVideosFullDrmInfo::TVcxHgMyVideosFullDrmInfo()
+    {
+    }
+    
+// -----------------------------------------------------------------------------
+// TVcxHgMyVideosFullDrmInfo::~TVcxHgMyVideosFullDrmInfo()
+// -----------------------------------------------------------------------------
+// 
+TVcxHgMyVideosFullDrmInfo::~TVcxHgMyVideosFullDrmInfo()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// TVcxHgMyVideosFullDrmInfo::GetFullDrmInfoL()
+// -----------------------------------------------------------------------------
+//
+void TVcxHgMyVideosFullDrmInfo::GetFullDrmInfoL( CDesCArray& aItemArray,
+                                                 const TDesC& aFileName )
+    {
+    TParsePtrC parse( aFileName );
+    TPtrC ext = parse.Ext();
+    TBool useCaf( EFalse );
+
+    if ( ext.CompareF( KVcxHgExtensionWmWithDot) == 0 || 
+         ext.CompareF( KVcxHgExtensionWmvWithDot) == 0 || 
+         ext.CompareF( KVcxHgExtensionAsfWithDot) == 0 )
+        {
+        useCaf = ETrue;
+        }
+
+    if ( useCaf )
+        {
+        ContentAccess::CData* cdata         = NULL;
+        TInt                  cafError      = KErrNone;
+        TBool                 isProtected   = EFalse;
+        TBool                 isForwardable = EFalse;
+        TBool                 canPlay       = EFalse;
+
+        cdata = CData::NewLC( (TVirtualPathPtr) aFileName, EPeek, EContentShareReadWrite );
+
+        cafError = cdata->GetAttribute( ContentAccess::EIsProtected, isProtected );
+
+        if ( cafError == KErrNone && isProtected )
+            {
+            cafError = cdata->GetAttribute( ContentAccess::ECanPlay, canPlay );
+
+            HBufC* statusLabel = StringLoader::LoadLC( R_VCXHGMYVIDEOS_DRM_MGR_DET_STAT );
+            HBufC* statusData  = NULL;
+            if ( cafError == KErrNone && canPlay )
+                {
+                statusData = StringLoader::LoadLC( R_VCXHGMYVIDEOS_WMDRM_VALID );
+                }
+            else
+                {
+                statusData = StringLoader::LoadLC( R_VCXHGMYVIDEOS_WMDRM_INVALID );
+                }
+            AppendLabelAndDataToArrayL( aItemArray, *statusLabel, *statusData );
+            CleanupStack::PopAndDestroy( statusData );
+            CleanupStack::PopAndDestroy( statusLabel );
+
+            cafError = cdata->GetAttribute( ContentAccess::EIsForwardable, isForwardable );
+
+            if ( cafError == KErrNone && isForwardable )
+                {
+                HBufC* sendingLabel = StringLoader::LoadLC( R_VCXHGMYVIDEOS_DRM_MGR_DET_CS );
+                HBufC* sendingData  = StringLoader::LoadLC( R_VCXHGMYVIDEOS_DRM_MGR_DET_ALLOWED );
+                AppendLabelAndDataToArrayL( aItemArray, *sendingLabel, *sendingData );
+                CleanupStack::PopAndDestroy( sendingData );
+                CleanupStack::PopAndDestroy( sendingLabel );                
+                }
+            }
+            
+        CleanupStack::PopAndDestroy( cdata );
+        }
+    else
+        {
+        TBool expired ( EFalse );
+        TBool sendingAllowed( EFalse );
+        RPointerArray<CDRMHelperRightsConstraints> tempArr;
+        TCleanupItem cleanupItem( ResetAndDestroy, &tempArr );
+        CleanupStack::PushL( cleanupItem );
+        tempArr.AppendL( NULL ); // Play
+        tempArr.AppendL( NULL ); // Display
+        tempArr.AppendL( NULL ); // Execute
+        tempArr.AppendL( NULL ); // Print
+
+        CDRMHelper* drmHelper = CDRMHelper::NewLC();
+
+        TRAPD( err, drmHelper->GetRightsDetailsL(
+                        aFileName,
+                        0, // Details for everything
+                        expired,
+                        sendingAllowed,
+                        tempArr[0],
+                        tempArr[1],
+                        tempArr[2],
+                        tempArr[3] ) );
+        CleanupStack::PopAndDestroy( drmHelper );
+
+        // Check if the rights are valid or expired
+        // Should probably be able to append this information also when the
+        // rights have expired.
+        // "Status"
+        HBufC* label = StringLoader::LoadLC( R_VCXHGMYVIDEOS_DRM_MGR_DET_STAT );
+        HBufC* data = NULL;
+        // "Valid" or "Expired"
+        TInt resId = ( expired || err == DRMCommon::ENoRights ?
+            R_VCXHGMYVIDEOS_DRM_MGR_DET_EXP : R_VCXHGMYVIDEOS_DRM_MGR_DET_VALID );
+        data = StringLoader::LoadLC( resId );
+        AppendLabelAndDataToArrayL( aItemArray, *label, *data );
+        CleanupStack::PopAndDestroy( data );
+        CleanupStack::PopAndDestroy( label );
+
+        // "Play"
+        FillDrmInfoL( aItemArray, tempArr[0], R_VCXHGMYVIDEOS_DRM_MGR_DET2_PLAY );
+
+        // "Display"
+        FillDrmInfoL( aItemArray, tempArr[1], R_VCXHGMYVIDEOS_DRM_MGR_DET2_DISPLAY );
+
+        // "Execute"
+        FillDrmInfoL( aItemArray, tempArr[2], R_VCXHGMYVIDEOS_DRM_MGR_DET2_EXECUTE );
+
+        // "Print"
+        FillDrmInfoL( aItemArray, tempArr[3], R_VCXHGMYVIDEOS_DRM_MGR_DET2_PRINT );
+
+        CleanupStack::PopAndDestroy( &tempArr );
+
+        // Check whether sending is allowed or not
+
+        // "Sending"
+        label = StringLoader::LoadLC( R_VCXHGMYVIDEOS_DRM_MGR_DET_CS );
+        data = NULL;
+        // "Allowed" or "Forbidden"
+        resId = ( sendingAllowed ? R_VCXHGMYVIDEOS_DRM_MGR_DET_ALLOWED
+                                 : R_VCXHGMYVIDEOS_DRM_MGR_DET_FORBID );
+        data = StringLoader::LoadLC( resId );
+        AppendLabelAndDataToArrayL( aItemArray, *label, *data );
+        CleanupStack::PopAndDestroy( data );
+        CleanupStack::PopAndDestroy( label );
+        }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/src/vcxhgmyvideosindicatorhelper.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,111 @@
+/*
+* 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:   TVcxHgMyVideosIndicatorHelper implementation*
+*/
+
+
+
+
+// INCLUDE FILES
+#include <AknsUtils.h>
+#include <AknIconUtils.h>
+#include <ganes/HgItem.h>
+#include "CIptvDriveMonitor.h"
+#include <vcxhgmyvideos.mbg>
+#include "vcxhgmyvideosmainview.h"
+#include "vcxhgmyvideosmodel.h"
+#include "vcxhgmyvideosindicatorhelper.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+TVcxHgMyVideosIndicatorHelper::TVcxHgMyVideosIndicatorHelper()
+    {
+    // No implementation needed.
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+TVcxHgMyVideosIndicatorHelper::~TVcxHgMyVideosIndicatorHelper()
+    {
+    // No implementation needed.
+    }
+
+// -----------------------------------------------------------------------------
+// Sorts indicators to correct location based on indicator priorities, caller
+// supplies all the necessary data for knowing which indicators to show. 
+// -----------------------------------------------------------------------------
+//
+void TVcxHgMyVideosIndicatorHelper::GetIndicatorsForVideoL( CVcxHgMyVideosModel& aModel,
+                                                            TBool aNewVideo,
+                                                            TBool /*aRecordingOngoing*/,
+                                                            const TDesC& aPath,
+                                                            TIndicatorDrmStatus aDrmStatus,
+                                                            TInt& aIndicator1,
+                                                            TInt& aIndicator2 )
+    {
+    RArray<TInt> indicators;
+
+    if ( aNewVideo )
+        {
+        indicators.AppendL( CHgItem::EHgItemFlagsNewVideoIndicator );
+        }
+
+    if ( aPath.Length() > 0 )
+        {
+        TInt drive = 0;
+
+        if ( aModel.FileServerSessionL().CharToDrive( aPath[0], drive ) == KErrNone )
+            {
+            if ( drive == aModel.DriveMonitorL().SystemDrive() )
+                {
+                indicators.AppendL( CHgItem::EHgItemFlagsPhoneStorageIndicator );
+                }
+            else if ( aModel.DriveMonitorL().IsMemoryCardDriveL( drive ) )
+                {
+                indicators.AppendL( CHgItem::EHgItemFlagsMmc );
+                }
+            else
+                {           
+                indicators.AppendL( CHgItem::EHgItemFlagsMassStorageIndicator );
+                }
+            }
+        }
+
+    if ( aDrmStatus == EIndicatorDrmStatusValid )
+        {
+        indicators.AppendL( CHgItem::EHgItemFlagsDrmRightsValid );
+        }
+    else if ( aDrmStatus == EIndicatorDrmStatusExpired )
+        {
+        indicators.AppendL( CHgItem::EHgItemFlagsDrmRightsExpired );
+        }
+
+    if ( indicators.Count() >= 2 )
+        {
+        aIndicator1 = indicators[1];
+        aIndicator2 = indicators[0];
+        }
+    else if ( indicators.Count() == 1 )
+        {
+        aIndicator1 = indicators[0];
+        }
+
+    indicators.Reset();
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/src/vcxhgmyvideoslistbase.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,121 @@
+/*
+* 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:      Base class for Hg based video list implementations.*
+*/
+
+
+
+
+// INCLUDE FILES
+#include <aknViewAppUi.h>
+#include <StringLoader.h>
+#include <utf.h>
+
+#include <ganes/HgScroller.h>
+
+#include <vcxhgmyvideos.rsg>
+#include "vcxhgmyvideoslistbase.h"
+#include "vcxhgmyvideosmainview.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosListBase::CVcxHgMyVideosListBase()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosListBase::CVcxHgMyVideosListBase( 
+    CVcxHgMyVideosModel& aModel,
+    CVcxHgMyVideosMainView& aView,
+    CHgScroller& aScroller )
+    : iModel( aModel ),
+      iView( aView ),
+      iScroller( &aScroller )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosListBase::ConstructL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosListBase::ConstructL()
+    {
+    iScroller->MakeVisible( EFalse );
+    iScroller->SetMopParent( &iView );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosListBase::~CVcxHgMyVideosListBase()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosListBase::~CVcxHgMyVideosListBase()
+    {
+    iView.AppUi()->RemoveFromStack( iScroller );
+    delete iScroller;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosListBase::DoListActivateL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosListBase::DoListActivateL( TInt aIndex )
+    {
+    iView.AppUi()->AddToStackL( iScroller );
+    iScroller->MakeVisible( ETrue );
+    SetEmptyListTextL();
+    SetTitleTextL( aIndex );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosListBase::DoListDeactivate() 
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosListBase::DoListDeactivate()
+    {
+    iView.AppUi()->RemoveFromStack( iScroller );
+    iScroller->MakeVisible( EFalse );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosListBase::UpdateLayout()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosListBase::UpdateLayout( TRect& aRect )
+    {
+    if ( aRect != iScroller->Rect() )
+        {
+        TRAP_IGNORE( iScroller->InitScreenL( aRect ) );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosListBase::SetEmptyListTextByResourceL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosListBase::SetEmptyListTextByResourceL( TInt aResourceId )
+    {
+    HBufC* textFromResourceFile = StringLoader::LoadLC( aResourceId );
+    iScroller->SetEmptyTextL( *textFromResourceFile );
+    CleanupStack::PopAndDestroy( textFromResourceFile );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosListBase::SetTitleTextByResourceL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosListBase::SetTitleTextByResourceL( TInt aResourceId )
+    {
+    HBufC* title = StringLoader::LoadLC( aResourceId );
+    iView.TitlePaneL()->SetTextL( *title );
+    CleanupStack::PopAndDestroy( title );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/src/vcxhgmyvideosmainview.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,888 @@
+/*
+* 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:      My Videos UI main view.*
+*/
+
+
+// Version : %version: 49 %
+
+// INCLUDE FILES
+#include <bldvariant.hrh>
+#include <aknViewAppUi.h>
+#include <avkon.hrh>
+#include <StringLoader.h>
+#include <coeaui.h>
+#include <aknnotewrappers.h>
+#include <hlplch.h>
+#include <apgcli.h>     // RApaLsSession
+#include <apacmdln.h>   // CApaCommandLine
+
+#include <AknsBasicBackgroundControlContext.h>
+#include <ganes/HgDoubleTextList.h>
+#include <ganes/HgDoubleGraphicList.h>
+
+#include "IptvDebug.h"
+#include "CIptvResourceLoader.h"
+#include <vcxhgmyvideos.rsg>
+
+#include "vcxhgmyvideosmodel.h"
+#include "vcxhgmyvideosmainview.h"
+#include "vcxhgmyvideosmainviewcontainer.h"
+#include "vcxhgmyvideoscategorylistimpl.h"
+#include "vcxhgmyvideosvideolistimpl.h"
+#include "vcxhgmyvideosvideomodelhandler.h"
+#include "vcxhgmyvideos.hrh"
+#include "vcxhgmyvideosmemorystatus.h"
+#include "vcxhgmyvideosvideodetailsdialog.h"
+#include "vcxhgmyvideosupnpinterface.h"
+
+// CONSTANTS
+_LIT( KVcxHgMyVideosMainViewResFile, "\\resource\\apps\\vcxhgmyvideos." );
+
+const TUint32 KVcxHgMyVideosViewUid = 0x20021191;
+const TUid KMediaSettingsAppUid = { 0x10005A3F };
+const TUid KBrowserAppUid       = { 0x10008D39 };
+
+const TInt KVcxHgMyVideosUrlMaxLen = 1024;
+
+_LIT( KBrowserProtocol, "4 " );
+
+// URL to Ovi Store videos. If Ovi Store Launcher is not installed, this
+// address will be opened to web browser.
+_LIT( KOviVideoStoreURL, "http://lr.ovi.mobi/store/video" );
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosMainView::CVcxHgMyVideosMainView()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosMainView::CVcxHgMyVideosMainView()
+    {
+    IPTVLOGSTRING_LOW_LEVEL( 
+        "MPX My Videos UI # ----------- MPX My Videos UI starting -----------" );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosMainView::NewL()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CVcxHgMyVideosMainView* CVcxHgMyVideosMainView::NewL()
+    {
+    CVcxHgMyVideosMainView* self = 
+        CVcxHgMyVideosMainView::NewLC();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosMainView::NewLC()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CVcxHgMyVideosMainView* CVcxHgMyVideosMainView::NewLC()
+    {
+    CVcxHgMyVideosMainView* self = 
+        new (ELeave) CVcxHgMyVideosMainView();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosMainView::ConstructL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosMainView::ConstructL()
+    {
+    IPTVLOGSTRING_LOW_LEVEL( 
+        "MPX My Videos UI # CVcxHgMyVideosMainView::ConstructL: Entered." );
+    
+    iResourceLoader = CIptvResourceLoader::NewL( *iCoeEnv );
+    iResourceLoader->AddResourceL( KVcxHgMyVideosMainViewResFile );
+
+    BaseConstructL( R_VCXHGMYVIDEOS_MAINVIEW );
+    
+    // Create component model.
+    iModel = CVcxHgMyVideosModel::NewL();
+
+    // Create background context.
+    iBgContext = CAknsBasicBackgroundControlContext::NewL( KAknsIIDQsnBgAreaMain,
+                                                           ClientRect(),
+                                                           ETrue );
+    IPTVLOGSTRING_LOW_LEVEL( 
+        "MPX My Videos UI # CVcxHgMyVideosMainView::ConstructL: Exited." );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosMainView::~CVcxHgMyVideosMainView()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CVcxHgMyVideosMainView::~CVcxHgMyVideosMainView()
+    {
+    IPTVLOGSTRING_LOW_LEVEL( 
+        "MPX My Videos UI # ----------- MPX My Videos UI stopping -----------" );
+
+    delete iCategoryList;
+    delete iVideoList;    
+    delete iModel;
+    delete iBgContext;
+    delete iResourceLoader;
+    
+    if ( iContainer )
+        {
+        AppUi()->RemoveFromStack( iContainer );
+        delete iContainer;
+        iContainer = NULL;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosMainView::CategoryListL()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosCategoryListImpl* CVcxHgMyVideosMainView::CategoryListL()
+    {
+    if ( !iCategoryList )
+        {
+        IPTVLOGSTRING_LOW_LEVEL( 
+            "MPX My Videos UI # CVcxHgMyVideosMainView::CategoryListL: Creating category list." );
+        // Create category list control.
+        CHgDoubleGraphicList* hgCategoryList = 
+            CHgDoubleGraphicList::NewL( ClientRect(), 0 );
+        CleanupStack::PushL( hgCategoryList );
+      
+        // Create list implementations. 
+        // Ownership of list control is transferred. 
+        iCategoryList = CVcxHgMyVideosCategoryListImpl::NewL( *iModel,
+                                                              *this,
+                                                              *hgCategoryList );
+        CleanupStack::Pop( hgCategoryList );
+        }
+    
+    return iCategoryList;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosMainView::VideoListL()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosVideoListImpl* CVcxHgMyVideosMainView::VideoListL()
+    {
+    if ( !iVideoList )
+        {
+        IPTVLOGSTRING_LOW_LEVEL( 
+            "MPX My Videos UI # CVcxHgMyVideosMainView::VideoListL: Creating video list." );
+        
+        // Create video list control.
+        CHgDoubleGraphicList* hgVideoList = 
+            CHgDoubleGraphicList::NewL( ClientRect(), 0 );
+        CleanupStack::PushL( hgVideoList );
+        
+        // Create list implementation. 
+        // Ownership of list control is transferred.        
+        iVideoList = CVcxHgMyVideosVideoListImpl::NewL( *iModel,
+                                                        *this,
+                                                        *hgVideoList );
+        CleanupStack::Pop( hgVideoList );
+        }
+    
+    return iVideoList;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosMainView::Cba()
+// -----------------------------------------------------------------------------
+//
+CEikButtonGroupContainer* CVcxHgMyVideosMainView::Cba()
+    {
+    return CAknView::Cba();
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosMainView::Id()
+// -----------------------------------------------------------------------------
+// 
+TUid CVcxHgMyVideosMainView::Id() const
+	{
+	return TUid::Uid( KVcxHgMyVideosViewUid ); 
+	}
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosMainView::MopSupplyObject()
+// -----------------------------------------------------------------------------
+// 
+TTypeUid::Ptr CVcxHgMyVideosMainView::MopSupplyObject( TTypeUid aId )
+    {   
+    if ( iBgContext && aId.iUid == MAknsControlContext::ETypeId )
+        {
+        return MAknsControlContext::SupplyMopObject( aId, iBgContext );
+        }  
+    return CAknView::MopSupplyObject( aId );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosMainView::HandleStatusPaneSizeChange()
+// 
+// Called by the framework when the application status pane
+// size is changed.
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosMainView::HandleStatusPaneSizeChange()
+    {
+    if ( iContainer ) // If view is active
+        {
+        UpdateLayout(); 
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosMainView::TitlePaneL()
+// -----------------------------------------------------------------------------
+// 
+CAknTitlePane* CVcxHgMyVideosMainView::TitlePaneL()
+    {
+    CAknTitlePane*  titlePane  = static_cast<CAknTitlePane*>(
+            StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
+
+    return titlePane;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosMainView::DoActivateL()
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosMainView::DoActivateL( const TVwsViewId& /*aPrevViewId*/,
+                                          TUid /*aCustomMessageId*/,
+                                          const TDesC8& /*aCustomMessage*/ )
+    {  
+    if ( ! iContainer )
+        {
+        iContainer = CVcxHgMyVideosMainViewContainer::NewL( *this );
+        AppUi()->AddToStackL( *this, iContainer );
+        }
+    
+    CVcxHgMyVideosModel::TVcxMyVideosAppState appState = iModel->AppState();
+    if ( ( appState == CVcxHgMyVideosModel::EVcxMyVideosAppStateUnknown ) ||
+         ( appState == CVcxHgMyVideosModel::EVcxMyVideosAppStateCategoryIdle ) ||
+         ( appState == CVcxHgMyVideosModel::EVcxMyVideosAppStatePlayer &&
+           iModel->PreviousAppState() == CVcxHgMyVideosModel::EVcxMyVideosAppStateCategoryIdle ) ) 
+        {
+        ActivateCategoryListL();
+        }
+    else
+        {
+        ActivateVideoListL( KErrNotFound ); // Try to activate old list. 
+        }
+    UpdateLayout();
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosMainView::DoDeactivate()
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosMainView::DoDeactivate()
+    {
+    if ( iCategoryList )
+        {
+        TRAP_IGNORE( CategoryListL()->DoListDeactivate() );
+        }
+    
+    if ( iVideoList )
+        {
+        TRAP_IGNORE( VideoListL()->DoListDeactivate() );
+        }
+
+    if ( iContainer )
+		{
+		AppUi()->RemoveFromStack( iContainer );
+		delete iContainer;
+		iContainer = NULL;
+		}
+	}
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosMainView::ActivateCategoryListL()
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosMainView::ActivateCategoryListL()
+    {
+    iModel->SetAppState( CVcxHgMyVideosModel::EVcxMyVideosAppStateCategoryBusy );
+    
+    CategoryListL()->DoListActivateL();
+    
+    if ( iVideoList )
+        {
+        VideoListL()->DoListDeactivate();
+        }
+    
+    iModel->SetAppState( CVcxHgMyVideosModel::EVcxMyVideosAppStateCategoryIdle );
+    DynInitMskL();
+    DynInitRskL();
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosMainView::ActivateVideoListL()
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosMainView::ActivateVideoListL( TInt aIndex )
+    {  
+    iModel->SetAppState( CVcxHgMyVideosModel::EVcxMyVideosAppStateVideoBusy );
+        
+    VideoListL()->DoListActivateL( aIndex );
+    
+    if ( iCategoryList )
+        {   
+        CategoryListL()->DoListDeactivate();
+        }
+    
+    iModel->SetAppState( CVcxHgMyVideosModel::EVcxMyVideosAppStateVideoIdle );
+    DynInitMskL();
+    DynInitRskL();
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosMainView::HandleCommandL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosMainView::HandleCommandL( TInt aCommand )
+    {
+    switch ( aCommand )
+        {
+        case EAknSoftkeyCancel:
+            {
+            HandleCancelL();
+            break;
+            }
+        case EVcxHgMyVideosCmdPlay:
+            {
+            VideoListL()->PlayCurrentVideoL();
+            }
+            break;
+        case EVcxHgMyVideosCmdOpen:
+        case EAknSoftkeyOpen: // MSK
+            {
+            TInt highlight = CategoryListL()->Highlight();
+            
+            if ( highlight >= 0 )
+                {
+                CategoryListL()->HandleOpenL( highlight );
+                }
+            }
+            break;
+        case EVcxHgMyVideosCmdDelete:
+            {
+            if ( iModel->AppState() == CVcxHgMyVideosModel::EVcxMyVideosAppStateVideoIdle )
+                {
+                VideoListL()->DeleteVideosL();
+                }
+            }
+            break;
+        case EVcxHgMyVideosCmdVideoDetails:
+            {
+            VideoListL()->VideoModel().ShowVideoDetailsDialogL();
+            }
+            break;
+        case EVcxHgMyVideosCmdShowViaHomenet:
+            {            
+            if ( ! VideoListL()->UPnPInterface().IsStarted() )
+                {
+                 if ( VideoListL()->UPnPInterface().Start() != KErrNone )
+                    {
+                    break;
+                    }
+                }
+            VideoListL()->PlayCurrentVideoL();
+            }
+            break;
+        case EVcxHgMyVideosCmdStopShowViaHomenet:
+            {            
+            VideoListL()->UPnPInterface().Stop();
+            }
+            break;
+        case EVcxHgMyVideosCmdMemoryStatus:
+            {
+            iMemoryStatus->ShowMemoryStatusDialogL( *iModel );
+            }
+            break;
+        case EVcxHgMyVideosCmdSortByDate:
+        case EVcxHgMyVideosCmdSortByName:
+        case EVcxHgMyVideosCmdSortBySize:
+            {
+            if ( iModel->AppState() == CVcxHgMyVideosModel::EVcxMyVideosAppStateVideoIdle )
+                {
+                VideoListL()->HandleSortCommandL( aCommand );
+                }
+            }
+            break;
+        case EVcxHgMyVideosCmdCopy:
+        case EVcxHgMyVideosCmdMove:
+            {
+            if ( iModel->AppState() == CVcxHgMyVideosModel::EVcxMyVideosAppStateVideoIdle )
+                {
+                VideoListL()->HandleMoveOrCopyCommandL( aCommand == EVcxHgMyVideosCmdCopy ?
+                                                        ETrue : EFalse );
+                }
+            }
+            break;
+        case EVcxHgMyVideosCmdSend:
+            {
+            Cba()->DrawDeferred();
+            VideoListL()->HandleSendL();
+            break;
+            }        
+        case EVcxHgMyVideosCmdMark:
+        case EVcxHgMyVideosCmdUnmark:
+        case EVcxHgMyVideosCmdMarkAll:
+        case EVcxHgMyVideosCmdUnmarkAll:
+        case EVcxHgMyVideosCmdToggleMultipleMarking:
+        case EVcxHgMyVideosCmdMarkContext:
+            {
+            VideoListL()->HandleMarkCommandL( aCommand );
+            }
+            break;
+        case EVcxHgMyVideosCmdOpenSettings:
+            {
+            // Open MediaSettings application
+            LaunchAppL( KMediaSettingsAppUid ); 
+            }
+            break;
+        case EVcxHgMyVideosCmdHelp:
+            {
+            HlpLauncher::LaunchHelpApplicationL( iEikonEnv->WsSession(),
+                                                 AppUi()->AppHelpContextL() );
+            }
+            break;
+        case EAknSoftkeySelect: // Select button / MSK.
+            {
+            if ( iModel->AppState() == CVcxHgMyVideosModel::EVcxMyVideosAppStateCategoryIdle )
+                {
+                HandleCommandL( EVcxHgMyVideosCmdOpen );
+                }
+            else if ( iModel->AppState() == CVcxHgMyVideosModel::EVcxMyVideosAppStateVideoIdle )
+                {
+                RArray<TInt> markedVideos;
+                CleanupClosePushL( markedVideos );
+                
+                VideoListL()->VideoModel().MarkedVideosL( markedVideos );
+                if ( markedVideos.Count() <= 0 )
+                    {
+                    HandleCommandL( EVcxHgMyVideosCmdPlay );
+                    }
+                CleanupStack::PopAndDestroy( &markedVideos );
+                }
+            }
+            break;
+        case EAknSoftkeyBack:
+            {
+            if ( iModel->AppState() == CVcxHgMyVideosModel::EVcxMyVideosAppStateVideoIdle )
+                {
+                VideoListL()->HandleMarkCommandL( EVcxHgMyVideosCmdUnmarkAll );
+                ActivateCategoryListL();
+                }
+            else if ( iModel->AppState() == CVcxHgMyVideosModel::EVcxMyVideosAppStateCategoryIdle )
+                {
+                AppUi()->HandleCommandL( aCommand );
+                }
+            }
+            break;
+        case EVcxHgMyVideosCmdExit:
+        case EAknSoftkeyExit:
+        case EEikCmdExit:
+        case EAknCmdExit:
+            {
+            // Pass command to app ui for handling.
+            AppUi()->HandleCommandL( EAknCmdExit );
+            }
+            break;
+        case EVcxHgMyVideosCmdNothing:
+        default:
+            {
+#ifdef RD_VIDEO_AS_RINGING_TONE            
+            // The command could be an AIW command,  offer it
+            // to AIW command handler
+            VideoListL()->TryHandleAiwCommandL( aCommand );
+#endif
+            }
+            break;
+        }
+
+    DynInitMskL();
+    DynInitRskL();
+    }
+
+// ------------------------------------------------------------------------------
+// CVcxHgMyVideosMainView::HandleKeyEventL()
+// ------------------------------------------------------------------------------
+//
+TKeyResponse CVcxHgMyVideosMainView::HandleKeyEventL( const TKeyEvent& aKeyEvent, 
+                                                      TEventCode aType )
+    {
+    TKeyResponse response( EKeyWasNotConsumed );
+    
+    // Clear and Delete keys perform 'Delete'.
+    if ( ( aKeyEvent.iScanCode == EStdKeyBackspace || 
+           aKeyEvent.iScanCode == EStdKeyDelete ) &&
+         aType == EEventKey )
+        {
+        if ( iModel->AppState() == CVcxHgMyVideosModel::EVcxMyVideosAppStateVideoIdle )
+            {
+            HandleCommandL( EVcxHgMyVideosCmdDelete );
+            
+			response = EKeyWasConsumed;
+            }
+        }
+    
+    // Enter key should work the same way as selection key.
+    else if ( ( aKeyEvent.iScanCode == EStdKeyEnter || aKeyEvent.iScanCode == EStdKeyDevice3 )
+              && aType == EEventKey )
+        {
+        HandleCommandL( EAknSoftkeySelect );
+        response = EKeyWasConsumed;
+        }
+    
+    return response;
+    }
+
+// ------------------------------------------------------------------------------
+// CVcxHgMyVideosMainView::UpdateLayout()
+// ------------------------------------------------------------------------------
+//
+void CVcxHgMyVideosMainView::UpdateLayout()
+    {
+    TRect rect( ClientRect() );
+    
+    if ( iVideoList )
+        {
+        iVideoList->UpdateLayout( rect );
+        }
+    if ( iCategoryList )
+        {
+        iCategoryList->UpdateLayout( rect );
+        }
+    if ( iBgContext )
+        {
+        iBgContext->SetRect( rect );
+        }
+    }
+	
+// ------------------------------------------------------------------------------
+// CVcxHgMyVideosMainView::DynInitMenuPaneL()
+// ------------------------------------------------------------------------------
+//
+void CVcxHgMyVideosMainView::DynInitMenuPaneL( TInt aResourceId,
+                                               CEikMenuPane* aMenuPane )
+    {
+  
+    if ( aResourceId == R_VCXHGMYVIDEOS_MAINVIEW_MENU )
+        {
+        aMenuPane->SetItemDimmed( EVcxHgMyVideosCmdDelete, ETrue );
+        aMenuPane->SetItemDimmed( EVcxHgMyVideosCmdSortSubMenu, ETrue );        
+        aMenuPane->SetItemDimmed( EVcxHgMyVideosCmdVideoDetails, ETrue );
+        aMenuPane->SetItemDimmed( EVcxHgMyVideosCmdStopShowViaHomenet, ETrue );
+        aMenuPane->SetItemDimmed( EVcxHgMyVideosCmdShowViaHomenet, ETrue );
+#ifdef RD_VIDEO_AS_RINGING_TONE
+        aMenuPane->SetItemDimmed( EVcxHgMyVideosCmdAiwAssign, ETrue );
+#endif
+        aMenuPane->SetItemDimmed( EVcxHgMyVideosCmdOpen, ETrue );
+        aMenuPane->SetItemDimmed( EVcxHgMyVideosCmdPlay, ETrue );
+        aMenuPane->SetItemDimmed( EVcxHgMyVideosCmdMemoryStatus, ETrue );
+        aMenuPane->SetItemDimmed( EVcxHgMyVideosCmdCopy, ETrue );
+        aMenuPane->SetItemDimmed( EVcxHgMyVideosCmdMove, ETrue );
+        aMenuPane->SetItemDimmed( EVcxHgMyVideosCmdMarkUnmarkSubMenu, ETrue);
+                
+        if ( iModel->AppState() == CVcxHgMyVideosModel::EVcxMyVideosAppStateCategoryIdle )
+            {                    
+            aMenuPane->SetItemDimmed( EVcxHgMyVideosCmdOpen, EFalse );    
+            aMenuPane->SetItemDimmed( EVcxHgMyVideosCmdMemoryStatus, EFalse );
+            }
+        else if ( iModel->AppState() == CVcxHgMyVideosModel::EVcxMyVideosAppStateVideoIdle )
+            {
+            aMenuPane->SetItemDimmed( EVcxHgMyVideosCmdPlay, EFalse );
+            aMenuPane->SetItemDimmed( EVcxHgMyVideosCmdMemoryStatus, EFalse );
+            aMenuPane->SetItemDimmed( EVcxHgMyVideosCmdSortSubMenu, EFalse );
+
+            // Video list handles initialisation of menu items specific to it.
+            VideoListL()->DynInitMenuPaneL( aResourceId, aMenuPane );
+            }
+        
+        aMenuPane->SetItemDimmed( EVcxHgMyVideosCmdHelp, EFalse );
+        aMenuPane->SetItemDimmed( EVcxHgMyVideosCmdExit, EFalse );
+        }
+    else if ( aResourceId == R_VCXHGMYVIDEOS_SORT_SUBMENU )
+        {
+        if ( iModel->AppState() == CVcxHgMyVideosModel::EVcxMyVideosAppStateCategoryIdle )
+            {
+            return;
+            }
+
+        switch ( iModel->VideolistSortOrderL() )
+            {
+            case EVcxMyVideosSortingCreationDate:
+                {
+                aMenuPane->SetItemButtonState( EVcxHgMyVideosCmdSortByDate,
+                                               EEikMenuItemSymbolOn );
+                break;
+                }                    
+            case EVcxMyVideosSortingName:
+                {
+                aMenuPane->SetItemButtonState( EVcxHgMyVideosCmdSortByName,
+                                               EEikMenuItemSymbolOn );
+                break;
+                }                    
+            case EVcxMyVideosSortingSize:
+                {
+                aMenuPane->SetItemButtonState( EVcxHgMyVideosCmdSortBySize,
+                                               EEikMenuItemSymbolOn );
+                break;
+                }                    
+            default:
+                {
+                break;
+                }
+            }
+        }   
+#ifdef RD_VIDEO_AS_RINGING_TONE
+    else if ( aResourceId == R_VCXHGMYVIDEOS_USE_AS_SUBMENU )
+        {
+        if ( iModel->AppState() == CVcxHgMyVideosModel::EVcxMyVideosAppStateCategoryIdle )
+            {
+            return;
+            }
+
+        // Let video list handle AIW menu
+        VideoListL()->DynInitMenuPaneL( aResourceId, aMenuPane );
+        }
+#endif
+    else if ( aResourceId == R_VCXHGMYVIDEOS_MARK_SUBMENU )
+        {
+        if ( iModel->AppState() == CVcxHgMyVideosModel::EVcxMyVideosAppStateCategoryIdle )
+            {
+            return;
+            }
+        TBool showMarkSubmenu = EFalse;
+        TBool showStartMarking = EFalse;
+        TBool showEndmarking = EFalse;
+        TBool showMarkAll = EFalse;
+        TBool showUnmarkAll = EFalse;
+
+        VideoListL()->ShowMarkMenuItemsL(
+                showMarkSubmenu,
+                showStartMarking,
+                showEndmarking,
+                showMarkAll,
+                showUnmarkAll );
+
+#ifndef RD_VIDEO_AS_RINGING_TONE
+        aMenuPane->SetItemDimmed( EVcxHgMyVideosCmdMarkContext, ! showStartMarking  );
+#endif
+        aMenuPane->SetItemDimmed( EVcxHgMyVideosCmdToggleMultipleMarking, ! showStartMarking );        
+        aMenuPane->SetItemDimmed( EVcxHgMyVideosCmdMarkAll, ! showMarkAll );
+        aMenuPane->SetItemDimmed( EVcxHgMyVideosCmdUnmarkAll, ! showUnmarkAll );
+        }
+    }
+
+// ------------------------------------------------------------------------------
+// CVcxHgMyVideosMainView::DynInitMskL()
+// ------------------------------------------------------------------------------
+//
+void CVcxHgMyVideosMainView::DynInitMskL()
+    {
+    TInt mskToSet( 0 );
+
+    if ( iModel->AppState() == CVcxHgMyVideosModel::EVcxMyVideosAppStateCategoryBusy ||
+         iModel->AppState() == CVcxHgMyVideosModel::EVcxMyVideosAppStateCategoryIdle )
+        {
+        mskToSet = R_VCXHGMYVIDEOS_MSK_OPEN;
+        }
+    else if ( iModel->AppState() == CVcxHgMyVideosModel::EVcxMyVideosAppStateVideoIdle )
+        {
+        mskToSet = VideoListL()->GetMskResourceL();
+        }
+    else
+        {
+        mskToSet = R_VCXHGMYVIDEOS_MSK_NOTHING;
+        }
+
+    if ( mskToSet != iCurrentMskResource )
+        {
+        iCurrentMskResource = mskToSet;
+
+        if ( Cba() )
+            {
+            Cba()->SetCommandL( CEikButtonGroupContainer::EMiddleSoftkeyPosition,
+                                iCurrentMskResource );
+            Cba()->DrawDeferred();
+            }
+        }
+    }
+
+// ------------------------------------------------------------------------------
+// CVcxHgMyVideosMainView::DynInitRskL()
+// ------------------------------------------------------------------------------
+//
+void CVcxHgMyVideosMainView::DynInitRskL()
+    {
+    TInt rskToSet( 0 );
+
+    if ( iVideoList && iVideoList->IsMarking() )
+        {
+        rskToSet = R_VCXHGMYVIDEOS_RSK_CANCEL;
+        }    
+    else
+        {
+        if ( iModel->AppState() == CVcxHgMyVideosModel::EVcxMyVideosAppStateCategoryIdle ||
+             iModel->AppState() == CVcxHgMyVideosModel::EVcxMyVideosAppStateCategoryBusy )
+             {
+             rskToSet = R_VCXHGMYVIDEOS_RSK_EXIT;
+             }
+         else 
+             {     
+             rskToSet = R_VCXHGMYVIDEOS_RSK_BACK;
+             }
+        }
+
+    if ( rskToSet != iCurrentRskResource )
+        {
+        iCurrentRskResource = rskToSet;
+
+        if ( Cba() )
+            {
+            Cba()->SetCommandL( CEikButtonGroupContainer::ERightSoftkeyPosition,
+                                iCurrentRskResource );
+            Cba()->DrawDeferred();
+            }
+        }
+    }
+
+// ------------------------------------------------------------------------------
+// CVcxHgMyVideosMainView::HandleCancelL()
+// ------------------------------------------------------------------------------
+//
+void CVcxHgMyVideosMainView::HandleCancelL()
+    {
+    if ( VideoListL()->IsMarking() )
+        {
+        VideoListL()->HandleMarkCommandL( EVcxHgMyVideosCmdStopMarking );
+        }    
+    }
+
+// ------------------------------------------------------------------------------
+// CVcxHgMyVideosMainView::LaunchAppL()
+// ------------------------------------------------------------------------------
+//
+void CVcxHgMyVideosMainView::LaunchAppL( const TUid aAppUid, const TDesC& aMsg )
+    {
+    RWsSession wsSession;
+    User::LeaveIfError( wsSession.Connect() );
+    CleanupClosePushL<RWsSession>( wsSession );
+    TApaTaskList taskList( wsSession );
+    TApaTask task = taskList.FindApp( aAppUid );
+    TInt msgLen = aMsg.Length();
+       
+    if ( task.Exists() )
+        {
+        if ( msgLen > 0 )
+            {
+            // Send message
+            HBufC8* param8 = HBufC8::NewLC( msgLen );
+            param8->Des().Append( aMsg );
+            task.SendMessage( TUid::Uid( 0 ), *param8 );
+            CleanupStack::PopAndDestroy( param8 );
+            }
+        else
+            {
+            task.BringToForeground();
+            }
+        }
+    else // Task didn't exist
+        {
+        RApaLsSession appArcSession;
+        User::LeaveIfError( appArcSession.Connect() );
+        CleanupClosePushL<RApaLsSession>( appArcSession );
+    
+        if ( msgLen > 0 )
+            {
+            TThreadId id;
+            appArcSession.StartDocument( aMsg, aAppUid , id ); 
+            }
+        else
+            {
+            TApaAppInfo appInfo;
+            TInt retVal = appArcSession.GetAppInfo( appInfo, aAppUid );
+            if ( retVal == KErrNone )
+                {
+                CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
+                cmdLine->SetExecutableNameL( appInfo.iFullName );
+                cmdLine->SetCommandL( EApaCommandRun );
+                User::LeaveIfError( appArcSession.StartApp( *cmdLine ) );
+                CleanupStack::PopAndDestroy( cmdLine );
+                }
+            else
+                {
+                IPTVLOGSTRING_LOW_LEVEL( 
+                        "MPX My Videos UI # CVcxHgMyVideosMainView::LaunchAppL - Application not found!" );
+                }
+            }
+        CleanupStack::PopAndDestroy(); // appArcSession
+        }
+    CleanupStack::PopAndDestroy(); // wsSession
+    }
+
+// ------------------------------------------------------------------------------
+// CVcxHgMyVideosMainView::LaunchBrowserL()
+// ------------------------------------------------------------------------------
+//
+void CVcxHgMyVideosMainView::LaunchBrowserL( const TDesC& aUrl )
+    {
+    HBufC* param = HBufC::NewLC( KVcxHgMyVideosUrlMaxLen );
+    param->Des().Copy( KBrowserProtocol() );
+    param->Des().Append( aUrl );
+    
+    LaunchAppL( KBrowserAppUid, *param );
+    
+    CleanupStack::PopAndDestroy( param );
+    }
+
+// ------------------------------------------------------------------------------
+// CVcxHgMyVideosMainView::LaunchOviStoreL()
+// ------------------------------------------------------------------------------
+//
+void CVcxHgMyVideosMainView::LaunchOviStoreL( const TUid aAppUid, const TDesC& aArgs )
+    {
+    IPTVLOGSTRING_LOW_LEVEL( "CVcxHgMyVideosMainView::LaunchOviStoreL() enter" );
+    RApaLsSession appArcSession;
+    User::LeaveIfError( appArcSession.Connect() );
+    CleanupClosePushL<RApaLsSession>( appArcSession );
+
+    TApaAppInfo appInfo;
+    TInt err = appArcSession.GetAppInfo( appInfo, aAppUid );
+    IPTVLOGSTRING2_LOW_LEVEL( "CVcxHgMyVideosMainView::LaunchOviStoreL() GetAppInfo() error = %d", err );
+
+    if ( KErrNone == err )
+        {
+        IPTVLOGSTRING3_LOW_LEVEL( "CVcxHgMyVideosMainView::LaunchOviStoreL() launch '%S' with arguments '%S'", &appInfo.iFullName, &aArgs );
+        RProcess process;
+        User::LeaveIfError( process.Create( appInfo.iFullName, aArgs ) );
+        process.Resume();
+        process.Close();
+        }
+    else
+        {
+        // Launcher not found, use browser until launcher is available
+        IPTVLOGSTRING_LOW_LEVEL( "CVcxHgMyVideosMainView::LaunchOviStoreL() launcher not found, launch browser" );
+        LaunchBrowserL( KOviVideoStoreURL );
+        }
+
+    CleanupStack::PopAndDestroy( &appArcSession );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/src/vcxhgmyvideosmainviewcontainer.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,111 @@
+/*
+* 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:      My Videos UI main view container.*
+*/
+
+
+
+
+// INCLUDE FILES
+#include <vcxhgmyvideos.rsg>
+#include "vcxhgmyvideosmainview.h"
+#include "vcxhgmyvideosmainviewcontainer.h"
+#include "vcxhgmyvideos.hrh"
+#include <csxhelp/iptv.hlp.hrh>
+
+const TUid KUidIptvMainApp = { 0x102750E2 };
+
+// =========================== MEMBER FUNCTIONS ===============================
+
+// ----------------------------------------------------------------------------
+// CVcxHgMyVideosMainViewContainer::CVcxHgMyVideosMainViewContainer()
+// ----------------------------------------------------------------------------
+// 
+CVcxHgMyVideosMainViewContainer::CVcxHgMyVideosMainViewContainer(
+    CVcxHgMyVideosMainView& aParentView )
+    : iParentView( aParentView )
+	{
+	}
+  
+// ----------------------------------------------------------------------------
+// CVcxHgMyVideosMainViewContainer::NewL()
+// ----------------------------------------------------------------------------
+//
+CVcxHgMyVideosMainViewContainer* CVcxHgMyVideosMainViewContainer::NewL(
+    CVcxHgMyVideosMainView& aParentView )
+	{
+    CVcxHgMyVideosMainViewContainer* self = NewLC( aParentView );
+    CleanupStack::Pop( self );
+    return self;
+	}
+
+// ----------------------------------------------------------------------------
+// CVcxHgMyVideosMainViewContainer::NewLC()
+// ----------------------------------------------------------------------------
+// 
+CVcxHgMyVideosMainViewContainer* CVcxHgMyVideosMainViewContainer::NewLC(
+    CVcxHgMyVideosMainView& aParentView )
+	{
+    CVcxHgMyVideosMainViewContainer* self = 
+        new (ELeave) CVcxHgMyVideosMainViewContainer( aParentView );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+	}
+
+// ----------------------------------------------------------------------------
+// CVcxHgMyVideosMainViewContainer::~CVcxHgMyVideosMainViewContainer()
+// ----------------------------------------------------------------------------
+//
+CVcxHgMyVideosMainViewContainer::~CVcxHgMyVideosMainViewContainer()
+    {
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxHgMyVideosMainViewContainer::ConstructL()
+// ----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosMainViewContainer::ConstructL()
+	{
+	CEikAppUi* appUi = static_cast<CEikAppUi*>( ControlEnv()->AppUi() );
+    SetRect( appUi->ClientRect() );
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxHgMyVideosMainViewContainer::OfferKeyEventL()
+// ----------------------------------------------------------------------------
+//
+TKeyResponse CVcxHgMyVideosMainViewContainer::OfferKeyEventL( 
+        const TKeyEvent& aKeyEvent, 
+        TEventCode aType )
+    {
+    TKeyResponse response( EKeyWasNotConsumed );
+    response = iParentView.HandleKeyEventL( aKeyEvent, aType );
+    
+    if ( response == EKeyWasNotConsumed )
+        {
+        return CCoeControl::OfferKeyEventL( aKeyEvent, aType );
+        }
+    return response;
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxHgMyVideosMainViewContainer::GetHelpContext()
+// ----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosMainViewContainer::GetHelpContext( TCoeHelpContext& aContext ) const
+    {
+    aContext.iMajor   = KUidIptvMainApp;
+    aContext.iContext = KIPTV_HLP_STORAGE;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/src/vcxhgmyvideosmemorystatus.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,175 @@
+/*
+* 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:      Common model class for component*
+*/
+
+
+
+
+// INCLUDE FILES
+#include <aknmessagequerydialog.h>
+#include <StringLoader.h>
+#include "CIptvDriveMonitor.h"
+#include <vcxhgmyvideos.rsg>
+#include "vcxhgmyvideosmodel.h"
+#include "vcxhgmyvideosmemorystatus.h"
+
+// CONSTANTS
+_LIT( KEnterString, "\n" );
+const TInt KVcxHgExtraSpace ( 20 );
+const TInt KVcxHgVideoSizeGB ( 0x40000000 );
+const TInt KVcxHgVideoSizeHalfGB ( 0x20000000 );
+const TInt KVcxHgVideoSizeMB ( 0x100000 );
+const TInt KVcxHgVideoSizeHalfMB ( 0x80000 );
+const TInt KVcxHgVideoSizeKB ( 0x400 );
+const TInt KVcxHgVideoSizeHalfKB ( 0x200 );
+const TUint64 KVcxHgFullPercentage ( 100 );
+
+// ========================== MEMBER FUNCTIONS ===============================
+
+// ---------------------------------------------------------------------------
+// TVcxHgMyVideosMemoryStatusDialog::TVcxHgMyVideosMemoryStatusDialog()
+// ---------------------------------------------------------------------------
+//
+TVcxHgMyVideosMemoryStatusDialog::TVcxHgMyVideosMemoryStatusDialog()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// TVcxHgMyVideosMemoryStatusDialog::ShowMemoryStatusDialogL()
+// ---------------------------------------------------------------------------
+//
+void TVcxHgMyVideosMemoryStatusDialog::ShowMemoryStatusDialogL( CVcxHgMyVideosModel& aModel )
+    {
+    HBufC* strFreeMemory = NULL;
+    HBufC* strUsedMemory = NULL;
+    TUint64 dispSize = 0;
+    TUint64 driveTotalSize = 0;
+    TUint64 driveFreeSize = 0;
+    TUint64 driveUsedSize = 0;
+    TInt freePercentage = 0;
+    TInt usedPercentage = 0;
+    TVolumeInfo volumeInfo;
+
+    for ( TInt i = 0; i < aModel.DriveMonitorL().iAvailableDrives.Count(); i++ )
+            {
+            if ( aModel.FileServerSessionL().Volume( 
+                     volumeInfo, aModel.DriveMonitorL().iAvailableDrives[i].iDrive )
+                 == KErrNone )
+                {
+                driveFreeSize += volumeInfo.iFree;
+                driveTotalSize += volumeInfo.iSize;
+                }
+            }
+
+    if ( !driveTotalSize )
+        {
+        freePercentage = 0;
+        }
+    else
+        {
+        freePercentage = driveFreeSize * KVcxHgFullPercentage / driveTotalSize;
+        }
+    
+    usedPercentage = KVcxHgFullPercentage - freePercentage;
+    driveUsedSize = driveTotalSize - driveFreeSize;
+
+    HBufC* strFreePercentage = StringLoader::LoadLC( R_VCXHGMYVIDEOS_MEMORY_PERCENTAGE,
+                                   ( freePercentage ) );
+    HBufC* strUsedPercentage = StringLoader::LoadLC( R_VCXHGMYVIDEOS_MEMORY_PERCENTAGE, 
+                                   ( usedPercentage ) );
+
+    HBufC* FreeMemoryTitle = StringLoader::LoadLC( R_VCXHGMYVIDEOS_FREE_MEMORY );    
+    
+    if ( driveFreeSize >= KVcxHgVideoSizeGB )
+        {
+        dispSize = driveFreeSize + KVcxHgVideoSizeHalfGB;
+        dispSize /= KVcxHgVideoSizeGB;
+        strFreeMemory = StringLoader::LoadLC( R_VCXHGMYVIDEOS_SIZE_GB_SHORT,
+                                                    static_cast<TUint32>( dispSize ) );        
+        }
+    
+    else if ( driveFreeSize >= KVcxHgVideoSizeMB )
+        {
+        dispSize = driveFreeSize + KVcxHgVideoSizeHalfMB;
+        dispSize /= KVcxHgVideoSizeMB;
+        strFreeMemory = StringLoader::LoadLC( R_VCXHGMYVIDEOS_SIZE_MB_SHORT,
+                                                    static_cast<TUint32>( dispSize ) );        
+        }
+    
+    else
+        {
+        dispSize = driveFreeSize + KVcxHgVideoSizeHalfKB;
+        dispSize /= KVcxHgVideoSizeKB;
+        strFreeMemory = StringLoader::LoadLC( R_VCXHGMYVIDEOS_SIZE_KB_SHORT,
+                                                    static_cast<TUint32>( dispSize ) );        
+        }
+    
+    HBufC* UsedMemoryTitle = StringLoader::LoadLC( R_VCXHGMYVIDEOS_USED_MEMORY );
+
+    if ( driveUsedSize >= KVcxHgVideoSizeGB )
+        {
+        dispSize = driveUsedSize + KVcxHgVideoSizeHalfGB;
+        dispSize /= KVcxHgVideoSizeGB;
+        strUsedMemory = StringLoader::LoadLC( R_VCXHGMYVIDEOS_SIZE_GB_SHORT,
+                                                    static_cast<TUint32>( dispSize ) );        
+        }
+    
+    else if ( driveUsedSize >= KVcxHgVideoSizeMB )
+        {
+        dispSize = driveUsedSize + KVcxHgVideoSizeHalfMB;
+        dispSize /= KVcxHgVideoSizeMB;
+        strUsedMemory = StringLoader::LoadLC( R_VCXHGMYVIDEOS_SIZE_MB_SHORT,
+                                                    static_cast<TUint32>( dispSize ) );        
+        }
+    
+    else
+        {
+        dispSize = driveUsedSize + KVcxHgVideoSizeHalfKB;
+        dispSize /= KVcxHgVideoSizeKB;
+        strUsedMemory = StringLoader::LoadLC( R_VCXHGMYVIDEOS_SIZE_KB_SHORT,
+                                                    static_cast<TUint32>( dispSize ) );        
+        }    
+    
+    HBufC* context = HBufC::NewLC(FreeMemoryTitle->Length() +
+                                  strFreePercentage->Length() +
+                                  strFreeMemory->Length() +
+                                  UsedMemoryTitle->Length() +
+                                  strUsedPercentage->Length() +
+                                  strUsedMemory->Length() +
+                                  KVcxHgExtraSpace );
+    
+    context->Des().Append( *FreeMemoryTitle );
+    context->Des().Append( KEnterString );
+    context->Des().Append( *strFreePercentage);
+    context->Des().Append( KEnterString );
+    context->Des().Append( *strFreeMemory );
+    context->Des().Append( KEnterString );
+    context->Des().Append( *UsedMemoryTitle );
+    context->Des().Append( KEnterString );
+    context->Des().Append( *strUsedPercentage );
+    context->Des().Append( KEnterString );
+    context->Des().Append( *strUsedMemory );
+                               
+    CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL( *context );
+    dlg->ExecuteLD(R_VCXHGMYVIDEOS_MEMORY_STATUS_MESSAGE_QUERY);
+
+    CleanupStack::PopAndDestroy( context );
+    CleanupStack::PopAndDestroy( strUsedMemory );
+    CleanupStack::PopAndDestroy( UsedMemoryTitle );
+    CleanupStack::PopAndDestroy( strFreeMemory );
+    CleanupStack::PopAndDestroy( FreeMemoryTitle );
+    CleanupStack::PopAndDestroy( strUsedPercentage );
+    CleanupStack::PopAndDestroy( strFreePercentage );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/src/vcxhgmyvideosmodel.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,381 @@
+/*
+* 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:      Common model class for component.*
+*/
+
+
+
+
+// INCLUDE FILES
+#include <bldvariant.hrh>
+#include <AknUtils.h>
+#include <centralrepository.h>
+#include "IptvDebug.h"
+#include "vcxhgmyvideosmodel.h"
+#include "vcxhgmyvideoscollectionclient.h"
+#include "thumbnaildata.h"
+#include "vcxhgmyvideoscenrepkeys.h"
+#include "vcxhgmyvideosthumbnailmanager.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosModel::CVcxHgMyVideosModel()
+  : iAppState( EVcxMyVideosAppStateUnknown ),
+    iPreviousAppState( EVcxMyVideosAppStateUnknown ),
+    iSortOrder( EVcxMyVideosSortingNone )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosModel::NewL()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosModel* CVcxHgMyVideosModel::NewL()
+    {
+    CVcxHgMyVideosModel* self = 
+        CVcxHgMyVideosModel::NewLC();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosModel::NewLC()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosModel* CVcxHgMyVideosModel::NewLC()
+    {
+    CVcxHgMyVideosModel* self = 
+        new (ELeave) CVcxHgMyVideosModel();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosModel::ConstructL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosModel::ConstructL()
+    {
+    iCollection = CVcxHgMyVideosCollectionClient::NewL();
+    iTouchSupport = AknLayoutUtils::PenEnabled();
+    iTnManager = CVcxHgMyVideosThumbnailManager::NewL();
+    InitMyVideosCenRepL();
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosModel::~CVcxHgMyVideosModel()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosModel::~CVcxHgMyVideosModel()
+    {
+    if ( iFsSession.Handle() )
+        {
+        iFsSession.Close();
+        }
+    delete iDriveMonitor;
+    delete iCollection;
+    delete iCollectionCenRep;
+    delete iMyVideosCenRep;
+    delete iTnManager;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosModel::TouchSupport()
+// -----------------------------------------------------------------------------
+//
+TBool CVcxHgMyVideosModel::TouchSupport()
+    {
+    return iTouchSupport;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosModel::CollectionClient()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosCollectionClient& CVcxHgMyVideosModel::CollectionClient()
+    {
+    return *iCollection;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosModel::FileServerSessionL()
+// -----------------------------------------------------------------------------
+//
+RFs& CVcxHgMyVideosModel::FileServerSessionL()
+    {
+    if ( ! iFsSession.Handle() )
+        {
+        TInt err = iFsSession.Connect();
+        if ( err == KErrNone )
+            {
+            // For sending handles to thumbnailmanager
+            err = iFsSession.ShareProtected();
+            }
+        if ( err != KErrNone )
+            {
+            iFsSession.Close();
+            User::Leave( err );
+            }
+        }
+
+    return iFsSession;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosModel::DriveMonitorL()
+// -----------------------------------------------------------------------------
+//
+CIptvDriveMonitor& CVcxHgMyVideosModel::DriveMonitorL()
+    {
+    if ( ! iDriveMonitor )
+        {
+        iDriveMonitor = CIptvDriveMonitor::NewL();
+        iDriveMonitor->RegisterObserverL( this );
+        }
+
+    return *iDriveMonitor;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosModel::SetAppState()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosModel::SetAppState( 
+        CVcxHgMyVideosModel::TVcxMyVideosAppState aAppState )
+    {
+    iPreviousAppState = iAppState;
+    iAppState = aAppState;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosModel::AppState()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosModel::TVcxMyVideosAppState CVcxHgMyVideosModel::AppState()
+    {
+    return iAppState;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosModel::PreviousAppState()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosModel::TVcxMyVideosAppState CVcxHgMyVideosModel::PreviousAppState()
+    {
+    return iPreviousAppState;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosModel::SetVideolistSortOrderL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosModel::SetVideolistSortOrderL( TVcxMyVideosSortingOrder aSortOrder )
+    {
+    if ( ! iCollectionCenRep )
+        {
+        iCollectionCenRep = CRepository::NewL( TUid::Uid( KVcxMyVideosCollectionCenrepUid ) );
+        }
+
+    iCollectionCenRep->Set( KVcxMyVideosCollectionCenrepKeySortingOrder, 
+                            static_cast<TInt>( aSortOrder ) );
+    
+    iSortOrder = aSortOrder;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosModel::GetLastWatchedIdL()
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosModel::GetLastWatchedIdL( TInt& aId )
+    {
+    if ( ! iCollectionCenRep )
+        {
+        iCollectionCenRep = CRepository::NewL( TUid::Uid( KVcxMyVideosCollectionCenrepUid ) );
+        }
+
+    return iCollectionCenRep->Get( KVcxMyVideosCollectionCenrepKeyLastWatchedMpxId, aId );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosModel::GetLastWatchedNameL
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosModel::GetLastWatchedNameL( TDes& aName )
+    {
+    if ( ! iCollectionCenRep )
+        {
+        iCollectionCenRep = CRepository::NewL( TUid::Uid( KVcxMyVideosCollectionCenrepUid ) );
+        }
+
+    return iCollectionCenRep->Get( KVcxMyVideosCollectionCenrepKeyLastWatchedName, aName );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosModel::GetLastWatchedPath
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosModel::GetLastWatchedPathL( TDes& aPath )
+    {
+    if ( ! iCollectionCenRep )
+        {
+        iCollectionCenRep = CRepository::NewL( TUid::Uid( KVcxMyVideosCollectionCenrepUid ) );
+        }
+
+    return iCollectionCenRep->Get( KVcxMyVideosCollectionCenrepKeyLastWatchedPath, aPath );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosModel::GetLastWatchedPath
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosModel::GetLastWatchedIndicatorL( TInt& aValue )
+    {
+    if ( ! iCollectionCenRep )
+        {
+        iCollectionCenRep = CRepository::NewL( TUid::Uid( KVcxMyVideosCollectionCenrepUid ) );
+        }
+
+    return iCollectionCenRep->Get( KVcxMyVideosCollectionCenrepKeyLastWatchedIndicator, aValue );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosModel::VideolistSortOrderL()
+// -----------------------------------------------------------------------------
+//
+TVcxMyVideosSortingOrder CVcxHgMyVideosModel::VideolistSortOrderL()
+    {
+    if ( iSortOrder == EVcxMyVideosSortingNone )
+    	{
+        if ( ! iCollectionCenRep )
+            {
+            iCollectionCenRep = CRepository::NewL( TUid::Uid( KVcxMyVideosCollectionCenrepUid ) );
+            }
+
+        TInt value( KErrNotFound );
+
+        TInt error = iCollectionCenRep->Get( KVcxMyVideosCollectionCenrepKeySortingOrder, value );
+        iSortOrder = static_cast<TVcxMyVideosSortingOrder>( value );
+    
+        if ( ( error != KErrNone ) || 
+             ( ( iSortOrder != EVcxMyVideosSortingCreationDate ) &&
+               ( iSortOrder != EVcxMyVideosSortingName ) &&
+               ( iSortOrder != EVcxMyVideosSortingSize ) ) )
+            {
+            iSortOrder = EVcxMyVideosSortingCreationDate;
+            }
+    	}
+    return iSortOrder;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosModel::GetScreenResolution()
+//
+//       Landscape    Portrait
+// QVGA  320x240  or  240x320
+// QHD   640x360  or  360x640
+// VGA   640x480  or  480x640
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosModel::TVcxScreenResolution CVcxHgMyVideosModel::GetScreenResolution( 
+        CCoeEnv* aCoeEnv )
+    {
+    TVcxScreenResolution resolution( EVcxScreenResolutionUnknown );
+    TSize screenSize = aCoeEnv->ScreenDevice()->SizeInPixels(); 
+    TBool landscape = screenSize.iWidth > screenSize.iHeight;
+
+    if ( ( landscape && screenSize.iHeight <= 240 ) ||
+         ( ! landscape && screenSize.iWidth <= 240 ) )
+        {
+        resolution = EVcxScreenResolutionQVGA;
+        }
+    else if ( ( landscape && screenSize.iHeight <= 360 ) ||
+              ( ! landscape && screenSize.iWidth <= 360 ) )
+        {
+        resolution = EVcxScreenResolutionQHD;
+        }
+    else if ( ( landscape && screenSize.iHeight <= 480 ) ||
+              ( ! landscape && screenSize.iWidth <= 480 ) )
+        {
+        resolution = EVcxScreenResolutionVGA;
+        }
+
+    return resolution;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosModel::ThumbnailManager()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosThumbnailManager& CVcxHgMyVideosModel::ThumbnailManager() const
+    {
+    return *iTnManager;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosModel::HandleDriveMonitorEvent()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosModel::HandleDriveMonitorEvent( TIptvDriveMonitorEvent& /*aEvent*/ )
+    {
+    // We are not interested about the event, we are observing just to keep
+    // iDriveMonitor.iAvailableDrives up to date. 
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosModel::GetMyVideosCustomizationIntL()
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosModel::GetMyVideosCustomizationInt( const TInt& aKey, 
+                                                       TInt& aValue )
+    {
+    if ( iMyVideosCenRep )
+        {
+        return iMyVideosCenRep->Get( aKey, aValue );
+        }
+    return KErrNotFound;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosModel::GetMyVideosCustomizationString()
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosModel::GetMyVideosCustomizationString( const TInt& aKey, 
+                                                          TDes& aValue )
+    {
+    if ( iMyVideosCenRep )
+        {
+        return iMyVideosCenRep->Get( aKey, aValue );
+        }
+    return KErrNotFound;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosModel::InitMyVideosCenRepL()
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosModel::InitMyVideosCenRepL()
+    {
+    TInt retVal = KErrNone;
+    if ( !iMyVideosCenRep )
+        {
+        TRAPD( error, iMyVideosCenRep = CRepository::NewL( KMyVideosMainViewCenRepUid ) );
+        retVal = error;
+        }
+    return retVal;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/src/vcxhgmyvideosthumbnailmanager.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,201 @@
+/*
+* 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:      Class for sharing thumbnailmanager session
+*/
+
+
+// INCLUDE FILES
+#include <thumbnailmanager.h>
+#include <thumbnailmanagerobserver.h>
+#include "vcxhgmyvideosthumbnailmanager.h"
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosThumbnailManager::NewL()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosThumbnailManager* CVcxHgMyVideosThumbnailManager::NewL()
+    {
+    CVcxHgMyVideosThumbnailManager* self = 
+        CVcxHgMyVideosThumbnailManager::NewLC();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosThumbnailManager::NewLC()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosThumbnailManager* CVcxHgMyVideosThumbnailManager::NewLC()
+    {
+    CVcxHgMyVideosThumbnailManager* self = 
+        new (ELeave) CVcxHgMyVideosThumbnailManager();
+    CleanupStack::PushL( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosThumbnailManager::~CVcxHgMyVideosThumbnailManager()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosThumbnailManager::~CVcxHgMyVideosThumbnailManager()
+    {
+    iTnObservers.Reset(); // The pointers are not own
+    delete iTnManager;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosThumbnailManager::PeekL()
+// -----------------------------------------------------------------------------
+//
+TThumbnailRequestId CVcxHgMyVideosThumbnailManager::PeekL(
+    CThumbnailObjectSource& aSource )
+    {
+    CThumbnailManager& tnm = SessionL();
+
+    // Set 'do not create' if needed
+    if ( !( iCurrentFlags & CThumbnailManager::EDoNotCreate ) )
+        {
+        CThumbnailManager::TThumbnailFlags flags =
+            static_cast< CThumbnailManager::TThumbnailFlags >(
+                iCurrentFlags | CThumbnailManager::EDoNotCreate );
+        tnm.SetFlagsL( flags );
+        iCurrentFlags = flags;
+        }
+
+    return tnm.GetThumbnailL( aSource );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosThumbnailManager::GetL()
+// -----------------------------------------------------------------------------
+//
+TThumbnailRequestId CVcxHgMyVideosThumbnailManager::GetL(
+    CThumbnailObjectSource& aSource )
+    {
+    CThumbnailManager& tnm = SessionL();
+
+    // Remove 'do not create' if needed
+    if ( iCurrentFlags & CThumbnailManager::EDoNotCreate )
+        {
+        CThumbnailManager::TThumbnailFlags flags =
+            static_cast< CThumbnailManager::TThumbnailFlags >(
+                iCurrentFlags & (~CThumbnailManager::EDoNotCreate) );
+        tnm.SetFlagsL( flags );
+        iCurrentFlags = flags;
+        }
+
+    return tnm.GetThumbnailL( aSource );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosThumbnailManager::Cancel()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosThumbnailManager::Cancel( TThumbnailRequestId aRequestId )
+    {
+    if ( iTnManager )
+        {
+        iTnManager->CancelRequest( aRequestId );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosThumbnailManager::Reset()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosThumbnailManager::Reset( CThumbnailObjectSource& aSource )
+    {
+    if ( iTnManager )
+        {
+        iTnManager->DeleteThumbnails( aSource );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosThumbnailManager::AddObserverL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosThumbnailManager::AddObserverL(
+        MThumbnailManagerObserver& aObserver )
+    {
+    iTnObservers.InsertInAddressOrderL( &aObserver );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosThumbnailManager::RemoveObserver()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosThumbnailManager::RemoveObserver(
+        MThumbnailManagerObserver& aObserver )
+    {
+    TInt i = iTnObservers.FindInAddressOrder( &aObserver );
+    if ( i >= 0 && i < iTnObservers.Count() )
+        {
+        iTnObservers.Remove( i ); // Pointer is not own
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosThumbnailManager::ThumbnailPreviewReady()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosThumbnailManager::ThumbnailPreviewReady(
+        MThumbnailData& /*aThumbnail*/, TThumbnailRequestId /*aId*/ )
+    {
+    // No implementation required.
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosThumbnailManager::ThumbnailReady()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosThumbnailManager::ThumbnailReady( TInt aError,
+        MThumbnailData& aThumbnail, TThumbnailRequestId aId )
+    {
+    TInt count = iTnObservers.Count();
+    for( TInt i = 0; i < count; ++i )
+        {
+        iTnObservers[i]->ThumbnailReady( aError, aThumbnail, aId );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosThumbnailManager::CVcxHgMyVideosThumbnailManager()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosThumbnailManager::CVcxHgMyVideosThumbnailManager()
+    {
+    // No implementation required.
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosThumbnailManager::SessionL()
+// -----------------------------------------------------------------------------
+//
+CThumbnailManager& CVcxHgMyVideosThumbnailManager::SessionL()
+    {
+    if ( !iTnManager )
+        {
+        CThumbnailManager* tnm = CThumbnailManager::NewLC( *this );
+        tnm->SetThumbnailSizeL( EVideoListThumbnailSize );
+        tnm->SetDisplayModeL( EColor16M );
+        iCurrentFlags = tnm->Flags();
+        CleanupStack::Pop( tnm );
+        iTnManager = tnm;
+        }
+    return *iTnManager;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/src/vcxhgmyvideosupnpinterface.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,227 @@
+/*
+* 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:      CCVcxuPnPInterface class deifnition*
+*/
+
+
+
+
+// INCLUDE FILES
+#include <upnpshowcommand.h>
+#include "vcxhgmyvideosupnpinterface.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosUPnPInterface::CVcxHgMyVideosuPnPInterface()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosUPnPInterface::CVcxHgMyVideosUPnPInterface()
+    {
+    // No implementation required
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosUPnPInterface::~CVcxHgMyVideosuPnPInterface()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosUPnPInterface::~CVcxHgMyVideosUPnPInterface() 
+    {
+    Stop();
+    delete iShowCommand;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosUPnPInterface::NewLC()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosUPnPInterface* CVcxHgMyVideosUPnPInterface::NewLC( 
+        MUpnpCommandObserver* aExtObserver )
+    {
+    CVcxHgMyVideosUPnPInterface* self = new ( ELeave )CVcxHgMyVideosUPnPInterface();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    self->iExtObserver = aExtObserver;
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosUPnPInterface::NewL()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosUPnPInterface* CVcxHgMyVideosUPnPInterface::NewL( 
+        MUpnpCommandObserver* aExtObserver )
+    {
+    CVcxHgMyVideosUPnPInterface* self = CVcxHgMyVideosUPnPInterface::NewLC( aExtObserver );    
+    CleanupStack::Pop(); // self;
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosUPnPInterface::ConstructL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosUPnPInterface::ConstructL()
+    {
+    TryCreateCmd();
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosUPnPInterface::TryCreateCmd()
+// -----------------------------------------------------------------------------
+//
+TBool CVcxHgMyVideosUPnPInterface::TryCreateCmd()
+    {
+    if( !iShowCommand )
+        {
+        TRAPD( showCreate, iShowCommand = CUpnpShowCommand::NewL( this ) );
+        if( showCreate != KErrNone )
+            {    
+            iShowCommand = NULL;
+            return EFalse;
+            }
+        }
+    return ETrue;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosUPnPInterface::IsApplicable()
+// -----------------------------------------------------------------------------
+//
+TBool CVcxHgMyVideosUPnPInterface::IsApplicable() 
+    {
+
+    if( !TryCreateCmd() )
+        {
+        return EFalse;
+        }
+
+    TBool available( EFalse );
+    TRAPD(err, available = iShowCommand->IsAvailableL() );
+               
+    if( err != KErrNone || !available ) 
+        {
+        return EFalse; 
+        }
+
+    return ETrue;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosUPnPInterface::IsStarted()
+// -----------------------------------------------------------------------------
+//
+TBool CVcxHgMyVideosUPnPInterface::IsStarted() 
+    {
+
+    if( !TryCreateCmd() )
+        {
+        return EFalse;        
+        }
+    return iStarted;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosUPnPInterface::Start()
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosUPnPInterface::Start()
+    { 
+ 
+    if( !TryCreateCmd() )
+        {
+        iStarted = EFalse;
+        return KErrGeneral;
+        }
+    TRAPD(err, iShowCommand->StartShowingL() );
+    
+    if( err != KErrNone )
+        {
+        iStarted = EFalse;
+        }
+    else
+        {
+        iStarted = ETrue;
+        }
+    return err;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosUPnPInterface::ShowVideo()
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosUPnPInterface::ShowVideo( const TDesC& aVideoPath )
+    {
+    TInt err( KErrGeneral );   
+    if( iStarted && aVideoPath.Length() > 0 && TryCreateCmd() )
+        {
+        TRAP( err, iShowCommand->ShowVideoL( aVideoPath ) );
+        }  
+    return err;
+    }
+ 
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosUPnPInterface::ShowThumbnail()
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosUPnPInterface::ShowThumbnail( const TDesC& aPath )
+    {
+    TInt err( KErrGeneral );
+    if( iStarted && aPath.Length() > 0, TryCreateCmd() )
+        {
+        TRAP( err, iShowCommand->ShowImageL( aPath ) );  
+        }
+        
+    return err;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosUPnPInterface::Stop()
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosUPnPInterface::Stop()
+    {
+    TInt err( KErrNone );
+    if( iStarted )
+        {
+        if(  TryCreateCmd() )
+            {
+            TRAP( err, iShowCommand->StopShowingL( ) );
+            }
+        else
+            {
+            err = KErrGeneral;
+            }
+        iStarted = EFalse;
+        }
+    return err;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosUPnPInterface::CommandComplete()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosUPnPInterface::CommandComplete( TInt aStatusCode )
+    {
+    if( aStatusCode == KErrDisconnected )
+        {             
+        iStarted = EFalse;
+        }
+    if( iExtObserver )
+        {
+        iExtObserver->CommandComplete( aStatusCode );
+        }
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/src/vcxhgmyvideosvideocopier.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,353 @@
+/*
+* 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:      Class for handling move/copy related notes and operations.*
+*/
+
+
+
+
+// INCLUDE FILES
+#include <CAknMemorySelectionDialogMultiDrive.h>
+#include <AknWaitDialog.h>
+#include <AknCommonDialogsDynMem.h>
+#include <aknnotewrappers.h>
+#include <StringLoader.h>
+#include <vcxmyvideosdefs.h>
+#include <vcxhgmyvideos.rsg>
+#include "IptvDebug.h"
+#include "vcxhgmyvideoscollectionclient.h"
+#include "vcxhgmyvideosvideomodelhandler.h"
+#include "vcxhgmyvideosmodel.h"
+#include "vcxhgmyvideosvideocopier.h"
+#include "CIptvDriveMonitor.h"
+
+// =========================== MEMBER FUNCTIONS ==============================
+
+// ---------------------------------------------------------------------------
+// CVcxHgMyVideosVideoCopier::CVcxHgMyVideosVideoCopier()
+// ---------------------------------------------------------------------------
+//
+CVcxHgMyVideosVideoCopier::CVcxHgMyVideosVideoCopier(
+        CVcxHgMyVideosVideoListImpl& aVideoList,
+        CVcxHgMyVideosVideoModelHandler& aVideoModel,
+        CVcxHgMyVideosModel& aModel )
+ :  iVideoList( aVideoList ),
+    iVideoModel( aVideoModel ),
+    iModel( aModel )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxHgMyVideosVideoCopier::ConstructL()
+// ---------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoCopier::ConstructL()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxHgMyVideosVideoCopier::NewL()
+// ---------------------------------------------------------------------------
+//
+CVcxHgMyVideosVideoCopier* CVcxHgMyVideosVideoCopier::NewL( 
+        CVcxHgMyVideosVideoListImpl& aVideoList,
+        CVcxHgMyVideosVideoModelHandler& aVideoModel,
+        CVcxHgMyVideosModel& aModel )
+    {
+    CVcxHgMyVideosVideoCopier* self = 
+        new( ELeave ) CVcxHgMyVideosVideoCopier( aVideoList, aVideoModel, aModel );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxHgMyVideosVideoCopier::~CVcxHgMyVideosVideoCopier()
+// ---------------------------------------------------------------------------
+//
+CVcxHgMyVideosVideoCopier::~CVcxHgMyVideosVideoCopier()
+    {
+    CloseMoveCopyWaitNote();
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxHgMyVideosVideoCopier::ShowMenuItemsL()
+// ---------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoCopier::ShowMenuItemsL( 
+        const RArray<TInt>& aOperationTargets,
+        TBool& aShowMoveAndCopySubmenu,
+        TBool& aShowCopy,
+        TBool& aShowMove )
+    {
+    CIptvDriveMonitor& driveMonitor = iModel.DriveMonitorL();
+    HBufC* videoUri = NULL;
+    TInt drive( 0 );
+
+    TUint32 flags;
+
+    for ( TInt i = 0; i < aOperationTargets.Count(); i++ )
+        {
+        // When we found source file that can be moved/copied, we need
+        // to also check that there is target drive that we can use.
+        videoUri = iVideoModel.GetVideoUri( aOperationTargets[i] ).AllocLC();
+        if ( videoUri->Length() > 0 )
+            {
+            if ( iModel.FileServerSessionL().CharToDrive( videoUri->Des()[0], drive )
+                  == KErrNone )
+                {
+                for ( TInt j = 0; j < driveMonitor.iAvailableDrives.Count(); j++ )
+                    {
+                    flags = driveMonitor.iAvailableDrives[j].iFlags;
+
+                    if ( driveMonitor.iAvailableDrives[j].iDrive != drive &&
+                            !(flags & TIptvDriveInfo::ELocked) && !(flags & TIptvDriveInfo::EMediaNotPresent) )
+                        {
+                        aShowMoveAndCopySubmenu = aShowCopy = aShowMove = ETrue;
+
+                        // No need to continue, we know that menu can be shown.
+                        CleanupStack::PopAndDestroy( videoUri );
+                        return;
+                        }
+                    }
+                }
+            }
+        CleanupStack::PopAndDestroy( videoUri );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxHgMyVideosVideoCopier::MoveOrCopyL()
+// ---------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoCopier::MoveOrCopyL( 
+        const RArray<TInt>& aOperationTargets,
+        TBool aCopy )
+    {
+    TInt targetDrive( EDriveC );
+
+    if ( QueryTargetDriveL( aCopy, targetDrive ) )
+        {
+        // Wait note is closed in destructor (CloseMoveCopyWaitNote()), 
+        // in DialogDismissedL() or in VideoMoveOrCopyCompletedL().
+        OpenMoveCopyWaitNoteL( aOperationTargets, aCopy );
+
+        TRAPD( ret, iVideoModel.MoveOrCopyVideosL( aOperationTargets, targetDrive, aCopy ));
+        
+        if( ret != KErrNone )
+            {
+            CloseMoveCopyWaitNote();
+            }
+        
+        iCopy = aCopy;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxHgMyVideosVideoCopier::QueryTargetDriveL()
+// ---------------------------------------------------------------------------
+//
+TBool CVcxHgMyVideosVideoCopier::QueryTargetDriveL( TBool aCopy, TInt& aTargetDrive )
+    {
+    TCommonDialogType dialogType;
+    TBool driveSelected( EFalse );
+    TDriveNumber selectedMem( EDriveC );
+    TInt includedMedias( 0 );
+
+    if ( aCopy )
+        {
+        dialogType = ECFDDialogTypeCopy;
+        }
+    else
+        {
+        dialogType = ECFDDialogTypeMove;
+        }
+    
+    if ( iModel.DriveMonitorL().MassStorageDrive() != KErrNotFound )
+        {
+        includedMedias |= AknCommonDialogsDynMem::EMemoryTypeInternalMassStorage;
+        }
+    if ( iModel.DriveMonitorL().MemoryCardDrive() != KErrNotFound )
+        {
+        includedMedias |= AknCommonDialogsDynMem::EMemoryTypeMMCExternalInDevice;
+        }
+    if ( iModel.DriveMonitorL().FixedDrive( EFalse ) == EDriveC )
+        {
+        includedMedias |= AknCommonDialogsDynMem::EMemoryTypePhone;
+        }
+    // If CIptvDriveMonitor does not publish C-drive, it means that product
+    // has (at least) two other usable memories, and therefore there is no
+    // need to allow user to move / copy items to (small) C-drive. 
+    if ( iModel.DriveMonitorL().PhoneMemoryDrive() == KErrNotFound )
+        {
+        includedMedias &= ~AknCommonDialogsDynMem::EMemoryTypePhone;
+        }
+
+// Skip the dialog in emulator as ASSERT_DEBUG macro does not allow single memory dialog.
+#if !defined(__WINS__) && !defined(__WINSCW__)
+    CAknMemorySelectionDialogMultiDrive* dlg =
+        CAknMemorySelectionDialogMultiDrive::NewL(
+            dialogType,
+            R_VCXHGMYVIDEOS_MEMORY_SELECTION_DIALOG,
+            EFalse,
+            includedMedias );
+    CleanupStack::PushL( dlg );
+    driveSelected = dlg->ExecuteL( selectedMem );
+    CleanupStack::PopAndDestroy(); // dlg
+#else
+    driveSelected = ETrue;
+    selectedMem = EDriveE;
+#endif // !defined(__WINS__) && !defined(__WINSCW__)
+
+    if ( driveSelected )
+        {
+        aTargetDrive = static_cast<TInt>( selectedMem );
+        return ETrue;
+        }
+
+    return EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoCopier::OpenMoveCopyWaitNoteL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoCopier::OpenMoveCopyWaitNoteL( 
+    const RArray<TInt>& aOperationTargets,
+    TBool aCopy )
+    {
+    CloseMoveCopyWaitNote();
+
+    HBufC* note = NULL;
+
+    if ( aOperationTargets.Count() == 1 )
+        {
+        HBufC* name = iVideoModel.GetVideoName( aOperationTargets[0] ).AllocLC();
+        if ( aCopy )
+            {
+            note = StringLoader::LoadL( R_VCXHGMYVIDEOS_COPYING_ONE, *name );
+            }
+        else
+            {
+            note = StringLoader::LoadL( R_VCXHGMYVIDEOS_MOVING_ONE, *name );
+            }
+        CleanupStack::PopAndDestroy( name );
+        CleanupStack::PushL( note );
+        }
+    else
+        {
+        if ( aCopy )
+            {
+            note = StringLoader::LoadLC( R_VCXHGMYVIDEOS_COPYING_MANY );
+            }
+        else
+            {
+            note = StringLoader::LoadLC( R_VCXHGMYVIDEOS_MOVING_MANY );
+            }
+        }
+
+    iMoveCopyWaitDialog = new (ELeave) 
+            CAknWaitDialog( ( REINTERPRET_CAST( CEikDialog**, &iMoveCopyWaitDialog ) ), ETrue );
+    iMoveCopyWaitDialog->SetCallback( this );
+    iMoveCopyWaitDialog->SetTextL( *note );
+    
+    if ( aCopy )
+        {
+        iMoveCopyWaitDialog->ExecuteLD( R_VCXHGMYVIDEOS_COPY_WAIT_NOTE );
+        }
+    else
+        {
+        iMoveCopyWaitDialog->ExecuteLD( R_VCXHGMYVIDEOS_MOVE_WAIT_NOTE );
+        }
+
+    CleanupStack::PopAndDestroy( note );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoCopier::CloseMoveCopyWaitNote()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoCopier::CloseMoveCopyWaitNote()
+    {
+    if ( iMoveCopyWaitDialog )
+        {
+        TRAPD( error, iMoveCopyWaitDialog->ProcessFinishedL() );
+        if ( error != KErrNone )
+            {
+            delete iMoveCopyWaitDialog;
+            }
+        iMoveCopyWaitDialog = NULL;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoCopier::DialogDismissedL()
+// Callback about (move/copy) wait note dismissal.
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoCopier::DialogDismissedL( TInt aButtonId )
+    {
+    if ( aButtonId == EAknSoftkeyCancel )
+        {
+        iModel.CollectionClient().CancelMoveOrCopyVideosL();
+        }
+    iMoveCopyWaitDialog = NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoCopier::VideoMoveOrCopyCompletedL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoCopier::VideoMoveOrCopyCompletedL( TInt aFailedCount,
+                                                           const TDesC& aFailedName )
+    {
+    CloseMoveCopyWaitNote();
+
+    if ( aFailedCount > 0 )
+        {
+        HBufC* text = NULL;
+
+        if ( aFailedCount == 1 )
+            {
+            if ( iCopy )
+                {
+                text = StringLoader::LoadLC( R_VCXHGMYVIDEOS_FLDR_ITEM_CANNOT_BE_COPIED,
+                                             aFailedName );
+                }
+            else
+                {
+                text = StringLoader::LoadLC( R_VCXHGMYVIDEOS_FLDR_ITEM_CANNOT_BE_MOVED,
+                                             aFailedName );                
+                }
+            }
+        else
+            {
+            if ( iCopy )
+                {
+                text = StringLoader::LoadLC( R_VCXHGMYVIDEOS_FLDR_SOME_ITEMS_CANT_COPY, 
+                                             aFailedCount );
+                }
+            else
+                {
+                text = StringLoader::LoadLC( R_VCXHGMYVIDEOS_FLDR_SOME_ITEMS_CANT_MOVE, 
+                                             aFailedCount );                
+                }            
+            }
+
+        CAknErrorNote* note = new ( ELeave ) CAknErrorNote( ETrue );
+        note->ExecuteLD( *text );
+        CleanupStack::PopAndDestroy( text );  
+        }    
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/src/vcxhgmyvideosvideodata.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,187 @@
+/*
+* 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:   CVcxHgMyVideosVideoData class implementation*
+*/
+
+
+
+
+// INCLUDE FILES
+#include "vcxhgmyvideosvideodata.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoData::NewL()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosVideoData* CVcxHgMyVideosVideoData::NewL()
+    {
+    CVcxHgMyVideosVideoData* self = 
+        CVcxHgMyVideosVideoData::NewLC();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoData::NewLC()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosVideoData* CVcxHgMyVideosVideoData::NewLC()
+    {
+    CVcxHgMyVideosVideoData* self = 
+        new (ELeave) CVcxHgMyVideosVideoData();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoData::CVcxHgMyVideosVideoData()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosVideoData::CVcxHgMyVideosVideoData()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoData::ConstructL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoData::ConstructL()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoData::~CVcxHgMyVideosVideoData()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosVideoData::~CVcxHgMyVideosVideoData()
+    {
+    delete iThumbnail;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoData::MPXItemId()
+// -----------------------------------------------------------------------------
+//
+TMPXItemId CVcxHgMyVideosVideoData::MPXItemId()
+    {
+    return iMPXItemId;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoData::State()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosVideoData::TVideoDataState CVcxHgMyVideosVideoData::State()
+    {
+    return iState;
+    }   
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoData::ThumbnailConversionId()
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosVideoData::ThumbnailConversionId()
+    {
+    return iConversionId;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoData::Thumbnail()
+// -----------------------------------------------------------------------------
+//
+CFbsBitmap* CVcxHgMyVideosVideoData::Thumbnail( TBool aGiveOwnership )
+    {
+    CFbsBitmap* thumbnail = iThumbnail;
+    if ( aGiveOwnership )
+        {
+        iThumbnail = NULL;
+        }
+    return thumbnail;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoData::DrmProtected()
+// -----------------------------------------------------------------------------
+//
+TBool CVcxHgMyVideosVideoData::DrmProtected()
+    {
+    return iDrmProtected;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoData::ValidDrmRights()
+// -----------------------------------------------------------------------------
+//
+TBool CVcxHgMyVideosVideoData::ValidDrmRights()
+    {
+    return iValidDrmRights;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoData::SetMPXItemId()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoData::SetMPXItemId( TMPXItemId aMPXItemId )
+    {
+    iMPXItemId = aMPXItemId;  
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoData::SetState()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoData::SetState( CVcxHgMyVideosVideoData::TVideoDataState aState )
+    {
+    iState = aState;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoData::SetThumbnailConversionId()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoData::SetThumbnailConversionId( TInt aConversionId )
+    {
+    iConversionId = aConversionId;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoData::SetThumbnail()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoData::SetThumbnail( CFbsBitmap* aThumbnail )
+    {
+    delete iThumbnail;
+    iThumbnail = aThumbnail;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoData::SetDrmProtected()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoData::SetDrmProtected( TBool aDrmProtected )
+    {
+    iDrmProtected = aDrmProtected;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoData::SetValidDrmRights()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoData::SetValidDrmRights( TBool aValidDrmRights )
+    {
+    iValidDrmRights = aValidDrmRights;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/src/vcxhgmyvideosvideodataupdater.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,1047 @@
+/*
+* 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:   CVcxHgMyVideosVideoDataUpdater implementation*
+*/
+
+
+
+
+// INCLUDE FILES
+#include <mpxmediaarray.h>
+#include <mpxmedia.h>
+#include <mpxmediageneraldefs.h>
+
+#include <ganes/HgScroller.h>
+#include <ganes/HgItem.h>
+
+#include <thumbnailmanager.h>
+#include <thumbnailmanagerobserver.h>
+#include <thumbnailobjectsource.h>
+#include <thumbnaildata.h>
+#include <DRMCommon.h> // DRM
+#include <gulicon.h>
+
+#include "IptvDebug.h"
+#include <myvideosindicator.h>
+#include <vcxmyvideosdefs.h>
+#include "vcxhgmyvideosmodel.h"
+#include "vcxhgmyvideosmainview.h"
+#include "vcxhgmyvideosvideolist.h"
+#include "vcxhgmyvideosvideodataupdater.h"
+#include "vcxhgmyvideosindicatorhelper.h"
+#include "vcxhgmyvideosthumbnailmanager.h"
+
+const TInt KRefreshTimerInterval( 1000000 );    // 1 second
+const TInt KMaxThumbnailReqs( 2 );              // Max count of peek and get reqs combined
+const TInt KMaxThumbnailGetReqs( 1 );           // Max count of get reqs
+const TInt KMaxPredictiveSelect( 10 );          // Max range for selecting items before/after visible area
+const TInt KScrollCheckInterval( 250000 );      // 0.25 seconds
+
+// -----------------------------------------------------------------------------
+// TimeStamp
+// -----------------------------------------------------------------------------
+//
+static TInt64 TimeStamp()
+    {
+    TTime time;
+    time.UniversalTime();
+    return time.Int64();
+    }
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDataUpdater::NewL()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosVideoDataUpdater* CVcxHgMyVideosVideoDataUpdater::NewL(
+        CVcxHgMyVideosModel& aModel,
+        CHgScroller& aScroller,
+        CVcxHgMyVideosVideoList& aVideoArray,
+        CMyVideosIndicator& aVideosIndicator )
+    {
+    CVcxHgMyVideosVideoDataUpdater* self = 
+        CVcxHgMyVideosVideoDataUpdater::NewLC( aModel,
+                                               aScroller,
+                                               aVideoArray,
+                                               aVideosIndicator );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDataUpdater::NewLC()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosVideoDataUpdater* CVcxHgMyVideosVideoDataUpdater::NewLC(
+        CVcxHgMyVideosModel& aModel,
+        CHgScroller& aScroller,
+        CVcxHgMyVideosVideoList& aVideoArray,
+        CMyVideosIndicator& aVideosIndicator)
+    {
+    CVcxHgMyVideosVideoDataUpdater* self = 
+        new (ELeave) CVcxHgMyVideosVideoDataUpdater( aModel,
+                                                     aScroller,
+                                                     aVideoArray,
+                                                     aVideosIndicator );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDataUpdater::CVcxHgMyVideosVideoDataUpdater()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosVideoDataUpdater::CVcxHgMyVideosVideoDataUpdater(
+        CVcxHgMyVideosModel& aModel,
+        CHgScroller& aScroller,
+        CVcxHgMyVideosVideoList& aVideoArray,
+        CMyVideosIndicator& aVideosIndicator )
+  : CActive( EPriorityStandard ),
+    iModel( aModel ),
+    iScroller( aScroller ),
+    iVideoArray( aVideoArray ),
+    iVideosIndicator( aVideosIndicator )
+    {
+    CActiveScheduler::Add( this );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDataUpdater::ConstructL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoDataUpdater::ConstructL()
+    {
+    iRefreshTimer = CPeriodic::NewL( CActive::EPriorityStandard );
+    iRetryTimer =   CPeriodic::NewL( CActive::EPriorityStandard );
+    iModel.ThumbnailManager().AddObserverL( *this );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDataUpdater::InfoArrayChanged()
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosVideoDataUpdater::InfoArrayChanged()
+    {
+    // Can we optimise this? Many times new video list contains lot of items
+    // from the old one. But how to make sure there isn't any radical changes...
+
+    CancelAndDeleteFetchArray();
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDataUpdater::~CVcxHgMyVideosVideoDataUpdater()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosVideoDataUpdater::~CVcxHgMyVideosVideoDataUpdater()
+    {
+    iModel.ThumbnailManager().RemoveObserver( *this );
+    Cancel();
+    delete iRefreshTimer; // Cancels active timer
+    delete iRetryTimer;
+    iFetchArray.ResetAndDestroy();
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDataUpdater::SetPausedL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoDataUpdater::SetPausedL( TBool aPaused )
+    {
+    iPaused = aPaused;
+
+    if ( ! iPaused )
+        {
+        ContinueVideoDataFetchingL();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDataUpdater::RequestDataL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoDataUpdater::RequestDataL( TMPXItemId aMPXItemId )
+    {
+    AddItemToFetchArrayL( aMPXItemId );
+    ContinueVideoDataFetchingL();
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDataUpdater::AddToRequestBufferL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoDataUpdater::AddToRequestBufferL( TMPXItemId aMPXItemId )
+    {
+    AddItemToFetchArrayL( aMPXItemId );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDataUpdater::FlushRequestBufferL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoDataUpdater::FlushRequestBufferL()
+    {
+    ContinueVideoDataFetchingL();
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDataUpdater::ReleaseData()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoDataUpdater::ReleaseData( TMPXItemId aMPXItemId )
+    {
+    TInt index = IndexByMPXItemId( aMPXItemId );
+    if ( index >= 0 )
+        {
+        RemoveItem( index ); 
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDataUpdater::PrepareForMoveOrDelete()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoDataUpdater::PrepareForMoveOrDelete( TMPXItemId aMPXItemId )
+    {
+    TInt index = IndexByMPXItemId( aMPXItemId );
+    if ( index >= 0 )
+        {
+        RemoveAndCancelThumbnailGeneration( index ); 
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDataUpdater::RemoveAndCancelThumbnailGeneration()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoDataUpdater::RemoveAndCancelThumbnailGeneration( TInt aIndex )
+    {
+    if ( aIndex >= 0 && aIndex < iFetchArray.Count() )
+        {
+        // Can be enabled when cancellation of (hd) thumbnail gets faster and
+        // does not hang up UI
+        CancelActivities( aIndex );
+        delete iFetchArray[aIndex];
+        iFetchArray.Remove( aIndex );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDataUpdater::RemoveItem()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoDataUpdater::RemoveItem( TInt aIndex )
+    {
+    if ( aIndex >= 0 && aIndex < iFetchArray.Count() )
+        {    
+        CVcxHgMyVideosVideoData* item = iFetchArray[aIndex];
+        
+        // When scrolling around canceling thumbnail creation is sometimes so slow
+        // that it hangs UI for while. Thumbnail is needed sooner or later anyway.
+        // Therefore let creation get finished in peace. It is possible to fetch already 
+        // created thumbs during creation but not during hang up. 
+        if ( item && !CancelNeeded( *item ) )
+            {
+            delete item;
+            iFetchArray.Remove( aIndex );
+            }         
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDataUpdater::AddItemToFetchArrayL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoDataUpdater::AddItemToFetchArrayL( TMPXItemId aMPXItemId )
+    {
+    CVcxHgMyVideosVideoData* newItem = CVcxHgMyVideosVideoData::NewLC();
+    newItem->SetMPXItemId( aMPXItemId );
+    iFetchArray.AppendL( newItem );   
+    
+    CleanupStack::Pop( newItem );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDataUpdater::CancelActivities()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoDataUpdater::CancelActivities( TInt aIndex )
+    {    
+    if ( aIndex >= 0 && aIndex < iFetchArray.Count() )
+        {
+        CVcxHgMyVideosVideoData* item = iFetchArray[aIndex];
+        if ( item && CancelNeeded( *item ) )
+            {
+            iModel.ThumbnailManager().Cancel( item->ThumbnailConversionId() );
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDataUpdater::CancelAndDeleteFetchArray()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoDataUpdater::CancelAndDeleteFetchArray()
+    {
+    TInt count = iFetchArray.Count();
+    for ( TInt i = 0; i < count; i++ )
+        {
+        CancelActivities( i );
+        }
+    iFetchArray.ResetAndDestroy();
+    
+    iPreviousFirstScrollerIndexTime = 0;
+    iPreviousFirstScrollerIndex = iScroller.FirstIndexOnScreen();
+    iPreviousModifiedIndexOnScreen = EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDataUpdater::ContinueVideoDataFetchingL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoDataUpdater::ContinueVideoDataFetchingL()
+    {
+    iRetryTimer->Cancel();
+    if ( !iPaused && iVideoArray.VideoCount() > 0 && iFetchArray.Count() > 0 )
+        {
+        TInt64 time = TimeStamp();
+        TBool refreshTimerNeeded = EFalse;
+        TInt peekReqs = 0;
+        TInt getReqs = 0;
+        GetActiveRequestCount( peekReqs, getReqs );
+        TInt reqs = peekReqs + getReqs;
+        if ( reqs < KMaxThumbnailReqs )
+            {
+            CVcxHgMyVideosVideoData::TVideoDataState state =
+                        CVcxHgMyVideosVideoData::EVideoDataStateNone;
+            CVcxHgMyVideosVideoData* prevItem = NULL;
+            CVcxHgMyVideosVideoData* item = NULL;
+            do
+                {
+                TInt err = KErrNone;
+                prevItem = item;
+                if ( !SelectNextIndexL( getReqs >= KMaxThumbnailGetReqs ) )
+                    {
+                    // Nothing to be started
+                    if ( !reqs && iFetchArray.Count() > 0 )
+                        {
+                        // To ensure that thumbnail creation continues after
+                        // disabled while scrolling
+                        iRetryTimer->Start( KScrollCheckInterval, KScrollCheckInterval,
+                            TCallBack( RetryTimerCallBack, this ) );
+                        iPreviousFirstScrollerIndexTime = 0; // Force scroll check update
+                        IPTVLOGSTRING_LOW_LEVEL(
+                           "MPX My Videos UI # ContinueVideoDataFetchingL # iRetryTimer start" );
+                        }
+                    break;
+                    }
+                item = iFetchArray[0];
+                state = item->State();
+                if ( state == CVcxHgMyVideosVideoData::EVideoDataStateNone )
+                    {
+                    // Try first a quick peek with thumbnail creation denied
+                    TRAP( err, StartThumbnailL( *item, ETrue ) );
+                    if( err == KErrNone )
+                        {
+                        ++reqs;
+                        refreshTimerNeeded = ETrue;
+                        }
+                    }
+                else if ( state == CVcxHgMyVideosVideoData::EVideoDataStateThumbnailPeekFinished ) 
+                    {
+                    if ( getReqs < KMaxThumbnailGetReqs )
+                        {
+                        // Try then get with thumbnail creation allowed
+                        TRAP( err, StartThumbnailL( *item, EFalse ) );
+                        if ( err == KErrNone )
+                            {
+                            ++reqs;
+                            ++getReqs;
+                            refreshTimerNeeded = ETrue;
+                            }
+                        }
+                    }
+                if ( err != KErrNone )
+                    {
+                    RemoveItem( 0 );
+                    }                
+                }
+            while ( iFetchArray.Count() > 0 && reqs < KMaxThumbnailReqs && prevItem != item );
+            }
+        if ( refreshTimerNeeded && !iRefreshTimer->IsActive() )
+            {
+            iRefreshTimer->Start( KRefreshTimerInterval, KRefreshTimerInterval,
+                TCallBack( RefreshTimerCallBack, this ) );
+            IPTVLOGSTRING_LOW_LEVEL(
+               "MPX My Videos UI # ContinueVideoDataFetchingL # iRefreshTimer start" );
+            }
+        if ( time - iPreviousFirstScrollerIndexTime >= KScrollCheckInterval )
+            {
+            // Store values for scroll direction check
+            iPreviousFirstScrollerIndexTime = time;
+            iPreviousFirstScrollerIndex = iScroller.FirstIndexOnScreen();
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDataUpdater::UpdateVideoDataToUiL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoDataUpdater::UpdateVideoDataToUiL( CVcxHgMyVideosVideoData& aVideoData )
+    {
+    IPTVLOGSTRING_LOW_LEVEL("CVcxHgMyVideosVideoDataUpdater::UpdateVideoDataToUiL() ENTER" );
+
+    TInt index = iVideoArray.IndexByMPXItemId( aVideoData.MPXItemId() );
+    
+    if ( index >= 0 && index < iScroller.ItemCount() )
+        {       
+        TBool drmUpdate = aVideoData.DrmProtected();
+        CHgItem& listItem = iScroller.ItemL( index );
+                
+        if ( aVideoData.Thumbnail() )
+            {
+            CGulIcon* thumbnail = CGulIcon::NewL( aVideoData.Thumbnail( ETrue ) );
+            listItem.SetIcon( thumbnail );
+            CMPXMedia* media = iVideoArray.MPXMediaByMPXItemId( aVideoData.MPXItemId() );
+            if ( iVideosIndicator.IsIndicatorShown( *media ) )
+                {
+                IPTVLOGSTRING_LOW_LEVEL("CVcxHgMyVideosVideoDataUpdater::UpdateVideoDataToUiL() has icon, has indicator" );
+                listItem.SetFlags( CHgItem::EHgItemFlagsIconOverlayIndicator );
+                }
+            else
+                {
+                IPTVLOGSTRING_LOW_LEVEL("CVcxHgMyVideosVideoDataUpdater::UpdateVideoDataToUiL() has icon, no indicator" );
+                listItem.ClearFlags( CHgItem::EHgItemFlagsIconOverlayIndicator );
+                }
+            }
+        
+        if ( drmUpdate )
+            {
+            TVcxHgMyVideosIndicatorHelper::TIndicatorDrmStatus drmStatus;
+            CMPXMedia* media = iVideoArray.MPXMedia( index );
+            
+            if ( media )
+                {
+                TVcxHgMyVideosIndicatorHelper indicatorHelper;
+                TInt indicator1( 0 );
+                TInt indicator2( 0 );
+
+                if ( aVideoData.ValidDrmRights() )
+                    {
+                    drmStatus = TVcxHgMyVideosIndicatorHelper::EIndicatorDrmStatusValid;
+                    }
+                else
+                    {
+                    drmStatus = TVcxHgMyVideosIndicatorHelper::EIndicatorDrmStatusExpired;
+                    }
+
+                TBool isNewVideo( EFalse );
+                if ( media->IsSupported( KMPXMediaGeneralFlags ) )
+                    {
+                    if ( media->ValueTObjectL<TUint32>( KMPXMediaGeneralFlags ) &
+                        EVcxMyVideosVideoNew )
+                        {
+                        isNewVideo = ETrue;
+                        }
+                    }                    
+
+                indicatorHelper.GetIndicatorsForVideoL(
+                    iModel,
+                    isNewVideo,
+                    EFalse, // *Recordings*
+                    media->ValueText( KMPXMediaGeneralUri ),
+                    drmStatus,
+                    indicator1,
+                    indicator2 );
+            
+                if ( indicator1 )
+                    {
+                    listItem.SetFlags( indicator1 );
+                    }
+                if ( indicator2 )
+                    {
+                    listItem.SetFlags( indicator2 );
+                    }
+                }
+            }
+        
+        if ( ListRefreshNeeded( index ) )
+            {
+            RefreshScreen();
+            }
+        }
+    IPTVLOGSTRING_LOW_LEVEL("CVcxHgMyVideosVideoDataUpdater::UpdateVideoDataToUiL() RETURN" );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDataUpdater::IndexByMPXItemId()
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosVideoDataUpdater::IndexByMPXItemId( TMPXItemId aMPXItemId )
+    {   
+    TInt count = iFetchArray.Count();
+    for ( TInt i = 0; i < count; i++ )
+        {
+        if ( iFetchArray[i]->MPXItemId() == aMPXItemId )
+            {
+            return i;
+            }
+        }
+    return KErrNotFound;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDataUpdater::SelectNextIndexL()
+// -----------------------------------------------------------------------------
+// 
+TBool CVcxHgMyVideosVideoDataUpdater::SelectNextIndexL( TBool aSelectForPeekOnly )
+    {
+    TBool selected = EFalse;
+    if ( iScroller.ItemCount() > 0 )
+        {
+        TInt firstIndexOnScreen = 0;
+        TInt lastIndexOnScreen = 0;
+        TInt lastIndex = 0;
+        GetScrollerArea( firstIndexOnScreen, lastIndexOnScreen, lastIndex );
+
+        // Determine scroll direction for optimal selection
+        TInt maxPredict = KMaxPredictiveSelect;
+        TBool scrollUp = iPreviousFirstScrollerIndex > firstIndexOnScreen;
+        TBool scrollDown = iPreviousFirstScrollerIndex < firstIndexOnScreen;
+        if ( scrollUp || scrollDown )
+            {
+            if ( scrollUp )
+                {
+                IPTVLOGSTRING_LOW_LEVEL(
+                   "MPX My Videos UI # CVcxHgMyVideosVideoDataUpdater # scroll up" );
+                }
+            else
+                {
+                IPTVLOGSTRING_LOW_LEVEL(
+                    "MPX My Videos UI # CVcxHgMyVideosVideoDataUpdater # scroll down" );
+                }
+            aSelectForPeekOnly = ETrue; // Disable thumb creation while scrolling
+            }
+        else
+            {
+            maxPredict /= 2; // Split range when checking both directions
+            }
+
+        if ( !aSelectForPeekOnly || scrollUp )
+            {
+            // Try visible area first with thumb creation disabled to get
+            // already created thumbs as fast as possible
+            selected = TrySelectFromScrollerAreaL( firstIndexOnScreen, 
+                                                   lastIndexOnScreen,
+                                                   ETrue );
+            }
+        if ( !selected && !scrollUp )
+            {
+            // Try visible area and items below
+            TInt end = Min( lastIndexOnScreen + maxPredict, lastIndex );
+            selected = TrySelectFromScrollerAreaL( firstIndexOnScreen, end, 
+                    aSelectForPeekOnly );
+            }
+        if ( !selected && !scrollDown && firstIndexOnScreen > 0 )
+            {
+            // Try items above visible area
+            TInt end = Max( firstIndexOnScreen - maxPredict - 1, 0 );
+            selected = TrySelectFromScrollerAreaL( firstIndexOnScreen - 1, end,
+                    aSelectForPeekOnly );
+            }
+        if ( !selected )
+            {
+            // Try any item
+            TInt count = iFetchArray.Count();
+            for ( TInt i = 0; i < count; i++ )
+                {
+                if ( TrySelectL( i, aSelectForPeekOnly ) )
+                    {
+                    selected = ETrue;
+                    break;
+                    }
+                }
+            }
+        }
+    return selected;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDataUpdater::RefreshTimerCallBack()
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosVideoDataUpdater::RefreshTimerCallBack( TAny* aAny )
+    {
+    CVcxHgMyVideosVideoDataUpdater* self = static_cast<CVcxHgMyVideosVideoDataUpdater*>( aAny ); 
+    if ( !self->iPaused && self->iFetchArray.Count() > 0 )
+        {
+        // Do refresh only if on screen item has been modified
+        if ( self->iPreviousModifiedIndexOnScreen )
+            {
+            self->iPreviousModifiedIndexOnScreen = EFalse; // Reset refresh checking
+            self->RefreshScreen();
+            }
+        }
+    else
+        {
+        self->iRefreshTimer->Cancel();
+        IPTVLOGSTRING_LOW_LEVEL(
+           "MPX My Videos UI # RefreshTimerCallBack # iRefreshTimer stop" );
+        }
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDataUpdater::RefreshScreen()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoDataUpdater::RefreshScreen()
+    {
+    IPTVLOGSTRING_LOW_LEVEL( "MPX My Videos UI # CVcxHgMyVideosVideoDataUpdater::RefreshScreen()" );
+    iScroller.DrawDeferred();
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDataUpdater::ListRefreshNeeded()
+// -----------------------------------------------------------------------------
+//
+TBool CVcxHgMyVideosVideoDataUpdater::ListRefreshNeeded( TInt aIndex )
+    {
+    TInt firstIndexOnScreen = 0;
+    TInt lastIndexOnScreen = 0;
+    TInt lastIndex = 0;
+    GetScrollerArea( firstIndexOnScreen, lastIndexOnScreen, lastIndex );
+    
+    TBool modifiedIndexOnScreen = aIndex >= firstIndexOnScreen &&
+        aIndex <= lastIndexOnScreen;
+    TBool refreshNeeded( EFalse );
+
+    // Refresh rules:
+    // 1) Refresh if off screen item is detected after on screen item
+    // 2) Refresh if item is the last
+    if ( ( iPreviousModifiedIndexOnScreen && !modifiedIndexOnScreen ) ||
+         iFetchArray.Count() <= 1 )
+        {
+        // Restart refresh timer if there are items left after current one
+        iRefreshTimer->Cancel();
+        if ( iFetchArray.Count() > 1 )
+            {
+            iRefreshTimer->Start( KRefreshTimerInterval, KRefreshTimerInterval,
+                TCallBack( RefreshTimerCallBack, this ) );
+            IPTVLOGSTRING_LOW_LEVEL(
+               "MPX My Videos UI # ListRefreshNeeded # iRefreshTimer start" );
+            }
+        else
+            {
+            IPTVLOGSTRING_LOW_LEVEL(
+               "MPX My Videos UI # ListRefreshNeeded # iRefreshTimer stop" );
+            }
+        refreshNeeded = ETrue;
+        }
+    iPreviousModifiedIndexOnScreen = modifiedIndexOnScreen;
+    return refreshNeeded;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDataUpdater::ThumbnailPreviewReady()
+// From MThumbnailManagerObserver, not used in Video Center.
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoDataUpdater::ThumbnailPreviewReady( MThumbnailData& /*aThumbnail*/, 
+                                                            TThumbnailRequestId /*aId*/ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDataUpdater::ThumbnailReady()
+// From MThumbnailManagerObserver
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoDataUpdater::ThumbnailReady( TInt aError,
+                                                     MThumbnailData& aThumbnail,
+                                                     TThumbnailRequestId aId )
+    {
+    IPTVLOGSTRING3_LOW_LEVEL( 
+        "MPX My Videos UI # ThumbnailReady(error=%d, thumbID=%d)", aError, aId );
+
+    TInt count = iFetchArray.Count();
+    for( TInt i = 0; i < count; ++i )
+        {
+        CVcxHgMyVideosVideoData* item = iFetchArray[i];
+        if ( aId == item->ThumbnailConversionId() )
+            {
+            if ( aError == KErrNone ||
+			     aError == KErrCompletion || // Accept blacklisted
+                 item->State() == CVcxHgMyVideosVideoData::EVideoDataStateThumbnailStarted )
+                {
+                // Never delete this, ownership gone to Ganes list
+                item->SetThumbnail( aError == KErrNone ? aThumbnail.DetachBitmap() : NULL );
+                item->SetState( CVcxHgMyVideosVideoData::EVideoDataStateThumbnailFinished );
+                StartFinalActions();
+                }
+            else if ( aError == KErrNotFound &&
+            	item->State() == CVcxHgMyVideosVideoData::EVideoDataStateThumbnailPeekStarted )
+                {
+                // Try getting thumbnail with create allowed when peek failed with not found
+                item->SetState( CVcxHgMyVideosVideoData::EVideoDataStateThumbnailPeekFinished );
+                }
+            else
+                {
+                // Stop thumbnail peek attemps
+                item->SetState( CVcxHgMyVideosVideoData::EVideoDataStateThumbnailFinished );
+                StartFinalActions();
+                }
+
+            TRAPD( err, ContinueVideoDataFetchingL() );
+            if ( err != KErrNone )
+                {
+                IPTVLOGSTRING2_LOW_LEVEL(
+                "MPX My Videos UI # CVcxHgMyVideosVideoDataUpdater::ThumbnailReady, err = %d",
+                err );
+                }
+            break;
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDataUpdater::RunL()
+// From CActive
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoDataUpdater::RunL()
+    {
+    if ( !iPaused )
+        {
+        TInt i = iFetchArray.Count() - 1;
+        while( i >= 0 )
+            {
+            CVcxHgMyVideosVideoData* item = iFetchArray[i];
+            if ( item->State() == CVcxHgMyVideosVideoData::EVideoDataStateThumbnailFinished )
+                {
+                TRAP_IGNORE(
+                    {
+                    CheckDrmL( *item );
+                    UpdateVideoDataToUiL( *item );
+                    } );				
+                delete item;
+                iFetchArray.Remove(i);
+#if 0
+                if ( iFetchArray.Count() > 0 )
+                    {
+                    // If drm checking is time consuming, proceed finalisation later
+                    StartFinalActions();
+                    break;
+                    }
+#endif
+                }
+            --i;
+            }
+        if ( !iFetchArray.Count() )
+            {
+            // No items left, timers are not needed anymore
+            iRefreshTimer->Cancel();
+            iRetryTimer->Cancel();
+            IPTVLOGSTRING_LOW_LEVEL(
+               "MPX My Videos UI # RunL # iRefreshTimer stop" );
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDataUpdater::RunError()
+// From CActive
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosVideoDataUpdater::RunError( TInt aError )
+    {
+    IPTVLOGSTRING2_LOW_LEVEL( "MPX My Videos UI # CVcxHgMyVideosVideoDataUpdater::RunError, aError = %d", aError );
+    
+    if ( aError != KErrNone )
+        {
+        }
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDataUpdater::DoCancel()
+// From CActive
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoDataUpdater::DoCancel()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDataUpdater::CheckDrmL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoDataUpdater::CheckDrmL( CVcxHgMyVideosVideoData& aVideoData )
+    {
+    CMPXMedia* media = iVideoArray.MPXMediaByMPXItemId( aVideoData.MPXItemId() );
+    if ( media && media->IsSupported( KMPXMediaGeneralUri ) )
+        {
+        TUint32 flags = 0;
+        if ( media->IsSupported( KMPXMediaGeneralFlags ) )
+            {
+            flags = media->ValueTObjectL<TUint32>( KMPXMediaGeneralFlags );
+            }
+        if ( flags & EVcxMyVideosVideoDrmProtected )
+            {
+            aVideoData.SetDrmProtected( ETrue );
+            aVideoData.SetValidDrmRights( EFalse );
+
+            ContentAccess::CData* cData = CData::NewLC( 
+                               (TVirtualPathPtr) media->ValueText( KMPXMediaGeneralUri ),
+                               EPeek,
+                               EContentShareReadWrite );
+            TInt intentResult = cData->EvaluateIntent( ContentAccess::EPlay );
+
+            // Not valid rights should return KErrCANoRights, KErrCANoPermission,
+            // or in rare cases KErrCAPendingRights. But we don't trust those and
+            // just compare against KErrNone.
+            if ( intentResult == KErrNone )
+                {
+                aVideoData.SetValidDrmRights( ETrue );
+                }
+            CleanupStack::PopAndDestroy( cData );
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDataUpdater::GetActiveRequestCount()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoDataUpdater::GetActiveRequestCount(
+        TInt& aPeekRequests, TInt& aGetRequests )
+    {
+    aPeekRequests = 0;
+    aGetRequests = 0;
+    TInt count = iFetchArray.Count();
+    for( TInt i = 0; i < count; ++i )
+        {
+        CVcxHgMyVideosVideoData::TVideoDataState state = iFetchArray[i]->State();
+        if ( state == CVcxHgMyVideosVideoData::EVideoDataStateThumbnailPeekStarted )
+            {
+            ++aPeekRequests;
+            }
+        else if ( state == CVcxHgMyVideosVideoData::EVideoDataStateThumbnailStarted )
+            {
+            ++aGetRequests;
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDataUpdater::StartThumbnailL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoDataUpdater::StartThumbnailL(
+        CVcxHgMyVideosVideoData& aItem, TBool aPeek )
+    {
+    CMPXMedia* media = iVideoArray.MPXMediaByMPXItemId( aItem.MPXItemId() );
+    if ( media && media->IsSupported( KMPXMediaGeneralUri ) )
+        {
+        TPtrC uri = media->ValueText( KMPXMediaGeneralUri ); 
+        TPtrC mime = media->IsSupported( KMPXMediaGeneralMimeType ) ? 
+                        media->ValueText( KMPXMediaGeneralMimeType ) : KNullDesC;
+        TThumbnailRequestId id = 0;
+        if ( aPeek )
+            {
+            CThumbnailObjectSource* source = CThumbnailObjectSource::NewLC(
+                    uri, mime );
+            id = iModel.ThumbnailManager().PeekL( *source );
+            CleanupStack::PopAndDestroy( source );
+            }
+        else
+            {
+            CThumbnailObjectSource* source = CThumbnailObjectSource::NewLC(
+                    uri, mime );
+            id = iModel.ThumbnailManager().GetL( *source );
+            CleanupStack::PopAndDestroy( source ); 
+            }
+        aItem.SetThumbnailConversionId( id );
+
+        IPTVLOGSTRING4_LOW_LEVEL( 
+                "MPX My Videos UI # StartThumbnailL() called thumbID %d for %S (peek %d)",
+                aItem.ThumbnailConversionId(),
+                &media->ValueText( KMPXMediaGeneralUri ),
+                aPeek );
+
+        aItem.SetState( aPeek ?
+                CVcxHgMyVideosVideoData::EVideoDataStateThumbnailPeekStarted :
+                CVcxHgMyVideosVideoData::EVideoDataStateThumbnailStarted );
+        }
+    else
+        {
+        User::Leave( KErrNotFound );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDataUpdater::TrySelectL()
+// -----------------------------------------------------------------------------
+//
+TBool CVcxHgMyVideosVideoDataUpdater::TrySelectL( TInt aIndex, 
+                                                  TBool aSelectForPeekOnly )
+    {
+    // Move selected index to first index of the fetch array
+    TBool selected = EFalse;
+    CVcxHgMyVideosVideoData* item = iFetchArray[aIndex];
+    CVcxHgMyVideosVideoData::TVideoDataState state = item->State();
+    if ( aSelectForPeekOnly )
+        {
+        // Accept item only for peeking
+        if ( state == CVcxHgMyVideosVideoData::EVideoDataStateNone )
+            {
+            iFetchArray.InsertL( item, 0 );
+            iFetchArray.Remove( aIndex + 1 );
+            selected = ETrue;
+            }
+        }
+    else if ( state == CVcxHgMyVideosVideoData::EVideoDataStateNone ||
+              state == CVcxHgMyVideosVideoData::EVideoDataStateThumbnailPeekFinished )
+        {
+        // Accept any item that waits to be fetched
+        iFetchArray.InsertL( item, 0 );
+        iFetchArray.Remove( aIndex + 1 );
+        selected = ETrue;
+        }
+    return selected;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDataUpdater::TrySelectFromScrollerL()
+// -----------------------------------------------------------------------------
+//
+TBool CVcxHgMyVideosVideoDataUpdater::TrySelectFromScrollerL(
+    TInt aPos, TBool aSelectForPeekOnly )
+    {
+    TBool selected = EFalse;
+    CGulIcon* icon = iScroller.ItemL( aPos ).Icon();
+    TMPXItemId mpxItemId = iVideoArray.ArrayIndexToMpxItemIdL( aPos );
+    TInt index = IndexByMPXItemId( mpxItemId );
+    if ( index >= 0 )
+        {
+		// Skip fetch selection if icon already exist
+        if ( !icon )
+            {
+            if ( TrySelectL( index, aSelectForPeekOnly ) )
+                {
+                selected = ETrue;
+                }
+            }
+        else
+            {
+            iFetchArray[index]->SetState(
+                CVcxHgMyVideosVideoData::EVideoDataStateThumbnailFinished );
+            StartFinalActions();
+            }
+        }
+    return selected;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDataUpdater::TrySelectFromScrollerAreaL()
+// -----------------------------------------------------------------------------
+//
+TBool CVcxHgMyVideosVideoDataUpdater::TrySelectFromScrollerAreaL( 
+    TInt aStartPos, TInt aEndPos, TBool aSelectForPeekOnly )
+    {
+    TBool selected = EFalse;
+    if ( aEndPos >= aStartPos )
+        {
+        // Search forwards
+        for ( TInt i = aStartPos; i <= aEndPos; i++ )
+            {
+            if ( TrySelectFromScrollerL( i, aSelectForPeekOnly ) )
+                {
+                selected = ETrue;
+                break;
+                }
+            }
+        }
+    else
+        {
+        // Search backwards
+        for ( TInt i = aStartPos; i >= aEndPos; i-- )
+            {
+            if ( TrySelectFromScrollerL( i, aSelectForPeekOnly ) )
+                {
+                selected = ETrue;
+                break;
+                }
+            }
+        }
+    return selected;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDataUpdater::StartFinalActions()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoDataUpdater::StartFinalActions()
+    {
+    if ( !IsActive() )
+        {
+        SetActive();
+        TRequestStatus* stat = &iStatus;
+        User::RequestComplete( stat, KErrNone );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDataUpdater::CancelNeeded()
+// -----------------------------------------------------------------------------
+//
+TBool CVcxHgMyVideosVideoDataUpdater::CancelNeeded( CVcxHgMyVideosVideoData& aItem )
+    {
+    CVcxHgMyVideosVideoData::TVideoDataState state = aItem.State();
+    return ( state == CVcxHgMyVideosVideoData::EVideoDataStateThumbnailPeekStarted ||
+             state == CVcxHgMyVideosVideoData::EVideoDataStateThumbnailStarted );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDataUpdater::RetryTimerCallBack()
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosVideoDataUpdater::RetryTimerCallBack( TAny* aAny )
+    {
+    CVcxHgMyVideosVideoDataUpdater* self = static_cast<CVcxHgMyVideosVideoDataUpdater*>( aAny ); 
+    self->iRetryTimer->Cancel();
+    TRAPD( err, self->ContinueVideoDataFetchingL() );
+    if ( err != KErrNone )
+        {
+        IPTVLOGSTRING2_LOW_LEVEL(
+        "MPX My Videos UI # CVcxHgMyVideosVideoDataUpdater::RetryTimerCallBack, err = %d",
+        err );
+        }
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDataUpdater::GetScrollerArea()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoDataUpdater::GetScrollerArea( TInt& aFirstIndexOnScreen, 
+                                                      TInt& aLastIndexOnScreen, 
+                                                      TInt& aLastIndex )
+    {
+    aLastIndex = Max( iScroller.ItemCount() - 1, 0 );
+    aFirstIndexOnScreen = Max( iScroller.FirstIndexOnScreen(), 0 );
+    aLastIndexOnScreen = Min( aFirstIndexOnScreen + iScroller.ItemsOnScreen(), aLastIndex );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/src/vcxhgmyvideosvideodetailsdialog.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,135 @@
+/*
+* 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:      My Videos Video Details Dialog.*
+*/
+
+
+
+
+// INCLUDE FILES
+#include <aknmessagequerydialog.h>
+#include <mpxmediageneraldefs.h>
+#include <vcxmyvideosdefs.h>
+#include <vcxhgmyvideos.rsg>
+#include "vcxhgmyvideosvideodetailsdialog.h"
+#include <MPFileDetailsDialog.h>
+#include <mpxmediageneraldefs.h>
+#include <mpxmediavideodefs.h>
+#include <filedetailspluginif.h>
+
+
+// ============================ MEMBER FUNCTIONS =============================
+
+// ---------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDetailsDialog::CVcxHgMyVideosVideoDetailsDialog()
+// ---------------------------------------------------------------------------
+//
+CVcxHgMyVideosVideoDetailsDialog::CVcxHgMyVideosVideoDetailsDialog()
+    {
+    
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDetailsDialog::CVcxHgMyVideosVideoDetailsDialog()
+// ---------------------------------------------------------------------------
+//
+CVcxHgMyVideosVideoDetailsDialog::~CVcxHgMyVideosVideoDetailsDialog()
+    {
+    if ( iDetailsAo->IsActive() )
+        {
+        iDetailsAo->Cancel();
+        }
+    delete iDetailsAo;
+    delete iDetailsMedia;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDetailsDialog::NewL
+//
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosVideoDetailsDialog* CVcxHgMyVideosVideoDetailsDialog::NewL()
+    {
+    CVcxHgMyVideosVideoDetailsDialog* self =
+            new (ELeave) CVcxHgMyVideosVideoDetailsDialog();
+	CleanupStack::PushL( self );		
+    self->ConstructL();
+	CleanupStack::Pop( self );
+    return self;        
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDetailsDialog::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoDetailsDialog::ConstructL()
+    {
+    iDetailsAo = CIdle::NewL( CActive::EPriorityStandard );
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDetailsDialog::ShowVideoDetailsDialogL()
+// ---------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoDetailsDialog::ShowVideoDetailsDialogL( const CMPXMedia& aMedia )
+    {
+    if ( iDetailsMedia )
+        {
+        delete iDetailsMedia;
+        iDetailsMedia = NULL;
+        }
+    iDetailsMedia = CMPXMedia::NewL( aMedia );
+    
+    ActivateDetailsActiveObject();
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDetailsDialog::ActivateDetailsActiveObject
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoDetailsDialog::ActivateDetailsActiveObject()
+    {
+    if ( !iDetailsAo->IsActive() )
+        {
+        iDetailsAo->Start( TCallBack( CVcxHgMyVideosVideoDetailsDialog::ShowDetailsL, this ) );
+        }
+    }
+
+// -------------------------------------------------------------------------------------------------
+//   CVcxHgMyVideosVideoDetailsDialog::ShowDetailsL
+// -------------------------------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosVideoDetailsDialog::ShowDetailsL( TAny* aPtr )
+{
+    static_cast<CVcxHgMyVideosVideoDetailsDialog*>(aPtr)->DoShowDetailsL();
+    return KErrNone;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CVcxHgMyVideosVideoDetailsDialog::DoShowDetailsL
+// -------------------------------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoDetailsDialog::DoShowDetailsL()
+    {
+    if ( iDetailsMedia )
+        {
+        CFileDetailsPluginIF* fdPlugin = CFileDetailsPluginIF::NewL();
+        CleanupStack::PushL( fdPlugin );
+        fdPlugin->ShowFileDetailsL( *iDetailsMedia );
+        CleanupStack::PopAndDestroy();
+        }
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/src/vcxhgmyvideosvideolist.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,365 @@
+/*
+* 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:      Class for providing video list.*
+*/
+
+
+
+
+// INCLUDE FILES
+#include <collate.h>
+#include <mpxmedia.h>
+#include <mpxmediaarray.h>
+#include <mpxmediageneraldefs.h>
+#include "vcxhgmyvideosvideolist.h"
+#include "vcxhgmyvideosvideolistitem.h"
+#include "IptvDebug.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoList::NewL()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosVideoList* CVcxHgMyVideosVideoList::NewL()
+    {
+    CVcxHgMyVideosVideoList* self = 
+        CVcxHgMyVideosVideoList::NewLC();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoList::NewLC()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosVideoList* CVcxHgMyVideosVideoList::NewLC()
+    {
+    CVcxHgMyVideosVideoList* self = 
+        new (ELeave) CVcxHgMyVideosVideoList();
+    CleanupStack::PushL( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoList::CVcxHgMyVideosVideoList()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosVideoList::CVcxHgMyVideosVideoList()
+    {
+    // No implementation required.
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoList::~CVcxHgMyVideosVideoList()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosVideoList::~CVcxHgMyVideosVideoList()
+    {
+    RemoveVideoList();
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoList::RemoveVideoList()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoList::RemoveVideoList()
+    {
+    iVideoList.ResetAndDestroy();
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoList::ReplaceVideoListL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoList::ReplaceVideoListL( CMPXMediaArray& aVideoList )
+    {
+    IPTVLOGSTRING_LOW_LEVEL( "MPX My Videos UI # CVcxHgMyVideosVideoList::ReplaceVideoListL() - Enter" );
+    
+    // Removes the all videos from array.
+    RemoveVideoList();
+           
+    TInt count = aVideoList.Count();
+    iVideoList.ReserveL( count );
+    for ( TInt i = 0; i < count; i++ )
+        {
+        CMPXMedia* media = CMPXMedia::NewL( *( aVideoList[i] ) ); 
+        if ( media )
+            {
+            CVcxHgMyVideosVideoListItem* item = CVcxHgMyVideosVideoListItem::NewLC( media );
+            iVideoList.AppendL( item );
+            CleanupStack::Pop( item );
+            }
+        }        
+    IPTVLOGSTRING_LOW_LEVEL( "MPX My Videos UI # CVcxHgMyVideosVideoList::ReplaceVideoListL() - Exit" );
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+TBool CVcxHgMyVideosVideoList::HasSameItemsL( const CMPXMediaArray& aVideoList )
+    {
+    TInt count( iVideoList.Count() );
+    if ( aVideoList.Count() != count || count == 0 )
+        {
+        return EFalse;
+        }
+
+    TBool isSame( ETrue );
+    CMPXMedia* oldMedia = NULL;
+    CMPXMedia* newMedia = NULL;
+    for ( TInt i = 0; i < count; i++ )
+        {
+        oldMedia = iVideoList[i]->Media();
+        newMedia = aVideoList[i];
+        if ( oldMedia && oldMedia->IsSupported( KMPXMediaGeneralId )
+                && newMedia && newMedia->IsSupported( KMPXMediaGeneralId ) )
+            {
+            if ( oldMedia->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId ) != 
+                    newMedia->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId ) )
+                {
+                isSame = EFalse;
+                break;
+                }
+            }
+        }
+    return isSame;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoList::VideoCount()
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosVideoList::VideoCount()
+    {
+    return iVideoList.Count();
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoList::RemoveVideo()
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosVideoList::RemoveVideo( TMPXItemId aMpxItemId )
+    {
+    TInt index = IndexByMPXItemId( aMpxItemId );
+    
+    if ( index != KErrNotFound )
+        {
+        delete iVideoList[index];
+        iVideoList.Remove( index );
+        }
+    return index;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoList::MPXMedia()
+// -----------------------------------------------------------------------------
+//
+CMPXMedia* CVcxHgMyVideosVideoList::MPXMedia( TInt aIndex )
+    {
+    if ( aIndex >= 0 && aIndex < iVideoList.Count() )
+        {
+        return iVideoList[aIndex]->Media();
+        }
+    return NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoList::MPXMediaByUri()
+// -----------------------------------------------------------------------------
+//
+CMPXMedia* CVcxHgMyVideosVideoList::MPXMediaByUri( const TDesC& aUri )
+    {
+    CMPXMedia* media = NULL;
+    TInt count( iVideoList.Count() );
+    
+    for ( TInt i = 0; i < count; i++ )
+        {
+        media = iVideoList[i]->Media();
+            
+        if ( media && media->IsSupported( KMPXMediaGeneralUri ) )
+            {
+            if ( aUri.CompareF( media->ValueText( KMPXMediaGeneralUri ) ) == 0 )
+                {
+                return media;
+                }
+            }
+        }
+    return NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoList::MPXMediaByMPXItemId()
+// -----------------------------------------------------------------------------
+//
+CMPXMedia* CVcxHgMyVideosVideoList::MPXMediaByMPXItemId( TMPXItemId aMpxItemId )
+    {
+    CMPXMedia* media = NULL;
+    TInt count( iVideoList.Count() );
+    
+    for ( TInt i = 0; i < count; i++ )
+        {
+        media = iVideoList[i]->Media();
+
+        if ( media && media->IsSupported( KMPXMediaGeneralId ) )
+            {         
+            if ( aMpxItemId == media->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId ) )
+                {
+                return media;
+                }
+            }
+        }        
+    return NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoList::ArrayIndexToMpxItemIdL()
+// -----------------------------------------------------------------------------
+//
+TMPXItemId CVcxHgMyVideosVideoList::ArrayIndexToMpxItemIdL( TInt aArrayIndex )
+    {
+    if ( aArrayIndex < 0 || aArrayIndex >= iVideoList.Count() )
+        {
+        User::Leave( KErrArgument );
+        }
+
+    return iVideoList[aArrayIndex]->Media()->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoList::IndexByMPXItemId()
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosVideoList::IndexByMPXItemId( TMPXItemId aMpxItemId )
+    {
+    CMPXMedia* media = NULL;
+    TInt count( iVideoList.Count() );
+    
+    for ( TInt i = 0; i < count; i++ )
+        {
+        media = iVideoList[i]->Media();
+
+        if ( media && media->IsSupported( KMPXMediaGeneralId ) )
+            {           
+            if ( aMpxItemId == media->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId ) )
+                {
+                return i;
+                }
+            }
+        }        
+    return KErrNotFound;
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoList::AddToCorrectPlaceL()
+// ----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoList::AddToCorrectPlaceL( CMPXMedia* aVideo,
+        TVcxMyVideosSortingOrder aSortingOrder )
+    {
+    IPTVLOGSTRING_LOW_LEVEL( "MPX My Videos UI # CVcxHgMyVideosVideoList::AddToCorrectPlaceL() - Enter" );
+    
+    if ( aVideo )
+        {        
+        // Ownership of aVideo is transferred.
+        CVcxHgMyVideosVideoListItem* video = CVcxHgMyVideosVideoListItem::NewL( aVideo );
+        CleanupStack::PushL( video );
+		
+		TLinearOrder<CVcxHgMyVideosVideoListItem> sortOrder( 
+            CVcxHgMyVideosVideoListItem::CompareByDate ); 
+            
+        switch( aSortingOrder )
+            {
+            case EVcxMyVideosSortingName:
+                {
+                sortOrder = CVcxHgMyVideosVideoListItem::CompareByName;
+                }
+                break;
+                
+            case EVcxMyVideosSortingSize:
+                {
+                sortOrder = CVcxHgMyVideosVideoListItem::CompareBySize;
+                }
+                break;
+                
+            case EVcxMyVideosSortingCreationDate:
+                {
+                sortOrder = CVcxHgMyVideosVideoListItem::CompareByDate;
+                }
+                break;
+                
+            case EVcxMyVideosSortingModified:
+            case EVcxMyVideosSortingId:
+            default:
+                {
+                CleanupStack::PopAndDestroy( video );
+                IPTVLOGSTRING_LOW_LEVEL( "MPX My Videos UI # CVcxHgMyVideosVideoList::AddToCorrectPlaceL() - LEAVE: Invalid sort order" );
+                User::Leave( KErrNotSupported );
+                }
+                break;
+            }
+                
+        // Ownership of video is transferred.
+        iVideoList.InsertInOrderAllowRepeatsL( video, sortOrder );
+        
+        CleanupStack::Pop( video );
+        }
+    
+    IPTVLOGSTRING_LOW_LEVEL( "MPX My Videos UI # CVcxHgMyVideosVideoList::AddToCorrectPlaceL() - Exit" );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoList::ResortVideoListL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoList::ResortVideoListL( const TVcxMyVideosSortingOrder& aSortingOrder )
+    {    
+    IPTVLOGSTRING_LOW_LEVEL( "MPX My Videos UI # CVcxHgMyVideosVideoList::ResortVideoListL() - Enter" );
+    
+    TLinearOrder<CVcxHgMyVideosVideoListItem> sortOrder( 
+        CVcxHgMyVideosVideoListItem::CompareByDate );
+    
+    switch ( aSortingOrder )
+        {
+        case EVcxMyVideosSortingName:
+            {
+            sortOrder = CVcxHgMyVideosVideoListItem::CompareByName;
+            }
+            break;
+            
+        case EVcxMyVideosSortingSize:
+            {
+            sortOrder = CVcxHgMyVideosVideoListItem::CompareBySize;
+            }
+            break;
+            
+        case EVcxMyVideosSortingCreationDate:
+            {
+            sortOrder = CVcxHgMyVideosVideoListItem::CompareByDate;
+            }
+            break;
+            
+        case EVcxMyVideosSortingModified:
+        case EVcxMyVideosSortingId:
+        default:
+            {
+            IPTVLOGSTRING_LOW_LEVEL( "MPX My Videos UI # CVcxHgMyVideosVideoList::ResortVideoListL() - LEAVE: Invalid sort order" );
+            User::Leave( KErrNotSupported );
+            }
+            break;
+        }
+    iVideoList.Sort( sortOrder );   
+    IPTVLOGSTRING_LOW_LEVEL( "MPX My Videos UI # CVcxHgMyVideosVideoList::ResortVideoListL() - Exit" );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/src/vcxhgmyvideosvideolistimpl.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,1146 @@
+/*
+* 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 of UI functionality for video list.*
+*/
+
+
+
+
+// INCLUDE FILES
+#include <StringLoader.h>
+#include <aknnotewrappers.h>
+#include <centralrepository.h>
+#include <AknsUtils.h>
+#include <AknUtils.h>
+#include <aknlayoutscalable_avkon.cdl.h>
+#include <bautils.h>  
+#include <gulicon.h>
+#include <fbs.h>
+
+#include <sendui.h>
+#include <SendUiConsts.h>
+#include <CMessageData.h>
+#include <MessagingDomainCRKeys.h>
+
+#include <ganes/HgScroller.h>
+#include <ganes/HgDoubleGraphicList.h>
+#include <AknWaitDialog.h> 
+
+#include <vcxhgmyvideos.rsg>
+#include <vcxhgmyvideosicons.mbg>
+#include <vcxmyvideosdefs.h>
+#include <myvideosindicator.h>
+#include "IptvDebug.h"
+
+#include <mpxplaybackutility.h>
+#include <mpxviewutility.h>
+#include <mpxcommandgeneraldefs.h>
+
+#include "vcxhgmyvideosvideolistimpl.h"
+#include "vcxhgmyvideosvideomodelhandler.h"
+#include "vcxhgmyvideosmodel.h"
+#include "vcxhgmyvideosmainview.h"
+#include "vcxhgmyvideoscollectionclient.h"
+#include "vcxhgmyvideos.hrh"
+#include "vcxhgmyvideosvideocopier.h"
+#include "vcxhgmyvideospanics.h"
+#include "vcxhgmyvideosupnpinterface.h"
+#ifdef RD_VIDEO_AS_RINGING_TONE
+#include "vcxhgmyvideosaiwmenuhandler.h"
+#endif
+
+_LIT( KVcxHgMyVideosMifFile, "\\resource\\apps\\vcxhgmyvideosicons.mif" );
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListImpl::NewL()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosVideoListImpl* CVcxHgMyVideosVideoListImpl::NewL(
+        CVcxHgMyVideosModel& aModel,
+        CVcxHgMyVideosMainView& aView,
+        CHgScroller& aScroller )
+    {
+    CVcxHgMyVideosVideoListImpl* self = 
+        CVcxHgMyVideosVideoListImpl::NewLC( aModel, aView, aScroller );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListImpl::NewLC()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosVideoListImpl* CVcxHgMyVideosVideoListImpl::NewLC(
+        CVcxHgMyVideosModel& aModel,
+        CVcxHgMyVideosMainView& aView,
+        CHgScroller& aScroller )
+    {
+    CVcxHgMyVideosVideoListImpl* self = 
+        new (ELeave) CVcxHgMyVideosVideoListImpl( aModel, aView, aScroller );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+    
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListImpl::CVcxHgMyVideosVideoListImpl()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosVideoListImpl::CVcxHgMyVideosVideoListImpl( 
+        CVcxHgMyVideosModel& aModel,
+        CVcxHgMyVideosMainView& aView,
+        CHgScroller& aScroller )
+  : CVcxHgMyVideosListBase( aModel, aView, aScroller )
+#ifdef RD_VIDEO_AS_RINGING_TONE
+    , iAiwMenuHandler( NULL )
+#endif
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListImpl::ConstructL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::ConstructL()
+    {
+    CVcxHgMyVideosListBase::ConstructL();
+
+    iVideoModel = CVcxHgMyVideosVideoModelHandler::NewL( 
+                      *this, iModel, iView, *iScroller );
+
+    iVideoCopier = CVcxHgMyVideosVideoCopier::NewL( *this, *iVideoModel, iModel );
+    
+    iUPnP = CVcxHgMyVideosUPnPInterface::NewL( this );
+    
+    CFbsBitmap* bitmap( NULL );
+    CFbsBitmap* mask( NULL );
+    CGulIcon* defaultIcon( NULL );
+    
+    // Create default icon for Hg list.
+    AknsUtils::CreateIconLC( AknsUtils::SkinInstance(), 
+                             KAknsIIDQgnPropMtvProgClip,
+                             bitmap,
+                             mask,
+                             KVcxHgMyVideosMifFile,
+                             EMbmVcxhgmyvideosiconsQgn_prop_mtv_prog_clip,
+                             EMbmVcxhgmyvideosiconsQgn_prop_mtv_prog_clip_mask );
+    
+    TInt error( KErrNone );
+    error = AknIconUtils::SetSize( bitmap, 
+                                   CHgDoubleGraphicList::PreferredImageSize(), 
+                                   EAspectRatioPreservedAndUnusedSpaceRemoved );
+    User::LeaveIfError( error );
+    
+    error = AknIconUtils::SetSize( mask, 
+                                   CHgDoubleGraphicList::PreferredImageSize(), 
+                                   EAspectRatioPreservedAndUnusedSpaceRemoved );
+    User::LeaveIfError( error );
+    
+    // Ownership of bitmap and mask is transferred to icon.
+    defaultIcon = CGulIcon::NewL( bitmap, mask );
+    CleanupStack::Pop( 2 ); // bitmap and mask
+    
+    CleanupStack::PushL( defaultIcon );
+             
+    // Ownership of icon is transferred.
+    iScroller->SetDefaultIconL( defaultIcon );
+    CleanupStack::Pop( defaultIcon );
+    
+    CGulIcon* ind = iVideoModel->VideoIndicator().VideoOverlayIndicatorL();
+    if ( ind )
+        {
+        CleanupStack::PushL( ind );
+        // Ownership of the icon is transferred
+        static_cast<CHgDoubleGraphicList*>( iScroller )->SetIconOverlayIndicator( ind );
+        CleanupStack::Pop( ind );
+        }
+    
+    iScroller->SetMarkingObserver( *this );
+    iScroller->SetSelectionObserver( *this );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListImpl::~CVcxHgMyVideosVideoListImpl()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosVideoListImpl::~CVcxHgMyVideosVideoListImpl()
+    {
+    CloseDeleteWaitNote();
+    delete iUPnP;
+    delete iVideoCopier;
+    delete iVideoModel;
+    delete iSendUi;
+#ifdef RD_VIDEO_AS_RINGING_TONE
+    delete iAiwMenuHandler;
+#endif
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListImpl::DoListActivateL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::DoListActivateL( TInt aIndex )
+    {
+    TInt index = aIndex;
+    TInt currentIndex = iVideoModel->CurrentCategoryIndex();
+    index = ( ( index != KErrNotFound ) ? index : currentIndex );
+    index = ( ( index != KErrNotFound ) ? index : 0 );
+
+    iVideoModel->UpdateVideoListL( index );
+    
+    iVideoModel->DoModelActivateL();
+    CVcxHgMyVideosListBase::DoListActivateL( index );
+    if ( index != currentIndex )
+        {
+        // Prevents old list from flickering
+        iScroller->DrawNow();
+        }
+    iScroller->SetFocus( ETrue );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListImpl::DoListDeactivate()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::DoListDeactivate()
+    {
+    CVcxHgMyVideosListBase::DoListDeactivate();
+    iVideoModel->DoModelDeactivate();
+    iScroller->SetFocus( EFalse );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListImpl::VideoModel()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosVideoModelHandler& CVcxHgMyVideosVideoListImpl::VideoModel()
+    {
+    return *iVideoModel;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListImpl::UPnPInterface()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosUPnPInterface& CVcxHgMyVideosVideoListImpl::UPnPInterface()
+    {
+    return *iUPnP;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListImpl::HandleSelectL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::HandleSelectL( TInt /*aIndex*/ )
+    {
+	iView.DynInitMskL();
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListImpl::HandleOpenL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::HandleOpenL( TInt /*aIndex*/ )
+    {
+    // Reset the visible selection of the list.
+    iScroller->DrawDeferred();
+    
+    if ( iModel.TouchSupport() )
+        {    
+        PlayCurrentVideoL();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListImpl::HandleMarkingL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::HandleMarkingL( TInt /*aIndex*/, TBool /*aMarked*/ )
+    {    
+    iView.DynInitMskL();
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListImpl::Highlight()
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosVideoListImpl::Highlight()
+    {
+    return iVideoModel->Highlight();
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListImpl::GetOperationTargetIndexesL()
+// Returns the index(es) of videos that should be the target for user's 
+// operation.
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::GetOperationTargetIndexesL( 
+        RArray<TInt>& aOperationTargets )
+    {
+    iVideoModel->MarkedVideosL( aOperationTargets );
+
+    if ( aOperationTargets.Count() == 0 )
+        {
+        TInt highlight = Highlight();
+        if ( highlight == KErrNotFound )
+            {
+            User::Leave( KErrNotFound );
+            }
+
+        aOperationTargets.AppendL( highlight );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListImpl::PlayCurrentVideoL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::PlayCurrentVideoL()
+    {
+    PlayVideoL();
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListImpl::DeleteVideosL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::DeleteVideosL()
+    {
+    IPTVLOGSTRING_LOW_LEVEL( "MPX My Videos UI # CVcxHgMyVideosVideoListImpl::DeleteVideosL()" );
+    RArray<TInt> operationTargetIndexes;
+	RArray<TInt> operationTargetIds;
+    CleanupClosePushL( operationTargetIndexes );
+    CleanupClosePushL( operationTargetIds );
+    
+    GetOperationTargetIndexesL( operationTargetIndexes );
+    OperationTargetsToMpxIdsL( operationTargetIndexes, operationTargetIds );
+
+    if ( ConfirmDeleteVideosL( operationTargetIndexes.Count(),
+                               iVideoModel->GetVideoName( operationTargetIds[0] ) ) )
+        {
+        HandleMarkCommandL( EVcxHgMyVideosCmdUnmarkAll );
+
+        // Wait note is closed in destructor (CloseDeleteWaitNote()), 
+        // in DialogDismissedL() or in VideoDeletionCompletedL().
+        OpenDeleteWaitNoteL();
+
+        TRAPD( err, iVideoModel->DeleteVideosL( operationTargetIds ) );
+        
+        if( err != KErrNone )
+            {
+            CloseDeleteWaitNote();
+            }
+        }
+
+    CleanupStack::PopAndDestroy( &operationTargetIds );
+    CleanupStack::PopAndDestroy( &operationTargetIndexes );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListImpl::ConfirmDeleteVideosL()
+// -----------------------------------------------------------------------------
+//
+TBool CVcxHgMyVideosVideoListImpl::ConfirmDeleteVideosL( TInt aTargetCount,
+                                                         const TDesC& aTargetName )
+    {
+    HBufC* text = NULL;
+
+    if ( aTargetCount == 1 )
+        {
+        text = StringLoader::LoadLC( R_VCXHGMYVIDEOS_QUERY_COMMON_CONF_DELETE, aTargetName );
+        }
+    else if ( aTargetCount > 1 )
+        {
+        text = StringLoader::LoadLC( R_VCXHGMYVIDEOS_FLDR_DEL_ITEMS_QUERY, aTargetCount );
+        }
+
+    if ( text )
+        {
+        CAknQueryDialog* dlg = CAknQueryDialog::NewL();
+
+        TInt result = dlg->ExecuteLD( R_VCXHGMYVIDEOS_DELETE_CONFIRMATION_QUERY, *text );
+        CleanupStack::PopAndDestroy( text );
+
+        if ( result == EAknSoftkeyYes || result == EAknSoftkeyOk )
+            {
+            return ETrue;
+            }
+        }
+
+    return EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListImpl::OpenDeleteWaitNoteL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::OpenDeleteWaitNoteL()
+    {
+    CloseDeleteWaitNote();
+
+    iDeleteWaitDialog = new (ELeave) 
+            CAknWaitDialog( ( REINTERPRET_CAST( CEikDialog**, &iDeleteWaitDialog ) ), ETrue );
+    iDeleteWaitDialog->SetCallback( this );
+    iDeleteWaitDialog->ExecuteLD( R_VCXHGMYVIDEOS_DELETING_WAIT_NOTE );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListImpl::CloseDeleteWaitNote()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::CloseDeleteWaitNote()
+    {
+    if ( iDeleteWaitDialog )
+        {
+        TRAPD( error, iDeleteWaitDialog->ProcessFinishedL() );
+        if ( error != KErrNone )
+            {
+            delete iDeleteWaitDialog;
+            }
+        iDeleteWaitDialog = NULL;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListImpl::CommandComplete()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::CommandComplete( TInt /*aStatusCode*/ )
+    {
+    // status larger than KErrNone does not require any attention.
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListImpl::DialogDismissedL()
+// Callback about (delete) wait note dismissal.
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::DialogDismissedL( TInt aButtonId )
+    {
+    if ( aButtonId == EAknSoftkeyCancel )
+        {
+        iModel.CollectionClient().CancelDeleteVideosL();
+        }
+    
+    iDeleteWaitDialog = NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListImpl::VideoDeletionCompletedL()
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosVideoListImpl::VideoDeletionCompletedL( TInt aFailedCount,
+                                                           const TDesC& aFailedName )
+    {
+    CloseDeleteWaitNote();
+
+    if ( aFailedCount > 0 )
+        {
+        HBufC* text = NULL;
+
+        if ( aFailedCount == 1 )
+            {
+            text = StringLoader::LoadLC( R_VCXHGMYVIDEOS_FLDR_CANT_DELETE_FILE_OPEN, aFailedName );
+            }
+        else
+            {
+            text = StringLoader::LoadLC( R_VCXHGMYVIDEOS_CANT_DELETE_ITEMS );
+            }
+
+        CAknErrorNote* note = new ( ELeave ) CAknErrorNote( ETrue );
+        note->ExecuteLD( *text );
+        CleanupStack::PopAndDestroy( text );  
+        }    
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListImpl::PlayVideoL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::PlayVideoL()
+    {
+    RArray<TInt> operationTargets;
+    CleanupClosePushL( operationTargets );
+    
+    GetOperationTargetIndexesL( operationTargets );
+    HandleMarkCommandL( EVcxHgMyVideosCmdUnmarkAll );
+    
+    // Currently only play one video
+    // Need to handle multiply selected videos
+    for ( TInt i = operationTargets.Count() - 1; i >= 0; i-- )
+        {
+        if( !iUPnP->IsStarted() )
+            {
+            iVideoModel->PlayVideoL( operationTargets[i] );
+
+            iModel.SetAppState( CVcxHgMyVideosModel::EVcxMyVideosAppStatePlayer );
+            }
+        else // UPnP started
+            {
+            TInt err(KErrNone); 
+            
+            err = iUPnP->ShowVideo( iVideoModel->GetVideoUri( operationTargets[0] ) );
+
+            if( err != KErrNone )
+                {
+                // some general upnp framework error, 
+                // call stop to deallocate
+                iUPnP->Stop();
+                }
+            }        
+        break;
+        }
+    
+    CleanupStack::PopAndDestroy( &operationTargets );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListImpl::HandleSortCommandL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::HandleSortCommandL( TInt aSortCommand )
+    {
+    TVcxMyVideosSortingOrder currentOrder = iModel.VideolistSortOrderL();
+    TVcxMyVideosSortingOrder wantedOrder( EVcxMyVideosSortingNone );
+        
+    switch ( aSortCommand )
+        {
+        case EVcxHgMyVideosCmdSortByDate:
+            {
+            wantedOrder = EVcxMyVideosSortingCreationDate;
+            break;
+            }
+        case EVcxHgMyVideosCmdSortByName:
+            {
+            wantedOrder = EVcxMyVideosSortingName;
+            break;
+            }            
+        case EVcxHgMyVideosCmdSortBySize:
+            {
+            wantedOrder = EVcxMyVideosSortingSize;
+            break;
+            }
+        default:
+            {
+            User::Leave( KErrNotSupported );
+            break;
+            }
+        }
+
+    if ( currentOrder != wantedOrder )
+        {
+        iModel.SetVideolistSortOrderL( wantedOrder );
+        iVideoModel->ResortVideoListL();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListImpl::ShowMarkMenuItemsL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::ShowMarkMenuItemsL( 
+        TBool& aShowMarkSubmenu,
+        TBool& showStartMarking,
+        TBool& showEndMarking, 
+        TBool& aShowMarkAll,
+        TBool& aShowUnmarkAll )
+    {
+    RArray<TInt> markedVideos;
+    CleanupClosePushL( markedVideos );
+    
+    iVideoModel->MarkedVideosL( markedVideos );
+    
+    TInt count = iVideoModel->VideoCount();
+    TInt highlight = Highlight();
+
+    // Set menu visibility information.
+    TBool markingMode( IsMarking() );
+    showStartMarking = !markingMode;
+    showEndMarking = markingMode;
+    aShowMarkAll = ( ( count > 0 ) && ( markedVideos.Count() < count ) );
+    aShowUnmarkAll = ( ( count > 0 ) && ( markedVideos.Count() > 0 ) );
+    aShowMarkSubmenu = ( showStartMarking || showEndMarking || aShowMarkAll || aShowUnmarkAll );
+    
+    CleanupStack::PopAndDestroy( &markedVideos );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListImpl::HandleMarkCommandL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::HandleMarkCommandL( TInt aMarkCommand )
+    {
+    IPTVLOGSTRING_LOW_LEVEL( "MPX My Videos UI # CVcxHgMyVideosVideoListImpl::HandleMarkCommandL()" );
+    
+    switch ( aMarkCommand )
+        {
+        case EVcxHgMyVideosCmdToggleMultipleMarking:
+            {
+            StartMarkingMode();
+            break;
+            }
+        case EVcxHgMyVideosCmdStopMarking:
+            {
+            iVideoModel->HandleMarkCommandL( EVcxHgMyVideosCmdUnmarkAll );
+            EndMarkingMode();
+            break;
+            }
+        case EVcxHgMyVideosCmdMark:
+        case EVcxHgMyVideosCmdMarkAll:
+            {
+            iVideoModel->HandleMarkCommandL( aMarkCommand );
+            StartMarkingMode();
+            break;
+            }
+        case EVcxHgMyVideosCmdUnmark:
+        case EVcxHgMyVideosCmdUnmarkAll:
+            {
+            iVideoModel->HandleMarkCommandL( aMarkCommand );
+            EndMarkingMode();
+            break;
+            }
+        case EVcxHgMyVideosCmdMarkContext:
+            {
+            iVideoModel->HandleMarkCommandL( EVcxHgMyVideosCmdMark );
+            StartMarkingMode();
+            break;
+            }
+        default:
+            break;
+        }
+    
+    iView.DynInitMskL();
+    iView.DynInitRskL();
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListImpl::HandleMoveOrCopyCommandL() 
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::HandleMoveOrCopyCommandL( TBool aCopy )
+    {
+    RArray<TInt> operationTargetIndexes;
+	RArray<TInt> operationTargetIds;
+    CleanupClosePushL( operationTargetIndexes );
+    CleanupClosePushL( operationTargetIds );
+    
+    GetOperationTargetIndexesL( operationTargetIndexes );
+    OperationTargetsToMpxIdsL( operationTargetIndexes, operationTargetIds );
+    
+    HandleMarkCommandL( EVcxHgMyVideosCmdUnmarkAll );
+    iVideoCopier->MoveOrCopyL( operationTargetIds, aCopy );
+    
+    CleanupStack::PopAndDestroy( &operationTargetIds );
+    CleanupStack::PopAndDestroy( &operationTargetIndexes );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListImpl::VideoMoveOrCopyCompletedL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::VideoMoveOrCopyCompletedL( TInt aFailedCount,
+                                                             const TDesC& aFailedName )
+    {
+    iVideoCopier->VideoMoveOrCopyCompletedL( aFailedCount, aFailedName );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListImpl::ShowResumeStartsFromBeginningNoteL() 
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::ShowResumeStartsFromBeginningNoteL()
+    {
+    HBufC* text = StringLoader::LoadLC( R_VCXHGMYVIDEOS_RESUME_NOT_POSSIBLE );
+    CAknInformationNote* note = new( ELeave ) CAknInformationNote( ETrue );
+    note->ExecuteLD( *text );
+    CleanupStack::PopAndDestroy( text );     
+    }
+
+// ------------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListImpl::DynInitMenuPaneL()
+// ------------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::DynInitMenuPaneL( TInt aResourceId,
+                                                    CEikMenuPane* aMenuPane )
+    {
+#ifdef RD_VIDEO_AS_RINGING_TONE
+    if ( AiwMenuHandlerL()->TryHandleSubmenuL( aMenuPane ) )
+        {
+        // Submenu was initialized by Aiw
+        return;
+        }
+#endif
+
+    if ( aResourceId == R_VCXHGMYVIDEOS_MAINVIEW_MENU )
+        {
+        // Check if list has videos marked
+        RArray<TInt> markedVideos;
+        CleanupClosePushL( markedVideos );
+        iVideoModel->MarkedVideosL( markedVideos );
+        TBool videosMarked = ( markedVideos.Count() > 0 );
+        CleanupStack::PopAndDestroy( &markedVideos );
+
+        TInt highlight = Highlight();
+        TInt count = iVideoModel->VideoCount();
+
+        // Show play menuitem for non-touch
+        if ( ! iModel.TouchSupport() )
+            {
+            TBool showPlay = ( !videosMarked && ( highlight >= 0 ) && ( count > 0 ) );
+            aMenuPane->SetItemDimmed( EVcxHgMyVideosCmdPlay, ! showPlay );
+            }
+        else
+            {
+            if ( IsMarking() )
+                {
+                aMenuPane->SetItemDimmed( EVcxHgMyVideosCmdPlay, ETrue );
+                }
+            }
+
+        if ( count > 0 )
+            {
+            // Video details.
+            TBool showVideoDetails = ( !videosMarked && highlight >= 0 );
+            aMenuPane->SetItemDimmed( EVcxHgMyVideosCmdVideoDetails, !showVideoDetails );
+
+            // UPnP menu item. Item's behaviour follows video details item.
+            if ( showVideoDetails && iUPnP->IsApplicable() )
+                {
+                if ( iUPnP->IsStarted() )
+                    {
+                    aMenuPane->SetItemDimmed( EVcxHgMyVideosCmdStopShowViaHomenet, EFalse);
+                    }
+                else
+                    {
+                    aMenuPane->SetItemDimmed( EVcxHgMyVideosCmdShowViaHomenet, EFalse );
+                    }
+                }
+
+            // Move, copy, delete
+            DynInitMenuPaneFileOperationsL( aMenuPane, videosMarked );
+
+            // Send item
+            if ( highlight >= 0 || videosMarked )
+                {
+                AddSendItemToMenuPaneL( aMenuPane );
+                }
+
+#ifdef RD_VIDEO_AS_RINGING_TONE
+            // Assign (use as) menu item
+            if ( !videosMarked && highlight >= 0 )
+                {
+                aMenuPane->SetItemDimmed( EVcxHgMyVideosCmdAiwAssign, EFalse );
+                }
+            else
+                {
+                // Hide Assign (use as) menu item
+                aMenuPane->SetItemDimmed( EVcxHgMyVideosCmdAiwAssign, ETrue );
+                }
+#endif
+
+            // Marking submenu
+            // Show "Mark/Unmark" only if there are videos in the list
+            aMenuPane->SetItemDimmed( EVcxHgMyVideosCmdMarkUnmarkSubMenu, EFalse);
+            }
+
+        // "Sort by" submenu
+        if( count == 0 )
+            {
+            // Dont show "Sort by" if list is empty.
+            aMenuPane->SetItemDimmed( EVcxHgMyVideosCmdSortSubMenu, ETrue );
+            }
+
+        // Hide "Settings" menu item
+        aMenuPane->SetItemDimmed( EVcxHgMyVideosCmdOpenSettings, ETrue );
+        }
+
+#ifdef RD_VIDEO_AS_RINGING_TONE
+    else if ( aResourceId == R_VCXHGMYVIDEOS_USE_AS_SUBMENU )
+        {
+        RArray<TInt> operationTargets;
+        CleanupClosePushL( operationTargets );
+
+        GetOperationTargetIndexesL( operationTargets );
+        if ( operationTargets.Count() > 0 )
+            {
+            HBufC* videoUri = iVideoModel->GetVideoUri( operationTargets[0] ).AllocLC();
+            if ( videoUri->Length() 
+                    && BaflUtils::FileExists( iModel.FileServerSessionL(), *videoUri ) )
+                {
+                AiwMenuHandlerL()->InitializeMenuPaneL(
+                        aResourceId,
+                        aMenuPane,
+                        *videoUri,
+                        KNullDesC );    //mime type
+                }
+            CleanupStack::PopAndDestroy( videoUri );
+            }
+        CleanupStack::PopAndDestroy( &operationTargets );
+        }
+#endif    
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListImpl::SetEmptyListTextL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::SetEmptyListTextL()
+    {
+    CVcxHgMyVideosListBase::SetEmptyListTextByResourceL( R_VCXHGMYVIDEOS_OPENING_VIDEOS );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListImpl::SetTitleTextL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::SetTitleTextL( TInt aIndex )
+    {
+    switch ( aIndex )
+        {
+        case KVcxMvcCategoryIdAll:
+            CVcxHgMyVideosListBase::SetTitleTextByResourceL( R_VCXHGMYVIDEOS_ALL_VIDEOS_TITLE );
+            break;
+        case KVcxMvcCategoryIdDownloads:
+            CVcxHgMyVideosListBase::SetTitleTextByResourceL( R_VCXHGMYVIDEOS_DOWNLOADS_TITLE );
+            break;
+        case KVcxMvcCategoryIdCaptured:
+            CVcxHgMyVideosListBase::SetTitleTextByResourceL( R_VCXHGMYVIDEOS_CAPTURED_TITLE );
+            break;
+        case KVcxMvcCategoryIdOther:
+            CVcxHgMyVideosListBase::SetTitleTextByResourceL( R_VCXHGMYVIDEOS_OTHER_TITLE );
+            break;
+        default:
+            {
+            IPTVLOGSTRING_LOW_LEVEL(
+                "MPX My Videos UI # ...VideoListImpl::SetTitleTextL() Unexpected category!" );
+            }
+            break;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListImpl::GetMskResourceL()
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosVideoListImpl::GetMskResourceL()
+    {
+    RArray<TInt> markedVideos;
+    CleanupClosePushL( markedVideos );
+    
+    iVideoModel->MarkedVideosL( markedVideos );
+    TInt highlight = Highlight();
+    TInt count = iVideoModel->VideoCount();
+
+    TBool showPlay = ( ( markedVideos.Count() == 0 ) && ( highlight >= 0 ) && ( count > 0 ) );
+    
+    CleanupStack::PopAndDestroy( &markedVideos );
+    
+    if ( showPlay )
+        {
+        return R_VCXHGMYVIDEOS_MSK_PLAY;
+        }
+    else if ( count == 0 )
+        {
+        return R_VCXHGMYVIDEOS_MSK_NOTHING;
+        }
+    else
+        {
+        return R_VCXHGMYVIDEOS_MSK_CONTEXTMENU;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListImpl::StartMarkingMode()
+// ---------------------------------------------------------------------------
+//  
+void CVcxHgMyVideosVideoListImpl::StartMarkingMode()
+    {
+    IPTVLOGSTRING2_LOW_LEVEL( "MPX My Videos UI # CVcxHgMyVideosVideoListImpl::StartMarkingMode() IsMarking = %d", IsMarking() );
+    
+    // Start multiple marking mode
+    if ( iModel.TouchSupport() )
+        {
+        iScroller->SetFlags( CHgScroller::EHgScrollerSelectionMode );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListImpl::EndMarkingMode()
+// ---------------------------------------------------------------------------
+//  
+void CVcxHgMyVideosVideoListImpl::EndMarkingMode()
+    {
+    IPTVLOGSTRING2_LOW_LEVEL( "MPX My Videos UI # CVcxHgMyVideosVideoListImpl::EndMarkingMode() IsMarking = %d", IsMarking() );
+
+    // End multiple marking mode
+    iScroller->ClearFlags( CHgScroller::EHgScrollerSelectionMode );
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListImpl::HandleSendL()
+// ---------------------------------------------------------------------------
+//  
+void CVcxHgMyVideosVideoListImpl::HandleSendL()
+    {
+    IPTVLOGSTRING_LOW_LEVEL( "CVcxHgMyVideosVideoListImpl::HandleSendL() ENTER" );
+
+    // Create message and disabled transports filter
+    CMessageData* message = CMessageData::NewLC();
+    CArrayFixFlat< TUid >* mtmFilter = new( ELeave ) CArrayFixFlat< TUid >( 1 );
+    CleanupStack::PushL( mtmFilter );
+
+    if ( MessagingConfL() & KMuiuEmailDisabledInMultimedia )
+        {
+        IPTVLOGSTRING_LOW_LEVEL( "CVcxHgMyVideosVideoListImpl::HandleSendL() send via email disabled" );
+        // Send via email disabled in CenRep, add to filter to disable
+        mtmFilter->AppendL( KSenduiMtmSmtpUid );
+        mtmFilter->AppendL( KSenduiMtmSyncMLEmailUid );
+        }
+
+    // Get the selected video(s) and attach
+    RArray<TInt> operationTargets;
+    CleanupClosePushL( operationTargets );
+    
+    GetOperationTargetIndexesL( operationTargets );
+    TInt64 attachmentsTotalSize( 0 );
+
+    IPTVLOGSTRING2_LOW_LEVEL( "CVcxHgMyVideosVideoListImpl::HandleSendL() targets count: %d", operationTargets.Count() );
+    for ( TInt i = 0; i < operationTargets.Count(); i++ )
+        {
+        HBufC* videoUri = iVideoModel->GetVideoUri( operationTargets[i] ).AllocLC();
+        TInt64 videoSize = iVideoModel->GetVideoSize( operationTargets[i] );
+
+        IPTVLOGSTRING3_LOW_LEVEL( "CVcxHgMyVideosVideoListImpl::HandleSendL() file: %S (%ld bytes)", videoUri, videoSize );
+
+        // Attach file to message
+        if ( videoUri->Length() > 0 && videoSize > 0 )
+            {
+            message->AppendAttachmentL( *videoUri );
+            attachmentsTotalSize += videoSize;
+            }
+
+        CleanupStack::PopAndDestroy( videoUri );
+        }
+
+    // Send message if it has attachment(s)
+    TSendingCapabilities capabilities( 0, attachmentsTotalSize, TSendingCapabilities::ESupportsAttachments );
+    if ( message->AttachmentArray().MdcaCount() > 0 )
+        {
+        IPTVLOGSTRING_LOW_LEVEL( "CVcxHgMyVideosVideoListImpl::HandleSendL() send message" );
+        SendUiL()->ShowQueryAndSendL( message, capabilities, mtmFilter, KNullUid, EFalse );
+        HandleMarkCommandL( EVcxHgMyVideosCmdUnmarkAll );
+        }
+
+    CleanupStack::PopAndDestroy( &operationTargets );
+    CleanupStack::PopAndDestroy( mtmFilter );
+    CleanupStack::PopAndDestroy( message );
+
+    IPTVLOGSTRING_LOW_LEVEL( "CVcxHgMyVideosVideoListImpl::HandleSendL() EXIT" );
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListImpl::MessagingConfL()
+// ---------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosVideoListImpl::MessagingConfL()
+    {
+    IPTVLOGSTRING_LOW_LEVEL( "CVcxHgMyVideosVideoListImpl::MessagingConfL()" );
+    TInt messagingConf;
+    CRepository* cenrep = CRepository::NewL( KCRUidMuiuMessagingConfiguration );
+    TInt cenrepErr( cenrep->Get( KMuiuSendUiConfiguration, messagingConf ) );
+    delete cenrep;
+    User::LeaveIfError( cenrepErr );
+    return messagingConf;
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListImpl::SendUi()
+// ---------------------------------------------------------------------------
+//
+CSendUi* CVcxHgMyVideosVideoListImpl::SendUiL()
+    {
+    if ( !iSendUi )
+        {
+        iSendUi = CSendUi::NewL();
+        }
+    return iSendUi;
+    }
+
+#ifdef RD_VIDEO_AS_RINGING_TONE
+// ---------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListImpl::TryHandleAiwCommandL()
+// ---------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::TryHandleAiwCommandL( TInt aCommand )
+    {
+    if ( AiwMenuHandlerL()->IsAiwCommand( aCommand ) )
+        {
+        // Call AIW service handler
+        RArray<TInt> operationTargets;
+        CleanupClosePushL( operationTargets );
+        
+        GetOperationTargetIndexesL( operationTargets );
+        if ( operationTargets.Count() > 0 )
+            {
+            HBufC* videoUri = iVideoModel->GetVideoUri( operationTargets[0] ).AllocLC();
+            if ( videoUri->Length() )
+                {
+                AiwMenuHandlerL()->HandleAiwCommandL(
+                        aCommand,
+                        *videoUri,
+                        KNullDesC );    //mime type
+                }
+            CleanupStack::PopAndDestroy( videoUri );
+            }
+        CleanupStack::PopAndDestroy( &operationTargets );
+        }
+    }
+#endif
+
+// ---------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListImpl::IsMarking()
+// ---------------------------------------------------------------------------
+//
+TBool CVcxHgMyVideosVideoListImpl::IsMarking()
+    {
+    TBool ret( EFalse );
+    
+    if( iScroller->Flags() & CHgScroller::EHgScrollerSelectionMode )
+        {
+        ret = ETrue;
+        }
+    return ret;
+    }
+
+#ifdef RD_VIDEO_AS_RINGING_TONE
+// ---------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListImpl::AiwMenuHandlerL()
+// ---------------------------------------------------------------------------
+//
+CHgMyVideosAiwMenuHandler* CVcxHgMyVideosVideoListImpl::AiwMenuHandlerL()
+    {
+    if ( !iAiwMenuHandler )
+        {
+        iAiwMenuHandler = new (ELeave) CHgMyVideosAiwMenuHandler();
+        iAiwMenuHandler->AttachMenuL( R_VCXHGMYVIDEOS_USE_AS_SUBMENU );
+        }
+    return iAiwMenuHandler;
+    }
+#endif
+
+// ---------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListImpl::OperationTargetsToMpxIdsL()
+// ---------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::OperationTargetsToMpxIdsL( 
+                                       RArray<TInt>& aOperationTargetIndexes,  
+                                       RArray<TInt>& aOperationTargetIds )
+    {
+    for ( TInt i = 0; i < aOperationTargetIndexes.Count(); i++ )
+        {
+		if ( iVideoModel->GetVideoId( aOperationTargetIndexes[i] ) != KErrNotFound )
+            {
+            aOperationTargetIds.Append( iVideoModel->GetVideoId( aOperationTargetIndexes[i] ) );
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListImpl::AddSendItemToMenuPaneL()
+// ---------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::AddSendItemToMenuPaneL( 
+        CEikMenuPane* aMenuPane )
+    {
+    IPTVLOGSTRING_LOW_LEVEL( "CVcxHgMyVideosVideoListImpl::AddSendItemToMenuPaneL() enter" );
+    // Get total size of the videos that we're about to send
+    RArray<TInt> operationTargets;
+    CleanupClosePushL( operationTargets );
+
+    GetOperationTargetIndexesL( operationTargets );
+    TInt64 attachmentsTotalSize( 0 );
+    for ( TInt i = 0; i < operationTargets.Count(); i++ )
+        {
+        attachmentsTotalSize += iVideoModel->GetVideoSize( operationTargets[i] );
+        }
+
+    IPTVLOGSTRING3_LOW_LEVEL( "CVcxHgMyVideosVideoListImpl::AddSendItemToMenuPaneL() %d files with total size %ld", operationTargets.Count(), attachmentsTotalSize );
+
+    // SendUi uses TInt for size, hide Send menu item for over 2GB attachments
+    if ( attachmentsTotalSize > 0 && attachmentsTotalSize < KMaxTInt )
+        {
+        // Find place for Send menu item on top of "Use as" (Assign) or Sort submenu
+        TInt sendItemIndex = 0;
+#ifdef RD_VIDEO_AS_RINGING_TONE
+        aMenuPane->ItemAndPos( EVcxHgMyVideosCmdAiwAssign, sendItemIndex );
+#else
+        aMenuPane->ItemAndPos( EVcxHgMyVideosCmdSortSubMenu, sendItemIndex );
+#endif
+        // Add Send item to context menu
+        TSendingCapabilities capabilities(
+            0,
+            attachmentsTotalSize,
+            TSendingCapabilities::ESupportsAttachments );
+        SendUiL()->AddSendMenuItemL(
+                *aMenuPane,
+                sendItemIndex,
+                EVcxHgMyVideosCmdSend,
+                capabilities );
+        aMenuPane->SetItemSpecific( EVcxHgMyVideosCmdSend, ETrue );
+        // The Send item also needs to be flagged as a list query.
+        CEikMenuPaneItem::SData& itemData = aMenuPane->ItemData( EVcxHgMyVideosCmdSend );
+        itemData.iFlags |= EEikMenuItemSpecificListQuery;
+        }
+    CleanupStack::PopAndDestroy( &operationTargets );
+    IPTVLOGSTRING_LOW_LEVEL( "CVcxHgMyVideosVideoListImpl::AddSendItemToMenuPaneL() return" );
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListImpl::DynInitMenuPaneFileOperationsL()
+// ---------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::DynInitMenuPaneFileOperationsL(
+        CEikMenuPane* aMenuPane,
+        TBool aItemsMarked )
+    {
+    // Delete
+    TBool showDelete = ( ( Highlight() >= 0 ) || aItemsMarked );
+
+    // Move and copy
+    RArray<TInt> operationTargets;
+    CleanupClosePushL( operationTargets );
+
+    TRAPD( error, GetOperationTargetIndexesL( operationTargets ) );
+
+    TBool showMoveAndCopySubmenu( EFalse );
+    TBool showCopy( EFalse );
+    TBool showMove( EFalse );
+
+    if ( error == KErrNone )
+        {
+        iVideoCopier->ShowMenuItemsL( operationTargets,
+                                      showMoveAndCopySubmenu,
+                                      showCopy,
+                                      showMove );
+        }
+
+    aMenuPane->SetItemDimmed( EVcxHgMyVideosCmdCopy, !showCopy );
+    aMenuPane->SetItemDimmed( EVcxHgMyVideosCmdMove, !showMove );
+    aMenuPane->SetItemDimmed( EVcxHgMyVideosCmdDelete, !showDelete );
+
+    CleanupStack::PopAndDestroy( &operationTargets );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/src/vcxhgmyvideosvideolistitem.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -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:   CVcxHgMyVideosVideoListItem class implementation*
+*/
+
+
+
+
+// INCLUDE FILES
+#include <mpxmedia.h>
+#include <collate.h>
+#include <mpxmediageneraldefs.h>
+#include <mpxmediageneralextdefs.h>
+#include "vcxhgmyvideosvideolistitem.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListItem::NewL()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosVideoListItem* CVcxHgMyVideosVideoListItem::NewL( CMPXMedia* aMPXMedia )
+    {
+    CVcxHgMyVideosVideoListItem* self = 
+        CVcxHgMyVideosVideoListItem::NewLC( aMPXMedia );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListItem::NewLC()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosVideoListItem* CVcxHgMyVideosVideoListItem::NewLC( CMPXMedia* aMPXMedia )
+    {
+    CVcxHgMyVideosVideoListItem* self = 
+        new (ELeave) CVcxHgMyVideosVideoListItem( aMPXMedia );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListItem::CVcxHgMyVideosVideoListItem()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosVideoListItem::CVcxHgMyVideosVideoListItem( CMPXMedia* aMPXMedia ) : 
+    iMedia( aMPXMedia )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListItem::ConstructL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListItem::ConstructL()
+    {
+    // No implementation required.
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListItem::~CVcxHgMyVideosVideoListItem()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosVideoListItem::~CVcxHgMyVideosVideoListItem()
+    {
+    delete iMedia;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListItem::CompareBySize()
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosVideoListItem::CompareBySize( 
+    const CVcxHgMyVideosVideoListItem& aNewVideo,
+    const CVcxHgMyVideosVideoListItem& aVideoInArray )
+    {
+    TInt result( 0 );
+     
+    TInt64 newItemsSize = aNewVideo.iMedia->ValueTObjectL<TInt64>( KMPXMediaGeneralExtSizeInt64 );
+    TInt64 arrayItemsSize = aVideoInArray.iMedia->ValueTObjectL<TInt64>( KMPXMediaGeneralExtSizeInt64 );
+
+    if ( arrayItemsSize > newItemsSize )
+        {
+        result = -1;
+        }
+    else if ( arrayItemsSize < newItemsSize )
+        {
+        result = 1;    
+        }
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListItem::CompareByName()
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosVideoListItem::CompareByName( 
+    const CVcxHgMyVideosVideoListItem& aNewVideo,
+    const CVcxHgMyVideosVideoListItem& aVideoInArray )
+    {        
+    TPtrC newVideoName( aNewVideo.iMedia->ValueText( KMPXMediaGeneralTitle ) );
+    TPtrC videoInArrayName( aVideoInArray.iMedia->ValueText( KMPXMediaGeneralTitle ));
+    
+    TCollationMethod collationMethod = *Mem::CollationMethodByIndex( 0 ); // get the standard method
+    collationMethod.iFlags |= TCollationMethod::EFoldCase;
+    
+    return newVideoName.CompareC( videoInArrayName, 3, &collationMethod );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListItem::CompareByDate()
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosVideoListItem::CompareByDate( 
+    const CVcxHgMyVideosVideoListItem& aNewVideo,
+    const CVcxHgMyVideosVideoListItem& aVideoInArray )
+    {
+    TInt result( 0 );
+    
+    TInt64 newItemsDate = aNewVideo.iMedia->ValueTObjectL<TInt64>( KMPXMediaGeneralDate );
+    TInt64 arrayItemsDate = aVideoInArray.iMedia->ValueTObjectL<TInt64>( KMPXMediaGeneralDate );
+    
+    if ( arrayItemsDate > newItemsDate )
+        {
+        result = 1;
+        }
+    else if ( arrayItemsDate < newItemsDate )
+        {
+        result = -1; 
+        }
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoListItem::Media()
+// -----------------------------------------------------------------------------
+//
+CMPXMedia* CVcxHgMyVideosVideoListItem::Media()
+    {
+    return iMedia;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/src/vcxhgmyvideosvideomodelhandler.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,1447 @@
+/*
+* Copyright (c) 2008-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:      UI level handler for video data.*
+*/
+
+
+
+
+// INCLUDE FILES
+#include <StringLoader.h>
+#include <mpxmediageneraldefs.h>
+#include <mpxmediageneralextdefs.h>
+#include <mpxmedia.h>
+#include <mpxmediaarray.h>
+
+#include <ganes/HgScroller.h>
+#include <ganes/HgItem.h>
+
+#include <vcxhgmyvideos.rsg>
+#include <vcxmyvideosdefs.h>
+#include <MPFileDetailsDialog.h>
+#include <myvideosindicator.h>
+#include <centralrepository.h>
+
+#include "IptvDebug.h"
+
+#include "vcxhgmyvideosmodel.h"
+#include "vcxhgmyvideosmainview.h"
+#include "vcxhgmyvideoscollectionclient.h"
+#include "vcxhgmyvideosvideomodelhandler.h"
+#include "vcxhgmyvideosvideolistimpl.h"
+#include "vcxhgmyvideosvideodataupdater.h"
+#include "vcxhgmyvideosthumbnailmanager.h"
+
+#include "vcxhgmyvideos.hrh"
+#include "vcxhgmyvideoslistbase.h"
+#include "vcxhgmyvideosindicatorhelper.h"
+#include "vcxhgmyvideosvideodetailsdialog.h"
+#include "vcxhgmyvideosvideolist.h"
+#include "vcxhgmyvideospanics.h"
+
+// CONSTANTS
+const TUint KVcxSecondsInMinute( 60 );
+const TUint KVcxSecondsInHour( 3600 );
+const TUint KVcxVideoSizeGB( 0x40000000 );
+const TUint KVcxVideoSizeHalfGB( 0x20000000 );
+const TUint KVcxVideoSizeMB( 0x100000 );
+const TUint KVcxVideoSizeHalfMB( 0x80000 );
+const TUint KVcxVideoSizeKB( 0x400 );
+const TUint KVcxVideoSizeHalfKB( 0x200 ); 
+
+const TUint KHgBufferSize( 250 );
+const TUint KHgBufferTreshold( 50 );
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::NewL()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosVideoModelHandler* CVcxHgMyVideosVideoModelHandler::NewL( 
+        CVcxHgMyVideosVideoListImpl& aVideoListImpl,
+        CVcxHgMyVideosModel& aModel,
+        CVcxHgMyVideosMainView& aView,
+        CHgScroller& aScroller )        
+    {
+    CVcxHgMyVideosVideoModelHandler* self = 
+        CVcxHgMyVideosVideoModelHandler::NewLC( 
+            aVideoListImpl, aModel, aView, aScroller );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::NewLC()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosVideoModelHandler* CVcxHgMyVideosVideoModelHandler::NewLC(
+        CVcxHgMyVideosVideoListImpl& aVideoListImpl,
+        CVcxHgMyVideosModel& aModel,
+        CVcxHgMyVideosMainView& aView,
+        CHgScroller& aScroller )        
+    {
+    CVcxHgMyVideosVideoModelHandler* self = 
+        new (ELeave) CVcxHgMyVideosVideoModelHandler( 
+            aVideoListImpl, aModel, aView, aScroller );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// Constructor
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosVideoModelHandler::CVcxHgMyVideosVideoModelHandler(
+        CVcxHgMyVideosVideoListImpl& aVideoListImpl,
+        CVcxHgMyVideosModel& aModel,
+        CVcxHgMyVideosMainView& aView,
+        CHgScroller& aScroller )
+    : iVideoListImpl( aVideoListImpl ),
+      iModel( aModel ),
+      iView( aView ),
+      iScroller( aScroller ),
+      iCurrentCategoryIndex( KErrNotFound ),
+      iRestoreListPosition( EFalse )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::ConstructL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoModelHandler::ConstructL()
+    {
+    iVideoArray = CVcxHgMyVideosVideoList::NewL();
+
+    iVideoIndicator = CMyVideosIndicator::NewL();
+
+    iDataUpdater = CVcxHgMyVideosVideoDataUpdater::NewL( iModel,
+                                                         iScroller,                                                        
+                                                         *iVideoArray,
+                                                         *iVideoIndicator );
+
+    }
+
+// -----------------------------------------------------------------------------
+// Destructor
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosVideoModelHandler::~CVcxHgMyVideosVideoModelHandler()
+    {
+    iMarkedMediaList.Close();
+    
+    delete iVideoDetails;
+    delete iVideoIndicator;
+    delete iDataUpdater;
+    delete iVideoArray;
+	delete iRepository;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::DoModelActivateL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoModelHandler::DoModelActivateL()
+    {
+    IPTVLOGSTRING_LOW_LEVEL( 
+        "MPX My Videos UI # CVcxHgMyVideosVideoModelHandler::DoModelActivateL() - Enter" );
+    
+    iDataUpdater->SetPausedL( EFalse );
+    iModel.CollectionClient().SetVideoModelObserver( this );
+
+    // Set scroller strip type
+    TVcxMyVideosSortingOrder sortOrder = iModel.VideolistSortOrderL();
+    UpdateScrollbarTypeL( sortOrder );
+
+    // Set up scroll buffer
+    iScroller.EnableScrollBufferL( *this, KHgBufferSize, KHgBufferTreshold ); 
+    
+    IPTVLOGSTRING_LOW_LEVEL( 
+        "MPX My Videos UI # CVcxHgMyVideosVideoModelHandler::DoModelActivateL() - Exit" );    
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::DoModelDeactivate()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoModelHandler::DoModelDeactivate()
+    {
+    IPTVLOGSTRING_LOW_LEVEL( 
+        "MPX My Videos UI # CVcxHgMyVideosVideoModelHandler::DoModelDeactivate() - Enter" );
+    
+    TRAP_IGNORE( iDataUpdater->SetPausedL( ETrue ) );
+    iModel.CollectionClient().SetVideoModelObserver( NULL );
+    iScroller.DisableScrollBuffer();
+
+    TRAP_IGNORE( SaveFirstListItemIdL() );
+
+    IPTVLOGSTRING_LOW_LEVEL( 
+        "MPX My Videos UI # CVcxHgMyVideosVideoModelHandler::DoModelDeactivate() - Exit" );    
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::SaveFirstListItemIdL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoModelHandler::SaveFirstListItemIdL()
+    {
+    iFirstListItemId = iVideoArray->ArrayIndexToMpxItemIdL(
+            iScroller.FirstIndexOnScreen() );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::UpdateVideoListL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoModelHandler::UpdateVideoListL( TInt aCategoryIndex )
+    {
+    IPTVLOGSTRING_LOW_LEVEL( 
+        "MPX My Videos UI # CVcxHgMyVideosVideoModelHandler::UpdateVideoListL() - Enter" );
+
+    CVcxHgMyVideosCollectionClient& collectionClient = iModel.CollectionClient();
+
+    if ( aCategoryIndex == iCurrentCategoryIndex )
+        {
+        // If we are re-opening the same video list again, then try 
+        // restore the highlight to previous position.
+        iRestoreListPosition = ETrue;
+        }
+    else
+        {
+        iRestoreListPosition = EFalse;
+        
+        // Removes videos from video list.
+        iVideoArray->RemoveVideoList();
+        
+        // Removes videos from scroller. After this command, list highlight 
+        // disappears, so don't forget to set highlight in NewVideoListL() 
+        // function.
+        iScroller.Reset();
+        }
+        
+    // Ask for video list from MPX collection.
+    collectionClient.GetVideoListL( aCategoryIndex );
+
+    iCurrentCategoryIndex = aCategoryIndex;
+    
+    IPTVLOGSTRING_LOW_LEVEL( 
+        "MPX My Videos UI # CVcxHgMyVideosVideoModelHandler::UpdateVideoListL() - Exit" );    
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::ResortVideoListL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoModelHandler::ResortVideoListL()
+    {    
+    IPTVLOGSTRING_LOW_LEVEL( 
+        "MPX My Videos UI # ResortVideoListL() - Enter" );
+        	
+    if ( iScroller.ItemCount() > 0 )
+        {
+        TVcxMyVideosSortingOrder sortOrder = iModel.VideolistSortOrderL();
+
+        if ( iVideoListImpl.IsMarking() )
+            {
+            SaveMarkingsL();
+            }
+
+        iVideoArray->ResortVideoListL( sortOrder );
+
+        TInt highlight = iScroller.SelectedIndex();
+        
+        ResetScrollerBufferAndItemsL();
+        
+        iScroller.SetSelectedIndex( highlight );
+        
+        iView.DynInitMskL();
+    	
+        if ( iVideoListImpl.IsMarking() )
+            {
+            RestoreMarkingsL();
+            }
+
+        // Switch to appropriate scroller strip
+        UpdateScrollbarTypeL( sortOrder );
+        }
+        IPTVLOGSTRING_LOW_LEVEL( 
+            "MPX My Videos UI # ResortVideoListL() - Exit" );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::Highlight()
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosVideoModelHandler::Highlight()
+    {
+    return iScroller.SelectedIndex();
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::VideoCount()
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosVideoModelHandler::VideoCount()
+    {
+    return iScroller.ItemCount();
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::CurrentCategoryIndex() 
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosVideoModelHandler::CurrentCategoryIndex()
+    {
+    return iCurrentCategoryIndex;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::MarkedVideosL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoModelHandler::MarkedVideosL( 
+        RArray<TInt>& aMarkedVideos )
+    {
+    iScroller.GetMarkedItemsL( aMarkedVideos );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::HandleMarkCommandL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoModelHandler::HandleMarkCommandL( TInt aMarkCommand )
+    {
+    switch ( aMarkCommand )
+        {
+        case EVcxHgMyVideosCmdMark:
+            {
+            TInt highlight = Highlight();
+            iScroller.Mark( highlight );
+            iScroller.RefreshScreen( highlight );
+            }
+            break;
+        case EVcxHgMyVideosCmdUnmark:
+            {
+            TInt highlight = Highlight();
+            iScroller.UnMark( highlight );
+            iScroller.RefreshScreen( highlight );
+            }            
+            break;
+        case EVcxHgMyVideosCmdMarkAll:
+            {
+            iScroller.MarkAll();
+            }
+            break;
+        case EVcxHgMyVideosCmdUnmarkAll:
+            {
+            iScroller.UnMarkAll();
+            }
+            break;
+        default:
+            {
+            IPTVLOGSTRING_LOW_LEVEL( "MPX My Videos UI # HandleMarkCommandL - LEAVE: Invalid mark command" );
+            User::Leave( KErrNotSupported );
+            }
+            break;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::VideoAgeProfileL()
+// -----------------------------------------------------------------------------
+//
+TInt32 CVcxHgMyVideosVideoModelHandler::VideoAgeProfileL( TInt aIndex )
+    {
+    return VideoAgeProfileL( iVideoArray->MPXMedia( aIndex ) );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::VideoAgeProfileL()
+// -----------------------------------------------------------------------------
+//
+TInt32 CVcxHgMyVideosVideoModelHandler::VideoAgeProfileL( TMPXItemId aId )
+    {
+    return VideoAgeProfileL( iVideoArray->MPXMediaByMPXItemId( aId ) );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::VideoAgeProfileL()
+// -----------------------------------------------------------------------------
+//
+TInt32 CVcxHgMyVideosVideoModelHandler::VideoAgeProfileL( CMPXMedia* aMedia )
+    {
+    TInt32 ageProfile( 0 );
+
+    if ( aMedia )
+        {
+        if ( aMedia->IsSupported( KVcxMediaMyVideosAgeProfile ) )
+            {
+            ageProfile = aMedia->ValueTObjectL<TInt32>( KVcxMediaMyVideosAgeProfile );
+            }
+        }
+    
+    return ageProfile;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::FindVideoMpxIdL()
+// Tries to find MPX Item Id based on URI. Does not modify MPX Item Id's initial
+// value if video not found.
+// -----------------------------------------------------------------------------
+//
+TBool CVcxHgMyVideosVideoModelHandler::FindVideoMpxIdL( const TDesC& aVideoPath,
+                                                        TMPXItemId& aMpxItemId )
+    {
+    CMPXMedia* media = iVideoArray->MPXMediaByUri( aVideoPath );
+    if ( media )
+        {
+        if ( media->IsSupported( KMPXMediaGeneralId ) )
+            {
+            aMpxItemId = media->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId );
+            return ETrue;
+            }
+        }
+    return EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::ShowVideoDetailsDialogL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoModelHandler::ShowVideoDetailsDialogL()
+    {
+    TInt highlight = Highlight();
+    
+    if ( highlight != KErrNotFound )
+        {
+        TMPXItemId mpxItemId = iVideoArray->ArrayIndexToMpxItemIdL( highlight );
+        iModel.CollectionClient().GetVideoDetailsL( mpxItemId );        
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+CMyVideosIndicator& CVcxHgMyVideosVideoModelHandler::VideoIndicator()
+    {
+    return *iVideoIndicator;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::GetVideoName()
+// -----------------------------------------------------------------------------
+//
+const TDesC& CVcxHgMyVideosVideoModelHandler::GetVideoName( TInt aId )
+    {
+    CMPXMedia* media = iVideoArray->MPXMediaByMPXItemId( TMPXItemId( aId, 0 ) );
+
+    if ( media && media->IsSupported( KMPXMediaGeneralTitle ) )
+        {
+        return media->ValueText( KMPXMediaGeneralTitle );
+        }
+    return KNullDesC;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::GetVideoUri()
+// -----------------------------------------------------------------------------
+//
+const TDesC& CVcxHgMyVideosVideoModelHandler::GetVideoUri( TInt aIndex )
+    {
+    CMPXMedia* media = iVideoArray->MPXMedia( aIndex );
+
+    if ( media && media->IsSupported( KMPXMediaGeneralUri ) )
+        {
+        return media->ValueText( KMPXMediaGeneralUri );
+        }
+    return KNullDesC;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::GetVideoId()
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosVideoModelHandler::GetVideoId( TInt aIndex )
+    {
+    CMPXMedia* media = iVideoArray->MPXMedia( aIndex );
+
+    if ( media && media->IsSupported( KMPXMediaGeneralId ) )
+        {
+        return media->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId ).iId1;
+        }
+    
+    return KErrNotFound;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::GetVideoSize()
+// -----------------------------------------------------------------------------
+//
+TInt64 CVcxHgMyVideosVideoModelHandler::GetVideoSize( TInt aIndex )
+    {
+    CMPXMedia* media = iVideoArray->MPXMedia( aIndex );
+
+    if ( media && media->IsSupported( KMPXMediaGeneralExtSizeInt64 ) )
+        {
+        return media->ValueTObjectL<TInt64>( KMPXMediaGeneralExtSizeInt64 );
+        }
+    return 0;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::DeleteVideosL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoModelHandler::DeleteVideosL( 
+        const RArray<TInt>& aOperationTargets )
+    {
+    CMPXMedia* media = NULL;
+    TMPXItemId mpxItemId;
+    CMPXMedia* mediaToDelete = NULL;
+    CMPXMediaArray* mediasToDelete = CMPXMediaArray::NewL();
+    CleanupStack::PushL( mediasToDelete );
+
+    for ( TInt i = 0; i < aOperationTargets.Count(); i++ )
+        {
+        media = iVideoArray->MPXMediaByMPXItemId( TMPXItemId(aOperationTargets[i],0) );
+
+        if ( media && media->IsSupported( KMPXMediaGeneralId ) )
+            {
+            mpxItemId = media->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId );
+            mediaToDelete = CMPXMedia::NewL();
+            CleanupStack::PushL( mediaToDelete );
+            mediaToDelete->SetTObjectValueL( KMPXMediaGeneralId, mpxItemId );
+            mediasToDelete->AppendL( *mediaToDelete );
+            CleanupStack::PopAndDestroy( mediaToDelete );
+            iDataUpdater->PrepareForMoveOrDelete( mpxItemId );
+            }
+        }
+
+    if ( mediasToDelete->Count() <= 0 )
+        {
+		User::Leave( KErrNotFound );
+        }
+
+    TRAPD( err, iModel.CollectionClient().DeleteVideosL( mediasToDelete ) );
+    	
+    if ( err != KErrNone )
+        {
+        VideoDeletionCompletedL( aOperationTargets.Count(), mpxItemId );
+		if ( err != KErrNotReady )
+		    {
+			User::Leave( err );
+			}
+        }
+    CleanupStack::PopAndDestroy( mediasToDelete );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::MoveOrCopyVideosL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoModelHandler::MoveOrCopyVideosL( 
+        const RArray<TInt>& aOperationTargets,
+        TInt aTargetDrive,
+        TBool aCopy )
+    {
+    CMPXMedia* media = NULL;
+    TMPXItemId mpxItemId;
+    CMPXMedia* mediaToMoveOrCopy = NULL;
+    CMPXMediaArray* mediasToMoveOrCopy = CMPXMediaArray::NewL();
+    CleanupStack::PushL( mediasToMoveOrCopy );
+
+    for ( TInt i = 0; i < aOperationTargets.Count(); i++ )
+        {
+        media = iVideoArray->MPXMediaByMPXItemId( TMPXItemId(aOperationTargets[i],0) );
+                    
+        if ( media && media->IsSupported( KMPXMediaGeneralId ) )
+            {
+            mpxItemId = media->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId );
+            mediaToMoveOrCopy = CMPXMedia::NewL();
+            CleanupStack::PushL( mediaToMoveOrCopy );
+            mediaToMoveOrCopy->SetTObjectValueL( KMPXMediaGeneralId, mpxItemId );
+            mediasToMoveOrCopy->AppendL( *mediaToMoveOrCopy );
+            CleanupStack::PopAndDestroy( mediaToMoveOrCopy );
+            iDataUpdater->PrepareForMoveOrDelete( mpxItemId );
+            }
+        }
+
+    if ( mediasToMoveOrCopy->Count() <= 0 )
+        {
+		User::Leave( KErrNotFound );
+        }
+		
+    iModel.CollectionClient().MoveOrCopyVideosL( mediasToMoveOrCopy, aTargetDrive, aCopy );
+
+    CleanupStack::PopAndDestroy( mediasToMoveOrCopy );    
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::PlayVideoL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoModelHandler::PlayVideoL( TInt aIndex )
+    {
+    CMPXMedia* media = iVideoArray->MPXMedia( aIndex );
+
+    if ( media && media->IsSupported( KMPXMediaGeneralId ) )
+        {
+        // Playback should be tried always when single clicking a video in My Videos
+        TMPXItemId mpxItemId = media->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId );
+        SetVideoLastWatchedL( *media );
+        ClearNewVideoFlagL( *media );
+        ResetEmptyDrmThumnailL( *media, aIndex );
+		IPTVLOGSTRING3_LOW_LEVEL( "CVcxHgMyVideosVideoModelHandler::PlayVideoL() aIndex=%d mpxItemId=%d", aIndex, (TInt) mpxItemId );
+        iModel.CollectionClient().PlayVideoL( mpxItemId );        
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::Release()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoModelHandler::Release( TInt aReleaseStart, 
+                                               TInt aReleaseEnd )
+    {   
+    for ( TInt i = aReleaseStart; i <= aReleaseEnd; i++ )
+        {
+        TRAP_IGNORE( iDataUpdater->ReleaseData( iVideoArray->ArrayIndexToMpxItemIdL( i ) ) );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::Request()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoModelHandler::Request( TInt aRequestStart, 
+                                               TInt aRequestEnd,
+                                               THgScrollDirection aDirection )
+    {
+    TRAP_IGNORE( HandleRequestL( aRequestStart, aRequestEnd, aDirection ) );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::HandleRequestL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoModelHandler::HandleRequestL( TInt aRequestStart, 
+                                                      TInt aRequestEnd,
+                                                      THgScrollDirection /*aDirection*/ )
+    {
+    IPTVLOGSTRING_LOW_LEVEL(
+        "MPX My Videos UI # CVcxHgMyVideosVideoModelHandler::HandleRequestL - Enter" );
+    
+    TInt videoCount = iVideoArray->VideoCount();
+    TInt requestStart = ( aRequestStart >= 0 ? aRequestStart : 0 );
+    TInt requestEnd = ( aRequestEnd < videoCount ? aRequestEnd : ( videoCount - 1 ) );
+    
+    IPTVLOGSTRING3_LOW_LEVEL(
+        "MPX My Videos UI # CVcxHgMyVideosVideoModelHandler::HandleRequestL - aRequestStart: %d, aRequestEnd: %d", requestStart, requestEnd );
+
+    TBool flushNeeded = EFalse;
+    for ( TInt i = requestStart; i <= requestEnd; i++ )
+        {
+        UpdateVideoListItemL( i );
+        iDataUpdater->AddToRequestBufferL( iVideoArray->ArrayIndexToMpxItemIdL( i ) );
+        flushNeeded = ETrue;
+        }
+    if ( flushNeeded )
+        {
+        iDataUpdater->FlushRequestBufferL();
+        }
+
+    iScroller.DrawDeferred();
+        
+    IPTVLOGSTRING_LOW_LEVEL( 
+        "MPX My Videos UI # CVcxHgMyVideosVideoModelHandler::HandleRequestL() - Exit" );    
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::FormatVideoSecondRowLC()
+// -----------------------------------------------------------------------------
+// 
+HBufC* CVcxHgMyVideosVideoModelHandler::FormatVideoSecondRowLC( CMPXMedia& aMedia )
+
+    {
+    _LIT( KVcxSecondLineSeparator, "," );
+
+    HBufC* details = NULL;
+    HBufC* sizeStr = NULL;
+    HBufC* lengthStr = NULL;
+    TReal32 length( 0 );
+    TInt64 size( 0 );
+    TInt detailsSize( 0 );
+
+    // Use KMPXMediaGeneralDuration or KVcxMediaMyVideosDuration?
+    if ( aMedia.IsSupported( KVcxMediaMyVideosDuration ) )
+        {
+        length = *( aMedia.Value<TReal32>( KVcxMediaMyVideosDuration ) ); // In seconds
+        IPTVLOGSTRING2_LOW_LEVEL( "MPX My Videos UI # FormatVideoSecondRowCompletedLC() length=%f", length );
+        }
+
+    if ( aMedia.IsSupported( KMPXMediaGeneralExtSizeInt64 ) )
+        {
+        size = *( aMedia.Value<TInt64>( KMPXMediaGeneralExtSizeInt64 ) ); // In bytes
+        IPTVLOGSTRING2_LOW_LEVEL( "MPX My Videos UI # FormatVideoSecondRowCompletedLC() size=%ld", size );
+        }
+
+    if ( size > 0 )
+        {
+        TUint64 bytes = static_cast<TUint64>( size );
+        TUint64 dispSize = 0;
+
+        if ( bytes >= KVcxVideoSizeGB )
+            {
+            dispSize  = bytes + KVcxVideoSizeHalfGB;
+            dispSize /= KVcxVideoSizeGB;
+            sizeStr = StringLoader::LoadLC( R_VCXHGMYVIDEOS_SIZE_LIST_GB, dispSize );
+            }
+        else if ( bytes >= KVcxVideoSizeMB )
+            {
+            dispSize  = bytes + KVcxVideoSizeHalfMB;
+            dispSize /= KVcxVideoSizeMB;
+            sizeStr = StringLoader::LoadLC( R_VCXHGMYVIDEOS_SIZE_LIST_MB, dispSize );
+            }
+        else
+            {
+            dispSize  = bytes + KVcxVideoSizeHalfKB;
+            dispSize /= KVcxVideoSizeKB;
+            sizeStr = StringLoader::LoadLC( R_VCXHGMYVIDEOS_LIST_SIZE_KB, dispSize );
+            }
+        detailsSize += sizeStr->Length();
+        }
+    if ( length > 0 )
+        {
+        TUint total = static_cast<TUint>( length );
+        
+        TUint hours = total / KVcxSecondsInHour;
+        TUint minutes = total / KVcxSecondsInMinute % KVcxSecondsInMinute;
+        TUint seconds = total % KVcxSecondsInMinute;
+
+        if ( hours > 0 )
+            {
+            CArrayFix<TInt>* numbers = new (ELeave) CArrayFixFlat<TInt>(2);
+            CleanupStack::PushL( numbers );
+            numbers->AppendL( hours );
+            numbers->AppendL( minutes );
+            lengthStr = StringLoader::LoadL( R_VCXHGMYVIDEOS_VIDEO_LIST_LENGTH_H_MIN, *numbers );
+            CleanupStack::PopAndDestroy( numbers );
+            CleanupStack::PushL( lengthStr );
+            }
+        else if ( minutes > 0 )
+            {
+            CArrayFix<TInt>* numbers = new (ELeave) CArrayFixFlat<TInt>(2);
+            CleanupStack::PushL( numbers );
+            numbers->AppendL( minutes );
+            numbers->AppendL( seconds );
+            lengthStr = StringLoader::LoadL( R_VCXHGMYVIDEOS_VIDEO_LIST_LENGTH_MIN_SEC, *numbers );
+            CleanupStack::PopAndDestroy( numbers );
+            CleanupStack::PushL( lengthStr );
+            }
+        else
+            {
+            lengthStr = StringLoader::LoadLC( R_VCXHGMYVIDEOS_VIDEO_LIST_LENGTH_SEC, seconds ); 
+            }
+        detailsSize += lengthStr->Length();
+        }      
+
+    details = HBufC::NewL( detailsSize + KVcxSecondLineSeparator().Length() );
+    if ( lengthStr )
+        {
+        details->Des().Append( *lengthStr );
+        CleanupStack::PopAndDestroy( lengthStr );
+        }
+    if ( sizeStr )
+        {
+        if ( lengthStr ) // Add separator when both are available.
+            {
+            details->Des().Append( KVcxSecondLineSeparator );
+            }
+        details->Des().Append( *sizeStr );
+        CleanupStack::PopAndDestroy( sizeStr );
+        }
+
+    CleanupStack::PushL( details );
+    return details;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::ReplaceVideoArrayL()
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosVideoModelHandler::ReplaceVideoArrayL( CMPXMediaArray& aVideoList )
+    {
+    iVideoArray->ReplaceVideoListL( aVideoList );
+    iDataUpdater->InfoArrayChanged();
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::UpdateVideoListItemL()
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosVideoModelHandler::UpdateVideoListItemL( TInt aListIndex )
+    {
+    IPTVLOGSTRING2_LOW_LEVEL( "CVcxHgMyVideosVideoModelHandler::UpdateVideoListItemL() ENTER list index = %d", aListIndex );
+
+    if ( aListIndex >= 0 && aListIndex < iScroller.ItemCount() )
+        {
+        TVcxHgMyVideosIndicatorHelper indicatorHelper;
+        CMPXMedia* media( NULL );
+        
+        media = iVideoArray->MPXMedia( aListIndex );
+
+        if ( media )
+            {           
+            CHgItem& item = iScroller.ItemL( aListIndex );
+            TBool isMarked = ( item.Flags() & CHgItem::EHgItemFlagMarked );
+            item.ClearFlags( item.Flags() );
+            
+            if ( media->IsSupported( KMPXMediaGeneralTitle ) )
+                {
+                HBufC* name( NULL );        
+                name = media->ValueText( KMPXMediaGeneralTitle ).AllocLC();
+                if ( name->Length() > 0 )
+                    {
+                    item.SetTitleL( *name );
+                    }
+                CleanupStack::PopAndDestroy( name );
+                }
+
+            HBufC* details( NULL );
+            
+            details = FormatVideoSecondRowLC( *media );
+            if ( details->Length() > 0 )
+                {
+                item.SetTextL( *details );
+                }
+            CleanupStack::PopAndDestroy( details );
+    
+            TBool isNewVideo( EFalse );
+            if ( media->IsSupported( KMPXMediaGeneralFlags ) )
+                {
+                if ( media->ValueTObjectL<TUint32>( KMPXMediaGeneralFlags ) &
+                     EVcxMyVideosVideoNew )
+                    {
+                    isNewVideo = ETrue;
+                    }
+                }
+            TInt indicator1( 0 );
+            TInt indicator2( 0 );            
+            
+            indicatorHelper.GetIndicatorsForVideoL(
+                iModel,
+                isNewVideo,
+                EFalse, // *Recordings*
+                media->ValueText( KMPXMediaGeneralUri ),
+                TVcxHgMyVideosIndicatorHelper::EIndicatorDrmStatusUnknown,
+                indicator1,
+                indicator2 );   
+            if ( indicator1 )
+                {
+                item.SetFlags( indicator1 );
+                }
+            if ( indicator2 )
+                {
+                item.SetFlags( indicator2 );
+                }
+            if ( isMarked )
+                {
+                item.SetFlags( CHgItem::EHgItemFlagMarked );
+                }
+            if ( item.Icon() && VideoIndicator().IsIndicatorShown( *media ) )
+                {
+                item.SetFlags( CHgItem::EHgItemFlagsIconOverlayIndicator );
+                }
+            if ( media->IsSupported( KMPXMediaGeneralDate ) )
+                {
+                TInt64 itemDate = media->ValueTObjectL<TInt64>( KMPXMediaGeneralDate );
+                item.SetTime( itemDate );
+                }    
+            }
+        }
+
+    IPTVLOGSTRING_LOW_LEVEL( "CVcxHgMyVideosVideoModelHandler::UpdateVideoListItemL() RETURN" );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::DeleteItemL()
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosVideoModelHandler::DeleteItemL( TMPXItemId aMpxItemId )
+    {
+    // Remove video from data updater.
+    iDataUpdater->ReleaseData( aMpxItemId );
+
+    // Remove video from video array.
+    TInt removedIndex = iVideoArray->RemoveVideo( aMpxItemId );
+    
+    if ( removedIndex != KErrNotFound )
+        {
+        // Remove item from the list.
+        iScroller.RemoveItem( removedIndex );
+        
+        if ( iScroller.ItemCount() > 0 )
+            {
+            TInt selectedIndex = iScroller.SelectedIndex();
+            
+            // Selected index number is greater than
+            // item count. Set the last item to be highlighted.
+            if ( selectedIndex >= iScroller.ItemCount() )
+                {
+                iScroller.SetSelectedIndex( iScroller.ItemCount() - 1 );
+                }
+            }
+        else
+            {
+            // Last item has deleted, set empty text and reset list.
+            iVideoListImpl.SetEmptyListTextByResourceL( R_VCXHGMYVIDEOS_NO_VIDEOS );
+            iScroller.Reset();
+
+            // End marking mode for empty list
+            if ( iVideoListImpl.IsMarking() )
+                {
+                iVideoListImpl.EndMarkingMode();
+                iView.DynInitRskL();
+                }
+            }
+
+        // fix for error where highlight was sometimes lost after delete. Problem is 
+        // that someone is 'stealing' keyboard focus from the scroller (probably the
+        // confirmation note, as user needs to clicks them to start the delete).
+        iScroller.SetFocus( ETrue ); 
+        
+        iScroller.DrawDeferred();
+        iView.DynInitMskL();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::InsertVideoL()
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosVideoModelHandler::InsertVideoL( CMPXMedia* aVideo )
+    {
+    if ( aVideo )
+        {		
+        if ( aVideo->IsSupported( KMPXMediaGeneralId ) )
+            {           
+            CleanupStack::PushL( aVideo );
+		    TMPXItemId itemId = aVideo->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId );
+            
+            // Get current sort order.
+            TVcxMyVideosSortingOrder sortOrder = iModel.VideolistSortOrderL();
+            
+            // Ownership of video item is transferred to video array.
+            CleanupStack::Pop( aVideo );
+            iVideoArray->AddToCorrectPlaceL( aVideo, sortOrder );
+            
+            TInt index = iVideoArray->IndexByMPXItemId( itemId );
+            
+            if ( index >= 0 )
+                {
+                // Create a new Hg list item. Ownership of list item  
+                // is transferred to scroller.
+                CHgItem* listItem = CHgItem::NewL();
+                iScroller.InsertItem( listItem, index );
+                            
+                if ( iScroller.SelectedIndex() == KErrNotFound )
+                    {
+                    iScroller.SetSelectedIndex( 0 );
+                    }    
+                UpdateVideoListItemL( index );
+                
+                // Update screen.
+                iScroller.DrawDeferred();
+                iView.DynInitMskL();
+                                                    
+                iDataUpdater->RequestDataL( itemId );    
+                }
+            }
+         else
+            {
+            delete aVideo;
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::ValidOrigin()
+// -----------------------------------------------------------------------------
+// 
+TBool CVcxHgMyVideosVideoModelHandler::ValidOrigin( CMPXMedia& aMedia )
+    {
+    IPTVLOGSTRING_LOW_LEVEL( 
+        "MPX My Videos UI # ValidOrigin - Enter" );
+    
+    TBool isValid( EFalse );
+	
+    if ( aMedia.IsSupported( KVcxMediaMyVideosOrigin ) )
+        {
+        TUint8 mediaOrigin( EVcxMyVideosOriginOther );
+        mediaOrigin = aMedia.ValueTObjectL<TUint8>( KVcxMediaMyVideosOrigin );   
+		
+        // All videos
+        if ( CurrentCategoryIndex() == KVcxMvcCategoryIdAll )
+            {
+            IPTVLOGSTRING_LOW_LEVEL( 
+                "MPX My Videos UI # ValidOrigin - Origin: All" );
+            isValid = ETrue;
+            }
+        // Captured
+        else if ( CurrentCategoryIndex() == KVcxMvcCategoryIdCaptured && 
+                mediaOrigin == EVcxMyVideosOriginCapturedWithCamera )
+            {
+            IPTVLOGSTRING_LOW_LEVEL( 
+                "MPX My Videos UI # ValidOrigin - Origin: Captured" );
+            isValid = ETrue;
+            }
+        // Downloads
+        else if ( CurrentCategoryIndex() == KVcxMvcCategoryIdDownloads &&
+                mediaOrigin == EVcxMyVideosOriginDownloaded )
+            {
+            IPTVLOGSTRING_LOW_LEVEL( 
+                "MPX My Videos UI # ValidOrigin - Origin: Downloads" );    	
+            isValid = ETrue;
+            }
+        // Other
+        else if ( CurrentCategoryIndex() == KVcxMvcCategoryIdOther && 
+                ( mediaOrigin == EVcxMyVideosOriginSideLoaded ||
+                mediaOrigin == EVcxMyVideosOriginOther ) )
+            {
+            IPTVLOGSTRING_LOW_LEVEL( 
+                "MPX My Videos UI # ValidOrigin - Origin: Other" ); 
+            isValid = ETrue;
+            }
+        }
+    IPTVLOGSTRING2_LOW_LEVEL( 
+        "MPX My Videos UI # ValidOrigin, isValid %b - Exit", isValid );
+    return isValid;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::NewVideoListL()
+// MPX Collection calls this callback when video list is available.
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosVideoModelHandler::NewVideoListL( CMPXMediaArray& aVideoList )
+    {
+    IPTVLOGSTRING2_LOW_LEVEL( 
+        "MPX My Videos UI # NewVideoListL(count=%d) - Enter", aVideoList.Count() );
+        
+    TBool sameItems = iVideoArray->HasSameItemsL( aVideoList );
+    if ( !sameItems )
+        {
+        ReplaceVideoArrayL( aVideoList );
+        }
+    
+    TInt videoCount = iVideoArray->VideoCount();         
+    if (  videoCount > 0 )
+        {
+        if ( !sameItems )
+            {
+            ResizeScrollerL( videoCount );
+            }
+
+        TInt firstItemIndex( KErrNotFound );
+
+        if ( iRestoreListPosition )
+            {
+            firstItemIndex = iVideoArray->IndexByMPXItemId( iFirstListItemId );
+            }
+        
+        IPTVLOGSTRING2_LOW_LEVEL( "CVcxHgMyVideosVideoModelHandler::NewVideoListL() Setting list position first index = %d", firstItemIndex );
+        firstItemIndex != KErrNotFound ? iScroller.SetFirstIndexOnScreen( firstItemIndex ) :
+                                    iScroller.SetFirstIndexOnScreen( 0 );
+        }
+    else
+        {
+        ResizeScrollerL( videoCount );
+        iVideoListImpl.SetEmptyListTextByResourceL( R_VCXHGMYVIDEOS_NO_VIDEOS );
+        iScroller.Reset();
+        iScroller.DrawDeferred();
+        }        
+    iView.DynInitMskL();
+ 
+    IPTVLOGSTRING_LOW_LEVEL( "MPX My Videos UI # NewVideoListL() - Exit" );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::VideoListModifiedL()
+// MPX Collection calls this callback when the video list has been modified.
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosVideoModelHandler::VideoListModifiedL()
+    {
+    IPTVLOGSTRING2_LOW_LEVEL( 
+        "MPX My Videos UI # VideoListModifiedL(count=%d) - Enter", 
+        iVideoArray->VideoCount() );
+
+    TInt videoCount = iVideoArray->VideoCount();
+        
+    if ( iScroller.ItemCount() != videoCount )
+        {
+        iScroller.ResizeL( videoCount );
+        }
+        
+    if ( iScroller.ItemCount() > 0 )
+       {
+       iScroller.DrawDeferred();
+       }
+              
+    iView.DynInitMskL();       
+
+    IPTVLOGSTRING_LOW_LEVEL( 
+        "MPX My Videos UI # VideoListModifiedL() - Exit" );            
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::VideoModifiedL()
+// MPX Collection calls this callback when single video item has been modified.
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosVideoModelHandler::VideoModifiedL( TMPXChangeEventType aEventType,
+                                                      TMPXItemId aMpxItemId,
+                                                      TInt32 aExtraInfo,
+                                                      TBool aSimulated )
+    {
+    IPTVLOGSTRING2_LOW_LEVEL( 
+        "MPX My Videos UI # VideoModifiedL(event=%d)", aEventType );
+        
+    switch ( aEventType )
+        {
+        case EMPXItemInserted:
+            {
+            if ( aMpxItemId.iId2 < 2 )
+                {
+                iModel.CollectionClient().FetchMpxMediaByMpxIdL( aMpxItemId );
+                }
+            }
+            break;
+            
+        case EMPXItemModified:
+            {
+            if ( aExtraInfo == EVcxMyVideosVideoListOrderChanged )
+                {
+                if ( aMpxItemId.iId1 == iCurrentCategoryIndex &&
+                     aMpxItemId.iId2 == 1 )
+                    {                    
+                    // Re-fetch current list completely, MMC card has 
+                    // removed or inserted.
+                    IPTVLOGSTRING_LOW_LEVEL( "MPX My Videos UI # VideoModifiedL - Re-fetching list" );
+                    iModel.CollectionClient().GetVideoListL( iCurrentCategoryIndex );
+                    }
+                }
+            else
+                {
+                TInt index = iVideoArray->IndexByMPXItemId( aMpxItemId );
+                if ( index != KErrNotFound )
+                    {
+                    UpdateVideoListItemL( index );              
+                    iScroller.RefreshScreen( index );
+                
+                    if ( ! aSimulated )
+                        {
+                        iDataUpdater->RequestDataL( aMpxItemId );    
+					    }                      
+                    iView.DynInitMskL();
+                    }
+                }
+            }
+            break;
+        
+        case EMPXItemDeleted:
+            {
+            if ( aMpxItemId.iId2 < 2 )
+                {
+                DeleteItemL( aMpxItemId );    
+                }
+            }
+            break;
+        
+        default:
+            {
+            IPTVLOGSTRING_LOW_LEVEL( 
+                "MPX My Videos UI # VideoModifiedL() Unexpected change!" );
+            #ifdef _DEBUG
+            User::Panic( KVcxHgMyVideosPanic, EVcxHgMyVideosPanicLogicalVideo );
+            #endif // _DEBUG            
+            }
+            break;
+        } 
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::VideoFetchingCompletedL()
+// MPX Collection calls this callback when a single video has fetched.
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosVideoModelHandler::VideoFetchingCompletedL( CMPXMedia* aVideo )
+    {
+    if ( ValidOrigin( *aVideo ) )
+        {
+        // Ownership of video item is transferred.
+        InsertVideoL( aVideo );	
+        }
+    else
+        {
+        delete aVideo;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::VideoDeletionCompletedL()
+// MPX Collection calls this callback when deletion of multiple videos completes.
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosVideoModelHandler::VideoDeletionCompletedL( TInt aFailedCount,
+                                                               TMPXItemId aFailedMpxId )
+    {
+    CMPXMedia* media = iVideoArray->MPXMediaByMPXItemId( aFailedMpxId );
+
+    if ( aFailedCount == 1 && media && media->IsSupported( KMPXMediaGeneralTitle ) )
+        {
+        iVideoListImpl.VideoDeletionCompletedL( aFailedCount, 
+                                                media->ValueText( KMPXMediaGeneralTitle ) );
+        }
+    else
+        {
+        iVideoListImpl.VideoDeletionCompletedL( aFailedCount, 
+                                                KNullDesC );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::VideoMoveOrCopyCompletedL()
+// MPX Collection calls this callback when move or copy command is completed.
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosVideoModelHandler::VideoMoveOrCopyCompletedL( TInt aFailedCount,
+                                                                 TMPXItemId aFailedMpxId )
+    {
+    CMPXMedia* media = iVideoArray->MPXMediaByMPXItemId( aFailedMpxId );
+
+    if ( aFailedCount == 1 && media && media->IsSupported( KMPXMediaGeneralTitle ) )
+        {    
+        iVideoListImpl.VideoMoveOrCopyCompletedL( aFailedCount, 
+                                                  media->ValueText( KMPXMediaGeneralTitle ) );
+        }
+    else
+        {
+        iVideoListImpl.VideoMoveOrCopyCompletedL( aFailedCount, 
+                                                  KNullDesC );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::VideoDetailsCompletedL()
+// MPX Collection calls this callback when details fetching is completed.
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosVideoModelHandler::VideoDetailsCompletedL( const CMPXMedia& aMedia )
+    {
+    if ( !iVideoDetails )
+        {
+	    iVideoDetails = CVcxHgMyVideosVideoDetailsDialog::NewL();
+        }
+    iVideoDetails->ShowVideoDetailsDialogL( aMedia );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::UpdateScrollbarTypeL()
+// Update scrollbar strip type depending on sort order
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosVideoModelHandler::UpdateScrollbarTypeL( const TVcxMyVideosSortingOrder& aSortingOrder )
+    {
+    if ( EVcxMyVideosSortingName == aSortingOrder )
+        {
+        // First letter on strip
+        iScroller.SetScrollBarTypeL( CHgScroller::EHgScrollerLetterStripLite );        
+        }
+    else if ( EVcxMyVideosSortingCreationDate == aSortingOrder )
+        {
+        // Show date on strip
+        iScroller.SetScrollBarTypeL( CHgScroller::EHgScrollerTimeStrip );
+        }
+    else
+        {
+        // No strip
+        iScroller.SetScrollBarTypeL( CHgScroller::EHgScrollerScrollBar );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::ResetScrollerItemsL()
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosVideoModelHandler::ResetScrollerItemsL()
+    {
+    // Reset items for refetch
+    TInt count = iScroller.ItemCount();
+    for ( TInt i = 0; i < count; ++i )
+        {
+        iScroller.ItemL( i ).SetIcon( NULL );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::ResetScrollerBufferAndItemsL()
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosVideoModelHandler::ResetScrollerBufferAndItemsL()
+    {
+    // Reset scroll buffer and items for refetch
+    iScroller.DisableScrollBuffer();
+    iScroller.EnableScrollBufferL( *this, KHgBufferSize, KHgBufferTreshold );
+    ResetScrollerItemsL();
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::ResizeScrollerL()
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosVideoModelHandler::ResizeScrollerL( TInt aNewItemCount )
+    {
+    if (iScroller.ItemCount() > 0)
+        {
+        // Reset scroller without time consuming scaling of icons never shown
+        iScroller.DisableScrollBuffer();
+        iScroller.ResizeL( aNewItemCount );
+        iScroller.EnableScrollBufferL( *this, KHgBufferSize, KHgBufferTreshold );
+        ResetScrollerItemsL();
+        }
+    else
+        {
+        // CHgScroller::Reset() was already called, no need to reset tricks
+        iScroller.ResizeL( aNewItemCount );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::SaveMarkingsL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoModelHandler::SaveMarkingsL()
+    {
+    // Get marked list item indexes
+    RArray<TInt> markedVideos;
+    CleanupClosePushL( markedVideos );
+    MarkedVideosL( markedVideos );
+    TInt markedCount( markedVideos.Count() );
+
+    iMarkedMediaList.Reset();
+    iMarkedMediaList.ReserveL( markedCount );
+
+    TInt markedIndex;
+
+    for ( TInt i = 0; i <markedCount; i++ )
+        {
+        markedIndex = markedVideos[ i ];
+        CMPXMedia* media = iVideoArray->MPXMedia( markedIndex );
+        iMarkedMediaList.Append( media );
+        iScroller.ItemL( markedIndex ).ClearFlags( CHgItem::EHgItemFlagMarked );
+        IPTVLOGSTRING3_LOW_LEVEL( "CVcxHgMyVideosVideoModelHandler::SaveMarkingsL() marked index = %d CMPXMedia = 0x%08x", markedIndex, media );
+        }
+
+    CleanupStack::PopAndDestroy( &markedVideos );
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::RestoreMarkingsL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoModelHandler::RestoreMarkingsL()
+    {
+    TInt videoCount = iVideoArray->VideoCount();
+    TInt found( KErrNotFound );
+
+    for ( TInt i = 0; i < videoCount; i++ )
+        {
+        CMPXMedia* media = iVideoArray->MPXMedia( i );
+        found = iMarkedMediaList.Find( media );
+        if ( KErrNotFound != found )
+            {
+            iScroller.ItemL( i ).SetFlags( CHgItem::EHgItemFlagMarked );
+            }
+        IPTVLOGSTRING4_LOW_LEVEL( "CVcxHgMyVideosVideoModelHandler::RestoreMarkingsL() list index = %d CMPXMedia = 0x%08x found = %d", i, media, found );
+        }
+
+    iMarkedMediaList.Reset();
+    }
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::SetVideoLastWatchedL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoModelHandler::SetVideoLastWatchedL( CMPXMedia& aMedia )
+    {    
+    if ( !iRepository )
+        {
+        iRepository = CRepository::NewL( TUid::Uid( KVcxMyVideosCollectionCenrepUid ) );
+        }
+    iRepository->Set( KVcxMyVideosCollectionCenrepKeyLastWatchedMpxId, 
+                      TInt( aMedia.ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId ).iId1 ));
+
+    iRepository->Set( KVcxMyVideosCollectionCenrepKeyLastWatchedName,
+                       aMedia.ValueText( KMPXMediaGeneralTitle ));
+
+    iRepository->Set( KVcxMyVideosCollectionCenrepKeyLastWatchedPath,
+                       aMedia.ValueText( KMPXMediaGeneralUri ));
+
+    iRepository->Set( KVcxMyVideosCollectionCenrepKeyLastWatchedIndicator,
+                       TInt( VideoIndicator().IsIndicatorShown( aMedia )) );
+	}
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoModelHandler::ClearNewVideoFlagL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoModelHandler::ClearNewVideoFlagL( CMPXMedia& aMedia )
+    {    
+    TUint32 flags = aMedia.ValueTObjectL<TUint32>( KMPXMediaGeneralFlags );
+    if( flags & EVcxMyVideosVideoNew )
+        {
+        flags &= ~EVcxMyVideosVideoNew;
+        iModel.CollectionClient().SetFlagsL( 
+		    aMedia.ValueTObjectL<TMPXItemId>( 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<TUint32>( 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 );
+            }
+        }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/tsrc/ut_vcxhgmyvideosmainview/Bwins/VcxHgMyVideosMainViewTestU.DEF	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,6 @@
+EXPORTS
+	?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &)
+	??1CVcxHgMyVideosMainView@@UAE@XZ @ 2 NONAME ; CVcxHgMyVideosMainView::~CVcxHgMyVideosMainView(void)
+	?NewL@CVcxHgMyVideosMainView@@SAPAV1@XZ @ 3 NONAME ; class CVcxHgMyVideosMainView * CVcxHgMyVideosMainView::NewL(void)
+	?NewLC@CVcxHgMyVideosMainView@@SAPAV1@XZ @ 4 NONAME ; class CVcxHgMyVideosMainView * CVcxHgMyVideosMainView::NewLC(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/tsrc/ut_vcxhgmyvideosmainview/EABI/VcxHgMyVideosMainViewTestU.def	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/tsrc/ut_vcxhgmyvideosmainview/conf/ui_VcxHgMyVideosMainViewTest.cfg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,253 @@
+/*
+* 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 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:  This file contains test configuration
+*
+*/
+
+
+// 
+// test blocks:
+// 
+// create
+// delete
+// appui
+// cba
+// titlepane
+// playerwrapper
+// categorylist
+// videolist
+// activatecategorylist
+// activatevideolist         params:index 
+// handlecommand             params:cmdid
+// updatemsktoolbar
+// handlekeyevent            params:code,scancode,repeats,type
+// dyninitmsk 
+// maketoolbarvisible        params:visible
+// dyninittoolbar          
+// handlecustomviewmessage   params:msguid,message
+// doactivate                params:msguid,msg
+// doadectivate
+
+
+[Define]
+EFalse 0
+ETrue  1
+
+EStdKeyNull 		0
+EStdKeyBackspace 	1
+EStdKeyTab 			2
+EStdKeyEnter 		3
+
+EEventNull    0
+EEventKey     1
+EEventKeyUp   2
+EEventKeyDown 3
+
+[Enddefine]
+
+
+[Test]
+title    create
+create   VcxHgMyVideosMainViewTest viewtest
+viewtest create
+viewtest delete
+delete   viewtest
+[Endtest] 
+
+
+[Test]
+title    appui
+create   VcxHgMyVideosMainViewTest viewtest
+viewtest create
+viewtest appui
+viewtest delete
+delete   viewtest
+[Endtest] 
+
+
+[Test]
+title    cba
+create   VcxHgMyVideosMainViewTest viewtest
+viewtest create
+viewtest cba
+viewtest delete
+delete   viewtest
+[Endtest] 
+
+
+[Test]
+title    titlepane
+create   VcxHgMyVideosMainViewTest viewtest
+viewtest create
+viewtest titlepane
+viewtest delete
+delete   viewtest
+[Endtest] 
+
+
+[Test]
+title    playerwrapper
+create   VcxHgMyVideosMainViewTest viewtest
+viewtest create
+viewtest playerwrapper
+viewtest delete
+delete   viewtest
+[Endtest] 
+
+
+[Test]
+title    categorylist
+create   VcxHgMyVideosMainViewTest viewtest
+viewtest create
+viewtest categorylist
+viewtest delete
+delete   viewtest
+[Endtest] 
+
+
+[Test]
+title    videolist
+create   VcxHgMyVideosMainViewTest viewtest
+viewtest create
+viewtest videolist
+viewtest delete
+delete   viewtest
+[Endtest] 
+
+
+[Test]
+title    activatecategorylist
+create   VcxHgMyVideosMainViewTest viewtest
+viewtest create
+viewtest activatecategorylist
+viewtest delete
+delete   viewtest
+[Endtest] 
+
+
+[Test]
+title    activatevideolist
+create   VcxHgMyVideosMainViewTest viewtest
+viewtest create
+viewtest activatevideolist
+viewtest delete
+delete   viewtest
+[Endtest] 
+
+
+[Test]
+title    handlecommand
+create   VcxHgMyVideosMainViewTest viewtest
+viewtest create
+
+loop 5000
+
+viewtest handlecommand LOOP_COUNTER
+
+endloop
+
+viewtest delete
+delete   viewtest
+[Endtest] 
+
+
+[Test]
+title    updatemsktoolbar
+create   VcxHgMyVideosMainViewTest viewtest
+viewtest create
+viewtest updatemsktoolbar
+viewtest delete
+delete   viewtest
+[Endtest] 
+
+
+[Test]
+title    handlekeyevent
+create   VcxHgMyVideosMainViewTest viewtest
+viewtest create
+
+loop 1000
+
+viewtest handlekeyevent 0 LOOP_COUNTER 0 EEventNull
+viewtest handlekeyevent 0 LOOP_COUNTER 0 EEventKey
+viewtest handlekeyevent 0 LOOP_COUNTER 0 EEventKeyUp
+viewtest handlekeyevent 0 LOOP_COUNTER 0 EEventKeyDown
+
+endloop
+
+viewtest delete
+delete   viewtest
+[Endtest] 
+
+
+[Test]
+title    dyninitmsk
+create   VcxHgMyVideosMainViewTest viewtest
+viewtest create
+viewtest dyninitmsk
+viewtest delete
+delete   viewtest
+[Endtest] 
+
+
+[Test]
+title    maketoolbarvisible
+create   VcxHgMyVideosMainViewTest viewtest
+viewtest create
+viewtest maketoolbarvisible EFalse
+viewtest maketoolbarvisible ETrue
+viewtest delete
+delete   viewtest
+[Endtest] 
+
+
+[Test]
+title    dyninittoolbar
+create   VcxHgMyVideosMainViewTest viewtest
+viewtest create
+viewtest dyninittoolbar
+viewtest delete
+delete   viewtest
+[Endtest] 
+
+
+[Test]
+title    handlecustomviewmessage
+create   VcxHgMyVideosMainViewTest viewtest
+viewtest create
+viewtest handlecustomviewmessage 1 teh_message
+viewtest delete
+delete   viewtest
+[Endtest] 
+
+
+[Test]
+title    doactivate
+create   VcxHgMyVideosMainViewTest viewtest
+viewtest create
+viewtest doactivate
+viewtest doactivate 1 teh_message
+viewtest delete
+delete   viewtest
+[Endtest] 
+
+
+[Test]
+title    dodeactivate
+create   VcxHgMyVideosMainViewTest viewtest
+viewtest create
+viewtest dodeactivate
+viewtest delete
+delete   viewtest
+[Endtest] 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/tsrc/ut_vcxhgmyvideosmainview/group/ABLD.BAT	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,15 @@
+@ECHO OFF
+
+REM Bldmake-generated batch file - ABLD.BAT
+REM ** DO NOT EDIT **
+
+perl -S ABLD.PL "\VideoApp_Domain\videoplayer\videocollection\hgmyvideos\tsrc\ut_vcxhgmyvideosmainview\group\\" %1 %2 %3 %4 %5 %6 %7 %8 %9
+if errorlevel==1 goto CheckPerl
+goto End
+
+:CheckPerl
+perl -v >NUL
+if errorlevel==1 echo Is Perl, version 5.003_07 or later, installed?
+goto End
+
+:End
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/tsrc/ut_vcxhgmyvideosmainview/group/VcxHgMyVideosMainViewTest.mmp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,109 @@
+/*TYPE TESTCLASS*//*
+* 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 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:  MMP file for STIF Test Framework's TestScripter*
+*/
+
+
+#include <platform_paths.hrh>
+
+TARGET          vcxhgmyvideosmainviewtest.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E3
+LANG            SC
+
+CAPABILITY      ALL -TCB
+
+USERINCLUDE     ../inc
+USERINCLUDE     ../../../inc
+
+OS_LAYER_SYSTEMINCLUDE
+APP_LAYER_SYSTEMINCLUDE
+
+USERINCLUDE    ../../../../../inc
+USERINCLUDE    ../../../../../videofeeds/utils/inc
+USERINCLUDE    ../../../../../videofeeds/viewmessageutility/inc
+
+SOURCEPATH      ../../../src
+SOURCE          vcxhgmyvideosmainview.cpp
+
+SOURCEPATH      ../src
+
+SOURCE          VcxHgMyVideosMainViewTest.cpp
+SOURCE          VcxHgMyVideosMainViewTestBlocks.cpp
+SOURCE          vcxhgmyvideosmodel_stub.cpp
+SOURCE          vcxhgmyvideosmainviewcontainer_stub.cpp
+SOURCE          vcxhgmyvideoscategorylistimpl_stub.cpp
+SOURCE          vcxhgmyvideosvideolistimpl_stub.cpp
+SOURCE          vcxhgmyvideosvideomodelhandler_stub.cpp
+SOURCE          vcxhgmyvideosmemorystatus_stub.cpp
+SOURCE          vcxhgmyvideosvideodetailsdialog_stub.cpp
+SOURCE          vcxhgmyvideosupnpinterface_stub.cpp
+SOURCE          vcxhgmyvideoslistbase_stub.cpp
+
+
+LIBRARY                 euser.lib
+LIBRARY                 stiftestinterface.lib
+LIBRARY                 stiftestengine.lib
+LIBRARY                 apparc.lib
+LIBRARY                 cone.lib
+LIBRARY                 eikctl.lib             
+LIBRARY                 eikcoctl.lib
+LIBRARY                 eikcore.lib  
+LIBRARY                 egul.lib 
+LIBRARY                 avkon.lib
+LIBRARY                 aknicon.lib         
+LIBRARY                 aknlayout.lib
+LIBRARY                 aknlayout2.lib
+LIBRARY                 aknlayout2scalable.lib
+LIBRARY                 bafl.lib                  // CDesCArray 
+LIBRARY                 commonengine.lib          // String loader
+LIBRARY                 flogger.lib               // RFileLogger
+LIBRARY                 hlplch.lib                // HlpLauncher
+LIBRARY                 efsrv.lib
+LIBRARY                 mediaclientvideo.lib      // S60 video player
+LIBRARY                 ws32.lib                  // RBlankWindow
+LIBRARY                 apmime.lib                // TDataType
+LIBRARY                 fbscli.lib                // CFbsBitmap
+LIBRARY                 bitgdi.lib                // CFbsBitmapDevice
+LIBRARY                 estor.lib
+LIBRARY                 form.lib                  // CTextView
+LIBRARY                 fepbase.lib               // MCoeFepObserver
+LIBRARY                 mediatorclient.lib
+LIBRARY                 aknskins.lib
+LIBRARY                 aknskinsrv.lib
+LIBRARY                 aknswallpaperutils.lib 
+LIBRARY                 charconv.lib              // CnvUtfConverter
+LIBRARY                 etel.lib                  // RTelServer
+LIBRARY                 etelmm.lib                // RMobilePhone
+LIBRARY                 secui.lib                 // CSecurityHandler
+LIBRARY                 mpxcommon.lib             // MPX
+LIBRARY                 mpxcollectionutility.lib  // MPX
+LIBRARY                 iptvutil.lib              // Iptv Resource Loader
+LIBRARY                 commondialogs.lib         // Memory selection dialog
+LIBRARY                 drmhelper.lib             // DRM
+LIBRARY                 featmgr.lib               // Feature manager
+LIBRARY                 servicehandler.lib        // AIW Service Handler
+LIBRARY                 centralrepository.lib	  // Upnp
+LIBRARY                 thumbnailmanager.lib      // CThumbnailManager
+LIBRARY                 caf.lib                   // CAF
+LIBRARY                 cafutils.lib              // CAF Utils
+LIBRARY                 sendui.lib                // For send video
+LIBRARY                 drmutility.lib            // DRM
+LIBRARY                 playbackhelper.lib        // Recognizer
+LIBRARY                 mpxplaybackutility.lib    // MPX playback utility
+LIBRARY                 mpxviewutility.lib		
+LIBRARY                 mpfiledetailsdialog.lib
+LIBRARY                 vcxviewmessageutility.lib // CVcxViewMessageUtility
+LIBRARY                 upnpcommand.lib
+LIBRARY                 ganes.lib                 // for HgList
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/tsrc/ut_vcxhgmyvideosmainview/group/VcxHgMyVideosMainViewTest.pkg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,58 @@
+;
+; 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 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: 
+;
+
+; Languages
+&EN
+
+; Provide value for uid
+#{"STIF"},(0x00000000),1,1,0,TYPE=SA
+
+; 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
+"\epoc32\release\armv5\udeb\VcxHgMyVideosMainViewTest.dll"   -   "!:\Sys\Bin\VcxHgMyVideosMainViewTest.dll"
+  
+; Embedded SIS 
+; None
+
+; End of Package body
+
+; PKG dependencies
+; None
+
+; PKG capabilities
+; None
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/tsrc/ut_vcxhgmyvideosmainview/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,37 @@
+/*
+* 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 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: 
+*
+*/
+
+
+PRJ_PLATFORMS
+// specify the platforms your component needs to be built for here
+// defaults to WINS MARM so you can ignore this if you just build these
+	
+	DEFAULT
+
+PRJ_TESTEXPORTS
+// NOTE: If using ARS requirements all export operations should be done under this.
+// 'abld test export'
+
+PRJ_EXPORTS
+
+../conf/ui_VcxHgMyVideosMainViewTest.cfg     /epoc32/winscw/c/testframework/ui_VcxHgMyVideosMainViewTest.cfg
+../init/testframework.ini                 /epoc32/winscw/c/testframework/testframework.ini
+
+PRJ_TESTMMPFILES
+
+VcxHgMyVideosMainViewTest.mmp
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/tsrc/ut_vcxhgmyvideosmainview/inc/VcxHgMyVideosMainViewTest.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,131 @@
+/*
+* 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 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:  STIF testclass declaration*
+*/
+
+
+#ifndef VCXHGMYVIDEOSMAINVIEWTEST_H
+#define VCXHGMYVIDEOSMAINVIEWTEST_H
+
+//  INCLUDES
+#include <StifLogger.h>
+#include <TestScripterInternal.h>
+#include <StifTestModule.h>
+#include <TestclassAssert.h>
+
+// MACROS
+#define TEST_CLASS_VERSION_MAJOR 0
+#define TEST_CLASS_VERSION_MINOR 0
+#define TEST_CLASS_VERSION_BUILD 0
+
+// Logging path
+_LIT( KVcxHgMyVideosMainViewTestLogPath, "\\logs\\testframework\\VcxHgMyVideosMainViewTest\\" ); 
+
+// Log file
+_LIT( KVcxHgMyVideosMainViewTestLogFile, "VcxHgMyVideosMainViewTest.txt" ); 
+_LIT( KVcxHgMyVideosMainViewTestLogFileWithTitle, "VcxHgMyVideosMainViewTest_[%S].txt" );
+
+
+// FORWARD DECLARATIONS
+class CVcxHgMyVideosMainViewTest;
+class CVcxHgMyVideosMainView;
+
+
+// CLASS DECLARATION
+
+/**
+*  CVcxHgMyVideosMainViewTest test class for STIF Test Framework TestScripter.
+*/
+NONSHARABLE_CLASS(CVcxHgMyVideosMainViewTest) : public CScriptBase
+    {
+    
+public:  // Constructors and destructor
+
+    /**
+    * Two-phased constructor.
+    */
+    static CVcxHgMyVideosMainViewTest* NewL( CTestModuleIf& aTestModuleIf );
+
+    /**
+    * Destructor.
+    */
+    virtual ~CVcxHgMyVideosMainViewTest();
+
+// 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.
+    */
+    CVcxHgMyVideosMainViewTest( CTestModuleIf& aTestModuleIf );
+
+    /**
+    * By default Symbian 2nd phase constructor is private.
+    */
+    void ConstructL();
+
+    /**
+    * Frees all resources allocated from test methods.
+    * @since ?Series60_version
+    */
+    void Delete();
+
+    /**
+    * Test methods are listed below. 
+    * 
+    * @param aItem Script line containing parameters.
+    * @return Symbian OS error code.
+    */
+    virtual TInt CreateL( CStifItemParser& aItem );
+    virtual TInt DeleteL( CStifItemParser& aItem );
+    virtual TInt AppUi( CStifItemParser& aItem );
+    virtual TInt Cba( CStifItemParser& aItem );
+    virtual TInt TitlePaneL( CStifItemParser& aItem );
+    virtual TInt PlayerWrapperL( CStifItemParser& aItem );
+    virtual TInt CategoryListL( CStifItemParser& aItem );
+    virtual TInt VideoListL( CStifItemParser& aItem );
+    virtual TInt ActivateCategoryListL( CStifItemParser& aItem );
+    virtual TInt ActivateVideoListL( CStifItemParser& aItem );      
+    virtual TInt HandleCommandL( CStifItemParser& aItem );        
+    virtual TInt UpdateMSKToolbarL( CStifItemParser& aItem );
+    virtual TInt HandleKeyEventL( CStifItemParser& aItem );
+    virtual TInt DynInitMskL( CStifItemParser& aItem );
+    virtual TInt MakeToolbarVisibleL( CStifItemParser& aItem );
+    virtual TInt DynInitToolbarL( CStifItemParser& aItem );
+    virtual TInt HandleCustomViewMessageL( CStifItemParser& aItem );
+    virtual TInt DoActivateL( CStifItemParser& aItem );
+    virtual TInt DoDeactivateL( CStifItemParser& aItem );
+    
+    /**
+     * Method used to log version of test class
+     */
+    void SendTestClassVersion();
+
+// Data
+    
+    CVcxHgMyVideosMainView* iView;
+
+    };
+
+#endif      // VCXHGMYVIDEOSMAINVIEWTEST_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/tsrc/ut_vcxhgmyvideosmainview/init/testframework.ini	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,169 @@
+#
+# This is STIFTestFramework initialization file 123
+# 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': Sret of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases' 
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.sd
+#
+# 	- 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.
+
+[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= stifmeasurementplugin04 
+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\ui_VcxHgMyVideosMainViewTest.cfg
+[End_Module]
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework 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.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+#CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+#HardwareBasePath=  C:\
+#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
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/tsrc/ut_vcxhgmyvideosmainview/sis/make_ut_vcxhgmyvideosmainview.bat	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,21 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of the License "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description: 
+rem
+
+
+call makesis.exe ut_vcxhgmyvideosmainview.pkg ut_vcxhgmyvideosmainview.sis
+call signsis.exe ut_vcxhgmyvideosmainview.sis ut_vcxhgmyvideosmainview.sisx Nokia_RnDCert_02.der Nokia_RnDCert_02.key
+
+pause
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/tsrc/ut_vcxhgmyvideosmainview/sis/ut_vcxhgmyvideosmainview.pkg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,53 @@
+;
+; 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 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:  Package file for fusion engine STIF tests;
+
+; Languages
+&EN
+
+; Provide value for uid
+#{"Fusion engine tests"},(0x00000000),1,1,0,TYPE=SA
+
+; 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
+
+; COMMON MODULES + INCLUDES
+
+"/epoc32/release/armv5/udeb/VcxHgMyVideosMainViewTest.dll" - "!:/Sys/Bin/VcxHgMyVideosMainViewTest.dll"
+
+"../init/testframework.ini" - "c:/testframework/testframework.ini"
+
+"../conf/ui_VcxHgMyVideosMainViewTest.cfg" - "c:/testframework/ui_VcxHgMyVideosMainViewTest.cfg"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/tsrc/ut_vcxhgmyvideosmainview/src/VcxHgMyVideosMainViewTest.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,147 @@
+/*
+* 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 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:  This file contains testclass implementation.*
+*/
+
+
+// INCLUDE FILES
+#include <Stiftestinterface.h>
+#include "VcxHgMyVideosMainViewTest.h"
+#include <SettingServerClient.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosMainViewTest::CVcxHgMyVideosMainViewTest
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosMainViewTest::CVcxHgMyVideosMainViewTest( 
+    CTestModuleIf& aTestModuleIf ):
+        CScriptBase( aTestModuleIf )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosMainViewTest::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosMainViewTest::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(KVcxHgMyVideosMainViewTestLogFileWithTitle, &title);
+        }
+    else
+        {
+        logFileName.Copy(KVcxHgMyVideosMainViewTestLogFile);
+        }
+
+    iLog = CStifLogger::NewL( KVcxHgMyVideosMainViewTestLogPath, 
+                          logFileName,
+                          CStifLogger::ETxt,
+                          CStifLogger::EFile,
+                          EFalse );
+    
+    SendTestClassVersion();
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosMainViewTest::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosMainViewTest* CVcxHgMyVideosMainViewTest::NewL( 
+    CTestModuleIf& aTestModuleIf )
+    {
+    CVcxHgMyVideosMainViewTest* self = new (ELeave) CVcxHgMyVideosMainViewTest( aTestModuleIf );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+
+    }
+
+// Destructor
+CVcxHgMyVideosMainViewTest::~CVcxHgMyVideosMainViewTest()
+    { 
+
+    // Delete resources allocated from test methods
+    Delete();
+
+    // Delete logger
+    delete iLog; 
+
+    }
+
+//-----------------------------------------------------------------------------
+// CVcxHgMyVideosMainViewTest::SendTestClassVersion
+// Method used to send version of test class
+//-----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosMainViewTest::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("VcxHgMyVideosMainViewTest.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 ) // Backpointer to STIF Test Framework
+    {
+
+    return ( CScriptBase* ) CVcxHgMyVideosMainViewTest::NewL( aTestModuleIf );
+
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/tsrc/ut_vcxhgmyvideosmainview/src/VcxHgMyVideosMainViewTestBlocks.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,349 @@
+/*
+* 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 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:  This file contains testclass implementation.*
+*/
+
+
+// INCLUDES
+#include <e32svr.h>
+#include <StifParser.h>
+#include <Stiftestinterface.h>
+
+#include "VcxHgMyVideosMainViewTest.h"
+
+
+#include <coemain.h>
+#include <aknappui.h>
+#include <aknviewappui.h> 
+#include <aknview.h>
+#include "vcxviewmessageutility.h"
+#include <akntitle.h>
+
+#define private public
+#include "vcxhgmyvideosmainview.h"
+#undef private
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosMainViewTest::Delete
+// Delete here all resources allocated and opened from test methods. 
+// Called from destructor. 
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosMainViewTest::Delete()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosMainViewTest::RunMethodL
+// Run specified method. Contains also table of test mothods and their names.
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosMainViewTest::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( "create" , CVcxHgMyVideosMainViewTest::CreateL  ),
+        ENTRY( "delete" , CVcxHgMyVideosMainViewTest::DeleteL  ),
+        ENTRY( "appui" , CVcxHgMyVideosMainViewTest::AppUi  ),
+        ENTRY( "cba" , CVcxHgMyVideosMainViewTest::Cba  ),
+        ENTRY( "titlepane" , CVcxHgMyVideosMainViewTest::TitlePaneL  ),
+        ENTRY( "playerwrapper" , CVcxHgMyVideosMainViewTest::PlayerWrapperL  ),
+        ENTRY( "categorylist" , CVcxHgMyVideosMainViewTest::CategoryListL  ),
+        ENTRY( "videolist" , CVcxHgMyVideosMainViewTest::VideoListL  ),
+        ENTRY( "activatecategorylist" , CVcxHgMyVideosMainViewTest::ActivateCategoryListL  ),
+        ENTRY( "activatevideolist" , CVcxHgMyVideosMainViewTest::ActivateVideoListL  ),
+        ENTRY( "handlecommand" , CVcxHgMyVideosMainViewTest::HandleCommandL  ),
+        ENTRY( "updatemsktoolbar" , CVcxHgMyVideosMainViewTest::UpdateMSKToolbarL  ),
+        ENTRY( "handlekeyevent" , CVcxHgMyVideosMainViewTest::HandleKeyEventL  ),
+        ENTRY( "dyninitmsk" , CVcxHgMyVideosMainViewTest::DynInitMskL  ),
+        ENTRY( "maketoolbarvisible" , CVcxHgMyVideosMainViewTest::MakeToolbarVisibleL  ),
+        ENTRY( "dyninittoolbar" , CVcxHgMyVideosMainViewTest::DynInitToolbarL  ),
+        ENTRY( "handlecustomviewmessage" , CVcxHgMyVideosMainViewTest::HandleCustomViewMessageL  ),
+        ENTRY( "doactivate" , CVcxHgMyVideosMainViewTest::DoActivateL  ),
+        ENTRY( "dodeactivate" , CVcxHgMyVideosMainViewTest::DoDeactivateL  ),
+        };
+
+    const TInt count = sizeof( KFunctions ) / 
+                        sizeof( TStifFunctionInfo );
+
+    return RunInternalL( KFunctions, count, aItem );
+
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosMainViewTest::
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosMainViewTest::CreateL( CStifItemParser& aItem )
+    {
+    iView = CVcxHgMyVideosMainView::NewL();
+
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosMainViewTest::
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosMainViewTest::DeleteL( CStifItemParser& aItem )
+    {
+    delete iView;
+    iView = NULL;
+
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosMainViewTest::
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosMainViewTest::AppUi( CStifItemParser& aItem )
+    {
+    iView->AppUi();
+
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosMainViewTest::
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosMainViewTest::Cba( CStifItemParser& aItem )
+    {
+    iView->Cba();
+
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosMainViewTest::
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosMainViewTest::TitlePaneL( CStifItemParser& aItem )
+    {
+    iView->TitlePaneL();
+
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosMainViewTest::
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosMainViewTest::PlayerWrapperL( CStifItemParser& aItem )
+    {
+    iView->PlayerWrapperL();
+
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosMainViewTest::
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosMainViewTest::CategoryListL( CStifItemParser& aItem )
+    {
+    iView->CategoryListL();
+
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosMainViewTest::
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosMainViewTest::VideoListL( CStifItemParser& aItem )
+    {
+    iView->VideoListL();
+
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosMainViewTest::
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosMainViewTest::ActivateCategoryListL( CStifItemParser& aItem )
+    {
+    iView->ActivateCategoryListL();
+
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosMainViewTest::
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosMainViewTest::ActivateVideoListL( CStifItemParser& aItem )
+    {
+    TInt param1;
+    aItem.GetNextInt(param1);  
+    
+    iView->ActivateVideoListL( param1  );
+
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosMainViewTest::
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosMainViewTest::HandleCommandL( CStifItemParser& aItem )
+    {
+    TInt param1;
+    aItem.GetNextInt(param1);  
+    
+    iView->HandleCommandL( param1 ); 
+
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosMainViewTest::
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosMainViewTest::UpdateMSKToolbarL( CStifItemParser& aItem )
+    {
+    iView->UpdateMSKToolbarL();
+
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosMainViewTest::
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosMainViewTest::HandleKeyEventL( CStifItemParser& aItem )
+    {
+    TInt param1;
+    aItem.GetNextInt(param1);    
+    TInt param2;
+    aItem.GetNextInt(param2);    
+    TInt param3;
+    aItem.GetNextInt(param3);
+    TInt param4;
+    aItem.GetNextInt(param4);
+    
+    TKeyEvent event;
+    
+    event.iCode = param1;
+    event.iScanCode = param2;
+    event.iRepeats = param3;
+    
+    iView->HandleKeyEventL( event, ( TEventCode )param4 );
+
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosMainViewTest::
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosMainViewTest::DynInitMskL( CStifItemParser& aItem )
+    {
+    iView->DynInitMskL();
+
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosMainViewTest::
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosMainViewTest::MakeToolbarVisibleL( CStifItemParser& aItem )
+    {
+    TInt param;
+    aItem.GetNextInt(param);
+    
+    iView->MakeToolbarVisibleL( param );
+
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosMainViewTest::
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosMainViewTest::DynInitToolbarL( CStifItemParser& aItem )
+    {
+    iView->DynInitToolbarL();
+
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosMainViewTest::
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosMainViewTest::HandleCustomViewMessageL( CStifItemParser& aItem )
+    {
+    TInt param1;
+    aItem.GetNextInt(param1);
+    
+    TPtrC param2;
+    aItem.GetNextString(param2);
+    
+    HBufC8* pbuf = HBufC8::NewLC( param2.Length() );
+    pbuf->Des().Copy( param2 );
+    
+    iView->HandleCustomViewMessageL( TUid::Uid( param1 ), *pbuf );
+    
+    CleanupStack::PopAndDestroy( pbuf );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosMainViewTest::
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosMainViewTest::DoActivateL( CStifItemParser& aItem )
+    {
+    TVwsViewId vid;
+
+    TInt param1;
+    aItem.GetNextInt(param1);
+    TUid uid = TUid::Uid ( param1 );
+    
+    TPtrC param2;
+    aItem.GetNextString(param2);
+    HBufC8* pbuf = HBufC8::NewLC( param2.Length() );
+    pbuf->Des().Copy( param2 );
+
+    iView->DoActivateL( vid,
+                        uid,
+                        *pbuf );
+    
+    CleanupStack::PopAndDestroy( pbuf );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosMainViewTest::
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosMainViewTest::DoDeactivateL( CStifItemParser& aItem )
+    {
+    iView->DoDeactivate();
+
+    return KErrNone;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/tsrc/ut_vcxhgmyvideosmainview/src/vcxhgmyvideoscategorylistimpl_stub.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,143 @@
+/*
+* 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:     Stub class for unit testing*
+*/
+
+
+
+
+// INCLUDE FILES
+
+#include <centralrepository.h>
+
+#include "VcxHgMyVideosCategoryListImpl.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosCategoryListImpl* CVcxHgMyVideosCategoryListImpl::NewL(
+        CVcxHgMyVideosModel& aModel,
+        CVcxHgMyVideosMainView& aView,
+        CHgScroller& aScroller )
+    {
+    CVcxHgMyVideosCategoryListImpl* self = 
+        CVcxHgMyVideosCategoryListImpl::NewLC( aModel, aView, aScroller );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosCategoryListImpl* CVcxHgMyVideosCategoryListImpl::NewLC(
+        CVcxHgMyVideosModel& aModel,
+        CVcxHgMyVideosMainView& aView,
+        CHgScroller& aScroller )
+    {
+    CVcxHgMyVideosCategoryListImpl* self = 
+        new (ELeave) CVcxHgMyVideosCategoryListImpl( aModel, aView, aScroller );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+    
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosCategoryListImpl::CVcxHgMyVideosCategoryListImpl( 
+        CVcxHgMyVideosModel& aModel,
+        CVcxHgMyVideosMainView& aView,
+        CHgScroller& aScroller )
+    : CVcxHgMyVideosListBase( aModel, aView, aScroller ) 
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosCategoryListImpl::ConstructL()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosCategoryListImpl::~CVcxHgMyVideosCategoryListImpl()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosCategoryListImpl::DoListActivateL( TInt aIndex )
+    {  
+    }
+
+// -----------------------------------------------------------------------------
+//  
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosCategoryListImpl::DoListDeactivate()
+    {    
+    }
+
+// -----------------------------------------------------------------------------
+//  
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosCategoryListImpl::Highlight()
+    {
+    return 0;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosCategoryListImpl::HandleSelectL( TInt /*aIndex*/ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosCategoryListImpl::HandleOpenL( TInt /*aIndex*/ )
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosCategoryListImpl::SetEmptyListTextL()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosCategoryListImpl::SetTitleTextL( TInt /*aIndex*/ )
+    {
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/tsrc/ut_vcxhgmyvideosmainview/src/vcxhgmyvideoslistbase_stub.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,109 @@
+/*
+* 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:     Stub class for unit testing*
+*/
+
+
+
+
+// INCLUDE FILES
+
+
+#include <vcxhgmyvideos.rsg>
+#include "vcxhgmyvideoslistbase.h"
+
+
+#include <coemain.h>
+#include <aknappui.h>
+#include <aknviewappui.h> 
+#include <aknview.h>
+#include "vcxviewmessageutility.h"
+#include <akntitle.h>
+
+#define private public
+#include "vcxhgmyvideosmainview.h"
+#undef private
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosListBase::CVcxHgMyVideosListBase( 
+    CVcxHgMyVideosModel& aModel,
+    CVcxHgMyVideosMainView& aView,
+    CHgScroller& aScroller )
+    : iModel( aModel ),
+      iView( aView ),
+      iScroller( &aScroller )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosListBase::ConstructL()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosListBase::~CVcxHgMyVideosListBase()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosListBase::DoListActivateL( TInt aIndex )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//  
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosListBase::DoListDeactivate()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//  
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosListBase::UpdateLayout( TRect& aRect )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosListBase::SetEmptyListTextByResourceL( TInt aResourceId )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosListBase::SetTitleTextByResourceL( TInt aResourceId )
+    {
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/tsrc/ut_vcxhgmyvideosmainview/src/vcxhgmyvideosmainviewcontainer_stub.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,107 @@
+/*
+* 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:     Stub class for unit testing*
+*/
+
+
+
+
+// INCLUDE FILES
+
+#include "VcxHgMyVideosMainViewContainer.h"
+
+
+
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+// 
+CVcxHgMyVideosMainViewContainer::CVcxHgMyVideosMainViewContainer(
+    CVcxHgMyVideosMainView& aParentView )
+    : iParentView( aParentView )
+	{
+	}
+  
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosMainViewContainer* CVcxHgMyVideosMainViewContainer::NewL(
+    CVcxHgMyVideosMainView& aParentView )
+	{
+    CVcxHgMyVideosMainViewContainer* self = NewLC( aParentView );
+    CleanupStack::Pop( self );
+    return self;
+	}
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+// 
+CVcxHgMyVideosMainViewContainer* CVcxHgMyVideosMainViewContainer::NewLC(
+    CVcxHgMyVideosMainView& aParentView )
+	{
+    CVcxHgMyVideosMainViewContainer* self = 
+        new (ELeave) CVcxHgMyVideosMainViewContainer( aParentView );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+	}
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosMainViewContainer::~CVcxHgMyVideosMainViewContainer()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosMainViewContainer::ConstructL()
+	{
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+TBool CVcxHgMyVideosMainViewContainer::IsActivated() const
+    {
+    return EFalse;
+    }
+
+// ---------------------------------------------------------
+// 
+// ---------------------------------------------------------
+//
+TKeyResponse CVcxHgMyVideosMainViewContainer::OfferKeyEventL( 
+        const TKeyEvent& aKeyEvent, 
+        TEventCode aType )
+    {
+    TKeyResponse response( EKeyWasNotConsumed );
+
+    return response;
+    }
+
+// ---------------------------------------------------------
+// 
+// ---------------------------------------------------------
+//
+void CVcxHgMyVideosMainViewContainer::GetHelpContext( TCoeHelpContext& aContext ) const
+    {
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/tsrc/ut_vcxhgmyvideosmainview/src/vcxhgmyvideosmemorystatus_stub.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,41 @@
+/*
+* 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:     Stub class for unit testing*
+*/
+
+
+#include <e32def.h>
+
+#include "VcxHgMyVideosMemoryStatus.h"
+
+
+// INCLUDE FILES
+
+// ========================== MEMBER FUNCTIONS ===============================
+
+// ---------------------------------------------------------------------------
+// TVcxHgMyVideosMemoryStatusDialog::TVcxHgMyVideosMemoryStatusDialog()
+// ---------------------------------------------------------------------------
+//
+TVcxHgMyVideosMemoryStatusDialog::TVcxHgMyVideosMemoryStatusDialog()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// TVcxHgMyVideosMemoryStatusDialog::ShowMemoryStatusDialogL()
+// ---------------------------------------------------------------------------
+//
+void TVcxHgMyVideosMemoryStatusDialog::ShowMemoryStatusDialogL( CVcxHgMyVideosModel& aModel )
+    {
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/tsrc/ut_vcxhgmyvideosmainview/src/vcxhgmyvideosmodel_stub.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,292 @@
+/*
+* 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:     Stub class for unit testing*
+*/
+
+
+#include "VcxHgMyVideosModel.h"
+
+// INCLUDE FILES
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosModel::CVcxHgMyVideosModel()
+  : iAppState( EVcxMyVideosAppStateUnknown ),
+    iPreviousAppState( EVcxMyVideosAppStateUnknown ),
+    iTnRequestId( KErrNotFound ),
+    iSortOrder( EVcxMyVideosSortingNone )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosModel* CVcxHgMyVideosModel::NewL()
+    {
+    CVcxHgMyVideosModel* self = 
+        CVcxHgMyVideosModel::NewLC();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosModel* CVcxHgMyVideosModel::NewLC()
+    {
+    CVcxHgMyVideosModel* self = 
+        new (ELeave) CVcxHgMyVideosModel();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosModel::ConstructL()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosModel::~CVcxHgMyVideosModel()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+TBool CVcxHgMyVideosModel::TouchSupport()
+    {
+    return EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosCollectionClient& CVcxHgMyVideosModel::CollectionClient()
+    {
+    return *iCollection;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosDownloadClient& CVcxHgMyVideosModel::DownloadClient()
+    {
+    return *( CVcxHgMyVideosDownloadClient* ) 0;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+RFs& CVcxHgMyVideosModel::FileServerSessionL()
+    {
+    return *( RFs* ) 0;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+CIptvDriveMonitor& CVcxHgMyVideosModel::DriveMonitorL()
+    {
+    return *( CIptvDriveMonitor* ) 0;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosModel::SetAppState( 
+        CVcxHgMyVideosModel::TVcxMyVideosAppState aAppState )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosModel::TVcxMyVideosAppState CVcxHgMyVideosModel::AppState()
+    {
+    return ( CVcxHgMyVideosModel::TVcxMyVideosAppState )0;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosModel::TVcxMyVideosAppState CVcxHgMyVideosModel::PreviousAppState()
+    {
+    return ( CVcxHgMyVideosModel::TVcxMyVideosAppState )0;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosModel::SetVideolistSortOrderL( TVcxMyVideosSortingOrder aSortOrder )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+TVcxMyVideosSortingOrder CVcxHgMyVideosModel::VideolistSortOrderL()
+    {
+    return EVcxMyVideosSortingNone;
+    }
+
+// -----------------------------------------------------------------------------
+//       Landscape    Portrait
+// QVGA  320x240  or  240x320
+// QHD   640x360  or  360x640
+// VGA   640x480  or  480x640
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosModel::TVcxScreenResolution CVcxHgMyVideosModel::GetScreenResolution( 
+        CCoeEnv* aCoeEnv )
+    {
+    return EVcxScreenResolutionQVGA;
+    }
+
+void CVcxHgMyVideosModel::SetVideoAsLastWatchedL( TVideoPlayerCustomMessage& aVideoInfo, 
+                                                  TInt aMpxId1,
+                                                  TUint32 aAgeProfile )
+    {   
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosModel::UpdateLastWatchedPlayPositionL( TUint32 aLastVideoPlayPoint )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosModel::GetLastWatchedDataL( TVideoPlayerCustomMessage& aVideoInfo,
+                                               TUint32& /*aMpxId1 */,
+                                               TUint32& aAgeProfile )
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// From MThumbnailManagerObserver, not used in Video Center.
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosModel::ThumbnailPreviewReady( MThumbnailData& /*aThumbnail*/, 
+                                                 TThumbnailRequestId /*aId*/ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// From MThumbnailManagerObserver
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosModel::ThumbnailReady( TInt aError,
+                                          MThumbnailData& aThumbnail,
+                                          TThumbnailRequestId aId )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosModel::HandleThumbnailReadyL( TInt aError,
+                                                 MThumbnailData& aThumbnail,
+                                                 TThumbnailRequestId aId )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosModel::ResetDownloadNotification()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+CThumbnailManager* CVcxHgMyVideosModel::ThumbnailManagerL()
+    {
+    return (CThumbnailManager*) 0;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosModel::CopyVideoPlayerCustomMessageL( TVideoPlayerCustomMessage& aSource,
+                                                         TVideoPlayerCustomMessage& aTarget )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+TVideoPlayerCustomMessage* CVcxHgMyVideosModel::VideoPlayerCustomMessageL()
+    {
+    return (TVideoPlayerCustomMessage*) NULL;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+CIptvLastWatchedApi* CVcxHgMyVideosModel::LastWatchedApiL()
+    {
+    return (CIptvLastWatchedApi*) NULL;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+CIptvLastWatchedData* CVcxHgMyVideosModel::LastWatchedDataL()
+    {
+    return (CIptvLastWatchedData*) 0;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosModel::HandleDriveMonitorEvent( TIptvDriveMonitorEvent& /*aEvent*/ )
+    {
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/tsrc/ut_vcxhgmyvideosmainview/src/vcxhgmyvideosupnpinterface_stub.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,146 @@
+/*
+* 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:     Stub class for unit testing*
+*/
+
+
+
+#include "VcxHgMyVideosUPnPInterface.h"
+
+// INCLUDE FILES
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosUPnPInterface::CVcxHgMyVideosuPnPInterface()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosUPnPInterface::CVcxHgMyVideosUPnPInterface()
+    {
+    // No implementation required
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosUPnPInterface::~CVcxHgMyVideosuPnPInterface()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosUPnPInterface::~CVcxHgMyVideosUPnPInterface() 
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosUPnPInterface::NewLC()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosUPnPInterface* CVcxHgMyVideosUPnPInterface::NewLC( 
+        MUpnpCommandObserver* aExtObserver )
+    {
+    CVcxHgMyVideosUPnPInterface* self = new ( ELeave )CVcxHgMyVideosUPnPInterface();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosUPnPInterface::NewL()
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosUPnPInterface* CVcxHgMyVideosUPnPInterface::NewL( 
+        MUpnpCommandObserver* aExtObserver )
+    {
+    CVcxHgMyVideosUPnPInterface* self = CVcxHgMyVideosUPnPInterface::NewLC( aExtObserver );    
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosUPnPInterface::ConstructL()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosUPnPInterface::ConstructL()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosUPnPInterface::TryCreateCmd()
+// -----------------------------------------------------------------------------
+//
+TBool CVcxHgMyVideosUPnPInterface::TryCreateCmd()
+    {
+    return ETrue;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosUPnPInterface::IsApplicable()
+// -----------------------------------------------------------------------------
+//
+TBool CVcxHgMyVideosUPnPInterface::IsApplicable() 
+    {
+    return ETrue;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosUPnPInterface::IsStarted()
+// -----------------------------------------------------------------------------
+//
+TBool CVcxHgMyVideosUPnPInterface::IsStarted() 
+    {
+    return EFalse;        
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosUPnPInterface::Start()
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosUPnPInterface::Start()
+    { 
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosUPnPInterface::ShowVideo()
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosUPnPInterface::ShowVideo( const TDesC& aVideoPath )
+    { 
+    return KErrNone;
+    }
+ 
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosUPnPInterface::ShowThumbnail()
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosUPnPInterface::ShowThumbnail( const TDesC& aPath )
+    { 
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosUPnPInterface::Stop()
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosUPnPInterface::Stop()
+    { 
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosUPnPInterface::Stop()
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosUPnPInterface::CommandComplete( TInt aStatusCode )
+    {
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/tsrc/ut_vcxhgmyvideosmainview/src/vcxhgmyvideosvideodetailsdialog_stub.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,42 @@
+/*
+* 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:     Stub class for unit testing*
+*/
+
+
+#include <e32def.h>
+#include <mpxmedia.h>
+
+#include "VcxHgMyVideosVideoDetailsDialog.h"
+
+
+// INCLUDE FILES
+
+// ============================ MEMBER FUNCTIONS =============================
+
+// ---------------------------------------------------------------------------
+// TVcxHgMyVideosVideoDetailsDialog::TVcxHgMyVideosVideoDetailsDialog()
+// ---------------------------------------------------------------------------
+//
+TVcxHgMyVideosVideoDetailsDialog::TVcxHgMyVideosVideoDetailsDialog()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// TVcxHgMyVideosVideoDetailsDialog::ShowVideoDetailsDialogL()
+// ---------------------------------------------------------------------------
+//
+void TVcxHgMyVideosVideoDetailsDialog::ShowVideoDetailsDialogL( const CMPXMedia& aMedia )
+    {
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/tsrc/ut_vcxhgmyvideosmainview/src/vcxhgmyvideosvideolistimpl_stub.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,487 @@
+/*
+* 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:     Stub class for unit testing*
+*/
+
+
+
+
+#include <centralrepository.h>
+#include "VcxHgMyVideosVideoListImpl.h"
+
+// INCLUDE FILES
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosVideoListImpl* CVcxHgMyVideosVideoListImpl::NewL(
+        CVcxHgMyVideosModel& aModel,
+        CVcxHgMyVideosMainView& aView,
+        CHgScroller& aScroller )
+    {
+    CVcxHgMyVideosVideoListImpl* self = 
+        CVcxHgMyVideosVideoListImpl::NewLC( aModel, aView, aScroller );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosVideoListImpl* CVcxHgMyVideosVideoListImpl::NewLC(
+        CVcxHgMyVideosModel& aModel,
+        CVcxHgMyVideosMainView& aView,
+        CHgScroller& aScroller )
+    {
+    CVcxHgMyVideosVideoListImpl* self = 
+        new (ELeave) CVcxHgMyVideosVideoListImpl( aModel, aView, aScroller );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+    
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosVideoListImpl::CVcxHgMyVideosVideoListImpl( 
+        CVcxHgMyVideosModel& aModel,
+        CVcxHgMyVideosMainView& aView,
+        CHgScroller& aScroller )
+  : CVcxHgMyVideosListBase( aModel, aView, aScroller ),
+    iCurrentlyPlayedVideo( KErrNotFound ),
+    iMultipleMarkingActive( EFalse ),
+    iEnv( CCoeEnv::Static() )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::ConstructL()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosVideoListImpl::~CVcxHgMyVideosVideoListImpl()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::DoListActivateL( TInt aIndex )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//  
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::DoListDeactivate( )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//  
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosVideoModelHandler& CVcxHgMyVideosVideoListImpl::VideoModel()
+    {
+    return *( CVcxHgMyVideosVideoModelHandler* ) NULL;
+    }
+
+// -----------------------------------------------------------------------------
+//  
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosUPnPInterface& CVcxHgMyVideosVideoListImpl::UPnPInterface()
+    {
+    return *( CVcxHgMyVideosUPnPInterface* ) NULL;
+    }
+
+// -----------------------------------------------------------------------------
+//  
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::UpdateLayout( TRect& aRect )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//  
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::HandleSelectL( TInt /*aIndex*/ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//  
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::HandleOpenL( TInt /*aIndex*/ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//  
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::HandleMarkingL( TInt /*aIndex*/, TBool /*aMarked*/ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//  
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosVideoListImpl::Highlight()
+    {
+    }
+
+// ---------------------------------------------------------
+// Returns the index(es) of videos that should be the target
+// for user's operation.
+// ---------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::GetOperationTargetIndexesL( 
+        RArray<TInt>& aOperationTargets )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::PlayCurrentVideoL()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::PlayExternalVideoL( TBool /*aLastWatched*/,
+                                                      const TDesC& aVideoPath )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//  
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::SelectNextVideoL( 
+        TBool aForward,
+        TViaPlayerCustomMessage& aVideoInfo )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//  
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::DeleteVideosL()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+TBool CVcxHgMyVideosVideoListImpl::ConfirmDeleteVideosL( TInt aTargetCount,
+                                                         const TDesC& aTargetName )
+    {
+    return EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::OpenDeleteWaitNoteL()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::CloseDeleteWaitNote()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::CommandComplete( TInt aStatusCode )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// Callback about (delete) wait note dismissal.
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::DialogDismissedL( TInt aButtonId )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosVideoListImpl::VideoDeletionCompletedL( TInt aFailedCount,
+                                                           const TDesC& aFailedName )
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+//  
+// -----------------------------------------------------------------------------
+//
+//void CVcxHgMyVideosVideoListImpl::PlayVideoL()
+//    {
+//    }
+
+// -----------------------------------------------------------------------------
+//  
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::HandleSortCommandL( TInt aSortCommand )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//  
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::ShowMarkMenuItemsL( 
+        TBool& aShowMarkSubmenu, TBool& aShowMark, TBool& aShowUnmark, 
+        TBool& aShowMarkAll, TBool& aShowUnmarkAll )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//  
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::HandleMarkCommandL( TInt aMarkCommand )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//  
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::ShowMoveAndCopyMenuItemsL( 
+        TBool& aShowMoveAndCopySubmenu, TBool& aShowCopy, TBool& aShowMove )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//  
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::HandleMoveOrCopyCommandL( TBool aCopy )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//  
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::VideoMoveOrCopyCompletedL( TInt aFailedCount,
+                                                             const TDesC& aFailedName )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//  
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::ShowResumeStartsFromBeginningNoteL()
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::DynInitToolbarL()
+    {    
+    }
+
+// ------------------------------------------------------------------------------
+//
+// ------------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::OfferToolbarEventL( TInt aCommand )
+    {
+    }
+
+// ------------------------------------------------------------------------------
+//
+// ------------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::MakeToolbarVisible( TBool aVisible )
+    {
+    }
+
+// ------------------------------------------------------------------------------
+//
+// ------------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::DynInitMenuPaneL( TInt aResourceId,
+                                                    CEikMenuPane* aMenuPane )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::SetEmptyListTextL()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::SetTitleTextL( TInt aIndex )
+    {
+    
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosVideoListImpl::GetMskResourceL()
+    {
+    return 0;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::CheckParentalControlL( TUint32 aAgeProfile )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// StartMarkingMode()
+// ---------------------------------------------------------------------------
+//  
+void CVcxHgMyVideosVideoListImpl::StartMarkingMode()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// EndMarkingMode()
+// ---------------------------------------------------------------------------
+//  
+void CVcxHgMyVideosVideoListImpl::EndMarkingMode()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// HandleSendL()
+// ---------------------------------------------------------------------------
+//  
+void CVcxHgMyVideosVideoListImpl::HandleSendL()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// MessagingConfL()
+// ---------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosVideoListImpl::MessagingConfL()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// IsDrmProtectedFileL()
+// ---------------------------------------------------------------------------
+//
+TBool CVcxHgMyVideosVideoListImpl::IsDrmProtectedFileL( TDesC& aFileName )
+    {
+    return EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+// IsSendingFileAllowedL()
+// ---------------------------------------------------------------------------
+//
+TBool CVcxHgMyVideosVideoListImpl::IsSendingFileAllowedL( TDesC& aFileName )
+    {
+    return ETrue;
+    }
+
+// ---------------------------------------------------------------------------
+// SendUi()
+// ---------------------------------------------------------------------------
+//
+CSendUi* CVcxHgMyVideosVideoListImpl::SendUiL()
+    {
+    return ( CSendUi* ) 0;
+    }
+
+// ---------------------------------------------------------------------------
+// DrmUtilityL()
+// ---------------------------------------------------------------------------
+//
+DRM::CDrmUtility* CVcxHgMyVideosVideoListImpl::DrmUtilityL()
+    {
+    return ( DRM::CDrmUtility* ) 0;
+    }
+
+// ---------------------------------------------------------------------------
+// DrmHelperL()
+// ---------------------------------------------------------------------------
+//
+CDRMHelper* CVcxHgMyVideosVideoListImpl::DrmHelperL()
+    {
+    return ( CDRMHelper* ) 0;
+    }
+
+// ---------------------------------------------------------------------------
+// TryHandleAiwCommandL()
+// ---------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::TryHandleAiwCommandL( TInt aCommand )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// NotifyForbiddenFilesL()
+// ---------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoListImpl::NotifyForbiddenFilesL( TInt aCount )
+    {
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideos/tsrc/ut_vcxhgmyvideosmainview/src/vcxhgmyvideosvideomodelhandler_stub.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,506 @@
+/*
+* 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:     Stub class for unit testing.*
+*/
+
+
+
+
+// INCLUDE FILES
+
+
+#include "VcxHgMyVideosVideoModelHandler.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosVideoModelHandler* CVcxHgMyVideosVideoModelHandler::NewL( 
+        CVcxHgMyVideosVideoListImpl& aVideoListImpl,
+        CVcxHgMyVideosModel& aModel,
+        CVcxHgMyVideosMainView& aView,
+        CHgScroller& aScroller )        
+    {
+    CVcxHgMyVideosVideoModelHandler* self = 
+        CVcxHgMyVideosVideoModelHandler::NewLC( 
+            aVideoListImpl, aModel, aView, aScroller );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosVideoModelHandler* CVcxHgMyVideosVideoModelHandler::NewLC(
+        CVcxHgMyVideosVideoListImpl& aVideoListImpl,
+        CVcxHgMyVideosModel& aModel,
+        CVcxHgMyVideosMainView& aView,
+        CHgScroller& aScroller )        
+    {
+    CVcxHgMyVideosVideoModelHandler* self = 
+        new (ELeave) CVcxHgMyVideosVideoModelHandler( 
+            aVideoListImpl, aModel, aView, aScroller );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// Constructor
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosVideoModelHandler::CVcxHgMyVideosVideoModelHandler(
+        CVcxHgMyVideosVideoListImpl& aVideoListImpl,
+        CVcxHgMyVideosModel& aModel,
+        CVcxHgMyVideosMainView& aView,
+        CHgScroller& aScroller )
+    : iVideoListImpl( aVideoListImpl ),
+      iModel( aModel ),
+      iView( aView ),
+      iScroller( aScroller ),
+      iCurrentCategoryIndex( KErrNotFound ),
+      iRestoreHighlightPosition( EFalse )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoModelHandler::ConstructL()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// Destructor
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosVideoModelHandler::~CVcxHgMyVideosVideoModelHandler()
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoModelHandler::DoModelActivateL()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoModelHandler::DoModelDeactivate()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoModelHandler::SaveHighlightedItemIdL()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoModelHandler::UpdateVideoListL( TInt aCategoryIndex )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoModelHandler::ResortVideoListL()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//  
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosVideoModelHandler::Highlight()
+    {
+    return 0;
+    }
+
+// -----------------------------------------------------------------------------
+//  
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosVideoModelHandler::VideoCount()
+    {
+    return 1;
+    }
+
+// -----------------------------------------------------------------------------
+//  
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosVideoModelHandler::CurrentCategoryIndex()
+    {
+    return 2;
+    }
+
+// -----------------------------------------------------------------------------
+//  
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoModelHandler::MarkedVideosL( 
+        RArray<TInt>& aMarkedVideos )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+TBool CVcxHgMyVideosVideoModelHandler::IsProgressivePlayPossible( TInt aIndex )
+    {
+    return ETrue;
+    }
+
+// -----------------------------------------------------------------------------
+//  
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoModelHandler::HandleMarkCommandL( TInt aMarkCommand )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosVideoModelHandler::GetViaPlayerCustomMessage(
+        TInt aIndex, TViaPlayerCustomMessage& aVideoInfo, TInt& aMpxId1 )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosVideoModelHandler::GetViaPlayerCustomMessage(
+        TMPXItemId& aMpxItemId, TViaPlayerCustomMessage& aVideoInfo )
+    {
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosVideoModelHandler::GetVideoPlayerCustomMessage(
+        TInt aIndex, TVideoPlayerCustomMessage& aVideoInfo, TInt& aMpxId1 )
+    {
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosVideoModelHandler::GetVideoPlayerCustomMessage(
+        TMPXItemId& aMpxItemId, TVideoPlayerCustomMessage& aVideoInfo )
+    {
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+TInt32 CVcxHgMyVideosVideoModelHandler::VideoAgeProfileL( TInt aIndex )
+    {
+    return 0;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+TInt32 CVcxHgMyVideosVideoModelHandler::VideoAgeProfileL( TMPXItemId aId )
+    {
+    return 0;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+TInt32 CVcxHgMyVideosVideoModelHandler::VideoAgeProfileL( CMPXMedia* aMedia )
+    {
+    return 0;
+    }
+
+// -----------------------------------------------------------------------------
+// Tries to find MPX Item Id based on URI. Does not modify MPX Item Id's initial
+// value if video not found.
+// -----------------------------------------------------------------------------
+//
+TBool CVcxHgMyVideosVideoModelHandler::FindVideoMpxIdL( const TDesC& aVideoPath,
+                                                        TMPXItemId& aMpxItemId )
+    {
+    return EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// Informative call about video being played. Method removes possible new indicator
+// from video.
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoModelHandler::ClearNewVideoIndicatorL( TInt aIndex )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// Informative call about video being played. Method removes possible new indicator
+// from video.
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoModelHandler::ClearNewVideoIndicatorL( TMPXItemId& aMpxItemId )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoModelHandler::ShowVideoDetailsDialogL()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosVideoModelHandler::LastPlaybackPosition( const TDesC& aContentUri )
+    {
+    return 0;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoModelHandler::SetLastPlaybackPositionL( const TDesC& aContentUri,
+                                                                TInt aPosition )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+const TDesC& CVcxHgMyVideosVideoModelHandler::GetVideoName( TInt aIndex )
+    {
+    return KNullDesC;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+const TDesC& CVcxHgMyVideosVideoModelHandler::GetVideoUri( TInt aIndex )
+    {
+    return KNullDesC;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosVideoModelHandler::GetVideoSize( TInt aIndex )
+    {
+    return 0;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoModelHandler::DeleteVideosL( 
+        const RArray<TInt>& aOperationTargets )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoModelHandler::MoveOrCopyVideosL( 
+        const RArray<TInt>& aOperationTargets,
+        TInt aTargetDrive,
+        TBool aCopy )
+    { 
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoModelHandler::PlayVideoL( TInt aIndex )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoModelHandler::Release( TInt aReleaseStart, 
+                                               TInt aReleaseEnd )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoModelHandler::Request( TInt aRequestStart, 
+                                               TInt aRequestEnd,
+                                               THgScrollDirection aDirection )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoModelHandler::HandleRequestL( TInt aRequestStart, 
+                                                      TInt aRequestEnd,
+                                                      THgScrollDirection aDirection )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+// 
+HBufC* CVcxHgMyVideosVideoModelHandler::FormatVideoSecondRowLC( 
+           CMPXMedia& aMedia )
+        
+    {
+    return ( HBufC* ) NULL ;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosVideoModelHandler::ReplaceVideoArrayL( CMPXMediaArray& aVideoList )
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosVideoModelHandler::UpdateVideoListItemL( TInt aListIndex )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosVideoModelHandler::DeleteItemL( TMPXItemId aMpxItemId )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosVideoModelHandler::InsertVideoL( CMPXMedia* aVideo )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+// 
+TBool CVcxHgMyVideosVideoModelHandler::ValidOrigin( CMPXMedia& aMedia )
+    {
+    return EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// MPX Collection calls this callback when video list is available.
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosVideoModelHandler::NewVideoListL( CMPXMediaArray& aVideoList )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// MPX Collection calls this callback when the video list has been modified.
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosVideoModelHandler::VideoListModifiedL()
+    {}
+
+// -----------------------------------------------------------------------------
+// MPX Collection calls this callback when single video item has been modified.
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosVideoModelHandler::VideoModifiedL( TMPXChangeEventType aEventType,
+                                                      TMPXItemId aMpxItemId,
+                                                      TInt32 aExtraInfo,
+                                                      TBool aSimulated )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// MPX Collection calls this callback when a single video has fetched.
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosVideoModelHandler::VideoFetchingCompletedL( CMPXMedia* aVideo )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// MPX Collection calls this callback when deletion of multiple videos completes.
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosVideoModelHandler::VideoDeletionCompletedL( TInt aFailedCount,
+                                                               TMPXItemId aFailedMpxId )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// MPX Collection calls this callback when move or copy command is completed.
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosVideoModelHandler::VideoMoveOrCopyCompletedL( TInt aFailedCount,
+                                                                 TMPXItemId aFailedMpxId )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// MPX Collection calls this callback when details fetching is completed.
+// -----------------------------------------------------------------------------
+// 
+void CVcxHgMyVideosVideoModelHandler::VideoDetailsCompletedL( const CMPXMedia& aMedia )
+    {
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideosplugin/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2006-2009 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:   Hgmyvideosplugin build include file*
+*/
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+WINSCW ARMV5
+
+PRJ_EXPORTS
+
+../rom/hgmyvideosplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(hgmyvideosplugin.iby)
+
+PRJ_MMPFILES
+vcxhgmyvideosplugin.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideosplugin/group/vcxhgmyvideosplugin.mmp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,54 @@
+/*
+* 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:   vcxhgmyvideosplugin buildfile*
+*/
+
+
+// Version : %version: 9 %
+
+#include <data_caging_paths.hrh>
+#include <bldvariant.hrh>
+#include <platform_paths.hrh>
+
+
+TARGET          vcxhgmyvideosplugin.dll
+TARGETTYPE      PLUGIN
+UID             0x10009D8D 0x2001B2B3
+
+CAPABILITY      CAP_ECOM_PLUGIN -AllFiles
+VENDORID        VID_DEFAULT
+
+
+SOURCEPATH      ../src
+SOURCE          vcxhgmyvideospluginproxy.cpp
+SOURCE          vcxhgmyvideosplugin.cpp
+
+START RESOURCE  ../rss/vcxhgmyvideosplugin.rss
+TARGET          vcxhgmyvideosplugin.rsc
+END // RESOURCE
+
+USERINCLUDE     ../inc 
+USERINCLUDE     ../../hgmyvideos/inc
+USERINCLUDE     ../../../inc    
+
+APP_LAYER_SYSTEMINCLUDE
+
+LIBRARY         euser.lib
+LIBRARY         apparc.lib
+LIBRARY         cone.lib
+LIBRARY         eikcore.lib 
+LIBRARY         avkon.lib
+LIBRARY         ecom.lib
+LIBRARY         mpxviewplugin.lib
+LIBRARY         vcxhgmyvideos.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideosplugin/inc/vcxhgmyvideosplugin.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,70 @@
+/*
+* Copyright (c) 2006-2009 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:   CVcxHgMyVideosPlugin class definition*
+*/
+
+
+
+#ifndef VCXHGMYVIDEOSPLUGIN_H
+#define VCXHGMYVIDEOSPLUGIN_H
+
+// INCLUDE FILES
+#include <mpxaknviewplugin.h>
+
+// CLASS DECLARATION
+
+/**
+ * 
+ *
+ *  @lib vcxhgmyvideosplugin.lib
+ */
+NONSHARABLE_CLASS( CVcxHgMyVideosPlugin ) : public CMPXAknViewPlugin
+    {
+public:
+
+    /**
+     * Two-phased constructor.
+     *
+     * @return Pointer to newly created object.
+     */
+    static CVcxHgMyVideosPlugin* NewL();
+
+    /**
+     * Destructor.
+     */
+    virtual ~CVcxHgMyVideosPlugin();
+
+private:
+
+    /**
+     * From CMPXAknViewPlugin. Construct Avkon view.
+     *
+     * @return Pointer to a newly created Avkon view.
+     */
+    CAknView* ConstructViewLC();
+
+private:
+
+    /**
+     * C++ default constructor.
+     */
+    CVcxHgMyVideosPlugin();
+
+    /**
+     * By default Symbian 2nd phase constructor is private.
+     */
+    void ConstructL();
+    };
+
+#endif // VCXHGMYVIDEOSPLUGIN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideosplugin/inc/vcxhgmyvideosplugin.hrh	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2006-2009 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:   Defines implementation UID for hgmyvideos*
+*/
+
+
+
+#ifndef VCXHGMYVIDEOSPLUGIN_HRH
+#define VCXHGMYVIDEOSPLUGIN_HRH
+
+/**
+ * View dll implementation ID 
+ */
+#define KVcxHgMyVideosImplementationId 0x2001B2B4
+
+#endif // VCXHGMYVIDEOSPLUGIN_HRH
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideosplugin/rom/hgmyvideosplugin.iby	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2006-2009 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:   Image description file for project hgmyvideosplugin.*
+*/
+
+
+
+#ifndef HGMYVIDEOSPLUGIN_IBY
+#define HGMYVIDEOSPLUGIN_IBY
+
+#include <data_caging_paths_for_iby.hrh>
+
+ECOM_PLUGIN( vcxhgmyvideosplugin.dll, vcxhgmyvideosplugin.rsc )
+
+#endif // HGMYVIDEOSPLUGIN_IBY
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideosplugin/rss/vcxhgmyvideosplugin.rss	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,78 @@
+/*
+* Copyright (c) 2006-2009 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:   vcxhgmyvideosplugin ECom resource file*
+*/
+
+
+
+// INCLUDE FILES
+#include <ecom/registryinfo.rh>
+#include <mpxviewplugin.hrh>
+
+// include common headerxxxxxviewtypes.hrh that has 0x2000B43C defined.
+
+#include "vcxhgmyvideosplugin.hrh"
+
+// RESOURCE DEFINITIONS 
+
+/**
+ * The opaque_data syntax is made up of three parts: 
+ * a list of Uids for resolving the view plugin, feature flags, priority.
+ * 
+ * <p>uid1;uid2;uid3</p>
+ *  uid*: uid of the supported Playback/Collection plugin.
+ *  E.g. if the view plugin supports Local Playback plugin, the list of
+ *  uids will be: 0x101FFC06
+ *
+ * <t>uid</t>
+ *  uid: plugin type uid.
+ *  E.g. if the view plugin supports playback type, uid will be: 0x101FFCA0
+ *
+ * <f>flags</f> [optional]
+ *  flags: sum of the required feature flags that listed in mpxviewplugin.hrh. 
+ *  E.g. if the view plugin needs to be pre-loaded and it's user-selectable,
+ *  then flags = KMPXVpFeaturePreLoaded + KMPXVpFeatureUserSelectable = 0x0003.
+ *
+ * <i>priority</i> [optional]
+ *  priority: a value of type TMPXViewPluginPriorities. This value determines
+ *  which view plugin will be resolved when several plugins can support the 
+ *  same set of Uids. 
+ *  Default value of this field is EMPXViewPluginPriorityNormal.
+ */
+RESOURCE REGISTRY_INFO theInfo
+    {
+    dll_uid = 0x2001B2B3;
+
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            interface_uid = KMPXViewPluginInterfaceUid;
+            implementations = 
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = KVcxHgMyVideosImplementationId;
+                    version_no = 2;       // version increased from original
+                    display_name = "vcxhgmyvideos"; 
+                    default_data = "";
+                    opaque_data = "<p></p>"
+                                  "<t>0x2000B43C</t>" // See above
+                                  "<f>0x0</f>"
+                                  "<i>"EMPXViewPluginPriorityNormal"</i>";
+                    }
+                };
+            }
+        };
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideosplugin/src/vcxhgmyvideosplugin.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,69 @@
+/*
+* Copyright (c) 2006-2009 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:   CVcxHgMyVideosPlugin class implementation*
+*/
+
+
+
+// INCLUDE FILES
+#include "vcxhgmyvideosmainview.h"
+#include "vcxhgmyvideosplugin.h"
+
+// ============================ MEMBER FUNCTIONS =============================
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CVcxHgMyVideosPlugin::CVcxHgMyVideosPlugin()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CVcxHgMyVideosPlugin::ConstructL()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CVcxHgMyVideosPlugin* CVcxHgMyVideosPlugin::NewL()
+    {
+    CVcxHgMyVideosPlugin* self = new ( ELeave ) CVcxHgMyVideosPlugin;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CVcxHgMyVideosPlugin::~CVcxHgMyVideosPlugin()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// From CMPXAknViewPlugin. Construct Avkon view.
+// ---------------------------------------------------------------------------
+//
+CAknView* CVcxHgMyVideosPlugin::ConstructViewLC()
+    {
+    return CVcxHgMyVideosMainView::NewLC();
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/hgmyvideosplugin/src/vcxhgmyvideospluginproxy.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,52 @@
+/*
+* Copyright (c) 2006-2009 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:   vcxhgmyvideosplugin.dll implementation proxy*
+*/
+
+
+
+// INCLUDE FILES
+#include <ecom/implementationproxy.h>
+
+#include "vcxhgmyvideosplugin.hrh"
+#include "vcxhgmyvideosplugin.h"
+
+#if ( !defined IMPLEMENTATION_PROXY_ENTRY )
+typedef TAny* TProxyNewLPtr;
+#define IMPLEMENTATION_PROXY_ENTRY( aUid,aFuncPtr ) { { aUid }, ( TProxyNewLPtr )( aFuncPtr ) }
+#endif
+
+// ---------------------------------------------------------------------------
+// The list of implementations
+// ---------------------------------------------------------------------------
+//
+const TImplementationProxy ImplementationTable[] = 
+    { 
+    IMPLEMENTATION_PROXY_ENTRY( 
+        KVcxHgMyVideosImplementationId, 
+        CVcxHgMyVideosPlugin::NewL ) 
+    };
+
+// ---------------------------------------------------------------------------
+// The proxy of implementations
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(
+    TInt& aTableCount )
+    {
+    aTableCount = 
+        sizeof( ImplementationTable ) / sizeof( TImplementationProxy );
+
+    return ImplementationTable;
+    }
Binary file videocollection/mpxmyvideoscollection/conf/videoscollection.confml has changed
Binary file videocollection/mpxmyvideoscollection/conf/videoscollection_2001B2A9.crml has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/data/vcxmyvideoscollectionplugin.RSS	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,72 @@
+/*
+* 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 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 <ecom/registryinfo.rh>
+#include <mpxcollectionplugin.hrh>
+#include <vcxmyvideosuids.h>
+
+/**
+ * The opaque_data syntax is made up of three parts: 
+ * a list of Uids for resolving the view plugin, feature flags, priority.
+ * 
+ * <p>uid1;uid2;uid3</p>
+ *  uid*: Supported plugin types.
+ *  E.g. if podcast plugin may support music plugin as well, KMPXColPluginMusic
+ *
+ * <t>uid</t>
+ *  uid: plugin type uid.
+ *  E.g. for music plugin will be: 0x101FFCDA
+ *
+ * <f>flags</f> [optional]
+ *  flags: sum of the required feature flags, not used now
+ *
+ * <i>priority</i> [optional]
+ *  priority: a value of type TMPXCollectionPluginPriorities. This value determines
+ *  the returning order when several plugins can support the same set of Uids. 
+ *  Default value of this field is EMPXCollectionPluginPriorityNormal.
+ */
+
+RESOURCE REGISTRY_INFO theInfo
+    {
+    dll_uid = 0x20016B96;
+
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            interface_uid = KMPXCollectionPluginInterfaceUid;
+            implementations = 
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = KVcxUidMyVideosMpxCollection;
+                    version_no = 1;
+                    display_name = "My Videos";
+                    default_data = "";
+//                    opaque_data = "<f>"EMPXCollectionPluginFlagCacheable"</f>"
+//                                  "<i>"EMPXCollectionPluginPriorityNormal"</i>";
+                    opaque_data = "<i>"EMPXCollectionPluginPriorityNormal"</i>";
+                    }
+                };
+            }
+        };
+    }
+            
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2006 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:    Build information file for MpxMyVideosCollection*
+*/
+
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/mpxmyvideoscollection.iby    CORE_APP_LAYER_IBY_EXPORT_PATH(mpxmyvideoscollection.iby)
+
+../conf/videoscollection.confml          APP_LAYER_CONFML(videoscollection.confml)
+../conf/videoscollection_2001B2A9.crml   APP_LAYER_CRML(videoscollection_2001B2A9.crml)
+
+PRJ_MMPFILES
+vcxmyvideoscollectionplugin.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/group/vcxmyvideoscollectionplugin.mmp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,73 @@
+/*
+* 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:    My Videos mpx collection plugin project specification*
+*/
+
+
+
+#include <bldvariant.hrh>
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+TARGET          vcxmyvideoscollectionplugin.dll
+TARGETTYPE      PLUGIN
+UID             0x10009D8D 0x20016B96
+
+VENDORID        VID_DEFAULT
+//CAPABILITY      CAP_ECOM_PLUGIN
+CAPABILITY All -TCB
+
+SOURCEPATH      ../src
+SOURCE          vcxmyvideoscollectionpluginproxy.cpp
+SOURCE          vcxmyvideoscollectionplugin.cpp
+SOURCE          vcxmyvideosmdsdb.cpp
+SOURCE          vcxmyvideoscollectionutil.cpp
+SOURCE          vcxmyvideosvideocache.cpp
+SOURCE          vcxmyvideoscategories.cpp
+SOURCE          vcxmyvideosmessagelist.cpp
+SOURCE          vcxmyvideosasyncfileoperations.cpp
+SOURCE          vcxmyvideosdrivemonitor.cpp
+SOURCE          vcxmyvideosdriveinfo.cpp
+SOURCE          vcxmyvideosdrivemonitorevent.cpp
+SOURCE          vcxmyvideosactivetask.cpp
+SOURCE          vcxmyvideosopenhandler.cpp
+SOURCE          vcxmyvideosmdsalbums.cpp
+SOURCE          vcxmyvideosmdscmdqueue.cpp
+SOURCE          vcxmyvideosalbums.cpp
+SOURCE          vcxmyvideosalbum.cpp
+SOURCE          vcxmyvideosasyncfilecopy.cpp
+
+SOURCEPATH      ../data
+
+START RESOURCE  vcxmyvideoscollectionplugin.RSS
+TARGET          vcxmyvideoscollectionplugin.rsc
+END
+
+USERINCLUDE     ../inc
+USERINCLUDE     ../../inc
+
+APP_LAYER_SYSTEMINCLUDE
+
+LIBRARY         euser.lib
+LIBRARY         ecom.lib
+
+LIBRARY         estor.lib
+LIBRARY         mpxcommon.lib
+LIBRARY         bafl.lib
+LIBRARY         flogger.lib
+LIBRARY         mdeclient.lib
+LIBRARY         efsrv.lib
+LIBRARY         charconv.lib
+LIBRARY         centralrepository.lib
+LIBRARY         platformenv.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosactivetask.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,167 @@
+/*
+* 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 <mpxcommand.h>
+#include <mpxmessage2.h>
+
+/**
+* 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();
+
+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
+    };
+
+#endif // VCXMYVIDEOSACTIVETASK_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosalbum.h	Thu Nov 04 11:16:56 2010 +0200
@@ -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 <e32std.h>
+#include <e32base.h>
+
+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<TUint32>& 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<TVcxMyVideosAlbumVideo> 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<TVcxMyVideosAlbumVideo> iVideoList;
+            
+    };
+
+#endif // CVCXMYVIDEOSALBUM_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosalbums.h	Thu Nov 04 11:16:56 2010 +0200
@@ -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 <mdequery.h>
+#include "vcxmyvideosmdsdb.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<TUint32>& 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<TUint32>& aAlbumIds );
+
+        /**
+         * Updates albums from MDS. This is called from MDS modify event.
+         * 
+         * @param aAlbumIds  Album IDs to update.
+         */
+        void UpdateAlbumsFromMdsL( RArray<TUint32>& 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<TVcxMyVideosAlbumVideo>& 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<TVcxMyVideosAlbumVideo>& 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<CMdEInstanceItem>& aItemArray );
+
+        /**
+         * From MVcxMyVideosMdsAlbumsObserver.
+         * Response to CVcxMyVideosMdsAlbums::RemoveRelationsL.
+         */
+        void HandleRemoveRelationsResp( RArray<TUint32>& aRelationIds,
+                RArray<TUint32>& aResults );
+
+        /**
+         * From MVcxMyVideosMdsAlbumsObserver.
+         * Response to CVcxMyVideosMdsAlbums::RemoveAlbumsL.
+         */
+        void HandleRemoveAlbumsResp( CMPXMedia* aCmd,
+                RArray<TUint32>& 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<TMdERelation>& 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<CMdEInstanceItem>& 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<CVcxMyVideosAlbum*> 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<TUint32> iMdsOpTargetIds;
+        
+        /**
+         * Stores album video data during relation deletion. This is to
+         * avoid second search when resp arrives.
+         */
+        RArray<TVcxMyVideosAlbumVideo> iRemoveFromAlbumVideos;
+        
+        /**
+         * Used in MDS operations to store operation results. Is in sync with iMdsOpTargetIds. 
+         */
+        RArray<TInt> iMdsOpResults;
+
+        /**
+         * Used in MDS operations to store operation results. Is in sync with iMdsOpTargetIds. 
+         */
+        RArray<TUint32> 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<TInt> iChangedAlbums;
+        
+    };
+
+#endif   // VCXMYVIDEOSALBUMS_H
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosasyncfilecopy.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,180 @@
+/*
+* 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:    Asynchronous file copy, implemented with several small sync block copies.*
+*/
+
+
+
+
+#ifndef VCXMYVIDEOSASYNCFILECOPY_H
+#define VCXMYVIDEOSASYNCFILECOPY_H
+
+// INCLUDES
+
+// FORWARD DECLARATIONS
+
+// CONSTANTS
+
+// CLASS DECLARATION
+
+/**
+* @lib mpxmyvideoscollectionplugin.lib
+*/
+NONSHARABLE_CLASS(CVcxMyVideosAsyncFileCopy) :
+    public CBase
+    {    
+    public: // Constructors and destructor
+
+        /**
+        * Two-phased constructor
+        * @return object constructed
+        */
+        static CVcxMyVideosAsyncFileCopy* NewL( RFs& aFs );
+
+        /**
+        * Destructor
+        */
+        virtual ~CVcxMyVideosAsyncFileCopy();
+
+    public:
+        /**
+        * Copies aSourceFileName to aSourceFileName. Leaves with KErrNotReady
+        * if there is already copy operation going on.
+        *
+        * @param aSourceFileName  Full path and name of the source file.
+        * @param aTargetFileName  Full path and name of the target file.
+        * @return                 ETrue if copy was finished. If EFalse, then
+        *                         user must do DoNextBlockCopyL calls to
+        *                         continue copying.
+        */
+        TBool CopyL( const TDesC& aSourceFileName, const TDesC& aTargetFileName );
+        
+        /**
+        * Checks if there is copy going on.
+        *
+        * @return ETrue if copy is going on, EFalse otherwise.
+        */
+        TBool CopyIsOngoing();
+        
+        /**
+        * Copies next block from the current copy operation.
+        *
+        * @return System wide error code.
+        */
+        TInt DoNextBlockCopy();
+
+        /**
+        * Cancels current copy operation (if any). Does nothing if copy
+        * operation is not going on. Cancel removes the possible target file
+        * which has been created during the current copy operation.
+        */
+        void Cancel();
+        
+    private:
+        /**
+        * Constructor
+        */
+        CVcxMyVideosAsyncFileCopy( RFs& aFs );
+
+        /**
+        * Symbian 2nd phase constructor.
+        */
+        void ConstructL ();
+        
+        /**
+        * Allocates buffer from RAM (iFileBlockBuffer) for a file block.
+        * 
+        * @param aFileSize  Size of the file to be copied.
+        */
+        void AllocateFileBlockBufferL( TInt aFileSize );
+        
+        /**
+        * Closes file handles and resets variables.
+        *
+        * @param aRemoveTargetFile If ETrue then the target file is removed.
+        */
+        void EndCopy( TBool aRemoveTargetFile );
+                
+    private:
+
+        /**
+        * File server session.
+        */
+        RFs& iFs;
+
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+        /**
+        * File in which we are copying from.
+        */ 
+        RFile64 iSourceFile;
+        
+        /**
+        * File which is being copied to.
+        */ 
+        RFile64 iTargetFile;
+
+        /**
+        * How much data is left for copying.
+        */
+        TInt64 iDataRemaining;
+        
+        /**
+        * Current read position in source file. 
+        */
+        TInt64 iReadPos;                      
+#else
+
+        /**
+        * File in which we are copying from.
+        */ 
+        RFile iSourceFile;
+        
+        /**
+        * File which is being copied to.
+        */ 
+        RFile iTargetFile;
+
+        /**
+        * How much data is left for copying.
+        */
+        TInt iDataRemaining;
+        
+        /**
+        * Current read position in source file. 
+        */
+        TInt iReadPos;                      
+
+#endif
+        /**
+        * Set to ETrue when copy starts and EFalse when copying ends.
+        */
+        TBool iIsCopying;
+        
+        /**
+        * Space for the one file block. Own
+        */
+        HBufC8* iFileBlockBuffer;
+
+#ifdef _DEBUG
+        /**
+        * Used to calculate copying speed.
+        */
+        TTime iStartTime;
+#endif        
+    };
+
+#endif   // VCXMYVIDEOSASYNCFILECOPY_H
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosasyncfileoperations.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,247 @@
+/*
+* 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 <mpxcollectionplugin.h>
+#include <mpxcollectionpath.h>
+#include <mpxcollectionmessagedefs.h>
+#include <vcxmyvideosdefs.h>
+
+// FORWARD DECLARATIONS
+class CVcxMyVideosCollectionPlugin;
+class CVcxMyVideosAsyncFileCopy;
+
+// 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<TUint32> iOperationIdArray;
+    
+        /**
+        * Array containing results for move/copy/delete operations. Array positions
+        * are in sync with iOperationIdArray.
+        */
+        RArray<TInt> 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;
+                                
+    };
+
+#endif   // VCXMYVIDEOSASYNCFILEOPERATIONS_H
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideoscategories.h	Thu Nov 04 11:16:56 2010 +0200
@@ -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 <vcxmyvideosdefs.h>
+
+// 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<TUint32>& 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<TUint32>& 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.
+        * @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<TInt>& aVideosIncrements, RArray<TInt>& aNewVideosIncrements,
+                TBool aForceUpdate );
+
+        /**
+        * 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<TUint32>& 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<TUint32>& 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<TUint32>& 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<TBool> iModifiedCategories;
+                                
+    };
+
+#endif   // VCXMYVIDEOSCATEGORIES_H
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideoscollection.hrh	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,37 @@
+/*
+* 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:    This file contains declarations for constants of My Videos*
+*/
+
+
+
+
+
+#ifndef VCXMYVIDEOSCOLLECTION_HRH
+#define VCXMYVIDEOSCOLLECTION_HRH
+
+#include <vcxmyvideosdefs.h>
+
+enum TVcxMyVideosCategory
+    {
+    EVcxMyVideosAllVideos = KVcxMvcCategoryIdAll,
+    EVcxMyVideosDownloads = KVcxMvcCategoryIdDownloads,
+    EVcxMyVideosTvRecordings = KVcxMvcCategoryIdTvRecordings,
+    EVcxMyVideosCapturedVideos = KVcxMvcCategoryIdCaptured,
+    EVcxMyVideosOther = KVcxMvcCategoryIdOther
+    };
+
+#endif      // VCXMYVIDEOSCOLLECTION_HRH
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideoscollectionplugin.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,394 @@
+/*
+* 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 of My Videos MPX Collection Plugin interface*
+*/
+
+
+
+#ifndef VCXMYVIDEOSCOLLECTIONPLUGIN_H
+#define VCXMYVIDEOSCOLLECTIONPLUGIN_H
+
+// INCLUDES
+
+#include <mpxcollectionplugin.h>
+#include <mpxcollectionpath.h>
+#include <mpxcollectionmessagedefs.h>
+#include <vcxmyvideosdefs.h>
+
+#include "vcxmyvideosactivetask.h"
+
+#include "vcxmyvideosmdsdb.h"
+
+// FORWARD DECLARATIONS
+class CVcxMyVideosMdsDb;
+class CMPXResource;
+class CMPXMediaArray;
+class CVcxMyVideosVideoCache;
+class CVcxMyVideosCategories;
+class CVcxMyVideosMessageList;
+class CVcxMyVideosAsyncFileOperations;
+class CVcxMyVideosOpenHandler;
+class CVcxMyVideosAlbums;
+
+// CONSTANTS
+
+// CLASS DECLARATION
+
+/**
+* Plug-in, provides access to My Videos collection.
+*
+* @lib mpxmyvideoscollectionplugin.lib
+*/
+NONSHARABLE_CLASS(CVcxMyVideosCollectionPlugin) :
+    public CMPXCollectionPlugin,
+    public MVcxMyVideosMdsDbObserver,
+    public MVcxMyVideosActiveTaskObserver
+    {    
+    public: // Constructors and destructor
+
+        friend class CVcxMyVideosOpenHandler;
+        friend class CVcxMyVideosVideoCache;
+        friend class CVcxMyVideosAlbums;
+        
+        /**
+        * Two-phased constructor
+        * @param aInitParams: initialization parameters
+        * @return object constructed
+        */
+        static CVcxMyVideosCollectionPlugin* NewL (TAny* aInitParams);
+
+        /**
+        * Destructor
+        */
+        virtual ~CVcxMyVideosCollectionPlugin();
+
+    public: // from base classes
+        /**
+        * From CMPXCollectionPlugin
+        * Navigates to the given path.  This method is serviced
+        * asynchronously and HandleOpenL is called upon completion
+        * @param aPath a path
+        * @param aAttrs attributes requested
+        * @param aFilter filter to apply or NULL if none
+        */
+        void OpenL(const CMPXCollectionPath& aPath,
+                   const TArray<TMPXAttribute>& aAttrs,
+                   CMPXFilter* aFilter);
+        
+        /**
+        * From CMPXCollectionPlugin
+        * Get the extended properties of the item referred to by the
+        * specified collection path.  This method is serviced asynchronously and
+        * HandleMediaL is called upon completion
+        * @param aPath a collection path referring to the item to retrieve the
+        *               extended properties for
+        * @param aAttr: array of attributes requested
+        * @param aCaps platsec capabilities of client requesting media; plug-in
+        *        should also verify its process capabilities (not yet supported)
+        * @aParam aSpecs specifications for attributes (not yet supported)
+        */
+        void MediaL(const CMPXCollectionPath& aPath,
+                    const TArray<TMPXAttribute>& aAttrs,
+                    const TArray<TCapability>& aCaps,
+                    CMPXAttributeSpecs* aSpecs);
+
+        /**
+        * From CMPXCollectionPlugin
+        * Cancel outstanding request.
+        */
+        void CancelRequest();
+
+        /**
+        * From CMPXCollectionPlugin
+        * Executes the given CMPXCommand command on the collection
+        * @param aCmd a command
+        */
+        void CommandL(CMPXCommand& aCmd);
+
+        /**
+        * From CMPXCollectionPlugin
+        *  Find the items matching the media specifications.  This method is serviced
+        *  asynchronously and HandleFindAllL is called upon completion
+        *  @param aCriteria Properties of the item that is to be found
+        *  @param aAttrs Requested attributes to return
+        */
+        void FindAllL(const CMPXMedia& aCriteria, const TArray<TMPXAttribute>& aAttrs);
+
+        /**
+        *  From CMPXCollectionPlugin
+        *  Find the items matching the media specifications
+        *  @param aCriteria Properties of the item that is to be found
+        *  @param aAttrs Requested attributes to return
+        *  @return results of the search. Method abandons ownership of results.
+        */
+        CMPXMedia* FindAllSyncL(const CMPXMedia& aCriteria,
+                                const TArray<TMPXAttribute>& aAttrs);
+
+        /**
+        * Get the list of supported capabilities
+        * @return TCollectionCapability, bitmask of supported capabilities
+        */
+        TCollectionCapability GetCapabilities();
+
+        /**
+        * DEPRECATED
+        * From CMPXCollectionPlugin
+        * Executes the given TMPXCollectionCommand command on the collection
+        * @param aCmd a command
+        * @param aArg an argument
+        */
+        void CommandL(TMPXCollectionCommand /*aCmd*/, TInt /*aArg = 0*/) {}
+
+        /**
+        * DEPRECATED
+        * From CMPXCollectionPlugin
+        * Adds an episode to the collection
+        * @param aMedia Properties of the item
+        */
+        void AddL(const CMPXMedia& /*aMedia*/) {}
+
+        /**
+        * DEPRECATED
+        * From CMPXCollectionPlugin
+        * Remove an item(s) from the collection database using the given path
+        * Note that the selection indices are hidden within the path
+        * @param aPath: path to the item to be removed
+        *
+        */
+        void RemoveL(const CMPXCollectionPath& /*aPath*/) {}
+
+        /**
+        *  DEPRECATED
+        *  Remove item(s) from the collection database using the given media properties
+        *  @param aMedia Properties of the item(s) to be removed. May cantain a URI
+        *                 or metadata. All item(s) matching the specified properties
+        *                 will be removed.
+        */
+        void RemoveL(const CMPXMedia& /*aMedia*/) {}
+
+        /**
+        *  DEPRECATED
+        *  Sets/updates the specified media for an item in the collection.  Media
+        *  is identified by specifying an ID or URI.
+        *  @param aMedia: new property values for the item
+        */
+        void SetL(const CMPXMedia& /*aMedia*/) {}
+
+        /**
+        * From MMPXDbActiveTaskObserver
+        */
+        MVcxMyVideosActiveTaskObserver::TStepResult HandleStepL();
+
+        /**
+        * From MMPXDbActiveTaskObserver
+        */
+        void HandleOperationCompleted( TInt aErr );
+
+        /**
+        * From MVcxMyVideosMdsDbObserver.
+        */
+        void HandleMyVideosDbEvent( TMPXChangeEventType aEvent,
+                RArray<TUint32>& aId, TInt aEventsLeft );
+
+        /**
+        * Leaving version of HandleMyVideosDbEvent.
+        */
+        void DoHandleMyVideosDbEventL( TMPXChangeEventType aEvent,
+                RArray<TUint32>& aId, TInt aEventsLeft );
+                
+        /**
+        * From MVcxMyVideosMdsDbObserver.
+        * Handler function for 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.
+        * @param aComplete            ETrue if list is complete and no more items are expected,
+        *                             EFalse if there are more to come.
+        */
+        void HandleCreateVideoListResp( CMPXMedia* aVideoList, TInt aNewItemsStartIndex,
+                TBool aComplete );
+
+        /**
+        * From MVcxMyVideosMdsDbObserver. Called when media is removed or inserted.
+        */
+        void HandleObjectPresentNotification();
+        
+        /**
+        * Leaving version of HandleObjectPresentNotification.
+        */
+        void DoHandleObjectPresentNotificationL();
+                 
+    private:
+        /**
+        * Constructor
+        */
+        CVcxMyVideosCollectionPlugin();
+
+        /**
+        * Symbian 2nd phase constructor.
+        */
+        void ConstructL ();
+                        
+        /**
+        * Copies KVcxMediaMyVideosTransactionId field from aRequest to aResp.
+        */
+        void SetTransactionIdL( CMPXMedia& aRequest, CMPXMedia& aResp );
+               
+        /**
+        * 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 );
+ 
+        /**
+        * Returns reference to iAsyncFileOperations member.
+        *
+        * @return reference to iAsyncFileOperations.
+        */        
+        CVcxMyVideosAsyncFileOperations& AsyncFileOperationsL();
+        
+        /**
+        * Called by iCache when it notices that current video list fetching has to
+        * be done again from the scratch. This is called only when there is video list
+        * fetching ongoing.
+        */
+        void RestartVideoListFetchingL();
+        
+    public:
+
+        /**
+        * Adds video to MDS and cache.
+        *
+        * @param aVideo video to add, KMPXMediaGeneralId will be set to new value.
+        */
+        void AddVideoToMdsAndCacheL( CMPXMedia& aVideo );
+
+        /**
+        * Sets video parameters in iCache and MDS from aVideo.
+        *
+        * @param aVideo  Media used to copy parameters from.
+        */
+        void SetVideoL( CMPXMedia& aVideo );
+
+        /**
+        * Sends My Videos message to clients. Transaction ID is copied from
+        * aCommand if it is available.
+        *
+        * @param aMessageId Message id.
+        * @param aCommand   Command which has caused the message, optional.
+        *                   Ownership does not move.
+        */
+        void SendMyVideosMessageL( TUint32 aMessageId, CMPXCommand* aCommand = NULL );
+
+        /**
+        * Sends messages to clients. If udeb version, adds messageid
+        * parameter to the message for debugging purposes. May or may not
+        * contain media list as parameter.
+        *
+        * @param aMessages  Messages to send.
+        */
+        void SendMessages( CMPXMessage& aMessages );
+
+        /**
+        * Creates iCategories if its not created yet and returns reference to it.
+        *
+        * @return Reference to iCategories member.
+        */
+        CVcxMyVideosCategories& CategoriesL();
+
+        /**
+        * Creates iAlbums if its not created yet and returns reference to it.
+        *
+        * @return Reference to iAlbums member.
+        */
+        CVcxMyVideosAlbums& AlbumsL();
+
+        /**
+        * Notifies to mediator listeners that count of new videos has decreased.
+        * 
+        * @param aVideo Removed or watched video.  
+        */
+        void NotifyNewVideosCountDecreasedL( CMPXMedia& aVideo );
+        
+    public:
+        /**
+        * MDS database handler, own.
+        */
+        CVcxMyVideosMdsDb* iMyVideosMdsDb;
+
+        /**
+        * MDS items are cached here for fast access.
+        * Own.
+        */
+        CVcxMyVideosVideoCache* iCache;
+
+        /**
+        * Messages are grouped here for sending.
+        */        
+        CVcxMyVideosMessageList* iMessageList;
+
+        /**
+        * File server session.
+        */
+        RFs iFs;
+
+        /**
+        * Executes command in several small steps.
+        */
+        CVcxMyVideosActiveTask* iActiveTask;
+                        
+    private:
+
+        /**
+        * Contains category list, accessed through CategoriesL() function.
+        * Own.
+        */
+        CVcxMyVideosCategories* iCategories;
+        
+        /**
+        * Albums related functionality (except mds db operations). Own.
+        */
+        CVcxMyVideosAlbums* iAlbums;
+
+        /**
+        * Target drive for Move operation.
+        */
+        TInt iTargetDrive;
+        
+        /**
+        * Performs multiple Move,Copy and Delete operations step by step. Own.
+        */
+        CVcxMyVideosAsyncFileOperations* iAsyncFileOperations;
+        
+        /**
+        * Contains collection Open operation related functionality.
+        */
+        CVcxMyVideosOpenHandler* iOpenHandler;
+        
+        /**
+        * Used for clearing orphan downloads only once.
+        */
+        TBool iOrphanDownloadsCleared;
+
+    };
+
+#endif   // VCXMYVIDEOSCOLLECTIONPLUGIN_H
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideoscollectionutil.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,311 @@
+/*
+* 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 <vcxmyvideosdefs.h>
+
+// 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<TUint32>& 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<CMPXMedia*>& aFromArray,
+                CMPXMedia& aToList,
+                RArray<TUint32>& 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<TMPXAttribute>& 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<TUint32>& 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
+    };
+#endif   // VCXMYVIDEOSCOLLECTIONUTIL_H
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosdriveinfo.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,98 @@
+/*
+* 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:    header file for TVcxMyVideosDriveInfo class*
+*/
+
+
+
+
+
+#ifndef VCXMYVIDEOSDRIVEINFO_H
+#define VCXMYVIDEOSDRIVEINFO_H
+
+//  INCLUDES
+#include <e32base.h>
+
+const TInt KVcxMyVideosDriveNameMaxLength = 256;
+
+// CLASS DECLARATION
+/**
+* Container class for storing drive info relevant for MPX My Videos Collection.
+*/
+NONSHARABLE_CLASS(TVcxMyVideosDriveInfo)
+    {
+    public:
+
+        /*
+        * Attribute flags used in iFlags member.
+        */
+        enum TDriveAttributes
+            {
+            /**
+            * Media can be removed from the drive, (E or F, depending on hw configuration).
+            * If not set (= 0) then the drive is fixed.
+            */
+            ERemovable = 1 << 0,
+
+            /**
+            * Default mass storage drive.
+            */
+            EMassStorage = 1 << 1,
+            
+            /**
+            * Media is locked.
+            */
+            ELocked = 1 << 2,
+            
+            /**
+            * Media is removed from the drive.
+            */
+            EMediaNotPresent = 1 << 3            
+            };
+            
+        /**
+        * Constructor, clears member variables to zero.
+        */
+        TVcxMyVideosDriveInfo();
+            
+    public:
+    
+        /**
+        * Drive ID number, 0 points to A:, 1 to B:, 2 to C: and so on.
+        */
+        TInt iDrive;
+
+        /**
+        * Drive char.
+        */
+        TChar iDriveChar;
+        
+        /**
+        * Drive type, same as TDriveInfo::iType.
+        */
+        TInt iType;
+
+        /**
+        * Properties of the drive, see TDriveAttributes -enum for flag values.
+        */
+        TUint32 iFlags;
+        
+        /**
+        * Volume name. Removable drive can contain different volumes (mmc cards). This name
+        * refers to removable item (card label), not the drive. 
+        */
+        TBuf<KVcxMyVideosDriveNameMaxLength> iVolumeName;
+    };
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosdrivemonitor.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,259 @@
+/*
+* 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:    Helper class for drive operations/monitoring.*
+*/
+
+
+
+
+
+#ifndef VCXMYVIDEOSDRIVEMONITOR_H
+#define VCXMYVIDEOSDRIVEMONITOR_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <f32file.h>
+#include "vcxmyvideosdriveinfo.h"
+#include "vcxmyvideosdrivemonitorevent.h"
+
+// CLASS DECLARATION
+
+/**
+* Observer for CVcxMyVideosDriveMonitor class.
+*/
+NONSHARABLE_CLASS(MVcxMyVideosDriveMonitorObserver)
+    {
+        
+    public:
+        /**
+        * Handles drive monitor event.
+        *
+        * @param aEvent Event.
+        */
+        virtual void HandleDriveMonitorEvent( TVcxMyVideosDriveMonitorEvent& aEvent ) = 0;
+    };
+
+/**
+ * Helper class for drive operations/monitoring.
+ * User can get available drives (through iAvailableDrives public member)
+ * and be notified when drives change (through MIptvDriveMonitorObserver interface).
+ */
+NONSHARABLE_CLASS(CVcxMyVideosDriveMonitor) : public CActive
+    {                
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        */
+        static CVcxMyVideosDriveMonitor* NewL();
+
+        /**
+        * Two-phased constructor. Use this is owner object already has a file session open.
+        *
+        * @param aFileSession file session.
+        */
+        static CVcxMyVideosDriveMonitor* NewL( const RFs& aFileSession );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CVcxMyVideosDriveMonitor();
+        
+    public:
+
+        /**
+        * Updates iAvailableDrives member variable from File server.
+        * This is called in ConstructL() also.
+        */ 
+        void RefreshAvailableDrivesL();
+
+        /**
+        * Returns the position index of aDrive in iAvailableDrives.
+        *
+        * @param aDrive drive to search.
+        * @return Position index of aDrive in iAvailableDrives. If not found,
+        *         KErrNotFound is returned.
+        */        
+        TInt ArrayPos( TInt aDrive );
+
+        /**
+        * Returns the position index of aDrive in iAvailableDrives. If not
+        * found, leaves with KErrNotFound code.
+        *
+        * @param aDrive drive to search.
+        * @return Position index of aDrive in iAvailableDrives.
+        */        
+        TInt ArrayPosL( TInt aDrive );
+
+        /**
+        * Returns the first removable drive (= memory card drive) from iAvailableDrives
+        * array. Leaves with KErrNotFound if not found.
+        */        
+        TInt MemoryCardDriveL();
+
+        /**
+        * Returns the first removable drive (= memory card drive) from iAvailableDrives
+        * array. Returns KErrNotFound if not found.
+        *
+        * @return drive number, or KErrNotFound if not found.
+        */        
+        TInt MemoryCardDrive();
+
+        /**
+        * Returns the first mass storage drive from iAvailableDrives array.
+        * Mass storege drive means the drive which is preferred for storing large
+        * files in the device, the drive itself can be anything, usually not c though.
+        * Leaves with KErrNotFound if not found.
+        *
+        * @return Drive number.
+        */
+        TInt MassStorageDriveL();
+
+        /**
+        * Returns the first mass storage drive from iAvailableDrives array.
+        * Mass storege drive means the drive which is preferred for storing large
+        * files in the device, the drive itself can be anything except c-drive.
+        * Returns KErrNotFound if not found.
+        *
+        * @return Drive number, or KErrNotFound if not found.
+        */
+        TInt MassStorageDrive();
+        
+        /**
+        * Gets the used memory from cenrep. If cenrep contains invalid drive or value is not found,
+        * chooses the preferred drive in the following order: 1. mass storage 2. memory card
+        * 3. EDriveC. If cenrep value was not usable, the chosen drive is written to cenrep.
+        * Leaves with system-wide error code if wasn't able to get the used memory.
+        * The returned memory might be locked or not present. Use GetUsedMemoryL to get drive
+        * which is available for usage.
+        *
+        * @param aPreferredMemory The used memory drive is written here.
+        */        
+        void GetPreferredMemoryL( TInt& aPreferredMemory );
+
+        /**
+        * Gets a memory for usage. Tries first the preferred memory, if it is not
+        * available (locked or not present), tries the next drive from iAvailable drives.
+        * if suitable drive is not found, returns system drive (c-drive).
+        *
+        * @param aUsedMemory  Drive which should be used is written here.
+        */
+        void GetUsedMemoryL( TInt& aUsedMemory );
+
+
+    protected: // Functions from base classes
+
+        /**
+        * From CActive, RunL.
+        * Called when operation completes.
+        */
+        void RunL();
+
+        /**
+        * From CActive, cancels request.
+        */
+        void DoCancel();
+
+        /**
+        * From CActive, handles leaves from RunL.
+        */
+        TInt RunError( TInt aError );
+         
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CVcxMyVideosDriveMonitor();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        *
+        * @param aFileSession
+        */
+        void ConstructL( const RFs& aFileSession );
+
+        /**
+        * Sends event to observers.
+        *
+        * @param aEvent event to send.
+        * @param aDrive drive which caused the event.
+        */
+        void SendEvent( TVcxMyVideosDriveMonitorEvent::TEvent aEvent, TInt aDrive );
+
+        /**
+        * Compares iPreviousAvailableDrives and iAvailableDrives arrays and
+        * sends appropriate events if they differ.
+        */
+        void CompareOldAndNewAvailableDrives();
+        
+        /**
+        * Returns drive type as a descriptor. For debugging only.
+        * @param aType Drive type, see valid values from e32const.h TMediaType enum.
+        */
+        const TDesC& DriveTypeDes( TInt aType );
+
+        /**
+        * Prints available drives. For debugging only.
+        */
+        void PrintAvailableDrives();
+
+    public:
+    
+        /**
+        * Array of currently available drives. These are updated
+        * with RefreshAvailableDrivesL -method or from file
+        * server event. RefreshAvailableDrivesL is also called upon creation
+        * of this object.
+        * iAvailableDrives array contains drives which are available for mass
+        * storaging videos. If there is hard disk and memory card
+        * available(both e and f-drives), then c-drive is excluded from the array.
+        * Array contains also drives which don't have media present (mmc), or which
+        * are locked.
+        */
+        RArray<TVcxMyVideosDriveInfo> iAvailableDrives;
+
+        
+    private:
+
+        /**
+        * Used to detect if refresh had any effect.
+        */
+        RArray<TVcxMyVideosDriveInfo> iPreviousAvailableDrives;
+
+        /**
+        * Array of observers. Pointers not owned.
+        */
+        RArray<MVcxMyVideosDriveMonitorObserver*> iObservers;
+        
+        /**
+        * Session to file server.
+        */
+        RFs iFs;
+        
+        /**
+        * ETrue if iFs is provided by the user of this class.
+        */
+        TBool iIfsIsProvidedByUser;
+
+    };
+
+#endif      // VCXMYVIDEOSDRIVEMONITOR_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosdrivemonitorevent.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,113 @@
+/*
+* 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:    Drive monitor event object*
+*/
+
+
+
+
+
+#ifndef VCXMYVIDEOSDRIVEMONITOREVENT_H
+#define VCXMYVIDEOSDRIVEMONITOREVENT_H
+
+//  INCLUDES
+#include <e32base.h>
+
+// CLASS DECLARATION
+
+/**
+*  Used for sending events from CVcxMyVideosDriveMonitor to client.
+*/
+NONSHARABLE_CLASS(TVcxMyVideosDriveMonitorEvent)
+    {
+    public:
+    
+        /**
+        * Events, used in iEvent member variable.
+        */
+        enum TEvent
+            {
+            /**
+            * Value used at construction.
+            */                
+            ENone,
+            
+            /**
+            * Media was removed (typically memory card).
+            */                
+            EMediaRemoved,
+
+            /**
+            * Media was inserted (typically memory card).
+            */
+            EMediaInserted,
+            
+            /**
+            * Drive was locked.
+            */
+            EDriveLocked,
+            
+            /**
+            * Drive was unlocked.
+            */
+            EDriveUnlocked,
+
+            /**
+            * Drive was mounted.
+            */            
+            EDriveMounted,
+
+            /**
+            * Drive was dismounted.
+            */            
+            EDriveDismounted,
+                        
+            /**
+            * Drive volume name was changed.
+            */
+            EDriveVolumeNameChanged
+            };
+            
+    public:  // Constructors and destructor
+        
+        /**
+        * C++ default constructor.
+        */
+        TVcxMyVideosDriveMonitorEvent();
+
+        /**
+        * Returns event as a descriptor. Used for debugging purposes.
+        *
+        * @param aEvent Event as enum.
+        * @return       Event as a descriptor.
+        */
+        static const TDesC& EventDes( TEvent aEvent );
+
+    public:
+    
+        /**
+        * Identifies the event, see TEvent for values.
+        */
+        TInt  iEvent;
+        
+        /**
+        * The drive which caused the event (a = 0, b = 1, ... etc).
+        */
+        TInt iDrive;
+
+    };
+
+#endif      // VCXMYVIDEOSDRIVEMONITOREVENT_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosmdsalbums.h	Thu Nov 04 11:16:56 2010 +0200
@@ -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 <mdequery.h>
+#include <mpxmedia.h>
+#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<TVcxMyVideosAlbumVideo>& 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<TUint32>& aRelationIds,
+                RArray<TUint32>& 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<TVcxMyVideosAlbumVideo>& 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<TUint32>& aRelationIds,
+                RArray<TUint32>& 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  <code>KErrNone</code>, 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  <code>KErrNone</code>, 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  <code>KErrNone</code>, 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  <code>KErrNone</code>, 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<TMdERelation>& aRelationArray);
+
+        /**
+         * From MMdERelationObserver
+         */
+        void HandleRelationNotification(CMdESession& aSession, 
+                TObserverNotificationType aType,
+                const RArray<TItemId>& 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<TVcxMyVideosAlbumVideo>* iAlbumContent;
+
+        /**
+         * The pending async operation ID is stored here.
+         */
+        TVcxAsyncOperation iAsyncOperation;
+
+        /**
+         * Used for storing items during async mds operations.
+         */
+        RPointerArray<CMdEInstanceItem> 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<TInt>* iResultArray;
+
+        /**
+         * Used in async operations to store
+         * pointer to result array (which is owned by the user). 
+         */
+        RArray<TUint32>* iResultArrayUint32;
+        
+        /**
+         * Used in async oprations (EVcxAddVideosToAlbum and EVcxRemoveVideosFromAlbum) to store
+         * pointer to item ID array (which is owned by the user). 
+         */
+        RArray<TUint32>* 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
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosmdscmdqueue.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,330 @@
+/*
+* 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:   Queues commands to MDS.
+*/
+
+
+
+#ifndef VCXMYVIDEOSMDSCMDQUEUE_H
+#define VCXMYVIDEOSMDSCMDQUEUE_H
+
+// INCLUDES
+#include <vcxmyvideosdefs.h>
+#include "vcxmyvideosalbum.h"
+#include "vcxmyvideosmdsdb.h"
+
+// FORWARD DECLARATIONS
+class CMPXMedia;
+
+// CONSTANTS
+
+// CLASS DECLARATION
+
+/**
+* All MDS commands inherit this.
+*
+* @lib mpxmyvideoscollectionplugin.lib
+*/
+NONSHARABLE_CLASS(CVcxMyVideosMdsCmd) : public CBase
+    {    
+    public:
+
+        /**
+        * Destructor
+        */
+        virtual ~CVcxMyVideosMdsCmd() {}
+        
+        /**
+        * Command type. Used for casting the pointer to correct type.
+        */
+        CVcxMyVideosMdsDb::TRequestType iCmdType;
+        
+        /**
+         * Pointer to client is stored here, used for performing response call.
+         */
+        MVcxMyVideosMdsAlbumsObserver* iClient;    
+    };
+
+/**
+* Class which encapsulates GetVideoListL function parameters.
+*
+* @lib mpxmyvideoscollectionplugin.lib
+*/
+NONSHARABLE_CLASS(CVcxMyVideosMdsCmdGetVideoList) : public CVcxMyVideosMdsCmd
+    {    
+    public:
+
+        /**
+        * Constructor
+        */
+        CVcxMyVideosMdsCmdGetVideoList() {}
+
+        /**
+        * Destructor
+        */
+        virtual ~CVcxMyVideosMdsCmdGetVideoList() {}
+
+    public:
+        /**
+        * Stored CreateVideoListL function parameters, see meanings from vcxmyvideosmdsdb.h file.
+        */
+        TVcxMyVideosSortingOrder iSortingOrder;
+        TBool                    iAscending;
+        TBool                    iFullDetails;
+        CMPXMedia**              iVideoList;
+    };
+
+/**
+* Class which stores GetAlbumsL function arguments.
+*
+* @lib mpxmyvideoscollectionplugin.lib
+*/
+NONSHARABLE_CLASS(CVcxMyVideosMdsCmdGetAlbums) : public CVcxMyVideosMdsCmd
+    {    
+    public: // Constructors and destructor
+
+        /**
+        * Constructor
+        */
+        CVcxMyVideosMdsCmdGetAlbums() {}
+
+        /**
+        * Destructor
+        */
+        virtual ~CVcxMyVideosMdsCmdGetAlbums() {}
+
+    public:
+        /**
+        * Stored GetAlbumsL function parameters, see meanings from vcxmyvideosmdsalbums.h file.
+        */
+        CMPXMedia* iAlbumList;
+    };
+
+/**
+* Class which stores GetAlbumContentIdsL function arguments.
+*
+* @lib mpxmyvideoscollectionplugin.lib
+*/
+NONSHARABLE_CLASS(CVcxMyVideosMdsCmdGetAlbumContentIds) : public CVcxMyVideosMdsCmd
+    {    
+    public: // Constructors and destructor
+
+        /**
+        * Constructor
+        */
+        CVcxMyVideosMdsCmdGetAlbumContentIds() {}
+
+        /**
+        * Destructor
+        */
+        virtual ~CVcxMyVideosMdsCmdGetAlbumContentIds() {}
+
+    public:
+        /**
+        * Stored GetAlbumContentL function parameters, see meanings from vcxmyvideosmdsalbums.h file.
+        */
+        TUint32                         iAlbumId;        
+        RArray<TVcxMyVideosAlbumVideo>* iAlbumContent; //not own
+    };
+
+/**
+* Class which stores GetAlbumContentVideosL function arguments.
+*
+* @lib mpxmyvideoscollectionplugin.lib
+*/
+NONSHARABLE_CLASS(CVcxMyVideosMdsCmdGetAlbumContentVideos) : public CVcxMyVideosMdsCmd
+    {    
+    public: // Constructors and destructor
+
+        /**
+        * Constructor
+        */
+        CVcxMyVideosMdsCmdGetAlbumContentVideos() {}
+
+        /**
+        * Destructor
+        */
+        virtual ~CVcxMyVideosMdsCmdGetAlbumContentVideos() {}
+
+    public:
+        /**
+        * Stored GetAlbumContentL function parameters, see meanings from vcxmyvideosmdsalbums.h file.
+        */
+        TUint32    iAlbumId;        
+        CMPXMedia* iAlbumContentVideos; //not own
+    };
+
+/**
+* Class which stores AddVideosToAlbumL function arguments.
+*
+* @lib mpxmyvideoscollectionplugin.lib
+*/
+NONSHARABLE_CLASS(CVcxMyVideosMdsCmdAddVideosToAlbum) : public CVcxMyVideosMdsCmd
+    {    
+    public: // Constructors and destructor
+
+        /**
+        * Constructor
+        */
+        CVcxMyVideosMdsCmdAddVideosToAlbum() {}
+
+        /**
+        * Destructor
+        */
+        virtual ~CVcxMyVideosMdsCmdAddVideosToAlbum() {}
+
+    public:
+        /**
+        * Stored AddVideosToAlbumL function parameters, see meanings from vcxmyvideosdefs.h
+        * KVcxCommandMyVideosAddToAlbum command descriptions.
+        */
+        CMPXMedia* iMpxCmd;
+    };
+
+/**
+* Class which stores RemoveRelationsL function arguments.
+*
+* @lib mpxmyvideoscollectionplugin.lib
+*/
+NONSHARABLE_CLASS(CVcxMyVideosMdsCmdRemoveRelations) : public CVcxMyVideosMdsCmd
+    {    
+    public: // Constructors and destructor
+
+        /**
+        * Constructor
+        */
+        CVcxMyVideosMdsCmdRemoveRelations() {}
+
+        /**
+        * Destructor
+        */
+        virtual ~CVcxMyVideosMdsCmdRemoveRelations() {}
+
+    public:
+        /**
+        * Stored RemoveRelationsL function parameters, see meanings from vcxmyvideosmdsalbums.h file.
+        */
+        RArray<TUint32>* iRelationIds; //not own
+        RArray<TUint32>* iResults;  //not own
+    };
+
+/**
+* Class which stores RemoveAlbumsL function arguments.
+*
+* @lib mpxmyvideoscollectionplugin.lib
+*/
+NONSHARABLE_CLASS(CVcxMyVideosMdsCmdRemoveAlbums) : public CVcxMyVideosMdsCmd
+    {    
+    public: // Constructors and destructor
+
+        /**
+        * Constructor
+        */
+        CVcxMyVideosMdsCmdRemoveAlbums() {}
+
+        /**
+        * Destructor
+        */
+        virtual ~CVcxMyVideosMdsCmdRemoveAlbums() {}
+
+    public:
+        /**
+        * Stored RemoveAlbumsL function parameters, see meanings from vcxmyvideosmdsalbums.h file.
+        */
+        CMPXMedia* iMpxCmd; //not own
+    };
+
+/**
+* Queues MDS commands.
+*
+* @lib mpxmyvideoscollectionplugin.lib
+*/
+NONSHARABLE_CLASS(CVcxMyVideosMdsCmdQueue) : public CBase
+    {    
+    public: // Constructors and destructor
+
+        /**
+        * Two-phased constructor
+        * @return object constructed
+        */
+        static CVcxMyVideosMdsCmdQueue* NewL( CVcxMyVideosMdsDb& aMdsDb );
+
+        /**
+        * Destructor
+        */
+        virtual ~CVcxMyVideosMdsCmdQueue();
+
+    public: // new methods
+        
+        /**
+        * Executes command if queue is empty, otherwise adds it to queue.
+        * Ownership of aCmd moves to this object.
+        *
+        * @param aCmd  Command to execute.
+        */
+        void ExecuteCmdL( CVcxMyVideosMdsCmd* aCmd );
+        
+        /**
+        * Called when command finishes. Executes next command from the queue.
+        */
+        void CmdFinished();
+        
+        /**
+         * Removes commands from command queue.
+         * 
+         * @param aType Defines what kind of commands are removed from the command queue.
+         */
+        void Cancel( CVcxMyVideosMdsDb::TRequestType aType = CVcxMyVideosMdsDb::EAll );
+                        
+    private:
+
+        /**
+        * Constructor
+        */
+        CVcxMyVideosMdsCmdQueue( CVcxMyVideosMdsDb& aMdsDb );
+
+        /**
+        * Symbian 2nd phase constructor.
+        */
+        void ConstructL();
+        
+        /**
+        * Executes the command.
+        *
+        * @param aCmd  Command to execute, ownership does not move.
+        */
+        void DoExecuteCmdL( CVcxMyVideosMdsCmd* aCmd );
+                    
+    private:
+        
+        /**
+        * Owner of this object.
+        */
+        CVcxMyVideosMdsDb& iMdsDb;
+        
+        /**
+        * Command queue. Own.
+        */
+        RArray<CVcxMyVideosMdsCmd*> iQueue;
+        
+        /**
+        * Set to ETrue when command is started and to EFalse
+        * when command finishes.
+        */
+        TBool iCmdInProgress;
+    };
+
+#endif   // VCXMYVIDEOSMDSCMDQUEUE_H
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosmdsdb.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,801 @@
+/*
+* 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 <mdesession.h>
+#include <mdequery.h>
+#include <harvesterclient.h>
+#include <mpxcollectionmessagedefs.h>
+#include <vcxmyvideosdefs.h>
+#include <e32property.h>
+#include "vcxmyvideosalbum.h"
+
+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<TUint32>& 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<TVcxMyVideosAlbumVideo>& 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<CMdEInstanceItem>& 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<TUint32>& aRelationIds,
+                RArray<TUint32>& 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<TUint32>& 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<TMdERelation>& 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<TUint32>& 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    <code>KErrNone</code>, 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  <code>KErrNone</code>, 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<TItemId>& aObjectIdArray);
+
+// from MMdEObjectPresentObserver
+    void HandleObjectPresentNotification(CMdESession& aSession, 
+			TBool aPresent, const RArray<TItemId>& 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<TItemId>& 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<TEvent> iEvents;
+    };
+
+#endif // VCXMYVIDEOSMDSDB_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosmessagelist.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,149 @@
+/*
+* 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 <mpxcollectionmessagedefs.h>
+#include <vcxmyvideosdefs.h>
+
+// 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;
+    };
+
+#endif   // VCXMYVIDEOSMESSAGELIST_H
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosopenhandler.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,208 @@
+/*
+* 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.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<TVcxMyVideosAlbumVideo>& /*aContentArray*/ ) {}
+
+    /**
+     * From MVcxMyVideosMdsAlbumsObserver, no implementation.
+     */
+    void HandleAddVideosToAlbumResp( CMPXMedia* /*aCmd*/,
+            RPointerArray<CMdEInstanceItem>& /*aItemArray*/ ) {}
+
+    /**
+     * From MVcxMyVideosMdsAlbumsObserver, no implementation.
+     */
+    void HandleRemoveRelationsResp( RArray<TUint32>& /*aRelationIds*/,
+            RArray<TUint32>& /*aResults*/ ) {}
+
+    /**
+     * From MVcxMyVideosMdsAlbumsObserver, no implementation.
+     */
+    void HandleRemoveAlbumsResp( CMPXMedia* /*aCmd*/,
+            RArray<TUint32>& /*aResultIds*/ ) {}
+
+    /**
+     * From MVcxMyVideosMdsAlbumsObserver, no implementation.
+     */
+    void HandleRelationEvent( TObserverNotificationType /*aType*/,
+            const RArray<TMdERelation>& /*aRelationArray*/ ) {}
+    
+    /**
+     * Called as a response to GetAlbumContentVideosL.
+     * 
+     * @param aAlbumId           ID of the album containing the result videos.
+     * @param aVideoList         Media containing array of videos.
+     * @param aError             Error code in case of failure.
+     * @param aFirstNewItemIndex Index of the first new item.
+     * @param aNewItemCount      How many new items in the query since the last results.
+     * @param aComplete          ETrue if query is complete, EFalse if there is more to come.
+     */
+    void HandleGetAlbumContentVideosResp( TUint32 aAlbumId, CMPXMedia& aVideoList,
+            TInt aError, TInt aFirstNewItemIndex, TInt aNewItemCount, TBool aComplete );
+
+
+    void DoHandleCreateVideoListRespL(
+            CMPXMedia* aVideoList, TInt aNewItemsStartIndex, TBool aComplete );
+
+private:
+    /**
+    * 2nd-phase Constructor
+    */
+    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<TInt> iCategoryIdsBeingOpened;
+    
+    /**
+    * Video lists for categories being opened are stored here.
+    * This is in sync with iCategoryIdsBeingOpened.
+    */
+    RArray<CMPXMedia*> iVideoListsBeingOpened;
+
+    /**
+    * The album IDs being opened are stored here. These values are used
+    * to filter list when items arrive from MDS.
+    * This is in sync with iAlbumVideoListsBeingOpened.
+    */
+    RArray<TInt> iAlbumIdsBeingOpened;
+
+    /**
+    * Video lists for albums being opened are stored here.
+    * This is in sync with iAlbumIdsBeingOpened.
+    */
+    RArray<CMPXMedia*> iAlbumVideoListsBeingOpened;
+    
+    /**
+     * Path being opened is stored here for the HandleOpenL call.
+     * Not Own.
+     */
+    const CMPXCollectionPath* iPath;
+    
+    };
+
+#endif // VCXMYVIDEOSACTIVETASK_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosvideocache.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,525 @@
+/*
+* 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<TVcxMyVideosVideo>& VideoArray();
+#endif
+    
+private:
+    /**
+    * Constructor
+    */
+    CVcxMyVideosVideoListIndex();
+    
+    /**
+    * Symbian 2nd phase constructor.
+    */
+    void ConstructL ();
+
+    /**
+     * Sorts iVideoArray by MDS ID.
+     */
+    void Sort();
+    
+    /**
+     * Used for keeping RArray<TVcxMyVideosVideo> 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<TVcxMyVideosVideo> 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<TUint32>& 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<TUint32>& 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<TUint32>& aMdsIds, TBool& aListFetchingWasCanceled,
+                RArray<TUint32>* 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<CMPXMedia*> 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;
+
+    };
+
+#endif   // VCXMYVIDEOSVIDEOCACHE_H
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/rom/mpxmyvideoscollection.iby	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2006-2009 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:      Image description file for mpxmyvideoscollection .*
+*/
+
+
+
+
+#ifndef __MPXMYVIDEOSCOLLECTION_IBY__
+#define __MPXMYVIDEOSCOLLECTION_IBY__
+
+#include <data_caging_paths_for_iby.hrh>
+
+ECOM_PLUGIN(vcxmyvideoscollectionplugin.DLL, vcxmyvideoscollectionplugin.RSC)
+
+#endif // __MPXMYVIDEOSCOLLECTION_IBY__
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosactivetask.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,228 @@
+/*
+* 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 <e32base.h>
+#include <mpxlog.h>
+#include "vcxmyvideosactivetask.h"
+
+// ============================ MEMBER FUNCTIONS =============================
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CVcxMyVideosActiveTask::CVcxMyVideosActiveTask( MVcxMyVideosActiveTaskObserver& aObserver ) :
+    CActive( CActive::EPriorityStandard ),
+    iObserver( aObserver )
+    {
+    CActiveScheduler::Add( this );
+    }
+
+// ---------------------------------------------------------------------------
+// 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 )
+    {
+    delete iCurCommand;
+    iCurCommand = NULL;
+    iCurCommand = CMPXMedia::NewL( aCommand );
+    iCurTask = aTask;
+    iCurStep = 0;
+
+    // Start the AO
+    iStatus = KRequestPending;
+    MPX_DEBUG1("CVcxMyVideosActiveTask::StartL SetActive");
+    SetActive();
+    TRequestStatus* status = &iStatus;
+    User::RequestComplete( status, KErrNone );
+    }
+
+// ---------------------------------------------------------------------------
+// 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()
+    {
+    MPX_DEBUG1("CVcxMyVideosActiveTask::RunL() start");
+
+    switch ( iObserver.HandleStepL() )
+        {
+        case MVcxMyVideosActiveTaskObserver::EDone:
+            Done();
+            break;
+
+        case MVcxMyVideosActiveTaskObserver::EMoreToCome:
+            ContinueStepping();
+            break;
+
+        //observer is responsible for calling Done, Cancel or ContinueStepping
+        case MVcxMyVideosActiveTaskObserver::EStopStepping:
+            MPX_DEBUG1("CVcxMyVideosActiveTask::RunL stopped stepping");
+            iStopped = ETrue;
+            break;
+        }
+    MPX_DEBUG1("CVcxMyVideosActiveTask::RunL() exit");
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosActiveTask::Done
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosActiveTask::Done()
+    {
+    MPX_DEBUG1("CVcxMyVideosActiveTask::Done() start");
+
+    iObserver.HandleOperationCompleted( KErrNone );
+    delete iCurCommand;
+    iCurCommand = NULL;
+    iStopped = EFalse;
+
+    MPX_DEBUG1("CVcxMyVideosActiveTask::Done() exit");
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosActiveTask::ContinueStepping
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosActiveTask::ContinueStepping()
+    {
+    ++iCurStep;
+    iStatus = KRequestPending;
+    MPX_DEBUG1("CVcxMyVideosActiveTask::ContinueStepping SetActive");
+    SetActive();
+    iStopped = EFalse;
+    TRequestStatus* status = &iStatus;
+    User::RequestComplete( status, KErrNone );
+    }
+
+void CVcxMyVideosActiveTask::Cancel()
+    {
+    if ( iStopped && !IsActive() )
+        {
+        MPX_DEBUG1("CVcxMyVideosActiveTask:: was paused, calling DoCancel()");
+        DoCancel();
+        }
+    else
+        {
+        MPX_DEBUG1("CVcxMyVideosActiveTask:: wasn't paused, calling CActive::Cancel() normally");
+        CActive::Cancel();
+        }
+    }
+// ---------------------------------------------------------------------------
+// From CActive
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosActiveTask::DoCancel()
+    {
+    MPX_DEBUG1("CVcxMyVideosActiveTask::DoCancel() start");
+    // Callback and cleanup
+    iObserver.HandleOperationCompleted( KErrCancel );
+    delete iCurCommand;
+    iCurCommand = NULL;
+    iStopped = EFalse;
+    MPX_DEBUG1("CVcxMyVideosActiveTask::DoCancel() exit");
+    }
+
+// ---------------------------------------------------------------------------
+// From CActive
+// ---------------------------------------------------------------------------
+//
+TInt CVcxMyVideosActiveTask::RunError( TInt aError )
+    {
+    MPX_DEBUG1("CVcxMyVideosActiveTask::RunError() start");
+    
+    // Callback and cleanup
+    iObserver.HandleOperationCompleted( aError );
+    delete iCurCommand;
+    iCurCommand = NULL;
+    iStopped = EFalse;
+
+    MPX_DEBUG1("CVcxMyVideosActiveTask::RunError() exit");
+    return KErrNone;
+    }
+
+// END OF FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosalbum.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,357 @@
+/*
+* 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 <mpxlog.h>
+#include <mpxmedia.h>
+#include <mpxmediaarray.h>
+#include <mpxmediacontainerdefs.h>
+#include <mpxmediageneraldefs.h>
+#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()
+    {
+    iVideoList.Reset();
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosAlbum::Sort
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbum::Sort()
+    {
+    const TLinearOrder<TVcxMyVideosAlbumVideo> KOrderByMdsId(
+            CVcxMyVideosAlbum::CompareVideosByMdsId );
+
+    iVideoList.Sort( KOrderByMdsId );
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosAlbum::SetL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbum::SetL( /*CMPXMedia& aAlbum*/ )
+    {
+    //TODO:
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosAlbum::BelongsToAlbum
+// ---------------------------------------------------------------------------
+//
+TBool CVcxMyVideosAlbum::BelongsToAlbum( TUint32 aMdsId )
+    {
+    const TLinearOrder<TVcxMyVideosAlbumVideo> KOrderByMdsId(
+            CVcxMyVideosAlbum::CompareVideosByMdsId );
+    
+    TInt index;
+    TVcxMyVideosAlbumVideo video;
+    video.iMdsId = aMdsId;
+    TInt err = iVideoList.FindInOrder( video, index, KOrderByMdsId );
+    
+    if ( err != KErrNone )
+        {
+        return EFalse;
+        }
+    
+    return ETrue;
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosAlbum::Video
+// ---------------------------------------------------------------------------
+//
+TInt CVcxMyVideosAlbum::Video( TUint32 aMdsId, TVcxMyVideosAlbumVideo& aVideo, TInt& aIndex )
+    {
+    const TLinearOrder<TVcxMyVideosAlbumVideo> KOrderByMdsId(
+            CVcxMyVideosAlbum::CompareVideosByMdsId );
+    
+    TVcxMyVideosAlbumVideo videoToFind;
+    videoToFind.iMdsId = aMdsId;
+    TInt err = iVideoList.FindInOrder( videoToFind, aIndex, KOrderByMdsId );
+
+    if ( err == KErrNone )
+        {
+        aVideo = iVideoList[aIndex];
+        }
+   
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosAlbum::AddL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbum::AddL( TVcxMyVideosAlbumVideo aVideo )
+    {
+    const TLinearOrder<TVcxMyVideosAlbumVideo> KOrderByMdsId(
+            CVcxMyVideosAlbum::CompareVideosByMdsId );
+
+    iVideoList.InsertInOrderAllowRepeatsL( aVideo, KOrderByMdsId );
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosAlbum::Remove
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbum::Remove( RArray<TUint32>& aMdsIds )
+    {
+    TInt count = aMdsIds.Count();
+    for ( TInt i = 0; i < count; i++ )
+        {
+        Remove( aMdsIds[i], EFalse /* don't compress */ );
+        }
+    iVideoList.Compress();
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosAlbum::Remove
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbum::Remove( TUint32 aMdsId, TBool aCompress )
+    {
+    const TLinearOrder<TVcxMyVideosAlbumVideo> KOrderByMdsId(
+            CVcxMyVideosAlbum::CompareVideosByMdsId );
+
+    TVcxMyVideosAlbumVideo video;
+    video.iMdsId = aMdsId;
+    TInt pos;
+    TInt err = iVideoList.FindInOrder( video, pos, KOrderByMdsId );
+    if ( err == KErrNone )
+        {
+        iVideoList.Remove( pos );
+        }
+    if ( aCompress )
+        {
+        iVideoList.Compress();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosAlbum::CompareVideosByMdsId
+// ---------------------------------------------------------------------------
+//
+TInt CVcxMyVideosAlbum::CompareVideosByMdsId( const TVcxMyVideosAlbumVideo& aVideo1,
+        const TVcxMyVideosAlbumVideo& aVideo2 )
+    {
+    if ( aVideo1.iMdsId == aVideo2.iMdsId )
+        {
+        return 0;
+        }
+
+    if ( aVideo1.iMdsId < aVideo2.iMdsId )
+        {
+        return -1;
+        }
+    return 1;
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosAlbum::CreateVideoListL
+// Creates album video list from iCollection.iCache->iVideoList.
+// ---------------------------------------------------------------------------
+//
+CMPXMedia* CVcxMyVideosAlbum::CreateVideoListL()
+    {
+    CMPXMedia* toVideoList = TVcxMyVideosCollectionUtil::CreateEmptyMediaListL();
+    CleanupStack::PushL( toVideoList );
+
+    AppendToVideoListL( *iCollection.iCache->iVideoList, *toVideoList, 0 );
+    
+    CleanupStack::Pop( toVideoList );
+
+    return toVideoList;
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosAlbum::CreateVideoListL
+// Appends to video list the items which belong to this album.
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbum::AppendToVideoListL( CMPXMedia& aFromVideoList,
+        CMPXMedia& aToVideoList, TInt aNewItemStartIndex )
+    {
+    if ( aNewItemStartIndex < 0 )
+        {
+        return;
+        }
+    
+    CMPXMediaArray* fromArray = aFromVideoList.Value<CMPXMediaArray>( KMPXMediaArrayContents ); 
+    CMPXMediaArray* toArray   = aToVideoList.Value<CMPXMediaArray>( KMPXMediaArrayContents ); 
+    TUint32 mdsId;
+    CMPXMedia* fromVideo;
+    TInt count = fromArray->Count();
+    for ( TInt i = aNewItemStartIndex; i < count; i++ )
+        {
+        fromVideo = fromArray->AtL( i );
+        mdsId = TVcxMyVideosCollectionUtil::IdL( *fromVideo ).iId1;
+        if ( BelongsToAlbum( mdsId ) )
+            {
+            CMPXMedia* toVideo = CMPXMedia::NewL( *fromVideo ); //share underlying memory
+            CleanupStack::PushL( toVideo );
+            toArray->AppendL( toVideo );
+            CleanupStack::Pop( toVideo );
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosAlbum::CalculateAttributesL
+// ---------------------------------------------------------------------------
+//
+TBool CVcxMyVideosAlbum::CalculateAttributesL()
+    {
+    TInt videoCount = 0;
+    TUint32 count = iVideoList.Count();
+    TInt newCount = 0;
+    CMPXMedia* video;
+    CMPXMedia* latestNewVideo = NULL;
+    TInt pos;
+    TUint32 flags;
+    TInt64 currentItemsCreationDate = 0;
+    TInt64 latestCreationDate = TVcxMyVideosCollectionUtil::CreationDateL( *iMedia );
+    for ( TInt i = 0; i < count; i++ )
+        {
+        video = iCollection.iCache->FindVideoByMdsIdL( iVideoList[i].iMdsId, pos );
+        if ( video )
+            {
+            videoCount++;
+            flags = TVcxMyVideosCollectionUtil::FlagsL( *video );
+            if ( flags & EVcxMyVideosVideoNew )
+                {
+                newCount++;
+                currentItemsCreationDate = TVcxMyVideosCollectionUtil::CreationDateL( *video );
+                if ( latestCreationDate < currentItemsCreationDate )
+                    {
+                    latestCreationDate = currentItemsCreationDate;
+                    latestNewVideo     = video;
+                    }
+                }
+            }
+        }
+    
+    TBool modified = EFalse;
+    
+    TUint32 prevValue = TVcxMyVideosCollectionUtil::CategoryItemCountL( *iMedia );
+    if ( prevValue != videoCount )
+        {
+        iMedia->SetTObjectValueL<TUint32>( KVcxMediaMyVideosCategoryItemCount, videoCount );
+        modified = ETrue;
+        }
+
+    prevValue = TVcxMyVideosCollectionUtil::CategoryNewItemCountL( *iMedia );
+    if ( prevValue != newCount )
+        {
+        iMedia->SetTObjectValueL<TUint32>( KVcxMediaMyVideosCategoryNewItemCount, newCount );
+        modified = ETrue;
+        }
+    
+    if ( latestNewVideo )
+        {
+        TPtrC prevNewVideoName( TVcxMyVideosCollectionUtil::CategoryNewVideoName( *iMedia ) );
+        TPtrC latestNewVideoName( TVcxMyVideosCollectionUtil::Title( *latestNewVideo ) );
+        if ( prevNewVideoName != latestNewVideoName )
+            {
+            iMedia->SetTextValueL( KVcxMediaMyVideosCategoryNewItemName,
+                    TVcxMyVideosCollectionUtil::Title( *latestNewVideo ) );
+            iMedia->SetTObjectValueL<TInt64>( KMPXMediaGeneralDate, latestCreationDate );    
+            modified = ETrue;
+            }
+        }
+    
+    return modified;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosalbums.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,816 @@
+/*
+* 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 <e32base.h>
+#include <mpxlog.h>
+#include <mpxmediacontainerdefs.h>
+#include <mpxcollectionpluginobserver.h>
+#include <mpxmediageneraldefs.h>
+#include "vcxmyvideosalbums.h"
+#include "vcxmyvideoscollectionutil.h"
+#include "vcxmyvideoscollectionplugin.h"
+#include "vcxmyvideosmdsdb.h"
+#include "vcxmyvideosmdsalbums.h"
+#include "vcxmyvideoscollectionutil.h"
+#include "vcxmyvideosmessagelist.h"
+#include "vcxmyvideosopenhandler.h"
+
+// ============================ 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()
+    {
+    if ( iAlbumList )
+        {
+        return;
+        }
+    iAlbumList = TVcxMyVideosCollectionUtil::CreateEmptyMediaListL();
+    iCollection.iMyVideosMdsDb->iAlbums->GetAlbumsL( iAlbumList, *this );
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::CreateAlbumsL
+// Called when iAlbumList is ready, fills iAlbums.
+// Pointers to CVcxMyVideosVideoCache::iVideoList are not filled in yet.
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::CreateAlbumsL()
+    {
+    CMPXMediaArray* albumArray = iAlbumList->Value<CMPXMediaArray>( KMPXMediaArrayContents );
+
+    TInt count = albumArray->Count();
+    CVcxMyVideosAlbum* album;
+    CMPXMedia* media;
+    for ( TInt i = 0; i < count; i++ )
+        {
+        media = albumArray->AtL( i );
+        album = CVcxMyVideosAlbum::NewLC( iCollection );
+        album->iMdsId = TVcxMyVideosCollectionUtil::IdL( *media ).iId1;
+        album->iMedia = media;
+        iAlbums.AppendL( album );
+        CleanupStack::Pop( album );
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::GetAlbumContentIdsL
+// Fetches MDS IDs for all albums.
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::GetAlbumContentIdsL()
+    {
+    TInt count = iAlbums.Count();
+    for ( TInt i = 0; i < count; i++ )
+        {
+        // These calls go to queue and responses arrive asynchronously
+        // to HandleGetAlbumContentIdsRespL.
+        iCollection.iMyVideosMdsDb->iAlbums->GetAlbumContentIdsL( iAlbums[i]->iMdsId,
+                iAlbums[i]->iVideoList, *this );
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::Album
+// ----------------------------------------------------------------------------
+//
+CVcxMyVideosAlbum* CVcxMyVideosAlbums::Album( TUint32 aMdsId, TInt* aPos )
+    {
+    TInt count = iAlbums.Count();
+    for ( TInt i = 0; i < count; i++ )
+        {
+        if ( iAlbums[i]->iMdsId == aMdsId )
+            {
+            if ( aPos )
+                {
+                *aPos = i;
+                }
+            return iAlbums[i];
+            }
+        }
+    return NULL;
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::AddVideosToAlbumL
+// Command from MPX client.
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::AddVideosToAlbumL( CMPXMedia* aCmd )
+    {    
+    TInt albumId = TVcxMyVideosCollectionUtil::Uint32ValueL( *aCmd );
+    CVcxMyVideosAlbum* album = Album( albumId );
+    if ( album )
+        {
+        CMPXMediaArray* mediaArray = TVcxMyVideosCollectionUtil::MediaArrayL( *aCmd );
+        TInt count = mediaArray->Count();
+        CMPXMedia* video;
+        TInt mdsId;
+        RArray<TUint32> uniqueVideoIds;
+        uniqueVideoIds.Reset();
+        CleanupClosePushL( uniqueVideoIds );
+        
+        for ( TInt i = 0; i < count; i++ )
+            {
+            video = mediaArray->AtL( i );
+            mdsId = TVcxMyVideosCollectionUtil::IdL( *video ).iId1;
+
+            // Mark duplicates as failed to aCmd (KErrAlreadyExists)
+            if ( uniqueVideoIds.Find( mdsId ) == KErrNotFound )
+                {
+                uniqueVideoIds.AppendL( mdsId );
+
+                // Mark videos which are already in album as failed to aCmd (KErrAlreadyExists)
+                if ( album->BelongsToAlbum( mdsId ) )
+                    {
+                    MPX_DEBUG3("CVcxMyVideosAlbums:: %d already belongs to %d album",
+                            mdsId, albumId );
+                    video->SetTObjectValueL<TInt32>( KVcxMediaMyVideosInt32Value, KErrAlreadyExists );
+                    }
+                else
+                    {
+                    video->SetTObjectValueL<TInt32>( KVcxMediaMyVideosInt32Value, KErrNone );
+                    }
+                }
+            else
+                {
+                MPX_DEBUG2("CVcxMyVideosAlbums:: %d already present in the aCmd, marking as KErrAlreadyExists", mdsId);
+                video->SetTObjectValueL<TInt32>( KVcxMediaMyVideosInt32Value, KErrAlreadyExists );
+                }
+
+            }
+        
+        CleanupStack::PopAndDestroy( &uniqueVideoIds );
+        }
+    
+    iCollection.iMyVideosMdsDb->iAlbums->AddVideosToAlbumL( aCmd, *this );
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::RemoveVideosFromAlbumL
+// Converts video mpx ids to relation ids and calls RemoveRelationsL.
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::RemoveVideosFromAlbumL( CMPXMedia* aCmd )
+    {
+    TInt albumId = TVcxMyVideosCollectionUtil::Uint32ValueL( *aCmd );
+    CMPXMediaArray* array = TVcxMyVideosCollectionUtil::MediaArrayL( *aCmd );
+    TVcxMyVideosAlbumVideo video;
+    TInt index;
+    TInt error;
+    CMPXMedia* media;
+    TInt count = array->Count();
+    iMdsOpTargetIds.Reset();
+    iMdsOpTargetIds.Reserve( count );
+    iRemoveFromAlbumVideos.Reset();
+    iRemoveFromAlbumVideos.Reserve( count );
+    TVcxMyVideosAlbumVideo paddingVideo;
+    paddingVideo.iMdsId         = 0;
+    paddingVideo.iRelationMdsId = 0;
+    
+    for ( TInt i = 0; i < count; i++ )
+        {
+        media = array->AtL( i );
+        error = Album( albumId )->Video(
+                TVcxMyVideosCollectionUtil::IdL( *media ).iId1, video, index );
+        if ( error == KErrNone )
+            {
+            iRemoveFromAlbumVideos.AppendL( video ); //store album video data now to avoid second search when response arrives
+            iMdsOpTargetIds.AppendL( video.iRelationMdsId );
+            }
+        else
+            {
+            iRemoveFromAlbumVideos.AppendL( paddingVideo ); //add dummy video to keep media array and iRemoveFromAlbumVideos in sync
+            }
+        }
+    iMdsOpResultsUint32.Reset();
+    iCollection.iMyVideosMdsDb->iAlbums->RemoveRelationsL(
+            iMdsOpTargetIds, iMdsOpResultsUint32, *this );
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::AddAlbumL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::AddAlbumL( CMPXMedia& aCmd )
+    {
+    if ( TVcxMyVideosCollectionUtil::Title( aCmd ).Length() > 255 )
+        {
+        User::Leave( KErrArgument );
+        }
+    
+    iCollection.iMyVideosMdsDb->iAlbums->AddAlbumL( aCmd );
+    
+    TUint32 mdsId = TVcxMyVideosCollectionUtil::IdL( aCmd ).iId1;
+    if ( !Album( mdsId ) )
+        {
+        CMPXMediaArray* albumArray = iAlbumList->Value<CMPXMediaArray>( KMPXMediaArrayContents );
+        albumArray->AppendL( aCmd );
+        
+        CVcxMyVideosAlbum* album = CVcxMyVideosAlbum::NewLC( iCollection );
+        album->iMdsId = mdsId;
+        album->iMedia = albumArray->AtL( albumArray->Count() - 1 );
+        iAlbums.AppendL( album );
+        CleanupStack::Pop( album );
+        
+        iCollection.iMessageList->AddEventL( TMPXItemId( mdsId, KVcxMvcMediaTypeAlbum ),
+                EMPXItemInserted, EVcxMyVideosListNoInfo, album->iMedia );
+        iCollection.iMessageList->SendL();
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::RemoveAlbumsFromMdsOnlyL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::RemoveAlbumsFromMdsOnlyL( CMPXMedia* aCmd )
+    {
+    iCollection.iMyVideosMdsDb->iAlbums->RemoveAlbumsL( aCmd, *this );
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::RemoveAlbumsL
+// From MDS delete event.
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::RemoveAlbumsL( RArray<TUint32>& aAlbumIds )
+    {
+    TInt count = aAlbumIds.Count();
+    for ( TInt i = count -1; i >= 0; i-- )
+        {
+        TBool removed = RemoveAlbumL( aAlbumIds[i], EFalse /* dont compress */);
+        if ( removed )
+            {
+            aAlbumIds.Remove( i );
+            }
+        }
+    iAlbums.Compress();
+    
+    iCollection.iMessageList->SendL();        
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::RemoveAlbumL
+// ----------------------------------------------------------------------------
+//
+TBool CVcxMyVideosAlbums::RemoveAlbumL( TUint32 aMdsId, TBool aCompress )
+    {
+    TInt pos;
+    CVcxMyVideosAlbum* album = Album( aMdsId, &pos );
+    if ( album )
+        {
+        CMPXMediaArray* albumArray = TVcxMyVideosCollectionUtil::MediaArrayL( *iAlbumList );
+        
+        iAlbums.Remove( pos );
+        albumArray->Remove( pos );
+        
+        MPX_DEBUG2("CVcxMyVideosAlbums:: removing album from pos %d", pos);
+        
+        if ( aCompress )
+            {
+            iAlbums.Compress();
+            }
+        iCollection.iMessageList->AddEventL( TMPXItemId( aMdsId, KVcxMvcMediaTypeAlbum ),
+                EMPXItemDeleted, EVcxMyVideosListNoInfo );
+        return ETrue;
+        }
+    return EFalse;
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::CalculateAttributesL
+// ----------------------------------------------------------------------------
+//
+TBool CVcxMyVideosAlbums::CalculateAttributesL()
+    {
+    TBool eventsAdded = EFalse;
+    TBool modified    = EFalse;
+    TInt count = iAlbums.Count();
+    for ( TInt i = 0; i < count; i++ )
+        {
+        modified = iAlbums[i]->CalculateAttributesL();
+        if ( modified )
+            {
+            iCollection.iMessageList->AddEventL(
+                    TMPXItemId( iAlbums[i]->iMdsId, KVcxMvcMediaTypeAlbum ),
+                    EMPXItemModified, 0 );
+            eventsAdded = ETrue;
+            }     
+        }
+    return eventsAdded;
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::AddAlbumsFromMdsL
+// From MDS insert event, no need to fetch content since the album was just
+// created.
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::AddAlbumsFromMdsL( RArray<TUint32>& /*aAlbumIds*/ )
+    {
+    //TODO: implement if we want to support albums which are added by someone else
+    //      than My Videos Collection.
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::HandleGetAlbumsRespL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::HandleGetAlbumsRespL( CMPXMedia* aAlbumList )
+    {
+    // aAlbumList = iAlbumList
+    CMPXMediaArray* array = aAlbumList->Value<CMPXMediaArray>( KMPXMediaArrayContents );
+    TInt count = array->Count();
+    TMPXItemId mpxId;
+    CMPXMedia* album;
+    for ( TInt i = 0; i < count; i++ )
+        {
+        album = array->AtL( i );
+        mpxId = TVcxMyVideosCollectionUtil::IdL( *album );
+        iCollection.iMessageList->AddEventL( mpxId, EMPXItemInserted, 0, album );
+        }
+    CreateAlbumsL(); //fills in iAlbums from iAlbumList
+    GetAlbumContentIdsL(); //fills iAlbums with MDS IDs of the videos asynchronously
+    iCollection.iMessageList->SendL();
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::HandleGetAlbumContentIdsRespL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::HandleGetAlbumContentIdsRespL( TUint32 aAlbumId,
+        RArray<TVcxMyVideosAlbumVideo>& /*aAlbumContentIds*/ )
+    {    
+    //&aAlbumContent = iAlbums[x]->iVideoList
+    
+    CVcxMyVideosAlbum* album( Album( aAlbumId ) ); 
+    if ( album )
+        {
+        album->Sort(); //sorts iAlbum[x]->iVideoList by MDS ID.
+        }
+
+    //if last album -> album list is complete
+    if ( iAlbums[iAlbums.Count() -1]->iMdsId == aAlbumId )
+        {
+        MPX_DEBUG1("CVcxMyVideosAlbums:: content ids for last album arrived -> album list is complete" );
+        iAlbumListIsComplete = ETrue;
+
+        if ( iCollection.iOpenHandler->iPendingAlbumOpenId )
+            {
+            MPX_DEBUG1("CVcxMyVideosAlbums:: there was album open pending, calling HandleAlbumOpenL()" );
+
+            TRAPD( err, iCollection.iOpenHandler->HandleAlbumOpenL() );
+            if ( err != KErrNone )
+                {
+                MPX_DEBUG3("CVcxMyVideosAlbums:: HandleAlbumOpenL() left: %d, calling HandleOpen(NULL,%d)",
+                        err, err);
+                iCollection.iObs->HandleOpen( static_cast<CMPXMedia*>(NULL), err );
+                }
+            }
+        }
+    
+    
+#ifdef _DEBUG
+    if ( album )
+        {
+        TInt count = album->iVideoList.Count();
+
+        MPX_DEBUG2("CVcxMyVideosCollectionPlugin:: content ids for album %d arrived", aAlbumId);
+
+        for ( TInt i = 0; i < album->iVideoList.Count(); i++ )
+            {
+            MPX_DEBUG2("CVcxMyVideosCollectionPlugin:: mds id = %d", album->iVideoList[i].iMdsId );
+            }
+        }
+#endif
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::HandleGetAlbumsResp
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::HandleGetAlbumsResp( CMPXMedia* aAlbumList )
+    {
+    TRAP_IGNORE( HandleGetAlbumsRespL( aAlbumList ) );
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::HandleGetAlbumContentIdsResp
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::HandleGetAlbumContentIdsResp( TUint32 aAlbumId,
+        RArray<TVcxMyVideosAlbumVideo>& aAlbumContent )
+    {
+    TRAP_IGNORE( HandleGetAlbumContentIdsRespL( aAlbumId, aAlbumContent ) );    
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::HandleAddVideosToAlbumResp
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::HandleAddVideosToAlbumResp( CMPXMedia* aCmd,
+        RPointerArray<CMdEInstanceItem>& aItemArray )
+    {    
+    TRAPD( err, DoHandleAddVideosToAlbumRespL( aCmd, aItemArray ) );
+    
+    if ( err != KErrNone )
+        {
+        CMPXMedia* cmd = iCollection.iActiveTask->Command(); 
+        if ( cmd )
+            {
+            cmd->SetTObjectValueL<TInt>( KVcxMediaMyVideosInt32Value, err );
+            iCollection.iActiveTask->Done();
+            }
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::DoHandleAddVideosToAlbumResp
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::DoHandleAddVideosToAlbumRespL( CMPXMedia* aCmd,
+        RPointerArray<CMdEInstanceItem>& aItemArray )
+    {
+    MPX_DEBUG1("CVcxMyVideosAlbums::DoHandleAddVideosToAlbumResp() start");
+
+    TUint32 albumId = TVcxMyVideosCollectionUtil::Uint32ValueL( *aCmd );
+    CVcxMyVideosAlbum* album = Album( albumId );
+
+    CMPXMediaArray* mediaArray = TVcxMyVideosCollectionUtil::MediaArrayL( *aCmd );
+    
+    TVcxMyVideosAlbumVideo video;
+    RArray<CVcxMyVideosAlbum*> modifiedAlbums;
+    modifiedAlbums.Reset();
+    CleanupClosePushL( modifiedAlbums );
+
+    TInt mediaArrayCount  = mediaArray->Count();
+    TInt resultArrayCount = aItemArray.Count();
+    CMPXMedia* media;
+    TInt j = 0;
+    for ( TInt i = 0; i < mediaArrayCount; i++ )
+        {
+        if ( j > resultArrayCount - 1 )
+            {
+            MPX_DEBUG1("CVcxMyVideosAlbums:: result array already at end, skipping the rest");
+            break; //break from for loop
+            }
+
+        media = mediaArray->AtL( i );
+
+        // Skip items which were already failed (KErrAlreadyExists)
+        if ( TVcxMyVideosCollectionUtil::Int32ValueL( *media ) != KErrAlreadyExists )
+            {
+            video.iRelationMdsId = aItemArray[j]->Id(); 
+            MPX_DEBUG3( "CVcxMyVideosAlbums:: item result[%d] = %d (id)", j, video.iRelationMdsId );
+            if ( video.iRelationMdsId == KNoId )
+                {
+                media->SetTObjectValueL<TInt>( KVcxMediaMyVideosInt32Value,
+                        KErrGeneral );
+                }
+            else
+                {
+                media->SetTObjectValueL<TInt>( KVcxMediaMyVideosInt32Value, KErrNone );
+                video.iMdsId = TVcxMyVideosCollectionUtil::IdL( *media ).iId1;
+                if ( album )
+                    {
+                    album->AddL( video );
+                    if ( modifiedAlbums.Find( album ) == KErrNotFound )
+                        {
+                        modifiedAlbums.AppendL( album );
+                        }
+                    iCollection.iMessageList->AddEventL( TMPXItemId( albumId, KVcxMvcMediaTypeAlbum ),
+                            EMPXItemModified, EVcxMyVideosVideoListOrderChanged );
+                    }
+                }
+            j++;
+            }
+        else
+            {
+            MPX_DEBUG2("CVcxMyVideosAlbums:: skipping already failed %d(KErrAlreadyExists) media array item",
+                    TVcxMyVideosCollectionUtil::IdL( *media ).iId1 );
+            }
+        }
+
+    TInt count = modifiedAlbums.Count();
+    for ( TInt i = 0; i < count; i++ )
+        {
+        modifiedAlbums[i]->CalculateAttributesL();
+        }
+    
+    CleanupStack::PopAndDestroy( &modifiedAlbums );
+    
+    iCollection.iActiveTask->Done();
+    iCollection.iMessageList->SendL();
+    
+    MPX_DEBUG1("CVcxMyVideosAlbums::DoHandleAddVideosToAlbumResp() exit");
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::HandleRemoveRelationsResp
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::HandleRemoveRelationsResp( RArray<TUint32>& /*aRelationIds*/,
+        RArray<TUint32>& aResults )
+    {
+    MPX_DEBUG1("CVcxMyVideosAlbums::HandleRemoveRelationsResp() start");
+    
+    // iRemoveFromAlbumVideos and mediaArray are in sync
+    
+    TRAP_IGNORE(
+    
+    CMPXMedia* cmd             = iCollection.iActiveTask->Command();
+    CMPXMediaArray* mediaArray = TVcxMyVideosCollectionUtil::MediaArrayL( *cmd );
+    TInt count                 = iRemoveFromAlbumVideos.Count();
+    CMPXMedia* video;
+    TInt relationId;
+    for ( TInt i = 0; i < count; i++ )
+        {
+        video = mediaArray->AtL( i );
+        relationId = iRemoveFromAlbumVideos[i].iRelationMdsId;
+        if ( relationId != 0 && 
+                aResults.Find( relationId ) != KErrNotFound )
+            {
+            video->SetTObjectValueL( KVcxMediaMyVideosInt32Value, KErrNone );
+            }
+        else
+            {
+            video->SetTObjectValueL( KVcxMediaMyVideosInt32Value, KErrGeneral );
+            }
+        }
+    
+    );
+    
+    iRemoveFromAlbumVideos.Reset();
+    
+    iCollection.iActiveTask->Done();
+
+    MPX_DEBUG1("CVcxMyVideosAlbums::HandleRemoveRelationsResp() exit");
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::HandleRemoveAlbumsResp
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::HandleRemoveAlbumsResp( CMPXMedia* aCmd,
+        RArray<TUint32>& aResultIds )
+    {    
+    TRAP_IGNORE(
+    
+    CMPXMediaArray* mediaArray = TVcxMyVideosCollectionUtil::MediaArrayL( *aCmd );
+    TInt count = mediaArray->Count();
+    TUint32 mdsId;
+    CMPXMedia* album;
+    for ( TInt i = 0; i < count; i++ )
+        {
+        album = mediaArray->AtL( i );
+        mdsId = TVcxMyVideosCollectionUtil::IdL( *album ).iId1;
+        if ( aResultIds.Find( mdsId ) != KErrNotFound )
+            {
+            album->SetTObjectValueL( KVcxMediaMyVideosInt32Value, KErrNone );
+            }
+        else
+            {
+            album->SetTObjectValueL( KVcxMediaMyVideosInt32Value, KErrGeneral );
+            }
+        }
+    
+    );
+    
+    iCollection.iActiveTask->Done();
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::HandleRelationEvent
+// Only relation removed events are received here.
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::HandleRelationEvent( TObserverNotificationType /*aType*/,
+        const RArray<TMdERelation>& aRelationArray )
+    {    
+    TRAP_IGNORE(
+
+    RArray<CVcxMyVideosAlbum*> modifiedAlbums;
+    modifiedAlbums.Reset();
+    CleanupClosePushL( modifiedAlbums );
+
+    TUint albumId;
+    CVcxMyVideosAlbum* album;
+    TInt count = aRelationArray.Count();
+    
+    
+    for ( TInt i = 0; i < count; i++ )
+        {
+        albumId = aRelationArray[i].LeftObjectId();
+        
+        MPX_DEBUG3("CVcxMyVideosAlbums:: relation (%d,%d) deleted from MDS",
+                aRelationArray[i].LeftObjectId(), aRelationArray[i].RightObjectId() );
+        
+        if ( iAlbumListIsComplete )
+            {
+            album = Album( albumId );
+            if ( album )
+                {
+                if ( modifiedAlbums.Find( album ) == KErrNotFound )
+                    {
+                    modifiedAlbums.AppendL( album );
+                    }
+                album->Remove( aRelationArray[i].RightObjectId(), ETrue /* compress */ );
+                iCollection.iMessageList->AddEventL( TMPXItemId( albumId, KVcxMvcMediaTypeAlbum ),
+                        EMPXItemModified, EVcxMyVideosVideoListOrderChanged );
+                }
+            }
+        else
+            {
+            //We are fetching albums already, we assume that it will be up to date.
+            //If that is not the case, then we should set some flag here and restart
+            //album fetching from scratch.
+            }
+        }
+    
+    count = modifiedAlbums.Count();
+    for ( TInt i = 0; i < count; i++ )
+        {
+        modifiedAlbums[i]->CalculateAttributesL();
+        }
+    
+    CleanupStack::PopAndDestroy( &modifiedAlbums );
+    
+    iCollection.iMessageList->SendL();
+    
+    );
+    }
+
+//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 )
+    {
+    TBool changed = EFalse;
+    
+    TMPXItemId mpxId = TVcxMyVideosCollectionUtil::IdL( aAlbum );
+    CVcxMyVideosAlbum* album = Album( mpxId.iId1 );
+
+    if ( album && album->iMedia )
+        {
+        CMPXMedia* media = album->iMedia;
+
+        if ( media->IsSupported( KMPXMediaGeneralTitle ) )
+            {
+            TPtrC newTitle( TVcxMyVideosCollectionUtil::Title( aAlbum ) );
+            TPtrC oldTitle( TVcxMyVideosCollectionUtil::Title( *media ) );
+
+            if ( newTitle != oldTitle )
+                {
+                media->SetTextValueL( KMPXMediaGeneralTitle, newTitle );
+                iCollection.iMessageList->AddEventL( mpxId, EMPXItemModified );
+                changed = ETrue;
+                }
+            }
+        // calculate attributes, in case that videos were removed or added to this album
+        album->CalculateAttributesL();
+        }
+        
+    return changed;
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::NewVideoFlagChangedL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::NewVideoFlagChangedL( TUint32 aMdsId )
+    {    
+    TInt count = iAlbums.Count();
+    for ( TInt i = 0; i < count; i++ )
+        {
+        if ( iAlbums[i]->BelongsToAlbum( aMdsId ) )
+            {
+            iAlbums[i]->CalculateAttributesL();
+            iCollection.iMessageList->AddEventL(
+                    TMPXItemId( iAlbums[i]->iMdsId, KVcxMvcMediaTypeAlbum ),
+                    EMPXItemModified, EVcxMyVideosListNoInfo );
+            }
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::VideoTitleChangedL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::VideoTitleChangedL( TUint32 aMdsId )
+    {    
+    NewVideoFlagChangedL( aMdsId ); // same calculation works for this
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::VideoAddedOrRemovedFromCacheL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::VideoAddedOrRemovedFromCacheL( CMPXMedia& aVideo )
+    {
+    TInt count = iAlbums.Count();
+    TUint32 mdsId = TVcxMyVideosCollectionUtil::IdL( aVideo ).iId1;
+    for ( TInt i = 0; i < count; i++ )
+        {
+        if ( iAlbums[i]->BelongsToAlbum( mdsId ) )
+            {
+            if ( iChangedAlbums.Find( i ) == KErrNotFound )
+                {
+                iChangedAlbums.AppendL( i );
+                }
+            }
+        }    
+    }
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::UpdateChangedAlbumsL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::UpdateChangedAlbumsL()
+    {
+    TInt count = iChangedAlbums.Count();
+    for ( TInt i = 0; i < count; i++ )
+        {
+        iCollection.iMessageList->AddEventL(
+                TMPXItemId( iAlbums[iChangedAlbums[i]]->iMdsId, KVcxMvcMediaTypeAlbum ),
+                EMPXItemModified, EVcxMyVideosVideoListOrderChanged );
+        iAlbums[iChangedAlbums[i]]->CalculateAttributesL();
+        }
+    iChangedAlbums.Reset();
+    }
+// END OF FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosasyncfilecopy.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,294 @@
+/*
+* 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:    Asynchronous file copy, implemented with several small sync block copies.*
+*/
+
+
+
+
+// INCLUDE FILES
+#include <mpxlog.h>
+#include <bautils.h>
+#include "vcxmyvideosasyncfilecopy.h"
+
+/**
+* One block shouldn't take more than 1 second to copy to keep cancel
+* response fast enough. On the otherhand, the deleting the already
+* copied data may take several seconds. 
+*
+* Copying speed tests (from massmemory to memorycard):
+*
+* Block size       speed        response time
+*   6MB        ->  3.20 MB/s    ~2sec    (unacceptable response time, full speed)
+*   3MB        ->  3.17 MB/s    ~1sec    (poor response time, almost full speed)
+*   1MB        ->  3.16 MB/s    ~0.3sec  (good response time, almost full speed)
+* 0.5MB        ->  2.60 MB/s    ~0.19sec (good response time, some speed loss)
+*
+* -> 1MB is the best.
+*
+* * Copying speed tests (from memorycard to massmemory):
+*
+* Block size       speed        response time
+*   3MB        ->  5.470 MB/s    0.548sec
+*   1MB        ->  4.393 MB/s    0.228sec
+*
+* 1M gives slightly reduced speed, great response time. 3MB would be better than
+* 1M but can't use it since it gives 1sec response time in memorycard writing.
+*/
+const TInt KBigBufSize    = 1024 * 1024; // 1MB
+const TInt KMediumBufSize = 512 * 1024;  // 0.5MB
+const TInt KSmallBufSize  = 100 * 1024;  // 0.1MB
+
+// ============================ MEMBER FUNCTIONS ==============================
+
+// ----------------------------------------------------------------------------
+// Two-phased constructor.
+// ----------------------------------------------------------------------------
+//
+CVcxMyVideosAsyncFileCopy* CVcxMyVideosAsyncFileCopy::NewL( RFs& aFs )
+    {
+    CVcxMyVideosAsyncFileCopy* self = new (ELeave) CVcxMyVideosAsyncFileCopy( aFs );
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// ----------------------------------------------------------------------------
+// Destructor.
+// ----------------------------------------------------------------------------
+//
+CVcxMyVideosAsyncFileCopy::~CVcxMyVideosAsyncFileCopy()
+    {
+    iSourceFile.Close();
+    iTargetFile.Close();
+    delete iFileBlockBuffer;
+    }
+
+// ----------------------------------------------------------------------------
+// Constructor.
+// ----------------------------------------------------------------------------
+//
+CVcxMyVideosAsyncFileCopy::CVcxMyVideosAsyncFileCopy( RFs& aFs )
+: iFs( aFs )
+    {
+    }
+
+// ----------------------------------------------------------------------------
+// Symbian 2nd phase constructor can leave.
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAsyncFileCopy::ConstructL ()
+    {
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAsyncFileCopy::CopyL
+// ----------------------------------------------------------------------------
+//
+TBool CVcxMyVideosAsyncFileCopy::CopyL( const TDesC& aSourceFileName,
+        const TDesC& aTargetFileName )
+    {
+    MPX_DEBUG1("CVcxMyVideosAsyncFileCopy::CopyL() start");
+    
+    if ( iIsCopying )
+        {
+        User::Leave( KErrNotReady );
+        }
+
+    TInt error = iSourceFile.Open( iFs, aSourceFileName, EFileRead | EFileShareReadersOnly );
+
+    User::LeaveIfError( error );
+
+    error = iTargetFile.Replace( iFs, aTargetFileName, EFileWrite | EFileWriteDirectIO
+            | EFileShareExclusive );
+
+    if ( error == KErrPathNotFound )
+        {
+        error = iFs.MkDirAll( aTargetFileName );
+        if ( error == KErrNone )
+            {
+            error = iTargetFile.Create( iFs, aTargetFileName, EFileWrite
+                    | EFileWriteDirectIO | EFileShareExclusive );
+            }
+        }
+
+    User::LeaveIfError( error );
+    User::LeaveIfError( iSourceFile.Size( iDataRemaining ) );
+    User::LeaveIfError( iTargetFile.SetSize( iDataRemaining ) );
+
+    TInt suggestBlockSize;
+    if ( iDataRemaining > KBigBufSize )
+        {
+        suggestBlockSize = KBigBufSize;
+        }
+    else
+        {
+        suggestBlockSize = iDataRemaining;
+        }
+    AllocateFileBlockBufferL( suggestBlockSize );
+
+    iReadPos   = 0;
+    iIsCopying = ETrue;
+
+#ifdef _DEBUG
+    iStartTime.UniversalTime();
+#endif
+
+    DoNextBlockCopy();
+
+    MPX_DEBUG1("CVcxMyVideosAsyncFileCopy::CopyL() exit");    
+    return !iIsCopying;
+    }
+    
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAsyncFileCopy::CopyIsOngoing
+// ----------------------------------------------------------------------------
+//
+TBool CVcxMyVideosAsyncFileCopy::CopyIsOngoing()
+    {
+    return iIsCopying;
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAsyncFileCopy::DoNextBlockCopy
+// ----------------------------------------------------------------------------
+//
+TInt CVcxMyVideosAsyncFileCopy::DoNextBlockCopy()
+    {    
+	TInt err = KErrNone;
+	TPtr8 fileBufPtr = iFileBlockBuffer->Des();
+
+	TInt bytesToCopy = Min( iDataRemaining, fileBufPtr.MaxSize() );
+
+	err = iSourceFile.Read( iReadPos, fileBufPtr, bytesToCopy );
+	if ( err == KErrNone && fileBufPtr.Length() != bytesToCopy )
+	    {
+		err = KErrCorrupt;
+	    }
+	if ( err == KErrNone )
+	    {
+		err = iTargetFile.Write( iReadPos, fileBufPtr, bytesToCopy );
+	    }
+	if ( err != KErrNone )
+		{
+		EndCopy( ETrue /* remove target file */);
+		return err;
+		}
+
+	iReadPos       += bytesToCopy;
+	iDataRemaining -= bytesToCopy;
+
+	if ( iDataRemaining == 0 )
+		{
+		EndCopy( EFalse /* keep target file */);
+		}
+
+	return KErrNone;
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAsyncFileCopy::Cancel
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAsyncFileCopy::Cancel()
+    {
+    MPX_DEBUG1("CVcxMyVideosAsyncFileCopy::Cancel() start");
+    
+    if ( iIsCopying )
+        {
+        EndCopy( ETrue /* remove target file */ );
+        }
+    MPX_DEBUG1("CVcxMyVideosAsyncFileCopy::Cancel() exit");
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAsyncFileCopy::AllocateFileBlockBufferL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAsyncFileCopy::AllocateFileBlockBufferL( TInt aFileSize )
+	{
+    delete iFileBlockBuffer;
+    iFileBlockBuffer = NULL;
+    
+	TInt big = Min( aFileSize, KBigBufSize );
+	iFileBlockBuffer = HBufC8::New( big );
+	if ( !iFileBlockBuffer )
+	    {
+		iFileBlockBuffer = HBufC8::New( KMediumBufSize );
+		}
+	if ( !iFileBlockBuffer )
+	    {
+		iFileBlockBuffer = HBufC8::NewL( KSmallBufSize );
+		}
+	}
+
+void CVcxMyVideosAsyncFileCopy::EndCopy( TBool aRemoveTargetFile )
+	{
+    MPX_DEBUG1("CVcxMyVideosAsyncFileCopy::EndCopy() start");
+
+    TTime modified;
+    iSourceFile.Modified( modified );
+    iTargetFile.SetModified( modified );
+
+#ifdef _DEBUG
+
+    TDateTime dT = modified.DateTime();
+    TBuf<200> buf;
+    buf.Format(_L("CVcxMyVideosAsyncFileCopy:: setting file modified date: %2d.%2d.%4d %2d:%2d:%2d"),
+            dT.Day()+1, dT.Month()+1, dT.Year(), dT.Hour(), dT.Minute(), dT.Second() ); 
+    MPX_DEBUG2("%S", &buf ); 
+
+    const TInt megaBytes = 0x100000;
+    const TInt kiloBytes = 1024;
+    TInt dataCopiedInMegaBytes = iReadPos / megaBytes;
+    TTime now;
+    now.UniversalTime();
+    TTimeIntervalSeconds interval;
+    now.SecondsFrom( iStartTime, interval );
+    TInt copyingSpeed = 0;
+    if ( interval.Int() > 0 )
+        {
+        copyingSpeed = (iReadPos / kiloBytes) / interval.Int();
+        }
+    MPX_DEBUG3("CVcxMyVideosAsyncFileCopy:: Data copied: %d (MB), %d kB/s", dataCopiedInMegaBytes, copyingSpeed);
+#endif
+	    
+	delete iFileBlockBuffer;
+	iFileBlockBuffer = NULL;
+	iReadPos       = 0;
+	iDataRemaining = 0;
+	iSourceFile.Close();
+	iIsCopying = EFalse;
+
+	if ( aRemoveTargetFile )
+	    {
+	    TFileName fileName;
+	    TInt err = iTargetFile.FullName( fileName );
+
+        iTargetFile.Close();	
+	    
+	    if ( err == KErrNone )
+	        {
+            MPX_DEBUG2("CVcxMyVideosAsyncFileCopy:: removing file: %S", &fileName);
+	        iFs.Delete( fileName );
+	        }
+	    }
+	else
+	    {
+        iTargetFile.Close();
+	    }
+
+    MPX_DEBUG1("CVcxMyVideosAsyncFileCopy::EndCopy() exit");
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosasyncfileoperations.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,817 @@
+/*
+* 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 <e32cmn.h>
+#include <s32mem.h>
+#include <mpxlog.h>
+#include <mpxmediacontainerdefs.h>
+#include <mpxmediageneraldefs.h>
+#include <mpxcollectionpluginobserver.h>
+#include <mpxmessagegeneraldefs.h>
+#include <mpxcommandgeneraldefs.h>
+#include <mpxcollectioncommanddefs.h>
+#include <mpxmessagecontainerdefs.h>
+#include <vcxmyvideosuids.h>
+#include <drmutility.h>
+#include <bautils.h>
+#include "vcxmyvideoscollectionplugin.h"
+#include "vcxmyvideoscollection.hrh"
+#include "vcxmyvideoscollectionutil.h"
+#include "vcxmyvideosvideocache.h"
+#include "vcxmyvideoscategories.h"
+#include "vcxmyvideosmessagelist.h"
+#include "vcxmyvideosasyncfileoperations.h"
+#include "vcxmyvideosasyncfilecopy.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()
+    {
+    iOperationIdArray.Close();
+    iOperationResult.Close();
+    delete iFileCopier;
+    delete iMediaForMoveOp;
+    delete iMediaForCopyOp;
+    }
+
+// ----------------------------------------------------------------------------
+// Constructor.
+// ----------------------------------------------------------------------------
+//
+CVcxMyVideosAsyncFileOperations::CVcxMyVideosAsyncFileOperations( CVcxMyVideosCollectionPlugin& aCollection )
+: iCollection( aCollection )
+    {
+    }
+
+// ----------------------------------------------------------------------------
+// Symbian 2nd phase constructor can leave.
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAsyncFileOperations::ConstructL ()
+    {
+    iFileCopier = CVcxMyVideosAsyncFileCopy::NewL( iCollection.iFs );
+    }
+    
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCollectionPlugin::DeleteVideoL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAsyncFileOperations::DeleteVideoL( TUint32 aMdsId, TBool aForce )
+    {
+    MPX_FUNC("CVcxMyVideosAsyncFileOperations::DeleteVideoL");
+            
+    TInt pos;
+    CMPXMedia* videoInCache = iCollection.iCache->FindVideoByMdsIdL( aMdsId, pos );
+                    
+    if ( !videoInCache )
+        {
+        MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: delete failed, MPX item not found from cache.");
+        User::Leave( KErrNotFound );
+        }
+    
+    TUint32 downloadId = TVcxMyVideosCollectionUtil::DownloadIdL( *videoInCache );            
+    if ( downloadId )
+        {
+        TVcxMyVideosDownloadState dlState =
+                TVcxMyVideosCollectionUtil::DownloadStateL( *videoInCache );
+                        
+        if ( aForce )
+            {
+            MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: aForce is ETrue, the video will be deleted even if download is ongoing");
+            }
+        else if ( dlState != EVcxMyVideosDlStateNone )
+            {
+            MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: delete failed since there is download going on.");
+            MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: use download cancel instead.");
+            User::Leave( KErrArgument );
+            }
+        else
+            {
+            MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: download id was != 0 but download state was EVcxMyVideosDlStateNone");
+            MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: -> we delete the video, it is prob gone from Download Manager already.");
+            }        
+        }
+            
+    if ( !videoInCache->IsSupported( KMPXMediaGeneralUri ) )
+        {
+        MPX_DEBUG1("CVcxMyVideosAsyncFileOperations::DeleteVideoL() KMPXMediaGeneralUri attribute missing -> leaving");
+        User::Leave( KErrArgument );
+        }
+    
+    MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: trying to delete: %S",
+            &videoInCache->ValueText( KMPXMediaGeneralUri ));
+    
+    TUint attr ( 0 ); 
+    TPtrC fileName = videoInCache->ValueText( KMPXMediaGeneralUri );
+    
+    TInt err = iCollection.iFs.Att( fileName, attr );
+    if ( err == KErrNone )
+        {
+        if ( attr & KEntryAttReadOnly )
+            {
+            iCollection.iFs.SetAtt( fileName, 0, KEntryAttReadOnly );
+            }
+        }
+    
+    err = iCollection.iFs.Delete( fileName );
+        
+    if ( err != KErrNone )
+        {
+        MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: file delete failed: %d", err );
+
+        if ( err == KErrNotFound || err == KErrPathNotFound )
+            {
+            MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: file was not found, trying to remove mds object anyways");
+            TInt result = iCollection.iMyVideosMdsDb->RemoveVideo( aMdsId );
+            if ( result == KErrNone )
+                {
+                MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: %d removed from mds", aMdsId); 
+                //mds events will clean cache
+                }
+            else
+                {
+                if ( result == KErrNotFound )
+                    {
+                    // file is gone, and mds item is gone -> try to delete from cache
+                    MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: %d not found from MDS, trying to delete from cache", aMdsId );
+                    TInt result = iCollection.iCache->RemoveL( aMdsId );
+                    if ( result == KErrNone )
+                        {
+                        MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: %d deleted from cache, generating event", aMdsId );
+                        iCollection.iMessageList->AddEventL( TMPXItemId( aMdsId, 0),
+                                EMPXItemDeleted, EVcxMyVideosListNoInfo );
+                        iCollection.iMessageList->SendL();
+                        } 
+                    }
+                else
+                    {
+                    //file is gone, mds item and cache are still present, couldnt remove them
+                    MPX_DEBUG3("CVcxMyVideosAsyncFileOperations:: failed to remove %d from mds (%d)", aMdsId, result);
+                    User::Leave( result );
+                    }
+                }
+            }            
+        else
+            {
+            // file delete failed and file still exists
+            MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: leaving mds object intact");
+            User::Leave( err );
+            }
+        }
+    else
+        {
+        MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: file delete successful, deleting item from MDS also to speed things up");
+        TInt result = iCollection.iMyVideosMdsDb->RemoveVideo( aMdsId );
+        if ( result == KErrNone )
+            {
+            MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: %d removed from mds", aMdsId);
+            //mds events will clean cache
+            }
+        else
+            {
+            if ( result == KErrNotFound )
+                {
+                // file is gone, and mds item is gone -> try to delete from cache
+                MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: %d not found from MDS, trying to delete from cache", aMdsId );
+                TInt result = iCollection.iCache->RemoveL( aMdsId );
+                if ( result == KErrNone )
+                    {
+                    MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: %d deleted from cache, generating event", aMdsId );
+                    iCollection.iMessageList->AddEventL( TMPXItemId( aMdsId, 0),
+                            EMPXItemDeleted, EVcxMyVideosListNoInfo );
+                    iCollection.iMessageList->SendL();
+                    }
+                }
+            else
+                {
+                //mds item and cache are still present, couldnt remove them
+                MPX_DEBUG3("CVcxMyVideosAsyncFileOperations:: failed to remove %d from mds (%d)", aMdsId, result);
+                User::Leave( result );
+                }
+            }
+        }   
+    }
+    
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAsyncFileOperations::HandleMoveOrCopyStepL
+// ----------------------------------------------------------------------------
+//
+MVcxMyVideosActiveTaskObserver::TStepResult
+        CVcxMyVideosAsyncFileOperations::HandleMoveOrCopyStepL()
+    {
+    // Reset inactivity timer. This will prevent ThumbAGDaemon start running while
+    // Move/copy is ongoing and failing the operation due to locked file handle.
+    User::ResetInactivityTime();
+    
+    CMPXMedia& cmd = iCollection.iActiveTask->GetCommand();
+    
+    MVcxMyVideosActiveTaskObserver::TStepResult stepResult;
+        
+    if ( iCurrentOperationIndex == 0 && !iFileCopier->CopyIsOngoing() )
+        {
+        InitMoveOrCopyOperationsL( cmd );        
+        }
+
+    TRAPD( err, MoveOrCopyVideoL( iOperationIdArray[iCurrentOperationIndex] ) );
+
+    if ( iFileCopier->CopyIsOngoing() && err == KErrNone )
+        {
+        // copy didnt finish yet, lets do some more steps before jumping to next file
+        return MVcxMyVideosActiveTaskObserver::EMoreToCome;
+        }
+        
+    iOperationResult.AppendL( err );
+    
+    iCurrentOperationIndex++;
+    
+    // End operations
+    if ( iCurrentOperationIndex > (iOperationIdArray.Count() - 1) )
+        {
+        iCurrentOperationIndex = 0;
+        stepResult             = MVcxMyVideosActiveTaskObserver::EDone;
+        if ( iIsMoveOperation )
+            {
+            SendOperationRespL( KVcxMessageMyVideosMoveResp );
+            }
+        else
+            {
+            SendOperationRespL( KVcxMessageMyVideosCopyResp );
+            }
+        }
+    else
+        {
+        stepResult = MVcxMyVideosActiveTaskObserver::EMoreToCome;
+        }
+        
+    return stepResult;
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAsyncFileOperations::InitMoveOrCopyOperationsL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAsyncFileOperations::InitMoveOrCopyOperationsL( CMPXMedia& aCmd )
+    {
+    if ( !aCmd.IsSupported( KMPXMediaArrayContents ) )
+        {
+        MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: error, no array defined");
+        User::Leave( KErrArgument );
+        }
+
+    CMPXMediaArray* idMediaArray = aCmd.Value<CMPXMediaArray>(
+            KMPXMediaArrayContents );
+
+    if ( idMediaArray->Count() == 0 )
+        {
+        MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: error, no items in array ");
+        User::Leave( KErrArgument );
+        }
+    
+    TUint32 cmdId = aCmd.ValueTObjectL<TUint32>( KVcxMediaMyVideosCommandId );    
+    if ( cmdId == KVcxCommandMyVideosMove )
+        {
+        MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: move operation");
+        iIsMoveOperation = ETrue;
+        }
+    else
+        {
+        iIsMoveOperation = EFalse;
+        }
+
+    iTargetDrive = aCmd.ValueTObjectL<TInt32>( KVcxMediaMyVideosInt32Value );
+    
+    TMPXItemId mpxId;    
+    iOperationIdArray.Reset();
+    TInt count = idMediaArray->Count();
+    for ( TInt i = 0; i < count; i++ )
+        {
+        mpxId = idMediaArray->AtL( i )->
+                        ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId );
+        MPX_DEBUG3("CVcxMyVideosAsyncFileOperations:: MPX ID: (%d, %d) will be moved ",
+                mpxId.iId1,
+                mpxId.iId2);
+        iOperationIdArray.AppendL( idMediaArray->AtL( i )->
+                ValueTObjectL<TMPXItemId>(KMPXMediaGeneralId ).iId1 );
+        }
+    
+    iCollection.SendMyVideosMessageL( KVcxMessageMyVideosMoveOrCopyStarted, &aCmd );
+
+    iOperationResult.Reset();
+    }
+    
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAsyncFileOperations::CancelOperationL
+// Called when leave or cancel occurs for the operation, generates resp msg.
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAsyncFileOperations::CancelOperationL( TInt aErr )
+    {
+    if ( iCollection.iActiveTask->IsActive() )
+        {
+        TInt mvCmdId = -1;
+        CMPXMedia& cmd = iCollection.iActiveTask->GetCommand();
+        TMPXCommandId commandId = *cmd.Value<TMPXCommandId>( KMPXCommandGeneralId );
+        
+        if ( commandId == KVcxCommandIdMyVideos )
+            {
+            mvCmdId = cmd.ValueTObjectL<TUint32>( KVcxMediaMyVideosCommandId );
+            }
+                    
+        TInt messageId; 
+        
+        switch ( mvCmdId )
+            {
+            case KVcxCommandMyVideosMove:
+                MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: generating KVcxMessageMyVideosMoveResp");
+                messageId = KVcxMessageMyVideosMoveResp;
+                if ( iFileCopier->CopyIsOngoing() )
+                    {
+                    //these have to be in this order, otherwise wrong item gets removed from mds
+                    TRAP_IGNORE( HandleFileCopyCompletedL( aErr ) ); // rolls mds back
+                    iFileCopier->Cancel(); // removes generated file and resets variables
+                    }
+                break;
+                
+            case KVcxCommandMyVideosCopy:
+                MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: generating KVcxMessageMyVideosCopyResp");
+                messageId = KVcxMessageMyVideosCopyResp;
+                if ( iFileCopier->CopyIsOngoing() )
+                    {
+                    TRAP_IGNORE( HandleFileCopyCompletedL( aErr ) ); // rolls mds back
+                    iFileCopier->Cancel(); // removes generated file and resets variables
+                    }
+                break;
+                
+            case KVcxCommandMyVideosDelete:
+                MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: generating KVcxMessageMyVideosDeleteResp");
+                messageId = KVcxMessageMyVideosDeleteResp;
+                break;
+            
+            default:
+                MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: no resp msg for this operation");
+                return;
+            }
+                        
+        // generates response array and resp message
+        for ( TInt i = iCurrentOperationIndex; i < iOperationIdArray.Count(); i++ )
+            {
+            iOperationResult.Append( aErr );
+            }
+        iCurrentOperationIndex = 0;
+
+        SendOperationRespL( messageId );
+        }
+    else
+        {
+        MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: no move,copy or delete operations were going on (nor anything else)");
+        User::Leave( KErrNotFound );
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAsyncFileOperations::SendOperationRespL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAsyncFileOperations::SendOperationRespL( TInt aCmdId )
+    {
+    CMPXMessage* message = TVcxMyVideosCollectionUtil::CreateEmptyMediaListL();
+    CleanupStack::PushL( message ); // 1->
+
+    CMPXMediaArray* messageArray = message->Value<CMPXMediaArray>(
+            KMPXMediaArrayContents );
+    message->SetTObjectValueL<TUid>(KMPXMessageCollectionId,
+            TUid::Uid(KVcxUidMyVideosMpxCollection));        
+            
+    // Add results
+    CMPXMedia* media;
+    TInt count = iOperationIdArray.Count();
+    for ( TInt i = 0; i < count; i++ )
+        {
+        MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: item added to array");
+        
+        media = CMPXMedia::NewL();
+        CleanupStack::PushL( media ); // 2->
+        media->SetTObjectValueL<TMPXItemId>( KMPXMediaGeneralId,
+                TMPXItemId( iOperationIdArray[i], 0) );
+        media->SetTObjectValueL<TInt32>( KVcxMediaMyVideosInt32Value,
+                iOperationResult[i] );
+        
+        messageArray->AppendL( media );
+        CleanupStack::Pop( media ); // <-2                            
+        }
+        
+    // Set message attributes
+    //
+    message->SetTObjectValueL<TMPXMessageId>( KMPXMessageGeneralId,
+            TMPXItemId( KVcxCommandIdMyVideos, 0 ));
+
+    message->SetTObjectValueL<TInt>( KVcxMediaMyVideosCommandId, aCmdId );
+    
+    iCollection.iMessageList->AddL( message );
+    CleanupStack::Pop( message ); // <-1
+    iCollection.iMessageList->SendL();
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAsyncFileOperations::MoveOrCopyVideoL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAsyncFileOperations::MoveOrCopyVideoL( TUint32 aMdsId )
+    {
+    if ( iFileCopier->CopyIsOngoing() )
+        {
+        TInt err = iFileCopier->DoNextBlockCopy();
+        if ( err != KErrNone || !iFileCopier->CopyIsOngoing() )
+            {
+            HandleFileCopyCompletedL( err );
+            }
+        return;
+        }
+        
+    //New file copy starts -> do sanity checks and mds and collection preparations
+    InitSingleMoveOrCopyL( aMdsId );
+            
+    MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: copying: %S", &iSourcePath);
+    MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: to     : %S", &iTargetPath);
+    
+    TBool completed = ETrue; // set to avoid warning
+    TRAPD( err, completed = iFileCopier->CopyL( iSourcePath, iTargetPath ) );
+    
+    if ( completed || err )
+        {
+        HandleFileCopyCompletedL( err );
+        }
+    }    
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAsyncFileOperations::InitSingleMoveOrCopyL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAsyncFileOperations::InitSingleMoveOrCopyL( TUint32 aMdsId )
+    {
+    //get media from cache or mds
+    TInt pos;
+    CMPXMedia* videoInCache = iCollection.iCache->FindVideoByMdsIdL( aMdsId, pos );
+
+    CMPXMedia* video = NULL;
+    if ( videoInCache )
+        {
+        video = CMPXMedia::NewL( *videoInCache );
+        }
+        
+    if ( !video )
+        {
+        video = iCollection.iMyVideosMdsDb->CreateVideoL( aMdsId, EFalse /* brief details */ );
+        }
+        
+    if ( !video )
+        {
+        MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: mds id %d not found from mds or cache", aMdsId);
+        User::Leave( KErrNotFound );
+        }
+
+    CleanupStack::PushL( video ); // 1->
+    
+    // sanity checks
+    if ( TVcxMyVideosCollectionUtil::DownloadIdL( *video ) != 0 )
+        {
+        MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: file is being downloaded, fail, leaving with KErrInUse code.");
+        User::Leave( KErrInUse );
+        }
+
+    iSourcePath = video->ValueText( KMPXMediaGeneralUri );
+            
+    if ( !DriveHasEnoughFreeSpaceL( iSourcePath, iTargetDrive ) )
+        {
+        MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: target drive full -> skipping");
+        User::Leave( KErrDiskFull );
+        }
+
+    TUint att = 0;
+    iCollection.iFs.Att( iSourcePath, att);    
+    if ( iIsMoveOperation && (att & KEntryAttReadOnly) )
+        {
+        MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: move operation and source file is read only -> skipping");
+        User::Leave( KErrAccessDenied );
+        }
+
+    TInt sourceDrive;
+    User::LeaveIfError( iCollection.iFs.CharToDrive( iSourcePath[0], sourceDrive ) );
+
+    if ( sourceDrive == iTargetDrive )
+        {
+        MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: source and target drives are the same, leaving with KErrAlreadyExists.");
+        CleanupStack::PopAndDestroy( video ); // <-1
+        User::Leave( KErrAlreadyExists );
+        }
+    
+    GenerateTargetPathForMoveOrCopyL( iSourcePath, iTargetPath, iTargetDrive );
+
+    MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: target path = %S", &iTargetPath );
+    
+    // update mds and cache
+    delete iMediaForMoveOp;
+    iMediaForMoveOp = NULL;
+    delete iMediaForCopyOp;
+    iMediaForCopyOp = NULL;
+
+    if ( iIsMoveOperation )
+        {
+        // Update existing media.
+        // Create new media object with only KMPXMediaGeneralId, and KMPXMediaGeneralUri
+        // attributes set, that way update is lighter operation.
+        iMediaForMoveOp = CMPXMedia::NewL();
+        iMediaForMoveOp->SetTObjectValueL<TMPXItemId>( KMPXMediaGeneralId,
+               video->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId ) );
+        iMediaForMoveOp->SetTextValueL( KMPXMediaGeneralUri, iTargetPath );
+        
+        iCollection.SetVideoL( *iMediaForMoveOp );
+        }
+    else
+        {
+        // Create new media.
+        iMediaForCopyOp = CMPXMedia::CopyL( *video );
+        iMediaForCopyOp->SetTextValueL( KMPXMediaGeneralUri, iTargetPath );
+        iCollection.AddVideoToMdsAndCacheL( *iMediaForCopyOp );
+        }
+ 
+     CleanupStack::PopAndDestroy( video ); // <-1           
+    }
+
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAsyncFileOperations::HandleFileCopyCompletedL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAsyncFileOperations::HandleFileCopyCompletedL( TInt aErr )
+    {
+    if ( aErr == KErrNone )
+        {
+        MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: Copy succeeded");
+        if ( iIsMoveOperation )
+            {
+            MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: move op: deleting source file");
+            aErr = BaflUtils::DeleteFile( iCollection.iFs, iSourcePath );
+            if ( aErr != KErrNone )
+                {
+                MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: delete for source file failed: %d", aErr );
+                }
+            }
+        }
+    else
+        {
+        MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: CopyFile failed: %d", aErr);
+        }
+    
+    // roll everything back if file operations failed
+    if ( aErr != KErrNone )
+        {
+        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<TMPXItemId>(
+                        KMPXMediaGeneralId ).iId1 );
+                }
+            else
+                {
+                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 )
+                {
+                MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: delete for target file failed: %d", delErr );
+                }
+            }
+        else
+            {
+            MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: copy failed %d", aErr );
+            MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: deleting the added media object and leaving");
+            iCollection.iMyVideosMdsDb->RemoveVideo( iMediaForCopyOp->ValueTObjectL<TMPXItemId>(
+                    KMPXMediaGeneralId ).iId1 );
+            }
+        }
+    
+    delete iMediaForMoveOp;
+    iMediaForMoveOp = NULL;    
+    delete iMediaForCopyOp;
+    iMediaForCopyOp = NULL;
+
+    User::LeaveIfError( aErr );
+    
+    }
+    
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAsyncFileOperations::DriveHasEnoughFreeSpaceL
+// ----------------------------------------------------------------------------
+//
+TBool CVcxMyVideosAsyncFileOperations::DriveHasEnoughFreeSpaceL( const TDesC& aPath, TInt aDrive )
+    {
+    TEntry entry;
+    User::LeaveIfError( iCollection.iFs.Entry( aPath, entry ) );
+    TUint32 size = static_cast<TUint32>( entry.iSize );
+    
+    TVolumeInfo volInfo;
+    User::LeaveIfError( iCollection.iFs.Volume( volInfo, aDrive ) );
+    
+    TInt64 freeSpace = volInfo.iFree;
+
+    const TInt K4MBSlack = 0x400000;
+
+    MPX_DEBUG3("CVcxMyVideosAsyncFileOperations:: space needed: %d, space available: %d", size + K4MBSlack,
+            freeSpace );
+    
+    if ( freeSpace < ( size + K4MBSlack ) )
+        {
+        MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: target drive does not have enough free space");
+        return EFalse;
+        }
+    else
+        {
+        return ETrue;
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAsyncFileOperations::GenerateTargetPathForMoveOrCopyL
+// ----------------------------------------------------------------------------
+//    
+void CVcxMyVideosAsyncFileOperations::GenerateTargetPathForMoveOrCopyL(
+        const TDesC& aSourcePath, TDes& aTargetPath, TInt aTargetDrive )
+    {
+    MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: source path = %S", &aSourcePath );
+    
+    aTargetPath.Zero();
+    
+    TChar targetDriveChar;
+    User::LeaveIfError( iCollection.iFs.DriveToChar( aTargetDrive, targetDriveChar ) );    
+    aTargetPath.Append( targetDriveChar );
+    aTargetPath.Append( ':' );
+    
+    TInt sourceDrive;
+    User::LeaveIfError( iCollection.iFs.CharToDrive( aSourcePath[0], sourceDrive ) );
+
+    TInt systemDrive = iCollection.iFs.GetSystemDrive();
+    
+    MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: source drive: %d", sourceDrive);
+    MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: target drive: %d", aTargetDrive);
+    MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: system drive: %d", systemDrive);
+
+    _LIT(KDataDes, "data");
+        
+    if ( sourceDrive == systemDrive )
+        {
+        //remove *:\data\* from the path
+        const TInt dataWordStartPos = 3;
+        const TInt dataWordLength   = 4;
+        
+        TPtrC pathData( aSourcePath.Mid( dataWordStartPos, dataWordLength ) );
+        MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: sourcePath.Mid(3,4)= %S", &pathData);
+
+        if ( pathData == KDataDes )
+            {
+            MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: source drive is system drive and 'data' exists in sourcePath");
+            MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: not copying 'data' to the target path");
+            
+            const TInt skipDataWordPos = 7;
+            aTargetPath.Append( aSourcePath.Mid( skipDataWordPos ) );
+            }
+        else
+            {
+            const TInt dontSkipDataWordPos = 2;
+            aTargetPath.Append( aSourcePath.Mid( dontSkipDataWordPos ) );
+            }
+        }    
+    else if ( aTargetDrive == systemDrive )
+        {
+        MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: target drive is system drive -> adding 'data' to path");
+        aTargetPath.Append( '\\' );
+        aTargetPath.Append( KDataDes );
+        aTargetPath.Append( aSourcePath.Mid( 2 ) );
+        }
+    else 
+        {
+        MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: source and target drives are not system drive, not adding or removing 'data'");        
+        aTargetPath.Append( aSourcePath.Mid( 2 ) );        
+        }
+    const TInt KMaxPathLength = 255;
+    TBuf<KMaxPathLength> uniquePath;
+    TVcxMyVideosCollectionUtil::MakeUniqueFileNameL( iCollection.iFs, aTargetPath, uniquePath );
+    aTargetPath = uniquePath;
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAsyncFileOperations::HandleDeleteStepL
+// ----------------------------------------------------------------------------
+//
+MVcxMyVideosActiveTaskObserver::TStepResult CVcxMyVideosAsyncFileOperations::HandleDeleteStepL()
+    {
+    // Reset inactivity timer. This will prevent ThumbAGDaemon start running while
+    // delete is ongoing and failing the operation due to locked file handle.
+    User::ResetInactivityTime();
+    
+    CMPXMedia& cmd = iCollection.iActiveTask->GetCommand();
+    
+    //no sanity checks for array items, since we want to generate all events, even if there is nothing to delete
+    
+    MVcxMyVideosActiveTaskObserver::TStepResult stepResult;
+    
+    TUint32 cmdId = cmd.ValueTObjectL<TUint32>( KVcxMediaMyVideosCommandId );    
+        
+    // Start operations
+    if ( iCurrentOperationIndex == 0 )
+        {
+        iOperationIdArray.Reset();
+
+        if ( cmd.IsSupported( KMPXMediaArrayContents ) )
+            {    
+            CMPXMediaArray* idMediaArray = cmd.Value<CMPXMediaArray>(
+                KMPXMediaArrayContents );
+                
+            TMPXItemId mpxId;
+            TInt count = idMediaArray->Count();
+            for ( TInt i = 0; i < count; i++ )
+                {
+                mpxId = idMediaArray->AtL( i )->
+                                ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId );
+                MPX_DEBUG3("CVcxMyVideosAsyncFileOperations:: MPX ID: (%d, %d) will be deleted ",
+                        mpxId.iId1,
+                        mpxId.iId2);
+                iOperationIdArray.AppendL( idMediaArray->AtL( i )->
+                        ValueTObjectL<TMPXItemId>(KMPXMediaGeneralId ).iId1 );
+                }
+
+            }
+                    
+        iCollection.SendMyVideosMessageL( KVcxMessageMyVideosDeleteStarted, &cmd );
+
+        iOperationResult.Reset();
+        }
+
+    if ( iOperationIdArray.Count() > 0 )
+        {
+        TRAPD( err, DeleteVideoL( iOperationIdArray[iCurrentOperationIndex] ) );
+        iOperationResult.AppendL( err );
+        }
+        
+    iCurrentOperationIndex++;
+    
+    // End operations
+    if ( iCurrentOperationIndex > (iOperationIdArray.Count() - 1) )
+        {
+        iCurrentOperationIndex = 0;
+        stepResult = MVcxMyVideosActiveTaskObserver::EDone;
+        SendOperationRespL( KVcxMessageMyVideosDeleteResp );
+        }
+    else
+        {
+        stepResult = MVcxMyVideosActiveTaskObserver::EMoreToCome;
+        }
+        
+    return stepResult;
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideoscategories.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,913 @@
+/*
+* 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 <mpxlog.h>
+#include <mpxmediacontainerdefs.h>
+#include <mpxmediageneraldefs.h>
+#include <mpxcollectionpluginobserver.h>
+#include <mpxmessagegeneraldefs.h>
+#include <mpxcommandgeneraldefs.h>
+#include <mpxcollectioncommanddefs.h>
+#include <mpxmessagecontainerdefs.h>
+#include "vcxmyvideoscollectionplugin.h"
+#include "vcxmyvideoscategories.h"
+#include "vcxmyvideoscollectionutil.h"
+#include "vcxmyvideosvideocache.h"
+#include "vcxmyvideosmessagelist.h"
+
+_LIT(KVcxMyVideosAllVideosCategoryText, "All videos");
+_LIT(KVcxMyVideosDownloadsCategoryText, "Downloads");
+_LIT(KVcxMyVideosTvRecordingsCategoryText, "TV recordings");
+_LIT(KVcxMyVideosCapturedVideosCategoryText, "Captured videos");
+_LIT(KVcxMyVideosOtherCategoryText, "Other");
+
+const TInt KVcxMyVideosAllVideosCategoryIndex    = 0;
+const TInt KVcxMyVideosDownloadsCategoryIndex    = 1;
+const TInt KVcxMyVideosTvRecordingsCategoryIndex = 2;
+const TInt KVcxMyVideosCapturedCategoryIndex     = 3;
+const TInt KVcxMyVideosOtherCategoryIndex        = 4;
+
+
+// ============================ MEMBER FUNCTIONS ==============================
+
+// ----------------------------------------------------------------------------
+// Two-phased constructor.
+// ----------------------------------------------------------------------------
+//
+CVcxMyVideosCategories* CVcxMyVideosCategories::NewL(
+    CVcxMyVideosCollectionPlugin& aCollection )
+    {
+    MPX_FUNC("CVcxMyVideosCategories::NewL");
+
+    CVcxMyVideosCategories* self = new (ELeave) CVcxMyVideosCategories( aCollection );
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// ----------------------------------------------------------------------------
+// Destructor.
+// ----------------------------------------------------------------------------
+//
+CVcxMyVideosCategories::~CVcxMyVideosCategories()
+    {
+    MPX_FUNC("CVcxMyVideosCategories::~CVcxMyVideosCategories");
+    
+    delete iList;
+    iModifiedCategories.Close();
+    }
+
+// ----------------------------------------------------------------------------
+// Constructor.
+// ----------------------------------------------------------------------------
+//
+CVcxMyVideosCategories::CVcxMyVideosCategories( CVcxMyVideosCollectionPlugin& aCollection )
+: iCollection( aCollection )
+    {
+    MPX_FUNC("CVcxMyVideosCategories::CVcxMyVideosCategories");
+    }
+
+// ----------------------------------------------------------------------------
+// Symbian 2nd phase constructor can leave.
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosCategories::ConstructL ()
+    {
+    MPX_FUNC("CVcxMyVideosCategories::ConstructL");
+    iList      = CreateCategoryListL();
+    iListArray = iList->Value<CMPXMediaArray>( KMPXMediaArrayContents );   
+
+    TInt categoryCount = iListArray->Count();
+    for ( TInt i = 0; i < categoryCount; i++ )
+        {
+        iModifiedCategories.Append( EFalse );
+        }
+
+    }
+    
+// ----------------------------------------------------------------------------------------------------------
+// CVcxMyVideosCategories::CreateCategoryListL
+// ----------------------------------------------------------------------------------------------------------
+//
+CMPXMedia* CVcxMyVideosCategories::CreateCategoryListL()
+    {
+    //first level
+
+    CMPXMedia* entries = TVcxMyVideosCollectionUtil::CreateEmptyMediaListL();
+    CleanupStack::PushL( entries ); // 1->
+    entries->SetTObjectValueL<TMPXItemId>(KMPXMediaGeneralId, 0 /*aPath.Id( 0 )*/);
+    CMPXMediaArray* entryArray = entries->Value<CMPXMediaArray>( KMPXMediaArrayContents );
+
+    AppendCategoryToArrayL( KVcxMyVideosAllVideosCategoryText,
+            TMPXItemId( KVcxMvcCategoryIdAll, 1), *entryArray );
+
+    AppendCategoryToArrayL( KVcxMyVideosDownloadsCategoryText,
+            TMPXItemId( KVcxMvcCategoryIdDownloads, 1 ), *entryArray );
+
+    AppendCategoryToArrayL( KVcxMyVideosTvRecordingsCategoryText,
+            TMPXItemId( KVcxMvcCategoryIdTvRecordings, 1 ), *entryArray );
+
+    AppendCategoryToArrayL( KVcxMyVideosCapturedVideosCategoryText,
+            TMPXItemId( KVcxMvcCategoryIdCaptured, 1), *entryArray );
+
+    AppendCategoryToArrayL( KVcxMyVideosOtherCategoryText,
+            TMPXItemId( KVcxMvcCategoryIdOther, 1 ), *entryArray );
+
+    entries->SetTObjectValueL( KMPXMediaArrayCount, entryArray->Count() );
+
+    CleanupStack::Pop( entries ); // <-1
+
+    return entries;
+    }
+
+// ----------------------------------------------------------------------------------------------------------
+// CVcxMyVideosCategories::AppendCategoryToArrayL
+// ----------------------------------------------------------------------------------------------------------
+//
+void CVcxMyVideosCategories::AppendCategoryToArrayL( const TDesC& aTitle, TMPXItemId aId,
+        CMPXMediaArray& aCategoryArray )
+    {
+    RArray<TInt> supportedIds;
+    CleanupClosePushL( supportedIds ); // 1->
+    supportedIds.AppendL( KMPXMediaIdGeneral );
+
+    CMPXMedia* category = CMPXMedia::NewL( supportedIds.Array() );
+    CleanupStack::PushL( category ); // 2->
+    category->SetTextValueL( KMPXMediaGeneralTitle, aTitle );
+    category->SetTObjectValueL( KMPXMediaGeneralId, aId );
+    category->SetTObjectValueL( KMPXMediaGeneralType, EMPXGroup );
+    category->SetTObjectValueL( KMPXMediaGeneralCategory, EMPXNoCategory );
+    category->SetTObjectValueL( KVcxMediaMyVideosCategoryItemCount, 0 );
+    category->SetTObjectValueL( KVcxMediaMyVideosCategoryNewItemCount, 0 );
+    aCategoryArray.AppendL( category );
+    CleanupStack::Pop( category );                // <-2
+    CleanupStack::PopAndDestroy( &supportedIds ); // <-1
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCategories::UpdateCategoriesL
+// Called by iCollection when fetching the video list from mds incrementally.
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosCategories::UpdateCategoriesL( CMPXMedia& aVideoList,
+        TInt aNewItemsStartIndex )
+    {    
+    CMPXMediaArray* categoryArray = iList->Value<CMPXMediaArray>( KMPXMediaArrayContents );
+    TInt categoryCount            = categoryArray->Count();
+
+    RArray<TInt> videosIncrements;
+    videosIncrements.Reset();
+    CleanupClosePushL( videosIncrements ); // 1->
+
+    RArray<TInt> newVideosIncrements;
+    newVideosIncrements.Reset();
+    CleanupClosePushL( newVideosIncrements ); // 2->
+
+    TInt i;
+    videosIncrements.ReserveL( categoryCount );
+    newVideosIncrements.ReserveL( categoryCount );
+    for ( i = 0; i < categoryCount; i++ )
+        {
+        videosIncrements.AppendL( 0 );
+        newVideosIncrements.Append( 0 );
+        }
+
+    CMPXMediaArray* videoListArray = aVideoList.Value<CMPXMediaArray>( KMPXMediaArrayContents );
+    TInt videoListCount            = videoListArray->Count();
+
+    videosIncrements[KVcxMyVideosAllVideosCategoryIndex] = videoListCount - aNewItemsStartIndex;
+    
+    CMPXMedia* media;
+    for ( i = aNewItemsStartIndex; i < videoListCount; i++ )
+        {
+        TUint8 origin = EVcxMyVideosOriginOther;
+        
+        media = videoListArray->AtL( i );
+        
+        origin = TVcxMyVideosCollectionUtil::OriginL( *media );
+                
+        TBool newVideo = EFalse;
+        TUint32 flags  = 0;
+        
+        if ( media->IsSupported( KMPXMediaGeneralFlags ) )
+            {
+            flags = media->ValueTObjectL<TUint32>( KMPXMediaGeneralFlags );
+            if ( flags & EVcxMyVideosVideoNew )
+                {
+                newVideo = ETrue;
+                newVideosIncrements[KVcxMyVideosAllVideosCategoryIndex]++;
+                }
+            }
+        
+        switch ( origin )
+            {
+            case EVcxMyVideosOriginDownloaded:
+                videosIncrements[KVcxMyVideosDownloadsCategoryIndex]++;
+                if ( newVideo )
+                    {
+                    newVideosIncrements[KVcxMyVideosDownloadsCategoryIndex]++;
+                    }
+                break;
+                
+            case EVcxMyVideosOriginCapturedWithCamera:
+                videosIncrements[KVcxMyVideosCapturedCategoryIndex]++;
+                if ( newVideo )
+                    {
+                    newVideosIncrements[KVcxMyVideosCapturedCategoryIndex]++;
+                    }
+                break;
+                                
+            case EVcxMyVideosOriginTvRecording:
+                videosIncrements[KVcxMyVideosTvRecordingsCategoryIndex]++;
+                if ( newVideo )
+                    {
+                    newVideosIncrements[KVcxMyVideosTvRecordingsCategoryIndex]++;
+                    }
+                break;
+
+            case EVcxMyVideosOriginSideLoaded:                
+            case EVcxMyVideosOriginOther:
+            default:
+                videosIncrements[KVcxMyVideosOtherCategoryIndex]++;
+                if ( newVideo )
+                    {
+                    newVideosIncrements[KVcxMyVideosOtherCategoryIndex]++;
+                    }
+                break;
+            }
+        }
+
+    // Update videos counts
+    UpdateVideosCountL( *categoryArray, videosIncrements,
+                        newVideosIncrements, !aNewItemsStartIndex );
+
+    CleanupStack::PopAndDestroy( &newVideosIncrements ); // <-1
+    CleanupStack::PopAndDestroy( &videosIncrements ); // <-1
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCategories::UpdateVideosCountL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosCategories::UpdateVideosCountL( CMPXMediaArray& aCategoryArray,
+    RArray<TInt>& aVideosIncrements, RArray<TInt>& aNewVideosIncrements,
+    TBool aForceUpdate  )
+    {
+    TBool modified = EFalse;
+    TInt categoryCount = aCategoryArray.Count();
+    CMPXMedia* category;
+    
+    for ( TInt i = 0; i < categoryCount; i++ )
+        {
+        if ( aForceUpdate || aVideosIncrements[i] != 0 )
+            {
+            category = aCategoryArray.AtL( i );
+
+            //codescanner warning: aVideosIncrements count is same as aCategoryArray count, so the range is checked
+            UpdateVideosCountL( *category, aVideosIncrements[i],
+                    KVcxMediaMyVideosCategoryItemCount, EVcxMyVideosListNoInfo );
+
+            modified = ETrue;
+            }
+
+        //codescanner warning: aNewVideosIncrements count is same as aCategoryArray count, so the range is checked
+        if (  aForceUpdate || aNewVideosIncrements[i] != 0 )
+            {
+            category = aCategoryArray.AtL( i );
+
+            UpdateVideosCountL( *category, aNewVideosIncrements[i],
+                    KVcxMediaMyVideosCategoryNewItemCount, EVcxMyVideosListNoInfo );
+
+            modified = ETrue;
+            }
+
+        }
+    if ( modified )
+        {
+        iCollection.iMessageList->SendL();
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCategories::UpdateVideosCountL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosCategories::UpdateVideosCountL( CMPXMedia& aCategory,
+    TInt aIncrement, TMPXAttributeData aCountAttribute, TInt aEventInfo )
+    {
+    if ( aIncrement != 0 )
+        {
+        AddToTUint32AttributeL( aCategory, aIncrement, aCountAttribute );
+        }
+    iCollection.iMessageList->AddEventL( aCategory.ValueTObjectL<TMPXItemId>(
+            KMPXMediaGeneralId ), EMPXItemModified, aEventInfo );
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCategories::VideosAddedL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosCategories::VideosAddedL( RArray<TUint32>& aIds )
+    {
+    VideosAddedOrRemovedL( aIds, ETrue );
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCategories::VideosRemovedL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosCategories::VideosRemovedL( RArray<TUint32>& aIds )
+    {
+    VideosAddedOrRemovedL( aIds, EFalse );
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCategories::VideoAddedL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosCategories::VideoAddedL( TUint32 aMdsId )
+    {
+    TInt pos( KErrNotFound );
+    CMPXMedia* video = iCollection.iCache->FindVideoByMdsIdL( aMdsId, pos );
+    if ( pos != KErrNotFound )
+        {
+        VideoAddedOrRemovedL( *video, ETrue );
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCategories::VideoAddedL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosCategories::VideoAddedL( CMPXMedia& aVideo )
+    {
+    VideoAddedOrRemovedL( aVideo, ETrue );
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCategories::VideoRemovedL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosCategories::VideoRemovedL( TUint32 aMdsId )
+    {
+    TInt pos( KErrNotFound );
+    CMPXMedia* video = iCollection.iCache->FindVideoByMdsIdL( aMdsId, pos );
+    if ( pos != KErrNotFound )
+        {
+        VideoAddedOrRemovedL( *video, EFalse );
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCategories::VideoRemovedL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosCategories::VideoRemovedL( CMPXMedia& aVideo )
+    {
+    VideoAddedOrRemovedL( aVideo, EFalse );
+    }
+    
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCategories::VideosAddedOrRemovedL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosCategories::VideosAddedOrRemovedL(
+        RArray<TUint32>& aIds, TBool aAdded )
+    {
+    TInt count = aIds.Count();
+    for ( TInt i = 0; i < count; i++ )
+        {
+        VideoAddedOrRemovedL( aIds[i], aAdded );
+        }
+    }
+    
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCategories::VideoAddedOrRemovedL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosCategories::VideoAddedOrRemovedL( TUint32 aMdsId, TBool aAdded )
+    {    
+    TInt pos( KErrNotFound );
+    CMPXMedia* video = iCollection.iCache->FindVideoByMdsIdL( aMdsId, pos );
+    if ( pos != KErrNotFound )
+        {
+        VideoAddedOrRemovedL( *video, aAdded );
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCategories::VideoAddedOrRemovedL
+// All remove&add calls eventually come here.
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosCategories::VideoAddedOrRemovedL( CMPXMedia& aVideo, TBool aAdded )
+    {
+    MPX_FUNC("CVcxMyVideosCategories::VideoAddedOrRemovedL()");
+
+    ResetModifiedCategoriesArray();
+
+    TInt categoryIndex  = CategoryIndex( TVcxMyVideosCollectionUtil::OriginL( aVideo ) );
+    CMPXMedia* category = iListArray->AtL( categoryIndex );
+    // every event updates always 2 categories, all and something else
+    UpdateCategoryL( *category, categoryIndex, aVideo, aAdded );
+
+    //iMessageArray will discard duplicates
+    AddEventsFromModifiedCategoriesArrayL();
+    }
+    
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCategories::UpdateCategoryL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosCategories::UpdateCategoryL( CMPXMedia& aCategory, TInt aCategoryIndex,
+        CMPXMedia& aVideo, TBool aAdded )
+    {
+    MPX_FUNC("CVcxMyVideosCategories::UpdateCategoryL");
+
+    TInt addition = 0;
+    
+    if ( aAdded )
+        {
+        MPX_DEBUG1("CVcxMyVideosCategories:: video added");
+        if ( TVcxMyVideosCollectionUtil::FlagsL( aVideo ) & EVcxMyVideosVideoNew )
+            {
+            TInt64 newItemsDate = TVcxMyVideosCollectionUtil::CreationDateL( aVideo );
+            TInt64 prevNewDate  = TVcxMyVideosCollectionUtil::CreationDateL( aCategory );
+
+            if ( static_cast<TInt64>(newItemsDate) > static_cast<TInt64>(prevNewDate) )
+                {                    
+                MPX_DEBUG1("CVcxMyVideosCategories:: EMPXItemInserted -> changing new video name");
+                aCategory.SetTextValueL( KVcxMediaMyVideosCategoryNewItemName,
+                        aVideo.ValueText( KMPXMediaGeneralTitle ) );
+                aCategory.SetTObjectValueL( KMPXMediaGeneralDate, newItemsDate ); 
+                iListArray->AtL( KVcxMyVideosAllVideosCategoryIndex)->SetTextValueL(
+                        KVcxMediaMyVideosCategoryNewItemName,
+                        aVideo.ValueText( KMPXMediaGeneralTitle ) );
+                iListArray->AtL( KVcxMyVideosAllVideosCategoryIndex)->SetTObjectValueL(
+                        KMPXMediaGeneralDate, newItemsDate );
+                iModifiedCategories[aCategoryIndex]                     = ETrue;
+                iModifiedCategories[KVcxMyVideosAllVideosCategoryIndex] = ETrue;
+                }
+            }
+        addition = 1;
+        }
+    else
+        {
+        MPX_DEBUG1("CVcxMyVideosCategories:: video deleted");
+
+        TBool modified = EFalse;
+        RArray<TUint32> ignoredIds;
+        ignoredIds.Reset();
+        CleanupClosePushL( ignoredIds ); // 1->
+        if ( !aAdded )
+            {
+            ignoredIds.AppendL( TVcxMyVideosCollectionUtil::IdL( aVideo ) );
+            }
+        UpdateCategoryNewVideoNameAndDateL( -1 /* -1 origin resolves to All category */,
+                modified, ignoredIds );
+        UpdateCategoryNewVideoNameAndDateL( TVcxMyVideosCollectionUtil::OriginL( aVideo ),
+                modified, ignoredIds );
+        CleanupStack::PopAndDestroy( &ignoredIds ); // <-1
+
+        if ( modified )
+            {
+            iModifiedCategories[aCategoryIndex]                     = ETrue;
+            iModifiedCategories[KVcxMyVideosAllVideosCategoryIndex] = ETrue;
+            }
+            
+        addition = -1;
+        }
+        
+    
+    if ( addition != 0 )
+        {
+        AddToTUint32AttributeL( aCategory, addition, KVcxMediaMyVideosCategoryItemCount );
+        AddToTUint32AttributeL( *(iListArray->AtL( KVcxMyVideosAllVideosCategoryIndex) ),
+                addition, KVcxMediaMyVideosCategoryItemCount );
+        if ( TVcxMyVideosCollectionUtil::FlagsL( aVideo ) & EVcxMyVideosVideoNew )
+            {
+            AddToTUint32AttributeL( aCategory, addition, KVcxMediaMyVideosCategoryNewItemCount );
+            AddToTUint32AttributeL( *(iListArray->AtL( KVcxMyVideosAllVideosCategoryIndex) ),
+                    addition, KVcxMediaMyVideosCategoryNewItemCount );
+            }
+        iModifiedCategories[aCategoryIndex]                     = ETrue;
+        iModifiedCategories[KVcxMyVideosAllVideosCategoryIndex] = ETrue;
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCategories::AddToTUint32AttributeL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosCategories::AddToTUint32AttributeL( CMPXMedia& aCategory, TInt aAddition,
+        TMPXAttributeData aAttribute )
+    {
+    TUint32 previousCount = 0;
+    if ( aCategory.IsSupported( aAttribute ) )
+        {
+        previousCount = aCategory.ValueTObjectL<TUint32>( aAttribute );
+        }
+    
+    TInt totalCount = previousCount + aAddition;
+    if ( totalCount < 0 )
+        {
+        totalCount = 0;
+        }
+    aCategory.SetTObjectValueL<TUint32>( aAttribute, totalCount );
+
+    MPX_DEBUG2("CVcxMyVideosCategories::AddToTUint32AttributeL() attribute(%x): ", aAttribute );
+    MPX_DEBUG3("CVcxMyVideosCategories::AddToTUint32AttributeL() %d -> %d", previousCount, totalCount);
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCategories::CategoryIndex
+// ----------------------------------------------------------------------------
+//
+TInt CVcxMyVideosCategories::CategoryIndex( TInt aOrigin )
+    {
+    switch ( aOrigin )
+        {
+        case -1:
+            return KVcxMyVideosAllVideosCategoryIndex;
+                        
+        case EVcxMyVideosOriginCapturedWithCamera:
+            return KVcxMyVideosCapturedCategoryIndex;
+                            
+        case EVcxMyVideosOriginDownloaded:
+#ifdef VCX_DOWNLOADS_CATEGORY
+            return KVcxMyVideosDownloadsCategoryIndex;
+#endif
+        case EVcxMyVideosOriginTvRecording:
+        case EVcxMyVideosOriginSideLoaded:                
+        case EVcxMyVideosOriginOther:
+        default:
+            return KVcxMyVideosOtherCategoryIndex;
+        }
+    }     
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCategories::NewVideoFlagChangedL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosCategories::NewVideoFlagChangedL( TUint32 aOldFlag, TUint32 aNewFlag,
+        TUint8 aOrigin, TBool& aModified )
+    {
+    CMPXMedia* categoryAll;
+    CMPXMedia* categoryByOrigin;
+    TBool modified = EFalse;
+    
+    if ( (aOldFlag & EVcxMyVideosVideoNew) && !(aNewFlag & EVcxMyVideosVideoNew) )
+        {
+        // new flag cleared -> update counters
+        categoryByOrigin = iListArray->AtL( CategoryIndex( aOrigin ) );
+        AddToTUint32AttributeL( *categoryByOrigin, -1, KVcxMediaMyVideosCategoryNewItemCount );
+        categoryAll = iListArray->AtL( KVcxMyVideosAllVideosCategoryIndex );
+        AddToTUint32AttributeL( *categoryAll, -1, KVcxMediaMyVideosCategoryNewItemCount );
+        aModified = ETrue;
+        modified  = ETrue;
+        } 
+    else if ( !(aOldFlag & EVcxMyVideosVideoNew) && (aNewFlag & EVcxMyVideosVideoNew) )
+        {
+        // new flag set -> update counters
+        categoryByOrigin = iListArray->AtL( CategoryIndex( aOrigin ) );
+        AddToTUint32AttributeL( *categoryByOrigin, 1, KVcxMediaMyVideosCategoryNewItemCount );
+        categoryAll = iListArray->AtL( KVcxMyVideosAllVideosCategoryIndex );
+        AddToTUint32AttributeL( *categoryAll, 1, KVcxMediaMyVideosCategoryNewItemCount );
+        aModified = ETrue;
+        modified  = ETrue;
+        }
+        
+    if ( modified )
+        {
+        TMPXItemId mpxId( categoryByOrigin->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId ) );
+        iCollection.iMessageList->AddEventL( mpxId, EMPXItemModified );
+
+        mpxId = categoryAll->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId );
+        iCollection.iMessageList->AddEventL( mpxId, EMPXItemModified );
+        } 
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCategories::ResetVideoCountersL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosCategories::ResetVideoCountersL()
+    {
+    TInt count = iListArray->Count();
+    
+    for ( TInt i = 0; i < count; i++ )
+        {
+        iListArray->AtL( i )->SetTObjectValueL<TUint32>(
+                KVcxMediaMyVideosCategoryNewItemCount, 0 );
+        iListArray->AtL( i )->SetTObjectValueL<TUint32>(
+                KVcxMediaMyVideosCategoryItemCount, 0 );
+        }
+    }
+
+/*
+
+New video name generation:
+
+1. When new video list is created: calculate new video names from scratch at the end of list creation.
+2. Item is removed (mds remove event): calculate from scratch to the categories which are affected.
+3. Item is added (mds add event): If new item && date is newer than previous -> put it to categories which are affected.
+4. Items new flag is modified: calculate from scratch to the categories which are affected.
+5. Items title is modified: calculate from scratch to the categories which are affected.
+*/
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCategories::UpdateCategoriesNewVideoNamesL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosCategories::UpdateCategoriesNewVideoNamesL()
+    {
+    MPX_FUNC("CVcxMyVideosCategories::UpdateCategoriesNewVideoNamesL");
+    
+    RArray<TUint32> ignoredIds;
+    ignoredIds.Reset();
+    CleanupClosePushL( ignoredIds ); // 1->
+    TBool modified = EFalse;
+    UpdateCategoryNewVideoNameAndDateL( -1 /* all category */, modified, ignoredIds );
+    UpdateCategoryNewVideoNameAndDateL( EVcxMyVideosOriginCapturedWithCamera, modified,
+            ignoredIds );
+    UpdateCategoryNewVideoNameAndDateL( EVcxMyVideosOriginDownloaded, modified, ignoredIds );
+    UpdateCategoryNewVideoNameAndDateL( EVcxMyVideosOriginTvRecording, modified, ignoredIds );
+    UpdateCategoryNewVideoNameAndDateL( EVcxMyVideosOriginOther, modified, ignoredIds );
+    CleanupStack::PopAndDestroy( &ignoredIds ); // <-1
+    
+    if ( modified )
+        {
+        // flush event list
+        MPX_DEBUG1("CVcxMyVideosCategories:: sending event list");
+        iCollection.iMessageList->SendL();
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCategories::UpdateCategoryNewVideoNameAndDateL
+// ----------------------------------------------------------------------------
+//    
+void CVcxMyVideosCategories::UpdateCategoryNewVideoNameAndDateL( TInt aOrigin, TBool& aModified,
+        RArray<TUint32>& aIgnoredIds )
+    {   
+    MPX_FUNC("CVcxMyVideosCategories::UpdateCategoryNewVideoNameAndDateL");
+
+    TPtrC prevNewVideoName;
+    TPtrC currentNewVideoName;
+    
+    CMPXMedia* videoList = iCollection.iCache->iVideoList;
+    
+    TInt categoryIndex = CategoryIndex( aOrigin );
+     
+    prevNewVideoName.Set( iListArray->AtL( categoryIndex )->ValueText(
+            KVcxMediaMyVideosCategoryNewItemName ) );
+    CMPXMedia* newVideo;
+    currentNewVideoName.Set( CalculateNewVideoNameL(
+            *videoList, aOrigin, aIgnoredIds, newVideo ) );
+    if ( currentNewVideoName.CompareF( prevNewVideoName ) != 0 )
+        {
+        iListArray->AtL( categoryIndex )->SetTextValueL(
+                KVcxMediaMyVideosCategoryNewItemName, currentNewVideoName );
+        MPX_DEBUG3("CVcxMyVideosCategories:: Category[%d] New Video Name changed to %S",
+                categoryIndex, &currentNewVideoName);
+
+        if ( newVideo )
+            {
+            TInt64 newDate( 0 );
+            if ( newVideo->IsSupported( KMPXMediaGeneralDate ) )
+                {
+                newDate = newVideo->ValueTObjectL<TInt64>( KMPXMediaGeneralDate );
+                }
+                
+            iListArray->AtL( categoryIndex )->SetTObjectValueL( KMPXMediaGeneralDate, newDate );
+            }
+        else
+            {
+            iListArray->AtL( categoryIndex )->SetTObjectValueL( KMPXMediaGeneralDate, 0 );
+            }
+            
+        MPX_DEBUG1("CVcxMyVideosCategories:: adding event");
+        
+        TMPXItemId mpxId = iListArray->AtL( categoryIndex )->ValueTObjectL<TMPXItemId>(
+                KMPXMediaGeneralId );
+        iCollection.iMessageList->AddEventL( mpxId, EMPXItemModified );
+
+        aModified = ETrue;
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCategories::CalculateNewVideoNameL
+// ----------------------------------------------------------------------------
+//    
+const TDesC& CVcxMyVideosCategories::CalculateNewVideoNameL( CMPXMedia& aVideoList,
+        TInt aOrigin, RArray<TUint32>& aIgnoredIds, CMPXMedia*& aNewVideo )
+    {
+    MPX_FUNC("CVcxMyVideosCategories::CalculateNewVideoNameL");
+
+    if ( aOrigin == EVcxMyVideosOriginSideLoaded )
+        {
+        aOrigin = EVcxMyVideosOriginOther;
+        }
+        
+    CMPXMediaArray* videoArray = aVideoList.Value<CMPXMediaArray>(
+            KMPXMediaArrayContents );
+    
+    TInt64 latestCreationDate = 0;
+    TInt64 currentItemsCreationDate;
+    TInt currentLatestItemIndex   = -1;
+    TUint8 origin;
+    TUint32 flags;
+    CMPXMedia* video;
+    TInt count = videoArray->Count();
+    for ( TInt i = 0; i < count; i++ )
+        {
+        video = videoArray->AtL( i );
+
+        // Handle only items which are not on ignore list (aIgnoredIds).
+        // Items on ignore list are going to be deleted, they just hang around
+        // on the list at this point.
+        if ( aIgnoredIds.Find( video->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId ).iId1 )
+                == KErrNotFound )
+            {
+            // IsSupported check omitted since this value should be set always
+            flags = video->ValueTObjectL<TUint32>( KMPXMediaGeneralFlags );
+            if ( flags & EVcxMyVideosVideoNew )
+                {
+                origin = TVcxMyVideosCollectionUtil::OriginL( *video );
+                if ( aOrigin == -1 || aOrigin == origin )
+                    {
+                    currentItemsCreationDate = video->ValueTObjectL<TInt64>(
+                            KMPXMediaGeneralDate ); 
+                    if ( latestCreationDate < currentItemsCreationDate )
+                        {
+                        latestCreationDate     = currentItemsCreationDate;
+                        currentLatestItemIndex = i;
+                        aNewVideo              = video;
+                        }
+                    }
+                }
+            }
+        else
+            {
+            MPX_DEBUG1("CVcxMyVideosCategories:: item is on ignore list, skipping");
+            }
+        }
+
+    if ( currentLatestItemIndex == -1 )
+        {
+        aNewVideo = NULL;
+        return KNullDesC;
+        }
+    else
+        {
+        MPX_DEBUG2("CVcxMyVideosCategories:: returning %S",
+                &videoArray->AtL( currentLatestItemIndex )->ValueText( KMPXMediaGeneralTitle ) );
+        return videoArray->AtL( currentLatestItemIndex )->ValueText( KMPXMediaGeneralTitle );
+        }
+        
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCategories::UpdateCategoryNewVideoNameAndDateL
+// Called when video is updated in a way that it affects category new
+// video name.
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosCategories::UpdateCategoryNewVideoNameAndDateL( CMPXMedia& aVideo,
+        TBool& aModified )
+    {
+    //       mpx items for current category new video names should be saved and used to
+    //       speed up this func
+    
+    TBool modified = EFalse;
+    RArray<TUint32> ignoredIds;
+    ignoredIds.Reset();
+    CleanupClosePushL( ignoredIds ); // 1->
+    UpdateCategoryNewVideoNameAndDateL( -1 /* -1 origin resolves to All category */, modified,
+            ignoredIds );
+    UpdateCategoryNewVideoNameAndDateL( TVcxMyVideosCollectionUtil::OriginL( aVideo ), modified,
+            ignoredIds );
+
+    if ( modified )
+        {
+        aModified = ETrue;
+        }
+    CleanupStack::PopAndDestroy( &ignoredIds ); // <-1
+    }
+
+// ----------------------------------------------------------------------------
+// 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 )
+    {
+    TMPXItemId mpxId = iListArray->AtL( 0 /* All category*/ )->ValueTObjectL<TMPXItemId>(
+            KMPXMediaGeneralId );
+    
+    MPX_DEBUG2("CVcxMyVideosCategories:: adding modify event for category[0], extra info = %d", aExtraInfo );
+    iCollection.iMessageList->AddEventL( mpxId, EMPXItemModified, aExtraInfo );
+    mpxId = iListArray->AtL( CategoryIndex(
+            TVcxMyVideosCollectionUtil::OriginL( aMedia ) ) )->ValueTObjectL<TMPXItemId>(
+            KMPXMediaGeneralId );
+
+    MPX_DEBUG3("CVcxMyVideosCategories:: adding modify event for category[%d], extra info = %d", mpxId.iId1, aExtraInfo );
+    iCollection.iMessageList->AddEventL( mpxId, EMPXItemModified, aExtraInfo );
+
+    if ( aFlushMessageList )
+        {
+        iCollection.iMessageList->SendL();
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCategories::OriginChangedL
+// Called when videos origin is changed (Video moves from one category to other).
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosCategories::OriginChangedL( CMPXMedia& aVideo, TUint8 aPrevOrigin,
+        TUint8 aNewOrigin )
+    {
+    CMPXMediaArray* categoryArray = iList->Value<CMPXMediaArray>( KMPXMediaArrayContents );
+
+    UpdateVideosCountL( *(categoryArray->AtL( CategoryIndex( aPrevOrigin ) )),
+            -1, KVcxMediaMyVideosCategoryItemCount, EVcxMyVideosVideoListOrderChanged ); //event added but not sent
+
+    UpdateVideosCountL( *(categoryArray->AtL( CategoryIndex( aNewOrigin ) )),
+            1, KVcxMediaMyVideosCategoryItemCount, EVcxMyVideosVideoListOrderChanged ); //event added but not sent
+
+    if ( TVcxMyVideosCollectionUtil::FlagsL( aVideo ) & EVcxMyVideosVideoNew )
+        {
+        UpdateVideosCountL( *(categoryArray->AtL( CategoryIndex( aPrevOrigin ) )),
+                -1, KVcxMediaMyVideosCategoryNewItemCount, EVcxMyVideosVideoListOrderChanged ); //this event will be optimized away at iCollection.iMessageList
+
+        UpdateVideosCountL( *(categoryArray->AtL( CategoryIndex( aNewOrigin ) )),
+                1, KVcxMediaMyVideosCategoryNewItemCount, EVcxMyVideosVideoListOrderChanged ); //this event will be optimized away at iCollection.iMessageList
+        }
+    
+    RArray<TUint32> ignoredIds;
+    ignoredIds.Reset();
+    CleanupClosePushL( ignoredIds ); // 1->
+    TBool modified = EFalse;
+    UpdateCategoryNewVideoNameAndDateL( aPrevOrigin, modified, ignoredIds );
+    UpdateCategoryNewVideoNameAndDateL( aNewOrigin, modified, ignoredIds );
+
+    CleanupStack::PopAndDestroy( &ignoredIds ); // <-1
+    iCollection.iMessageList->SendL();
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCategories::ResetModifiedCategoriesArray
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosCategories::ResetModifiedCategoriesArray()
+    {
+    TInt count = iModifiedCategories.Count();
+    for ( TInt i = 0; i < count; i++ )
+        {
+        iModifiedCategories[i] = EFalse;
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCategories::AddEventsFromModifiedCategoriesArrayL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosCategories::AddEventsFromModifiedCategoriesArrayL()
+    {
+    TMPXItemId mpxId;
+    TInt count = iModifiedCategories.Count();
+    for ( TInt i = 0; i < count; i++ )
+        {
+        if ( iModifiedCategories[i] )
+            {
+            MPX_DEBUG2("CVcxMyVideosCategories:: category[%d] modified, adding event.", i);
+            mpxId = iListArray->AtL(i)->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId );
+            iCollection.iMessageList->AddEventL( mpxId, EMPXItemModified );
+            }
+        }
+    }
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideoscollectionplugin.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,1094 @@
+/*
+* 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 of My Videos collection Plugin interface*
+*/
+
+
+
+// INCLUDE FILES
+#include <e32cmn.h>
+#include <s32mem.h>
+#include <mpxlog.h>
+#include <mpxmediacontainerdefs.h>
+#include <mpxmediageneraldefs.h>
+#include <mpxmediageneralextdefs.h>
+#include <mpxcollectionpluginobserver.h>
+#include <mpxmessagegeneraldefs.h>
+#include <mpxcommandgeneraldefs.h>
+#include <mpxcollectioncommanddefs.h>
+#include <mpxmessagecontainerdefs.h>
+#include <vcxmyvideosuids.h>
+#include <drmutility.h>
+#include <bautils.h>
+#include "vcxmyvideoscollectionplugin.h"
+#include "vcxmyvideoscollection.hrh"
+#include "vcxmyvideoscollectionutil.h"
+#include "vcxmyvideosvideocache.h"
+#include "vcxmyvideoscategories.h"
+#include "vcxmyvideosmessagelist.h"
+#include "vcxmyvideosasyncfileoperations.h"
+#include "vcxmyvideosopenhandler.h"
+#include "vcxmyvideosmdsalbums.h"
+#include "vcxmyvideosalbums.h"
+
+
+// ============================ MEMBER FUNCTIONS ==============================
+
+// ----------------------------------------------------------------------------
+// Two-phased constructor.
+// ----------------------------------------------------------------------------
+//
+CVcxMyVideosCollectionPlugin* CVcxMyVideosCollectionPlugin::NewL(
+    TAny* /* aInitParams */)
+    {
+    MPX_FUNC("CVcxMyVideosCollectionPlugin::NewL");
+
+    CVcxMyVideosCollectionPlugin* self = new (ELeave) CVcxMyVideosCollectionPlugin();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// ----------------------------------------------------------------------------
+// Destructor.
+// ----------------------------------------------------------------------------
+//
+CVcxMyVideosCollectionPlugin::~CVcxMyVideosCollectionPlugin()
+    {
+    MPX_FUNC("CVcxMyVideosCollectionPlugin::~CVcxMyVideosCollectionPlugin");
+    MPX_DEBUG2("CVcxMyVideosCollectionPlugin:: this = %x", this);
+        
+    delete iMyVideosMdsDb;
+    delete iCache;
+    delete iMessageList;
+    delete iCategories;
+    delete iAsyncFileOperations;
+    delete iActiveTask;
+    delete iOpenHandler;
+    delete iAlbums;
+    iFs.Close();
+    }
+
+// ----------------------------------------------------------------------------
+// Constructor.
+// ----------------------------------------------------------------------------
+//
+CVcxMyVideosCollectionPlugin::CVcxMyVideosCollectionPlugin()
+    {
+    MPX_FUNC("CVcxMyVideosCollectionPlugin::CVcxMyVideosCollectionPlugin");
+    MPX_DEBUG2("CVcxMyVideosCollectionPlugin:: this = %x", this);
+    }
+
+// ----------------------------------------------------------------------------
+// Symbian 2nd phase constructor can leave.
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosCollectionPlugin::ConstructL ()
+    {
+    MPX_FUNC("CVcxMyVideosCollectionPlugin::ConstructL");
+    
+    User::LeaveIfError( iFs.Connect() );
+#ifndef VCX_ALBUMS        
+    iMyVideosMdsDb = CVcxMyVideosMdsDb::NewL( this, iFs );    
+#else
+    iMyVideosMdsDb = CVcxMyVideosMdsDb::NewL( this, iFs, &AlbumsL() );
+#endif
+    iActiveTask    = CVcxMyVideosActiveTask::NewL( *this );
+    iCache         = CVcxMyVideosVideoCache::NewL( *this );
+    iMessageList   = CVcxMyVideosMessageList::NewL( *this );
+    iOpenHandler   = CVcxMyVideosOpenHandler::NewL( *this, *iCache, *iMyVideosMdsDb );
+    }
+
+// ----------------------------------------------------------------------------
+// Navigates to the given path
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosCollectionPlugin::OpenL(
+    const CMPXCollectionPath& aPath,
+    const TArray<TMPXAttribute>& /* aAttrs */,
+    CMPXFilter* /*aFilter*/)
+    {
+    iOpenHandler->OpenL( aPath );
+    }
+
+// ----------------------------------------------------------------------------
+// Get the extended properties of the current file (async)
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosCollectionPlugin::MediaL(
+    const CMPXCollectionPath& aPath,
+    const TArray<TMPXAttribute>& aAttrs,
+    const TArray<TCapability>& /*aCaps*/,
+    CMPXAttributeSpecs* /*aSpecs*/)
+    {
+    MPX_FUNC("CVcxMyVideosCollectionPlugin::MediaL");
+    MPX_DEBUG_PATH(aPath);
+    
+    RArray<TInt> supportedIds;
+    CleanupClosePushL( supportedIds ); // 1->
+
+    if ( aPath.Selection().Count() > 1 )
+        {
+        // it's a container if there are multiple selections, else it's not a container
+        //supportedIds.AppendL(KMPXMediaIdContainer);
+        //multiple selections not supported yet
+        CleanupStack::PopAndDestroy( &supportedIds ); // <-1
+        iObs->HandleMedia( NULL, KErrNotSupported );
+        return;
+        }
+
+    RArray<TMPXItemId> ids;
+    CleanupClosePushL(ids); // 2->
+
+    aPath.SelectionL( ids );
+    
+    // MPX playback server asks it by path without selecting the media.
+    if ( ids.Count() == 0 && aPath.Id() != KMPXInvalidItemId )
+        {
+        CMPXCollectionPath* path = CMPXCollectionPath::NewL( aPath );
+        CleanupStack::PushL( path );
+        path->SelectL( aPath.Id() );
+        path->SelectionL( ids );
+        CleanupStack::PopAndDestroy( path );
+        }
+
+    if ( ids.Count() == 0 )
+        {
+        MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: request didn't contain any items ids, aborting");
+        
+        iObs->HandleMedia( NULL, KErrArgument );
+        CleanupStack::PopAndDestroy( &ids );          // <-2
+        CleanupStack::PopAndDestroy( &supportedIds ); // <-1
+        return;
+        }
+        
+    TBool useCachedVideo( EFalse );
+
+    TInt pos;
+    CMPXMedia* videoInCache = iCache->FindVideoByMdsIdL( ids[0].iId1, pos );
+    
+    if ( videoInCache )
+        {
+        // 0 attributes means "get all" -> can't use cache
+        MPX_DEBUG2("CVcxMyVideosCollectionPlugin:: client is requesting %d attributes", aAttrs.Count());
+        if ( aAttrs.Count() > 0 )
+            {
+            TBool nonSupportedAttrCanBeFoundFromMds;
+            if ( TVcxMyVideosCollectionUtil::AreSupported( *videoInCache, aAttrs,
+                    nonSupportedAttrCanBeFoundFromMds ) )
+                {
+                MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: all attributes found from cache");
+                useCachedVideo = ETrue;
+                }
+            else
+                {
+                MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: all attributes NOT found from cache");
+                if ( !nonSupportedAttrCanBeFoundFromMds )
+                    {
+                    MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: none of the non cached attrs can be found from MDS -> use cached version");
+                    useCachedVideo = ETrue;
+                    }
+                else
+                    {
+                    MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: at least one of the non cached attributes can be found from MDS");
+                    }
+                }
+            }
+        }
+
+    CMPXMedia* video;
+
+    if ( useCachedVideo )
+        {
+        MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: using cached video");
+        video = CMPXMedia::CopyL( *videoInCache );
+        }
+    else
+        {
+        MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: fetching from MDS");
+        video = iMyVideosMdsDb->CreateVideoL( ids[0].iId1, ETrue /* full details */ );    
+        }
+    
+    if ( video )
+        {
+        iObs->HandleMedia( video, KErrNone );
+        }
+    else
+        {
+        iObs->HandleMedia( NULL, KErrNotFound );    
+        }
+    
+    CleanupStack::PopAndDestroy( &ids );          // <-2
+    CleanupStack::PopAndDestroy( &supportedIds ); // <-1
+    }
+
+// ----------------------------------------------------------------------------
+// Cancel the pending request, this is called by mpx framework when client calls
+// Cancel.
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosCollectionPlugin::CancelRequest()
+    {
+    MPX_FUNC("CVcxMyVideosCollectionPlugin::CancelRequest");
+
+    iActiveTask->Cancel();
+    iMyVideosMdsDb->Cancel();
+    }
+    
+// ----------------------------------------------------------------------------
+// Executes the given command on the collection
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosCollectionPlugin::CommandL(
+    CMPXCommand& aCmd)
+    {
+    MPX_DEBUG1("CVcxMyVideosCollectionPlugin::CommandL() start");
+
+    if ( !aCmd.IsSupported( KMPXCommandGeneralId ) )
+        {
+        User::Leave( KErrArgument );
+        }
+
+    TMPXCommandId commandId = *aCmd.Value<TMPXCommandId>(KMPXCommandGeneralId);
+     
+    TBool syncOp( EFalse );
+    if( aCmd.IsSupported( KMPXCommandGeneralDoSync ) )
+        {
+        syncOp = *aCmd.Value<TBool>( KMPXCommandGeneralDoSync );
+        }
+
+    if ( !syncOp )
+        {
+        // async
+        iActiveTask->StartL( commandId, aCmd );        
+        }
+    else
+        {
+        // sync, operations to a single media object only
+        TMPXCommandId commandId = *aCmd.Value<TMPXCommandId>(KMPXCommandGeneralId);
+
+        switch ( commandId )
+            {
+            case KMPXCommandIdCollectionAdd:
+                {
+                MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: sync KMPXCommandIdCollectionAdd arrived");
+                
+#ifdef _DEBUG
+                CMPXMedia* video = aCmd.Value<CMPXMedia>( KMPXCommandColAddMedia );                
+                TUint32 mdsId( 0 );
+                iMyVideosMdsDb->AddVideoL( *video, mdsId );
+#else
+                User::Leave( KErrNotSupported );
+#endif
+                }
+                break;
+                
+            case KMPXCommandIdCollectionSet:
+                {
+                MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: sync KMPXCommandIdCollectionSet arrived");
+                
+                CMPXMedia* video = aCmd.Value<CMPXMedia>( KMPXCommandColSetMedia );
+                
+                TMPXItemId mpxId = TVcxMyVideosCollectionUtil::IdL( *video );
+                if ( mpxId.iId2 == KVcxMvcMediaTypeVideo )
+                    {
+                    SetVideoL( *video );
+                    }
+                else if ( mpxId.iId2 == KVcxMvcMediaTypeAlbum )
+                    {
+                    iMyVideosMdsDb->iAlbums->SetAlbumL( *video );
+                    }
+                else
+                    {
+                    User::Leave( KErrNotFound );
+                    }
+                }
+                break;
+            
+            case KVcxCommandIdMyVideos:
+                {
+                switch ( aCmd.ValueTObjectL<TUint32>( KVcxMediaMyVideosCommandId ) )
+                    {
+                    case KVcxCommandMyVideosCancelMoveOrCopy:
+                        {
+                        MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: sync KVcxCommandMyVideosCancelMoveOrCopy arrived");
+                        iActiveTask->Cancel();
+                        }
+                        break;
+
+                    case KVcxCommandMyVideosCancelDelete:
+                        {
+                        MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: sync KVcxCommandMyVideosCancelDelete arrived");
+                        iActiveTask->Cancel();
+                        }
+                        break;
+                    
+                    case KVcxCommandMyVideosAddAlbum:
+                        {
+                        MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: sync KVcxCommandMyVideosAddAlbum arrived");
+                        AlbumsL().AddAlbumL( aCmd );
+                        }
+                        break;
+                    }
+                }
+                break;
+                   
+            default:
+                {
+                MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: UNKNOWN SYNC COMMAND ARRIVED");
+                User::Leave( KErrNotSupported );
+                }
+            }
+        }
+    MPX_DEBUG1("CVcxMyVideosCollectionPlugin::CommandL() exit");            
+    }
+
+// ----------------------------------------------------------------------------
+// Find the items matching the media specifications
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosCollectionPlugin::FindAllL(
+    const CMPXMedia& /* aCriteria */,
+    const TArray<TMPXAttribute>& /* aAttrs */)
+    {
+    MPX_FUNC("CVcxMyVideosCollectionPlugin::FindAllL");
+    }
+
+// ----------------------------------------------------------------------------
+// Find the items matching the media specifications
+// ----------------------------------------------------------------------------
+//
+CMPXMedia* CVcxMyVideosCollectionPlugin::FindAllSyncL(
+    const CMPXMedia& /* aCriteria */,
+    const TArray<TMPXAttribute>& /* aAttrs */)
+    {
+    MPX_FUNC("CVcxMyVideosCollectionPlugin::FindAllSyncL");
+    return NULL;
+    }
+
+// ----------------------------------------------------------------------------
+// Get the list of supported capabilities
+// ----------------------------------------------------------------------------
+//
+TCollectionCapability CVcxMyVideosCollectionPlugin::GetCapabilities()
+    {
+    // This one supports simple search
+    return EMcSearch;
+    }
+
+// ----------------------------------------------------------------------------------------------------------
+// CVcxMyVideosCollectionPlugin::SendMessages
+// ----------------------------------------------------------------------------------------------------------
+//
+void CVcxMyVideosCollectionPlugin::SendMessages( CMPXMessage& aMessages )
+    {
+    iObs->HandleMessage( aMessages );
+    }
+
+// ----------------------------------------------------------------------------------------------------------
+// CVcxMyVideosCollectionPlugin::HandleMyVideosDbEvent
+// ----------------------------------------------------------------------------------------------------------
+//
+void CVcxMyVideosCollectionPlugin::HandleMyVideosDbEvent(
+        TMPXChangeEventType aEvent,
+        RArray<TUint32>& aId,
+        TInt aEventsLeft )
+    {
+    TRAPD( err, DoHandleMyVideosDbEventL( aEvent, aId, aEventsLeft ));
+    if ( err != KErrNone )
+        {
+        MPX_DEBUG2("CVcxMyVideosCollectionPlugin::DoHandleMyVideosDbEventL() leaved with error code: %d", err);
+        }
+    }
+    
+// ----------------------------------------------------------------------------------------------------------
+// CVcxMyVideosCollectionPlugin::DoHandleMyVideosDbEventL
+// ----------------------------------------------------------------------------------------------------------
+//
+void CVcxMyVideosCollectionPlugin::DoHandleMyVideosDbEventL(
+        TMPXChangeEventType aEvent,
+        RArray<TUint32>& aId,
+        TInt /*aEventsLeft*/ )
+    {
+    MPX_FUNC("CVcxMyVideosCollectionPlugin::DoHandleMyVideosDbEventL");
+    
+    RArray<TUint32> nonVideoIds;
+    nonVideoIds.Reset();
+    CleanupClosePushL( nonVideoIds );
+    
+    switch ( aEvent )
+        {
+        case EMPXItemDeleted:
+            {
+            MPX_DEBUG1("CVcxMyVideosCollectionPlugin::DoHandleMyVideosDbEventL() --------------------------------------------.");
+            MPX_DEBUG1("CVcxMyVideosCollectionPlugin::DoHandleMyVideosDbEventL() Items from MDS deleted, deleting from cache |" );
+            MPX_DEBUG1("CVcxMyVideosCollectionPlugin::DoHandleMyVideosDbEventL() --------------------------------------------'");
+
+            iCache->RemoveL( aId, EFalse );
+            
+            CategoriesL().ResetVideoCountersL();
+            CategoriesL().UpdateCategoriesL( *iCache->iVideoList, 0 );
+            CategoriesL().UpdateCategoriesNewVideoNamesL();
+            
+#ifdef VCX_ALBUMS 
+            AlbumsL().RemoveAlbumsL( aId );
+#endif
+            }
+            break;
+        
+        case EMPXItemInserted:
+            {
+            MPX_DEBUG1("CVcxMyVideosCollectionPlugin::DoHandleMyVideosDbEventL() ------------------------------------.");
+            MPX_DEBUG1("CVcxMyVideosCollectionPlugin::DoHandleMyVideosDbEventL() Items added to MDS, adding to cache |");
+            MPX_DEBUG1("CVcxMyVideosCollectionPlugin::DoHandleMyVideosDbEventL() ------------------------------------'");
+            
+            if ( iMyVideosMdsDb->iVideoListFetchingIsOngoing )
+                {
+                MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: video list fetching is ongoing, ignoring add event");
+                CleanupStack::PopAndDestroy( &nonVideoIds );
+                return;
+                }
+                
+            TBool videoListFetchingWasCancelled = EFalse;
+
+            // After the call, aId will contain only items which were actually inserted to cache.
+            // We receive add events for all object types. When fetching the item from MDS we use
+            // video condition and only video objects are added to cache. Items which were detected
+            // to not be videos are added to nonVideoIds.
+            iCache->AddVideosFromMdsL( aId, videoListFetchingWasCancelled,
+                    &nonVideoIds, EFalse /* dont update categories*/ );
+
+            CategoriesL().ResetVideoCountersL();
+            CategoriesL().UpdateCategoriesL( *iCache->iVideoList, 0 );
+            CategoriesL().UpdateCategoriesNewVideoNamesL();
+            
+#ifdef VCX_ALBUMS
+#if 0 //TODO: do this if we want to support albums which are being added by someone else than My Videos Collection
+            
+            //After the call nonVideoIds will contain only items which were actually added
+            //to albums.
+            AlbumsL().AddAlbumsFromMdsL( nonVideoIds );
+#endif
+#endif
+            
+            if ( videoListFetchingWasCancelled )
+                {
+                RestartVideoListFetchingL();
+                }
+            }
+            
+            break;
+        
+        case EMPXItemModified:
+            {
+            MPX_DEBUG1("CVcxMyVideosCollectionPlugin::DoHandleMyVideosDbEventL() --------------------------------------.");
+            MPX_DEBUG1("CVcxMyVideosCollectionPlugin::DoHandleMyVideosDbEventL() Items modified in MDS, updating cache |");
+            MPX_DEBUG1("CVcxMyVideosCollectionPlugin::DoHandleMyVideosDbEventL() --------------------------------------'");
+            CMPXMedia* video;
+#ifdef VCX_ALBUMS
+            CMPXMedia* album;
+#endif
+            TInt count = aId.Count();
+            for ( TInt i = count - 1; i >= 0; i-- )
+                {
+                video = iMyVideosMdsDb->CreateVideoL( aId[i], ETrue /* full details */ );
+                
+                if ( video )
+                    {
+                    CleanupStack::PushL( video ); // 1->
+                    iCache->UpdateVideoL( *video );
+                    CleanupStack::PopAndDestroy( video ); // <-1
+                    }
+                else
+                    {
+#ifndef VCX_ALBUMS
+                    MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: couldn't find the modified item from MDS");
+                    aId.Remove( i );
+#else
+                    MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: item was not found from videos, checking albums");
+                    album = iMyVideosMdsDb->iAlbums->GetAlbumL( aId[i] );
+                    
+                    if ( album )
+                        {
+                        CleanupStack::PushL( album ); // 1->
+                        iAlbums->UpdateAlbumL( *album ); // this will add event to iMessageList if necessarry
+                        CleanupStack::PopAndDestroy( album ); // <-1
+                        }
+                    else
+                        {
+                        MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: couldn't find the modified item from MDS");
+                        }
+                    aId.Remove( i );
+#endif
+                    }
+                }
+            
+            }
+            break;
+        }
+
+        TInt pos;
+        TInt count = aId.Count();
+        for ( TInt i = 0; i < count; i++ )
+            {
+            if ( aEvent == EMPXItemInserted )
+                {
+                // add item from cache to the message if we have it.
+                CMPXMedia* video = iCache->FindVideoByMdsIdL( aId[i], pos );
+                TRAP_IGNORE( iMessageList->AddEventL( TMPXItemId( aId[i], KVcxMvcMediaTypeVideo),
+                        aEvent, 0, video ) );
+                }
+            else
+                {
+                TRAP_IGNORE( iMessageList->AddEventL( TMPXItemId( aId[i], KVcxMvcMediaTypeVideo),
+                        aEvent ) );
+                }
+            }
+
+#ifdef VCX_ALBUMS
+    //nonVideoIds are albums
+    count = nonVideoIds.Count();
+    for ( TInt i = 0; i < count; i++ )
+        {
+        TRAP_IGNORE( iMessageList->AddEventL(
+                TMPXItemId( nonVideoIds[i], KVcxMvcMediaTypeAlbum ), aEvent ) );
+        }
+
+    iAlbums->UpdateChangedAlbumsL();
+#endif
+
+    CleanupStack::PopAndDestroy( &nonVideoIds );
+	iMessageList->SendL();
+    }
+    
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCollectionPlugin::HandleStepL
+// ----------------------------------------------------------------------------
+//
+MVcxMyVideosActiveTaskObserver::TStepResult CVcxMyVideosCollectionPlugin::HandleStepL()
+    {
+    MPX_FUNC("CVcxMyVideosCollectionPlugin::HandleStepL");
+
+    MVcxMyVideosActiveTaskObserver::TStepResult stepResult(MVcxMyVideosActiveTaskObserver::EDone);
+
+    switch ( iActiveTask->GetTask() )
+        {
+        case KMPXCommandIdCollectionSet:
+            {
+            MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: async KMPXCommandIdCollectionSet in");
+            
+            CMPXMedia* video = CMPXMedia::NewL( *(iActiveTask->GetCommand().Value<CMPXMedia>(
+                            KMPXCommandColSetMedia)) );
+            
+            CleanupStack::PushL( video );
+            
+            SetVideoL( *video );
+
+            CleanupStack::PopAndDestroy( video );
+            
+            MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: async KMPXCommandIdCollectionSet out");
+            
+            stepResult = MVcxMyVideosActiveTaskObserver::EDone;            
+            break;
+            }
+        case KVcxCommandIdMyVideos:
+            {
+            CMPXCommand& cmd = iActiveTask->GetCommand();
+            if ( !cmd.IsSupported( KVcxMediaMyVideosCommandId ) )
+                {
+                MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: KVcxMediaMyVideosCommandId attribute not supported in cmd, aborting");
+                User::Leave( KErrArgument );
+                }
+
+            TInt myVideosCmd( cmd.ValueTObjectL<TUint>( KVcxMediaMyVideosCommandId ) );
+
+            switch ( myVideosCmd )
+                {                
+                case KVcxCommandMyVideosGetMediaFullDetailsByMpxId:
+                    {
+                    MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: KVcxCommandMyVideosGetMediaFullDetailsByMpxId received");
+                    CMPXMedia& cmd = iActiveTask->GetCommand();
+                    TMPXItemId mpxId( TVcxMyVideosCollectionUtil::IdL( cmd ) );
+                    if ( !mpxId.iId1 && !mpxId.iId2 )
+                        {
+                        User::Leave( KErrArgument );
+                        }
+                    MPX_DEBUG2("CVcxMyVideosCollectionPlugin:: KVcxCommandMyVideosGetMediaFullDetailsByMpxId cmd: MDS ID %d requested", mpxId.iId1 );
+
+                    CMPXMedia* video = iMyVideosMdsDb->CreateVideoL(
+                            mpxId.iId1, ETrue /* full details */ );
+                    
+                    if ( !video )
+                        {
+                        User::Leave( KErrNotFound );
+                        }
+                    
+                    CleanupStack::PushL( video ); // 1->
+                                        
+                    cmd.SetCObjectValueL<CMPXMedia>( KMPXCommandColAddMedia, video );
+                    CleanupStack::PopAndDestroy( video ); // <-1
+
+                    cmd.SetTObjectValueL<TUid>(KMPXMessageCollectionId, TUid::Uid(
+                            KVcxUidMyVideosMpxCollection));
+                    
+                    stepResult = MVcxMyVideosActiveTaskObserver::EDone;            
+                    }
+                    break;
+                    
+                case KVcxCommandMyVideosGetMediasByMpxId:
+                    {
+                    MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: KVcxCommandMyVideosGetMediasByMpxId received");
+                    
+                    // Get ids from the request
+                    CMPXMedia& cmd = iActiveTask->GetCommand();
+                    if ( !cmd.IsSupported( KMPXMediaArrayContents ) )
+                        {
+                        MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: error, no array defined");
+                        User::Leave( KErrArgument );
+                        }
+                    
+                    CMPXMediaArray* idMediaArray = cmd.Value<CMPXMediaArray>(
+                            KMPXMediaArrayContents );
+
+                    if ( idMediaArray->Count() == 0 )
+                        {
+                        MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: error, no items in array ");
+                        User::Leave( KErrArgument );
+                        }
+
+                    TMPXItemId mpxId;
+                    RArray<TUint32> mdsIds;
+                    RArray<TUint32> mdsIds2;
+                    mdsIds.Reset();
+                    CleanupClosePushL( mdsIds );  // 1->
+                    mdsIds2.Reset();
+                    CleanupClosePushL( mdsIds2 ); // 2->
+
+                    for ( TInt i = 0; i < idMediaArray->Count(); i++ )
+                        {
+                        mpxId = (*idMediaArray)[i]->ValueTObjectL<TMPXItemId>(
+                                KMPXMessageMediaGeneralId );
+                        MPX_DEBUG2("CVcxMyVideosCollectionPlugin:: KVcxCommandMyVideosGetMediasByMpxId cmd: MDS ID %d requested",
+                               mpxId.iId1 );
+                        mdsIds.AppendL( mpxId.iId1 );
+                        mdsIds2.AppendL( mpxId.iId1 );
+                        }
+
+                    if ( !iCache->iVideoList )
+                        {
+                        MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: iVideoListCache = NULL -> creating new empty iCache->iVideoList");
+                        iCache->SetComplete( EFalse );
+                        iCache->iVideoList = TVcxMyVideosCollectionUtil::CreateEmptyMediaListL();
+                        }
+
+                    TBool videoListFetchingWasCancelled = EFalse;
+                        
+                    if ( !iCache->IsComplete() )
+                        {                            
+                        // Load items to cache
+                        MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: loading requested items to iCache->iVideoList");
+                        
+                        iCache->AddVideosFromMdsL( mdsIds, videoListFetchingWasCancelled );
+                        }
+                    else
+                        {
+                        // iCache->iVideoList contains all 
+                        }
+
+                    CMPXMessage* message = iCache->GetVideosL( mdsIds2 );
+                    CleanupStack::PushL( message ); // 3-> 
+
+                    // Set message attributes
+                    //
+                    TMPXItemId itemId;
+                    itemId.iId1 = KVcxCommandIdMyVideos;
+                    message->SetTObjectValueL<TMPXMessageId>( KMPXMessageGeneralId, itemId );
+                    message->SetTObjectValueL<TInt>( KVcxMediaMyVideosCommandId,
+                            KVcxMessageMyVideosGetMediasByMpxIdResp );
+                    
+                    SetTransactionIdL( cmd, *message );
+                            
+                    iMessageList->AddL( message );
+                    CleanupStack::Pop( message );            //  <-3
+                    iMessageList->SendL();
+
+                    if ( videoListFetchingWasCancelled )
+                        {
+                        MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: video list fetching was cancelled, restarting");
+                        RestartVideoListFetchingL();
+                        }
+
+                    CleanupStack::PopAndDestroy( &mdsIds2 ); //  <-2
+                    CleanupStack::PopAndDestroy( &mdsIds );  //  <-1
+                        
+                    stepResult = MVcxMyVideosActiveTaskObserver::EDone;            
+                    }
+                    break;
+                
+                case KVcxCommandMyVideosCopy:
+                case KVcxCommandMyVideosMove:
+                    {
+                    MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: KVcxCommandMyVideosMove or Copy step");
+                    stepResult = AsyncFileOperationsL().HandleMoveOrCopyStepL();
+                    }
+                    break;
+                    
+                case KVcxCommandMyVideosDelete:
+                    {
+                    MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: KVcxCommandMyVideosDelete step");
+                    stepResult = AsyncFileOperationsL().HandleDeleteStepL();
+                    }
+                    break;
+                    
+                case KVcxCommandMyVideosAddToAlbum:
+                    iAlbums->AddVideosToAlbumL( &iActiveTask->GetCommand() );
+                    stepResult = MVcxMyVideosActiveTaskObserver::EStopStepping;
+                    break;
+
+                case KVcxCommandMyVideosRemoveFromAlbum:
+                    iAlbums->RemoveVideosFromAlbumL( &iActiveTask->GetCommand() );
+                    stepResult = MVcxMyVideosActiveTaskObserver::EStopStepping;
+                    break;
+                    
+                case KVcxCommandMyVideosAddAlbum:
+                    {
+                    MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: async KVcxCommandMyVideosAddAlbum arrived");
+                    AlbumsL().AddAlbumL( iActiveTask->GetCommand() );
+                    stepResult = MVcxMyVideosActiveTaskObserver::EDone;
+                    break;
+                    }
+
+                case KVcxCommandMyVideosRemoveAlbums:
+                    {
+                    MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: async KVcxCommandMyVideosRemoveAlbums arrived");
+                    AlbumsL().RemoveAlbumsFromMdsOnlyL( iActiveTask->Command() );
+                    stepResult = MVcxMyVideosActiveTaskObserver::EStopStepping;
+                    break;
+                    }
+
+                    
+                }
+            }
+            break;
+
+            
+        case KMPXCommandIdCollectionRemoveMedia:
+            {
+            TMPXItemId mpxId = iActiveTask->GetCommand().ValueTObjectL<TMPXItemId>(
+                    KMPXMediaGeneralId );
+            AsyncFileOperationsL().DeleteVideoL( mpxId.iId1 );
+            stepResult = MVcxMyVideosActiveTaskObserver::EDone;            
+            break;
+            }
+            
+        default:
+            {
+            // Should never happen!
+            ASSERT(0);
+            break;
+            }
+        }
+    return stepResult;
+    }
+
+
+// ----------------------------------------------------------------------------
+// Handler for async operations completed
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosCollectionPlugin::HandleOperationCompleted(
+    TInt aErr )
+    {
+    MPX_FUNC("CVcxMyVideosCollectionPlugin::HandleOperationCompleted");
+    
+    if ( aErr != KErrNone )
+        {
+        MPX_DEBUG2("CVcxMyVideosCollectionPlugin:: Leave or cancel happened during the operation: %d", aErr);
+        
+        if ( iAsyncFileOperations )
+            {
+            TRAPD( err, AsyncFileOperationsL().CancelOperationL( aErr ) ); // generates resp message for move,copy or delete operations
+            if ( err != KErrNone )
+                {
+                MPX_DEBUG2("CVcxMyVideosCollectionPlugin:: failed to generate resp msg: %d", err);
+                }
+            }
+        }
+
+    
+
+    CMPXCommand& cmd = iActiveTask->GetCommand();
+    TRAP_IGNORE( cmd.SetTObjectValueL<TInt32>( KVcxMediaMyVideosInt32Value, aErr ) );
+
+    iObs->HandleCommandComplete( &cmd, KErrNone );
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCollectionPlugin::CategoriesL
+// ----------------------------------------------------------------------------
+//
+CVcxMyVideosCategories& CVcxMyVideosCollectionPlugin::CategoriesL()
+    {
+    if ( !iCategories )
+        {
+        iCategories = CVcxMyVideosCategories::NewL( *this );
+        }
+    return *iCategories;
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCollectionPlugin::AlbumsL
+// TODO: Unecessarry func since we always load this
+// ----------------------------------------------------------------------------
+//
+CVcxMyVideosAlbums& CVcxMyVideosCollectionPlugin::AlbumsL()
+    {
+    if ( !iAlbums )
+        {
+        iAlbums = CVcxMyVideosAlbums::NewL( *this );
+        }
+    return *iAlbums;
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCollectionPlugin::HandleCreateVideoListResp
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosCollectionPlugin::HandleCreateVideoListResp(
+        CMPXMedia* aVideoList, TInt aNewItemsStartIndex, TBool aComplete )
+    {
+    TRAPD( err, iOpenHandler->DoHandleCreateVideoListRespL( aVideoList, aNewItemsStartIndex, aComplete ));
+    if ( err != KErrNone )
+        {
+        MPX_DEBUG2("CVcxMyVideosCollectionPlugin:: DoHandleCreateVideoListRespL() left with error code: %d", err );
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCollectionPlugin::RestartVideoListFetchingL
+// Called when video list fetching is interrupted due to "get item by mpx id"
+// request, or sorting order change. Or by some other reason that requires
+// new video list fetching. iCache->iVideoList media array has been reset, Ie lists are the
+// the same but items have been deleted.
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosCollectionPlugin::RestartVideoListFetchingL()
+    {
+    MPX_FUNC("CVcxMyVideosCollectionPlugin::RestartVideoListFetchingL()");
+    
+    // Client already had something on the list.
+    // -> tell client to fetch everything from scratch again.
+    MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: open was not pending, client had something on the list");
+    MPX_DEBUG1("                               -> telling client to fetch everything from the scratch again");
+    MPX_DEBUG2("CVcxMyVideosCollectionPlugin:: adding modify event for path root, extra info = %d",
+            EVcxMyVideosVideoListOrderChanged );
+    
+    iCache->ResetVideoListL();
+    
+    iMessageList->AddEventL( TMPXItemId( KVcxUidMyVideosMpxCollection,
+            KVcxUidMyVideosMpxCollection ), EMPXItemModified,
+            EVcxMyVideosVideoListOrderChanged );
+    iMessageList->SendL();
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCollectionPlugin::SetVideoL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosCollectionPlugin::SetVideoL( CMPXMedia& aVideo )
+    {
+    TRAPD( leave, iCache->UpdateVideoL( aVideo ) );
+	
+    if ( leave == KErrNone )
+        {
+        TMPXItemId mpxId( TVcxMyVideosCollectionUtil::IdL( aVideo ) );
+
+        TInt pos;
+        CMPXMedia* videoInCache = iCache->FindVideoByMdsIdL( mpxId, pos );
+		
+        if ( videoInCache )
+            {
+            iMyVideosMdsDb->UpdateVideoL( *videoInCache );
+            }
+        }
+    else if ( leave == KErrNotFound )
+        {
+        iMyVideosMdsDb->UpdateVideoL( aVideo );
+        }
+	else
+	    {
+		User::Leave( leave );
+		}
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCollectionPlugin::NotifyNewVideosCountDecreasedL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosCollectionPlugin::NotifyNewVideosCountDecreasedL( CMPXMedia& aVideo )
+    {    
+    const TInt KMediaExtSize( 8 );
+    
+    HBufC8* buffer = HBufC8::NewL( KMediaExtSize );
+    CleanupStack::PushL( buffer );
+    TPtr8 des = buffer->Des();
+    
+    RDesWriteStream stream;
+    CleanupClosePushL( stream );
+    stream.Open( des );
+    
+    aVideo.ExternalizeL( stream );
+    
+    stream.CommitL();
+    
+    CleanupStack::PopAndDestroy( &stream );    
+        
+    CleanupStack::PopAndDestroy( buffer );
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCollectionPlugin::AddVideoToMdsAndCacheL
+// ----------------------------------------------------------------------------
+//    
+void CVcxMyVideosCollectionPlugin::AddVideoToMdsAndCacheL( CMPXMedia& aVideo )
+    {
+    MPX_FUNC("CVcxMyVideosCollectionPlugin::AddVideoToMdsAndCacheL");
+    
+    TMPXItemId mpxId;
+    iMyVideosMdsDb->AddVideoL( aVideo, mpxId.iId1 );
+
+    aVideo.SetTObjectValueL<TMPXItemId>( KMPXMediaGeneralId, mpxId );                        
+    MPX_DEBUG2("CVcxMyVideosCollectionPlugin:: new MDS ID: %d", mpxId.iId1 );
+
+    RArray<TUint32> ids;
+    ids.Reset();
+    CleanupClosePushL( ids ); // 1->
+    ids.AppendL( mpxId.iId1 );
+    HandleMyVideosDbEvent( EMPXItemInserted, ids, 0 ); //this will fetch from mds to cache
+    CleanupStack::PopAndDestroy( &ids ); // <-1
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCollectionPlugin::SetTransactionIdL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosCollectionPlugin::SetTransactionIdL( CMPXMedia& aRequest, CMPXMedia& aResp )
+    {
+    if ( aRequest.IsSupported( KVcxMediaMyVideosTransactionId ) )
+        {
+        TUint32 transactionId( aRequest.ValueTObjectL<TUint32>( KVcxMediaMyVideosTransactionId ));
+        MPX_DEBUG2("CVcxMyVideosCollectionPlugin:: transaction ID: %d", transactionId );
+        aResp.SetTObjectValueL<TUint32>( KVcxMediaMyVideosTransactionId, transactionId );
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCollectionPlugin::SendMyVideosMessageL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosCollectionPlugin::SendMyVideosMessageL(
+        TUint32 aMessageId, CMPXCommand* aCommand )
+    {
+    CMPXMessage* message = CMPXMessage::NewL();
+    CleanupStack::PushL( message ); // 1->
+    TMPXItemId itemId;
+    itemId.iId1 = KVcxCommandIdMyVideos;
+    message->SetTObjectValueL<TMPXMessageId>( KMPXMessageGeneralId, itemId );
+    message->SetTObjectValueL<TInt>( KVcxMediaMyVideosCommandId,
+            aMessageId );
+    
+    if ( aCommand )
+        {
+        SetTransactionIdL( *aCommand, *message );
+        }
+    else
+        {
+        message->SetTObjectValueL<TUint32>( KVcxMediaMyVideosTransactionId, 0 );
+        }
+            
+    iMessageList->AddL( message );
+    CleanupStack::Pop( message ); // <-1
+    iMessageList->SendL();
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCollectionPlugin::AsyncFileOperationsL
+// ----------------------------------------------------------------------------
+//
+CVcxMyVideosAsyncFileOperations& CVcxMyVideosCollectionPlugin::AsyncFileOperationsL()
+    {
+    if ( !iAsyncFileOperations )
+        {
+        iAsyncFileOperations = CVcxMyVideosAsyncFileOperations::NewL( *this );
+        }
+    return *iAsyncFileOperations;
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCollectionPlugin::HandleObjectPresentNotification
+// From MVcxMyVideosMdsDbObserver. Called when media is inserted/removed. 
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosCollectionPlugin::HandleObjectPresentNotification()
+    {
+    TRAPD( err, DoHandleObjectPresentNotificationL() );
+
+    if ( err != KErrNone )
+        {
+        MPX_DEBUG2("CVcxMyVideosCollectionPlugin::DoHandleObjectPresentNotificationL() left with code %d", err);
+        }
+    }
+    
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCollectionPlugin::DoHandleObjectPresentNotificationL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosCollectionPlugin::DoHandleObjectPresentNotificationL()
+    {
+    iCache->ResetVideoListL();
+
+    MPX_DEBUG2("CVcxMyVideosCollectionPlugin:: adding modify event for path root, extra info = %d",
+            EVcxMyVideosVideoListOrderChanged );
+    iMessageList->AddEventL( TMPXItemId( KVcxUidMyVideosMpxCollection,
+            KVcxUidMyVideosMpxCollection ), EMPXItemModified, EVcxMyVideosVideoListOrderChanged );
+            
+    MPX_DEBUG3("CVcxMyVideosCollectionPlugin:: adding modify event for category[%d], extra info = %d",
+            KVcxMvcCategoryIdAll, EVcxMyVideosVideoListOrderChanged );
+    iMessageList->AddEventL( TMPXItemId( KVcxMvcCategoryIdAll, 1 ), EMPXItemModified,
+            EVcxMyVideosVideoListOrderChanged );
+
+    MPX_DEBUG3("CVcxMyVideosCollectionPlugin:: adding modify event for category[%d], extra info = %d",
+            KVcxMvcCategoryIdDownloads, EVcxMyVideosVideoListOrderChanged );
+    iMessageList->AddEventL( TMPXItemId( KVcxMvcCategoryIdDownloads, 1 ), EMPXItemModified,
+            EVcxMyVideosVideoListOrderChanged );
+
+    MPX_DEBUG3("CVcxMyVideosCollectionPlugin:: adding modify event for category[%d], extra info = %d",
+            KVcxMvcCategoryIdTvRecordings, EVcxMyVideosVideoListOrderChanged );
+    iMessageList->AddEventL( TMPXItemId( KVcxMvcCategoryIdTvRecordings, 1 ), EMPXItemModified,
+            EVcxMyVideosVideoListOrderChanged );
+
+    MPX_DEBUG3("CVcxMyVideosCollectionPlugin:: adding modify event for category[%d], extra info = %d",
+            KVcxMvcCategoryIdCaptured, EVcxMyVideosVideoListOrderChanged );
+    iMessageList->AddEventL( TMPXItemId( KVcxMvcCategoryIdCaptured, 1 ), EMPXItemModified,
+            EVcxMyVideosVideoListOrderChanged );
+
+    MPX_DEBUG3("CVcxMyVideosCollectionPlugin:: adding modify event for category[%d], extra info = %d",
+            KVcxMvcCategoryIdOther, EVcxMyVideosVideoListOrderChanged );
+    iMessageList->AddEventL( TMPXItemId( KVcxMvcCategoryIdOther, 1 ), EMPXItemModified,
+            EVcxMyVideosVideoListOrderChanged );
+
+    iMessageList->SendL();    
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideoscollectionpluginproxy.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,44 @@
+/*
+* 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:    Standard proxy of the ECOM plugin*
+*/
+
+
+
+
+#include <ecom/implementationproxy.h>
+#include <vcxmyvideosuids.h>
+#include "vcxmyvideoscollectionplugin.h"
+
+#if (!defined IMPLEMENTATION_PROXY_ENTRY)
+typedef TAny* TProxyNewLPtr;
+#define IMPLEMENTATION_PROXY_ENTRY(aUid,aFuncPtr) {{aUid},(TProxyNewLPtr)(aFuncPtr)}
+#endif
+
+// ----------------------------------------------------------------------------
+// The list of implementations
+// ----------------------------------------------------------------------------
+//
+const TImplementationProxy ImplementationTable[] =
+    { IMPLEMENTATION_PROXY_ENTRY(KVcxUidMyVideosMpxCollection, CVcxMyVideosCollectionPlugin::NewL) };
+
+// ----------------------------------------------------------------------------
+// The proxy of implementations
+// ----------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+    {
+    aTableCount=sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+    return ImplementationTable;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideoscollectionutil.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,670 @@
+/*
+* 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 <mpxmedia.h>
+#include <mpxmediaarray.h>
+#include <mpxlog.h>
+#include <mpxmediacontainerdefs.h>
+#include <mpxmediageneraldefs.h>
+#include <vcxmyvideosdefs.h>
+#include <mpxmessagecontainerdefs.h>
+#include <bautils.h>
+#include <mpxmediavideodefs.h>
+#ifdef _DEBUG
+#include <flogger.h>
+#include <f32file.h> 
+#endif
+#include "vcxmyvideoscollectionutil.h"
+
+// ============================ MEMBER FUNCTIONS ==============================
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCollectionUtil::CreateEmptyMediaListL
+// ----------------------------------------------------------------------------
+//
+CMPXMedia* TVcxMyVideosCollectionUtil::CreateEmptyMediaListL()
+    {
+    RArray<TInt> 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<TInt> 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<TUint32>& 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<CMPXMediaArray>( KMPXMediaArrayContents );
+    CMPXMediaArray* toArray   = aToList.Value<CMPXMediaArray>( 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<TMPXItemId>( 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<CMPXMedia*>& aFromArray,
+        CMPXMedia& aToList,
+        RArray<TUint32>& 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<CMPXMediaArray>( 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<TMPXItemId>( 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<CMPXMediaArray>( KMPXMediaArrayContents );
+    CMPXMediaArray* fromArray = aFromList.Value<CMPXMediaArray>( 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<KMaxDigits> 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<TUint8>( 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<TUint32>( KMPXMediaGeneralFlags );                
+        }
+    return flags;
+    }
+
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::CreationDateL
+// ----------------------------------------------------------------------------
+//
+TInt64 TVcxMyVideosCollectionUtil::CreationDateL( CMPXMedia& aVideo )
+    {
+    TInt64 creationDate = 0;
+                            
+    if ( aVideo.IsSupported( KMPXMediaGeneralDate ) )
+        {
+        creationDate = aVideo.ValueTObjectL<TInt64>( KMPXMediaGeneralDate );                
+        }
+    return creationDate;
+    }
+
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::DownloadIdL
+// ----------------------------------------------------------------------------
+//
+TUint32 TVcxMyVideosCollectionUtil::DownloadIdL( CMPXMedia& aVideo )
+    {
+    TUint32 downloadId = 0;
+                            
+    if ( aVideo.IsSupported( KVcxMediaMyVideosDownloadId ) )
+        {
+        downloadId = aVideo.ValueTObjectL<TUint32>( KVcxMediaMyVideosDownloadId );                
+        }
+    return downloadId;
+    }
+
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::DownloadStateL
+// ----------------------------------------------------------------------------
+//
+TVcxMyVideosDownloadState TVcxMyVideosCollectionUtil::DownloadStateL( CMPXMedia& aVideo )
+    {
+    TVcxMyVideosDownloadState downloadState = EVcxMyVideosDlStateNone;
+                            
+    if ( aVideo.IsSupported( KVcxMediaMyVideosDownloadState ) )
+        {
+        downloadState = static_cast<TVcxMyVideosDownloadState>(
+                aVideo.ValueTObjectL<TUint8>( KVcxMediaMyVideosDownloadState ) );
+        }
+    return downloadState;
+    }
+
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::IdL
+// ----------------------------------------------------------------------------
+//
+TMPXItemId TVcxMyVideosCollectionUtil::IdL( const CMPXMedia& aVideo )
+    {
+    TMPXItemId id( 0, 0 );
+                            
+    if ( aVideo.IsSupported( KMPXMediaGeneralId ) )
+        {
+        id = aVideo.ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId );
+        }
+    return id;
+    }
+
+
+
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::DurationL
+// ----------------------------------------------------------------------------
+//
+TReal32 TVcxMyVideosCollectionUtil::DurationL( CMPXMedia& aVideo )
+    {
+    TReal32 duration = -1;
+                            
+    if ( aVideo.IsSupported( KVcxMediaMyVideosDuration ) )
+        {
+        duration = aVideo.ValueTObjectL<TReal32>( 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<TUint8>( KVcxMediaMyVideosRating );                
+        }
+    return rating;
+    }
+
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::AudioFourCcL
+// ----------------------------------------------------------------------------
+//
+TUint32 TVcxMyVideosCollectionUtil::AudioFourCcL( CMPXMedia& aVideo )
+    {
+    TUint32 audioFourCc = 0;
+                            
+    if ( aVideo.IsSupported( KVcxMediaMyVideosAudioFourCc ) )
+        {
+        audioFourCc = aVideo.ValueTObjectL<TUint32>( KVcxMediaMyVideosAudioFourCc );                
+        }
+    return audioFourCc;
+    }
+
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::AreSupported
+// ----------------------------------------------------------------------------
+//
+TBool TVcxMyVideosCollectionUtil::AreSupported( CMPXMedia& aVideo,
+        const TArray<TMPXAttribute>& 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 )
+    {
+    switch ( aCategoryId )
+        {
+        case KVcxMvcCategoryIdAll:
+            return KErrNotFound;
+
+        case KVcxMvcCategoryIdDownloads:
+            return EVcxMyVideosOriginDownloaded;
+
+        case KVcxMvcCategoryIdTvRecordings:
+            return EVcxMyVideosOriginTvRecording;
+            
+        case KVcxMvcCategoryIdCaptured:
+            return EVcxMyVideosOriginCapturedWithCamera;
+            
+        case KVcxMvcCategoryIdOther:
+            return EVcxMyVideosOriginOther;
+        }
+    return KErrNotFound;
+    }
+
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::MediaArrayL
+// ----------------------------------------------------------------------------
+//
+CMPXMediaArray* TVcxMyVideosCollectionUtil::MediaArrayL( const CMPXMedia& aMedia )
+    {
+    if ( !aMedia.IsSupported( KMPXMediaArrayContents ) )
+        {
+        User::Leave( KErrArgument );
+        }
+
+    return aMedia.Value<CMPXMediaArray>( KMPXMediaArrayContents );
+    }
+
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::Int32ValueL
+// ----------------------------------------------------------------------------
+//
+TInt32 TVcxMyVideosCollectionUtil::Int32ValueL( CMPXMedia& aMedia )
+    {
+    if ( !aMedia.IsSupported( KVcxMediaMyVideosInt32Value ) )
+        {
+        User::Leave( KErrArgument );
+        }
+    return aMedia.ValueTObjectL<TInt32>( KVcxMediaMyVideosInt32Value );
+    }
+
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::Uint32ValueL
+// ----------------------------------------------------------------------------
+//
+TUint32 TVcxMyVideosCollectionUtil::Uint32ValueL( CMPXMedia& aMedia )
+    {
+    if ( !aMedia.IsSupported( KVcxMediaMyVideosUint32Value ) )
+        {
+        User::Leave( KErrArgument );
+        }
+    return aMedia.ValueTObjectL<TUint32>( KVcxMediaMyVideosUint32Value );
+    }
+
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::CategoryItemCountL
+// ----------------------------------------------------------------------------
+//
+TUint32 TVcxMyVideosCollectionUtil::CategoryItemCountL( CMPXMedia& aVideo )
+    {
+    TUint32 categoryItemCount = 0;
+                            
+    if ( aVideo.IsSupported( KVcxMediaMyVideosCategoryItemCount ) )
+        {
+        categoryItemCount = aVideo.ValueTObjectL<TUint32>( KVcxMediaMyVideosCategoryItemCount );                
+        }
+    return categoryItemCount;
+    }
+
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::CategoryNewItemCountL
+// ----------------------------------------------------------------------------
+//
+TUint32 TVcxMyVideosCollectionUtil::CategoryNewItemCountL( CMPXMedia& aVideo )
+    {
+    TUint32 categoryNewItemCount = 0;
+                            
+    if ( aVideo.IsSupported( KVcxMediaMyVideosCategoryNewItemCount ) )
+        {
+        categoryNewItemCount = aVideo.ValueTObjectL<TUint32>( KVcxMediaMyVideosCategoryNewItemCount );                
+        }
+    return categoryNewItemCount;
+    }
+
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::CategoryNewVideoName
+// ----------------------------------------------------------------------------
+//
+const TDesC& TVcxMyVideosCollectionUtil::CategoryNewVideoName( const CMPXMedia& aVideo )
+    {                            
+    if ( aVideo.IsSupported( KVcxMediaMyVideosCategoryNewItemName ) )
+        {
+        return aVideo.ValueText( KVcxMediaMyVideosCategoryNewItemName );
+        }
+    else
+        {
+        return KNullDesC;
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::GetIdsFromMediaArrayL
+// ----------------------------------------------------------------------------
+//
+void TVcxMyVideosCollectionUtil::GetIdsFromMediaArrayL( CMPXMediaArray& aMediaArray,
+        RArray<TUint32>& aIdArray )
+    {
+    TInt count = aMediaArray.Count();
+    aIdArray.Reset();
+    aIdArray.ReserveL( count );
+    for ( TInt i = 0; i < count; i++ )
+        {
+        aIdArray.AppendL( IdL( *aMediaArray.AtL( i ) ).iId1 );
+        }
+    }
+
+#ifdef _DEBUG
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::PrintOpenFileHandlesL
+// ----------------------------------------------------------------------------
+//
+void TVcxMyVideosCollectionUtil::PrintOpenFileHandlesL( const TDesC& aFileName, RFs& aFs )
+    {
+
+#ifdef _DEBUG
+    TPtrC fileName( aFileName.Mid(2) );
+    MPX_DEBUG2("TVcxMyVideosCollectionUtil :: Checking open file handles to %S", &fileName);
+#endif
+
+    CFileList* fileList = 0;
+
+    TOpenFileScan fileScan( aFs );
+
+    fileScan.NextL( fileList );   
+  
+    while ( fileList )   
+        {
+        for (TInt i = 0; i < fileList->Count(); i++ )   
+            {   
+            if ( (*fileList)[i].iName == aFileName.Mid(2) )
+                {
+                TFullName processName;
+                GetProcessName( fileScan.ThreadId(), processName );
+                MPX_DEBUG3("TVcxMyVideosCollectionUtil:: %S has a file handle open to %S.", &processName, &(*fileList)[i].iName);
+                }
+            }
+
+        fileScan.NextL( fileList );   
+        }
+    }   
+
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::GetProcessName
+// ----------------------------------------------------------------------------
+//
+void TVcxMyVideosCollectionUtil::GetProcessName( TInt aThreadId, TFullName& aProcessName )
+    {
+    _LIT(KAsterixDes, "*");
+  	TFindThread find( KAsterixDes );
+  	while( find.Next( aProcessName ) == KErrNone )
+        {
+      	RThread thread;
+      	TInt err = thread.Open( aProcessName );
+      	
+      	if ( err == KErrNone )
+      	    {
+      	    if ( thread.Id().Id() ==  aThreadId )
+      	        {
+      	        aProcessName = thread.Name();
+                thread.Close();
+                return;
+      	        }
+      	         	
+      	    thread.Close();
+      	    }
+        }
+    aProcessName = KNullDesC;
+    }   
+#endif
+   
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosdriveinfo.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,30 @@
+/*
+* 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 "vcxmyvideosdriveinfo.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+TVcxMyVideosDriveInfo::TVcxMyVideosDriveInfo()
+    : iDrive( 0 )
+    , iFlags( 0 )
+    {
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosdrivemonitor.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,763 @@
+/*
+* 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: 
+*
+*/
+
+
+
+
+
+// INCLUDE FILES
+#include <mpxlog.h>
+#include <vcxmyvideosdefs.h>
+#include "vcxmyvideosdrivemonitor.h"
+#include "vcxmyvideosdrivemonitorevent.h"
+#include <bldvariant.hrh>
+#include <driveinfo.h> //multiple drive stuff
+#include <centralrepository.h>
+
+// EXTERNAL DATA STRUCTURES
+
+// EXTERNAL FUNCTION PROTOTYPES  
+
+// CONSTANTS
+#ifdef _DEBUG
+_LIT( KVcxMyVideosMediaNotPresentDes, "EMediaNotPresent");
+_LIT( KVcxMyVideosMediaUnknownDes, "EMediaUnknown");
+_LIT( KVcxMyVideosMediaFloppyDes, "EMediaFloppy");
+_LIT( KVcxMyVideosMediaHardDiskDes, "EMediaHardDisk");
+_LIT( KVcxMyVideosMediaCdRomDes, "EMediaCdRom");
+_LIT( KVcxMyVideosMediaRamDes, "EMediaRam");
+_LIT( KVcxMyVideosMediaFlashDes, "EMediaFlash");
+_LIT( KVcxMyVideosMediaRomDes, "EMediaRom");
+_LIT( KVcxMyVideosMediaRemoteDes, "EMediaRemote");
+_LIT( KVcxMyVideosMediaNANDFlashDes, "EMediaNANDFlash");
+#endif
+
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosDriveMonitor::CVcxMyVideosDriveMonitor
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CVcxMyVideosDriveMonitor::CVcxMyVideosDriveMonitor()
+: CActive( EPriorityStandard )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosDriveMonitor::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CVcxMyVideosDriveMonitor::ConstructL( const RFs& aFileSession )
+    {
+    iFs                  = aFileSession;
+    iIfsIsProvidedByUser = ETrue;
+   
+    ConstructL();    
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosDriveMonitor::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CVcxMyVideosDriveMonitor::ConstructL()
+    {
+    iObservers.Reset();
+    iAvailableDrives.Reset();
+    iPreviousAvailableDrives.Reset();
+    
+    if ( !iIfsIsProvidedByUser )
+        {
+        User::LeaveIfError( iFs.Connect() );
+        }
+        
+    CActiveScheduler::Add( this );
+    RefreshAvailableDrivesL();
+
+#if 0
+    MPX_DEBUG2("CVcxMyVideosDriveMonitor:: PhoneMemoryDrive() returns %d",
+        PhoneMemoryDrive());
+#endif
+    MPX_DEBUG2("CVcxMyVideosDriveMonitor:: MemoryCardDrive() returns %d",
+        MemoryCardDrive());
+    MPX_DEBUG2("CVcxMyVideosDriveMonitor:: MassStorageDrive() returns %d",
+        MassStorageDrive());
+#if 0
+    MPX_DEBUG2("CVcxMyVideosDriveMonitor:: FixedDrive(c-drive excluded) returns %d",
+        FixedDrive( ETrue ));
+#endif
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosDriveMonitor::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CVcxMyVideosDriveMonitor* CVcxMyVideosDriveMonitor::NewL()
+    {
+    CVcxMyVideosDriveMonitor* self = new( ELeave ) CVcxMyVideosDriveMonitor();
+        
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop(self);
+
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosDriveMonitor::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CVcxMyVideosDriveMonitor* CVcxMyVideosDriveMonitor::NewL( const RFs& aFileSession )
+    {
+    CVcxMyVideosDriveMonitor* self = new( ELeave ) CVcxMyVideosDriveMonitor();
+        
+    CleanupStack::PushL( self );
+    self->ConstructL( aFileSession );
+    CleanupStack::Pop(self);
+
+    return self;
+    }
+    
+// Destructor
+CVcxMyVideosDriveMonitor::~CVcxMyVideosDriveMonitor()
+    {
+    iObservers.Close();
+    iAvailableDrives.Close();
+    iPreviousAvailableDrives.Close();
+    Cancel();
+    
+    if ( !iIfsIsProvidedByUser )
+        {
+        iFs.Close();
+        }
+    }
+
+/*
+N96 without memory card:
+26/09/2007	11:37:22	CIptvDriveMonitor:: drive[2]: type = EMediaNANDFlash
+26/09/2007	11:37:22	CIptvDriveMonitor::           MediaAtt flags = 104 DriveAtt flags = 11
+26/09/2007	11:37:22	CIptvDriveMonitor:: drive[3]: type = EMediaRam
+26/09/2007	11:37:22	CIptvDriveMonitor::           MediaAtt flags = 5 DriveAtt flags = 11
+26/09/2007	11:37:22	CIptvDriveMonitor:: drive[4]: type = EMediaHardDisk
+26/09/2007	11:37:22	CIptvDriveMonitor::           MediaAtt flags = 14 DriveAtt flags = 21
+26/09/2007	11:37:22	CIptvDriveMonitor:: drive[5]: type = EMediaNotPresent
+26/09/2007	11:37:22	CIptvDriveMonitor::           MediaAtt flags = 0 DriveAtt flags = 21
+26/09/2007	11:37:22	CIptvDriveMonitor:: drive[25]: type = EMediaRom
+26/09/2007	11:37:22	CIptvDriveMonitor::           MediaAtt flags = 8 DriveAtt flags = 12
+
+N96 with memory card:
+27/09/2007	6:01:07	CIptvDriveMonitor:: drive[2]: type = EMediaNANDFlash
+27/09/2007	6:01:07	CIptvDriveMonitor::           MediaAtt flags = 104 DriveAtt flags = 11
+27/09/2007	6:01:07	CIptvDriveMonitor:: drive[3]: type = EMediaRam
+27/09/2007	6:01:07	CIptvDriveMonitor::           MediaAtt flags = 5 DriveAtt flags = 11
+27/09/2007	6:01:07	CIptvDriveMonitor:: drive[4]: type = EMediaHardDisk
+27/09/2007	6:01:07	CIptvDriveMonitor::           MediaAtt flags = 14 DriveAtt flags = 21
+27/09/2007	6:01:07	CIptvDriveMonitor:: drive[5]: type = EMediaHardDisk
+27/09/2007	6:01:07	CIptvDriveMonitor::           MediaAtt flags = 14 DriveAtt flags = 21
+27/09/2007	6:01:07	CIptvDriveMonitor:: drive[25]: type = EMediaRom
+27/09/2007	6:01:07	CIptvDriveMonitor::           MediaAtt flags = 8 DriveAtt flags = 12
+
+N95:
+
+N95 8GB:
+
+*/
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosDriveMonitor::RefreshAvailableDrivesL
+// -----------------------------------------------------------------------------
+//
+void CVcxMyVideosDriveMonitor::RefreshAvailableDrivesL()
+    {
+    MPX_FUNC("CVcxMyVideosDriveMonitor::RefreshAvailableDrivesL()");
+    
+    TDriveList driveList;
+    User::LeaveIfError( iFs.DriveList( driveList ) );
+
+    iPreviousAvailableDrives.Reset();
+    TInt i;
+    for ( i = 0; i < iAvailableDrives.Count(); i++ )
+        {
+        iPreviousAvailableDrives.Append( iAvailableDrives[i] );
+        }
+            
+    iAvailableDrives.Reset();
+    
+    for ( i = 0; i < driveList.Length(); i++ )
+        {
+        if ( driveList[i] != 0 && i != EDriveY ) // N95 8GB has a 1MB small flash drive at y-drive, rule it out
+            {
+            TDriveInfo driveInfo;
+            User::LeaveIfError( iFs.Drive( driveInfo, i ) );
+            
+            /*
+            From e32cost.h:
+            const TUint KMediaAttVariableSize   = 0x01;
+            const TUint KMediaAttDualDensity    = 0x02;
+            const TUint KMediaAttFormattable    = 0x04;
+            const TUint KMediaAttWriteProtected = 0x08;
+            const TUint KMediaAttLockable       = 0x10;
+            const TUint KMediaAttLocked         = 0x20;
+            const TUint KMediaAttHasPassword    = 0x40;
+            const TUint KMediaAttReadWhileWrite = 0x80;
+            const TUint KMediaAttDeleteNotify   = 0x100;
+            
+            The drive attributes.    
+            
+            const TUint KDriveAttLocal          = 0x01;
+            const TUint KDriveAttRom            = 0x02;
+            const TUint KDriveAttRedirected     = 0x04;
+            const TUint KDriveAttSubsted        = 0x08;
+            const TUint KDriveAttInternal       = 0x10;
+            const TUint KDriveAttRemovable      = 0x20;
+            const TUint KDriveAttRemote         = 0x40;
+            const TUint KDriveAttTransaction    = 0x80;
+            */
+
+            MPX_DEBUG3("CVcxMyVideosDriveMonitor:: drive[%d]: type = %S",
+                    i, &DriveTypeDes( driveInfo.iType ));
+
+            MPX_DEBUG3(
+                "CVcxMyVideosDriveMonitor::           MediaAtt flags = %x DriveAtt flags = %x",
+                    driveInfo.iMediaAtt,
+                    driveInfo.iDriveAtt );
+
+#ifdef __WINSCW__
+            // (2) c-drive is EMediaRam
+            // (3) d-drive is EMediaHardDisk
+            // (4) e-drive is EMediaHardDisk or EMediaNotPresent
+            // (25) z-drive is EMediaRom
+            if ( (driveInfo.iType == EMediaRam) ||                                     // c
+                 ((driveInfo.iType == EMediaHardDisk) && i != EDriveD /* skip d */) || // e
+                 (driveInfo.iType == EMediaNANDFlash) ||                               // nothing
+                 (driveInfo.iType == EMediaNotPresent) )                               // e
+#else
+            // (2) c-drive is EMediaNANDFlash
+            // (3) d-drive is EMediaRam
+            // (4) e-drive is EMediaHardDisk or EMediaNotPresent
+            // (5) f-drive is EMediaHardDisk or EMediaNotPresent
+            // (25) z-drive is EMediaRom
+            if ( (driveInfo.iType == EMediaHardDisk) ||  // e,f
+                 (driveInfo.iType == EMediaNANDFlash) || // c
+                 (driveInfo.iType == EMediaNotPresent) ) // e,f
+#endif // __WINSCW__
+                {                
+                if ( !(driveInfo.iMediaAtt & KMediaAttWriteProtected) &&
+                      (driveInfo.iDriveAtt & KDriveAttLocal) )
+                    {
+                    TVcxMyVideosDriveInfo iptvDriveInfo;
+                    TVolumeInfo volumeInfo;
+                    TChar ch;
+
+                    iFs.DriveToChar( i, ch );
+
+                    iptvDriveInfo.iDrive     = i;
+                    iptvDriveInfo.iDriveChar = ch;
+                    iptvDriveInfo.iType      = driveInfo.iType;
+
+                    TUint driveStatus;
+                    TInt err = DriveInfo::GetDriveStatus( iFs, i, driveStatus );
+                    if ( err == KErrNone )
+                        {
+                        if ( driveStatus & DriveInfo::EDriveRemovable )
+                            {
+                            iptvDriveInfo.iFlags |= TVcxMyVideosDriveInfo::ERemovable;
+                            }
+                        }
+
+                    TInt massStorageDrive;
+                    err = DriveInfo::GetDefaultDrive( DriveInfo::EDefaultMassStorage,
+                                                      massStorageDrive );
+                    if ( err == KErrNone )
+                        {
+                        if ( i == massStorageDrive )
+                            {
+                            iptvDriveInfo.iFlags |= TVcxMyVideosDriveInfo::EMassStorage;
+                            }                        
+                        }
+
+                    if ( driveInfo.iMediaAtt & KMediaAttLocked )
+                        {
+                        iptvDriveInfo.iFlags |= TVcxMyVideosDriveInfo::ELocked;
+                        }
+                    if ( driveInfo.iType == EMediaNotPresent )
+                        {
+                        iptvDriveInfo.iFlags |= TVcxMyVideosDriveInfo::EMediaNotPresent;
+                        }
+
+                    // When mass storage mode is activated while application is running,
+                    // the only hint about that is the TVolumeInfo not being available. 
+                    // Therefore we mark drive as EMediaNotPresent if that structure
+                    // is not available.
+                    if ( iFs.Volume( volumeInfo, i ) != KErrNone )
+                        {
+                        iptvDriveInfo.iFlags |= TVcxMyVideosDriveInfo::EMediaNotPresent;
+                        iptvDriveInfo.iVolumeName.Zero();
+                        }
+                    else
+                        {
+                        iptvDriveInfo.iVolumeName = volumeInfo.iName;
+                        }
+
+                    if ( iptvDriveInfo.iFlags & TVcxMyVideosDriveInfo::EMediaNotPresent )
+                        {
+                        iptvDriveInfo.iFlags |= TVcxMyVideosDriveInfo::ERemovable;
+                        }
+
+                    iAvailableDrives.AppendL( iptvDriveInfo );
+                    }
+                }
+            }
+        } // for
+
+    // if e and f-drives are available, then c-drive is removed from the available drives list
+    if ( ArrayPos( EDriveE ) != KErrNotFound &&
+         ArrayPos( EDriveF ) != KErrNotFound )
+        {
+        TInt cDrivePos = ArrayPos( EDriveC );
+        if ( cDrivePos != KErrNotFound )
+            {
+            MPX_DEBUG1(
+                "CIptvDriveMonitor:: e & f-drives available -> removing c from available drives");
+            iAvailableDrives.Remove( cDrivePos );
+            iAvailableDrives.Compress();
+            }
+        }    
+    }
+    
+// -----------------------------------------------------------------------------
+// CVcxMyVideosDriveMonitor::ArrayPos
+// -----------------------------------------------------------------------------
+//
+TInt CVcxMyVideosDriveMonitor::ArrayPos( TInt aDrive )
+    {
+    TInt i;
+    for (i = 0; i < iAvailableDrives.Count(); i++ )
+        {
+        if ( iAvailableDrives[i].iDrive == aDrive )
+            {
+            return i;
+            }
+        }
+    return KErrNotFound;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosDriveMonitor::ArrayPosL
+// -----------------------------------------------------------------------------
+//
+TInt CVcxMyVideosDriveMonitor::ArrayPosL( TInt aDrive )
+    {
+    TInt pos;
+    User::LeaveIfError( pos = ArrayPos( aDrive ) );
+    return pos;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosDriveMonitor::MemoryCardDriveL
+// -----------------------------------------------------------------------------
+//
+TInt CVcxMyVideosDriveMonitor::MemoryCardDriveL()
+    {
+    TInt drive;
+    User::LeaveIfError( drive = MemoryCardDrive() );
+    return drive;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosDriveMonitor::MemoryCardDrive
+// -----------------------------------------------------------------------------
+//
+TInt CVcxMyVideosDriveMonitor::MemoryCardDrive()
+    {
+    TInt i;
+    for ( i = 0; i < iAvailableDrives.Count(); i++ )
+        {
+        if ( iAvailableDrives[i].iFlags & TVcxMyVideosDriveInfo::ERemovable )
+            {
+            return iAvailableDrives[i].iDrive;
+            }
+        }
+    return KErrNotFound;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosDriveMonitor::MassStorageDriveL
+// -----------------------------------------------------------------------------
+//
+TInt CVcxMyVideosDriveMonitor::MassStorageDriveL()
+    {
+    TInt drive;
+    User::LeaveIfError( drive = MassStorageDrive() );
+    return drive;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosDriveMonitor::MassStorageDrive
+// -----------------------------------------------------------------------------
+//
+TInt CVcxMyVideosDriveMonitor::MassStorageDrive()
+    {
+    TInt i;
+    for ( i = 0; i < iAvailableDrives.Count(); i++ )
+        {
+        if ( iAvailableDrives[i].iFlags & TVcxMyVideosDriveInfo::EMassStorage )
+            {
+            return iAvailableDrives[i].iDrive;
+            }
+        }
+    return KErrNotFound;
+    }
+    
+// -----------------------------------------------------------------------------
+// CVcxMyVideosDriveMonitor::RunL()
+// -----------------------------------------------------------------------------
+//
+void CVcxMyVideosDriveMonitor::RunL()
+    {
+    MPX_FUNC("CVcxMyVideosDriveMonitor::RunL()");
+    
+    if ( iStatus == KErrNone )
+        {        
+        iFs.NotifyChange( ENotifyDisk, iStatus );
+        
+        TRAPD( err, RefreshAvailableDrivesL() );
+        if ( err != KErrNone )
+            {
+            MPX_DEBUG2("CVcxMyVideosDriveMonitor:: RefreshAvailableDrivesL leaved with error code %d, ignoring", err);
+            } 
+        CompareOldAndNewAvailableDrives();
+        SetActive();
+        }
+    else
+        {
+        iFs.NotifyChange( ENotifyDisk, iStatus );
+        SetActive();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosDriveMonitor::DoCancel()
+// -----------------------------------------------------------------------------
+//
+void CVcxMyVideosDriveMonitor::DoCancel()
+    {
+    iFs.NotifyChangeCancel( iStatus );
+    }       
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosDriveMonitor::RunError()
+// -----------------------------------------------------------------------------
+//
+TInt CVcxMyVideosDriveMonitor::RunError( TInt /* aError */ )
+    {
+    MPX_DEBUG1("CVcxMyVideosDriveMonitor::RunL() leaved (should never happen).");
+    return KErrNone;
+    }       
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosDriveMonitor::SendEvent()
+// -----------------------------------------------------------------------------
+//
+void CVcxMyVideosDriveMonitor::SendEvent( TVcxMyVideosDriveMonitorEvent::TEvent aEvent,
+    TInt aDrive )
+    {
+    MPX_DEBUG4("CVcxMyVideosDriveMonitor:: Sending event: %S(%d), drive: %d",
+            &TVcxMyVideosDriveMonitorEvent::EventDes( aEvent ),
+            aEvent,
+            aDrive );
+
+    TVcxMyVideosDriveMonitorEvent event;
+        
+    for ( TInt i = 0; i < iObservers.Count(); i++ )
+        {
+        event.iEvent = static_cast<TInt>(aEvent);
+        event.iDrive = aDrive;
+        iObservers[i]->HandleDriveMonitorEvent( event );
+        }
+
+#ifdef _DEBUG
+    PrintAvailableDrives();
+#endif
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosDriveMonitor::CompareOldAndNewAvailableDrives
+// -----------------------------------------------------------------------------
+//
+void CVcxMyVideosDriveMonitor::CompareOldAndNewAvailableDrives()
+    {
+    // Run through old drives list to detect changes
+    TInt i;
+    for ( i = 0; i < iPreviousAvailableDrives.Count(); i++ )
+        {
+        TInt pos = ArrayPos( iPreviousAvailableDrives[i].iDrive );
+        if ( pos == KErrNotFound )
+            {
+            // drive was dismounted
+            SendEvent( TVcxMyVideosDriveMonitorEvent::EDriveDismounted,
+                iPreviousAvailableDrives[i].iDrive );
+            }
+        else 
+            {
+            // drive still present
+            if ( iPreviousAvailableDrives[i].iFlags != iAvailableDrives[pos].iFlags )
+                {
+                // drive was changed
+                if ( (iPreviousAvailableDrives[i].iFlags & TVcxMyVideosDriveInfo::EMediaNotPresent) && 
+                     !(iAvailableDrives[pos].iFlags & EMediaNotPresent) )
+                    {
+                    SendEvent( TVcxMyVideosDriveMonitorEvent::EMediaInserted,
+                        iAvailableDrives[pos].iDrive );
+                    }
+                    
+                if ( !(iPreviousAvailableDrives[i].iFlags & TVcxMyVideosDriveInfo::EMediaNotPresent) && 
+                     (iAvailableDrives[pos].iFlags & TVcxMyVideosDriveInfo::EMediaNotPresent) )
+                    {
+                    SendEvent( TVcxMyVideosDriveMonitorEvent::EMediaRemoved,
+                        iAvailableDrives[pos].iDrive );
+                    }
+
+                if ( !(iPreviousAvailableDrives[i].iFlags & TVcxMyVideosDriveInfo::ELocked) && 
+                     (iAvailableDrives[pos].iFlags & TVcxMyVideosDriveInfo::ELocked) )
+                    {
+                    SendEvent( TVcxMyVideosDriveMonitorEvent::EDriveLocked,
+                        iAvailableDrives[pos].iDrive );
+                    }
+
+                if ( (iPreviousAvailableDrives[i].iFlags & TVcxMyVideosDriveInfo::ELocked) && 
+                     !(iAvailableDrives[pos].iFlags & TVcxMyVideosDriveInfo::ELocked) )
+                    {
+                    SendEvent( TVcxMyVideosDriveMonitorEvent::EDriveUnlocked,
+                        iAvailableDrives[pos].iDrive );
+                    }
+                    
+                }
+            // drive volume name was changed
+            if ( iPreviousAvailableDrives[i].iVolumeName.Compare( 
+                 iAvailableDrives[pos].iVolumeName ) != 0 )
+                {
+                SendEvent( TVcxMyVideosDriveMonitorEvent::EDriveVolumeNameChanged, 
+                    iAvailableDrives[pos].iDrive ); 
+                }
+            }
+        }
+
+    // Run through new drives list to detect mounted drives
+    for ( i = 0; i < iAvailableDrives.Count(); i++ )
+        {
+        TBool found = EFalse;
+        for ( TInt j = 0; j < iPreviousAvailableDrives.Count(); j++ )
+            {
+            if ( iPreviousAvailableDrives[j].iDrive == iAvailableDrives[i].iDrive )
+                {
+                found = ETrue;
+                break;
+                }
+            }
+        if ( !found )
+            {
+            SendEvent( TVcxMyVideosDriveMonitorEvent::EDriveMounted,
+                iAvailableDrives[i].iDrive );
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosDriveMonitor::DriveType()
+// -----------------------------------------------------------------------------
+//
+#ifdef _DEBUG 
+const TDesC& CVcxMyVideosDriveMonitor::DriveTypeDes( TInt aType )
+    {
+    switch (aType)
+        {     
+        case EMediaNotPresent:
+            return KVcxMyVideosMediaNotPresentDes;
+	      case EMediaUnknown:
+            return KVcxMyVideosMediaUnknownDes;
+        case EMediaFloppy:
+            return KVcxMyVideosMediaFloppyDes;
+        case EMediaHardDisk:
+            return KVcxMyVideosMediaHardDiskDes;
+        case EMediaCdRom:
+            return KVcxMyVideosMediaCdRomDes;
+        case EMediaRam:
+            return KVcxMyVideosMediaRamDes;
+        case EMediaFlash:
+            return KVcxMyVideosMediaFlashDes;
+        case EMediaRom:
+            return KVcxMyVideosMediaRomDes;
+        case EMediaRemote:
+            return KVcxMyVideosMediaRemoteDes;
+        case EMediaNANDFlash:
+            return KVcxMyVideosMediaNANDFlashDes;
+        default:
+            return KVcxMyVideosMediaUnknownDes;
+        }
+    }
+#else
+const TDesC& CVcxMyVideosDriveMonitor::DriveTypeDes( TInt /*aType*/ )
+    {
+    return KNullDesC;
+    }
+#endif
+    
+// -----------------------------------------------------------------------------
+// CVcxMyVideosDriveMonitor::PrintAvailableDrives()
+// -----------------------------------------------------------------------------
+//
+void CVcxMyVideosDriveMonitor::PrintAvailableDrives()
+    {
+#ifdef _DEBUG 
+    for ( TInt i = 0; i < iAvailableDrives.Count(); i++ )
+        {
+        MPX_DEBUG3("CVcxMyVideosDriveMonitor:: iAvailableDrives[%d].iDrive = %d",
+            i, iAvailableDrives[i].iDrive);
+        MPX_DEBUG2("    ERemovableDrive  = %d",
+            !!(iAvailableDrives[i].iFlags & TVcxMyVideosDriveInfo::ERemovable));
+        MPX_DEBUG2("    EMassStorage     = %d",
+            !!(iAvailableDrives[i].iFlags & TVcxMyVideosDriveInfo::EMassStorage));
+        MPX_DEBUG2("    ELockedDrive     = %d",
+            !!(iAvailableDrives[i].iFlags & TVcxMyVideosDriveInfo::ELocked));
+        MPX_DEBUG2("    EMediaNotPresent = %d",
+            !!(iAvailableDrives[i].iFlags & TVcxMyVideosDriveInfo::EMediaNotPresent));
+        }
+#endif
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosDriveMonitor::GetPreferredMemoryL
+// Gets the preferred memory, this doesn't mean yet that it can be actually used.
+// Media might not be present or it might be locked.
+// -----------------------------------------------------------------------------
+//
+void CVcxMyVideosDriveMonitor::GetPreferredMemoryL( TInt& aPreferredMemory )
+    {
+    MPX_FUNC("CVcxMyVideosDriveMonitor::GetPreferredMemoryL()");
+    
+    TInt cenRepMemory = KErrNotFound; //init to some non valid drive value, in case that cenrep wont change it at all
+    
+    TUid uid;
+    uid.iUid = KVcxMyVideosCenRepUid;
+    CRepository* cenRep = CRepository::NewL( uid );
+    CleanupStack::PushL( cenRep ); // 1->
+
+    TInt cenRepError = cenRep->Get( KVcxMyVideosCenRepPreferredMemoryKey, cenRepMemory );
+                
+    aPreferredMemory = EDriveC;
+        
+    if ( ArrayPos( cenRepMemory ) == KErrNotFound
+        || cenRepError != KErrNone )
+        {
+        MPX_DEBUG1(
+            "CVcxMyVideosDriveMonitor:: cenrep value for used memory was not valid or not found.");
+
+        // Non existing drive or no cen rep value -> figure out the default drive
+        TInt massStorageDrive = MassStorageDrive();
+        if ( massStorageDrive != KErrNotFound )
+            {
+            MPX_DEBUG1("CVcxMyVideosDriveMonitor:: using mass storage");
+            aPreferredMemory = massStorageDrive;
+            }
+        else
+            {    
+            TInt memoryCardDrive  = MemoryCardDrive();
+            if ( memoryCardDrive != KErrNotFound )
+                {
+                MPX_DEBUG1("CVcxMyVideosDriveMonitor:: using memory card");
+                aPreferredMemory = memoryCardDrive;
+                }
+            }
+
+        MPX_DEBUG2(
+            "CVcxMyVideosDriveMonitor:: writing new value to cenrep (%d)", aPreferredMemory);
+
+        cenRep->Set( KVcxMyVideosCenRepPreferredMemoryKey, aPreferredMemory );
+        }
+    else
+        {
+        //Cenrep value was valid, use it
+        MPX_DEBUG1(
+            "CVcxMyVideosDriveMonitor:: cenrep value for used memory was valid, using it.");
+        aPreferredMemory = cenRepMemory;
+        }
+
+    CleanupStack::PopAndDestroy( cenRep ); // <-1
+            
+    MPX_DEBUG2("CVcxMyVideosDriveMonitor:: preferred memory: %d", aPreferredMemory);
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosDriveMonitor::GetUsedMemoryL
+// Gets the memory for usage. Tries first the preferred memory, if it is not
+// available (locked or not present), tries the next drive from iAvailable drives.
+// If suitable drive is not found, returns system drive (c-drive).
+// -----------------------------------------------------------------------------
+//
+void CVcxMyVideosDriveMonitor::GetUsedMemoryL( TInt& aUsedMemory )
+    {
+    TInt preferredDrive;
+    GetPreferredMemoryL( preferredDrive );
+    
+    TInt startPos   = ArrayPos( preferredDrive );
+    TInt currentPos = startPos;
+    TUint32 flags;
+    TBool found = EFalse;
+    while ( !found )
+        {
+        flags = iAvailableDrives[currentPos].iFlags;
+    
+        if ( (flags & TVcxMyVideosDriveInfo::ELocked) ||
+            (flags & TVcxMyVideosDriveInfo::EMediaNotPresent) )
+            {
+            MPX_DEBUG1("CVcxMyVideosDownloadUtil:: drive was locked or not present -> trying next available drive");
+            currentPos++;
+            if ( currentPos > (iAvailableDrives.Count()-1) )
+                {
+                currentPos = 0;
+                }
+            if ( currentPos == startPos )
+                {
+                // we went full round and couldnt find drive -> use c-drive
+                MPX_DEBUG1("CVcxMyVideosDownloadUtil:: no suitable drive found from iAvailable drives, using c-drive");
+                aUsedMemory = iFs.GetSystemDrive();
+                found       = ETrue;
+                }
+            }
+        else
+            {
+            aUsedMemory = iAvailableDrives[currentPos].iDrive;
+            found       = ETrue;
+            }
+        }
+    MPX_DEBUG2("CVcxMyVideosDownloadUtil::GetUsedMemoryL() returns %d", aUsedMemory);
+    }
+        
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosdrivemonitorevent.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,86 @@
+/*
+* 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 "vcxmyvideosdrivemonitorevent.h"
+
+#ifdef _DEBUG
+_LIT(KIptvDmeMediaRemovedDes, "EMediaRemoved");
+_LIT(KIptvDmeMediaInsertedDes, "EMediaInserted");
+_LIT(KIptvDmeDriveLockedDes, "EDriveLocked");
+_LIT(KIptvDmeDriveUnlockedDes, "EDriveUnlocked");
+_LIT(KIptvDmeDriveMountedDes, "EDriveMounted");
+_LIT(KIptvDmeDriveDismountedDes, "EDriveDismounted");
+_LIT(KIptvDmeDriveVolumeNameChangedDes, "EDriveVolumeNameChanged");
+_LIT(KIptvDmeUnknownDes, "Unknown");
+#endif
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+TVcxMyVideosDriveMonitorEvent::TVcxMyVideosDriveMonitorEvent()
+    : iEvent( ENone )
+    , iDrive( -1 )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// TVcxMyVideosDriveMonitorEvent::EventDes()
+// -----------------------------------------------------------------------------
+//
+#ifdef _DEBUG
+const TDesC& TVcxMyVideosDriveMonitorEvent::EventDes( TVcxMyVideosDriveMonitorEvent::TEvent aEvent )
+    {
+    switch ( aEvent )
+        {
+        case EMediaRemoved:
+            return KIptvDmeMediaRemovedDes;
+            
+        case EMediaInserted:
+            return KIptvDmeMediaInsertedDes;
+
+        case EDriveLocked:
+            return KIptvDmeDriveLockedDes;
+
+        case EDriveUnlocked:
+            return KIptvDmeDriveUnlockedDes;
+
+        case EDriveMounted:
+            return KIptvDmeDriveMountedDes;
+
+        case EDriveDismounted:
+            return KIptvDmeDriveDismountedDes;
+        
+        case EDriveVolumeNameChanged:
+            return KIptvDmeDriveVolumeNameChangedDes;
+
+        default:
+            return KIptvDmeUnknownDes;
+        }
+    }
+    
+#else
+
+const TDesC& TVcxMyVideosDriveMonitorEvent::EventDes( TVcxMyVideosDriveMonitorEvent::TEvent /*aEvent*/ )
+    {
+    return KNullDesC;
+    }
+
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosmdsalbums.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,1081 @@
+/*
+* 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 <e32base.h>
+#include <mpxlog.h>
+#include <mdesession.h>
+#include <mdeconstants.h>
+#include <mdequery.h>
+#include <mpxmedia.h>
+#include <mpxmediaarray.h>
+#include <mpxmediacontainerdefs.h>
+#include <mpxmediageneraldefs.h>
+#include "vcxmyvideosmdsalbums.h"
+#include "vcxmyvideosmdsdb.h"
+#include "vcxmyvideoscollectionutil.h"
+#include "vcxmyvideosmdscmdqueue.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 )
+    {
+    MPX_DEBUG1("CVcxMyVideosMdsAlbums::CancelQueries() start");
+
+    if ( aType == CVcxMyVideosMdsDb::EAll || aType == CVcxMyVideosMdsDb::EGetAlbums )
+        {
+        if ( iAlbumQuery )
+            {
+            iAlbumQuery->Cancel();
+            }
+        }
+
+    if ( aType == CVcxMyVideosMdsDb::EAll || aType == CVcxMyVideosMdsDb::EGetAlbumContentIds )
+        {
+        if ( iRelationQuery )
+            {
+            iRelationQuery->Cancel();
+            }
+        }
+
+    if ( aType == CVcxMyVideosMdsDb::EAll || aType == CVcxMyVideosMdsDb::EGetAlbumContentVideos )
+        {
+        if ( iVideoQuery )
+            {
+            iVideoQuery->Cancel();
+            }
+        }
+
+    if ( aType == CVcxMyVideosMdsDb::EAll || aType == CVcxMyVideosMdsDb::EAddVideosToAlbum
+            || aType == CVcxMyVideosMdsDb::ERemoveRelations
+            || aType == CVcxMyVideosMdsDb::ERemoveAlbums )
+        {
+        
+        // MDS does not offer cancel for these
+        //Cancel();
+        }
+
+    MPX_DEBUG1("CVcxMyVideosMdsAlbums::CancelQueries() exit");
+    }
+
+// ---------------------------------------------------------------------------
+// From CActive
+// CVcxMyVideosMdsAlbums::DoCancel
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::DoCancel()
+    {
+    MPX_DEBUG1("CVcxMyVideosMdsAlbums::DoCancel() start");
+
+    // MDS does not offer way to cancel these async requests
+    
+    MPX_DEBUG1("CVcxMyVideosMdsAlbums::DoCancel() exit");
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::SetObservingL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::SetObservingL()
+    {
+    if ( iObserver )
+        {
+        //ENotifyAdd and ENotifyModify are not supported
+        iMdsDb.MdsSessionL().AddRelationItemObserverL( *this, NULL,
+                ENotifyRemove, iMdsDb.iNamespaceDef );
+
+#if 0
+        // We receive only IDs from here. We need to make query to get
+        // relation objects-> slow to use. We use the response from
+        // the add operation instead. This way we don't receive
+        // add events if someone else adds videos to our albums
+        // but the performance is the best possible.
+        iMdsDb.MdsSessionL().AddRelationObserverL( *this, NULL,
+                ENotifyAdd | ENotifyModify | ENotifyRemove );        
+#endif    
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::GetAlbumsL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::GetAlbumsL( CMPXMedia* aAlbumList,
+        MVcxMyVideosMdsAlbumsObserver& aClient )
+    {
+    CVcxMyVideosMdsCmdGetAlbums* cmd = new (ELeave) CVcxMyVideosMdsCmdGetAlbums;
+    CleanupStack::PushL( cmd );
+    cmd->iCmdType   = CVcxMyVideosMdsDb::EGetAlbums;
+    cmd->iClient    = &aClient;
+    cmd->iAlbumList = aAlbumList;
+    iMdsDb.iCmdQueue->ExecuteCmdL( cmd ); //owneship moves
+    CleanupStack::Pop( cmd );
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::GetAlbumL
+// ---------------------------------------------------------------------------
+//
+CMPXMedia* CVcxMyVideosMdsAlbums::GetAlbumL( TUint32 aId )
+    {
+    CMdEObject* object = iMdsDb.ObjectL( aId, EFalse /* is not video, is album */);
+
+    if ( !object )
+        {
+        MPX_DEBUG2("CVcxMyVideosMdsAlbums:: mds id %d not found from mds", aId);
+        return NULL;
+        }
+        
+    CleanupStack::PushL( object ); // 1->
+
+    CMPXMedia* album = CMPXMedia::NewL( );
+    CleanupStack::PushL( album ); // 2->
+
+    Object2MediaL( *object, *album );
+
+    CleanupStack::Pop( album );            // <-2
+    CleanupStack::PopAndDestroy( object ); // <-1
+
+    return album;
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::DoGetAlbumsL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::DoGetAlbumsL( CMPXMedia* aAlbumList,
+        MVcxMyVideosMdsAlbumsObserver& aClient )
+    {
+    MPX_DEBUG1("CVcxMyVideosMdsAlbums::DoGetAlbumsL() start");
+    
+    iAlbumList = aAlbumList; //store pointer to album list, we do not own this
+    iClient    = &aClient;
+    
+    delete iAlbumQuery;
+    iAlbumQuery = NULL;
+    
+    iAlbumQuery = iMdsDb.MdsSessionL().NewObjectQueryL( *iNamespaceDef, *iAlbumObjectDef, this );
+
+    CMdELogicCondition& rootCondition = iAlbumQuery->Conditions();
+    rootCondition.SetOperator( ELogicConditionOperatorOr );
+    rootCondition.AddObjectConditionL( *iAlbumObjectDef );
+
+    iAlbumQuery->FindL();
+
+    MPX_DEBUG1("CVcxMyVideosMdsAlbums::DoGetAlbumsL() exit");
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::GetAlbumContentIdsL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::GetAlbumContentIdsL( TUint32 aAlbumId,
+        RArray<TVcxMyVideosAlbumVideo>& aContentArray,
+        MVcxMyVideosMdsAlbumsObserver& aClient )
+    {
+    CVcxMyVideosMdsCmdGetAlbumContentIds* cmd = new (ELeave) CVcxMyVideosMdsCmdGetAlbumContentIds;
+    CleanupStack::PushL( cmd ); // 1->
+    cmd->iCmdType      = CVcxMyVideosMdsDb::EGetAlbumContentIds;
+    cmd->iClient       = &aClient;
+    cmd->iAlbumId      = aAlbumId;
+    cmd->iAlbumContent = &aContentArray;
+    iMdsDb.iCmdQueue->ExecuteCmdL( cmd ); //owneship moves
+    CleanupStack::Pop( cmd ); // <-1
+    }
+    
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::DoGetAlbumContentIdsL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::DoGetAlbumContentIdsL( TUint32 aAlbumId,
+        RArray<TVcxMyVideosAlbumVideo>& aContentArray,
+        MVcxMyVideosMdsAlbumsObserver& aClient )
+    {
+    MPX_DEBUG1("CVcxMyVideosMdsAlbums::DoGetAlbumContentIdsL() start");
+        
+    delete iRelationQuery;
+    iRelationQuery = NULL;
+    
+    iClient       = &aClient;
+    iAlbumId      = aAlbumId;
+    iAlbumContent = &aContentArray;
+    
+    iRelationQuery = iMdsDb.MdsSessionL().NewRelationQueryL( *iNamespaceDef, this );
+
+    CMdELogicCondition& rootCondition = iRelationQuery->Conditions();
+
+    //relation left side contains and...
+    CMdERelationCondition& relationCondition =
+        rootCondition.AddRelationConditionL( *iContainsRelationDef, ERelationConditionSideLeft); // "AND"
+    
+    CMdELogicCondition& leftCondition = relationCondition.LeftL();
+    CMdELogicCondition& rightCondition = relationCondition.RightL();
+    
+    //...left side is album...
+    leftCondition.AddObjectConditionL( *iAlbumObjectDef );
+    //...and left id is aAlbumId..
+    leftCondition.AddObjectConditionL( aAlbumId );
+    
+    //Right side is video
+    rightCondition.AddObjectConditionL( *iMdsDb.iVideoObjectDef ); 
+    
+    iRelationQuery->FindL();
+
+    MPX_DEBUG1("CVcxMyVideosMdsAlbums::DoGetAlbumContentIdsL() exit");
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::GetAlbumContentVideosL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::GetAlbumContentVideosL( TUint32 aAlbumId, CMPXMedia& aVideoList,
+        MVcxMyVideosMdsAlbumsObserver& aClient )
+    {
+    MPX_DEBUG1("CVcxMyVideosMdsAlbums::GetAlbumContentVideosL() start");
+    
+    CVcxMyVideosMdsCmdGetAlbumContentVideos* cmd = new (ELeave) CVcxMyVideosMdsCmdGetAlbumContentVideos;
+    CleanupStack::PushL( cmd ); // 1->
+    cmd->iCmdType            = CVcxMyVideosMdsDb::EGetAlbumContentVideos;
+    cmd->iClient             = &aClient;
+    cmd->iAlbumId            = aAlbumId;
+    cmd->iAlbumContentVideos = &aVideoList;
+    iMdsDb.iCmdQueue->ExecuteCmdL( cmd ); //owneship moves
+    CleanupStack::Pop( cmd ); // <-1
+    MPX_DEBUG1("CVcxMyVideosMdsAlbums::GetAlbumContentVideosL() exit");
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::DoGetAlbumContentVideosL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::DoGetAlbumContentVideosL( TUint32 aAlbumId, CMPXMedia& aVideoList,
+        MVcxMyVideosMdsAlbumsObserver& aClient )
+    {
+    MPX_DEBUG1("CVcxMyVideosMdsAlbums::DoGetAlbumContentVideosL() start");
+    
+    delete iVideoQuery;
+    iVideoQuery = NULL;
+
+    iClient    = &aClient;
+    iVideoList = &aVideoList;
+    iAlbumId   = aAlbumId;
+    
+    iVideoQuery = iMdsDb.MdsSessionL().NewObjectQueryL( *iNamespaceDef, *iMdsDb.iVideoObjectDef, this );
+    CMdELogicCondition& rootCondition = iVideoQuery->Conditions();
+    CMdERelationCondition& relationCondition = 
+            rootCondition.AddRelationConditionL( *iContainsRelationDef );
+
+    CMdELogicCondition& leftCondition = relationCondition.LeftL();
+
+    //...left side is an album...
+    leftCondition.AddObjectConditionL( *iAlbumObjectDef );
+    //...and left id is aAlbumId..
+    leftCondition.AddObjectConditionL( aAlbumId );
+
+    //and queried object is on the right side of the relation
+    relationCondition.SetSide( ERelationConditionSideRight );
+    
+    const TInt maxItemsInQueryResult = 500;
+    iVideoQuery->FindL( KMdEQueryDefaultMaxCount, maxItemsInQueryResult );
+    
+    MPX_DEBUG1("CVcxMyVideosMdsAlbums::DoGetAlbumContentVideosL() exit");
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::GetSchemaDefinitionsL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::GetSchemaDefinitionsL()
+    {
+    iNamespaceDef = &(iMdsDb.MdsSessionL().GetDefaultNamespaceDefL());
+    
+    _LIT( KVcxAlbumObjectName, "Album" );
+    iAlbumObjectDef = &(iNamespaceDef->GetObjectDefL( KVcxAlbumObjectName ));
+
+    _LIT( KVcxTypePropertyName, "Type" );
+    iTypePropertyDef = &(iAlbumObjectDef->GetPropertyDefL( KVcxTypePropertyName ));
+
+    _LIT( KVcxContainsRelationName, "Contains" );
+    iContainsRelationDef =
+        &(iNamespaceDef->GetRelationDefL( KVcxContainsRelationName ));
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::Object2MediaL
+// For album objects only.
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::Object2MediaL(
+        CMdEObject& aObject,
+        CMPXMedia& aAlbum )
+    {    
+    aAlbum.SetTObjectValueL<TMPXGeneralType>(KMPXMediaGeneralType, EMPXGroup );
+   
+    CMdEProperty* property = NULL;
+
+    // ID
+    TMPXItemId mpxId;
+    mpxId.iId1 = aObject.Id();
+    mpxId.iId2 = KVcxMvcMediaTypeAlbum;
+    aAlbum.SetTObjectValueL<TMPXItemId>( KMPXMediaGeneralId, mpxId );
+    
+    // TITLE
+    if ( aObject.Property( *iMdsDb.iTitlePropertyDef, property, 0 ) != KErrNotFound )
+        {
+        aAlbum.SetTextValueL( KMPXMediaGeneralTitle,
+                static_cast<CMdETextProperty*>(property)->Value());
+        }
+       
+    // CREATION DATE
+    if ( aObject.Property( *iMdsDb.iCreationDatePropertyDef, property, 0 ) != KErrNotFound )
+        {
+        aAlbum.SetTObjectValueL<TInt64>( KMPXMediaGeneralDate,
+                static_cast<CMdETimeProperty*>(property)->Value().Int64() );
+        }
+              
+    // MODIFIED DATE
+    if ( aObject.Property( *iMdsDb.iLastModifiedDatePropertyDef, property, 0 ) != KErrNotFound )
+        {
+        aAlbum.SetTObjectValueL<TInt64>( KVcxMediaMyVideosModifiedDate,
+                static_cast<CMdETimeProperty*>(property)->Value().Int64() );
+        }
+
+#if 0 //TODO
+    // ALBUM TYPE
+    if ( aObject.Property( *iTypePropertyDef, property, 0 ) != KErrNotFound )
+        {
+        aAlbum.SetTObjectValueL<TUint16>( KVcxMediaMyVideosAlbumType,
+                static_cast<CMdETUint16Property*>(property)->Value() );
+        }
+#endif
+
+    //TODO: usage count
+    
+    aAlbum.SetTObjectValueL( KMPXMediaGeneralType, EMPXGroup );
+    aAlbum.SetTObjectValueL( KMPXMediaGeneralCategory, EMPXNoCategory );
+    aAlbum.SetTObjectValueL( KVcxMediaMyVideosCategoryItemCount, 0 );
+    aAlbum.SetTObjectValueL( KVcxMediaMyVideosCategoryNewItemCount, 0 );
+
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::Media2ObjectL
+// Called by AddAlbumL()
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::Media2ObjectL(
+        CMPXMedia& aAlbum,
+        CMdEObject& aObject)
+    {
+    CMdEProperty* property;
+
+    // MDS ID
+    
+    // TITLE (NAME)
+    if ( aAlbum.IsSupported( KMPXMediaGeneralTitle ) )
+        {
+        if ( TVcxMyVideosCollectionUtil::Title( aAlbum ).Length() > KVcxMvcMaxTitleLength )
+            {
+            User::Leave( KErrArgument );
+            }
+        
+        if ( aObject.Property( *iMdsDb.iTitlePropertyDef, property, 0 ) != KErrNotFound )
+            {
+            static_cast<CMdETextProperty*>(property)->SetValueL(
+                    aAlbum.ValueText( KMPXMediaGeneralTitle ) );
+            }
+        else
+            {
+            aObject.AddTextPropertyL(
+                    *iMdsDb.iTitlePropertyDef, aAlbum.ValueText( KMPXMediaGeneralTitle ) );
+            }
+        }
+        
+    // KMPXMediaGeneralDate ( creation date )
+    if ( aAlbum.IsSupported( KMPXMediaGeneralDate ) )
+        {
+        TInt64 creationDateInt64 = 0;
+        creationDateInt64 = aAlbum.ValueTObjectL<TInt64>( KMPXMediaGeneralDate );
+        TTime creationDate( creationDateInt64 );
+        if ( aObject.Property( *iMdsDb.iCreationDatePropertyDef, property, 0 ) != KErrNotFound )
+            {
+            static_cast<CMdETimeProperty*>(property)->SetValueL( creationDate );
+            }
+        else
+            {
+            aObject.AddTimePropertyL( *iMdsDb.iCreationDatePropertyDef, creationDate );
+            }
+        }
+        
+    // KVcxMediaMyVideosModifiedDate
+    if ( aAlbum.IsSupported( KVcxMediaMyVideosModifiedDate ) )
+        {
+        TInt64 modifiedDateInt64 = aAlbum.ValueTObjectL<TInt64>( KVcxMediaMyVideosModifiedDate );
+        TTime modifiedDate( modifiedDateInt64 );
+        if ( aObject.Property( *iMdsDb.iLastModifiedDatePropertyDef, property, 0 ) != KErrNotFound )
+            {
+            static_cast<CMdETimeProperty*>(property)->SetValueL( modifiedDate );
+            }
+        else
+            {
+            aObject.AddTimePropertyL( *iMdsDb.iLastModifiedDatePropertyDef, modifiedDate );
+            }
+        }        
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::GetSchemaDefinitionsL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::HandleQueryNewResults(CMdEQuery& aQuery,
+            TInt aFirstNewItemIndex,
+            TInt aNewItemCount )
+    {
+    if ( &aQuery == iVideoQuery )
+        {
+        TRAPD( err, HandleVideoQueryResultsL( aQuery, KErrNone,
+                aFirstNewItemIndex, aNewItemCount, EFalse /* completed */ ) );
+        if ( err != KErrNone )
+            {
+            MPX_DEBUG2("CVcxMyVideosMdsAlbums:: HandleVideoQueryResultsL() left: %d", err);
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::HandleQueryCompleted
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::HandleQueryCompleted( CMdEQuery& aQuery, TInt aError )
+    {
+    if ( &aQuery == iAlbumQuery )
+        {
+        TRAPD( err, HandleAlbumQueryCompletedL( aQuery, aError ) );
+        if ( err != KErrNone )
+            {
+            MPX_DEBUG2("CVcxMyVideosMdsAlbums:: HandleAlbumQueryCompletedL() left: %d", err);
+            }
+        }
+    else if ( &aQuery == iVideoQuery )
+        {
+        TRAPD( err, HandleVideoQueryResultsL( aQuery, aError, 0, 0, ETrue /* completed */ ) );
+        if ( err != KErrNone )
+            {
+            MPX_DEBUG2("CVcxMyVideosMdsAlbums:: HandleVideoQueryResultsL() left: %d", err);
+            }
+        }
+    else if ( &aQuery == iRelationQuery )
+        {
+        TRAPD( err, HandleRelationQueryCompletedL( aQuery, aError ) );
+        if ( err != KErrNone )
+            {
+            MPX_DEBUG2("CVcxMyVideosMdsAlbums:: HandleRelationQueryCompletedL() left: %d", err);
+            }
+        }
+
+    iMdsDb.iCmdQueue->CmdFinished();
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::HandleAlbumQueryCompletedL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::HandleAlbumQueryCompletedL( CMdEQuery& /*aQuery*/, TInt aError )
+    {
+    MPX_DEBUG1("CVcxMyVideosMdsAlbums::HandleAlbumQueryCompletedL() start");
+    
+    if ( aError != KErrNone )
+        {
+        MPX_DEBUG2("CVcxMyVideosMdsAlbums:: object query failed with error: %d", aError);
+        return;
+        }
+    
+    CMPXMediaArray* array = iAlbumList->Value<CMPXMediaArray>( KMPXMediaArrayContents );
+    
+    CMPXMedia* media;    
+    TInt count = iAlbumQuery->Count();
+    
+    iAlbumList->SetTObjectValueL<TInt>( KMPXMediaArrayCount, count );
+    
+    for ( TInt i = 0; i < count; i++ )
+        {
+        CMdEObject& object = iAlbumQuery->Result( i );
+
+        media = CMPXMedia::NewL();
+        CleanupStack::PushL( media ); // 1->
+
+        Object2MediaL( object, *media );
+        
+#ifdef _DEBUG
+        TBuf<KVcxMvcMaxTitleLength> title;
+        title = TVcxMyVideosCollectionUtil::Title( *media );
+        MPX_DEBUG2("CVcxMyVideosMdsAlbums:: object title: %S", &title);
+#endif        
+
+        array->AppendL( media );
+
+        CleanupStack::Pop( media ); // <-1
+        }
+    
+    iClient->HandleGetAlbumsResp( iAlbumList );
+    iAlbumList = NULL;
+    
+    MPX_DEBUG1("CVcxMyVideosMdsAlbums::HandleAlbumQueryCompletedL() exit");
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::HandleVideoQueryCompletedL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::HandleVideoQueryResultsL( CMdEQuery& /*aQuery*/, TInt aError,
+    TInt aFirstNewItemIndex, TInt aNewItemCount, TBool aComplete  )
+    {
+    MPX_DEBUG1("CVcxMyVideosMdsAlbums::HandleVideoQueryResultsL() start");
+    
+    if ( aComplete )
+        {
+        // error code given only if completed
+        if ( aError != KErrNone )
+            {
+            MPX_DEBUG2("CVcxMyVideosMdsAlbums:: object query failed with error: %d", aError);
+            }
+
+        iClient->HandleGetAlbumContentVideosResp( iAlbumId, *iVideoList, 
+                aError, aFirstNewItemIndex, aNewItemCount, aComplete );
+        return;
+        }
+    
+    CMPXMediaArray* array = iVideoList->Value<CMPXMediaArray>( KMPXMediaArrayContents );
+    
+    CMPXMedia* media;    
+    TInt count = iVideoQuery->Count();
+    
+    iVideoList->SetTObjectValueL<TInt>( KMPXMediaArrayCount, count );
+    
+    for ( TInt i = aFirstNewItemIndex; i < count; i++ )
+        {
+        CMdEObject& object = iVideoQuery->Result( i );
+
+        media = CMPXMedia::NewL();
+        CleanupStack::PushL( media ); // 1->
+
+        iMdsDb.Object2MediaL( object, *media );
+        
+#ifdef _DEBUG
+        TBuf<256> title;
+        title = TVcxMyVideosCollectionUtil::Title( *media );
+        MPX_DEBUG2("CVcxMyVideosMdsAlbums:: object title: %S", &title);
+#endif        
+
+        array->AppendL( media );
+
+        CleanupStack::Pop( media ); // <-1
+        }
+    
+    iClient->HandleGetAlbumContentVideosResp( iAlbumId, *iVideoList, 
+            aError, aFirstNewItemIndex, aNewItemCount, aComplete );
+    iVideoList = NULL;
+    
+    MPX_DEBUG1("CVcxMyVideosMdsAlbums::HandleVideoQueryResultsL() exit");
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::HandleRelationQueryCompletedL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::HandleRelationQueryCompletedL( CMdEQuery& /*aQuery*/, TInt aError )
+    {
+    MPX_DEBUG1("CVcxMyVideosMdsAlbums::HandleRelationQueryCompletedL() start");
+    
+    if ( aError != KErrNone )
+        {
+        MPX_DEBUG2("CVcxMyVideosMdsAlbums:: relation query failed with error: %d", aError);
+        return;
+        }
+            
+    TInt count = iRelationQuery->Count();
+    TVcxMyVideosAlbumVideo video;
+    for ( TInt i = 0; i < count; i++ )
+        {
+        MPX_DEBUG4("Relation (id = %d): %d contains %d", iRelationQuery->Result( i ).Id(),
+                iRelationQuery->Result( i ).LeftObjectId(),
+                iRelationQuery->Result( i ).RightObjectId());
+        video.iMdsId         = iRelationQuery->Result( i ).RightObjectId();
+        video.iRelationMdsId = iRelationQuery->Result( i ).Id();
+        iAlbumContent->AppendL( video );
+        }
+    
+    iClient->HandleGetAlbumContentIdsResp( iAlbumId, *iAlbumContent );
+
+    MPX_DEBUG1("CVcxMyVideosMdsAlbums::HandleRelationQueryCompletedL() exit");
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::AddVideosToAlbumL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::AddVideosToAlbumL( CMPXMedia* aCmd,
+        MVcxMyVideosMdsAlbumsObserver& aClient )
+    {
+    MPX_DEBUG1("CVcxMyVideosMdsAlbums::AddVideosToAlbumL() start");
+    
+    CVcxMyVideosMdsCmdAddVideosToAlbum* cmd = new (ELeave) CVcxMyVideosMdsCmdAddVideosToAlbum;
+    CleanupStack::PushL( cmd ); // 1->
+    cmd->iCmdType  = CVcxMyVideosMdsDb::EAddVideosToAlbum;
+    cmd->iClient   = &aClient;
+    cmd->iMpxCmd   = aCmd;
+    iMdsDb.iCmdQueue->ExecuteCmdL( cmd ); //ownership moves
+    CleanupStack::Pop( cmd ); // <-1
+    MPX_DEBUG1("CVcxMyVideosMdsAlbums::AddVideosToAlbumL() exit");
+    }
+    
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::DoAddVideosToAlbumL
+// Called by iMdsDb.iCmdQueue
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::DoAddVideosToAlbumL( CMPXMedia* aCmd,
+        MVcxMyVideosMdsAlbumsObserver& aClient )
+    {
+    iItemArray.Reset();
+    iResultBuffer.Close();
+    CMdERelation* relation;
+    CMPXMediaArray* videoArray = TVcxMyVideosCollectionUtil::MediaArrayL( *aCmd );
+    
+    TInt albumId = TVcxMyVideosCollectionUtil::Uint32ValueL( *aCmd );
+    
+    TInt count = videoArray->Count();
+    iItemArray.Reserve( count );
+    for ( TInt i = 0; i < count; i++ )
+        {
+        // Filter already failed items out from the request (KErrAlreadyExists)
+        if ( TVcxMyVideosCollectionUtil::Int32ValueL( *videoArray->AtL( i ) ) 
+                != KErrAlreadyExists )
+            {
+            relation = iMdsDb.MdsSessionL().NewRelationL(
+                    *iContainsRelationDef, albumId,
+                    TVcxMyVideosCollectionUtil::IdL( *videoArray->AtL( i ) ) );
+            CleanupStack::PushL( relation );
+            iItemArray.AppendL( relation );
+            CleanupStack::Pop( relation );        
+            }
+        }
+    
+    iClient = &aClient;
+    iMpxCmd = aCmd;
+
+    iAsyncOperation = EVcxAddVideosToAlbum;
+
+    iMdsDb.MdsSessionL().AddItemsAsyncL( iItemArray, iStatus, iResultBuffer );
+    SetActive();
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::RemoveRelationsL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::RemoveRelationsL( RArray<TUint32>& aRelationIds,
+        RArray<TUint32>& aResults, MVcxMyVideosMdsAlbumsObserver& aClient )
+    {
+    MPX_DEBUG1("CVcxMyVideosMdsAlbums::RemoveRelationsL() start");
+    
+    CVcxMyVideosMdsCmdRemoveRelations* cmd = new (ELeave) CVcxMyVideosMdsCmdRemoveRelations;
+    CleanupStack::PushL( cmd ); // 1->
+    cmd->iCmdType     = CVcxMyVideosMdsDb::ERemoveRelations;
+    cmd->iClient      = &aClient;
+    cmd->iRelationIds = &aRelationIds;
+    cmd->iResults     = &aResults;
+    iMdsDb.iCmdQueue->ExecuteCmdL( cmd ); //owneship moves
+    CleanupStack::Pop( cmd ); // <-1
+    MPX_DEBUG1("CVcxMyVideosMdsAlbums::RemoveRelationsL() exit");    
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::DoRemoveRelationsL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::DoRemoveRelationsL( RArray<TUint32>& aRelationIds,
+        RArray<TUint32>& aResults, MVcxMyVideosMdsAlbumsObserver& aClient )
+    {
+    MPX_DEBUG1("CVcxMyVideosMdsAlbums::DoRemoveRelationsL() start");
+
+    iResultBuffer.Close();
+    
+    iClient            = &aClient;
+    iResultArrayUint32 = &aResults;
+    iIdArray           = &aRelationIds;
+    
+    iAsyncOperation = EVcxRemoveRelations;
+    
+    iMdsDb.MdsSessionL().RemoveRelationsAsyncL( *iIdArray, iStatus, iResultBuffer, iNamespaceDef );
+    SetActive();
+    
+    MPX_DEBUG1("CVcxMyVideosMdsAlbums::DoRemoveRelationsL() exit");
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::AddAlbumL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::AddAlbumL( CMPXMedia& aAlbum )
+    {
+    MPX_DEBUG1("CVcxMyVideosMdsAlbums::AddAlbumL() start");
+             
+    CMdEObject* object = iMdsDb.MdsSessionL().NewObjectLC(
+            *iAlbumObjectDef, KNullDesC ); // 1->
+
+    Media2ObjectL( aAlbum, *object );
+    iMdsDb.SetCreationAndModifiedDatesL( *object );
+
+    TUint32 mdsId;
+
+#ifdef _DEBUG
+    TRAPD( err, mdsId = iMdsDb.MdsSessionL().AddObjectL( *object ) );
+
+    if ( err != KErrNone )
+        {
+        MPX_DEBUG2( "CVcxMyVideosMdsAlbums:: iMdsDb.MdsSessionL().AddObjectL leaved with error: %d", err );
+        User::Leave( err );
+        }
+#else
+
+    mdsId = iMdsDb.MdsSessionL().AddObjectL( *object );
+
+#endif
+    
+    if ( mdsId == KNoId )
+        {
+        MPX_DEBUG1( "CVcxMyVideosMdsAlbums::AddAlbumL could not add new album" );
+        User::Leave( KErrGeneral );
+        }
+    
+    MPX_DEBUG2( "CVcxMyVideosMdsAlbums::AddAlbumL album created, mds id: %d", mdsId );
+
+    aAlbum.SetTObjectValueL<TMPXItemId>( KMPXMediaGeneralId, TMPXItemId( mdsId, KVcxMvcMediaTypeAlbum ) );
+    
+    CleanupStack::PopAndDestroy( object ); // <-1
+    
+    MPX_DEBUG1("CVcxMyVideosMdsAlbums::AddAlbumL() exit");
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::SetAlbumL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::SetAlbumL( CMPXMedia& aVideo )
+    {
+    MPX_DEBUG1("CVcxMyVideosMdsDb::SetAlbumL() start");
+
+    TMPXItemId mpxId = TVcxMyVideosCollectionUtil::IdL( aVideo );
+
+    MPX_DEBUG2("CVcxMyVideosMdsAlbums::SetAlbumL updating object %d ", mpxId.iId1);
+    
+    CMdEObject* object =
+            iMdsDb.MdsSessionL().OpenObjectL( mpxId.iId1, *iAlbumObjectDef );
+    if ( !object )
+        {
+        // No object with this ID was found!
+        MPX_DEBUG1("CVcxMyVideosMdsAlbums::SetAlbumL no object found");
+        User::Leave( KErrNotFound );
+        }
+    else
+        {
+        MPX_DEBUG1("CVcxMyVideosMdsAlbums::SetAlbumL object found");
+        
+        if ( object->OpenForModifications() )
+            {
+            CleanupStack::PushL( object ); // 1->
+            
+            Media2ObjectL( aVideo, *object );
+            
+            iMdsDb.MdsSessionL().CommitObjectL( *object );
+
+            CleanupStack::PopAndDestroy( object );
+            }
+        else
+            {
+            // Object is already locked!
+            MPX_DEBUG1("CVcxMyVideosMdsAlbums::SetAlbumL object was locked!");
+            delete object;
+            User::Leave( KErrInUse );
+            }
+        }
+
+    MPX_DEBUG1("CVcxMyVideosMdsDb::SetAlbumL() exit");
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::RemoveAlbumsL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::RemoveAlbumsL( CMPXMedia* aMpxCmd, MVcxMyVideosMdsAlbumsObserver& aClient )
+    {
+    MPX_DEBUG1("CVcxMyVideosMdsAlbums::RemoveAlbumsL() start");
+    
+    CVcxMyVideosMdsCmdRemoveAlbums* cmd = new (ELeave) CVcxMyVideosMdsCmdRemoveAlbums;
+    CleanupStack::PushL( cmd ); // 1->
+    cmd->iCmdType  = CVcxMyVideosMdsDb::ERemoveAlbums;
+    cmd->iClient   = &aClient;
+    cmd->iMpxCmd   = aMpxCmd;
+    iMdsDb.iCmdQueue->ExecuteCmdL( cmd ); //owneship moves
+    CleanupStack::Pop( cmd ); // <-1
+    MPX_DEBUG1("CVcxMyVideosMdsAlbums::RemoveAlbumsL() exit");    
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::DoRemoveAlbumsL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::DoRemoveAlbumsL( CMPXMedia* aMpxCmd,
+        MVcxMyVideosMdsAlbumsObserver& aClient )
+    {
+    MPX_DEBUG1("CVcxMyVideosMdsAlbums::DoRemoveAlbumsL() start");
+
+    iResultBuffer.Close();
+
+    iClient = &aClient;
+    iMpxCmd = aMpxCmd;
+    
+    RArray<TUint32> idArray;
+    CleanupClosePushL( idArray );
+
+    CMPXMediaArray* mediaArray = TVcxMyVideosCollectionUtil::MediaArrayL( *aMpxCmd );
+
+    TVcxMyVideosCollectionUtil::GetIdsFromMediaArrayL( *mediaArray, idArray );
+    
+    iAsyncOperation = EVcxRemoveAlbums;
+    
+    iMdsDb.MdsSessionL().RemoveObjectsAsyncL( idArray, iStatus, iResultBuffer, iNamespaceDef );
+    
+    CleanupStack::PopAndDestroy( &idArray );
+    SetActive();
+
+    MPX_DEBUG1("CVcxMyVideosMdsAlbums::DoRemoveAlbumsL() exit");    
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::RunL
+// From CActive.
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::RunL()
+    {
+#ifdef _DEBUG
+    TInt status = iStatus.Int();
+    if ( status != KErrNone )
+        {
+        MPX_DEBUG2("CVcxMyVideosMdsAlbums::RunL() iStatus = %d", status);
+        }
+#endif
+    
+    switch ( iAsyncOperation )
+        {
+        case EVcxAddVideosToAlbum:
+            {
+            HandleAddVideosToAlbumCompletedL();
+            }
+            break;
+            
+        case EVcxRemoveRelations:
+            HandleRemoveRelationsCompletedL();
+            break;
+            
+        case EVcxRemoveAlbums:
+            HandleRemoveAlbumsCompletedL();
+            break;
+        }
+
+    iMdsDb.iCmdQueue->CmdFinished();
+    }
+
+//TODO: implement RunError
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::HandleAddVideosToAlbumCompletedL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::HandleAddVideosToAlbumCompletedL()
+    {
+    MPX_DEBUG1("CVcxMyVideosMdsAlbums::HandleAddVideosToAlbumCompletedL() start");
+    
+    iMdsDb.MdsSessionL().DeserializeItemsL( iResultBuffer, iItemArray );
+    
+    iClient->HandleAddVideosToAlbumResp( iMpxCmd, iItemArray );
+    iResultBuffer.Close();
+    iItemArray.Close();    
+
+    MPX_DEBUG1("CVcxMyVideosMdsAlbums::HandleAddVideosToAlbumCompletedL() exit");
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::HandleRemoveRelationsCompletedL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::HandleRemoveRelationsCompletedL()
+    {
+    MPX_DEBUG1("CVcxMyVideosMdsAlbums::HandleRemoveRelationsCompletedL() start");
+    
+    iMdsDb.MdsSessionL().DeserializeIdsL( iResultBuffer, NULL, NULL, iResultArrayUint32 );
+
+#ifdef _DEBUG
+    TItemId result;
+    TInt count = iResultArrayUint32->Count();
+    for ( TInt i = 0; i < count; i++ )
+        {
+        result = (*iResultArrayUint32)[i];
+        MPX_DEBUG3("relation remove result[%d] = %d", i, result);
+        }
+#endif
+    
+    iClient->HandleRemoveRelationsResp( *iIdArray, *iResultArrayUint32 );
+
+    MPX_DEBUG1("CVcxMyVideosMdsAlbums::HandleRemoveRelationsCompletedL() exit");
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::HandleRemoveAlbumsCompletedL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::HandleRemoveAlbumsCompletedL()
+    {
+    MPX_DEBUG1("CVcxMyVideosMdsAlbums::HandleRemoveAlbumsCompletedL() start");
+
+    RArray<TUint32> resultArray;
+    resultArray.Reset();
+    CleanupClosePushL( resultArray );
+    
+    iMdsDb.MdsSessionL().DeserializeIdsL( iResultBuffer, &resultArray, NULL, NULL  );
+
+#ifdef _DEBUG
+    TItemId result;
+    TInt count = resultArray.Count();
+
+    MPX_DEBUG2("CVcxMyVideosMdsAlbums:: remove albums result count = %d", count);
+
+    for ( TInt i = 0; i < count; i++ )
+        {
+        result = resultArray[i];
+        MPX_DEBUG3("CVcxMyVideosMdsAlbums:: remove albums result[%d] = %d", i, result);
+        }
+#endif
+
+    iClient->HandleRemoveAlbumsResp( iMpxCmd, resultArray );
+
+    CleanupStack::PopAndDestroy( &resultArray );
+    
+    MPX_DEBUG1("CVcxMyVideosMdsAlbums::HandleRemoveRelationsCompletedL() exit");
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::HandleRelationItemNotification
+// From MMdERelationItemObserver
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::HandleRelationItemNotification(CMdESession& /*aSession*/, 
+        TObserverNotificationType aType,
+        const RArray<TMdERelation>& aRelationArray)
+    {
+    if ( iObserver )
+        {
+        iObserver->HandleRelationEvent( aType, aRelationArray );
+        }
+    }
+
+#if 0
+// ----------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::HandleRelationNotification
+// From MMdERelationObserver
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::HandleRelationNotification(CMdESession& /*aSession*/, 
+        TObserverNotificationType aType,
+        const RArray<TItemId>& aRelationIdArray)
+    {    
+    switch ( aType )
+        {
+        case ENotifyAdd:
+            MPX_DEBUG1("CVcxMyVideosMdsAlbums:: relation ENotifyAdd");
+            if ( iObserver )
+                {
+                iObserver->HandleRelationIdEvent( aType, aRelationIdArray );
+                }
+            break;
+        case ENotifyModify:
+            MPX_DEBUG1("CVcxMyVideosMdsAlbums:: ENotifyModify");
+            break;
+        case ENotifyRemove:
+            //remove is handled at HandleRelationItemNotification
+            break;
+        }
+    }
+#endif
+
+// END OF FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosmdscmdqueue.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,231 @@
+/*
+* 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:  Queues commands to MDS.
+*
+*/
+
+
+// INCLUDE FILES
+#include <e32base.h>
+#include <mpxlog.h>
+#include "vcxmyvideosmdscmdqueue.h"
+#include "vcxmyvideosmdsdb.h"
+#include "vcxmyvideosmdsalbums.h"
+
+
+// ============================ MEMBER FUNCTIONS =============================
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CVcxMyVideosMdsCmdQueue::CVcxMyVideosMdsCmdQueue( CVcxMyVideosMdsDb& aMdsDb )
+: iMdsDb( aMdsDb )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// 2nd-phase constructor
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsCmdQueue::ConstructL()
+    {
+    iQueue.Reset();    
+    }
+
+// ---------------------------------------------------------------------------
+// Two-Phase Constructor
+// ---------------------------------------------------------------------------
+//
+CVcxMyVideosMdsCmdQueue* CVcxMyVideosMdsCmdQueue::NewL( CVcxMyVideosMdsDb& aMdsDb )
+    {
+    CVcxMyVideosMdsCmdQueue* self = new(ELeave) CVcxMyVideosMdsCmdQueue( aMdsDb );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CVcxMyVideosMdsCmdQueue::~CVcxMyVideosMdsCmdQueue()
+    {
+    for ( TInt i = 0; i < iQueue.Count(); i++ )
+        {
+        delete iQueue[i];
+        }
+    iQueue.Close();
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsCmdQueue::Cancel
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsCmdQueue::Cancel( CVcxMyVideosMdsDb::TRequestType aType )
+    {
+    TInt count = iQueue.Count()-1;
+    for ( TInt i = count; i >= 0; i-- )
+        {
+        if ( iQueue[i]->iCmdType == aType || aType == CVcxMyVideosMdsDb::EAll )
+            {
+            delete iQueue[i];
+            iQueue[i] = NULL;
+            iQueue.Remove( i );
+            }
+        }    
+    iQueue.Compress();
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsCmdQueue::ExecuteCmdL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsCmdQueue::ExecuteCmdL( CVcxMyVideosMdsCmd* aCmd )
+    {    
+    if ( iQueue.Count() == 0 && !iCmdInProgress )
+        {
+        DoExecuteCmdL( aCmd ); //ownership does not move
+        delete aCmd;
+        }
+    else
+        {
+        iQueue.AppendL( aCmd );
+        }    
+    }
+    
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsCmdQueue::CmdFinished
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsCmdQueue::CmdFinished()
+    {
+    iCmdInProgress = EFalse;
+
+    TInt err( KErrGeneral );
+    while ( err != KErrNone )
+        {
+        if ( iQueue.Count() == 0 )
+            {
+            break;
+            }
+                            
+        TInt cmdIndexToExecute;
+        // Let other commads bypass EGetVideoList
+        if ( iQueue.Count() > 1 && iQueue[0]->iCmdType == CVcxMyVideosMdsDb::EGetVideoList )
+            {
+            cmdIndexToExecute = 1;
+            }
+        else
+            {
+            cmdIndexToExecute = 0;
+            }
+        TRAP( err, DoExecuteCmdL( iQueue[cmdIndexToExecute] ) ); //ownership does not move
+        delete iQueue[cmdIndexToExecute];
+        iQueue[cmdIndexToExecute] = NULL;
+        iQueue.Remove( cmdIndexToExecute );
+        iQueue.Compress();
+        
+#ifdef _DEBUG
+        if ( err != KErrNone )
+            {
+            MPX_DEBUG2("CVcxMyVideosMdsCmdQueue:: MDS cmd failed: %d", err);
+            }
+#endif
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsCmdQueue::DoExecuteCmdL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsCmdQueue::DoExecuteCmdL( CVcxMyVideosMdsCmd* aCmd )
+    {    
+    switch ( aCmd->iCmdType )
+        {
+        case CVcxMyVideosMdsDb::EGetVideoList:
+            {
+            CVcxMyVideosMdsCmdGetVideoList* cmd =
+                    static_cast<CVcxMyVideosMdsCmdGetVideoList*>( aCmd );
+            iMdsDb.DoCreateVideoListL( cmd->iSortingOrder,
+                    cmd->iAscending,
+                    cmd->iFullDetails,
+                    *cmd->iVideoList );
+            iCmdInProgress = ETrue;
+            }
+            break;
+        
+        case CVcxMyVideosMdsDb::EGetAlbums:
+            {
+            CVcxMyVideosMdsCmdGetAlbums* cmd = static_cast<CVcxMyVideosMdsCmdGetAlbums*>( aCmd );
+            iMdsDb.iAlbums->DoGetAlbumsL( cmd->iAlbumList, *cmd->iClient );
+            iCmdInProgress = ETrue;
+            }
+            break;
+
+        case CVcxMyVideosMdsDb::EGetAlbumContentIds:
+            {
+            CVcxMyVideosMdsCmdGetAlbumContentIds* cmd =
+                    static_cast<CVcxMyVideosMdsCmdGetAlbumContentIds*>( aCmd );
+            iMdsDb.iAlbums->DoGetAlbumContentIdsL( cmd->iAlbumId, *cmd->iAlbumContent,
+                    *cmd->iClient );
+            iCmdInProgress = ETrue;
+            }
+            break;
+
+        case CVcxMyVideosMdsDb::EGetAlbumContentVideos:
+            {
+            CVcxMyVideosMdsCmdGetAlbumContentVideos* cmd =
+                    static_cast<CVcxMyVideosMdsCmdGetAlbumContentVideos*>( aCmd );
+            iMdsDb.iAlbums->DoGetAlbumContentVideosL( cmd->iAlbumId, *cmd->iAlbumContentVideos,
+                    *cmd->iClient );
+            iCmdInProgress = ETrue;
+            }
+            break;
+            
+        case CVcxMyVideosMdsDb::EAddVideosToAlbum:
+            {
+            CVcxMyVideosMdsCmdAddVideosToAlbum* cmd =
+                    static_cast<CVcxMyVideosMdsCmdAddVideosToAlbum*>( aCmd );
+            iMdsDb.iAlbums->DoAddVideosToAlbumL( cmd->iMpxCmd,
+                    *cmd->iClient );
+            iCmdInProgress = ETrue;
+            }
+            break;
+
+        case CVcxMyVideosMdsDb::ERemoveRelations:
+            {
+            CVcxMyVideosMdsCmdRemoveRelations* cmd =
+                    static_cast<CVcxMyVideosMdsCmdRemoveRelations*>( aCmd );
+            iMdsDb.iAlbums->DoRemoveRelationsL( *cmd->iRelationIds, *cmd->iResults,
+                    *cmd->iClient );
+            iCmdInProgress = ETrue;
+            }
+            break;
+            
+        case CVcxMyVideosMdsDb::ERemoveAlbums:
+            {
+            CVcxMyVideosMdsCmdRemoveAlbums* cmd =
+                    static_cast<CVcxMyVideosMdsCmdRemoveAlbums*>( aCmd );
+            iMdsDb.iAlbums->DoRemoveAlbumsL( cmd->iMpxCmd, *cmd->iClient );
+            iCmdInProgress = ETrue;
+            }
+            break;
+
+        default:
+            break;
+        }    
+    }    
+// END OF FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosmdsdb.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,1788 @@
+/*
+* 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 <harvesterclient.h>
+#include <mpxlog.h>
+#include <mdeconstants.h>
+#include <mdequery.h>
+#include <bautils.h>
+#include <mpxmedia.h>
+#include <vcxmyvideosdefs.h>
+#include <mpxmediacontainerdefs.h>
+#include <mpxmediageneraldefs.h>
+#include <mpxmediageneralextdefs.h>
+#include <mpxmediaarray.h>
+#include <mpxmediavideodefs.h>
+#include "vcxmyvideosmdsdb.h"
+#include "vcxmyvideoscollectionutil.h"
+#include "vcxmyvideosmdsalbums.h"
+#include "vcxmyvideoscollectionutil.h"
+#include "vcxmyvideosmdscmdqueue.h"
+
+_LIT( KVcxVideoObjectName, "Video" );
+                                                              //1 (ID)
+_LIT( KVcxTitlePropertyName, "Title" );                       //2
+_LIT( KVcxDescriptionPropertyName, "Description" );           //3
+                                                              //4 (file path = URI)
+_LIT( KVcxSizePropertyName, "Size" );                         //11 (5 also for compatibility)
+
+_LIT( KVcxCreationDatePropertyName, "CreationDate" );         //6 creation date is saved to 2 properties
+_LIT( KVcxTimeOffsetPropertyName, "TimeOffset" );             //6
+
+_LIT( KVcxFlagsPropertyName, "RecordingFlags" );              //7 flags are saved
+_LIT( KVcxDrmPropertyName, "DRM");                            //7 to both of these
+
+_LIT( KVcxCopyrightPropertyName, "Copyright" );               //8
+_LIT( KVcxItemTypePropertyName, "ItemType" );                 //9 (mime type)
+_LIT( KVcxLastModifiedDatePropertyName, "LastModifiedDate" ); //12
+_LIT( KVcxAgeProfilePropertyName, "AgeProfile" );             //13
+_LIT( KVcxAudioLanguagePropertyName, "AudioLanguage" );       //14
+_LIT( KVcxAuthorPropertyName, "Author" );                     //15
+_LIT( KVcxOriginPropertyName, "Origin" );                     //16
+_LIT( KVcxDurationPropertyName, "Duration" );                 //17
+_LIT( KVcxLastPlayPositionPropertyName, "LastPlayPosition" ); //10
+_LIT( KVcxRatingPropertyName, "Rating" );                     //19
+_LIT( KVcxBitratePropertyName, "Bitrate" );                   //20
+_LIT( KVcxAudioFourCcPropertyName, "AudioFourCC" );           //21
+_LIT( KVcxWidthPropertyName, "Width" );                       //22
+_LIT( KVcxHeightPropertyName, "Height" );                     //23
+_LIT( KVcxArtistPropertyName, "Artist" );                     //24
+
+
+// ---------------------------------------------------------------------------
+// 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()
+    { 
+    // define P&S property types
+    if ( iDefineKey )
+        {
+        RProperty::Define( iKeyCategory, iPropertyKey,
+                          RProperty::EInt, KAllowAllPolicy, KPowerMgmtPolicy );
+        }
+    
+    // attach to the property
+    TInt err = iProperty.Attach( iKeyCategory, iPropertyKey,EOwnerThread );
+    User::LeaveIfError( err );
+    
+    // wait for the previously attached property to be updated
+    iProperty.Subscribe( iStatus );
+    SetActive();
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMdsShutdownMonitor::~CVcxMdsShutdownMonitor()
+// ---------------------------------------------------------------------------
+//
+CVcxMdsShutdownMonitor::~CVcxMdsShutdownMonitor()
+    {
+    Cancel();
+    iProperty.Close();
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMdsShutdownMonitor::RunL()
+// ---------------------------------------------------------------------------
+//
+void CVcxMdsShutdownMonitor::RunL()
+    {
+    // resubscribe before processing new value to prevent missing updates
+    iProperty.Subscribe( iStatus );
+    SetActive();
+    
+    // retrieve the value
+    TInt value = 0;
+    TInt err = iProperty.Get( value );
+    MPX_DEBUG2("CVcxMyVideosMdsDb::RunL(): iProperty.Get(value); returns %d", err);
+    
+    User::LeaveIfError( err );
+
+    iObserver.ShutdownNotification( value );    
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMdsShutdownMonitor::DoCancel()
+// ---------------------------------------------------------------------------
+//
+void CVcxMdsShutdownMonitor::DoCancel()
+    {
+    iProperty.Cancel();
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsDb::CVcxMyVideosMdsDb
+// ---------------------------------------------------------------------------
+//
+CVcxMyVideosMdsDb::CVcxMyVideosMdsDb( MVcxMyVideosMdsDbObserver* aObserver,
+        RFs& aFs, MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver )
+: iFs( aFs ), iMdsDbObserver(aObserver), iAlbumsObserver(aAlbumsObserver) 
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsDb::ConstructL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsDb::ConstructL()
+    {
+    MPX_DEBUG1( "CVcxMyVideosMdsDb::ConstructL start" );
+
+    iCmdQueue = CVcxMyVideosMdsCmdQueue::NewL( *this );
+
+    iActiveSchedulerWait = new (ELeave) CActiveSchedulerWait;
+    
+    OpenMdsSessionL();
+
+        
+    iAlbums = CVcxMyVideosMdsAlbums::NewL( *this, iAlbumsObserver );
+    
+    TCallBack callBack( AsyncHandleQueryCompleted, this );    
+    iAsyncHandleQueryCompleteCaller = new (ELeave) CAsyncCallBack( callBack,
+            CActive::EPriorityStandard );
+
+    iMdsShutdownMonitor = CVcxMdsShutdownMonitor::NewL(
+            *this, KHarvesterPSShutdown, KMdSShutdown, EFalse );
+    
+    iEvents.Reset();
+
+    MPX_DEBUG1( "CVcxMyVideosMdsDb::ConstructL exit" );
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsDb::OpenMdsSessionL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsDb::OpenMdsSessionL()
+    {
+    MPX_DEBUG1( "CVcxMyVideosMdsDb::OpenMdsSessionL() start" );
+
+    iMdsSessionError = KErrNone;
+
+    delete iMdsSession;
+    iMdsSession = NULL;
+    iMdsSession = CMdESession::NewL( *this );
+    if ( !iMdsSession )
+        {
+        User::Leave( KErrGeneral );
+        }
+    
+    //  Wait until session opened
+    iActiveSchedulerWait->Start();    
+    MPX_DEBUG1( "CVcxMyVideosMdsDb:: iActiveSchedulerWait->Start done" );
+
+    if ( iMdsSessionError == KErrNone )
+        {
+        MPX_DEBUG1( "CVcxMyVideosMdsDb:: session opened ok, adding observers" );
+
+        // We order all object notifications. If we set video condition, then we wont
+        // receive remove notifications at all (mds feature). Extra notifications
+        // do not bother us much since we try to fetch the item from the db
+        // after the add notification anyways, and then we use video condition.
+        // Eventually extra events are ignored.    
+        iMdsSession->AddObjectObserverL( *this, NULL );
+    
+        iMdsSession->AddObjectPresentObserverL( *this );
+        
+        GetSchemaDefinitionsL();
+        
+        if ( iAlbums )
+            {
+            iAlbums->GetSchemaDefinitionsL();
+            iAlbums->SetObservingL();
+            }
+        }
+    else
+        {
+        MPX_DEBUG2( "CVcxMyVideosMdsDb:: session opening failed: %d", iMdsSessionError );
+        iMdsSessionError = KErrGeneral; // this ensures that next time when mds is tried to use, it tries to open session again
+        delete iMdsSession;
+        iMdsSession = NULL;        
+        }
+
+    MPX_DEBUG1( "CVcxMyVideosMdsDb::OpenMdsSessionL() exit" );
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsDb::HandleObjectPresentNotification( CMdESession& /*aSession*/,
+        TBool aPresent, const RArray<TItemId>& aObjectIdArray)
+    {
+    MPX_DEBUG1( "CVcxMyVideosMdsDb::--------------------------------------------------------------." );
+    MPX_DEBUG3( "CVcxMyVideosMdsDb::HandleObjectPresentNotification( aPresent = %1d, count = %4d) |", aPresent, aObjectIdArray.Count() );
+    MPX_DEBUG1( "CVcxMyVideosMdsDb::--------------------------------------------------------------'" );
+
+    TObserverNotificationType type;
+    if ( aPresent )
+        {
+        type = ENotifyAdd;
+        }
+    else
+        {
+        type = ENotifyRemove;
+        }
+    
+    TRAP_IGNORE( DoHandleObjectNotificationL( type, 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()
+    {
+    MPX_DEBUG1( "CVcxMyVideosMdsDb::~CVcxMyVideosMdsDb() start" );
+
+    delete iEventProcessor;
+    iEvents.Close();
+
+    Cancel( EGetVideoList );
+
+    delete iAlbums;
+    delete iCmdQueue;
+    delete iVideoQuery;
+    delete iMdsSession;
+    delete iActiveSchedulerWait;
+    delete iAsyncHandleQueryCompleteCaller;
+    delete iMdsShutdownMonitor;
+    MPX_DEBUG1( "CVcxMyVideosMdsDb::~CVcxMyVideosMdsDb() exit" );
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsDb::Cancel
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsDb::Cancel( TRequestType aType )
+    {
+    MPX_DEBUG1("CVcxMyVideosMdsDb::Cancel() start");
+    
+    iCmdQueue->Cancel( aType );
+    
+    if ( aType == EAll || aType == EGetVideoList )
+        {
+        if ( iVideoQuery )
+            {
+            iVideoQuery->Cancel();
+            }
+        iVideoListFetchingIsOngoing = EFalse;
+        }
+
+    if ( aType != EGetVideoList )
+        {
+        iAlbums->CancelQueries( aType );
+        }
+    
+    MPX_DEBUG1("CVcxMyVideosMdsDb::Cancel() exit");
+    }
+    
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsDb::AddVideoL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsDb::AddVideoL(
+        CMPXMedia& aVideo, 
+        TUint32& aMdsId )
+    {
+    MPX_DEBUG1( "CVcxMyVideosMdsDb::AddVideoL() start" );
+         
+    CMdEObject* object = MdsSessionL().NewObjectLC(
+            *iVideoObjectDef, aVideo.ValueText( KMPXMediaGeneralUri ) ); // 1->
+
+    // Value from aVideo is taken in use in Media2ObjectL if aVideo contains creation date
+    SetCreationAndModifiedDatesL( *object ); // use current time
+    
+    object->AddUint8PropertyL( *iOriginPropertyDef,
+            aVideo.ValueTObjectL<TUint8>( KVcxMediaMyVideosOrigin ) );
+    
+    CMdEProperty* property;
+
+    //  Type can not be modified normally, so set it here
+    if ( aVideo.IsSupported( KMPXMediaGeneralMimeType ) )
+        {
+        if (KErrNotFound != object->Property( *iItemTypePropertyDef, property, 0 ))
+            {
+            static_cast<CMdETextProperty*>(property)->SetValueL(
+                    aVideo.ValueText( KMPXMediaGeneralMimeType ) );
+            }
+        else
+            {
+            object->AddTextPropertyL(
+                *iItemTypePropertyDef,
+                aVideo.ValueText( KMPXMediaGeneralMimeType ) );
+            }
+        }
+
+    Media2ObjectL( aVideo, *object );
+    TRAPD( err, aMdsId = MdsSessionL().AddObjectL( *object ) );
+
+    if ( err != KErrNone )
+        {
+        MPX_DEBUG2( "CVcxMyVideosMdsDb:: MdsSessionL().AddObjectL leaved with error: %d", err );
+        User::Leave( err );
+        }
+        
+    if ( aMdsId == KNoId )
+        {
+        MPX_DEBUG1( "CVcxMyVideosMdsDb::AddVideoL could not add new video" );
+        User::Leave( KErrGeneral );
+        }
+    else
+        {
+        MPX_DEBUG2( "CVcxMyVideosMdsDb::AddVideoL video created, mds id: %d", aMdsId );
+        }        
+
+    CleanupStack::PopAndDestroy( object ); // <-1
+
+    MPX_DEBUG1( "CVcxMyVideosMdsDb::AddVideoL() exit" );
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsDb::RemoveVideo
+// ---------------------------------------------------------------------------
+//
+TInt CVcxMyVideosMdsDb::RemoveVideo( TUint32 aMdsId )
+    {
+    MPX_DEBUG1( "CVcxMyVideosMdsDb::RemoveVideoL() start" );
+
+    TInt retValue( KErrNone );
+    TItemId id( 0 ); //init to avoid warning
+
+    MPX_DEBUG2( "CVcxMyVideosMdsDb:: removing object %d", aMdsId );
+    
+    TRAPD( err,  id = MdsSessionL().RemoveObjectL( aMdsId ) );
+
+    if ( err == KErrNone )
+        {
+        if ( id == KNoId )
+            {
+            MPX_DEBUG1( "CVcxMyVideosMdsDb:: video not found" );
+            retValue = KErrNotFound;
+            }
+        else
+            {
+            MPX_DEBUG1( "CVcxMyVideosMdsDb:: remove successful" );
+            }
+        }
+    else
+        {
+        MPX_DEBUG2( "CVcxMyVideosMdsDb:: MdsSessionL().RemoveObjectL left: %d", err );
+        retValue = err;        
+        }
+        
+    MPX_DEBUG1( "CVcxMyVideosMdsDb::RemoveVideoL() exit" );        
+    return retValue;
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsDb::UpdateVideoL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsDb::UpdateVideoL( CMPXMedia& aVideo )
+    {
+    MPX_DEBUG1( "CVcxMyVideosMdsDb::UpdateVideoL() start" );
+
+    TMPXItemId mpxId = aVideo.ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId );
+
+    MPX_DEBUG2("CVcxMyVideosMdsDb::UpdateVideoL updating object %d ", mpxId.iId1);
+    
+    CMdEObject* object =
+            MdsSessionL().OpenObjectL( mpxId.iId1, *iVideoObjectDef );
+    if ( !object )
+        {
+        // No object with this ID was found!
+        MPX_DEBUG1("CVcxMyVideosMdsDb::UpdateVideoL no object found");
+        User::Leave( KErrNotFound );
+        }
+    else
+        {
+        MPX_DEBUG1("CVcxMyVideosMdsDb::UpdateVideoL object found");
+        
+        if ( object->OpenForModifications() )
+            {
+            CleanupStack::PushL( object ); // 1->
+            
+            Media2ObjectL( aVideo, *object );
+            
+            MdsSessionL().CommitObjectL(*object);
+
+            CleanupStack::PopAndDestroy(object);
+            }
+        else
+            {
+            // Object is already locked!
+            MPX_DEBUG1("CVcxMyVideosMdsDb::UpdateVideoL object was locked!");
+            delete object;
+            User::Leave( KErrInUse );
+            }
+        }
+    MPX_DEBUG1( "CVcxMyVideosMdsDb::UpdateVideoL() exit" );
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsDb::CreateVideoListL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsDb::CreateVideoListL( TVcxMyVideosSortingOrder aSortingOrder,
+        TBool aAscending, TBool aFullDetails, CMPXMedia*& aVideoList )
+    {
+    MPX_DEBUG1( "CVcxMyVideosMdsDb::CreateVideoListL() start" );
+    
+    CVcxMyVideosMdsCmdGetVideoList* cmd = new (ELeave) CVcxMyVideosMdsCmdGetVideoList;
+    CleanupStack::PushL( cmd ); // 1->
+    cmd->iCmdType      = CVcxMyVideosMdsDb::EGetVideoList;
+    cmd->iSortingOrder = aSortingOrder;
+    cmd->iAscending    = aAscending;
+    cmd->iFullDetails  = aFullDetails;
+    cmd->iVideoList    = &aVideoList;
+
+    iCmdQueue->ExecuteCmdL( cmd ); //ownership moves
+    CleanupStack::Pop( cmd ); // <-1
+    }
+    
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsDb::DoCreateVideoListL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsDb::DoCreateVideoListL( TVcxMyVideosSortingOrder aSortingOrder,
+        TBool aAscending, TBool aFullDetails, CMPXMedia*& aVideoList )
+    {
+    MPX_FUNC( "CVcxMyVideosMdsDb::DoCreateVideoListL" );
+        
+    if ( iVideoListFetchingIsOngoing )
+        {
+        MPX_DEBUG1("CVcxMyVideosMdsDb:: video list fetching already going on, returning current list");
+        aVideoList = iVideoList;
+        }
+    
+    if ( !aVideoList )
+        {
+        aVideoList = TVcxMyVideosCollectionUtil::CreateEmptyMediaListL();
+        }
+                    
+    CMPXMediaArray* mediaArray = aVideoList->Value<CMPXMediaArray>( KMPXMediaArrayContents );
+    
+    delete iVideoQuery;
+    iVideoQuery = NULL;
+    
+    iVideoQuery = MdsSessionL().NewObjectQueryL(
+            *iNamespaceDef,
+            *iVideoObjectDef,
+            this);
+
+    iVideoQuery->SetResultMode( EQueryResultModeItem );
+
+    TMdESortOrder direction;
+    
+    if ( aAscending )
+        {
+        direction = ESortAscending;
+        }
+    else
+        {
+        direction = ESortDescending;
+        }
+        
+    switch ( aSortingOrder )
+        {
+        case EVcxMyVideosSortingId:
+            {
+            MPX_DEBUG1("CVcxMyVideosMdsDb:: EVcxMyVideosSortingId"); 
+            iVideoQuery->AppendOrderRuleL(
+                TMdEOrderRule( EOrderRuleTypeItemID, direction ) );
+            }
+            break;
+            
+        case EVcxMyVideosSortingCreationDate:
+            {
+            MPX_DEBUG1("CVcxMyVideosMdsDb:: EVcxMyVideosSortingCreationDate"); 
+            iVideoQuery->AppendOrderRuleL(
+                TMdEOrderRule( *iCreationDatePropertyDef/*EOrderRuleTypeCreationTime*/, direction ) );
+            }
+            break;
+
+        case EVcxMyVideosSortingModified:
+            {
+            MPX_DEBUG1("CVcxMyVideosMdsDb:: EVcxMyVideosSortingModified"); 
+            iVideoQuery->AppendOrderRuleL(
+                TMdEOrderRule( *iLastModifiedDatePropertyDef/*EOrderRuleTypeLastModifiedDate*/, direction ) );
+            }
+            break;
+
+        case EVcxMyVideosSortingName:
+            {
+            MPX_DEBUG1("CVcxMyVideosMdsDb:: EVcxMyVideosSortingName"); 
+        
+            TMdEOrderRule orderRule( *iTitlePropertyDef, direction );
+            orderRule.SetCaseSensitive( EFalse /* insensitive */);
+            iVideoQuery->AppendOrderRuleL( orderRule );
+            }
+            break;
+
+        case EVcxMyVideosSortingSize:
+            {
+            MPX_DEBUG1("CVcxMyVideosMdsDb:: EVcxMyVideosSortingSize"); 
+            iVideoQuery->AppendOrderRuleL(
+                TMdEOrderRule( *iSizePropertyDef, direction ) );
+            }
+            break;
+        }
+
+    iVideoListFetchingIsOngoing = ETrue;
+
+    iFullDetails = aFullDetails;
+    
+    const TInt maxItemsInQueryResult = 500;
+    iVideoQuery->FindL( KMdEQueryDefaultMaxCount, maxItemsInQueryResult );
+
+    aVideoList->SetTObjectValueL<TMPXGeneralType>( KMPXMediaGeneralType, EMPXGroup );            
+    aVideoList->SetTObjectValueL( KMPXMediaArrayCount, mediaArray->Count() );
+
+    iVideoList = aVideoList; // lets store the pointer, ownership stays at observer
+    }
+
+// ---------------------------------------------------------------------------
+// From class MMdEQueryObserver.
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsDb::HandleQueryNewResults(
+        CMdEQuery& aQuery,
+        TInt aFirstNewItemIndex,
+        TInt aNewItemCount )
+    {
+    TRAPD( err, DoHandleQueryNewResultsL( aQuery, aFirstNewItemIndex, aNewItemCount ));
+    if ( err != KErrNone )
+        {
+        MPX_DEBUG2("CVcxMyVideosMdsDb:: DoHandleQueryNewResultsL() left with error code: %d", err);
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// Leaving version of HandleQueryNewResults.
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsDb::DoHandleQueryNewResultsL(
+        CMdEQuery& /*aQuery*/,
+        TInt aFirstNewItemIndex,
+#ifdef _DEBUG
+        TInt aNewItemCount )
+#else
+        TInt /*aNewItemCount*/ )
+#endif
+    {
+    MPX_DEBUG1("CVcxMyVideosMdsDb::HandleQueryNewResults() start");
+    
+    if ( !iVideoList )
+        {
+        MPX_DEBUG1("CVcxMyVideosMdsDb:: iVideoList is NULL, should never happen");
+        return;
+        }
+    
+    MPX_DEBUG2("CVcxMyVideosMdsDb:: aFirstNewItemIndex = %d", aFirstNewItemIndex);
+    MPX_DEBUG2("CVcxMyVideosMdsDb:: aNewItemCount      = %d", aNewItemCount);
+        
+    CMPXMediaArray* array = iVideoList->Value<CMPXMediaArray>( KMPXMediaArrayContents );
+    CMPXMedia* media;    
+    TInt count = iVideoQuery->Count();
+    
+    iVideoList->SetTObjectValueL<TInt>( KMPXMediaArrayCount, count );
+    
+    for ( TInt i = aFirstNewItemIndex; i < count; i++ )
+        {
+        CMdEObject& object = iVideoQuery->Result( i );
+
+        media = CMPXMedia::NewL();
+        CleanupStack::PushL( media ); // 1->
+        
+        Object2MediaL( object, *media, iFullDetails );
+        array->AppendL( media );
+
+        CleanupStack::Pop( media ); // <-1
+        }
+    
+    iMdsDbObserver->HandleCreateVideoListResp( iVideoList, aFirstNewItemIndex,
+            EFalse /* not complete yet */);
+    MPX_DEBUG1("CVcxMyVideosMdsDb::HandleQueryNewResults() exit");
+    }
+
+
+            
+// ---------------------------------------------------------------------------
+// From class MMdEQueryObserver.
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsDb::HandleQueryCompleted(
+        CMdEQuery& /*aQuery*/,
+        TInt /*aError*/)
+    {
+    iAsyncHandleQueryCompleteCaller->CallBack();
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsDb::AsyncHandleQueryCompleted
+// ---------------------------------------------------------------------------
+//
+TInt CVcxMyVideosMdsDb::AsyncHandleQueryCompleted( TAny* aThis )
+    {
+    MPX_FUNC( "CVcxMyVideosMdsDb::AsyncHandleQueryCompleted" );
+
+    CVcxMyVideosMdsDb* thisObj = static_cast<CVcxMyVideosMdsDb*>( aThis );
+    
+    if ( !thisObj->iVideoList )
+        {
+        MPX_DEBUG1("CVcxMyVideosMdsDb:: iVideoList is NULL, should never happen");
+        return KErrNone;
+        }
+
+#ifdef _DEBUG
+    CMPXMediaArray* array = thisObj->iVideoList->Value<CMPXMediaArray>( KMPXMediaArrayContents );
+#endif
+
+    MPX_DEBUG2("CVcxMyVideosMdsDb:: query contains %d items", thisObj->iVideoQuery->Count());
+    MPX_DEBUG2("CVcxMyVideosMdsDb:: iVideoList contains %d items", array->Count());
+    
+    if ( thisObj->iActiveSchedulerWait->IsStarted() )
+        {
+        thisObj->iActiveSchedulerWait->AsyncStop();
+        }
+    
+    thisObj->iVideoListFetchingIsOngoing = EFalse;
+    thisObj->iMdsDbObserver->HandleCreateVideoListResp( thisObj->iVideoList, KErrNotFound /* KErrNotFound = no new items */,
+            ETrue /* complete */);
+    
+    thisObj->iVideoList = NULL; // not owned by us -> just clear
+    
+    thisObj->iCmdQueue->CmdFinished();
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsDb::CreateVideoL
+// ---------------------------------------------------------------------------
+//
+CMPXMedia* CVcxMyVideosMdsDb::CreateVideoL( TUint32 aId, TBool aFullDetails )
+    {
+    MPX_DEBUG1( "CVcxMyVideosMdsDb::CreateVideoL() start" );
+
+    CMdEObject* object = ObjectL( aId );
+
+    if ( !object )
+        {
+        MPX_DEBUG2("CVcxMyVideosMdsDb:: mds id %d not found from mds", aId);
+        return NULL;
+        }
+        
+    CleanupStack::PushL( object ); // 1->
+
+    CMPXMedia* video = CMPXMedia::NewL( );
+    CleanupStack::PushL( video ); // 2->
+
+    Object2MediaL( *object, *video, aFullDetails );
+
+    CleanupStack::Pop( video );            // <-2
+    CleanupStack::PopAndDestroy( object ); // <-1
+    MPX_DEBUG1( "CVcxMyVideosMdsDb::CreateVideoL() exit" );
+
+    return video;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MMdESessionObserver.
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsDb::HandleSessionOpened(
+        CMdESession& /*aSession*/,
+        TInt aError)
+    {
+    MPX_DEBUG1("CVcxMyVideosMdsDb::HandleSessionOpened() start" );
+
+    iActiveSchedulerWait->AsyncStop();
+
+    if ( aError != KErrNone )
+        {
+        MPX_DEBUG2( "CVcxMyVideosMdsDb::HandleSessionOpened: %d", aError );
+
+        iMdsSessionError = aError;
+        }
+    MPX_DEBUG1("CVcxMyVideosMdsDb::HandleSessionOpened() exit" );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MMdESessionObserver.
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsDb::HandleSessionError(
+        CMdESession& /*aSession*/,
+        TInt aError)
+    {
+    MPX_DEBUG1("CVcxMyVideosMdsDb::HandleSessionError() start" );
+
+    if (iActiveSchedulerWait->IsStarted())
+        {
+        MPX_DEBUG1( "CVcxMyVideosMdsDb:: Session opening was going on");
+        iActiveSchedulerWait->AsyncStop();
+        }
+
+    if ( iVideoListFetchingIsOngoing )
+        {
+        MPX_DEBUG1( "CVcxMyVideosMdsDb:: Videolist fetching was going on");
+        iVideoListFetchingIsOngoing = EFalse;
+        iMdsDbObserver->HandleCreateVideoListResp( iVideoList, -1 /* -1 = no new items */,
+                ETrue /* complete */);
+        }
+        
+    MPX_DEBUG2( "CVcxMyVideosMdsDb::HandleSessionError: %d", aError );
+
+    iMdsSessionError = aError;
+
+    MPX_DEBUG1("CVcxMyVideosMdsDb::HandleSessionError() exit" );
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsDb::HandleObjectNotification
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsDb::HandleObjectNotification(
+        CMdESession& /*aSession*/,
+        TObserverNotificationType aType,
+        const RArray<TItemId>& aObjectIdArray)
+    {
+    TRAP_IGNORE( DoHandleObjectNotificationL( aType, aObjectIdArray ));
+    }
+    
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsDb::ObjectL
+// ---------------------------------------------------------------------------
+//
+CMdEObject* CVcxMyVideosMdsDb::ObjectL( const TItemId aId, TBool aIsVideo )
+    {
+    MPX_DEBUG1("CVcxMyVideosMdsDb::ObjectL start");
+    //  If the id is not valid, just return NULL, because
+    //  MdsSessionL().GetObjectL leaves in that case
+    if ( aId == KNoId )
+        {
+        return NULL;
+        }
+
+    CMdEObject* object;
+    if ( aIsVideo )
+        {
+        object = MdsSessionL().GetObjectL( aId, *iVideoObjectDef );
+        }
+    else
+        {
+        object = MdsSessionL().GetObjectL( aId, *iAlbums->iAlbumObjectDef );
+        }
+    
+    if ( object )
+        {
+        MPX_DEBUG2( "CVcxMyVideosMdsDb::ObjectL found, id: %d", aId );
+        }
+    else
+        {
+        MPX_DEBUG2( "CVcxMyVideosMdsDb::ObjectL not found, id: %d", aId );
+        }
+
+    MPX_DEBUG1("CVcxMyVideosMdsDb::ObjectL exit");
+    return object;
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsDb::Object2MediaL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsDb::Object2MediaL(
+        CMdEObject& aObject,
+        CMPXMedia& aVideo,
+        TBool aFullDetails )
+    {    
+    aVideo.SetTObjectValueL<TMPXGeneralType>(KMPXMediaGeneralType, EMPXItem );
+   
+    CMdEProperty* property = NULL;
+
+    //1. ID, KMPXMediaGeneralId (BRIEF)
+    TMPXItemId mpxId;
+    mpxId.iId1 = aObject.Id();
+    aVideo.SetTObjectValueL<TMPXItemId>( KMPXMediaGeneralId, mpxId );
+    
+    //2. TITLE (BRIEF)
+    if ( aObject.Property( *iTitlePropertyDef, property, 0 ) != KErrNotFound )
+        {
+        aVideo.SetTextValueL( KMPXMediaGeneralTitle,
+                static_cast<CMdETextProperty*>(property)->Value());
+        }
+
+    //  This is a fix for setting the title always
+    if ( !property || static_cast<CMdETextProperty*>(property)->Value().Length() == 0 )
+        {
+        TParse parse;
+        parse.Set( aObject.Uri(), NULL, NULL );
+        aVideo.SetTextValueL( KMPXMediaGeneralTitle, parse.Name() );
+        }
+
+    //3. DESCRIPTION
+    if ( aObject.Property( *iDescriptionPropertyDef, property, 0 ) != KErrNotFound
+         && aFullDetails )
+        {
+        aVideo.SetTextValueL( KMPXMediaGeneralComment,
+                static_cast<CMdETextProperty*>(property)->Value() );
+        }
+
+    //4. URI (= FILE PATH) (BRIEF)
+    aVideo.SetTextValueL( KMPXMediaGeneralUri, aObject.Uri() );
+   
+    //5. FILE SIZE, KMPXMediaGeneralSize (BRIEF)    
+    // With 64bit support the value will be copied after reading KMPXMediaGeneralExtSizeInt64
+#ifndef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+    if (KErrNotFound !=
+            aObject.Property( *iSizePropertyDef, property, 0 ))
+        {
+        aVideo.SetTObjectValueL<TInt>( KMPXMediaGeneralSize,
+                static_cast<CMdEUint32Property*>(property)->Value() );
+        }
+        
+    //  If the size was not found or it is 0, get it from the file
+    if ( !(aVideo.Value<TInt>( KMPXMediaGeneralSize )) )
+        {
+        TEntry entry;
+        TInt err = iFs.Entry( aObject.Uri(), entry );
+        if ( err == KErrNone )
+            {
+            aVideo.SetTObjectValueL<TInt>( KMPXMediaGeneralSize, entry.iSize );
+            }
+        }
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+    
+    //6. CREATION DATE, KMPXMediaGeneralDate
+    if ( aObject.Property( *iCreationDatePropertyDef, property, 0 ) != KErrNotFound )
+        {
+        aVideo.SetTObjectValueL<TInt64>( KMPXMediaGeneralDate,
+                static_cast<CMdETimeProperty*>(property)->Value().Int64() );
+        }
+    
+    //7. FLAGS, KMPXMediaGeneralFlags (BRIEF)
+    TUint32 flags = 0;
+    if ( aObject.Property( *iFlagsPropertyDef, property, 0 ) != KErrNotFound )
+        {
+        flags = static_cast<CMdEUint32Property*>(property)->Value();
+        }
+    else
+        {
+        // MDS didn't have flags variable set at all, so this is harvested video.
+        // Set new flag on.
+        flags |= EVcxMyVideosVideoNew;
+        }
+    if ( aObject.Property( *iDrmPropertyDef, property, 0 ) != KErrNotFound )
+        {
+        TBool drmProtected = static_cast<CMdEBoolProperty*>(property)->Value();
+        if ( drmProtected )
+            {
+            flags |= EVcxMyVideosVideoDrmProtected;
+            }
+        }
+    aVideo.SetTObjectValueL<TUint32>( KMPXMediaGeneralFlags, flags );
+  
+    //8. COPYRIGHT, KMPXMediaGeneralCopyright
+    if ( aObject.Property( *iCopyrightPropertyDef, property, 0 ) != KErrNotFound 
+         && aFullDetails )
+        {
+        aVideo.SetTextValueL( KMPXMediaGeneralCopyright,
+                static_cast<CMdETextProperty*>(property)->Value() );
+        }
+    
+    //9. KMPXMediaGeneralMimeType
+    if ( aObject.Property( *iItemTypePropertyDef, property, 0 ) != KErrNotFound 
+         && aFullDetails )
+        {
+        aVideo.SetTextValueL( KMPXMediaGeneralMimeType,
+                static_cast<CMdETextProperty*>(property)->Value() );
+        }
+    
+    //11. FILE SIZE, KMPXMediaGeneralExtSizeInt64 (BRIEF)    
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+    if (KErrNotFound !=
+            aObject.Property( *iSizePropertyDef, property, 0 ))
+        {
+        TUint32 val = static_cast<CMdEUint32Property*>(property)->Value(); 
+        aVideo.SetTObjectValueL<TInt64>( KMPXMediaGeneralExtSizeInt64, val );
+        // Maintains compatibility
+        aVideo.SetTObjectValueL<TInt>( KMPXMediaGeneralSize, val );
+        }
+        
+    //  If the size was not found or it is 0, get it from the file
+    if ( !(aVideo.Value<TInt64>( KMPXMediaGeneralExtSizeInt64 )) )
+        {
+        TEntry entry;
+        TInt err = iFs.Entry( aObject.Uri(), entry );
+        if ( err == KErrNone )
+            {
+            aVideo.SetTObjectValueL<TInt64>( KMPXMediaGeneralExtSizeInt64, entry.FileSize() );
+            // Maintains compatibility
+            aVideo.SetTObjectValueL<TInt>( KMPXMediaGeneralSize, entry.iSize );
+            }
+        }
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+    //12. KVcxMediaMyVideosModifiedDate
+    if ( aObject.Property( *iLastModifiedDatePropertyDef, property, 0 ) != KErrNotFound 
+        && aFullDetails )
+        {
+        aVideo.SetTObjectValueL<TInt64>( KVcxMediaMyVideosModifiedDate,
+                static_cast<CMdETimeProperty*>(property)->Value().Int64() );
+        }
+    
+    //13. KVcxMediaMyVideosAgeProfile (BRIEF)
+    if ( aObject.Property( *iAgeProfilePropertyDef, property, 0 ) != KErrNotFound )
+        {
+        aVideo.SetTObjectValueL<TInt32>( KVcxMediaMyVideosAgeProfile,
+            static_cast<CMdEInt32Property*>(property)->Value() );
+        }
+        
+    //14. KVcxMediaMyVideosAudioLanguage
+    if ( aObject.Property( *iAudioLanguagePropertyDef, property, 0 ) != KErrNotFound
+         && aFullDetails )
+        {
+        aVideo.SetTextValueL( KVcxMediaMyVideosAudioLanguage,
+                static_cast<CMdETextProperty*>(property)->Value() );
+        }
+    
+    //15. AUTHOR, KVcxMediaMyVideosAuthor
+    if ( aObject.Property( *iAuthorPropertyDef, property, 0 ) != KErrNotFound
+         && aFullDetails )
+        {
+        aVideo.SetTextValueL( KVcxMediaMyVideosAuthor,
+                static_cast<CMdETextProperty*>(property)->Value() );
+        }
+
+    //16. ORIGIN, KVcxMediaMyVideosOrigin
+    if ( aObject.Property( *iOriginPropertyDef, property, 0 ) != KErrNotFound )
+        {
+        TUint8 origin = static_cast<CMdEUint8Property*>(property)->Value();
+#ifndef VCX_DOWNLOADS_CATEGORY
+        if( origin != EVcxMyVideosOriginCapturedWithCamera )
+            {
+            origin = EVcxMyVideosOriginOther;
+            }           
+#else
+        if ( origin != EVcxMyVideosOriginCapturedWithCamera &&
+				 origin != EVcxMyVideosOriginDownloaded
+				)
+            {
+            origin = EVcxMyVideosOriginOther;
+            }
+
+#endif
+        aVideo.SetTObjectValueL<TUint8>( KVcxMediaMyVideosOrigin, origin );
+        }
+
+    //17. DURATION, (KMPXMediaGeneralDuration can't be used since it is TInt
+    //   and we need TReal32 ) (BRIEF)
+    if ( aObject.Property( *iDurationPropertyDef, property, 0 ) != KErrNotFound )
+        {        
+        aVideo.SetTObjectValueL<TReal32>( KVcxMediaMyVideosDuration,
+                static_cast<CMdEReal32Property*>(property)->Value() );
+        }
+
+    //10. LAST PLAYBACK POSITION
+    // KMPXMediaGeneralLastPlaybackPosition
+    if ( aObject.Property( *iLastPlayPositionPropertyDef, property, 0 ) != KErrNotFound
+         && aFullDetails )
+        {        
+        TInt pos = static_cast<CMdEReal32Property*>(property)->Value();
+        
+        aVideo.SetTObjectValueL<TInt>( KMPXMediaGeneralLastPlaybackPosition, pos );
+        }
+    
+    //19. RATING (FULL)
+    if ( aObject.Property( *iRatingPropertyDef, property, 0 ) != KErrNotFound
+            && aFullDetails )
+        {
+        aVideo.SetTObjectValueL<TUint8>( KVcxMediaMyVideosRating,
+                static_cast<CMdEUint8Property*>(property)->Value() );
+        }
+    else
+        {
+        aVideo.SetTObjectValueL<TUint8>( KVcxMediaMyVideosRating, 0 );
+        }
+    
+    //20. BITRATE (FULL)
+    if ( aObject.Property( *iBitratePropertyDef, property, 0 ) != KErrNotFound
+            && aFullDetails )
+        {
+        TUint16 bitrate = static_cast<CMdEUint16Property*>(property)->Value();        
+        aVideo.SetTObjectValueL<TUint16>( KMPXMediaVideoBitRate, bitrate );
+        }    
+
+    //21. AUDIOFOURCC (BRIEF)
+    if ( aObject.Property( *iAudioFourCcPropertyDef, property, 0 ) != KErrNotFound )
+        {
+        aVideo.SetTObjectValueL<TUint32>( KVcxMediaMyVideosAudioFourCc,
+                static_cast<CMdEUint32Property*>(property)->Value() );
+        }
+    else
+        {
+        aVideo.SetTObjectValueL<TUint32>( KVcxMediaMyVideosAudioFourCc, 0 );
+        }
+    
+    //22. WIDTH (FULL)
+    if ( aObject.Property( *iWidthPropertyDef, property, 0 ) != KErrNotFound
+            && aFullDetails )
+        {    
+        aVideo.SetTObjectValueL<TUint16>( KMPXMediaVideoWidth,
+                static_cast<CMdEUint16Property*>(property)->Value() );
+        }    
+    
+    //23. Height (FULL)
+    if ( aObject.Property( *iHeightPropertyDef, property, 0 ) != KErrNotFound
+            && aFullDetails )
+        {    
+        aVideo.SetTObjectValueL<TUint16>( KMPXMediaVideoHeight,
+                static_cast<CMdEUint16Property*>(property)->Value() );
+        }    
+    
+    //24. ARTIST (FULL)
+   if ( aObject.Property( *iArtistPropertyDef, property, 0 ) != KErrNotFound
+           && aFullDetails )
+       {
+       aVideo.SetTextValueL( KMPXMediaVideoArtist,
+               static_cast<CMdETextProperty*>(property)->Value());
+       }
+
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsDb::Media2ObjectL
+// Called by AddVideoL()
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsDb::Media2ObjectL(
+        CMPXMedia& aVideo,
+        CMdEObject& aObject)
+    {
+    CMdEProperty* property;
+
+    // 1. MDS ID
+    
+    // 2. TITLE (NAME)
+    if ( aVideo.IsSupported( KMPXMediaGeneralTitle ) )
+        {
+        if ( aObject.Property( *iTitlePropertyDef, property, 0 ) != KErrNotFound )
+            {
+            static_cast<CMdETextProperty*>(property)->SetValueL(
+                    aVideo.ValueText( KMPXMediaGeneralTitle ) );
+            }
+        else
+            {
+            aObject.AddTextPropertyL(
+                    *iTitlePropertyDef, aVideo.ValueText( KMPXMediaGeneralTitle ) );
+            }
+        }
+        
+    // 3. DESC
+    if ( aVideo.IsSupported( KMPXMediaGeneralComment ) )
+        {
+        if ( aObject.Property( *iDescriptionPropertyDef, property, 0 ) != KErrNotFound )
+            {
+            static_cast<CMdETextProperty*>(property)->SetValueL(
+                    aVideo.ValueText( KMPXMediaGeneralComment ) );
+            }
+        else
+            {
+            aObject.AddTextPropertyL(
+                    *iDescriptionPropertyDef, aVideo.ValueText( KMPXMediaGeneralComment ) );
+            }
+        }
+
+    // 4. URI ( = file path )
+    if ( aVideo.IsSupported( KMPXMediaGeneralUri ) )
+        {
+        aObject.SetUriL( aVideo.ValueText( KMPXMediaGeneralUri ) );
+        TVolumeInfo volInfo;
+        // 4.1 MEDIA ID ( = drive number )
+        if ( iFs.Volume( volInfo, TVcxMyVideosCollectionUtil::DriveLetter2DriveNumber(
+                aObject.Uri() ) ) == KErrNone)
+            {
+            aObject.SetMediaId( volInfo.iUniqueID );
+            }
+        }
+
+    // 5. With 64bit support KMPXMediaGeneralSize is not used, see KMPXMediaGeneralExtSizeInt64
+#ifndef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+    if ( aVideo.IsSupported( KMPXMediaGeneralSize ) )
+        {
+        TUint32 size = 0;
+        TInt sizeInMediaObject = aVideo.ValueTObjectL<TInt>( KMPXMediaGeneralSize );
+        size = static_cast<TUint32>( sizeInMediaObject );
+
+        if ( aObject.Property( *iSizePropertyDef, property, 0 ) != KErrNotFound )
+            {
+            static_cast<CMdEUint32Property*>( property )->SetValueL( size );
+            }
+        else
+            {
+            aObject.AddUint32PropertyL( *iSizePropertyDef, size );
+            }
+        }
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+    // 6. KMPXMediaGeneralDate ( creation date )
+    SetCreationDateToObjectL( aVideo, aObject );
+    
+    // 7. KMPXMediaGeneralFlags (including DRM flag)
+    if ( aVideo.IsSupported( KMPXMediaGeneralFlags ) )
+        {
+        TUint32 flags = aVideo.ValueTObjectL<TUint32>( KMPXMediaGeneralFlags );
+        if ( aObject.Property( *iFlagsPropertyDef, property, 0 ) != KErrNotFound )
+            {
+            static_cast<CMdEUint32Property*>(property)->SetValueL( flags );
+            }
+        else
+            {
+            aObject.AddUint32PropertyL( *iFlagsPropertyDef, flags );
+            }
+
+        TBool drmProtected;
+        if ( flags & EVcxMyVideosVideoDrmProtected )
+            {
+            drmProtected = ETrue;
+            }
+        else
+            {
+            drmProtected = EFalse;
+            }
+            
+        if ( aObject.Property( *iDrmPropertyDef, property, 0 ) != KErrNotFound )
+            {
+            static_cast<CMdEBoolProperty*>(property)->SetValueL( drmProtected );
+            }
+        else
+            {
+            aObject.AddBoolPropertyL( *iDrmPropertyDef, drmProtected );
+            }
+        }
+
+    // 8. KMPXMediaGeneralCopyright
+    if ( aVideo.IsSupported( KMPXMediaGeneralCopyright ))
+        {
+        if ( aObject.Property( *iCopyrightPropertyDef, property, 0 ) != KErrNotFound )
+            {
+            static_cast<CMdETextProperty*>(property)->SetValueL(
+                    aVideo.ValueText( KMPXMediaGeneralCopyright ) );
+            }
+        else
+            {
+            if ( aVideo.ValueText( KMPXMediaGeneralCopyright ).Length() )
+                {
+                aObject.AddTextPropertyL(
+                        *iCopyrightPropertyDef,
+                        aVideo.ValueText( KMPXMediaGeneralCopyright ) );
+                }
+            }
+        }
+
+#if 0
+    // 9. KMPXMediaGeneralMimeType
+    if ( aVideo.IsSupported( KMPXMediaGeneralMimeType ))
+        {
+        if ( aObject.Property( *iItemTypePropertyDef, property, 0 ) != KErrNotFound )
+            {
+            static_cast<CMdETextProperty*>(property)->SetValueL(
+                    aVideo.ValueText( KMPXMediaGeneralMimeType ) );
+            }
+        else
+            {
+            aObject.AddTextPropertyL(
+                    *iItemTypePropertyDef,
+                    aVideo.ValueText( KMPXMediaGeneralMimeType ) );
+            }
+        }
+#endif
+
+    // 11. KMPXMediaGeneralExtSizeInt64
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+    if ( aVideo.IsSupported( KMPXMediaGeneralExtSizeInt64 ) )
+        {
+        TUint32 size = 0;
+        TInt64 sizeInMediaObject = aVideo.ValueTObjectL<TInt64>( KMPXMediaGeneralExtSizeInt64 );
+        size = static_cast<TUint32>( sizeInMediaObject );
+
+        if ( aObject.Property( *iSizePropertyDef, property, 0 ) != KErrNotFound )
+            {
+            static_cast<CMdEUint32Property*>( property )->SetValueL( size );
+            }
+        else
+            {
+            aObject.AddUint32PropertyL( *iSizePropertyDef, size );
+            }
+        }
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+    
+    // 12. KVcxMediaMyVideosModifiedDate
+    if ( aVideo.IsSupported( KVcxMediaMyVideosModifiedDate ) )
+        {
+        TInt64 modifiedDateInt64 = aVideo.ValueTObjectL<TInt64>( KVcxMediaMyVideosModifiedDate );
+        TTime modifiedDate( modifiedDateInt64 );
+        if ( aObject.Property( *iLastModifiedDatePropertyDef, property, 0 ) != KErrNotFound )
+            {
+            static_cast<CMdETimeProperty*>(property)->SetValueL( modifiedDate );
+            }
+        else
+            {
+            aObject.AddTimePropertyL( *iLastModifiedDatePropertyDef, modifiedDate );
+            }
+        }
+            
+    // 13. KVcxMediaMyVideosAgeProfile
+    if ( aVideo.IsSupported( KVcxMediaMyVideosAgeProfile ) )
+        {
+        TInt32 ageProfile = aVideo.ValueTObjectL<TInt32>(KVcxMediaMyVideosAgeProfile );
+        if ( aObject.Property( *iAgeProfilePropertyDef, property, 0 ) != KErrNotFound )
+            {
+            static_cast<CMdEInt32Property*>(property)->SetValueL( ageProfile );
+            }
+        else
+            {
+            aObject.AddInt32PropertyL( *iAgeProfilePropertyDef, ageProfile );
+            }
+        }
+            
+    // 14. KVcxMediaMyVideosAudioLanguage
+    if ( aVideo.IsSupported( KVcxMediaMyVideosAudioLanguage ) )
+        {
+        if ( aObject.Property( *iAudioLanguagePropertyDef, property, 0 ) != KErrNotFound )
+            {
+            static_cast<CMdETextProperty*>(property)->SetValueL(
+                    aVideo.ValueText( KVcxMediaMyVideosAudioLanguage ) );
+            }
+        else
+            {
+            aObject.AddTextPropertyL(
+                    *iAudioLanguagePropertyDef,
+                    aVideo.ValueText( KVcxMediaMyVideosAudioLanguage ) );
+            }
+        }
+        
+    // 15. KVcxMediaMyVideosAuthor
+    if ( aVideo.IsSupported( KVcxMediaMyVideosAuthor ) )
+        {
+        if ( aObject.Property( *iAuthorPropertyDef, property, 0 ) != KErrNotFound )
+            {
+            static_cast<CMdETextProperty*>(property)->SetValueL(
+                    aVideo.ValueText( KVcxMediaMyVideosAuthor ) );
+            }
+        else
+            {
+            aObject.AddTextPropertyL(
+                    *iAuthorPropertyDef,
+                    aVideo.ValueText( KVcxMediaMyVideosAuthor ) );
+            }
+        }
+        
+    // 16. KVcxMediaMyVideosOrigin
+    if ( aVideo.IsSupported( KVcxMediaMyVideosOrigin ) )
+        {
+        TUint8 origin = aVideo.ValueTObjectL<TUint8>( KVcxMediaMyVideosOrigin );
+        if ( aObject.Property( *iOriginPropertyDef, property, 0 ) != KErrNotFound )
+            {
+            static_cast<CMdEUint8Property*>(property)->SetValueL( origin );
+            }
+        else
+            {
+            aObject.AddUint8PropertyL( *iOriginPropertyDef, origin );
+            }
+        }
+    
+    // 17. KVcxMediaMyVideosDuration
+    if ( aVideo.IsSupported( KVcxMediaMyVideosDuration ))
+        {        
+        TReal32 duration = aVideo.ValueTObjectL<TReal32>( KVcxMediaMyVideosDuration );
+
+        if ( aObject.Property( *iDurationPropertyDef, property, 0 ) != KErrNotFound )
+            {
+            static_cast<CMdEReal32Property*>(property)->SetValueL( duration );
+            }
+        else
+            {
+            aObject.AddReal32PropertyL( *iDurationPropertyDef, duration );
+            }
+        }
+
+    // 10. KMPXMediaGeneralLastPlaybackPosition
+    if ( aVideo.IsSupported( KMPXMediaGeneralLastPlaybackPosition ))
+        {        
+        TReal32 lastPlaybackPos = aVideo.ValueTObjectL<TInt>(
+                        KMPXMediaGeneralLastPlaybackPosition );
+        
+        // Play pos is written only after playback. Reset new video flag
+        // now, so there's no need for changing the flag explitically
+        if ( aObject.Property( *iFlagsPropertyDef, property, 0 ) != KErrNotFound )
+            {
+            TUint32 flags = static_cast<CMdEUint32Property*>(property)->Value();
+            
+            flags &= ~EVcxMyVideosVideoNew;
+            
+            static_cast<CMdEUint32Property*>(property)->SetValueL( flags );
+            }
+        
+        if ( aObject.Property( *iLastPlayPositionPropertyDef, property, 0 ) != KErrNotFound )
+            {
+            static_cast<CMdEReal32Property*>(property)->SetValueL( lastPlaybackPos );
+            }
+        else
+            {
+            aObject.AddReal32PropertyL( *iLastPlayPositionPropertyDef, lastPlaybackPos );
+            }
+        }
+    
+    // 19. RATING
+    if ( aVideo.IsSupported( KVcxMediaMyVideosRating ) )
+        {
+        TUint8 rating = aVideo.ValueTObjectL<TUint8>( KVcxMediaMyVideosRating );
+        
+        if ( aObject.Property( *iRatingPropertyDef, property, 0 ) != KErrNotFound )
+            {
+            static_cast<CMdEUint8Property*>(property)->SetValueL( rating );
+            }
+        else
+            {
+            aObject.AddUint8PropertyL( *iRatingPropertyDef, rating );
+            }
+        }
+    // 20. BITRATE
+    if ( aVideo.IsSupported( KMPXMediaVideoBitRate ) )
+        {           
+        TUint16 bitrate = aVideo.ValueTObjectL<TUint16>( KMPXMediaVideoBitRate );
+        
+        if ( aObject.Property( *iBitratePropertyDef, property, 0 ) != KErrNotFound )
+            {
+            static_cast<CMdEUint16Property*>(property)->SetValueL( bitrate );
+            }
+        else
+            {
+            aObject.AddUint16PropertyL( *iBitratePropertyDef, bitrate );
+            }
+        }
+
+    // 21. AUDIOFOURCC
+    if ( aVideo.IsSupported( KVcxMediaMyVideosAudioFourCc ) )
+        {
+        TUint32 audioFourCc = aVideo.ValueTObjectL<TUint32>( KVcxMediaMyVideosAudioFourCc );
+        
+        if ( aObject.Property( *iAudioFourCcPropertyDef, property, 0 ) != KErrNotFound )
+            {
+            static_cast<CMdEUint32Property*>(property)->SetValueL( audioFourCc );
+            }
+        else
+            {
+            aObject.AddUint32PropertyL( *iAudioFourCcPropertyDef, audioFourCc );
+            }
+        }
+    
+    //22. WIDTH (FULL)
+    if ( aVideo.IsSupported( KMPXMediaVideoWidth ) )
+       {
+       TUint16 width = aVideo.ValueTObjectL<TUint16>( KMPXMediaVideoWidth );
+       
+       if ( aObject.Property( *iWidthPropertyDef, property, 0 ) != KErrNotFound )
+           {
+           static_cast<CMdEUint16Property*>(property)->SetValueL( width );
+           }
+       else
+           {
+           aObject.AddUint16PropertyL( *iWidthPropertyDef, width );
+           }
+       }
+        
+    //23. Height (FULL)
+    if ( aVideo.IsSupported( KMPXMediaVideoHeight ) )
+       {
+       TUint16 width = aVideo.ValueTObjectL<TUint16>( KMPXMediaVideoHeight );
+       
+       if ( aObject.Property( *iHeightPropertyDef, property, 0 ) != KErrNotFound )
+           {
+           static_cast<CMdEUint16Property*>(property)->SetValueL( width );
+           }
+       else
+           {
+           aObject.AddUint16PropertyL( *iHeightPropertyDef, width );
+           }
+       }
+    
+    // 24. Artist
+    if ( aVideo.IsSupported( KMPXMediaVideoArtist ) )
+        {
+        if ( aObject.Property( *iArtistPropertyDef, property, 0 ) != KErrNotFound )
+            {
+            static_cast<CMdETextProperty*>(property)->SetValueL(
+                    aVideo.ValueText( KMPXMediaVideoArtist ) );
+            }
+        else
+            {
+            aObject.AddTextPropertyL(
+                    *iArtistPropertyDef, aVideo.ValueText( KMPXMediaVideoArtist ) );
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsDb::SetCreationDateToObjectL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsDb::SetCreationDateToObjectL( const CMPXMedia& aVideo, CMdEObject& aObject )
+    {
+    CMdEProperty* property;
+    
+    if ( aVideo.IsSupported( KMPXMediaGeneralDate ) )
+        {
+        TInt64 creationDateInt64 = 0;
+        creationDateInt64 = aVideo.ValueTObjectL<TInt64>( KMPXMediaGeneralDate );
+        TTime creationDate( creationDateInt64 );
+        if ( aObject.Property( *iCreationDatePropertyDef, property, 0 ) != KErrNotFound )
+            {
+            static_cast<CMdETimeProperty*>(property)->SetValueL( creationDate );
+            }
+        else
+            {
+            aObject.AddTimePropertyL( *iCreationDatePropertyDef, creationDate );
+            }
+#ifdef _DEBUG
+        TDateTime dT = creationDate.DateTime();
+        TBuf<200> buf;
+        buf.Format(_L("date from aVideo to aObject: %2d.%2d.%4d %2d:%2d:%2d"),
+                dT.Day()+1, dT.Month()+1, dT.Year(), dT.Hour(), dT.Minute(), dT.Second() ); 
+        MPX_DEBUG2("%S", &buf ); 
+#endif
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsDb::GetSchemaDefinitionsL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsDb::GetSchemaDefinitionsL()
+    {
+    MPX_FUNC( "CVcxMyVideosMdsDb::GetSchemaDefinitionsL" );
+
+    //  Namespace
+    iNamespaceDef = &(MdsSessionL().GetDefaultNamespaceDefL());
+    
+    //  Default object definitions
+    iVideoObjectDef = &(iNamespaceDef->GetObjectDefL( KVcxVideoObjectName ));
+
+    //  Base object property definitions
+    iTitlePropertyDef = &(iVideoObjectDef->GetPropertyDefL(
+            KVcxTitlePropertyName )); //2
+    iSizePropertyDef = &(iVideoObjectDef->GetPropertyDefL(
+            KVcxSizePropertyName )); //11 (5 also)
+    iCreationDatePropertyDef = &(iVideoObjectDef->GetPropertyDefL(
+            KVcxCreationDatePropertyName )); //6
+    iTimeOffsetPropertyDef = &(iVideoObjectDef->GetPropertyDefL(
+            KVcxTimeOffsetPropertyName )); //6
+    iItemTypePropertyDef = &(iVideoObjectDef->GetPropertyDefL(
+            KVcxItemTypePropertyName )); //9
+    iLastModifiedDatePropertyDef = &(iVideoObjectDef->GetPropertyDefL(
+            KVcxLastModifiedDatePropertyName )); //12
+
+    //  Media object property definitions
+    iDescriptionPropertyDef = &(iVideoObjectDef->GetPropertyDefL(
+            KVcxDescriptionPropertyName)); //3
+    iCopyrightPropertyDef = &(iVideoObjectDef->GetPropertyDefL(
+            KVcxCopyrightPropertyName )); //8
+    iAuthorPropertyDef = &(iVideoObjectDef->GetPropertyDefL(
+            KVcxAuthorPropertyName )); //15
+    iOriginPropertyDef = &(iVideoObjectDef->GetPropertyDefL(
+            KVcxOriginPropertyName )); //16
+    iDurationPropertyDef = &(iVideoObjectDef->GetPropertyDefL(
+            KVcxDurationPropertyName )); //17
+    iDrmPropertyDef = &(iVideoObjectDef->GetPropertyDefL(
+            KVcxDrmPropertyName )); //part of flags (7)
+    iRatingPropertyDef = &(iVideoObjectDef->GetPropertyDefL(
+            KVcxRatingPropertyName )); //19
+    iBitratePropertyDef = &(iVideoObjectDef->GetPropertyDefL(
+                KVcxBitratePropertyName )); //20
+    iAudioFourCcPropertyDef = &(iVideoObjectDef->GetPropertyDefL(
+                KVcxAudioFourCcPropertyName )); //21
+    iWidthPropertyDef = &(iVideoObjectDef->GetPropertyDefL(
+            KVcxWidthPropertyName )); //22
+    iHeightPropertyDef = &(iVideoObjectDef->GetPropertyDefL(
+            KVcxHeightPropertyName )); //23
+    iArtistPropertyDef = &(iVideoObjectDef->GetPropertyDefL(
+                KVcxArtistPropertyName )); //24
+
+    //  Video object property definitions
+    iLastPlayPositionPropertyDef = &(iVideoObjectDef->GetPropertyDefL(
+            KVcxLastPlayPositionPropertyName )); //10
+
+    iFlagsPropertyDef = &(iVideoObjectDef->GetPropertyDefL(
+            KVcxFlagsPropertyName )); //7
+
+    iAgeProfilePropertyDef = &(iVideoObjectDef->GetPropertyDefL(
+            KVcxAgeProfilePropertyName )); //13
+
+    iAudioLanguagePropertyDef = &(iVideoObjectDef->GetPropertyDefL(
+            KVcxAudioLanguagePropertyName )); //14
+    
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsDb::DoHandleObjectNotificationL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsDb::DoHandleObjectNotificationL(
+        TObserverNotificationType aType,
+        const RArray<TItemId>& aObjectIdArray )
+    {
+    MPX_FUNC( "CVcxMyVideosMdsDb::DoHandleObjectNotificationL" );
+
+    if ( iMdsDbObserver )
+        {
+        // Let delete events bypass buffer only if it empty.
+        // This assures that event arriving order stays the same.
+        if ( aType & ENotifyRemove && iEvents.Count() == 0 )
+            {
+            // Delete handling is so fast that we dont buffer them at all.
+            // Modify and add require fetch from mds -> they are slow.
+            RArray<TUint32> idArray;
+            CleanupClosePushL( idArray ); // 1->
+    
+            for ( TInt i = 0; i < aObjectIdArray.Count(); i++ )
+                {
+                idArray.Append( aObjectIdArray[i] );
+                }
+                 
+            iMdsDbObserver->HandleMyVideosDbEvent( EMPXItemDeleted, idArray, iEvents.Count() );
+    
+            CleanupStack::PopAndDestroy( &idArray ); // <-1
+            }
+        else
+            {
+            // Buffer modify & add events, since their handling is slow.
+            // Process them on background.
+            TInt count = aObjectIdArray.Count();
+            
+            if ( iEvents.Count() == 0 )
+                {
+                iEvents.ReserveL( count );
+                }
+            
+            TEvent event;
+            for ( TInt i = 0; i < count; i++ )
+                {
+                event.iMdsId     = aObjectIdArray[i];
+                event.iEventType = aType;
+                iEvents.AppendL( event );
+                }
+        
+            if ( !iEventProcessor )
+                {
+                iEventProcessor = CIdle::NewL( CActive::EPriorityIdle );
+                }
+        
+            if ( !iEventProcessor->IsActive() )
+                {
+                iEventProcessor->Start( TCallBack( ProcessEvents, this ));
+                }
+            }
+        }    
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsDb::ProcessEvents
+// ---------------------------------------------------------------------------
+//
+TInt CVcxMyVideosMdsDb::ProcessEvents( TAny* aPtr )
+    {
+    return static_cast<CVcxMyVideosMdsDb*>(aPtr)->DoProcessEvents();
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsDb::DoProcessEvents
+// ---------------------------------------------------------------------------
+//
+TInt CVcxMyVideosMdsDb::DoProcessEvents()
+    {
+    TInt sent             = 0;
+    TInt currentEventType = -1;
+    const TInt sendAtOnce = 10;
+
+    RArray<TUint32> idArray;
+    CleanupClosePushL( idArray ); // 1->
+
+    idArray.Reserve( sendAtOnce ); // may fail, it's ok
+    
+    while ( sent < sendAtOnce )
+        {
+        if ( iEvents.Count() == 0 )
+            {
+            break;
+            }
+        
+        if ( iEvents[0].iEventType != currentEventType &&
+                currentEventType != -1 )
+            {
+            break;
+            }
+        currentEventType = iEvents[0].iEventType;
+        idArray.Append( iEvents[0].iMdsId ); // this may fail, it is ok, we can't do anything for it
+        iEvents.Remove( 0 );
+        sent++;           
+        }
+
+    iEvents.Compress();
+    
+    if ( currentEventType & ENotifyAdd )
+        {
+        iMdsDbObserver->HandleMyVideosDbEvent( EMPXItemInserted, idArray, iEvents.Count() );
+        }        
+    else if ( currentEventType & ENotifyModify )
+        {
+        iMdsDbObserver->HandleMyVideosDbEvent( EMPXItemModified, idArray, iEvents.Count() );
+        }       
+    else if ( currentEventType & ENotifyRemove )
+        {
+        iMdsDbObserver->HandleMyVideosDbEvent( EMPXItemDeleted, idArray, iEvents.Count() );
+        }
+
+    CleanupStack::PopAndDestroy( &idArray ); // <-1
+    
+    return iEvents.Count();
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsDb::SetCreationAndModifiedDatesL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsDb::SetCreationAndModifiedDatesL( CMdEObject& aObject )
+    {
+    TTime time;
+    time.UniversalTime();
+    TTimeIntervalSeconds timeOffset = User::UTCOffset();
+    TTime localTime = time + timeOffset;
+
+    const TInt secondsInMinute( 60 );    
+    aObject.AddTimePropertyL( *iCreationDatePropertyDef, localTime ); 
+    aObject.AddInt16PropertyL( *iTimeOffsetPropertyDef, timeOffset.Int() / secondsInMinute );
+    aObject.AddTimePropertyL( *iLastModifiedDatePropertyDef, localTime );
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsDb::MdsSessionL
+// ---------------------------------------------------------------------------
+//
+CMdESession& CVcxMyVideosMdsDb::MdsSessionL()
+    {
+    if ( iMdsSessionError == KErrServerTerminated )
+        {
+        // This ensures that the iMdsSessionError KErrServerTerminated
+        // value does not change, since the user can't access iMdsSession.
+        // Recovery happens in ShutDownNotification func.
+        User::Leave( KErrServerTerminated );
+        }
+
+    if ( !iMdsSession )
+        {
+        OpenMdsSessionL();
+        
+        if ( !iMdsSession )
+            {
+            User::Leave( KErrGeneral );
+            }
+        }
+
+    return *iMdsSession;
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsDb::ShutdownNotification
+// From MVcxMdsShutDownMonitorObserver
+// ---------------------------------------------------------------------------
+//    
+void CVcxMyVideosMdsDb::ShutdownNotification( TInt aShutdownState )
+    {
+    if ( aShutdownState == 0 )
+        {
+        // Server has restarted, recreate session.
+        MPX_DEBUG1("CVcxMyVideosMdsDb:: MDS Server restarted!");
+        OpenMdsSessionL();
+        return;
+        }
+        
+    if ( aShutdownState == 1 )
+        {
+        MPX_DEBUG1("CVcxMyVideosMdsDb:: MDS Server went down!");
+        iMdsSessionError = KErrServerTerminated;
+        }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosmessagelist.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,329 @@
+/*
+* 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 <e32cmn.h>
+#include <mpxlog.h>
+#include <mpxmediacontainerdefs.h>
+#include <mpxmediageneraldefs.h>
+#include <mpxmessagegeneraldefs.h>
+#include <mpxcommandgeneraldefs.h>
+#include <mpxcollectioncommanddefs.h>
+#include <mpxmessagecontainerdefs.h>
+#include <vcxmyvideosuids.h>
+#include "vcxmyvideoscollectionplugin.h"
+#include "vcxmyvideoscollectionutil.h"
+#include "vcxmyvideosmessagelist.h"
+
+// ============================ MEMBER FUNCTIONS ==============================
+
+// ----------------------------------------------------------------------------
+// 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");
+    
+    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 ( aChange == EMPXItemModified && AlreadyInMessageListL( aId, aChange, aExtraInfo ) )
+        {
+        MPX_DEBUG1("CVcxMyVideosMessageList:: already in message list, skipping add");
+        return;
+        }
+     
+    CMPXMessage* message = CMPXMedia::NewL();
+    CleanupStack::PushL( message ); // 1->
+
+    message->SetTObjectValueL<TMPXMessageId>(KMPXMessageGeneralId, KMPXMessageIdItemChanged);
+    message->SetTObjectValueL<TUid>(KMPXMessageCollectionId, TUid::Uid(KVcxUidMyVideosMpxCollection));        
+    message->SetTObjectValueL<TMPXChangeEventType>(KMPXMessageChangeEventType, aChange);        
+    message->SetTObjectValueL<TMPXItemId>(KMPXMessageMediaGeneralId, aId);
+    message->SetTObjectValueL<TMPXGeneralCategory>( KMPXMessageMediaGeneralCategory, EMPXCollection );
+    
+    if ( aVideo && aChange == EMPXItemInserted )
+        {
+        message->SetCObjectValueL<CMPXMedia>( KMPXCommandColAddMedia, aVideo );
+        }
+        
+    if ( aExtraInfo )
+        {
+        message->SetTObjectValueL<TInt32>( KVcxMediaMyVideosInt32Value, aExtraInfo );
+        }
+    
+    MPX_DEBUG1("CVcxMyVideosMessageList:: appending to message array");
+    
+    iMessageArray->AppendL( message ); // ownership moves
+
+    CleanupStack::Pop( message ); // <-1        
+
+    iMessageCount++;
+    iMessageList->SetTObjectValueL<TInt>( KMPXMessageArrayCount, iMessageCount );
+    
+    if ( iMessageArray->Count() > 100 )
+        {
+        SendL();
+        }
+    }
+
+// ----------------------------------------------------------------------------------------------------------
+// CVcxMyVideosMessageList::AddEventL
+// ----------------------------------------------------------------------------------------------------------
+//
+void CVcxMyVideosMessageList::AddEventL( TInt aEvent )
+    {
+    TMPXItemId itemId;
+    itemId.iId1 = KVcxCommandIdMyVideos;
+    CMPXMedia* msg = CMPXMedia::NewL();
+    CleanupStack::PushL( msg ); // 1->
+    msg->SetTObjectValueL<TMPXMessageId>( KMPXMessageGeneralId, itemId );
+    msg->SetTObjectValueL<TUid>(KMPXMessageCollectionId, TUid::Uid(KVcxUidMyVideosMpxCollection));        
+
+    msg->SetTObjectValueL<TInt>( 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<TMPXItemId>( KMPXMessageMediaGeneralId );
+            event  = media->ValueTObjectL<TMPXChangeEventType>( KMPXMessageChangeEventType );
+            
+            if ( aId == itemId && aChange == event )
+                {
+                extraInfo = 0;
+                if ( media->IsSupported( KVcxMediaMyVideosInt32Value ) )
+                    {
+                    extraInfo = media->ValueTObjectL<TInt32>( KVcxMediaMyVideosInt32Value );
+                    }
+                    
+                if ( extraInfo == EVcxMyVideosVideoListOrderChanged &&
+                        aExtraInfo == 0 )
+                    {
+                    MPX_DEBUG1("CVcxMyVideosMessageList:: found similar message with EVcxMyVideosVideoListOrderChanged flag set, discarding this msg");
+                    return ETrue;
+                    }
+                
+                if ( aExtraInfo == EVcxMyVideosVideoListOrderChanged &&
+                       extraInfo == 0 )
+                    {
+                    MPX_DEBUG1("CVcxMyVideosMessageList:: Turning the EVcxMyVideosVideoListOrderChanged flag on to the previous message");
+                    MPX_DEBUG1("CVcxMyVideosMessageList:: and discarding this.");
+                    media->SetTObjectValueL<TInt32>( KVcxMediaMyVideosInt32Value,
+                            EVcxMyVideosVideoListOrderChanged );
+                    return ETrue;
+                    }
+                     
+                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<TUint32>( 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
+    iMessageCount++;
+    iMessageList->SetTObjectValueL<TInt>( KMPXMessageArrayCount, iMessageCount );
+    iMessageArray->AppendL( aMessage ); // ownership moves
+    }
+
+// ----------------------------------------------------------------------------------------------------------
+// CVcxMyVideosMessageList::SendL
+// ----------------------------------------------------------------------------------------------------------
+//
+void CVcxMyVideosMessageList::SendL()
+    {
+    MPX_DEBUG1("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<CMPXMessageArray>( KMPXMessageArrayContents ); 
+
+        iMessageList->SetTObjectValueL<TMPXMessageId>(KMPXMessageGeneralId, KVcxCommandIdMyVideos);
+        iMessageList->SetTObjectValueL<TInt>(KVcxMediaMyVideosCommandId, KVcxMessageMyVideosMessageArray );
+        iMessageList->SetTObjectValueL<TUid>(KMPXMessageCollectionId, TUid::Uid(KVcxUidMyVideosMpxCollection));
+        iMessageCount = 0;
+        }
+    }
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosopenhandler.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,549 @@
+/*
+* 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 <e32base.h>
+#include <mpxlog.h>
+#include <mpxcollectionplugin.h>
+#include <mpxcollectionpluginobserver.h>
+#include <mpxmediacontainerdefs.h>
+#include <mpxmediageneraldefs.h>
+
+#include "vcxmyvideoscollectionplugin.h"
+#include "vcxmyvideosopenhandler.h"
+#include "vcxmyvideosvideocache.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 )
+    {
+    MPX_FUNC("CVcxMyVideosOpenHandler::OpenL");
+
+    MPX_DEBUG1("CVcxMyVideosOpenHandler:: path before open:");
+    MPX_DEBUG_PATH( aPath );
+
+    iPath = &aPath;
+    
+    const TInt categoryLevel = 1;
+    const TInt videosLevel   = 2;
+    const TInt playlistLevel = 3;
+    
+    switch ( aPath.Levels() )
+        {
+        case categoryLevel:
+            {
+            //we are at root level, return main level items (categories + albums)
+
+#ifdef VCX_ALBUMS             
+            iCollection.AlbumsL().CreateAlbumListL(); //async
+#endif
+
+            // This is needed to update category counters.
+            // Goes to queue if CreateAlbumListL command goes to execution
+            TRAPD( err, iCache.CreateVideoListL() );
+            
+            if ( err != KErrNone )
+                {
+                MPX_DEBUG2("iCache->CreateVideoListL() left: %d. Returning categories and albums anyway.", err);
+                }
+            
+            CMPXMedia* itemList = TVcxMyVideosCollectionUtil::CreateEmptyMediaListL();
+            CleanupStack::PushL( itemList );
+            
+            itemList->SetTObjectValueL<TBool>( KVcxMediaMyVideosVideoListIsPartial,
+                !iCache.IsComplete() );
+                
+            TVcxMyVideosCollectionUtil::AppendToListL( *itemList, *iCollection.CategoriesL().iList );
+#ifdef VCX_ALBUMS
+            TVcxMyVideosCollectionUtil::AppendToListL( *itemList, *iCollection.AlbumsL().iAlbumList );
+#endif
+            itemList->SetCObjectValueL( KMPXMediaGeneralContainerPath, iPath );
+            iCollection.iObs->HandleOpen( itemList, KErrNone );
+            CleanupStack::PopAndDestroy( itemList );
+            MPX_DEBUG1("CVcxMyVideosOpenHandler:: called HandleOpen for categories + albums");
+            }
+            break;
+
+        case videosLevel:
+            {
+            //we are at second level, return video list from some category or album
+
+#ifdef VCX_ALBUMS
+            iCollection.AlbumsL().CreateAlbumListL(); //async
+#endif
+
+            TMPXItemId categoryId( aPath.Id() );
+            
+            if ( ( categoryId.iId2 == KVcxMvcMediaTypeCategory ) ||
+                    ( categoryId.iId2 == KVcxMvcMediaTypeVideo ) && 
+                 (categoryId.iId1 == KVcxMvcCategoryIdAll ||
+                 categoryId.iId1 == KVcxMvcCategoryIdDownloads ||
+                 categoryId.iId1 == KVcxMvcCategoryIdTvRecordings ||
+                 categoryId.iId1 == KVcxMvcCategoryIdCaptured ||
+                 categoryId.iId1 == KVcxMvcCategoryIdOther) )
+                {
+                MPX_DEBUG2("CVcxMyVideosOpenHandler:: opening category %d", categoryId.iId1 );
+                OpenCategoryL( categoryId.iId1 );
+                return;
+                }
+            else
+                {
+                MPX_DEBUG2("CVcxMyVideosOpenHandler:: opening album %d", categoryId.iId1 );
+                
+                iPendingAlbumOpenId = categoryId.iId1;
+                if ( iCollection.AlbumsL().iAlbumListIsComplete ) 
+                    {
+                    HandleAlbumOpenL(); // iPendingAlbumOpenId goes to 0
+                    return;
+                    }
+                else
+                    {
+                    // We will continue at HandleAlbumOpenL when album list arrives, iPendingAlbumOpenId is left != 0
+                    return;
+                    }
+                }            
+            }
+
+        case playlistLevel:
+			{
+			iCollection.iObs->HandleOpen(const_cast<CMPXCollectionPath*> (&aPath), KErrNone);
+			}
+			break;
+
+        default:
+            break;
+
+        } //switch
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosOpenHandler::OpenCategoryL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosOpenHandler::OpenCategoryL( TUint32 aCategoryId )
+    {
+    TUint8 origin = static_cast<TUint8>( TVcxMyVideosCollectionUtil::Origin( aCategoryId ) );
+
+    iCache.CreateVideoListL(); // Causes async call to MDS, callbacks to DoHandleCreateVideoListRespL will follow.
+                               // If iCache.iVideoList is complete and can be used (correct sorting order),
+                               // then nothing is done.
+
+    if ( iCache.IsComplete() )
+        {
+        MPX_DEBUG1("CVcxMyVideosOpenHandler:: videolist complete");
+
+        // iCache.iVideoList is complete
+        if ( aCategoryId == KVcxMvcCategoryIdAll )
+            {
+            MPX_DEBUG1("CVcxMyVideosOpenHandler:: KVcxMvcCategoryIdAll: calling HandleOpen(iCache.iVideoList)");
+            iCache.iVideoList->SetCObjectValueL( KMPXMediaGeneralContainerPath, iPath );
+            iCache.iVideoList->SetTObjectValueL<TInt>( KVcxMediaMyVideosInt32Value,
+                    EVcxMyVideosVideoListComplete );
+            iCollection.iObs->HandleOpen( iCache.iVideoList, KErrNone );                    
+            }
+        else
+            {
+            MPX_DEBUG1("CVcxMyVideosOpenHandler:: other than KVcxMvcCategoryIdAll: creating new category video list");
+            CMPXMedia* videoList = iCache.CreateVideoListByOriginL( origin );
+            MPX_DEBUG1("CVcxMyVideosOpenHandler:: calling HandleOpen(new list)");
+            videoList->SetCObjectValueL( KMPXMediaGeneralContainerPath, iPath );
+            videoList->SetTObjectValueL<TInt>( KVcxMediaMyVideosInt32Value,
+                    EVcxMyVideosVideoListComplete );
+            iCollection.iObs->HandleOpen( videoList, KErrNone );
+            delete videoList;
+            }
+        iCollection.iMessageList->AddEventL( KVcxMessageMyVideosListComplete );
+        iCollection.iMessageList->SendL();
+
+        // No append events will arrive anymore -> we create our own version of the
+        // video list.
+        iCache.ReCreateVideoListL();
+        }
+    else
+        {
+        MPX_DEBUG1("CVcxMyVideosOpenHandler:: video list incomplete");
+        // iCache.iVideoList is incomplete                
+
+        if ( aCategoryId == KVcxMvcCategoryIdAll )
+            {
+            MPX_DEBUG1("CVcxMyVideosOpenHandler:: KVcxMvcCategoryIdAll, calling HandleOpen");
+            iCache.iVideoList->SetCObjectValueL( KMPXMediaGeneralContainerPath, iPath );
+            iCollection.iObs->HandleOpen( iCache.iVideoList, KErrNone  );
+            }
+        else
+            {   
+            MPX_DEBUG1("CVcxMyVideosOpenHandler:: other than KVcxMvcCategoryIdAll");
+
+            TInt pos = iCategoryIdsBeingOpened.Find( aCategoryId );
+            if ( pos == KErrNotFound )
+                {
+                MPX_DEBUG1("CVcxMyVideosOpenHandler:: category was not opened yet, creating list for it");
+                iCategoryIdsBeingOpened.AppendL( aCategoryId ); 
+                CMPXMedia* videoList = iCache.CreateVideoListByOriginL( origin );
+                CleanupStack::PushL( videoList );
+                iVideoListsBeingOpened.AppendL( videoList );
+                CleanupStack::Pop( videoList );
+                MPX_DEBUG1("CVcxMyVideosOpenHandler:: calling HandleOpen");
+                videoList->SetCObjectValueL( KMPXMediaGeneralContainerPath, iPath );
+                iCollection.iObs->HandleOpen( videoList, KErrNone  );
+                }
+            else
+                {
+                MPX_DEBUG1("CVcxMyVideosOpenHandler:: category was already being opened, calling HandleOpen with that");                        
+                iVideoListsBeingOpened[pos]->SetCObjectValueL( KMPXMediaGeneralContainerPath, iPath );
+                iCollection.iObs->HandleOpen( iVideoListsBeingOpened[pos], KErrNone  );
+                }
+            }
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosOpenHandler::DoHandleCreateVideoListRespL
+// New items fetched from MDS. iCollection.iCache->iVideoList = &aVideoList.
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosOpenHandler::DoHandleCreateVideoListRespL(
+        CMPXMedia* aVideoList, TInt aNewItemsStartIndex, TBool aComplete )
+    {    
+    MPX_FUNC("CVcxMyVideosOpenHandler::DoHandleCreateVideoListRespL()");
+
+    MPX_DEBUG2("CVcxMyVideosOpenHandler:: aComplete = %d", aComplete);
+    
+    if ( aNewItemsStartIndex != KErrNotFound )
+        {
+        //iCache.iVideoList now contains new items, tell iCache to check if partial list contains the new items
+        iCache.CheckForPartialVideoListItemsL( aNewItemsStartIndex );
+        }
+
+    // Append new items to category video lists. All category is using iCache.iVideoList, thus no need to append to it.
+    TInt categoryCount = iCategoryIdsBeingOpened.Count();
+    for ( TInt i = 0; i < categoryCount; i++ )
+        {
+        iCache.AppendToListL( *iVideoListsBeingOpened[i], *aVideoList,
+                TVcxMyVideosCollectionUtil::Origin( iCategoryIdsBeingOpened[i] ),
+                aNewItemsStartIndex );
+        }
+
+    // Append new items to album video lists.
+    TInt albumCount = iAlbumVideoListsBeingOpened.Count();
+    for ( TInt i = 0; i < albumCount; i++ )
+        {
+        iCollection.iAlbums->Album( iAlbumIdsBeingOpened[i] )->AppendToVideoListL(
+                *aVideoList, *(iAlbumVideoListsBeingOpened[i]), aNewItemsStartIndex );
+        }
+
+    if ( aComplete == 0 )
+        {
+        iCollection.iMessageList->AddEventL( KVcxMessageMyVideosItemsAppended );
+
+        // Still fetching items
+        iCollection.CategoriesL().UpdateCategoriesL( *aVideoList, aNewItemsStartIndex );
+        }                           
+    else
+        {
+        // End event arrived
+        
+        iCache.SetComplete( ETrue );
+        iCache.iIsFetchingVideoList = EFalse;
+        
+
+        // Create modify event for All category.
+        // This will cause client to make a new OpenL() call.
+        // Also this causes collection framework to purge its possibly outdated
+        // (KVcxMessageMyVideosItemsAppended events don't update collection framework cache) cache.
+        MPX_DEBUG3("CVcxMyVideosOpenHandler:: adding modify event for category[%d], extra info = %d",
+                KVcxMvcCategoryIdAll, EVcxMyVideosVideoListOrderChanged );
+        iCollection.iMessageList->AddEventL( TMPXItemId( KVcxMvcCategoryIdAll, 1 ), EMPXItemModified,
+                EVcxMyVideosVideoListOrderChanged );
+        // We dont send here, the send is at the end of this function.
+
+        for ( TInt i = 0; i < categoryCount; i++ )
+            {
+            // Create modify event for other than All categories.
+            // This will cause client to make a new OpenL() call.
+            // Also this causes collection framework to purge its possibly outdated
+            // (KVcxMessageMyVideosItemsAppended events don't update collection frameworks cache) cache.
+            MPX_DEBUG3("CVcxMyVideosOpenHandler:: adding modify event for category[%d], extra info = %d",
+                    iCategoryIdsBeingOpened[i], EVcxMyVideosVideoListOrderChanged );
+            iCollection.iMessageList->AddEventL( TMPXItemId( iCategoryIdsBeingOpened[i], 1 ), EMPXItemModified,
+                    EVcxMyVideosVideoListOrderChanged );
+            // We dont send here, the send is at the end of this function.
+            delete iVideoListsBeingOpened[i]; // we can delete our copy, client has its own copy
+            iVideoListsBeingOpened[i] = NULL;
+            }
+        iVideoListsBeingOpened.Reset();
+        iCategoryIdsBeingOpened.Reset();
+
+        for ( TInt i = 0; i < albumCount; i++ )
+            {
+            // Create modify event for albums.
+            // This will cause client to make a new OpenL() call.
+            // Also this causes collection framework to purge its possibly outdated
+            // (KVcxMessageMyVideosItemsAppended events don't update collection frameworks cache) cache.
+            MPX_DEBUG3("CVcxMyVideosOpenHandler:: adding modify event for album %d, extra info = %d",
+                    iAlbumIdsBeingOpened[i], EVcxMyVideosVideoListOrderChanged );
+            iCollection.iMessageList->AddEventL(
+                    TMPXItemId( iAlbumIdsBeingOpened[i], KVcxMvcMediaTypeAlbum ),
+                    EMPXItemModified, EVcxMyVideosVideoListOrderChanged );
+            // We dont send here, the send is at the end of this function.
+            delete iAlbumVideoListsBeingOpened[i]; // we can delete our copy, client has its own copy
+            iAlbumVideoListsBeingOpened[i] = NULL;
+            }
+        iAlbumVideoListsBeingOpened.Reset();
+        iAlbumIdsBeingOpened.Reset();
+        
+        // All category, lets delete our copy and start using new one, this gives the full
+        // ownership of the list to client. Video objects will continue to point to the same shared data.
+        iCache.ReCreateVideoListL();
+
+        iCollection.CategoriesL().UpdateCategoriesNewVideoNamesL();
+
+        iCollection.AlbumsL().CalculateAttributesL(); // adds events if attributes modified, does not send
+        
+        iCollection.iMessageList->AddEventL( KVcxMessageMyVideosListComplete );
+        }
+    iCollection.iMessageList->SendL();
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosOpenHandler::HandleAlbumOpenL
+// Album list has been fetched already.
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosOpenHandler::HandleAlbumOpenL()
+    {
+    MPX_DEBUG1("CVcxMyVideosOpenHandler::HandleAlbumOpenL() start");
+    
+    CVcxMyVideosAlbum* album = iCollection.AlbumsL().Album( iPendingAlbumOpenId );
+    if ( album )
+        {
+        if ( iCollection.iCache->IsComplete() )
+            {
+            //videolist complete
+            CMPXMedia* videoList = album->CreateVideoListL();
+            CleanupStack::PushL( videoList ); // 1->
+            videoList->SetCObjectValueL( KMPXMediaGeneralContainerPath, iPath );
+            videoList->SetTObjectValueL<TInt>( KVcxMediaMyVideosInt32Value,
+                    EVcxMyVideosVideoListComplete ); 
+            iCollection.iObs->HandleOpen( videoList, KErrNone );
+            CleanupStack::PopAndDestroy( videoList ); // <-1
+            iCollection.iMessageList->AddEventL( KVcxMessageMyVideosListComplete );
+            iCollection.iMessageList->SendL();
+            }
+        else
+            {
+            if ( iCollection.iCache->iIsFetchingVideoList )
+                {
+                MPX_DEBUG1("CVcxMyVideosOpenHandler:: videolist fetching already in progress -> use that to populate album");
+
+                // videolist incomplete and fetching already going on
+                TInt pos = iAlbumIdsBeingOpened.Find( iPendingAlbumOpenId );
+                if ( pos == KErrNotFound )
+                    {
+                    //store video list for append events
+                    CMPXMedia* videoList = album->CreateVideoListL();
+                    CleanupStack::PushL( videoList );
+                    iAlbumVideoListsBeingOpened.AppendL( videoList );
+                    CleanupStack::Pop( videoList );
+                    iAlbumIdsBeingOpened.AppendL( iPendingAlbumOpenId );
+                    videoList->SetCObjectValueL( KMPXMediaGeneralContainerPath, iPath );
+                    iCollection.iObs->HandleOpen( videoList, KErrNone );
+                    }
+                else
+                    {
+                    //video list already stored
+                    iAlbumVideoListsBeingOpened[pos]->SetCObjectValueL( KMPXMediaGeneralContainerPath, iPath );
+                    iCollection.iObs->HandleOpen( iAlbumVideoListsBeingOpened[pos],
+                            KErrNone );
+                    }
+                }
+            else
+                {
+                MPX_DEBUG1("CVcxMyVideosOpenHandler:: videolist partial and no fetching going on -> fetch the album videos separately");
+
+                delete iAlbumVideoList;
+                iAlbumVideoList = NULL;
+                iAlbumVideoList = TVcxMyVideosCollectionUtil::CreateEmptyMediaListL();
+                iCollection.iMyVideosMdsDb->iAlbums->GetAlbumContentVideosL( iPendingAlbumOpenId,
+                        *iAlbumVideoList, *this );
+                return;
+                }
+            }
+        }
+    else
+        {
+        MPX_DEBUG2("CVcxMyVideosOpenHandler:: album ID not valid (%d) -> calling HandleOpen with KErrNotFound",
+                iPendingAlbumOpenId);
+        iCollection.iObs->HandleOpen( static_cast<CMPXMedia*>(NULL), KErrNotFound );
+        }
+    iPendingAlbumOpenId = 0;
+
+    MPX_DEBUG1("CVcxMyVideosOpenHandler::HandleAlbumOpenL() exit");
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosOpenHandler::HandleGetAlbumContentVideosResp
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosOpenHandler::HandleGetAlbumContentVideosResp(
+        TUint32 aAlbumId, CMPXMedia& aVideoList, TInt aError,
+        TInt aFirstNewItemIndex, TInt aNewItemCount, TBool aComplete )
+    {
+    TRAPD( err, HandleGetAlbumContentVideosRespL( aAlbumId, aVideoList, aError,
+            aFirstNewItemIndex, aNewItemCount, aComplete ));
+    if ( err != KErrNone )
+        {
+        MPX_DEBUG2("CVcxMyVideosOpenHandler:: HandleGetAlbumContentVideosRespL leaved: %d", err);
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosOpenHandler::HandleGetAlbumContentVideosRespL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosOpenHandler::HandleGetAlbumContentVideosRespL(
+        TUint32 aAlbumId, CMPXMedia& /*aVideoList*/, TInt aError,
+        TInt /*aFirstNewItemIndex*/, TInt /*aNewItemCount*/, TBool aComplete )
+    {
+    MPX_DEBUG1("CVcxMyVideosOpenHandler::HandleGetAlbumContentVideosRespL() start");
+    
+    if ( aError != KErrNone )
+        {
+        MPX_DEBUG2("CVcxMyVideosOpenHandler:: error %d occured when fetching album videos", aError );        
+        }
+    
+    MPX_DEBUG3("CVcxMyVideosOpenHandler:: iPendingAlbumOpenId = %d, aAlbumId = %d", iPendingAlbumOpenId, aAlbumId );
+    
+    if ( iPendingAlbumOpenId == aAlbumId )
+        {
+        MPX_DEBUG2("CVcxMyVideosOpenHandler:: First videos for album %d arrived, calling HandleOpen()", aAlbumId);
+        
+        iAlbumVideoList->SetCObjectValueL( KMPXMediaGeneralContainerPath, iPath );
+        if ( aComplete )
+            {
+            iAlbumVideoList->SetTObjectValueL<TInt>( KVcxMediaMyVideosInt32Value,
+                    EVcxMyVideosVideoListComplete );
+            }
+        iCollection.iObs->HandleOpen( iAlbumVideoList, aError );
+        iPendingAlbumOpenId = 0;
+        }
+
+    if ( !aComplete )
+        {
+        iCollection.iMessageList->AddEventL( KVcxMessageMyVideosItemsAppended );
+
+        MPX_DEBUG3("CVcxMyVideosOpenHandler:: adding modify event for album %d, extra info = %d",
+                aAlbumId, EVcxMyVideosVideoListOrderChanged );
+        iCollection.iMessageList->AddEventL( TMPXItemId( aAlbumId, KVcxMvcMediaTypeAlbum ), EMPXItemModified,
+                EVcxMyVideosVideoListOrderChanged );
+        }
+    else
+        {
+        //TODO: should add album id
+        iCollection.AlbumsL().CalculateAttributesL(); // adds events if attributes modified, does not send
+
+        iCollection.iMessageList->AddEventL( KVcxMessageMyVideosListComplete );
+
+        
+        delete iAlbumVideoList;
+        iAlbumVideoList = NULL;
+        }
+    
+    iCollection.iMessageList->SendL();
+    
+    MPX_DEBUG1("CVcxMyVideosOpenHandler::HandleGetAlbumContentVideosRespL() exit");
+    }
+
+// END OF FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosvideocache.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,1778 @@
+/*
+* 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 <mpxlog.h>
+#include <mpxmedia.h>
+#include <mpxmediaarray.h>
+#include <mpxmediageneraldefs.h>
+#include <mpxmediageneralextdefs.h>
+#include <mpxmediacontainerdefs.h>
+#include <vcxmyvideosdefs.h>
+#include <centralrepository.h>
+#include <collate.h>
+#include <mpxmediavideodefs.h>
+#include "vcxmyvideosvideocache.h"
+#include "vcxmyvideoscollectionplugin.h"
+#include "vcxmyvideoscollectionutil.h"
+#include "vcxmyvideoscategories.h"
+#include "vcxmyvideosmessagelist.h"
+#include "vcxmyvideosopenhandler.h"
+#include "vcxmyvideosalbums.h"
+
+// ============================ 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 )
+    {
+    CMPXMediaArray* mediaArray = TVcxMyVideosCollectionUtil::MediaArrayL( aVideoList );
+    TInt count = mediaArray->Count();
+    iVideoArray.Reset();
+    iVideoArray.ReserveL( count );
+    for ( TInt i = 0; i < count; i++ )
+        {
+        AddL( mediaArray->AtL( i ), i );
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosVideoListIndex::Find
+// ----------------------------------------------------------------------------
+//
+TInt CVcxMyVideosVideoListIndex::Find( TUint32 aMdsId, TVcxMyVideosVideo& aVideo )
+    {
+    const TLinearOrder<TVcxMyVideosVideo> 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<TVcxMyVideosVideo> 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<TVcxMyVideosVideo> 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<TVcxMyVideosVideo>& CVcxMyVideosVideoListIndex::VideoArray()
+    {
+    return iVideoArray;
+    }
+#endif
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosVideoListIndex::Sort
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosVideoListIndex::Sort()
+    {
+    const TLinearOrder<TVcxMyVideosVideo> 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 )
+    {
+    MPX_FUNC("CVcxMyVideosCollectionCache::NewL");
+
+    CVcxMyVideosVideoCache* self = new (ELeave) CVcxMyVideosVideoCache( aMyVideosCollectionPlugin );
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// ----------------------------------------------------------------------------
+// Destructor.
+// ----------------------------------------------------------------------------
+//
+CVcxMyVideosVideoCache::~CVcxMyVideosVideoCache()
+    {
+    MPX_FUNC("CVcxMyVideosVideoCache::~CVcxMyVideosVideoCache");
+    
+    delete iVideoList;
+    DeletePartialList();
+    delete iVideoListIndex;
+    }
+
+// ----------------------------------------------------------------------------
+// Constructor.
+// ----------------------------------------------------------------------------
+//
+CVcxMyVideosVideoCache::CVcxMyVideosVideoCache(
+        CVcxMyVideosCollectionPlugin& aMyVideosCollectionPlugin )
+: iCollection( aMyVideosCollectionPlugin )
+    {
+    MPX_FUNC("CVcxMyVideosVideoCache::CVcxMyVideosVideoCache");
+    }
+
+// ----------------------------------------------------------------------------
+// Symbian 2nd phase constructor can leave.
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosVideoCache::ConstructL ()
+    {
+    MPX_FUNC("CVcxMyVideosVideoCache::ConstructL");
+
+    iVideoList          = TVcxMyVideosCollectionUtil::CreateEmptyMediaListL();
+    SetComplete( EFalse );
+    
+    iPartialVideoList.Reset();
+    iVideoListIndex = CVcxMyVideosVideoListIndex::NewL();
+    }
+
+// ----------------------------------------------------------------------------------------------------------
+// CVcxMyVideosVideoCache::CreateVideoListByOriginL
+// ----------------------------------------------------------------------------------------------------------
+//
+CMPXMedia* CVcxMyVideosVideoCache::CreateVideoListByOriginL( TUint8 aOrigin )
+    {
+    MPX_FUNC("CVcxMyVideosVideoCache::CreateVideoListByOriginL()");
+    
+    CMPXMediaArray* allVideosArray = NULL;
+    TInt allVideosArrayCount       = 0;
+
+    if ( aOrigin == EVcxMyVideosOriginSideLoaded )
+        {
+        aOrigin = EVcxMyVideosOriginOther;
+        }
+            
+    allVideosArray = iVideoList->Value<CMPXMediaArray>(
+            KMPXMediaArrayContents);
+
+    allVideosArrayCount = allVideosArray->Count();
+
+    MPX_DEBUG2("CVcxMyVideosVideoCache:: iVideoList count = %d", allVideosArrayCount );
+    
+    CMPXMedia* filteredVideos =
+            TVcxMyVideosCollectionUtil::CreateEmptyMediaListL();
+    CleanupStack::PushL( filteredVideos ); // 1->
+                        
+    CMPXMediaArray* filteredVideosArray = filteredVideos->Value<CMPXMediaArray>(
+            KMPXMediaArrayContents );
+
+    CMPXMedia* media = NULL;
+    
+    for( TInt i = 0; i < allVideosArrayCount; i++ )
+        {
+        media = (*allVideosArray)[i];
+
+        TUint8 mediaOrigin = TVcxMyVideosCollectionUtil::OriginL( *media );
+                    
+        if ( mediaOrigin == aOrigin )
+            {
+            filteredVideosArray->AppendL( *media );
+            }
+        }
+    
+    filteredVideos->SetTObjectValueL( KMPXMediaArrayCount, filteredVideosArray->Count() );
+    
+    CleanupStack::Pop( filteredVideos );  // <-1
+    return filteredVideos;
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosVideoCache::AppendToListL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosVideoCache::AppendToListL( CMPXMedia& aToList, CMPXMedia& aFromList,
+        TUint8 aOrigin, TInt aNewItemsStartIndex )
+    {
+    MPX_FUNC("CVcxMyVideosVideoCache::AppendToListL()");
+    
+    if ( aNewItemsStartIndex < 0 )
+        {
+        MPX_DEBUG1("CVcxMyVideosVideoCache:: aNewItemsStartIndex < 0 -> skipping");
+        return;
+        }
+        
+    CMPXMediaArray* toArray = aToList.Value<CMPXMediaArray>(
+            KMPXMediaArrayContents );
+
+    CMPXMediaArray* fromArray = aFromList.Value<CMPXMediaArray>(
+            KMPXMediaArrayContents );
+
+    TInt fromCount = fromArray->Count();
+    TInt origin;
+    CMPXMedia* media;
+    for ( TInt i = aNewItemsStartIndex; i < fromCount; i++ )
+        {
+        media  = fromArray->AtL( i );
+        origin = TVcxMyVideosCollectionUtil::OriginL( *media );
+        if ( origin == aOrigin )
+            {
+            toArray->AppendL( *media );
+            } 
+        }
+    }
+    
+// ----------------------------------------------------------------------------
+// CVcxMyVideosVideoCache::FindVideoByUriL
+// ----------------------------------------------------------------------------
+//
+CMPXMedia* CVcxMyVideosVideoCache::FindVideoByUriL( const TDesC& aUri )
+    {    
+    CMPXMediaArray* cachedVideoArray = iVideoList->Value<CMPXMediaArray>(
+                                KMPXMediaArrayContents);
+
+    for ( TInt i = 0; i < cachedVideoArray->Count(); i++ )
+        {       
+        if ( (*cachedVideoArray)[i]->ValueText( KVcxMediaMyVideosRemoteUrl ) == aUri )
+            {
+            return (*cachedVideoArray)[i];
+            }
+        }
+    return NULL;
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosVideoCache::FindVideoByMdsIdL
+// ----------------------------------------------------------------------------
+//
+CMPXMedia* CVcxMyVideosVideoCache::FindVideoByMdsIdL( TUint32 aMdsId, TInt& aPos )
+    {
+    //MPX_FUNC("CVcxMyVideosVideoCache::FindVideoByMdsIdL()");
+    
+    //MPX_DEBUG2("CVcxMyVideosVideoCache:: looking for %d MDS ID from cache", aMdsId);
+    
+    aPos = KErrNotFound;
+    
+    if ( !iVideoList )
+        {
+        return NULL;
+        }
+    
+    if ( IsComplete() )
+        {
+        TVcxMyVideosVideo video;
+        TInt pos = iVideoListIndex->Find( aMdsId, video );
+        if ( pos != KErrNotFound )
+            {
+            aPos = video.iPos;
+            MPX_DEBUG2("CVcxMyVideosVideoCache::FindVideoByMdsIdL found %d from index", aMdsId );
+            return video.iVideo;
+            }
+        }
+    
+    CMPXMediaArray* cachedVideoArray = iVideoList->Value<CMPXMediaArray>(
+                                KMPXMediaArrayContents);
+   
+    TMPXItemId mpxItemId;
+    CMPXMedia* media;
+    TInt count = cachedVideoArray->Count();
+    for ( TInt i = 0; i < count; i++ )
+        {
+        media = cachedVideoArray->AtL( i );
+        if ( media->IsSupported( KMPXMediaGeneralId ))
+            {
+            mpxItemId = media->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId );
+            if ( mpxItemId.iId1 == aMdsId && mpxItemId.iId2 == 0 )
+                {
+                MPX_DEBUG2("CVcxMyVideosVideoCache::FindVideoByMdsIdL() found %d from iVideoList", aMdsId );
+                aPos = i;
+                return media;
+                }
+            }
+        }
+
+    count = iPartialVideoList.Count();
+    TMPXItemId mpxId;  
+    for ( TInt i = 0; i < count; i++ )
+        {
+        mpxId = TVcxMyVideosCollectionUtil::IdL( *(iPartialVideoList[i]) );
+        if ( aMdsId ==  mpxId.iId1 )
+            {
+            MPX_DEBUG2("CVcxMyVideosVideoCache::FindVideoByMdsIdL() found %d from iPartialVideoList", aMdsId );
+            MPX_DEBUG1("CVcxMyVideosVideoCache::FindVideoByMdsIdL() returning the pointer and setting aPos to KErrNotFound");
+            aPos = KErrNotFound; // this indicates that not found from iVideoList
+            return iPartialVideoList[i];
+            }       
+        }
+
+    MPX_DEBUG2("CVcxMyVideosCollectionPlugin::FindVideoByMdsIdL() MDSID %d NOT FOUND", aMdsId);
+    return NULL;
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosVideoCache::GetVideosL
+// ----------------------------------------------------------------------------
+//
+CMPXMedia* CVcxMyVideosVideoCache::GetVideosL( RArray<TUint32>& 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<TUint32>& aMdsIds,
+        TBool& aListFetchingWasCanceled, RArray<TUint32>* aNonVideoIds, TBool aUpdateCategories  )
+    {
+    MPX_FUNC("CVcxMyVideosVideoCache::AddVideosFromMdsL");
+
+    TVcxMyVideosSortingOrder sortingOrder = SortingOrderL();
+  
+    aListFetchingWasCanceled = EFalse;
+
+    MPX_DEBUG2("CVcxMyVideosVideoCache:: adding %d items", aMdsIds.Count());
+
+    for ( TInt j = aMdsIds.Count()-1; j >= 0 ; j-- )
+        {
+        CMPXMedia* videoToCache;
+        TInt pos;
+        if ( !FindVideoByMdsIdL( aMdsIds[j], pos ) )
+            {
+            MPX_DEBUG2("CVcxMyVideosVideoCache:: MDSID(%d) not found from cache, ok", aMdsIds[j]);
+            
+            //TODO: This doesnt work with new mds cmd queue. Cancel must be done if there is _any_ async req going on.
+            //      Maybe the fetching could be changed to asynchronous...
+            if ( iCollection.iMyVideosMdsDb->iVideoListFetchingIsOngoing )
+                {
+                // If list fetching is not canceled, CreateVideoObjectL will leave with KErrNotReady.
+                MPX_DEBUG1("CVcxMyVideosVideoCache:: video list fetching is ongoing, canceling it to be able to fetch single items!");
+                iCollection.iMyVideosMdsDb->Cancel();
+                aListFetchingWasCanceled = ETrue;
+                }
+
+            videoToCache = iCollection.iMyVideosMdsDb->CreateVideoL( 
+                    aMdsIds[j], EFalse /* brief details */);
+                                
+            if ( videoToCache )
+                {
+                CleanupStack::PushL( videoToCache ); // 1->
+
+                TInt err = AddL( videoToCache, sortingOrder, aUpdateCategories );
+                
+                if ( err == KErrNone )
+                    {
+                    CleanupStack::Pop( videoToCache ); // <-1
+                    }
+                else
+                    {
+                    CleanupStack::PopAndDestroy( videoToCache ); // <-1
+                    }
+                    
+                MPX_DEBUG3("CVcxMyVideosVideoCache:: %d (pointer = %x) added to cache", aMdsIds[j], videoToCache);
+                }
+            else
+                {
+                MPX_DEBUG2("CVcxMyVideosVideoCache:: video with %d ID not found from MDS -> prob non video object, skipping add to cache", aMdsIds[j] );
+                if ( aNonVideoIds )
+                    {
+                    aNonVideoIds->AppendL( aMdsIds[j] );
+                    }
+                aMdsIds.Remove( j );
+                }
+            }
+        else
+            {
+            MPX_DEBUG2("CVcxMyVideosVideoCache:: %d was already in cache -> skipping add", aMdsIds[j]);
+            aMdsIds.Remove( j );
+            }
+        }
+
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosVideoCache::AddL()
+// This is for single adds, video list fetching does not call this.
+// ----------------------------------------------------------------------------
+//
+TInt CVcxMyVideosVideoCache::AddL( CMPXMedia* aVideo, TVcxMyVideosSortingOrder aSortingOrder,
+        TBool aUpdateCategories )
+    {
+    MPX_FUNC("CVcxMyVideosVideoCache::AddL");
+    
+    if ( !IsComplete() )
+        {
+        MPX_DEBUG1("CVcxMyVideosVideoCache:: iVideoList is partial, adding to iPartialVideoList");
+        return AddToPartialListL( aVideo );
+        }
+    else
+        {
+        MPX_DEBUG1("CVcxMyVideosVideoCache:: iVideoList is complete, adding to iVideoList");
+        return AddToCorrectPlaceL( *aVideo, aSortingOrder, aUpdateCategories );
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosVideoCache::CheckForPartialVideoListItemsL()
+// This is called by iCollection during video list fetching.
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosVideoCache::CheckForPartialVideoListItemsL( TInt aNewItemsStartIndex )
+    {
+    // Replace items in iVideoList with iPartialVideoList items.
+    if ( !iVideoList || !iVideoList->IsSupported( KMPXMediaArrayContents ) )
+        {
+        return;
+        }
+        
+    CMPXMediaArray* videoArray = iVideoList->Value<CMPXMediaArray>(
+                                KMPXMediaArrayContents);
+    
+    TInt videoArrayCount = videoArray->Count();
+
+    MPX_DEBUG2("  videoArrayCount           = %d", videoArrayCount);
+    MPX_DEBUG2("  iPartialVideoList.Count() = %d", iPartialVideoList.Count());
+    
+    for ( TInt i = iPartialVideoList.Count()-1; i >= 0 ; i-- )
+        {
+        for ( TInt j = aNewItemsStartIndex; j < videoArrayCount; j++ )
+            {
+            if ( TVcxMyVideosCollectionUtil::IdL( *(iPartialVideoList[i]) )
+                    == TVcxMyVideosCollectionUtil::IdL( *(videoArray->AtL( j )) ) )
+                {
+                // Replace item in iVideoList with item from iPartialVideoList
+                MPX_DEBUG2( "CVcxMyVideosVideoCache:: replacing %d, in iVideoList with item from iPartialVideoList",
+                        TVcxMyVideosCollectionUtil::IdL( *(iPartialVideoList[i]) ).iId1 );
+
+                if ( j == videoArray->Count() -1 )
+                    {
+                    videoArray->Remove( j );
+                    videoArray->AppendL( iPartialVideoList[i] );
+                    }
+                else
+                    {
+                    videoArray->Remove( j );
+                    videoArray->Insert( iPartialVideoList[i], j );
+                    }
+                iPartialVideoList.Remove( i );
+                iPartialVideoList.Compress();                    
+                break; // found -> break from for loop
+                }
+            }
+        }    
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosVideoCache::PosOnPartialVideoListL()
+// ----------------------------------------------------------------------------
+//
+TInt CVcxMyVideosVideoCache::PosOnPartialVideoListL( CMPXMedia& aVideo )
+    {
+    TInt count    = iPartialVideoList.Count();
+    TUint32 mdsId = TVcxMyVideosCollectionUtil::IdL( aVideo );
+    
+    for ( TInt i = 0; i < count; i++ )
+        {
+        if ( TVcxMyVideosCollectionUtil::IdL( *(iPartialVideoList[i]) ).iId1 == mdsId )
+            {
+            return i;
+            }        
+        }
+    return KErrNotFound;
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosVideoCache::PosOnVideoListL()
+// ----------------------------------------------------------------------------
+//
+TInt CVcxMyVideosVideoCache::PosOnVideoListL( CMPXMedia& aVideo )
+    {
+    CMPXMediaArray* videoArray = iVideoList->Value<CMPXMediaArray>(
+            KMPXMediaArrayContents);
+
+    TInt count    = videoArray->Count();
+    TUint32 mdsId = TVcxMyVideosCollectionUtil::IdL( aVideo );
+    
+    for ( TInt i = 0; i < count; i++ )
+        {
+        if ( TVcxMyVideosCollectionUtil::IdL( *(videoArray->AtL( i )) ).iId1 == mdsId )
+            {
+            return i;
+            }        
+        }
+    return KErrNotFound;
+    }
+    
+// ----------------------------------------------------------------------------
+// CVcxMyVideosVideoCache::AddToPartialListL()
+// ----------------------------------------------------------------------------
+//
+TInt CVcxMyVideosVideoCache::AddToPartialListL( CMPXMedia* aVideo )
+    {
+    TInt pos = PosOnPartialVideoListL( *aVideo );
+     
+    TInt result;
+    if ( pos == KErrNotFound )
+        {
+        iPartialVideoList.Append( aVideo );
+        result = KErrNone;
+        }
+    else
+        {
+        result = KErrAlreadyExists;
+        }
+    return result;
+    }
+
+// ----------------------------------------------------------------------------
+// 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 )
+    {
+    MPX_FUNC("CVcxMyVideosVideoCache::CreateVideoListL");
+
+    MPX_DEBUG2("CVcxMyVideosVideoCache:: aForce = %d", aForce );
+    
+    TVcxMyVideosSortingOrder sortingOrder = SortingOrderL();
+        
+    if ( iIsFetchingVideoList
+            && sortingOrder == iLastSortingOrder && !aForce )
+        {
+        MPX_DEBUG1("CVcxMyVideosVideoCache:: iVideoList creation is already ongoing, skipping");
+        return;
+        }
+                   
+    if ( !IsComplete() || (sortingOrder != iLastSortingOrder) || aForce )
+        {
+        MPX_DEBUG1("CVcxMyVideosVideoCache:: iVideoList was partial or in wrong order or aForce was ETrue, recreating");
+
+        if ( iIsFetchingVideoList )
+            {
+            MPX_DEBUG1("CVcxMyVideosVideoCache:: video list fetching is ongoing, canceling it");
+            iCollection.iMyVideosMdsDb->Cancel( CVcxMyVideosMdsDb::EGetVideoList );
+            iIsFetchingVideoList = EFalse;
+            }
+        
+        ResetVideoListL();
+                        
+        TBool ascending = ETrue;
+        
+        switch ( sortingOrder )
+            {
+            case EVcxMyVideosSortingId:
+            case EVcxMyVideosSortingName:
+            case EVcxMyVideosSortingSize:
+                ascending = ETrue;
+                break;
+            case EVcxMyVideosSortingCreationDate:
+            case EVcxMyVideosSortingModified:
+                ascending = EFalse;
+                break;
+            }
+            
+        iCollection.iMyVideosMdsDb->CreateVideoListL( 
+                sortingOrder,
+                ascending,
+                EFalse /* brief list */,
+                iVideoList /* use existing */ );
+
+        iIsFetchingVideoList = ETrue;
+        iLastSortingOrder   = sortingOrder;
+        SetComplete( EFalse );
+        }
+    else
+        {
+        MPX_DEBUG1("CVcxMyVideosVideoCache:: iVideoList is complete and in right sorting order, doing nothing");
+        }              
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosVideoCache::UpdateVideoL
+// ----------------------------------------------------------------------------
+//
+TBool CVcxMyVideosVideoCache::UpdateVideoL( CMPXMedia& aVideo )
+    {
+    MPX_FUNC("CVcxMyVideosVideoCache::UpdateVideoL");
+    
+    TInt pos;
+    CMPXMedia* videoInCache = FindVideoByMdsIdL( aVideo.ValueTObjectL<TMPXItemId>(
+            KMPXMediaGeneralId ).iId1, pos );
+    if ( !videoInCache )
+        {
+        MPX_DEBUG2("CVcxMyVideosVideoCache:: MDS ID %d not found from cache, leaving",
+            aVideo.ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId ).iId1 );
+        User::Leave( KErrNotFound );
+        }
+
+    TBool changed = EFalse;
+        
+    // 1 MPX ID cant be changed
+    // 2
+    if ( aVideo.IsSupported( KMPXMediaGeneralTitle ) )
+        {
+        if ( videoInCache->ValueText( KMPXMediaGeneralTitle ) !=
+                aVideo.ValueText( KMPXMediaGeneralTitle ) )
+            {
+            videoInCache->SetTextValueL( KMPXMediaGeneralTitle,
+                    aVideo.ValueText( KMPXMediaGeneralTitle ) );
+
+            //updates sorting order and category attributes if necessarry
+            HandleVideoTitleModifiedL( videoInCache );
+
+            changed = ETrue;
+            }
+        }
+    // 3
+    if ( aVideo.IsSupported( KMPXMediaGeneralComment ) )
+        {
+        if ( videoInCache->ValueText( KMPXMediaGeneralComment ) != 
+                aVideo.ValueText( KMPXMediaGeneralComment ) )
+            {
+            videoInCache->SetTextValueL( KMPXMediaGeneralComment,
+                    aVideo.ValueText( KMPXMediaGeneralComment ) );
+            changed = ETrue;
+            }
+        }
+    // 4
+    if ( aVideo.IsSupported( KMPXMediaGeneralUri ) )
+        {
+        MPX_DEBUG2("CVcxMyVideosVideoCache:: old file path: %S", &videoInCache->ValueText( KMPXMediaGeneralUri ));
+        MPX_DEBUG2("CVcxMyVideosVideoCache:: new file path: %S", &aVideo.ValueText( KMPXMediaGeneralUri ));
+
+        if ( videoInCache->ValueText( KMPXMediaGeneralUri ) !=
+               aVideo.ValueText( KMPXMediaGeneralUri ) ) 
+            {            
+            videoInCache->SetTextValueL( KMPXMediaGeneralUri,
+                    aVideo.ValueText( KMPXMediaGeneralUri ) );
+    
+            changed = ETrue;
+            }
+        }
+    // 5
+	// With 64bit file support this is obsolete.
+	// Can be removed if this attribute is removed from MPX framework code
+    if ( aVideo.IsSupported( KMPXMediaGeneralSize ) )
+        {
+        if ( aVideo.ValueTObjectL<TInt>( KMPXMediaGeneralSize ) !=
+                videoInCache->ValueTObjectL<TInt>( KMPXMediaGeneralSize ) )
+            {
+            videoInCache->SetTObjectValueL<TInt>( KMPXMediaGeneralSize,
+                    aVideo.ValueTObjectL<TInt>( KMPXMediaGeneralSize ) );
+
+#ifndef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+            TVcxMyVideosSortingOrder sortingOrder = SortingOrderL();
+            if ( sortingOrder == EVcxMyVideosSortingSize )
+                {
+                MPX_DEBUG1("CVcxMyVideosVideoCache:: size updated && sorting order is by size, moving video to correct place on cache");
+                MoveToCorrectPlaceL( *videoInCache, sortingOrder );
+                videoInCache = FindVideoByMdsIdL( aVideo.ValueTObjectL<TMPXItemId>(
+                        KMPXMediaGeneralId ).iId1, pos );
+
+                iCollection.CategoriesL().GenerateCategoryModifiedEventL(
+                        *videoInCache, ETrue /* flush */, EVcxMyVideosVideoListOrderChanged );
+                }
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+            changed = ETrue;
+            }
+        }
+
+    // 6 Creation date changes values when item is moved from one memory to another.
+    //   The first the object is created to MDS with current date, and when file is added
+    //   to file system the value is changed to files creation date.
+    if ( aVideo.IsSupported( KMPXMediaGeneralDate ) )
+        {
+        TInt64 newCreationDate;
+        TInt64 oldCreationDate;
+        newCreationDate = aVideo.ValueTObjectL<TInt64>( KMPXMediaGeneralDate );
+        oldCreationDate = videoInCache->ValueTObjectL<TInt64>( KMPXMediaGeneralDate );
+        if ( newCreationDate != oldCreationDate )
+            {
+            videoInCache->SetTObjectValueL<TInt64>( KMPXMediaGeneralDate,
+                newCreationDate );
+
+            TVcxMyVideosSortingOrder sortingOrder = SortingOrderL();
+            if ( sortingOrder == EVcxMyVideosSortingCreationDate )
+                {
+                MPX_DEBUG1("CVcxMyVideosVideoCache:: creation date updated && sorting order is by creation date, moving video to correct place on cache");
+                MoveToCorrectPlaceL( *videoInCache, sortingOrder );
+                videoInCache = FindVideoByMdsIdL( aVideo.ValueTObjectL<TMPXItemId>(
+                        KMPXMediaGeneralId ).iId1, pos );
+
+                iCollection.CategoriesL().GenerateCategoryModifiedEventL(
+                        *videoInCache, EFalse /* dont flush */, EVcxMyVideosVideoListOrderChanged );
+                }
+
+            changed = ETrue;
+            }
+        }
+
+    // 7
+    if ( aVideo.IsSupported( KMPXMediaGeneralFlags ) )
+        {
+        TUint32 oldFlags = videoInCache->ValueTObjectL<TUint32>( KMPXMediaGeneralFlags );
+        TUint32 newFlags = aVideo.ValueTObjectL<TUint32>( KMPXMediaGeneralFlags );
+
+        MPX_DEBUG3("CVcxMyVideosVideoCache:: %x -> %x", oldFlags, newFlags);
+
+        // Play pos is written only after playback. Reset new video flag
+        // now, so there's no need for changing the flag explitically
+        if ( aVideo.IsSupported( KMPXMediaGeneralLastPlaybackPosition ) )
+            {
+            newFlags &= ~EVcxMyVideosVideoNew;
+            MPX_DEBUG3("CVcxMyVideosVideoCache:: flags: %x -> %x", oldFlags, newFlags);
+            }
+
+        if ( oldFlags != newFlags )
+            {        
+            videoInCache->SetTObjectValueL<TUint32>( KMPXMediaGeneralFlags, newFlags );
+
+            if ( (newFlags & EVcxMyVideosVideoNew) != (oldFlags & EVcxMyVideosVideoNew) )
+                {
+                MPX_DEBUG1("CVcxMyVideosVideoCache:: new video flag modified-> updating categories' new video names and counters");
+    
+                TBool modified = EFalse;
+                iCollection.CategoriesL().UpdateCategoryNewVideoNameAndDateL(
+                        *videoInCache, modified );
+
+                TUint8 origin = TVcxMyVideosCollectionUtil::OriginL( *videoInCache );
+                
+                iCollection.CategoriesL().NewVideoFlagChangedL(
+                        oldFlags, newFlags,
+                        origin,
+                        modified );
+
+#ifdef VCX_ALBUMS
+                iCollection.AlbumsL().NewVideoFlagChangedL(
+                        TVcxMyVideosCollectionUtil::IdL( *videoInCache ).iId1 );
+#endif
+                }
+            changed = ETrue;
+            }
+        }
+    // 8
+    if ( aVideo.IsSupported( KMPXMediaGeneralCopyright ) )
+        {
+        if ( videoInCache->ValueText( KMPXMediaGeneralCopyright ) !=
+                aVideo.ValueText( KMPXMediaGeneralCopyright ) )
+            {
+            videoInCache->SetTextValueL( KMPXMediaGeneralCopyright,
+                    aVideo.ValueText( KMPXMediaGeneralCopyright ) );
+            changed = ETrue;
+            }
+        }
+#if 0 // type cant be changed
+    // 9
+    if ( aVideo.IsSupported( KMPXMediaGeneralMimeType ) )
+        {
+        videoInCache->SetTextValueL( aVideo.ValueText( KMPXMediaGeneralMimeType ) );
+        changed = ETrue;
+        }
+#endif
+
+    // 11
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+    if ( aVideo.IsSupported( KMPXMediaGeneralExtSizeInt64 ) )
+        {
+        if ( aVideo.ValueTObjectL<TInt64>( KMPXMediaGeneralExtSizeInt64 ) !=
+                videoInCache->ValueTObjectL<TInt64>( KMPXMediaGeneralExtSizeInt64 ) )
+            {
+            videoInCache->SetTObjectValueL<TInt64>( KMPXMediaGeneralExtSizeInt64,
+                    aVideo.ValueTObjectL<TInt64>( KMPXMediaGeneralExtSizeInt64 ) );
+
+            TVcxMyVideosSortingOrder sortingOrder = SortingOrderL();
+            if ( sortingOrder == EVcxMyVideosSortingSize )
+                {
+                MPX_DEBUG1("CVcxMyVideosVideoCache:: size updated && sorting order is by size, moving video to correct place on cache");
+                MoveToCorrectPlaceL( *videoInCache, sortingOrder );
+                videoInCache = FindVideoByMdsIdL( aVideo.ValueTObjectL<TMPXItemId>(
+                        KMPXMediaGeneralId ).iId1, pos );
+
+                iCollection.CategoriesL().GenerateCategoryModifiedEventL(
+                        *videoInCache, ETrue /* flush */, EVcxMyVideosVideoListOrderChanged );
+                }
+            changed = ETrue;
+            }
+        }
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+    // 12
+    if ( aVideo.IsSupported( KVcxMediaMyVideosModifiedDate ) )
+        {
+        if ( videoInCache->ValueTObjectL<TInt64>( KVcxMediaMyVideosModifiedDate ) !=
+                aVideo.ValueTObjectL<TInt64>( KVcxMediaMyVideosModifiedDate ) )
+            {
+            videoInCache->SetTObjectValueL<TInt64>( KVcxMediaMyVideosModifiedDate,
+                    aVideo.ValueTObjectL<TInt64>( KVcxMediaMyVideosModifiedDate ) );
+            changed = ETrue;
+            }
+        }
+    // 13
+    if ( aVideo.IsSupported( KVcxMediaMyVideosAgeProfile ) )
+        {
+        if ( videoInCache->ValueTObjectL<TInt32>( KVcxMediaMyVideosAgeProfile ) != 
+                aVideo.ValueTObjectL<TInt32>( KVcxMediaMyVideosAgeProfile ) )
+            {
+            videoInCache->SetTObjectValueL<TInt32>( KVcxMediaMyVideosAgeProfile,
+                    aVideo.ValueTObjectL<TInt32>( KVcxMediaMyVideosAgeProfile ) );
+            changed = ETrue;
+            }
+        }
+    // 14
+    if ( aVideo.IsSupported( KVcxMediaMyVideosAudioLanguage ) )
+        {
+        if ( videoInCache->ValueText( KVcxMediaMyVideosAudioLanguage ) != 
+                aVideo.ValueText( KVcxMediaMyVideosAudioLanguage ) )
+            {
+            videoInCache->SetTextValueL( KVcxMediaMyVideosAudioLanguage,
+                    aVideo.ValueText( KVcxMediaMyVideosAudioLanguage ) );
+            changed = ETrue;
+            }
+        }
+    // 15
+    if ( aVideo.IsSupported( KVcxMediaMyVideosAuthor ) )
+        {
+        if ( videoInCache->ValueText( KVcxMediaMyVideosAuthor ) !=
+                aVideo.ValueText( KVcxMediaMyVideosAuthor ))
+            {
+            videoInCache->SetTextValueL( KVcxMediaMyVideosAuthor,
+                    aVideo.ValueText( KVcxMediaMyVideosAuthor ) );
+            changed = ETrue;
+            }
+        }
+
+    // 16
+    if ( aVideo.IsSupported( KVcxMediaMyVideosOrigin ) )
+        {
+        TUint8 prevOrigin( TVcxMyVideosCollectionUtil::OriginL( *videoInCache ) );
+        TUint8 newOrigin( TVcxMyVideosCollectionUtil::OriginL( aVideo ) );
+                    
+        if ( newOrigin != prevOrigin )
+            {
+            videoInCache->SetTObjectValueL<TUint8>( KVcxMediaMyVideosOrigin, newOrigin );
+            iCollection.CategoriesL().OriginChangedL( *videoInCache, prevOrigin, newOrigin );            
+            changed = ETrue;
+            }
+        }
+
+    // 17
+    if ( aVideo.IsSupported( KVcxMediaMyVideosDuration ) )
+        {
+        TReal32 durationInCache = TVcxMyVideosCollectionUtil::DurationL( *videoInCache );
+        TReal32 newDuration     = TVcxMyVideosCollectionUtil::DurationL( aVideo );
+        
+        MPX_DEBUG2("SETTING DURATION TO: %f", newDuration );
+        
+        if ( durationInCache != newDuration )
+            {
+            videoInCache->SetTObjectValueL<TReal32>( KVcxMediaMyVideosDuration, newDuration );
+            changed = ETrue;
+            }
+        }
+    // 10
+    if ( aVideo.IsSupported( KMPXMediaGeneralLastPlaybackPosition ) )
+        {
+        MPX_DEBUG1("CVcxMyVideosVideoCache::UpdateVideo Last play pos is supported");
+        
+        if ( videoInCache->ValueTObjectL<TInt>( KMPXMediaGeneralLastPlaybackPosition ) !=
+                aVideo.ValueTObjectL<TInt>( KMPXMediaGeneralLastPlaybackPosition ))
+            {
+            videoInCache->SetTObjectValueL<TInt>( KMPXMediaGeneralLastPlaybackPosition,
+                    aVideo.ValueTObjectL<TInt>( KMPXMediaGeneralLastPlaybackPosition ) );
+            changed = ETrue;
+            }
+        }
+
+    // 19
+    if ( aVideo.IsSupported( KVcxMediaMyVideosRating ) )
+        {
+        TUint8 ratingInCache( TVcxMyVideosCollectionUtil::RatingL( *videoInCache ) );
+        TUint8 ratingInNew( TVcxMyVideosCollectionUtil::RatingL( aVideo ) );
+        if (  ratingInNew != ratingInCache )
+            {
+            videoInCache->SetTObjectValueL<TUint32>( KVcxMediaMyVideosRating,
+                    ratingInNew );
+
+            changed = ETrue;
+            }
+        }
+
+    // 20
+    if ( aVideo.IsSupported( KMPXMediaVideoBitRate ) )
+        {
+        TUint16 bitRate = aVideo.ValueTObjectL<TUint16>( KMPXMediaVideoBitRate ); 
+        if ( bitRate != videoInCache->ValueTObjectL<TUint16>( KMPXMediaVideoBitRate ) )
+            {
+            videoInCache->SetTObjectValueL<TUint16>( KMPXMediaVideoBitRate,
+                                                     bitRate );
+            
+            changed = ETrue;
+            }
+        }
+
+    // 21
+    if ( aVideo.IsSupported( KVcxMediaMyVideosAudioFourCc ) )
+        {
+        TUint32 AudioFourCcInCache( TVcxMyVideosCollectionUtil::DownloadIdL( *videoInCache ) );
+        TUint32 AudioFourCcInNew( TVcxMyVideosCollectionUtil::AudioFourCcL( aVideo ) );
+        if (  AudioFourCcInNew != AudioFourCcInCache )
+            {
+            videoInCache->SetTObjectValueL<TUint32>( KVcxMediaMyVideosAudioFourCc,
+                    AudioFourCcInNew );
+
+            changed = ETrue;
+            }
+        }
+
+    // 22
+    if ( aVideo.IsSupported( KMPXMediaVideoWidth ) )
+        {
+        TUint16 width = aVideo.ValueTObjectL<TUint16>( KMPXMediaVideoWidth ); 
+        if ( width != videoInCache->ValueTObjectL<TUint16>( KMPXMediaVideoWidth ) )
+            {
+            videoInCache->SetTObjectValueL<TUint16>( KMPXMediaVideoWidth,
+                    width );
+            
+            changed = ETrue;
+            }
+        }
+    
+    // 23
+    if ( aVideo.IsSupported( KMPXMediaVideoHeight ) )
+        {
+        TUint16 height = aVideo.ValueTObjectL<TUint16>( KMPXMediaVideoHeight ); 
+        if ( height != videoInCache->ValueTObjectL<TUint16>( KMPXMediaVideoHeight ) )
+            {
+            videoInCache->SetTObjectValueL<TUint16>( KMPXMediaVideoHeight,
+                    height );
+            
+            changed = ETrue;
+            }
+        }
+                
+    // 24 
+    if ( aVideo.IsSupported( KMPXMediaVideoArtist ) )
+        {
+        if ( videoInCache->ValueText( KMPXMediaVideoArtist ) !=
+                aVideo.ValueText( KMPXMediaVideoArtist ) )
+            {
+            videoInCache->SetTextValueL( KMPXMediaVideoArtist,
+                    aVideo.ValueText( KMPXMediaVideoArtist ) );
+
+            changed = ETrue;
+            }
+        }
+    
+    if ( changed )
+        {
+        iCollection.iMessageList->SendL();
+        }
+    
+    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 )
+    {
+    MPX_DEBUG1("CVcxMyVideosVideoCache:: video title in cache modified");
+    MPX_DEBUG1("                         -> updating categories new video names");
+
+    TBool modified = EFalse;
+    iCollection.CategoriesL().UpdateCategoryNewVideoNameAndDateL(
+            *aVideoInCache, modified );
+
+#ifdef VCX_ALBUMS 
+    iCollection.AlbumsL().VideoTitleChangedL(
+            TVcxMyVideosCollectionUtil::IdL( *aVideoInCache ).iId1 );
+#endif
+    
+    TVcxMyVideosSortingOrder sortingOrder = SortingOrderL();
+    if ( sortingOrder == EVcxMyVideosSortingName )
+        {
+        MPX_DEBUG1(" Title modified and sorting by Name -> moving item to correct place");
+        
+        TMPXItemId mpxId( aVideoInCache->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId ) );
+        
+        // Deletes the old media object and creates a new one to a new position
+        MoveToCorrectPlaceL( *aVideoInCache, SortingOrderL() );
+        // Find the new object
+        TInt pos;
+        aVideoInCache = FindVideoByMdsIdL( mpxId.iId1, pos );
+        
+        iCollection.CategoriesL().GenerateCategoryModifiedEventL(
+                *aVideoInCache, ETrue /* flush */, EVcxMyVideosVideoListOrderChanged );
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosVideoCache::FindCorrectPositionL
+// Finds the correct position using bisection method.
+// ----------------------------------------------------------------------------
+//
+TInt CVcxMyVideosVideoCache::FindCorrectPositionL( CMPXMedia& aMedia,
+        TVcxMyVideosSortingOrder aSortingOrder )
+    {
+    MPX_FUNC("CVcxMyVideosVideoCache::FindCorrectPositionL()");
+            
+    CMPXMediaArray* cachedVideoArray = iVideoList->Value<CMPXMediaArray>(
+                                KMPXMediaArrayContents);
+
+    TInt videoCount = cachedVideoArray->Count();
+
+    MPX_DEBUG2("CVcxMyVideosVideoCache:: video count = %d", videoCount);
+
+    if ( videoCount == 0 )
+        {
+        MPX_DEBUG1("CVcxMyVideosVideoCache:: video count was 0, returning pos 0");
+        return 0;
+        }
+        
+    TInt stepSize     = 0;
+    TInt upLimit      = videoCount - 1; //highest possible place
+    TInt downLimit    = 0;              //lowest possible place
+    TInt pos          = videoCount / 2; // start from the middle
+    
+    if ( videoCount > 5 )
+        {
+        stepSize = videoCount / 4; // we start at middle, the first step size is half of the middle = 1/4
+        MPX_DEBUG2("CVcxMyVideosVideoCache:: stepsize: %d", stepSize);
+        }
+    else
+        {
+        stepSize = 1;
+        MPX_DEBUG1("CVcxMyVideosVideoCache:: Moving with single steps.");
+        MPX_DEBUG2("CVcxMyVideosVideoCache:: stepsize: %d", stepSize);
+
+        if ( videoCount == 1 )
+            {
+            MPX_DEBUG1("CVcxMyVideosVideoCache:: only one video -> stepSize = 0");
+            pos      = 0;
+            stepSize = 0;
+            }
+        }
+    
+    MPX_DEBUG2("CVcxMyVideosVideoCache:: start pos = %d", pos);
+
+    TBool found = EFalse;
+    TInt compare;
+    while ( !found )
+        {
+        compare = CompareL( aMedia, *cachedVideoArray->AtL( pos ), aSortingOrder ); 
+        if ( compare == 0 )
+            {
+            MPX_DEBUG1("CVcxMyVideosVideoCache:: equal item found");
+            found = ETrue;
+            break;
+            }            
+        else if ( compare == 1 )
+            {
+            MPX_DEBUG1("CVcxMyVideosVideoCache:: greater item found");
+            upLimit = pos - 1;
+            if ( upLimit < 0 )
+                {
+                upLimit = 0;
+                }
+            if ( upLimit < downLimit )
+                {
+                upLimit = downLimit;
+                }
+            pos -= stepSize;
+            if ( pos < downLimit )
+                {
+                pos += stepSize;
+                MPX_DEBUG1("CVcxMyVideosVideoCache:: hit the limiter");
+                }
+            }
+        else if ( compare == -1 )
+            {
+            MPX_DEBUG1("CVcxMyVideosVideoCache:: smaller item found");
+            downLimit = pos + 1;
+            if ( downLimit > videoCount - 1 )
+                {
+                downLimit = videoCount - 1;
+                }
+            if ( downLimit > upLimit )
+                {
+                downLimit = upLimit;
+                }
+            pos += stepSize;
+            if ( pos > upLimit )
+                {
+                pos -= stepSize;
+                MPX_DEBUG1("CVcxMyVideosVideoCache:: hit the limiter");
+                }
+            }
+        MPX_DEBUG3("CVcxMyVideosVideoCache:: item is between: %d - %d", downLimit, upLimit );            
+        MPX_DEBUG2("CVcxMyVideosVideoCache:: new pos = %d", pos);
+        
+        if ( downLimit == upLimit )
+            {
+            MPX_DEBUG1("CVcxMyVideosVideoCache:: downLimit and upLimit are the same, this is last item to check");
+            compare = CompareL( aMedia, *cachedVideoArray->AtL( pos ), aSortingOrder ); 
+
+            if ( compare == 1 )
+                {
+                MPX_DEBUG1("CVcxMyVideosVideoCache:: the last possible item had greater value -> this is the correct place");
+                }
+            else
+                {
+                MPX_DEBUG1("CVcxMyVideosVideoCache:: last possible item had smaller value (or equal) -> adding one to pos");
+                pos++;
+                }
+            found = ETrue;
+            break;
+            }
+
+        stepSize = (upLimit - downLimit) / 4;
+        MPX_DEBUG2("CVcxMyVideosVideoCache:: stepsize: %d", stepSize);
+            
+        if ( stepSize < 1 )
+            {
+            MPX_DEBUG1("CVcxMyVideosVideoCache:: Moving with single steps.");
+            stepSize = 1;
+            MPX_DEBUG2("CVcxMyVideosVideoCache:: stepsize: %d", stepSize);
+            }
+
+        MPX_DEBUG1("CVcxMyVideosVideoCache:: ---- new round ----");
+        }        
+    MPX_DEBUG2("CVcxMyVideosVideoCache:: returning pos %d", pos);
+    return pos;
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosVideoCache::CompareL
+// ----------------------------------------------------------------------------
+//
+TInt CVcxMyVideosVideoCache::CompareL( CMPXMedia& aNewVideo, CMPXMedia& aVideoInList,
+        TVcxMyVideosSortingOrder aSortingOrder )
+    {
+    TInt result = 0;
+    
+    switch ( aSortingOrder )
+        {
+        case EVcxMyVideosSortingCreationDate:
+            {
+            TInt64 newItemsDate  = aNewVideo.ValueTObjectL<TInt64>( KMPXMediaGeneralDate );
+            TInt64 listItemsDate = aVideoInList.ValueTObjectL<TInt64>( KMPXMediaGeneralDate );
+            MPX_DEBUG3("CVcxMyVideosVideoCache:: new date = %d, list item date = %d", newItemsDate, listItemsDate);
+            if ( listItemsDate > newItemsDate /*static_cast<TInt64>(listItemsDate) > static_cast<TInt64>(newItemsDate)*/ )
+                {
+                result = -1;
+                }
+            else
+                {
+                if ( listItemsDate == newItemsDate/*static_cast<TInt64>(listItemsDate) == static_cast<TInt64>(newItemsDate)*/ )
+                    {
+                    result = 0;
+                    }
+                else
+                    {
+                    result = 1;
+                    }
+                }
+            }              
+            break;
+            
+        case EVcxMyVideosSortingName:
+            {
+            TPtrC newVideoName( aNewVideo.ValueText( KMPXMediaGeneralTitle ) );
+            TPtrC videoInListName( aVideoInList.ValueText( KMPXMediaGeneralTitle ));
+            MPX_DEBUG3("CVcxMyVideosVideoCache:: newVideoName = %S, videoInListName = %S", &newVideoName, &videoInListName);
+            TCollationMethod collationMethod = *Mem::CollationMethodByIndex(0); // get the standard method
+            collationMethod.iFlags |= TCollationMethod::EFoldCase;
+            result = newVideoName.CompareC( videoInListName, 3, &collationMethod) * -1;
+            if ( result < 0 )
+                {
+                result = -1;
+                }
+            if ( result > 0 )
+                {
+                result = 1;
+                }
+            }
+            break;
+            
+        case EVcxMyVideosSortingSize:
+            {
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+            TInt64 newItemsSize  = aNewVideo.ValueTObjectL<TInt64>( KMPXMediaGeneralExtSizeInt64 );
+            TInt64 listItemsSize = aVideoInList.ValueTObjectL<TInt64>( KMPXMediaGeneralExtSizeInt64 );
+#else
+            TInt newItemsSize  = aNewVideo.ValueTObjectL<TInt>( KMPXMediaGeneralSize );
+            TInt listItemsSize = aVideoInList.ValueTObjectL<TInt>( KMPXMediaGeneralSize );
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+            MPX_DEBUG3("CVcxMyVideosVideoCache:: newItemsSize = %ld, listItemsSize = %ld", newItemsSize, listItemsSize);
+            if ( listItemsSize > newItemsSize )
+                {
+                result = 1;
+                }
+            else
+                {
+                if ( listItemsSize == newItemsSize )
+                    {
+                    result = 0;
+                    }
+                else
+                    {
+                    result = -1;
+                    }
+                }
+            }              
+            break;
+        }
+        
+    return result;
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosVideoCache::SortingOrderL
+// ----------------------------------------------------------------------------
+//    
+TVcxMyVideosSortingOrder CVcxMyVideosVideoCache::SortingOrderL()
+    {
+
+    if( !iCenRep ) 
+        {
+        TUid uid;
+        uid.iUid = KVcxMyVideosCollectionCenrepUid;
+		iCenRep = CRepository::NewL( uid );
+        }
+    
+    TInt sortingOrderInCenrep;
+
+    TInt cenRepError = iCenRep->Get( KVcxMyVideosCollectionCenrepKeySortingOrder,
+            sortingOrderInCenrep );
+    
+    TVcxMyVideosSortingOrder sortingOrder;
+    
+    if ( cenRepError != KErrNone )
+        {
+        MPX_DEBUG2("CVcxMyVideosVideoCache:: error %d while reading sorting order from Cenrep", cenRepError );
+        sortingOrder = EVcxMyVideosSortingCreationDate;
+        }
+    else
+        {
+        sortingOrder = static_cast<TVcxMyVideosSortingOrder>( sortingOrderInCenrep );
+        }
+    return sortingOrder;
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosVideoCache::AddToCorrectPlaceL
+// ----------------------------------------------------------------------------
+//
+TInt CVcxMyVideosVideoCache::AddToCorrectPlaceL( CMPXMedia& aVideo,
+        TVcxMyVideosSortingOrder aSortingOrder, TBool aUpdateCategories )
+    {    
+    if ( PosOnVideoListL( aVideo ) != KErrNotFound )
+        {
+        MPX_DEBUG2( "CVcxMyVideosVideoCache::AddToCorrectPlaceL() %d is already on iVideoList, skipping add",
+                TVcxMyVideosCollectionUtil::IdL( aVideo ).iId1 );
+        return KErrAlreadyExists;
+        }
+        
+    TInt pos = FindCorrectPositionL( aVideo, aSortingOrder );
+
+    CMPXMediaArray* cachedVideoArray = iVideoList->Value<CMPXMediaArray>(
+            KMPXMediaArrayContents );
+
+    if ( pos > (cachedVideoArray->Count() -1) )
+        {
+        cachedVideoArray->AppendL( aVideo );
+        }
+    else
+        {
+        cachedVideoArray->InsertL( aVideo, pos );
+        }
+    iVideoListIndex->AddL( cachedVideoArray->AtL( pos ), pos );
+#ifdef _DEBUG
+    CheckVideoListIndexL();
+#endif
+    
+    if ( aUpdateCategories )
+        {
+        iCollection.CategoriesL().VideoAddedL( aVideo );
+#ifdef VCX_ALBUMS
+        iCollection.AlbumsL().VideoAddedOrRemovedFromCacheL( aVideo );
+#endif
+        }
+
+    return KErrNone;
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosVideoCache::MoveToCorrectPlaceL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosVideoCache::MoveToCorrectPlaceL( CMPXMedia& aVideo,
+        TVcxMyVideosSortingOrder aSortingOrder )
+    {
+    if ( PosOnPartialVideoListL( aVideo ) != KErrNotFound )
+        {
+        MPX_DEBUG2("CVcxMyVideosVideoCache::MoveToCorrectPlaceL() item %d was on iPartialVideoList, not moving ",
+                TVcxMyVideosCollectionUtil::IdL( aVideo ).iId1);
+        return;
+        }
+        
+    CMPXMedia* video = CMPXMedia::NewL( aVideo );
+    CleanupStack::PushL( video ); // 1->
+    RemoveL( *video, EFalse /* dont update categories */ );
+    AddToCorrectPlaceL( *video, aSortingOrder, EFalse /* dont update categories */ );
+    CleanupStack::PopAndDestroy( video ); // <-1
+    }
+
+// ----------------------------------------------------------------------------
+// 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 )
+    {
+    MPX_FUNC("CVcxMyVideosVideoCache::RemoveL");
+    
+    TInt pos;
+    CMPXMedia* video = FindVideoByMdsIdL( aMdsId, pos );
+
+    if ( !video )
+        {
+        MPX_DEBUG1("CVcxMyVideosVideoCache:: RemoveL failed since the item wasn't on cache");
+        return KErrNotFound;
+        }
+    
+    if ( aUpdateCategories &&
+            pos != KErrNotFound /* no need to update if item is on iPartialVideoList*/ )
+        {
+        iCollection.CategoriesL().VideoRemovedL( *video );
+#ifdef VCX_ALBUMS
+        iCollection.AlbumsL().VideoAddedOrRemovedFromCacheL( *video );
+#endif
+        }
+        
+    if ( pos != KErrNotFound )
+        {
+        CMPXMediaArray* cachedVideoArray = iVideoList->Value<CMPXMediaArray>(
+                KMPXMediaArrayContents );
+        
+        MPX_DEBUG2("CVcxMyVideosVideoCache:: %d removed from iVideoList", aMdsId);
+        cachedVideoArray->Remove( pos );
+        iVideoListIndex->Remove( aMdsId, ETrue /* compress */);
+#ifdef _DEBUG
+        CheckVideoListIndexL();
+#endif
+        }
+    else
+        {
+        MPX_DEBUG2("CVcxMyVideosVideoCache:: %d removed from iPartialVideoList", aMdsId);
+        iPartialVideoList.Remove( PosOnPartialVideoListL( *video ) );
+        iPartialVideoList.Compress();        
+        }
+        
+    return KErrNone;
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosVideoCache::RemoveL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosVideoCache::RemoveL( RArray<TUint32>& aMdsIds, TBool aUpdateCategories )
+    {        
+    for ( TInt i = 0; i < aMdsIds.Count(); i++ )
+        {
+        RemoveL( aMdsIds[i], aUpdateCategories );
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosVideoCache::ResetVideoListL
+// iVideoList stays the same, media array is deleted and recreated to 0 length,
+// media items are deleted.
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosVideoCache::ResetVideoListL()
+    {
+    MPX_FUNC("CVcxMyVideosVideoCache::ResetVideoListL");
+
+    iCollection.iMyVideosMdsDb->Cancel( CVcxMyVideosMdsDb::EGetVideoList );
+
+    CMPXMediaArray* mediaArray =
+            iVideoList->ValueCObjectL<CMPXMediaArray>( KMPXMediaArrayContents );
+    CleanupStack::PushL( mediaArray ); // 1->
+    
+    for ( TInt i = mediaArray->Count() - 1; i >= 0; i-- )
+        {
+        mediaArray->Remove( i );
+        }        
+
+    iVideoList->Delete( KMPXMediaArrayContents );
+    iVideoList->SetCObjectValueL<CMPXMediaArray>( KMPXMediaArrayContents, mediaArray );
+
+    CleanupStack::PopAndDestroy( mediaArray ); // <-1
+    
+    TInt count = iCollection.iOpenHandler->iVideoListsBeingOpened.Count();
+    
+    for ( TInt i = 0; i < count; i++ )
+        {
+        CMPXMedia* videoList = iCollection.iOpenHandler->iVideoListsBeingOpened[i];
+        if ( videoList )
+            {
+            MPX_DEBUG3("CVcxMyVideosVideoCache:: reset iVideoListsBeingOpened[%d] category: %d",
+                    i, iCollection.iOpenHandler->iCategoryIdsBeingOpened[i] );
+            mediaArray = videoList->ValueCObjectL<CMPXMediaArray>( KMPXMediaArrayContents );
+            CleanupStack::PushL( mediaArray ); // 1->
+            for ( TInt i = mediaArray->Count() - 1; i >= 0; i-- )
+                {
+                mediaArray->Remove( i );
+                }
+            videoList->Delete( KMPXMediaArrayContents );
+            videoList->SetCObjectValueL<CMPXMediaArray>( KMPXMediaArrayContents,
+                    mediaArray );
+            CleanupStack::PopAndDestroy( mediaArray ); // <-1
+            }
+        }
+        
+    SetComplete( EFalse );
+                
+    iCollection.CategoriesL().ResetVideoCountersL(); //this does not send events
+    }
+
+// ----------------------------------------------------------------------------
+// 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()
+    {
+    MPX_FUNC("CVcxMyVideosVideoCache::ReCreateVideoListL");
+    
+    CMPXMedia* newList = TVcxMyVideosCollectionUtil::CreateEmptyMediaListL();
+    CleanupStack::PushL( newList ); // 1->
+
+    CMPXMediaArray* oldArray = iVideoList->Value<CMPXMediaArray>(
+            KMPXMediaArrayContents );
+    TInt count = oldArray->Count();
+
+    CMPXMediaArray* newArray = newList->Value<CMPXMediaArray>(
+            KMPXMediaArrayContents );
+    
+    CMPXMedia* video;
+    for ( TInt i = 0; i < count; i++ )
+        {
+        video = CMPXMedia::NewL( *oldArray->AtL( i ) ); // points to same heap object
+        CleanupStack::PushL( video ); // 2->
+        newArray->AppendL( video ); // ownership moves
+        CleanupStack::Pop( video ); // <-2
+        }
+    
+    delete iVideoList;
+    iVideoList = NULL;
+    iVideoList = newList;
+    
+    iVideoListIndex->SetL( *iVideoList );
+#ifdef _DEBUG
+    CheckVideoListIndexL();
+#endif
+    
+    CleanupStack::Pop( newList ); // <-1
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosVideoCache::IsComplete
+// ----------------------------------------------------------------------------
+//
+TBool CVcxMyVideosVideoCache::IsComplete()
+    {
+    return iVideoListIsComplete;
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosVideoCache::SetComplete
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosVideoCache::SetComplete( TBool aComplete )
+    {
+    if ( !iVideoListIsComplete && aComplete )
+        {
+        MPX_DEBUG1("CVcxMyVideosVideoCache:: iVideoList turned to complete, setting up iVideoListIndex");
+        iVideoListIndex->SetL( *iVideoList );
+#ifdef _DEBUG
+        CheckVideoListIndexL();
+#endif
+        }
+    iVideoListIsComplete = aComplete;
+    }
+
+#ifdef _DEBUG
+// ----------------------------------------------------------------------------
+// CVcxMyVideosVideoCache::SetComplete
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosVideoCache::CheckVideoListIndexL()
+    {
+    if ( !IsComplete() )
+        {
+        return;
+        }
+    
+    TInt pos;
+    TInt mdsId;
+    CMPXMedia* video;
+    CMPXMediaArray* mediaArray = TVcxMyVideosCollectionUtil::MediaArrayL( *iVideoList );
+    TInt count = iVideoListIndex->VideoArray().Count();
+    for ( TInt i = 0; i < count; i++ )
+        {
+        pos   = iVideoListIndex->VideoArray()[i].iPos;
+        mdsId = iVideoListIndex->VideoArray()[i].iMdsId;
+        video = iVideoListIndex->VideoArray()[i].iVideo;
+        
+        if ( pos < 0 || pos > mediaArray->Count() -1 )
+            {
+            MPX_DEBUG3( "CVcxMyVideosVideoCache:: iVideoListIndex->iVideoArray[%d].iPos out of range -> Panic",
+                    i, pos );
+            _LIT( KVideoListIndexPosCorrupted, "iVideoListIndex pos");
+            User::Panic( KVideoListIndexPosCorrupted, KErrCorrupt ); 
+            }
+        
+        if ( mediaArray->AtL( pos ) != video )
+            {
+            MPX_DEBUG3( "CVcxMyVideosVideoCache:: iVideoListIndex->iVideoArray[%d].iVideo != mediaArray->AtL( %d ) -> Panic",
+                    i, pos );
+            _LIT( KVideoListIndexVideoCorrupted, "iVideoListIndex video pointer");
+            User::Panic( KVideoListIndexVideoCorrupted, KErrCorrupt );
+            }
+        
+        if ( TVcxMyVideosCollectionUtil::IdL( *mediaArray->AtL( pos ) ).iId1 != 
+                mdsId )
+            {
+            MPX_DEBUG3( "CVcxMyVideosVideoCache:: iVideoListIndex->iVideoArray[%d].iMdsId != MDSID in mediaArray->AtL( %d ) -> Panic",
+                    i, pos );
+            _LIT( KVideoListIndexMdsIdCorrupted, "iVideoListIndex MDS ID");
+            User::Panic( KVideoListIndexMdsIdCorrupted, KErrCorrupt );        
+            }
+        }
+    MPX_DEBUG1("CVcxMyVideosVideoCache:: iVideoListIndex check OK");
+    }
+#endif
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/Bwins/VCXMyVideosCollectionPluginTestu.def	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * LibEntryL(class CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/EABI/VCXMyVideosCollectionPluginTestu.def	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,15 @@
+EXPORTS
+	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
+	_ZTI23CVCXMyVideosTestContent @ 2 NONAME ; #<TI>#
+	_ZTI24CVCXMyVideosTestDownload @ 3 NONAME ; #<TI>#
+	_ZTI25CVCXMyVideosTestDlWatcher @ 4 NONAME ; #<TI>#
+	_ZTI26CVCXMyVideosTestServiceEmu @ 5 NONAME ; #<TI>#
+	_ZTI34CVCXMyVideosCollectionPluginTester @ 6 NONAME ; #<TI>#
+	_ZTV23CVCXMyVideosTestContent @ 7 NONAME ; #<VT>#
+	_ZTV24CVCXMyVideosTestDownload @ 8 NONAME ; #<VT>#
+	_ZTV25CVCXMyVideosTestDlWatcher @ 9 NONAME ; #<VT>#
+	_ZTV26CVCXMyVideosTestServiceEmu @ 10 NONAME ; #<VT>#
+	_ZTV34CVCXMyVideosCollectionPluginTester @ 11 NONAME ; #<VT>#
+	_ZTI28CVCXMyVideosTestTransactions @ 12 NONAME ; #<TI>#
+	_ZTV28CVCXMyVideosTestTransactions @ 13 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXConsts.inc	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,16 @@
+TRUE               1
+FALSE              0
+SYNC               0
+ASYNC              1
+FAKE               13579
+
+DEFAULT_DEST      "Internet"
+
+3G_AP             "Internet"
+3G_AP2            "Internet2"
+WLAN_AP           "Wlan"
+WLAN_AP2          "Wlan2"
+EMULATOR_AP       "Ethernet with Daemon Dynamic IP"
+BAD_AP            "BadIap" // CIptvTestUtilities::GetIapIdL returns AP that does not work
+INVALID_AP        "invalidiap" // CIptvTestUtilities::GetIapIdL returns invalid AP ID
+DEFAULT_AP        "default" // used via CIptvTestUtilALR::GetDefaultIap
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXDrives.inc	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,24 @@
+//
+// C is not used by Video Center when phone has F drive, change these accordingly.
+//
+// If phone has only C and E drives:
+//   C_DRIVE  e
+//   E_DRIVE  f
+//
+// If phone has F drive:
+//   C_DRIVE  e
+//   E_DRIVE  f
+//
+
+A_DRIVE  a
+C_DRIVE  e
+E_DRIVE  f
+O_DRIVE  o
+Z_DRIVE  z
+
+ANY_DRIVE "anydrive"
+
+// Don't change these drives
+C_DRIVE_FORCED  c
+E_DRIVE_FORCED  e
+F_DRIVE_FORCED  f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXErrors.inc	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,103 @@
+KIptvTestErrNotFound                -1111
+KIptvTestErrVerifyFailed            -1112
+
+KERRNONE                                        0         
+KERRNOTFOUND                                    -1        
+KERRGENERAL                                     -2        
+KERRCANCEL                                      -3
+KERRNOMEMORY                                    -4        
+KERRNOTSUPPORTED                                -5        
+KERRARGUMENT                                    -6        
+KERRBADHANDLE                                   -8
+KERROVERFLOW                                    -9        
+KERRUNDERFLOW                                   -10        
+KERRALREADYEXISTS                               -11
+KERRINUSE                                       -14
+KERRSERVERBUSY                                  -16
+KERRNOTREADY                                    -18
+KERRUNKNOWN                                     -19
+KERRCORRUPT                                     -20
+KERRLOCKED                                      -22
+KERRDISKFULL                                    -26
+KERRBADNAME                                     -28
+KERRTIMEDOUT                                    -33
+KERRABORT                                       -39
+KERRTOOBIG                                      -40
+KErrCouldNotConnect                             -34
+
+
+// EPG manager server side error codes
+KIptvErrorGetUpdateInformationLNotFound           123
+KIptvErrorEpgUpdateFailed                         133
+KIptvErrorEpgUpdateSuccessed                      134
+KIptvVodUpdateNotStarted                          137
+KIptvVodUpdateStarted                             136
+KIptvErrorVodNoIap                                139
+KIptvErrorNoService                               140
+KIptvThumbnailCount                               141
+KIptvContentUpdateCompleted                       146
+KIptvServiceThumbnailDownloaded                   143
+KIptvContentThumbnailDownloaded                   144
+KIptvRssParserError                               145
+
+KIptvErrorRssSearchStarted                        170
+KIptvErrorRssSearchFailed                         171
+KIptvErrorRssSearchSucceed                        172
+KIptvErrorRssSearchNoIap                          173
+
+EIptvDlNoError                           0
+EIptvDlOutOfMemory                       1
+EIptvDlOutOfMemoryInVodDlPluginCreate    2
+EIptvDlVodDlPluginNotFound               3
+EIptvDlGeneralErrorInVodDlPluginCreate   4
+EIptvDlMessageAlreadyPending             5
+EIptvDlTypeNotSupported                  6
+EIptvDlMaxDownloadsExceeded              7
+EIptvDlAlreadyExists                     8
+KIptvDlCouldNotGetServiceData            9
+EIptvDlEpgManagerNotReady                10
+EIptvDlCouldNotGetContentFullDetails     11
+EIptvDlFailedToAddNewVideoToMyVideos     12
+EIptvDlCouldNotConnectToS60DlMgr         13
+EIptvDlCouldNotSetIapAttrToS60DlMgr      14
+EIptvDlCouldNotCreateS60Download         15
+EIptvDlCouldNotStartS60Download          16
+EIptvDlConnectionFailed                  17
+EIptvDlAuthFailed                        18
+EIptvDlProxyAuthFailed                   19
+EIptvDlContentNotFound                   20
+EIptvDlDiskFull                          21
+EIptvDlDestFileInUse                     22
+EIptvDlBadUrl                            23
+EIptvDlMmcRemoved                        24
+EIptvDlGeneral                           25
+EIptvDlDisconnected                      26
+EIptvDlContentUnchanged                  27
+
+KIptvSchemaMismatch                      301
+KIptvInvalidServiceType                  302
+EXmlNoElements                           -997
+KErrNotFound                             -1
+
+KErrGsmMMServiceOptionTemporaryOutOfOrder 	 -4162
+
+// From HttpDownloadMgrCommon.h
+EGeneral -30421
+EInternal -30422
+EContentFileIntegrity -30423
+EDiskFull -30424
+EConnectionFailed -30425
+ETransactionFailed -30426
+EMoveFailed -30427
+EDestFileWriteFailed -30428
+EMMCRemoved -30429
+EBadUrl -30430
+EWrongDestFilename -30431
+EDestFileInUse -30432
+EHttpUnhandled -30433
+EHttpAuthenticationFailed -30434
+EProxyAuthenticationFailed -30435
+EObjectNotFound -30436
+EPartialContentModified -30437
+EContentExpired -30438
+EHttpRestartFailed  -30450
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXMyVideosCollectionPluginTestAttributes.cfg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,2777 @@
+#-----------------------------------------------------------------------------------
+#
+# STIF test script file for testing VCXMyVideosCollectionPluginTest.dll
+#
+# Tests functionality for attributes of videos.
+#
+#-----------------------------------------------------------------------------------
+
+[StifSettings]
+CapsModifier= IptvTestClientApiCapsMod.exe
+[EndStifSettings]
+
+[Define]
+INCLUDE c:\TestFramework\VCXMVCollectionPluginTest.inc
+INCLUDE c:\TestFramework\VCXDrives.inc
+INCLUDE c:\TestFramework\VCXConsts.inc
+INCLUDE c:\TestFramework\VCXErrors.inc
+[Enddefine]
+
+#************************************************************************************
+# Sub Cleanup
+# Removes all videos from the phone. Collection is opened.
+#************************************************************************************
+[Sub Cleanup]
+print cleanup start
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV RemoveAllMedia
+
+VCXMV CheckMediaCount ANY_DRIVE 0
+
+print wait 3min
+pause 180000
+print cleanup end
+[EndSub]
+
+#------------------------------------------------------------------------------------
+#
+#  Does configuration for cases in this script.
+#  Creates 'Internet' IAP into 'Internet' destination and sets connection as authorized.
+#  Sets preferred memory to first used drive and sorting order to none.
+#  Removes all video files from the device.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30400 <not a test> Setup
+var CASE ET30400
+
+create VCXTestUtilModule Util
+
+// Copies some known 3G AP to "Internet" destination with "Internet" name for the AP.
+Util CopyMethod "Internet" "Internet" "Internet"
+// Disable connection dialog for "Internet" destination.
+Util SetConnectionMethodIntAttribute "Internet" "Internet" 507 2 // 507 is ECmSeamlessnessLevel
+delete Util
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetPreferredMemory E_DRIVE
+VCXMV SetSortingOrder EVcxMyVideosSortingNone
+
+callsub Cleanup
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that collection plugin updates video attribute when it's changed by
+#  3rd party application.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30401 KMPXMediaGeneralTitle modified by 3rd party
+var CASE ET30401
+
+// Test case
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+callsub Cleanup
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "TESTING"
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "TESTING"
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests updating attribute for a video. Update is done by passing a full media object
+#  to collection.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30402 Update - attribute KMPXMediaGeneralTitle
+var CASE ET30402
+
+// Setup case
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+callsub Cleanup
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+delete VCXMV
+
+pause 2000
+
+// Test case
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "TESTING"
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "TESTING"
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests updating attribute for a video. Update is done by passing a full media object
+#  to collection.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30403 Update - attribute KMPXMediaGeneralUri
+var CASE ET30403
+
+// Setup case
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+callsub Cleanup
+delete VCXMV
+
+pause 2000
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralUri "c:\video1.mp4"
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralUri "c:\video1.mp4"
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+callsub Cleanup
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests updating attribute for a video. Update is done by passing a full media object
+#  to collection.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30404 Update - attribute KMPXMediaGeneralSize
+var CASE ET30404
+
+// Setup case
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+callsub Cleanup
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+delete VCXMV
+
+pause 2000
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 100000
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 100000
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests updating read-only attribute for a video, attribute should not change.
+#  Update is done by passing a full media object to collection.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30405 Update - attribute KMPXMediaGeneralDate
+var CASE ET30405
+
+// Setup case
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+callsub Cleanup
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+delete VCXMV
+
+pause 2000
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralDate 50009
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Read only attribute and it's not saved to MDS
+allownextresult KERRCORRUPT
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralDate 50009
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests updating attribute for a video. Update is done by passing a full media object
+#  to collection.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30406 Update - attribute KMPXMediaGeneralFlags
+var CASE ET30406
+
+// Setup case
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+callsub Cleanup
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+delete VCXMV
+
+pause 2000
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 775
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralFlags 775
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests updating attribute for a video. Update is done by passing a full media object
+#  to collection.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30407 Update - attribute KMPXMediaGeneralCopyright
+var CASE ET30407
+
+// Setup case
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+callsub Cleanup
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+delete VCXMV
+
+pause 2000
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralCopyright "joonas"
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralCopyright "joonas"
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests updating read-only attribute for a video, attribute should not change.
+#  Update is done by passing a full media object to collection.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30408 Update - attribute KMPXMediaGeneralMimeType
+var CASE ET30408
+
+// Setup case
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+callsub Cleanup
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+delete VCXMV
+
+pause 2000
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralMimeType "mimeko"
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Read only attribute and it's not saved to MDS
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralMimeType "video/mp4"
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests updating attribute for a video. Update is done by passing a full media object
+#  to collection.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30409 Update - attribute KVcxMediaMyVideosModifiedDate
+var CASE ET30409
+
+// Setup case
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+callsub Cleanup
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+delete VCXMV
+
+pause 2000
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDate 44000
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosModifiedDate 44000
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests updating attribute for a video. Update is done by passing a full media object
+#  to collection.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30410 Update - attribute KVcxMediaMyVideosAgeProfile
+var CASE ET30410
+
+// Setup case
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+callsub Cleanup
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+delete VCXMV
+
+pause 2000
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAgeProfile 15
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAgeProfile 15
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests updating attribute for a video. Update is done by passing a full media object
+#  to collection.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30411 Update - attribute KVcxMediaMyVideosAudioLanguage
+var CASE ET30411
+
+// Setup case
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+callsub Cleanup
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+delete VCXMV
+
+pause 2000
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "hello"
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "hello"
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests updating attribute for a video. Update is done by passing a full media object
+#  to collection.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30412 Update - attribute KVcxMediaMyVideosAuthor
+var CASE ET30412
+
+// Setup case
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+callsub Cleanup
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+delete VCXMV
+
+pause 2000
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAuthor "Matti"
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAuthor "Matti"
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests updating attribute for a video. Update is done by passing a full media object
+#  to collection.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30413 Update - attribute KVcxMediaMyVideosOrigin
+var CASE ET30413
+
+// Setup case
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+callsub Cleanup
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+delete VCXMV
+
+pause 2000
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginOther
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+delete VCXMV
+
+pause 2000
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests updating attribute for a video. Update is done by passing a full media object
+#  to collection.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30414 Update - attribute KVcxMediaMyVideosDuration
+var CASE ET30414
+
+// Setup case
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+callsub Cleanup
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+delete VCXMV
+
+pause 2000
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDuration 55 66
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosDuration 55 66
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests updating attribute for a video. Update is done by passing a full media object
+#  to collection.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30415 Update - attribute KMPXMediaGeneralLastPlaybackPosition
+var CASE ET30415
+
+// Setup case
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+callsub Cleanup
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+delete VCXMV
+
+pause 2000
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 22 23
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 22 23
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests updating read-only attribute for a video, attribute should not change.
+#  Update is done by passing a full media object to collection.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30416 Update - attribute KVcxMediaMyVideosDownloadId
+var CASE ET30416
+
+// Setup case
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+callsub Cleanup
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+delete VCXMV
+
+pause 2000
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDownloadId 999
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// DL ID is not saved to MDS DB.
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosDownloadId 0
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests updating read-only attribute for a video, attribute should not change.
+#  Update is done by passing a full media object to collection.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30434 Update - attribute KVcxMediaMyVideosAudioFourCc
+var CASE ET30434
+
+// Setup case
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+callsub Cleanup
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+delete VCXMV
+
+pause 2000
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAudioFourCc 666
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAudioFourCc 666
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+
+#------------------------------------------------------------------------------------
+#
+#  Tests updating all attributes of a video. Close collection and check the attributes.
+#  Update is done by passing a full media object to collection.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30417 Update - All attributes, client closed between
+var CASE ET30417
+
+// Setup case
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+callsub Cleanup
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+delete VCXMV
+
+pause 2000
+
+// TEST CASE:
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Sets all possible attributes of video.
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "a"
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 3
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralDate 50009
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralMimeType "mimeko"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDownloadId 999
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralFlags 3
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+allownextresult KERRCORRUPT
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralDate 50009
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralMimeType "video/mp4"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosDownloadId 0
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+
+//
+// Restart client here and check again
+//
+delete VCXMV
+
+pause 2000
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralFlags 3
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+allownextresult KERRCORRUPT
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralDate 50009
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralMimeType "video/mp4"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosDownloadId 0
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+
+delete VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests updating attribute by partial update, meaning the media object has only
+#  the updated attribute.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30419 Update - partial update KMPXMediaGeneralTitle
+var CASE ET30419
+
+// Setup case
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+callsub Cleanup
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+delete VCXMV
+
+pause 2000
+
+// TEST CASE:
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Setup media attributes, create full copy
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "a"
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 3
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDownloadId 11
+
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+// Make empty media item, only one attribute is updated.
+VCXMV CreateCopyOfMedia ANY_DRIVE 0 0
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "TESTING"
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "TESTING"
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralFlags 3
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosDownloadId 0
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests updating attribute by partial update, meaning the media object has only
+#  the updated attribute.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30420 Update - partial update KMPXMediaGeneralUri
+var CASE ET30420
+
+// Setup case
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+callsub Cleanup
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+delete VCXMV
+
+pause 2000
+
+// TEST CASE:
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Setup media attributes, create full copy
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "a"
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 3
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+// Make empty media item, only one attribute is updated.
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 0 0
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralUri "c:\video1.mp4"
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralUri "c:\video1.mp4"
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralFlags 3
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests updating attribute by partial update, meaning the media object has only
+#  the updated attribute.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30421 Update - partial update KMPXMediaGeneralSize
+var CASE ET30421
+
+// Setup case
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+callsub Cleanup
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+delete VCXMV
+
+pause 2000
+
+// TEST CASE:
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Setup media attributes, create full copy
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "a"
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 3
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+// Make empty media item, only one attribute is updated.
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 0 0
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 100000
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 100000
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralFlags 3
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests updating attribute by partial update, meaning the media object has only
+#  the updated attribute. Attribute is read-only and should not change.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30422 Update - partial update KMPXMediaGeneralDate
+var CASE ET30422
+
+// Setup case
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+callsub Cleanup
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+delete VCXMV
+
+pause 2000
+
+// TEST CASE:
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Setup media attributes, create full copy
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "a"
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 3
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+// Make empty media item, only one attribute is updated.
+VCXMV CreateCopyOfMedia ANY_DRIVE 0 0
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralDate 50009
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Read only attribute and it's not saved to MDS. This check must fail.
+allownextresult KERRCORRUPT
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralDate 50009
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralFlags 3
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests updating attribute by partial update, meaning the media object has only
+#  the updated attribute.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30423 Update - partial update KMPXMediaGeneralFlags
+var CASE ET30423
+
+// Setup case
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+callsub Cleanup
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+delete VCXMV
+
+pause 2000
+
+// TEST CASE:
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Setup media attributes, create full copy
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "a"
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 3
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+// Make empty media item, only one attribute is updated.
+VCXMV CreateCopyOfMedia ANY_DRIVE 0 0
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 775
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralFlags 775
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests updating attribute by partial update, meaning the media object has only
+#  the updated attribute.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30424 Update - partial update KMPXMediaGeneralCopyright
+var CASE ET30424
+
+// Setup case
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+callsub Cleanup
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+delete VCXMV
+
+pause 2000
+
+// TEST CASE:
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Setup media attributes, create full copy
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "a"
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 3
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+// Make empty media item, only one attribute is updated.
+VCXMV CreateCopyOfMedia ANY_DRIVE 0 0
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralCopyright "joonas"
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralCopyright "joonas"
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralFlags 3
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests updating attribute by partial update, meaning the media object has only
+#  the updated attribute. Attribute is read-only and should not change.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30425 Update - partial update KMPXMediaGeneralMimeType
+var CASE ET30425
+
+// Setup case
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+callsub Cleanup
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+delete VCXMV
+
+pause 2000
+
+pause 2000
+
+// TEST CASE:
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Setup media attributes, create full copy
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "a"
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 3
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+// Make empty media item, only one attribute is updated.
+VCXMV CreateCopyOfMedia ANY_DRIVE 0 0
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralMimeType "mimeko"
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Read only attribute and it's not saved to MDS
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralMimeType "video/mp4"
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralFlags 3
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests updating attribute by partial update, meaning the media object has only
+#  the updated attribute.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30426 Update - partial update KVcxMediaMyVideosModifiedDate
+var CASE ET30426
+
+// Setup case
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+callsub Cleanup
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+delete VCXMV
+
+pause 2000
+
+// TEST CASE:
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Setup media attributes, create full copy
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "a"
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 3
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDownloadId 11
+
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+// Make empty media item, only one attribute is updated.
+VCXMV CreateCopyOfMedia ANY_DRIVE 0 0
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDate 44000
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosModifiedDate 44000
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralFlags 3
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosDownloadId 0
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests updating attribute by partial update, meaning the media object has only
+#  the updated attribute.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30427 Update - partial update KVcxMediaMyVideosAgeProfile
+var CASE ET30427
+
+// Setup case
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+callsub Cleanup
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+delete VCXMV
+
+pause 2000
+
+// TEST CASE:
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Setup media attributes, create full copy
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "a"
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 3
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDownloadId 11
+
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+// Make empty media item, only one attribute is updated.
+VCXMV CreateCopyOfMedia ANY_DRIVE 0 0
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAgeProfile 15
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAgeProfile 15
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralFlags 3
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosDownloadId 0
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests updating attribute by partial update, meaning the media object has only
+#  the updated attribute.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30428 Update - partial update KVcxMediaMyVideosAudioLanguage
+var CASE ET30428
+
+// Setup case
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+callsub Cleanup
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+delete VCXMV
+
+pause 2000
+
+// TEST CASE:
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Setup media attributes, create full copy
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "a"
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 3
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDownloadId 11
+
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+// Make empty media item, only one attribute is updated.
+VCXMV CreateCopyOfMedia ANY_DRIVE 0 0
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "hello"
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "hello"
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralFlags 3
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosDownloadId 0
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests updating attribute by partial update, meaning the media object has only
+#  the updated attribute.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30429 Update - partial update KVcxMediaMyVideosAuthor
+var CASE ET30429
+
+// Setup case
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+callsub Cleanup
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+delete VCXMV
+
+pause 2000
+
+// TEST CASE:
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Setup media attributes, create full copy
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "a"
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 3
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDownloadId 11
+
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+// Make empty media item, only one attribute is updated.
+VCXMV CreateCopyOfMedia ANY_DRIVE 0 0
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAuthor "Matti"
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAuthor "Matti"
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralFlags 3
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosDownloadId 0
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests updating attribute by partial update, meaning the media object has only
+#  the updated attribute.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30430 Update - partial update KVcxMediaMyVideosOrigin
+var CASE ET30430
+
+// Setup case
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+callsub Cleanup
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+delete VCXMV
+
+pause 2000
+
+// TEST CASE:
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Setup media attributes, create full copy
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "a"
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 3
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDownloadId 11
+
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+// Make empty media item, only one attribute is updated.
+VCXMV CreateCopyOfMedia ANY_DRIVE 0 0
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralFlags 3
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosDownloadId 0
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests updating attribute by partial update, meaning the media object has only
+#  the updated attribute.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30431 Update - partial update KVcxMediaMyVideosDuration
+var CASE ET30431
+
+// Setup case
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+callsub Cleanup
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+delete VCXMV
+
+pause 2000
+
+// TEST CASE:
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Setup media attributes, create full copy
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "a"
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 3
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDownloadId 11
+
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+// Make empty media item, only one attribute is updated.
+VCXMV CreateCopyOfMedia ANY_DRIVE 0 0
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDuration 55 66
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosDuration 55 66
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralFlags 3
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosDownloadId 0
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests updating attribute by partial update, meaning the media object has only
+#  the updated attribute.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30432 Update - partial update KMPXMediaGeneralLastPlaybackPosition
+var CASE ET30432
+
+// Setup case
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+callsub Cleanup
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+delete VCXMV
+
+pause 2000
+
+// TEST CASE:
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Setup media attributes, create full copy
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "a"
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 3
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDownloadId 11
+
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+// Make empty media item, only one attribute is updated.
+VCXMV CreateCopyOfMedia ANY_DRIVE 0 0
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 22 23
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 22 23
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralFlags 3
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosDownloadId 0
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests updating attribute by partial update, meaning the media object has only
+#  the updated attribute. Attribute is read-only and should not change.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30433 Update - partial update KVcxMediaMyVideosDownloadId
+var CASE ET30433
+
+// Setup case
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+callsub Cleanup
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+delete VCXMV
+
+pause 2000
+
+// TEST CASE:
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Setup media attributes, create full copy
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "a"
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 3
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDownloadId 11
+
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+// Make empty media item, only one attribute is updated.
+VCXMV CreateCopyOfMedia ANY_DRIVE 0 0
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDownloadId 999
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosDownloadId 0
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralFlags 3
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests updating attribute by partial update, meaning the media object has only
+#  the updated attribute. Attribute is read-only and should not change.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30435 Update - partial update KVcxMediaMyVideosAudioFourCc
+var CASE ET30435
+
+// Setup case
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+callsub Cleanup
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+delete VCXMV
+
+pause 2000
+
+// TEST CASE:
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Setup media attributes, create full copy
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "a"
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 3
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDownloadId 11
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAudioFourCc 12
+
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+// Make empty media item, only one attribute is updated.
+VCXMV CreateCopyOfMedia ANY_DRIVE 0 0
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAudioFourCc 999
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAudioFourCc 999
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralFlags 3
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests updating attribute by partial update, meaning the media object has only
+#  the updated attribute. Attribute is read-only and should not change.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30436 Create AC3 video, check audio attribute
+var CASE ET30436
+
+// Setup case
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+callsub Cleanup
+
+VCXMV CreateVideoFile IptvTestVideoAviAC3 C_DRIVE "ac3.avi"
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+delete VCXMV
+
+pause 2000
+
+// TEST CASE:
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAudioFourCc 999
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+
+#------------------------------------------------------------------------------------
+#
+# Note: DISABLED, NOT SUPPORTED IN DEBUG BUILDS!
+#
+#------------------------------------------------------------------------------------
+#[Test]
+#title ET30434 Add - Add empty media item
+
+#create VCXTestUtilModule Util
+#Util CreateMobilecrashWatcher
+
+#create VCXMyVideosCollectionPluginTest VCXMV
+#VCXMV Create
+#VCXMV SetFileCheck 0
+
+#callsub Cleanup
+
+#VCXMV AddMedia 1
+#VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMpxItemInserted
+#waittestclass VCXMV
+
+#VCXMV CheckMediaCount ANY_DRIVE 1
+#delete VCXMV
+
+#Util CheckMobilecrashes
+#pause 1000
+#delete Util
+#[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#[Endtest]
+#************************************************************************************
+# Testname:ET30435 Add - Add with existing MPX ID
+# Note: DISABLED, NOT SUPPORTED IN DEBUG BUILDS!
+#
+#------------------------------------------------------------------------------------
+#[Test]
+#title ET30435 Add - Add with existing MPX ID
+
+#create VCXTestUtilModule Util
+#Util CreateMobilecrashWatcher
+
+#create VCXMyVideosCollectionPluginTest VCXMV
+#VCXMV Create
+
+#callsub Cleanup
+
+#VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+#VCXMV CreateCopyOfMedia ANY_DRIVE 0
+#VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "ExistingId"
+#allownextresult KERRGENERAL
+#VCXMV AddMedia 1
+
+#VCXMV RefreshContents
+#VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+#waittestclass VCXMV
+
+#VCXMV CheckMediaCount ANY_DRIVE 1
+
+#delete VCXMV
+
+#Util CheckMobilecrashes
+#pause 1000
+#delete Util
+#[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#[Endtest]
+#************************************************************************************
+# Testname:ET30436 Add - add with existing file name
+# Note: DISABLED, NOT SUPPORTED IN DEBUG BUILDS!
+#
+#------------------------------------------------------------------------------------
+#[Test]
+#title ET30436 Add - add with existing file name
+
+#create VCXTestUtilModule Util
+#Util CreateMobilecrashWatcher
+
+#create VCXMyVideosCollectionPluginTest VCXMV
+#VCXMV Create
+
+#callsub Cleanup
+
+#VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+#VCXMV CreateCopyOfMedia ANY_DRIVE 0
+#VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "ExistingFile"
+#VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralId 0 0
+#allownextresult KERRGENERAL
+#VCXMV AddMedia 1
+
+#VCXMV RefreshContents
+#VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+#waittestclass VCXMV
+
+#VCXMV CheckMediaCount ANY_DRIVE 1
+#VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "video0"
+
+#delete VCXMV
+
+#Util CheckMobilecrashes
+#pause 1000
+#delete Util
+#[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#[Endtest]
+#************************************************************************************
+# Testname:ET30460 Sideload, open collection, add video and get full details
+# Note: DISABLED, NOT SUPPORTED IN DEBUG BUILDS!
+#
+#------------------------------------------------------------------------------------
+#[Test]
+#title ET30460 Sideload, open collection, add video and get full details
+
+#create VCXTestUtilModule Util
+#Util CreateMobilecrashWatcher
+
+#create VCXMyVideosCollectionPluginTest VCXMV
+#VCXMV Create
+
+#VCXMV SetFileCheck 0
+
+#callsub Cleanup
+
+#VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+#VCXMV CreateEmptyMedia
+#VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "5"
+#VCXMV AddMedia 1
+#VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMpxItemInserted
+#waittestclass VCXMV
+#VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+#waittestclass VCXMV
+
+#VCXMV CheckMediaCount ANY_DRIVE 2
+
+#VCXMV GetMediaFullDetails ANY_DRIVE 0
+
+#VCXMV GetMediaFullDetails ANY_DRIVE 1
+
+#delete VCXMV
+
+#Util CheckMobilecrashes
+#pause 1000
+#delete Util
+#[Endtest]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXMyVideosCollectionPluginTestBigFiles.cfg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,589 @@
+#-----------------------------------------------------------------------------------
+#
+# STIF test script file for testing VCXMyVideosCollectionPluginTest.dll
+#
+# Tests functionality for move and copy of video files.
+#
+#-----------------------------------------------------------------------------------
+
+[StifSettings]
+CapsModifier= IptvTestClientApiCapsMod.exe
+[EndStifSettings]
+
+[Define]
+INCLUDE c:\TestFramework\VCXDrives.inc
+INCLUDE c:\TestFramework\VCXConsts.inc
+INCLUDE c:\TestFramework\VCXErrors.inc
+INCLUDE c:\TestFramework\VCXMVCollectionPluginTest.inc
+[Enddefine]
+
+#-----------------------------------------------------------------------------------
+# Sub SetupVideos
+# Creates 3 videos to drive defined by constant C_DRIVE. Creation and modified
+# dates are set at file creation. Videos listed in creation order:
+#   3.mp4, attributes: title: c, size 51000 bytes
+#   1.mp4, attributes: title: a, size 49000 bytes
+#   2.mp4, attributes: title: b, size 50000 bytes
+# Parameters:
+#  OPTION_ORIGIN origin attribute for videos
+#-----------------------------------------------------------------------------------
+[Sub SetupVideos]
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetSortingOrder EVcxMyVideosSortingName
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create some video objects.
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "1.mp4" 
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "2.mp4"
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "3.mp4"
+pause 1000
+
+VCXMV SetAutomaticRefresh 0
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "c"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDateCurrent
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 100000
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginDownloaded
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDateCurrent
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 500000
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginDownloaded
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 2
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "b"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDateCurrent
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 50000
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginDownloaded
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+pause 10000
+
+VCXMV SetAutomaticRefresh 1
+
+pause 10000
+
+delete VCXMV
+[EndSub]
+
+#************************************************************************************
+# Sub SetupLargeVideo
+#	Creates a 3GB file to USED_DRIVE
+#************************************************************************************
+[Sub SetupLargeVideo]
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create sideloaded video
+VCXMV CreateVideoFile IptvTestVideoMpeg4 USED_DRIVE "verybig.mp4" -999
+
+pause 10000
+
+delete VCXMV
+[EndSub]
+
+#************************************************************************************
+# Sub Cleanup
+# Removes all videos from the phone. Collection is opened.
+#************************************************************************************
+[Sub Cleanup]
+print cleanup start
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV RemoveAllMedia
+delete VCXMV
+print wait 30sec
+pause 30000
+print cleanup end
+[EndSub]
+#************************************************************************************
+
+
+#------------------------------------------------------------------------------------
+#
+#  Does configuration for cases in this script.
+#  Creates 'Internet' IAP into 'Internet' destination and sets connection as authorized.
+#  Sets preferred memory to first used drive and sorting order to none.
+#  Removes all video files from the device.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title 001 <not a test> Setup
+var CASE 001
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetPreferredMemory E_DRIVE
+VCXMV SetSortingOrder EVcxMyVideosSortingNone
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV RemoveAllMedia
+
+VCXMV CheckMediaCount ANY_DRIVE 0
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Create video for testing.
+#
+# CaseClass: bigfiles
+#------------------------------------------------------------------------------------
+[Test]
+title 002 Setup create video
+var CASE 002
+
+callsub Cleanup
+
+var USED_DRIVE E_DRIVE
+callsub SetupLargeVideo
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetPreferredMemory E_DRIVE
+VCXMV SetSortingOrder EVcxMyVideosSortingNone
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 0
+VCXMV CheckMediaCount E_DRIVE 1
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests moving a video from second to first drive.
+#
+# CaseClass: bigfiles
+#------------------------------------------------------------------------------------
+[Test]
+title 003 Move from 2nd to 1st drive
+var CASE 003
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 0
+VCXMV CheckMediaCount E_DRIVE 1
+
+VCXMV MoveMedia E_DRIVE 0 C_DRIVE 0
+VCXMV WaitForMessages 15MINUTES KVCXMYVideosTestMessageMoveResp KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCopyOrMoveStarted
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 1
+VCXMV CheckMediaCount E_DRIVE 0
+
+print OK!
+delete VCXMV
+[Endtest]
+
+
+#------------------------------------------------------------------------------------
+#
+#  Tests copying a video from first to second drive.
+#
+# CaseClass: bigfiles
+#------------------------------------------------------------------------------------
+[Test]
+title 005 Copy from 2nd to 1st drive
+var CASE 005
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 1
+VCXMV CheckMediaCount E_DRIVE 0
+
+VCXMV CopyMedia C_DRIVE 0 E_DRIVE 0
+VCXMV WaitForMessages 15MINUTES KVCXMYVideosTestMessageCopyResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCollectionItemChanged KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCollectionItemChanged KVCXMYVideosTestMessageCollectionCategoryChanged
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 1
+VCXMV CheckMediaCount E_DRIVE 1
+
+print OK!
+delete VCXMV
+[Endtest]
+
+
+#------------------------------------------------------------------------------------
+#
+#  Tests deleting media.
+#
+# CaseClass: bigfiles
+#------------------------------------------------------------------------------------
+[Test]
+title 006 Delete video from 1st drive
+var CASE 006
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTES KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 1
+VCXMV CheckMediaCount E_DRIVE 1
+
+VCXMV DeleteMedia C_DRIVE 0 0
+VCXMV WaitForMessages 15MINUTES KVCXMYVideosTestMessageDeleteResp KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDeleteStarted KVCXMYVideosTestMessageMpxItemDeleted KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 0
+VCXMV CheckMediaCount E_DRIVE 1
+
+print OK!
+delete VCXMV
+[Endtest]
+
+
+#------------------------------------------------------------------------------------
+#
+#  Tests copying 
+#
+# CaseClass: bigfiles
+#------------------------------------------------------------------------------------
+[Test]
+title 007 Copy from 2nd to 1st drive
+var CASE 007
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 0
+VCXMV CheckMediaCount E_DRIVE 1
+
+VCXMV CopyMedia E_DRIVE 0 C_DRIVE 0
+VCXMV WaitForMessages 15MINUTES KVCXMYVideosTestMessageCopyResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCollectionItemChanged KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCollectionItemChanged KVCXMYVideosTestMessageCollectionCategoryChanged
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 1
+VCXMV CheckMediaCount E_DRIVE 1
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests deleting media.
+#
+# CaseClass: bigfiles
+#------------------------------------------------------------------------------------
+[Test]
+title 008 Delete video from 2nd drive
+var CASE 008
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTES KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 1
+VCXMV CheckMediaCount E_DRIVE 1
+
+VCXMV DeleteMedia E_DRIVE 0 0
+VCXMV WaitForMessages 15MINUTES KVCXMYVideosTestMessageDeleteResp KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDeleteStarted KVCXMYVideosTestMessageMpxItemDeleted KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 1
+VCXMV CheckMediaCount E_DRIVE 0
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests opening 'Other videos' category with one big file
+#
+#------------------------------------------------------------------------------------
+[Test]
+title 009 Setup create videos
+var CASE 009
+
+callsub Cleanup
+
+callsub SetupVideos
+
+var USED_DRIVE E_DRIVE
+callsub SetupLargeVideo
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 4
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests opening 'Other videos' category with one big file
+#
+#------------------------------------------------------------------------------------
+[Test]
+title 010 Open Other videos - one big file
+var CASE 010
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosOther
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests opening 'All videos' category with one big file and 3 small
+#
+#------------------------------------------------------------------------------------
+[Test]
+title 011 Open All videos - one big file, 3 small
+var CASE 011
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 4
+
+print OK!
+delete VCXMV
+[Endtest]
+
+
+#------------------------------------------------------------------------------------
+#
+#  Tests sorting 
+#
+# CaseClass: bigfiles
+#------------------------------------------------------------------------------------
+[Test]
+title 012 All videos, Sorting by size
+var CASE 012
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetSortingOrder EVcxMyVideosSortingModified
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 4
+
+VCXMV GetAllMediaFullDetails
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+VCXMV CheckMediaDetail ANY_DRIVE 3 EVcxTestMapping_KMPXMediaGeneralTitle "verybig"
+
+// Get videos sorted
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV SetSortingOrder EVcxMyVideosSortingSize
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV GetAllMediaFullDetails
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 3 EVcxTestMapping_KMPXMediaGeneralTitle "verybig"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+
+#------------------------------------------------------------------------------------
+#
+#  Cleans up videos
+#
+#------------------------------------------------------------------------------------
+[Test]
+title 013 <not a test> Cleanup
+var CASE 013
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV RemoveAllMedia
+
+VCXMV CheckMediaCount ANY_DRIVE 0
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXMyVideosCollectionPluginTestDelete.cfg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,520 @@
+#-----------------------------------------------------------------------------------
+#
+# STIF test script file for testing VCXMyVideosCollectionPluginTest.dll
+#
+# Tests functionality for deleting video files.
+#
+#-----------------------------------------------------------------------------------
+
+[StifSettings]
+CapsModifier= IptvTestClientApiCapsMod.exe
+[EndStifSettings]
+
+[Define]
+INCLUDE c:\TestFramework\VCXMVCollectionPluginTest.inc
+INCLUDE c:\TestFramework\VCXDrives.inc
+INCLUDE c:\TestFramework\VCXConsts.inc
+INCLUDE c:\TestFramework\VCXErrors.inc
+[Enddefine]
+
+#************************************************************************************
+# Sub Cleanup
+# Removes all videos from the phone. Collection is opened.
+#************************************************************************************
+[Sub Cleanup]
+print cleanup start
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV RemoveAllMedia
+
+delete VCXMV
+
+print wait 30sec
+pause 30000
+print cleanup end
+[EndSub]
+#************************************************************************************
+
+#------------------------------------------------------------------------------------
+#
+#  Does configuration for cases in this script.
+#  Creates 'Internet' IAP into 'Internet' destination and sets connection as authorized.
+#  Sets preferred memory to first used drive and sorting order to none.
+#  Removes all video files from the device.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30900 <not a test> Setup
+var CASE ET30900
+
+create VCXTestUtilModule Util
+
+// Copies some known 3G AP to "Internet" destination with "Internet" name for the AP.
+Util CopyMethod "Internet" "Internet" "Internet"
+Util SetUsedDestination "Internet"
+// Disable connection dialog for "Internet" destination.
+Util SetConnectionMethodIntAttribute "Internet" "Internet" 507 2 // 507 is ECmSeamlessnessLevel
+delete Util
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetPreferredMemory E_DRIVE
+VCXMV SetSortingOrder EVcxMyVideosSortingNone
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV RemoveAllMedia
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 0
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests deleting media from first used drive.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30909 Delete a media from 1st drive
+var CASE ET30909
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create sideloaded video
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "video0 CASE .mp4"
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 1
+VCXMV CheckMediaCount E_DRIVE 0
+
+VCXMV DeleteMedia C_DRIVE 0 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDeleteResp KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDeleteStarted KVCXMYVideosTestMessageMpxItemDeleted KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 0
+VCXMV CheckMediaCount E_DRIVE 0
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests deleting media from second used drive.
+# 
+#------------------------------------------------------------------------------------
+[Test]
+title ET30902 Delete a media from 2nd drive
+var CASE ET30902
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create sideloaded video
+VCXMV CreateVideoFile IptvTestVideo3Gp E_DRIVE "video0 CASE .mp4"
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 0
+VCXMV CheckMediaCount E_DRIVE 1
+
+VCXMV DeleteMedia E_DRIVE 0 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDeleteResp KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDeleteStarted KVCXMYVideosTestMessageMpxItemDeleted KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 0
+VCXMV CheckMediaCount E_DRIVE 0
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests deleting multiple videos.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30903 Delete multiple medias
+var CASE ET30903
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create sideloaded video
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "video CASE .mp4" 50000 5
+
+// Create sideloaded video
+VCXMV CreateVideoFile IptvTestVideo3Gp E_DRIVE "video CASE .mp4" 50000 5
+
+VCXMV CheckMediaCount C_DRIVE 5
+VCXMV CheckMediaCount E_DRIVE 5
+
+VCXMV DeleteMedias ANY_DRIVE 0 10 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDeleteResp KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDeleteStarted KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CoolDown
+
+VCXMV CheckMediaCount C_DRIVE 0
+VCXMV CheckMediaCount E_DRIVE 0
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests deleting a downloaded video.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30904 Delete downloaded video
+var CASE ET30904
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Start download
+VCXMV Download 3G_AP SERVICE_2 5 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+VCXMV CheckMediaCount C_DRIVE 0
+VCXMV CheckMediaCount E_DRIVE 1
+
+VCXMV DeleteMedia E_DRIVE 0 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDeleteResp KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDeleteStarted KVCXMYVideosTestMessageMpxItemDeleted KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 0
+VCXMV CheckMediaCount E_DRIVE 0
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests deleting download which is still ongoing.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30905 Delete ongoing download
+var CASE ET30905
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Start download
+VCXMV Download 3G_AP SERVICE_2 3 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV // Dl started
+
+VCXMV DeleteMedia E_DRIVE 0 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDeleteResp KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDeleteStarted
+allownextresult KERRARGUMENT
+waittestclass VCXMV
+
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+VCXMV CheckMediaCount C_DRIVE 0
+VCXMV CheckMediaCount E_DRIVE 1
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests deleting nothing, sends a delete request with no media objects.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30906 Delete nothing
+var CASE ET30906
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "video1 CASE .mp4"
+
+VCXMV DeleteMedias C_DRIVE 1 0 E_DRIVE 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDeleteResp KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDeleteStarted
+//allownextresult KERRARGUMENT
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 1
+VCXMV CheckMediaCount E_DRIVE 0
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests canceling a delete of 30 videos.
+#
+# Note: This might fail in emulator because file deletion is much faster than in actual HW.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30907 Cancel delete
+var CASE ET30907
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "video CASE .mp4" 50000 30
+
+VCXMV SetQuietMode 1
+
+VCXMV CheckMediaCount C_DRIVE 30
+VCXMV CheckMediaCount E_DRIVE 0
+
+pause 60000 // Wait for MDS to scan the files and maybe thumbnail generation
+
+VCXMV CancelNextOperation
+VCXMV DeleteMedias C_DRIVE 0 30 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandCanceled
+waittestclass VCXMV
+
+VCXMV CoolDown
+
+VCXMV SetQuietMode 0
+
+// Check that all videos have not been deleted
+VCXMV CheckMinimumMediaCount C_DRIVE 10
+VCXMV CheckMediaCount E_DRIVE 0
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests cancel delete request when there's no delete operation ongoing.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30908 Cancel delete without request
+var CASE ET30908
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CancelDelete
+
+VCXMV CheckMediaCount C_DRIVE 0
+VCXMV CheckMediaCount E_DRIVE 0
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests delete operation, sends request with no media array defined.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30910 Delete, no array defined
+var CASE ET30910
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "video1 CASE .mp4"
+
+VCXMV DeleteMedias C_DRIVE -4 0 E_DRIVE 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDeleteResp KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDeleteStarted
+//allownextresult KERRARGUMENT
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 1
+VCXMV CheckMediaCount E_DRIVE 0
+
+print OK!
+delete VCXMV
+[Endtest]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXMyVideosCollectionPluginTestDownload.cfg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,1374 @@
+#-----------------------------------------------------------------------------------
+#
+# STIF test script file for testing VCXMyVideosCollectionPluginTest.dll
+#
+# Tests functionality for downloading video files.
+#
+#-----------------------------------------------------------------------------------
+
+[StifSettings]
+CapsModifier= IptvTestClientApiCapsMod.exe
+[EndStifSettings]
+
+[Define]
+INCLUDE c:\TestFramework\VCXMVCollectionPluginTest.inc
+INCLUDE c:\TestFramework\VCXDrives.inc
+INCLUDE c:\TestFramework\VCXConsts.inc
+INCLUDE c:\TestFramework\VCXErrors.inc
+[Enddefine]
+
+#************************************************************************************
+# Sub Cleanup
+# Removes all videos from the phone. Collection is opened.
+#************************************************************************************
+[Sub Cleanup]
+print cleanup start
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV RemoveAllMedia
+delete VCXMV
+
+print wait 30sec
+pause 30000
+print cleanup end
+[EndSub]
+#************************************************************************************
+
+#************************************************************************************
+
+#------------------------------------------------------------------------------------
+#
+#  Does configuration for cases in this script.
+#  Creates 'Internet' IAP into 'Internet' destination and sets connection as authorized.
+#  Sets preferred memory to first used drive and sorting order to none.
+#  Removes all video files from the device.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30100 <not a test> Setup
+var CASE ET30100
+create VCXTestUtilModule Util
+
+// Copies some known 3G AP to "Internet" destination with "Internet" name for the AP.
+Util SetUsedDestination "Internet"
+Util CopyMethod "Internet" "Internet" "Internet"
+// Disable connection dialog for "Internet" destination.
+Util SetConnectionMethodIntAttribute "Internet" "Internet" 507 2 // 507 is ECmSeamlessnessLevel
+Util SetDefaultIapCenrep
+
+Util CreateMobilecrashWatcher
+
+// Remove all videos
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetPreferredMemory C_DRIVE
+VCXMV SetSortingOrder EVcxMyVideosSortingNone
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV RemoveAllMedia
+
+VCXMV CheckMediaCount ANY_DRIVE 0
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+
+print OK!
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests download to first used drive.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30101 Download video, 1st drive
+var CASE ET30101
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_SMALLVIDEOS 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 1
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralFlags EVcxMyVideosVideoNew
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Sets used memory to second drive.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title <not a test> Setup default memory
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetPreferredMemory E_DRIVE
+delete VCXMV
+print OK!
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests downloading 3 videos. Each download is started when previous finishes.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30102 Download 3 videos one by one, 2nd drive
+var CASE ET30102
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetPreferredMemory E_DRIVE
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_SMALLVIDEOS 2 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+VCXMV Download DEFAULT_AP SERVICE_SMALLVIDEOS 3 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+VCXMV Download DEFAULT_AP SERVICE_SMALLVIDEOS 4 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Check video has been loaded, there's one from previous case
+VCXMV CheckMediaCount E_DRIVE 3
+VCXMV CheckMediaCount C_DRIVE 0
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests opening download category when download is ongoing.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30103 Download and open downloads category
+var CASE ET30103
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Create one sideloaded video
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video CASE 0.mp4"
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Start download
+VCXMV Download DEFAULT_AP SERVICE_2 0 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete
+waittestclass VCXMV // Dl started
+
+// Get list of downloads
+VCXMV OpenLevel EVcxMyVideosDownloads
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlProgressed
+waittestclass VCXMV
+
+// Check that there's a download
+VCXMV CheckMediaCount ANY_DRIVE 1
+
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+VCXMV CoolDown
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Get list of all videos
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Downloaded and sideloaded
+VCXMV CheckMediaCount ANY_DRIVE 2
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests canceling a download.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30104 Cancel download
+var CASE ET30104
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Start download
+VCXMV Download DEFAULT_AP SERVICE_2 20 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV // Dl started
+
+// Cancel it
+VCXMV CancelDownload SERVICE_2 20 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlCanceled
+waittestclass VCXMV // Dl canceled
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Should be no videos
+VCXMV CheckMediaCount ANY_DRIVE 0
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests pausing a download.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30105 Pause download
+var CASE ET30105
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Start download
+VCXMV Download DEFAULT_AP SERVICE_2 20 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV // Command complete
+
+// Pause it
+VCXMV PauseDownload SERVICE_2 20 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlPaused
+waittestclass VCXMV // Dl paused
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests resuming a download.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30111 Pause and resume download
+var CASE ET30111
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Start download
+VCXMV Download DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+// Pause it
+VCXMV PauseDownload SERVICE_2 1 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlPaused
+waittestclass VCXMV // Dl paused
+
+VCXMV ResumeDownload DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests opening downloads category when download is paused. All videos category
+#  is opened then and download is resumed.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30112 Pause and open downloads category
+var CASE ET30112
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Start download
+VCXMV Download DEFAULT_AP SERVICE_2 20 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV // Command complete
+
+// Pause it
+VCXMV PauseDownload SERVICE_2 20 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlPaused
+waittestclass VCXMV // Dl paused
+
+VCXMV CoolDown
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Get list of downloads
+VCXMV OpenLevel EVcxMyVideosDownloads
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Check that there's a download
+VCXMV CheckMediaCount ANY_DRIVE 1
+
+VCXMV CoolDown
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV ResumeDownload DEFAULT_AP SERVICE_2 20 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+VCXMV CancelDownload SERVICE_2 20 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete
+waittestclass VCXMV // Dl canceled
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests canceling a download in paused state.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30113 Cancel paused download
+var CASE ET30113
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Start download
+VCXMV Download DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV // Command complete
+
+// Pause it
+VCXMV PauseDownload SERVICE_2 1 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlPaused
+waittestclass VCXMV // Dl paused
+
+// Cancel download
+VCXMV CancelDownload SERVICE_2 1 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlCanceled
+waittestclass VCXMV // Dl canceled
+
+VCXMV CheckMediaCount ANY_DRIVE 0
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests downloading two videos at same time.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30106 2 downloads same time
+var CASE ET30106
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Check that there's no other videos
+VCXMV CheckMediaCount ANY_DRIVE 0
+
+VCXMV Download DEFAULT_AP SERVICE_2 3 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete
+waittestclass VCXMV // Dl started
+
+VCXMV Download DEFAULT_AP SERVICE_SMALLVIDEOS 0 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete
+waittestclass VCXMV // Dl started
+
+VCXMV WaitAllDownloads
+waittestclass VCXMV
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Check videos have been loaded
+VCXMV CheckMediaCount ANY_DRIVE 2
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that progress of a download is set to 100% when download is finished.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30109 Check progress of finished download
+var CASE ET30109
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete
+waittestclass VCXMV
+
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV
+
+VCXMV CheckDownloadProgress SERVICE_2 1 100
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that progress of a download is updated during the download.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30110 Check progress of download
+var CASE ET30110
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning KVCXMYVideosTestMessageDlProgressed KVCXMYVideosTestMessageDlProgressed KVCXMYVideosTestMessageDlProgressed
+waittestclass VCXMV
+
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that progress of download is updated after download has been resumed.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30114 Pause, resume, check progress
+var CASE ET30114
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 20 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV PauseDownload SERVICE_2 20 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlPaused
+waittestclass VCXMV
+
+VCXMV ResumeDownload DEFAULT_AP SERVICE_2 20 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning KVCXMYVideosTestMessageDlProgressed KVCXMYVideosTestMessageDlProgressed
+waittestclass VCXMV
+
+VCXMV CoolDown
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that attributes can be fetched for video that has been downloaded.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30115 Details of downloaded video
+var CASE ET30115
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_SMALLVIDEOS 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+VCXMV GetMediaFullDetails ANY_DRIVE 0
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that attributes can be fetched for paused download.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30116 Details of paused video
+var CASE ET30116
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 20 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV // Dl starts
+
+VCXMV PauseDownload SERVICE_2 20 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlPaused
+waittestclass VCXMV
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+VCXMV GetMediaFullDetails ANY_DRIVE 0
+
+VCXMV CancelDownload SERVICE_2 20 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlCanceled
+waittestclass VCXMV // Dl canceled
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that attributes can be fetched for ongoing download.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30117 Details of ongoing download
+var CASE ET30117
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete
+waittestclass VCXMV // Dl complete
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+VCXMV GetMediaFullDetails ANY_DRIVE 0
+
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that download can be started with full attributes and they are preserved
+#  when download is complete. Some attributes are updated when download is complete.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30120 Start download with full attributes
+var CASE ET30120
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateEmptyMedia
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 0
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+//VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin 6
+//VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+
+VCXMV DownloadUsingMedia DEFAULT_AP SERVICE_SMALLVIDEOS 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 1MINUTE KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+delete VCXMV
+pause 2000
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+
+VCXMV GetMediaFullDetails ANY_DRIVE 0
+
+// These are set at download time.
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "small1"
+//VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 213358
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginDownloaded
+
+//VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralFlags 0
+//EVcxMyVideosVideoNew
+
+// These were given at download start 
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+//VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+//allownextresult KERRNOTSUPPORTED
+//VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that download state is not preserved in the collection database.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30121 Download state in DB
+var CASE ET30121
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Start download
+VCXMV Download DEFAULT_AP SERVICE_2 20 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV // Dl started
+
+// Cancel it
+VCXMV PauseDownload SERVICE_2 20 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlPaused
+waittestclass VCXMV // Dl paused
+
+delete VCXMV
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Should be no downloads
+VCXMV CheckDownloadCount 0
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests downloading videos to two different drives at same time.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30122 Download videos to 2 drives
+var CASE ET30122
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV SetPreferredMemory E_DRIVE
+pause 2000
+
+VCXMV Download DEFAULT_AP SERVICE_2 0 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV // Command complete
+
+VCXMV SetPreferredMemory C_DRIVE
+pause 2000
+
+VCXMV Download DEFAULT_AP SERVICE_SMALLVIDEOS 1 0 "mediacharger" "Buran_9o"
+
+VCXMV WaitAllDownloads
+waittestclass VCXMV
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Check video has been loaded, there's one from previous case
+VCXMV CheckMediaCount E_DRIVE 1
+VCXMV CheckMediaCount C_DRIVE 1
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests getting full attributes for a downloaded video with MPX ID.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30123 Details by MPX ID of downloaded video
+var CASE ET30123
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_SMALLVIDEOS 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+VCXMV GetMediaFullDetailsByMpxId ANY_DRIVE 0
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests getting full attributes for a paused download with MPX ID.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30124 Details by MPX ID of paused video
+var CASE ET30124
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 20 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV // Dl starts
+
+VCXMV PauseDownload SERVICE_2 20 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlPaused
+waittestclass VCXMV
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+VCXMV GetMediaFullDetailsByMpxId ANY_DRIVE 0
+
+VCXMV CancelDownload SERVICE_2 20 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlCanceled
+waittestclass VCXMV // Dl canceled
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests getting full attributes for a ongoing download with MPX ID.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30125 Details by MPX ID of ongoing download
+var CASE ET30125
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete
+waittestclass VCXMV // Dl complete
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+VCXMV GetMediaFullDetailsByMpxId ANY_DRIVE 0
+
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests getting full attributes for a download with MPX ID. Download is started with full
+#  attributes.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30126 Start download with full attributes, get details by MPX ID
+var CASE ET30126
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateEmptyMedia
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 0
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+//VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin 6
+//VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+
+VCXMV DownloadUsingMedia DEFAULT_AP SERVICE_SMALLVIDEOS 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 1MINUTE KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+delete VCXMV
+pause 2000
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+
+VCXMV GetMediaFullDetailsByMpxId ANY_DRIVE 0
+
+// These are set at download time.
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "small1"
+//VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 213358
+//VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralFlags 0
+//EVcxMyVideosVideoNew
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginDownloaded
+
+// These were given at download start
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+//VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+//allownextresult KERRNOTSUPPORTED
+//VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXMyVideosCollectionPluginTestDownload2.cfg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,1581 @@
+#-----------------------------------------------------------------------------------
+#
+# STIF test script file for testing VCXMyVideosCollectionPluginTest.dll
+#
+# Tests functionality for downloading video files.
+#
+#-----------------------------------------------------------------------------------
+
+[StifSettings]
+CapsModifier= IptvTestClientApiCapsMod.exe
+[EndStifSettings]
+
+[Define]
+INCLUDE c:\TestFramework\VCXMVCollectionPluginTest.inc
+INCLUDE c:\TestFramework\VCXDrives.inc
+INCLUDE c:\TestFramework\VCXConsts.inc
+INCLUDE c:\TestFramework\VCXErrors.inc
+[Enddefine]
+
+#************************************************************************************
+# Sub Cleanup
+# Removes all videos from the phone. Collection is opened.
+#************************************************************************************
+[Sub Cleanup]
+print cleanup start
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV RemoveAllMedia
+delete VCXMV
+
+print pause 3min
+pause 180000
+print cleanup end
+[EndSub]
+#************************************************************************************
+
+#------------------------------------------------------------------------------------
+#
+#  Does configuration for cases in this script.
+#  Creates 'Internet' IAP into 'Internet' destination and sets connection as authorized.
+#  Sets preferred memory to first used drive and sorting order to none.
+#  Removes all video files from the device.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30300 <not a test> Setup
+var CASE ET30300
+
+create VCXTestUtilModule Util
+
+// Copies some known 3G AP to "Internet" destination with "Internet" name for the AP.
+Util SetUsedDestination DEFAULT_DEST
+Util CopyMethod "Internet" "Internet" "Internet"
+// Disable connection dialog for "Internet" destination.
+Util SetConnectionMethodIntAttribute "Internet" "Internet" 507 2 // 507 is ECmSeamlessnessLevel
+
+Util CreateMobilecrashWatcher
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetPreferredMemory E_DRIVE
+VCXMV SetSortingOrder EVcxMyVideosSortingNone
+
+// Open collection
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Open category
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Remove all videos.
+VCXMV RemoveAllMedia
+
+// Get the list again and verify videos have been removed.
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 0
+print OK!
+
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests downloading same video two times.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30301 2 downloads, same url
+var CASE ET30301
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// Test
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Check that there's no other videos
+VCXMV CheckMediaCount ANY_DRIVE 0
+
+VCXMV Download DEFAULT_AP SERVICE_2 0 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 5MINUTES KVCXMYVideosTestMessageCommandComplete
+waittestclass VCXMV // Dl started
+
+VCXMV Download DEFAULT_AP SERVICE_2 19 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 5MINUTES KVCXMYVideosTestMessageCommandComplete
+waittestclass VCXMV // Dl started
+
+VCXMV WaitAllDownloads 5
+waittestclass VCXMV
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Check videos have been loaded
+VCXMV CheckMediaCount ANY_DRIVE 2
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that download goes to paused state when connection is disconnected.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30302 Download, connection disconnects
+var CASE ET30302
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// Test
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetAutoResume 0
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 20 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV // Dl started
+
+loop 3
+Util WaitForConnectionActivity DEFAULT_AP
+allowerrorcodes KERRTIMEDOUT
+waittestclass Util
+allowerrorcodes KERRNOTFOUND
+allowerrorcodes KERRALREADYEXISTS
+Util Attach DEFAULT_AP
+allowerrorcodes KERRNOTREADY
+Util Terminate
+endloop
+
+VCXMV CoolDown
+
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests resuming download after connection has been disconnected.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30303 Download, connection disconnects, resume
+var CASE ET30303
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// Test
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetAutoResume 0
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 0 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV // Dl started
+
+loop 3
+Util WaitForConnectionActivity DEFAULT_AP
+allowerrorcodes KERRTIMEDOUT
+waittestclass Util
+allowerrorcodes KERRNOTFOUND
+allowerrorcodes KERRALREADYEXISTS
+Util Attach DEFAULT_AP
+allowerrorcodes KERRNOTREADY
+Util Terminate
+endloop
+
+VCXMV CoolDown
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosDownloadState EVcxMyVideosDlStatePaused
+
+VCXMV ResumeDownload DEFAULT_AP SERVICE_2 0 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests collection background download functionality, client exits before download is complete.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30304 Client deleted before DL completes.
+var CASE ET30304
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// Test
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV // Dl started
+
+print OK!
+delete VCXMV
+
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests canceling a finished download, operation should do nothing.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30305 Cancel finished download
+var CASE ET30305
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// Test
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Start download
+VCXMV Download DEFAULT_AP SERVICE_SMALLVIDEOS 0 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Downloaded video
+VCXMV CheckMediaCount ANY_DRIVE 1
+
+// Cancel download
+VCXMV CancelDownload SERVICE_SMALLVIDEOS 0 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete
+//allowerrorcodes KERRARGUMENT
+waittestclass VCXMV // Dl canceled
+
+VCXMV CoolDown
+
+VCXMV CheckMediaCount ANY_DRIVE 0
+
+delete VCXMV
+
+print OK!
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests canceling download with invalid MPX ID.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30306 Cancel download with invalid MPX ID
+var CASE ET30306
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// Test
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Start download
+VCXMV Download DEFAULT_AP SERVICE_2 0 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+// Cancel download
+VCXMV CancelDownloadById 666 -1 0 // Will use real download id
+allowerrorcodes KERRLOCKED
+allowerrorcodes KERRARGUMENT
+allowerrorcodes KERRCORRUPT
+waittestclass VCXMV
+
+VCXMV CoolDown
+
+delete VCXMV
+
+// Check that video doesn't exist.
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Downloaded video
+VCXMV CheckMediaCount ANY_DRIVE 0
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests canceling download with invalid download ID.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30311 Cancel download with invalid download ID
+var CASE ET30311
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// Test
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Start download
+VCXMV Download DEFAULT_AP SERVICE_2 20 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+// Cancel download
+VCXMV CancelDownloadById -1 666 0 // Will use real mpx id
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete
+//VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlCanceled
+allowerrorcodes KERRNOTFOUND
+allowerrorcodes KERRCORRUPT
+waittestclass VCXMV
+
+VCXMV CoolDown
+
+delete VCXMV
+
+// Check that video doesn't exist
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Downloaded video
+VCXMV CheckMediaCount ANY_DRIVE 1
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests downloading video with 1024 characters long url.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30307 Download with long url
+var CASE ET30307
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV DownloadUrl DEFAULT_AP VCXMYVideosTest1kURL 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests downloading video with 2048 characters long url.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30329 Download with long url 2
+var CASE ET30329
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV DownloadUrl DEFAULT_AP VCXMYVideosTest2kURL 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+allowerrorcodes KERRARGUMENT
+//allowerrorcodes -7376
+waittestclass VCXMV // Dl complete
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 0
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests download with invalid url.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30308 Download invalid url
+var CASE ET30308
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV DisableDownloadCheck
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV DownloadUrl DEFAULT_AP "http:\/\/asdfsda" 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+allownextresult KVCXMYVideosTestMessageDlFailed
+allownextresult EObjectNotFound
+allownextresult -7376
+waittestclass VCXMV // Dl complete
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests download with empty url.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30309 Download empty url
+var CASE ET30309
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV DisableDownloadCheck
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV DownloadUrl DEFAULT_AP VCXTestZeroUrl 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+allownextresult KERRARGUMENT
+allownextresult KERRABORT
+waittestclass VCXMV // Dl complete
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 0
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests download when destination folder doesn't exist.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30310 Download video, dest folder does not exist
+var CASE ET30310
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+Util DeleteFolder "c:\data\videos\"
+Util DeleteFolder "e:\my videos\"
+Util DeleteFolder "e:\my videos\downloads\"
+//"
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_SMALLVIDEOS 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests download with IAP which doesn't work.
+#
+# Note: Disabled because connection dialog is shown.
+#------------------------------------------------------------------------------------
+//[Test]
+//title ET30312 Download video with bad IAP
+
+//create VCXTestUtilModule Util
+//Util CreateMobilecrashWatcher
+
+//callsub Cleanup
+
+// TESTCASE START
+
+//create  VCXMyVideosCollectionPluginTest VCXMV
+//VCXMV Create
+
+// Get list of videos
+//VCXMV OpenCollection VCXCollectionMyVideos
+//VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+//waittestclass VCXMV
+
+//VCXMV SetAutoResume 0
+
+//VCXMV OpenLevel EVcxMyVideosAllVideos
+//VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+//waittestclass VCXMV
+
+//VCXMV Download BAD_AP SERVICE_SMALLVIDEOS 1 0 "mediacharger" "Buran_9o"
+//VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlPaused KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+//allowerrorcodes EConnectionFailed
+//waittestclass VCXMV // Dl complete
+
+// Lets resume it with working AP
+//VCXMV ResumeDownload DEFAULT_AP SERVICE_SMALLVIDEOS 1 0 "mediacharger" "Buran_9o"
+//VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+//waittestclass VCXMV
+
+//VCXMV SetAutoResume 1
+
+//VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+//waittestclass VCXMV // Dl complete
+
+//VCXMV CheckMediaCount E_DRIVE 1
+
+//print OK!
+//delete VCXMV
+
+//Util CheckMobilecrashes
+//pause 1000
+//delete Util
+//[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests download with invalid iap, it doesn't exist.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30313 Download video with invalid IAP
+var CASE ET30313
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV SetAutoResume 0
+
+VCXMV Download VCXTestInvalidIap SERVICE_SMALLVIDEOS 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlPaused KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+allowerrorcodes KVCXMYVideosTestMessageDlFailed
+waittestclass VCXMV // Dl complete
+
+// Lets resume it with working AP
+VCXMV ResumeDownload DEFAULT_AP SERVICE_SMALLVIDEOS 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 30SECONDS KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+VCXMV CheckMediaCount E_DRIVE 1
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests download without username and password.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30314 Download video wo username nor password
+var CASE ET30314
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_SMALLVIDEOS 1 0
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+allownextresult EHttpAuthenticationFailed
+waittestclass VCXMV // Dl complete
+
+VCXMV CheckMediaCount E_DRIVE 1
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralFlags EVcxMyVideosVideoNew
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests download with invalid username.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30315 Download video with invalid username
+var CASE ET30315
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_SMALLVIDEOS 1 0 "xxx" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+allownextresult EHttpAuthenticationFailed
+waittestclass VCXMV // Dl complete
+
+VCXMV CheckMediaCount E_DRIVE 1
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralFlags EVcxMyVideosVideoNew
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests download with invalid password.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30316 Download video with invalid password
+var CASE ET30316
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_SMALLVIDEOS 1 0 "mediacharger" "xxx"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+allownextresult EHttpAuthenticationFailed
+waittestclass VCXMV // Dl complete
+
+VCXMV CheckMediaCount E_DRIVE 1
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralFlags EVcxMyVideosVideoNew
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Sets default used memory for following cases.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title <not a test> Setup default memory
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetPreferredMemory E_DRIVE
+delete VCXMV
+print OK!
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests download of video which doesn't exist on the server.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30317 Download 404
+var CASE ET30317
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV DownloadUrl DEFAULT_AP "http:\/\/193.65.182.78/asdfsdafasasdf.mp3" 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+allownextresult EObjectNotFound
+waittestclass VCXMV // Dl complete
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests download when the url has address of server which doesn't exist.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30318 Download invalid server
+var CASE ET30318
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV DownloadUrl DEFAULT_AP "http:\/\/111.111.111.111/asdfsdafasasdf.mp3" 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+allowerrorcodes EHttpUnhandled
+allowerrorcodes -7376
+waittestclass VCXMV // Dl complete
+
+VCXMV CheckMediaCount E_DRIVE 1
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralFlags EVcxMyVideosVideoNew
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests download with streaming video address.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30319 Download stream
+var CASE ET30319
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV DownloadUrl DEFAULT_AP "rtsp:\/\/193.65.182.100/rtpencoder/WTT_ch02.sdp" 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+allowerrorcodes KVCXMYVideosTestErrorDownloadNotFound
+allowerrorcodes -7376
+waittestclass VCXMV
+
+VCXMV CoolDown
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests pausing of download which is already in paused state.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30320 Pause paused download
+var CASE ET30320
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Start download
+VCXMV Download DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV // Command complete
+
+// Pause it
+VCXMV PauseDownload SERVICE_2 1 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlPaused
+waittestclass VCXMV // Dl paused
+
+// Pause again
+VCXMV PauseDownload SERVICE_2 1 0
+//VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlPaused
+//waittestclass VCXMV // Dl paused
+
+VCXMV ResumeDownload DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests pausing of a download which has been finished, it doesn't exist.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30321 Pause finished download ( non existing )
+var CASE ET30321
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Start download
+VCXMV Download DEFAULT_AP SERVICE_SMALLVIDEOS 0 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV
+
+// Pause it
+VCXMV PauseDownload SERVICE_SMALLVIDEOS 0 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests resuming a download which is already running.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30323 Resume running download
+var CASE ET30323
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Start download
+VCXMV Download DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV ResumeDownload DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests resuming download with different IAP what it was started.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30324 Resume with different IAP
+var CASE ET30324
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Start download
+VCXMV Download WLAN_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+// Pause it
+VCXMV PauseDownload SERVICE_2 1 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlPaused
+waittestclass VCXMV // Dl paused
+
+VCXMV ResumeDownload DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests resuming download with no username and password.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30325 Resume without username nor password
+var CASE ET30325
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Start download
+VCXMV Download DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+// Pause it
+VCXMV PauseDownload SERVICE_2 1 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlPaused
+waittestclass VCXMV // Dl paused
+
+VCXMV ResumeDownload DEFAULT_AP SERVICE_2 1 0
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+allownextresult EHttpAuthenticationFailed
+waittestclass VCXMV // Dl complete
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests resuming download with invalid username and password.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30326 Resume with invalid username and password
+var CASE ET30326
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Start download
+VCXMV Download DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+// Pause it
+VCXMV PauseDownload SERVICE_2 1 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlPaused
+waittestclass VCXMV // Dl paused
+
+VCXMV ResumeDownload DEFAULT_AP SERVICE_2 1 0 "xxx" "xxxx"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+allownextresult EHttpAuthenticationFailed
+waittestclass VCXMV // Dl complete
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests resuming download which doesn't exist.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30327 Resume non existing download
+var CASE ET30327
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV ResumeDownload DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 0
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests two downloads at the same time, the videos have same url.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30328 Two downloads same time with same URL
+var CASE ET30328
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Start download
+VCXMV Download DEFAULT_AP SERVICE_2 0 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+// Start download
+VCXMV Download DEFAULT_AP SERVICE_2 19 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 5MINUTES KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV WaitAllDownloads 4 // wait for 4 minutes
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 2
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# Test resuming download which doesn't support pausing.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30330 Ranged download, non pausable file
+var CASE ET30330
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV DownloadUrl DEFAULT_AP "http:\/\/waplabdc.nokia-boston.com/browser/users/drm1.0/CD/CD_kulkurin_iltakalja.dm" 0
+
+// Wait download to start.
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+print Pausing
+
+// Pause it
+VCXMV PauseDownloadByUrl "http:\/\/waplabdc.nokia-boston.com/browser/users/drm1.0/CD/CD_kulkurin_iltakalja.dm" 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlPaused
+allowerrorcodes KERRTIMEDOUT // Might also fail
+waittestclass VCXMV // Dl paused
+
+print Resuming
+
+// Pause it
+VCXMV ResumeAllDownloads
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+allowerrorcodes KERRTIMEDOUT // Might also fail
+waittestclass VCXMV // Dl complete
+
+VCXMV CheckMediaCount E_DRIVE 1
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXMyVideosCollectionPluginTestFullMemory.cfg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,840 @@
+#-----------------------------------------------------------------------------------
+#
+# STIF test script file for testing VCXMyVideosCollectionPluginTest.dll
+#
+# Tests functionality when target drive of device has not enough space.
+#
+#-----------------------------------------------------------------------------------
+
+[StifSettings]
+CapsModifier= IptvTestClientApiCapsMod.exe
+[EndStifSettings]
+
+[Define]
+INCLUDE c:\TestFramework\VCXMVCollectionPluginTest.inc
+INCLUDE c:\TestFramework\VCXDrives.inc
+INCLUDE c:\TestFramework\VCXConsts.inc
+INCLUDE c:\TestFramework\VCXErrors.inc
+[Enddefine]
+
+#************************************************************************************
+# Sub Cleanup
+# Removes all videos from the phone. Collection is opened.
+#************************************************************************************
+[Sub Cleanup]
+print cleanup start
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV RemoveAllMedia
+delete VCXMV
+
+print wait 30sec
+pause 30000
+print cleanup end
+[EndSub]
+#************************************************************************************
+
+#************************************************************************************
+
+#------------------------------------------------------------------------------------
+#
+#  Does configuration for cases in this script.
+#  Creates 'Internet' IAP into 'Internet' destination and sets connection as authorized.
+#  Sets preferred memory to first used drive and sorting order to none.
+#  Removes all video files from the device.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30600 <not a test> Setup
+var CASE ET30600
+create VCXTestUtilModule Util
+
+// Copies some known 3G AP to "Internet" destination with "Internet" name for the AP.
+Util SetUsedDestination "Internet"
+Util CopyMethod "Internet" "Internet" "Internet"
+// Disable connection dialog for "Internet" destination.
+Util SetConnectionMethodIntAttribute "Internet" "Internet" 507 2 // 507 is ECmSeamlessnessLevel
+Util SetDefaultIapCenrep
+
+Util CreateMobilecrashWatcher
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetPreferredMemory C_DRIVE
+VCXMV SetSortingOrder EVcxMyVideosSortingNone
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV RemoveAllMedia
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 0
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests download to first drive when there's not enough free space for the video.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30615 Download video to full 1st memory
+var CASE ET30615
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetPreferredMemory C_DRIVE
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+Util SetDriveFreeSpace C_DRIVE FREESPACE_1MB
+
+VCXMV Download DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+allownextresult KERRDISKFULL
+allownextresult EDiskFull
+waittestclass VCXMV // Dl complete
+
+VCXMV CheckMediaCount C_DRIVE 1
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralFlags EVcxMyVideosVideoNew
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests download to second drive when there's not enough free space for the video.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30602 Download video to full 2nd memory
+var CASE ET30602
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetPreferredMemory E_DRIVE
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+Util SetDriveFreeSpace E_DRIVE FREESPACE_1MB
+
+VCXMV Download DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+allownextresult KERRDISKFULL
+allownextresult EDiskFull
+waittestclass VCXMV // Dl complete
+
+VCXMV CheckMediaCount E_DRIVE 1
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralFlags EVcxMyVideosVideoNew
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Sets default used memory.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title <not a test> Setup default memory
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetPreferredMemory E_DRIVE_FORCED
+delete VCXMV
+print OK!
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that it's possible to fetch video attributes for failed download in full memory.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30603 Details for failed DL on Full memory
+var CASE ET30603
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+Util SetDriveFreeSpace E_DRIVE_FORCED FREESPACE_100KB
+
+VCXMV Download DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+allownextresult KERRDISKFULL
+allownextresult EDiskFull
+waittestclass VCXMV // Dl complete
+
+VCXMV CheckMediaCount E_DRIVE_FORCED 1
+
+VCXMV GetAllMediaFullDetails
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that failed download can be continued after drive has enough space again.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30604 Full memory DL fails, free space and resume
+var CASE ET30604
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+Util SetDriveFreeSpace E_DRIVE_FORCED FREESPACE_1MB
+
+VCXMV Download DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+allowerrorcodes KERRDISKFULL
+allowerrorcodes EDiskFull
+waittestclass VCXMV // Dl complete
+
+VCXMV CheckMediaCount E_DRIVE_FORCED 1
+
+Util SetDriveFreeSpace E_DRIVE_FORCED FREESPACE_10MB
+
+VCXMV ResumeDownload DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+VCXMV GetAllMediaFullDetails
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests download when drive fills up during the download.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30605 Start download and fill memory
+var CASE ET30605
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+Util SetDriveFreeSpace E_DRIVE_FORCED FREESPACE_10MB
+
+VCXMV Download DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+Util SetDriveFreeSpace E_DRIVE_FORCED FREESPACE_100KB
+
+allownextresult KERRDISKFULL
+allownextresult EDiskFull
+waittestclass VCXMV
+
+VCXMV CheckMediaCount E_DRIVE_FORCED 1
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests resuming paused download when drive has not enough space.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30606 Download paused, fill memory and resume
+var CASE ET30606
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 20 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+// Pause it
+VCXMV PauseDownload SERVICE_2 20 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlPaused
+waittestclass VCXMV // Dl paused
+
+Util SetDriveFreeSpace E_DRIVE_FORCED FREESPACE_100KB
+
+VCXMV ResumeDownload DEFAULT_AP SERVICE_2 20 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+allownextresult KERRDISKFULL
+allownextresult EDiskFull
+waittestclass VCXMV // Dl complete
+
+VCXMV CheckMediaCount E_DRIVE_FORCED 1
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests canceling download when drive is full.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30607 Download paused, fill memory and cancel
+var CASE ET30607
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+Util SetDriveFreeSpace E_DRIVE_FORCED FREESPACE_10MB
+
+VCXMV Download DEFAULT_AP SERVICE_2 20 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+// Pause it
+VCXMV PauseDownload SERVICE_2 20 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlPaused
+waittestclass VCXMV // Dl paused
+
+Util SetDriveFreeSpace E_DRIVE_FORCED FREESPACE_100KB
+
+// Cancel download
+VCXMV CancelDownload SERVICE_2 20 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlCanceled
+waittestclass VCXMV // Dl canceled
+
+VCXMV CheckMediaCount E_DRIVE_FORCED 0
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests multiple download when there's not enough space for all of them.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30608 Not enough space for 4 downloads
+var CASE ET30608
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+Util SetDriveFreeSpace E_DRIVE_FORCED FREESPACE_10MB
+
+VCXMV Download DEFAULT_AP SERVICE_2 3 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 4 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 5 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 6 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV WaitAllDownloads
+allownextresult KERRDISKFULL
+allownextresult EDiskFull
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests moving a video to drive which has not enough space.
+#
+# Note: My Videos MPX plugin needs 4 MB of extra space.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30609 Move to full memory
+var CASE ET30609
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create sideloaded video
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE_FORCED "video0 CASE .mp4"
+
+VCXMV CheckMediaCount C_DRIVE_FORCED 1
+VCXMV CheckMediaCount E_DRIVE_FORCED 0
+
+Util SetDriveFreeSpace E_DRIVE_FORCED FREESPACE_100KB
+
+VCXMV MoveMedia C_DRIVE_FORCED 0 E_DRIVE_FORCED 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMoveResp KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCopyOrMoveStarted
+allownextresult KERRDISKFULL
+allownextresult EDiskFull
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE_FORCED 1
+VCXMV CheckMediaCount E_DRIVE_FORCED 0
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests moving video from drive which has very little free space.
+#
+# Note: My Videos MPX plugin needs 4 MB of extra space.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30610 Move from full memory
+var CASE ET30610
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create sideloaded video
+VCXMV CreateVideoFile IptvTestVideoMpeg4 E_DRIVE_FORCED "video0 CASE .mp4"
+
+VCXMV CheckMediaCount C_DRIVE_FORCED 0
+VCXMV CheckMediaCount E_DRIVE_FORCED 1
+
+Util SetDriveFreeSpace E_DRIVE_FORCED FREESPACE_100KB
+
+VCXMV MoveMedia E_DRIVE_FORCED 0 C_DRIVE_FORCED 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMoveResp KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCopyOrMoveStarted
+allowerrorcodes KERRDISKFULL
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests copying video to drive which has not enough space.
+#
+# Note: My Videos MPX plugin needs 4 MB of extra space.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30611 Copy to full memory
+var CASE ET30611
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create sideloaded video
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE_FORCED "video0 CASE .mp4"
+
+VCXMV CheckMediaCount C_DRIVE_FORCED 1
+VCXMV CheckMediaCount E_DRIVE_FORCED 0
+
+Util SetDriveFreeSpace E_DRIVE_FORCED FREESPACE_100KB
+
+VCXMV CopyMedia C_DRIVE_FORCED 0 E_DRIVE_FORCED 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCopyResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCollectionItemChanged KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCollectionItemChanged KVCXMYVideosTestMessageCollectionCategoryChanged
+allownextresult KERRDISKFULL
+allownextresult EDiskFull
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE_FORCED 1
+VCXMV CheckMediaCount E_DRIVE_FORCED 0
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Test copying a video from drive which has a very little free space.
+#
+# Note: My Videos MPX plugin needs 4 MB of extra space.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30612 Copy from full memory
+var CASE ET30612
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create sideloaded video
+VCXMV CreateVideoFile IptvTestVideoMpeg4 E_DRIVE_FORCED "video0 CASE .mp4"
+
+VCXMV CheckMediaCount C_DRIVE_FORCED 0
+VCXMV CheckMediaCount E_DRIVE_FORCED 1
+
+Util SetDriveFreeSpace E_DRIVE_FORCED FREESPACE_100KB
+
+VCXMV CopyMedia E_DRIVE_FORCED 0 C_DRIVE_FORCED 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCopyResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCollectionItemChanged KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCollectionItemChanged KVCXMYVideosTestMessageCollectionCategoryChanged
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE_FORCED 1
+VCXMV CheckMediaCount E_DRIVE_FORCED 1
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests moving multiple videos to drive with not enough space for them.
+#
+# Note: My Videos MPX plugin needs 4 MB of extra space.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30613 Move multiple to full memory
+var CASE ET30613
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create sideloaded video
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE_FORCED "video CASE .mp4" 50000 10
+
+VCXMV CheckMediaCount C_DRIVE_FORCED 10
+VCXMV CheckMediaCount E_DRIVE_FORCED 0
+
+// Space for only 1 video
+Util SetDriveFreeSpace E_DRIVE_FORCED FREESPACE_4MBPLUS100KB
+
+VCXMV MoveMedias C_DRIVE_FORCED 0 10 E_DRIVE_FORCED 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMoveResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCommandComplete
+allownextresult KERRDISKFULL
+allownextresult EDiskFull
+waittestclass VCXMV
+
+// Get list of all videos
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE_FORCED 9
+VCXMV CheckMediaCount E_DRIVE_FORCED 1
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests copying multiple videos to drive with not enough space for them.
+#
+# Note: My Videos MPX plugin needs 4 MB of extra space.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30614 Copy multiple to full memory
+var CASE ET30614
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create sideloaded video
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE_FORCED "video CASE .mp4" 50000 10
+
+VCXMV CheckMediaCount C_DRIVE_FORCED 10
+VCXMV CheckMediaCount E_DRIVE_FORCED 0
+
+// Space for only 1 video
+Util SetDriveFreeSpace E_DRIVE_FORCED FREESPACE_4MBPLUS100KB
+
+VCXMV CopyMedias C_DRIVE_FORCED 0 10 E_DRIVE_FORCED 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCopyResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCommandComplete
+allownextresult KERRDISKFULL
+allownextresult EDiskFull
+waittestclass VCXMV
+
+// Get list of all videos
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE_FORCED 10
+VCXMV CheckMediaCount E_DRIVE_FORCED 1
+
+print OK!
+delete VCXMV
+[Endtest]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXMyVideosCollectionPluginTestHelium.cfg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,2282 @@
+#-----------------------------------------------------------------------------------
+#
+# STIF test script file for testing service management client API.
+#
+# This cfg has test cases which are run when Helium generates ATS3 test drops.
+# The cases are from other cfgs under the test module, if they are changed then 
+# easiest way to update cases here is to run perl script in the internal tool folder.
+#
+#-----------------------------------------------------------------------------------
+
+[StifSettings]
+CapsModifier= IptvTestClientApiCapsMod.exe
+[EndStifSettings]
+
+[Define]
+INCLUDE c:\TestFramework\VCXMVCollectionPluginTest.inc
+INCLUDE c:\TestFramework\VCXDrives.inc
+INCLUDE c:\TestFramework\VCXConsts.inc
+INCLUDE c:\TestFramework\VCXErrors.inc
+[Enddefine]
+
+[Sub Cleanup]
+print cleanup start
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV RemoveAllMedia
+
+delete VCXMV
+
+print wait 30sec
+pause 30000
+print cleanup end
+[EndSub]
+[Sub SetupVideos]
+
+callsub Cleanup
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingName
+
+VCXMV SetFileCheck 0
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create some video objects.
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "a.mp4"
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "b.mp4"
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "c.mp4"
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "d.mp4"
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "e.mp4"
+
+pause 10000
+
+VCXMV GetAllMediaFullDetails
+
+VCXMV SetAutomaticRefresh 0
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin ORIGIN
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 0
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 1
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin ORIGIN
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDateCurrent
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags EVcxMyVideosVideoNew
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 2
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin ORIGIN
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 0
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 3
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin ORIGIN
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDateCurrent
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags EVcxMyVideosVideoNew
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 4
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin ORIGIN
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 0
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+delete VCXMV
+[EndSub]
+[Sub CreateVideo]
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video CASE .mp4"
+[EndSub]
+
+[Test]
+title ET30200 <not a test> Setup
+var CASE ET30200
+
+create VCXTestUtilModule Util
+// Copies some known 3G AP to "Internet" destination with "Internet" name for the AP.
+Util SetUsedDestination "Internet"
+Util CopyMethod "Internet" "Internet" "Internet"
+// Disable connection dialog for "Internet" destination.
+Util SetConnectionMethodIntAttribute "Internet" "Internet" 507 2 // 507 is ECmSeamlessnessLevel
+Util SetDefaultIapCenrep
+delete Util
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetPreferredMemory E_DRIVE
+VCXMV SetSortingOrder EVcxMyVideosSortingNone
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV RemoveAllMedia
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 0
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+[Test]
+title ET30207 Sideload video while category is open.
+var CASE ET30207
+
+callsub Cleanup
+
+// TESTCASE START
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+callsub CreateVideo
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralFlags EVcxMyVideosVideoNew
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginOther
+
+print OK!
+delete VCXMV
+[Endtest]
+
+[Test]
+title ET30208 Sideload video 1st drive
+var CASE ET30208
+
+callsub Cleanup
+
+// TESTCASE START
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+callsub CreateVideo
+
+pause PAUSE_SIDELOAD
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralFlags EVcxMyVideosVideoNew
+print OK!
+delete VCXMV
+[Endtest]
+
+[Test]
+title ET30209 Get sideloaded video details 1st drive
+var CASE ET30209
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV GetMediaFullDetails ANY_DRIVE 0
+
+print OK!
+delete VCXMV
+[Endtest]
+
+[Test]
+title ET30210 Delete sideloaded video 1st drive
+var CASE ET30210
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV DeleteFileOfMedia ANY_DRIVE 0
+
+pause PAUSE_SIDELOAD
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 0
+print OK!
+delete VCXMV
+[Endtest]
+
+[Test]
+title ET30214 Sideload multiple videos
+var CASE ET30214
+
+callsub Cleanup
+
+// TESTCASE START
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0 CASE .mp4"
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video1 CASE .mp4"
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video2 CASE .mp4"
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video3 CASE .mp4"
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video4 CASE .mp4"
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video5 CASE .mp4"
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video6 CASE .mp4"
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video7 CASE .mp4"
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video8 CASE .mp4"
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video9 CASE .mp4"
+
+pause PAUSE_SIDELOAD
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 10
+print OK!
+delete VCXMV
+[Endtest]
+
+[Test]
+title ET30909 Delete a media from 1st drive
+var CASE ET30909
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create sideloaded video
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "video0 CASE .mp4"
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 1
+VCXMV CheckMediaCount E_DRIVE 0
+
+VCXMV DeleteMedia C_DRIVE 0 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDeleteResp KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDeleteStarted KVCXMYVideosTestMessageMpxItemDeleted KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 0
+VCXMV CheckMediaCount E_DRIVE 0
+
+print OK!
+delete VCXMV
+[Endtest]
+
+[Test]
+title ET30903 Delete multiple medias
+var CASE ET30903
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create sideloaded video
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "video CASE .mp4" 50000 5
+
+// Create sideloaded video
+VCXMV CreateVideoFile IptvTestVideo3Gp E_DRIVE "video CASE .mp4" 50000 5
+
+VCXMV CheckMediaCount C_DRIVE 5
+VCXMV CheckMediaCount E_DRIVE 5
+
+VCXMV DeleteMedias ANY_DRIVE 0 10 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDeleteResp KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDeleteStarted KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CoolDown
+
+VCXMV CheckMediaCount C_DRIVE 0
+VCXMV CheckMediaCount E_DRIVE 0
+
+print OK!
+delete VCXMV
+[Endtest]
+
+[Test]
+title ET30907 Cancel delete
+var CASE ET30907
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "video CASE .mp4" 50000 30
+
+VCXMV SetQuietMode 1
+
+VCXMV CheckMediaCount C_DRIVE 30
+VCXMV CheckMediaCount E_DRIVE 0
+
+pause 60000 // Wait for MDS to scan the files and maybe thumbnail generation
+
+VCXMV CancelNextOperation
+VCXMV DeleteMedias C_DRIVE 0 30 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandCanceled
+waittestclass VCXMV
+
+VCXMV CoolDown
+
+VCXMV SetQuietMode 0
+
+// Check that all videos have not been deleted
+VCXMV CheckMinimumMediaCount C_DRIVE 10
+VCXMV CheckMediaCount E_DRIVE 0
+
+print OK!
+delete VCXMV
+[Endtest]
+
+[Test]
+title ET30701 Move from 1st to 2nd drive
+var CASE ET30701
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create sideloaded video
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+VCXMV CheckMediaCount C_DRIVE 1
+VCXMV CheckMediaCount E_DRIVE 0
+
+VCXMV MoveMedia C_DRIVE 0 E_DRIVE 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMoveResp KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCopyOrMoveStarted
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 0
+VCXMV CheckMediaCount E_DRIVE 1
+
+print OK!
+delete VCXMV
+[Endtest]
+
+[Test]
+title ET30702 Check attributes of moved file
+var CASE ET30702
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create sideloaded video
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+// Update attributes
+// Sets all possible attributes of video.
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "a"
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralDate 2
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 3
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralMimeType "d"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDownloadId 0
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 1
+VCXMV CheckMediaCount E_DRIVE 0
+
+VCXMV MoveMedia C_DRIVE 0 E_DRIVE 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMoveResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 0
+VCXMV CheckMediaCount E_DRIVE 1
+
+// Check attributes
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+// Size is set to right size of the file after move.
+allowerrorcodes KERRCORRUPT
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+// General date is read-only.
+allowerrorcodes KERRCORRUPT
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralDate 3
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralFlags 3
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+// Mime type is read-only.
+allowerrorcodes KERRCORRUPT
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralMimeType "d"
+allowerrorcodes KERRCORRUPT
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+allowerrorcodes KERRCORRUPT
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosDownloadId 0
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+
+print OK!
+delete VCXMV
+[Endtest]
+
+[Test]
+title ET30707 Move multiple
+var CASE ET30707
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create sideloaded video
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video.mp4" 50000 10
+
+VCXMV CheckMediaCount C_DRIVE 10
+VCXMV CheckMediaCount E_DRIVE 0
+
+VCXMV MoveMedias C_DRIVE 0 5 E_DRIVE 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMoveResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCommandComplete
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 5
+VCXMV CheckMediaCount E_DRIVE 5
+
+print OK!
+delete VCXMV
+[Endtest]
+
+[Test]
+title ET30711 Cancel move
+var CASE ET30711
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video.mp4" 70000 30
+
+VCXMV CheckMediaCount C_DRIVE 30
+VCXMV CheckMediaCount E_DRIVE 0
+
+VCXMV CancelNextOperation
+VCXMV MoveMedias C_DRIVE 0 30 E_DRIVE 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandCanceled
+waittestclass VCXMV
+
+VCXMV CoolDown
+
+// Check that all videos have not been moved
+VCXMV CheckMinimumMediaCount C_DRIVE 5
+
+VCXMV CheckMediaCount ANY_DRIVE 30
+
+print OK!
+delete VCXMV
+[Endtest]
+
+[Test]
+title ET30751 Copy from 1st to 2nd drive
+var CASE ET30751
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create sideloaded video
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+VCXMV CheckMediaCount C_DRIVE 1
+VCXMV CheckMediaCount E_DRIVE 0
+
+VCXMV CopyMedia C_DRIVE 0 E_DRIVE 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCopyResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCollectionItemChanged KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCollectionItemChanged KVCXMYVideosTestMessageCollectionCategoryChanged
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 1
+VCXMV CheckMediaCount E_DRIVE 1
+
+print OK!
+delete VCXMV
+[Endtest]
+
+[Test]
+title ET30752 Check attributes of copied file
+var CASE ET30752
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+pause 10000
+
+// Update attributes
+// Sets all possible attributes of video.
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralDate 2
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 3
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralMimeType "d"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDownloadId 0
+
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 1
+VCXMV CheckMediaCount E_DRIVE 0
+
+VCXMV CopyMedia C_DRIVE 0 E_DRIVE 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCopyResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+// Get list of all videos
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 1
+VCXMV CheckMediaCount E_DRIVE 1
+
+// Check attributes
+
+VCXMV CheckMediaDetail E_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+// Size is set by collection after copy.
+allowerrorcodes KERRCORRUPT
+VCXMV CheckMediaDetail E_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+// Read-only attribute.
+allowerrorcodes KERRCORRUPT
+VCXMV CheckMediaDetail E_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralDate 3
+VCXMV CheckMediaDetail E_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+allowerrorcodes KERRCORRUPT
+VCXMV CheckMediaDetail E_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV CheckMediaDetail E_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV CheckMediaDetail E_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV CheckMediaDetail E_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+allowerrorcodes KERRCORRUPT
+VCXMV CheckMediaDetail E_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV CheckMediaDetail E_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+VCXMV CheckMediaDetail E_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosDownloadId 0
+
+print OK!
+delete VCXMV
+[Endtest]
+
+[Test]
+title ET30757 Copy multiple
+var CASE ET30757
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create sideloaded video
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video.mp4" 50000 10
+
+VCXMV CheckMediaCount C_DRIVE 10
+VCXMV CheckMediaCount E_DRIVE 0
+
+VCXMV CopyMedias C_DRIVE 0 5 E_DRIVE 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCopyResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCommandComplete
+waittestclass VCXMV
+
+// Get list of all videos
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 10
+VCXMV CheckMediaCount E_DRIVE 5
+
+print OK!
+delete VCXMV
+[Endtest]
+
+[Test]
+title ET30761 Cancel copy
+var CASE ET30761
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video.mp4" 70000 30
+
+VCXMV CheckMediaCount C_DRIVE 30
+VCXMV CheckMediaCount E_DRIVE 0
+
+VCXMV CancelNextOperation
+VCXMV CopyMedias C_DRIVE 0 30 E_DRIVE 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandCanceled
+waittestclass VCXMV
+
+VCXMV CoolDown
+
+// Get list of all videos
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Check that at least few videos have been copied
+VCXMV CheckMaximumMediaCount E_DRIVE 25
+VCXMV CheckMediaCount C_DRIVE 30
+
+print OK!
+delete VCXMV
+[Endtest]
+
+[Test]
+title ET30803 EVcxMyVideosAllVideos - EVcxMyVideosSortingCreationDate
+var CASE ET30803
+
+// Check video sorting
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingCreationDate
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Check count and sort order
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+VCXMV GetAllMediaFullDetails
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+[Test]
+title ET30805 EVcxMyVideosAllVideos - EVcxMyVideosSortingName
+var CASE ET30805
+
+// Check sorting
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingName
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+[Test]
+title ET30806 EVcxMyVideosAllVideos - EVcxMyVideosSortingSize
+var CASE ET30806
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingSize
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+[Test]
+title ET30843 EVcxMyVideosDownloads - EVcxMyVideosSortingName, remove video
+var CASE ET30843
+
+callsub Cleanup
+
+var OPTION_ORIGIN EVcxMyVideosOriginDownloaded
+callsub SetupVideos
+
+// Get videos sorted
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingName
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosDownloads
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Check count and sort order
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+
+// Remove one of them
+
+VCXMV RemoveMedia ANY_DRIVE 1 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 2
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+[Test]
+title ET30846 EVcxMyVideosDownloads - EVcxMyVideosSortingCreationDate, remove video
+var CASE ET30846
+
+callsub Cleanup
+
+var OPTION_ORIGIN EVcxMyVideosOriginDownloaded
+callsub SetupVideos
+
+// Get videos sorted
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingCreationDate
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosDownloads
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+
+// Remove one of them
+
+VCXMV RemoveMedia ANY_DRIVE 1 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 2
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+[Test]
+title ET30848 EVcxMyVideosDownloads - EVcxMyVideosSortingSize, remove video
+var CASE ET30848
+
+callsub Cleanup
+
+var OPTION_ORIGIN EVcxMyVideosOriginDownloaded
+callsub SetupVideos
+
+// Get videos sorted
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingSize
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosDownloads
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+
+// Remove one of them
+
+VCXMV RemoveMedia ANY_DRIVE 1 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 2
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+[Test]
+title ET30879 EVcxMyVideosOther - EVcxMyVideosSortingName, modify video
+var CASE ET30879
+
+callsub Cleanup
+
+var OPTION_ORIGIN EVcxMyVideosOriginOther
+callsub SetupVideos
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingName
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosOther
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Check count and sort order
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+
+// Modify one of the videos and check order
+VCXMV CreateCopyOfMedia ANY_DRIVE 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "x"
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMyVideosTestMessageVideoListOrderChanged KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "x"
+
+// Modify one of the videos and check order
+VCXMV CreateCopyOfMedia ANY_DRIVE 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "0"
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMyVideosTestMessageVideoListOrderChanged KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "0"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "x"
+
+// Modify one of the videos and check order
+VCXMV CreateCopyOfMedia ANY_DRIVE 2
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "1"
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMyVideosTestMessageVideoListOrderChanged KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "0"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "1"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+[Test]
+title ET30884 EVcxMyVideosOther - EVcxMyVideosSortingName, sideload video
+var CASE ET30884
+
+callsub Cleanup
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingName
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create some video objects.
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "video3.mp4" 52000
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "video0.mp4" 50000
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "video2.mp4" 51000
+pause 1000
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginOther
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 1
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginOther
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 2
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginOther
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+delete VCXMV
+
+// Get videos sorted
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingName
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosOther
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "video0"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "video2"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "video3"
+
+// Sideload video
+
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "video1.mp4"
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "video0"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "video1"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "video2"
+VCXMV CheckMediaDetail ANY_DRIVE 3 EVcxTestMapping_KMPXMediaGeneralTitle "video3"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+[Test]
+title ET30051 Setup all origins
+var CASE ET30051
+
+callsub Cleanup
+
+// TESTCASE START
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingName
+
+VCXMV SetFileCheck 0
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create some video objects.
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "a.mp4"
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "b.mp4"
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "c.mp4"
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "d.mp4"
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "e.mp4"
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "f.mp4"
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "g.mp4"
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "h.mp4"
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "i.mp4"
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "j.mp4"
+pause 1000
+
+VCXMV GetAllMediaFullDetails
+
+VCXMV SetAutomaticRefresh 0
+
+// Set 5 videos with new video flag
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "OriginOther"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginOther
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags EVcxMyVideosVideoNew
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDateCurrent
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "OriginCamera"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginCapturedWithCamera
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags EVcxMyVideosVideoNew
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDateCurrent
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 2
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "OriginDownloaded"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginDownloaded
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags EVcxMyVideosVideoNew
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDateCurrent
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 3
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "OriginSideloaded"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginSideLoaded
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags EVcxMyVideosVideoNew
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDateCurrent
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 4
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "OriginRecording"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags EVcxMyVideosVideoNew
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDateCurrent
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+// Set next 5 videos with no flags
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 5
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "OriginOther2"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginOther
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 0
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 6
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "OriginCamera2"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginCapturedWithCamera
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 0
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 7
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "OriginDownloaded2"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginDownloaded
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 0
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 8
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "OriginSideloaded2"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginSideLoaded
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 0
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 9
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "OriginRecording2"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 0
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV SetAutomaticRefresh 1
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV GetAllMediaFullDetails
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CoolDown
+
+delete VCXMV
+
+[Endtest]
+
+[Test]
+title ET30046 All videos - category details
+var CASE ET30046
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageListComplete
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KMPXMediaGeneralTitle "All videos"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 10
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 5
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "OriginRecording"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+[Test]
+title ET30047 Downloads - category details
+var CASE ET30047
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageListComplete
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosDownloads EVcxTestMapping_KMPXMediaGeneralTitle "Downloads"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosDownloads EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 2
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosDownloads EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 1
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosDownloads EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "OriginDownloaded"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+[Test]
+title ET30048 TV recordings - category details
+var CASE ET30048
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageListComplete
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosTvRecordings EVcxTestMapping_KMPXMediaGeneralTitle "TV recordings"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosTvRecordings EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 2
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosTvRecordings EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 1
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosTvRecordings EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "OriginRecording"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+[Test]
+title ET30049 Captured videos - category details
+var CASE ET30049
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageListComplete
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosCapturedVideos EVcxTestMapping_KMPXMediaGeneralTitle "Captured videos"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosCapturedVideos EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 2
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosCapturedVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 1
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosCapturedVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "OriginCamera"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+[Test]
+title ET30050 Other videos - category details
+var CASE ET30050
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageListComplete
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KMPXMediaGeneralTitle "Other"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 4
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 2
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "OriginSideloaded"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+[Test]
+title ET30023 Setup, DL 2, sideload 18
+var CASE ET30023
+
+callsub Cleanup
+
+// TESTCASE START
+
+// Sideload 48 videos and download 2
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "video.mp4" 50000 20
+
+VCXMV CoolDown
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 0 0
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginDownloaded
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 1 0
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginDownloaded
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+delete VCXMV
+
+// Open all videos
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 20
+
+print OK!
+delete VCXMV
+[Endtest]
+
+[Test]
+title ET30024 GetMediasByMpxId - All videos
+var CASE ET30024
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV GetMediasByMpxId 0 20
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageGotMediasByKMpxId
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 20
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+[Test]
+title ET30027 GetMediasByMpxId - Few from middle
+var CASE ET30027
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV GetMediasByMpxId 7 13
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageGotMediasByKMpxId
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 6
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+[Test]
+title <not a test> Setup default memory
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetPreferredMemory E_DRIVE
+delete VCXMV
+print OK!
+[Endtest]
+
+[Test]
+title ET30102 Download 3 videos one by one, 2nd drive
+var CASE ET30102
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetPreferredMemory E_DRIVE
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_SMALLVIDEOS 2 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+VCXMV Download DEFAULT_AP SERVICE_SMALLVIDEOS 3 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+VCXMV Download DEFAULT_AP SERVICE_SMALLVIDEOS 4 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Check video has been loaded, there's one from previous case
+VCXMV CheckMediaCount E_DRIVE 3
+VCXMV CheckMediaCount C_DRIVE 0
+
+print OK!
+delete VCXMV
+[Endtest]
+
+[Test]
+title ET30103 Download and open downloads category
+var CASE ET30103
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Create one sideloaded video
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video CASE 0.mp4"
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Start download
+VCXMV Download DEFAULT_AP SERVICE_2 0 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete
+waittestclass VCXMV // Dl started
+
+// Get list of downloads
+VCXMV OpenLevel EVcxMyVideosDownloads
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlProgressed
+waittestclass VCXMV
+
+// Check that there's a download
+VCXMV CheckMediaCount ANY_DRIVE 1
+
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+VCXMV CoolDown
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Get list of all videos
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Downloaded and sideloaded
+VCXMV CheckMediaCount ANY_DRIVE 2
+
+print OK!
+delete VCXMV
+[Endtest]
+
+[Test]
+title ET30104 Cancel download
+var CASE ET30104
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Start download
+VCXMV Download DEFAULT_AP SERVICE_2 20 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV // Dl started
+
+// Cancel it
+VCXMV CancelDownload SERVICE_2 20 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlCanceled
+waittestclass VCXMV // Dl canceled
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Should be no videos
+VCXMV CheckMediaCount ANY_DRIVE 0
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+[Test]
+title ET30105 Pause download
+var CASE ET30105
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Start download
+VCXMV Download DEFAULT_AP SERVICE_2 20 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV // Command complete
+
+// Pause it
+VCXMV PauseDownload SERVICE_2 20 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlPaused
+waittestclass VCXMV // Dl paused
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+[Test]
+title ET30111 Pause and resume download
+var CASE ET30111
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Start download
+VCXMV Download DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+// Pause it
+VCXMV PauseDownload SERVICE_2 1 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlPaused
+waittestclass VCXMV // Dl paused
+
+VCXMV ResumeDownload DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+[Test]
+title ET30113 Cancel paused download
+var CASE ET30113
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Start download
+VCXMV Download DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV // Command complete
+
+// Pause it
+VCXMV PauseDownload SERVICE_2 1 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlPaused
+waittestclass VCXMV // Dl paused
+
+// Cancel download
+VCXMV CancelDownload SERVICE_2 1 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlCanceled
+waittestclass VCXMV // Dl canceled
+
+VCXMV CheckMediaCount ANY_DRIVE 0
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+[Test]
+title ET30110 Check progress of download
+var CASE ET30110
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning KVCXMYVideosTestMessageDlProgressed KVCXMYVideosTestMessageDlProgressed KVCXMYVideosTestMessageDlProgressed
+waittestclass VCXMV
+
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+[Test]
+title ET30122 Download videos to 2 drives
+var CASE ET30122
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV SetPreferredMemory E_DRIVE
+pause 2000
+
+VCXMV Download DEFAULT_AP SERVICE_2 0 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV // Command complete
+
+VCXMV SetPreferredMemory C_DRIVE
+pause 2000
+
+VCXMV Download DEFAULT_AP SERVICE_SMALLVIDEOS 1 0 "mediacharger" "Buran_9o"
+
+VCXMV WaitAllDownloads
+waittestclass VCXMV
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Check video has been loaded, there's one from previous case
+VCXMV CheckMediaCount E_DRIVE 1
+VCXMV CheckMediaCount C_DRIVE 1
+
+print OK!
+delete VCXMV
+[Endtest]
+
+[Test]
+title <not a test> Setup default memory
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetPreferredMemory E_DRIVE
+delete VCXMV
+print OK!
+[Endtest]
+
+[Test]
+title ET30317 Download 404
+var CASE ET30317
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV DownloadUrl DEFAULT_AP "http:\/\/193.65.182.78/asdfsdafasasdf.mp3" 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+allownextresult EObjectNotFound
+waittestclass VCXMV // Dl complete
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+[Test]
+title ET30302 Download, connection disconnects
+var CASE ET30302
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// Test
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetAutoResume 0
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 20 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV // Dl started
+
+loop 3
+Util WaitForConnectionActivity DEFAULT_AP
+allowerrorcodes KERRTIMEDOUT
+waittestclass Util
+allowerrorcodes KERRNOTFOUND
+allowerrorcodes KERRALREADYEXISTS
+Util Attach DEFAULT_AP
+allowerrorcodes KERRNOTREADY
+Util Terminate
+endloop
+
+VCXMV CoolDown
+
+delete VCXMV
+[Endtest]
+
+[Test]
+title ET30653 3 downloads, Cancel first download
+var CASE ET30653
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetPreferredMemory E_DRIVE
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 20 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 2 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+// Cancel download
+VCXMV CancelDownload SERVICE_2 20 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlCanceled
+waittestclass VCXMV // Dl canceled
+
+VCXMV WaitAllDownloads
+waittestclass VCXMV
+
+VCXMV CheckMediaCount E_DRIVE 2
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+[Test]
+title ET30658 3 downloads, Pause and resume second download
+var CASE ET30658
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetPreferredMemory E_DRIVE
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 0 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 2 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+// Pause download
+VCXMV PauseDownload SERVICE_2 0 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlPaused
+waittestclass VCXMV
+
+VCXMV ResumeDownload DEFAULT_AP SERVICE_2 0 0 "mediacharger" "Buran_9o"
+
+VCXMV WaitAllDownloads
+waittestclass VCXMV
+
+VCXMV CheckMediaCount E_DRIVE 3
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+[Test]
+title ET30661 3 downloads, pause 1st, cancel 2nd, wait 3rd, resume 1st
+var CASE ET30661
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetPreferredMemory E_DRIVE
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 20 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 2 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV PauseDownload SERVICE_2 1 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlPaused
+waittestclass VCXMV
+
+VCXMV CancelDownload SERVICE_2 20 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlCanceled
+waittestclass VCXMV
+
+VCXMV WaitAllDownloads
+waittestclass VCXMV
+
+VCXMV ResumeDownload DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+
+VCXMV WaitAllDownloads
+waittestclass VCXMV
+
+VCXMV CheckMediaCount E_DRIVE 2
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXMyVideosCollectionPluginTestLists.cfg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,2528 @@
+#-----------------------------------------------------------------------------------
+#
+# STIF test script file for testing VCXMyVideosCollectionPluginTest.dll
+#
+# Tests functionality for category video lists.
+#
+#-----------------------------------------------------------------------------------
+
+[StifSettings]
+CapsModifier= IptvTestClientApiCapsMod.exe
+[EndStifSettings]
+
+[Define]
+INCLUDE c:\TestFramework\VCXMVCollectionPluginTest.inc
+INCLUDE c:\TestFramework\VCXDrives.inc
+INCLUDE c:\TestFramework\VCXConsts.inc
+INCLUDE c:\TestFramework\VCXErrors.inc
+[Enddefine]
+
+#************************************************************************************
+# Sub Cleanup
+# Removes all videos from the phone. Collection is opened.
+#************************************************************************************
+[Sub Cleanup]
+print cleanup start
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV RemoveAllMedia
+delete VCXMV
+
+print wait 30sec
+pause 30000
+print cleanup end
+[EndSub]
+
+#************************************************************************************
+# Sub SetupVideos
+#  Creates 5 videos with defined origin. List will be:
+#
+# a.mp4
+# b.mp4
+# c.mp4
+# d.mp4
+# e.mp4
+#
+# 2nd and 4th videos have new flag set.
+#************************************************************************************
+[Sub SetupVideos]
+
+callsub Cleanup
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingName
+
+VCXMV SetFileCheck 0
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create some video objects.
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "a.mp4"
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "b.mp4"
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "c.mp4"
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "d.mp4"
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "e.mp4"
+
+pause 10000
+
+VCXMV GetAllMediaFullDetails
+
+VCXMV SetAutomaticRefresh 0
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin ORIGIN
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 0
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 1
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin ORIGIN
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDateCurrent
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags EVcxMyVideosVideoNew
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 2
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin ORIGIN
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 0
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 3
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin ORIGIN
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDateCurrent
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags EVcxMyVideosVideoNew
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 4
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin ORIGIN
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 0
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+delete VCXMV
+[EndSub]
+
+#------------------------------------------------------------------------------------
+#
+#  Does configuration for cases in this script.
+#  Creates 'Internet' IAP into 'Internet' destination and sets connection as authorized.
+#  Sets preferred memory to first used drive and sorting order to none.
+#  Removes all video files from the device.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30000 <not a test> Setup
+
+create VCXTestUtilModule Util
+// Copies some known 3G AP to "Internet" destination with "Internet" name for the AP.
+Util CopyMethod "Internet" "Internet" "Internet"
+// Disable connection dialog for "Internet" destination.
+Util SetConnectionMethodIntAttribute "Internet" "Internet" 507 2 // 507 is ECmSeamlessnessLevel
+delete Util
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetPreferredMemory E_DRIVE
+VCXMV SetSortingOrder EVcxMyVideosSortingNone
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV RemoveAllMedia
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 0
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests opening 'All videos' category when it's empty.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30002 All videos - empty
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 0
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests opening 'Downloads' category when it's empty.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30003 Downloads - empty
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosDownloads
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 0
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests opening 'TV Recordings' category when it's empty.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30004 TV recordings - empty
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosTvRecordings
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 0
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests opening 'Captured videos' category when it's empty.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30005 Captured videos - empty
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosCapturedVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 0
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests opening 'Other videos' category when it's empty.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30006 Other videos - empty
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosOther
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 0
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Creates five video files, one for every origin. This case is needed by following cases.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30007 Setup all origins
+
+callsub Cleanup
+
+// TESTCASE START
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingName
+
+VCXMV SetFileCheck 0
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create some video objects.
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "a.mp4"
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "b.mp4"
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "c.mp4"
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "d.mp4"
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "e.mp4"
+pause 1000
+
+VCXMV SetAutomaticRefresh 0
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "OriginOther"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginOther
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "OriginCamera"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginCapturedWithCamera
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 2
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "OriginDownloaded"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginDownloaded
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 3
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "OriginSideloaded"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginSideLoaded
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 4
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "OriginRecording"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV SetAutomaticRefresh 1
+
+VCXMV GetAllMediaFullDetails
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests opening 'All videos' category when device has videos with different origins.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30008 All videos - all origins
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetFileCheck 0
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 5
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests opening 'Downloads' category when device has videos with different origins.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30010 Downloads - all origins
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetFileCheck 0
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosDownloads
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "OriginDownloaded"
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests opening 'TV recordings' category when device has videos with different origins.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30011 TV recordings - all origins
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetFileCheck 0
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosTvRecordings
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "OriginRecording"
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests opening 'Captured videos' category when device has videos with different origins.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30012 Captured videos - all origins
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetFileCheck 0
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosCapturedVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "OriginCamera"
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests opening 'Other videos' category when device has videos with different origins.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30013 Other videos - all origins
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetFileCheck 0
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosOther
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 2
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "OriginOther"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "OriginSideloaded"
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Creates two videos for each different origin, one with new flag and one without.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30051 Setup all origins
+
+callsub Cleanup
+
+// TESTCASE START
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingName
+
+VCXMV SetFileCheck 0
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create some video objects.
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "a.mp4"
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "b.mp4"
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "c.mp4"
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "d.mp4"
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "e.mp4"
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "f.mp4"
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "g.mp4"
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "h.mp4"
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "i.mp4"
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "j.mp4"
+pause 1000
+
+VCXMV GetAllMediaFullDetails
+
+VCXMV SetAutomaticRefresh 0
+
+// Set 5 videos with new video flag
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "OriginOther"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginOther
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags EVcxMyVideosVideoNew
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDateCurrent
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "OriginCamera"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginCapturedWithCamera
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags EVcxMyVideosVideoNew
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDateCurrent
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 2
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "OriginDownloaded"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginDownloaded
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags EVcxMyVideosVideoNew
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDateCurrent
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 3
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "OriginSideloaded"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginSideLoaded
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags EVcxMyVideosVideoNew
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDateCurrent
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 4
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "OriginRecording"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags EVcxMyVideosVideoNew
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDateCurrent
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+// Set next 5 videos with no flags
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 5
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "OriginOther2"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginOther
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 0
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 6
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "OriginCamera2"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginCapturedWithCamera
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 0
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 7
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "OriginDownloaded2"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginDownloaded
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 0
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 8
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "OriginSideloaded2"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginSideLoaded
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 0
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 9
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "OriginRecording2"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 0
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV SetAutomaticRefresh 1
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV GetAllMediaFullDetails
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CoolDown
+
+delete VCXMV
+
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that category 'All videos' has correct details when there's videos with different origins.
+#
+# Preconditions: Case ET30051 run succesfully.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30046 All videos - category details
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageListComplete
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KMPXMediaGeneralTitle "All videos"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 10
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 5
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "OriginRecording"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that category 'Downloads' has correct details when there's videos with different origins.
+#
+# Preconditions: Case ET30051 run succesfully.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30047 Downloads - category details
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageListComplete
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosDownloads EVcxTestMapping_KMPXMediaGeneralTitle "Downloads"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosDownloads EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 2
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosDownloads EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 1
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosDownloads EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "OriginDownloaded"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that category 'TV recorgins' has correct details when there's videos with different origins.
+#
+# Preconditions: Case ET30051 run succesfully.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30048 TV recordings - category details
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageListComplete
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosTvRecordings EVcxTestMapping_KMPXMediaGeneralTitle "TV recordings"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosTvRecordings EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 2
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosTvRecordings EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 1
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosTvRecordings EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "OriginRecording"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that category 'Captured videos' has correct details when there's videos with different origins.
+#
+# Preconditions: Case ET30051 run succesfully.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30049 Captured videos - category details
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageListComplete
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosCapturedVideos EVcxTestMapping_KMPXMediaGeneralTitle "Captured videos"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosCapturedVideos EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 2
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosCapturedVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 1
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosCapturedVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "OriginCamera"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that category 'Other videos' has correct details when there's videos with different origins.
+#
+# Preconditions: Case ET30051 run succesfully.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30050 Other videos - category details
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageListComplete
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KMPXMediaGeneralTitle "Other"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 4
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 2
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "OriginSideloaded"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that category 'Other videos' details are updated when videos are deleted.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30052 Other videos - video is deleted, category details
+
+var ORIGIN EVcxMyVideosOriginOther
+callsub SetupVideos
+
+// Create client to modify videos.
+create VCXMyVideosCollectionPluginTest VCXMV2
+VCXMV2 Create
+VCXMV2 OpenCollection VCXCollectionMyVideos
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV2
+VCXMV2 OpenLevel EVcxMyVideosAllVideos
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV2
+
+// And second client to check categories.
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KMPXMediaGeneralTitle "Other"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 5
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 2
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "d"
+
+// Delete last media, it doesn't have new flag.
+VCXMV2 DeleteMedia ANY_DRIVE 4 0
+
+VCXMV CoolDown
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KMPXMediaGeneralTitle "Other"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 4
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 2
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "d"
+
+// Delete last media, it has new flag.
+VCXMV2 DeleteMedia ANY_DRIVE 3 0
+
+VCXMV CoolDown
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KMPXMediaGeneralTitle "Other"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 3
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 1
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "b"
+
+print OK!
+delete VCXMV
+delete VCXMV2
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that category 'Other videos' details are updated when videos are added by sideloading.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30053 Other videos - video is sideloaded, category details
+
+var ORIGIN EVcxMyVideosOriginOther
+callsub SetupVideos
+
+// Create client to modify videos.
+create VCXMyVideosCollectionPluginTest VCXMV2
+VCXMV2 Create
+VCXMV2 OpenCollection VCXCollectionMyVideos
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV2
+VCXMV2 OpenLevel EVcxMyVideosAllVideos
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV2
+
+// And second client to check categories.
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KMPXMediaGeneralTitle "Other"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 5
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 2
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "d"
+
+VCXMV2 CreateVideoFile IptvTestVideo3Gp C_DRIVE "1.mp4"
+pause 500
+VCXMV2 CreateVideoFile IptvTestVideo3Gp C_DRIVE "2.mp4"
+pause 5000
+VCXMV2 CreateVideoFile IptvTestVideo3Gp C_DRIVE "3.mp4"
+
+VCXMV CoolDown
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KMPXMediaGeneralTitle "Other"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 8
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 5
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "3"
+
+print OK!
+delete VCXMV
+delete VCXMV2
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that category 'Other videos' details are updated when videos are moved.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30054 Other videos - video is moved, category details
+
+var ORIGIN EVcxMyVideosOriginOther
+callsub SetupVideos
+
+// Create client to modify videos.
+create VCXMyVideosCollectionPluginTest VCXMV2
+VCXMV2 Create
+VCXMV2 OpenCollection VCXCollectionMyVideos
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV2
+VCXMV2 OpenLevel EVcxMyVideosAllVideos
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV2
+
+// And second client to check categories.
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KMPXMediaGeneralTitle "Other"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 5
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 2
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "d"
+
+// Move video with no new flag.
+VCXMV2 MoveMedia C_DRIVE 4 E_DRIVE 0
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageMoveResp KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCopyOrMoveStarted
+waittestclass VCXMV2
+
+VCXMV CoolDown
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KMPXMediaGeneralTitle "Other"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 5
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 2
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "d"
+
+// Move video with new flag.
+VCXMV2 MoveMedia C_DRIVE 3 E_DRIVE 0
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageMoveResp KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCopyOrMoveStarted
+waittestclass VCXMV2
+
+VCXMV CoolDown
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KMPXMediaGeneralTitle "Other"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 5
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 2
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "d"
+
+print OK!
+delete VCXMV
+delete VCXMV2
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that category 'Other videos' details are updated when videos are copied.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30055 Other videos - video is copied, category details
+
+var ORIGIN EVcxMyVideosOriginOther
+callsub SetupVideos
+
+// Create client to modify videos.
+create VCXMyVideosCollectionPluginTest VCXMV2
+VCXMV2 Create
+VCXMV2 OpenCollection VCXCollectionMyVideos
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV2
+VCXMV2 OpenLevel EVcxMyVideosAllVideos
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV2
+
+// And second client to check categories.
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KMPXMediaGeneralTitle "Other"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 5
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 2
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "d"
+
+// Copy video with no new flag.
+VCXMV2 CopyMedia C_DRIVE 4 E_DRIVE 0
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCopyResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCollectionItemChanged KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCollectionCategoryChanged
+waittestclass VCXMV2
+
+VCXMV CoolDown
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KMPXMediaGeneralTitle "Other"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 6
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 2
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "d"
+
+// Copy video with new flag.
+VCXMV2 CopyMedia C_DRIVE 1 E_DRIVE 0
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCopyResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCollectionItemChanged KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCollectionCategoryChanged
+waittestclass VCXMV2
+
+VCXMV CoolDown
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KMPXMediaGeneralTitle "Other"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 7
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 3
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "b"
+
+print OK!
+delete VCXMV
+delete VCXMV2
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that category 'Other videos' details are updated when videos are removed.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30056 Other videos - video is removed, category details
+
+var ORIGIN EVcxMyVideosOriginOther
+callsub SetupVideos
+
+// Create client to modify videos.
+create VCXMyVideosCollectionPluginTest VCXMV2
+VCXMV2 Create
+VCXMV2 OpenCollection VCXCollectionMyVideos
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV2
+VCXMV2 OpenLevel EVcxMyVideosAllVideos
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV2
+
+// And second client to check categories.
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KMPXMediaGeneralTitle "Other"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 5
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 2
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "d"
+
+// Delete last media, it doesn't have new flag.
+VCXMV2 RemoveMedia ANY_DRIVE 4 0
+VCXMV2 CoolDown
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KMPXMediaGeneralTitle "Other"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 4
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 2
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "d"
+
+// Delete last media, it has new flag.
+VCXMV2 RemoveMedia ANY_DRIVE 3 0
+VCXMV2 CoolDown
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KMPXMediaGeneralTitle "Other"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 3
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 1
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "b"
+
+print OK!
+delete VCXMV
+delete VCXMV2
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that category 'Other videos' details are updated when the file of a video deleted.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30057 Other videos - video file is deleted, category details
+
+var ORIGIN EVcxMyVideosOriginOther
+callsub SetupVideos
+
+// Create client to modify videos.
+create VCXMyVideosCollectionPluginTest VCXMV2
+VCXMV2 Create
+VCXMV2 OpenCollection VCXCollectionMyVideos
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV2
+VCXMV2 OpenLevel EVcxMyVideosAllVideos
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV2
+
+// And second client to check categories.
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KMPXMediaGeneralTitle "Other"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 5
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 2
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "d"
+
+// Delete last media, it doesn't have new flag.
+VCXMV2 DeleteFileOfMedia ANY_DRIVE 4
+VCXMV2 CoolDown
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KMPXMediaGeneralTitle "Other"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 4
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 2
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "d"
+
+// Delete last media, it has new flag.
+VCXMV2 DeleteFileOfMedia ANY_DRIVE 3
+VCXMV2 CoolDown
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KMPXMediaGeneralTitle "Other"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 3
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 1
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "b"
+
+print OK!
+delete VCXMV
+delete VCXMV2
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that category 'Other videos' details are updated when new flag of a video is modified.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30058 Other videos - video new flag is modified, category details
+
+var ORIGIN EVcxMyVideosOriginOther
+callsub SetupVideos
+
+// Create client to modify videos.
+create VCXMyVideosCollectionPluginTest VCXMV2
+VCXMV2 Create
+VCXMV2 OpenCollection VCXCollectionMyVideos
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV2
+VCXMV2 OpenLevel EVcxMyVideosAllVideos
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV2
+
+// And second client to check categories.
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KMPXMediaGeneralTitle "Other"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 5
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 2
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "d"
+
+// Set new flag off for a media.
+VCXMV2 CreateCopyOfMedia ANY_DRIVE 3
+VCXMV2 SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 0
+VCXMV2 SetMedia 1
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV2
+
+VCXMV CoolDown
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KMPXMediaGeneralTitle "Other"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 5
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 1
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "b"
+
+// Set new flag on for another media.
+VCXMV2 CreateCopyOfMedia ANY_DRIVE 4
+VCXMV2 SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags EVcxMyVideosVideoNew
+VCXMV2 SetMedia 1
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV2
+
+VCXMV CoolDown
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KMPXMediaGeneralTitle "Other"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 5
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 2
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosOther EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "e"
+
+print OK!
+delete VCXMV
+delete VCXMV2
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that category 'Downloads' details are updated when video is downloaded.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30059 Downloads - video is downloaded, category details
+
+var ORIGIN EVcxMyVideosOriginDownloaded
+callsub SetupVideos
+
+// Create client to modify videos.
+create VCXMyVideosCollectionPluginTest VCXMV2
+VCXMV2 Create
+VCXMV2 OpenCollection VCXCollectionMyVideos
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV2
+VCXMV2 OpenLevel EVcxMyVideosAllVideos
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV2
+
+// And second client to check categories.
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosDownloads EVcxTestMapping_KMPXMediaGeneralTitle "Downloads"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosDownloads EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 5
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosDownloads EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 2
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosDownloads EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "d"
+
+// Check category details when download is ongoing.
+VCXMV2 Download 3G_AP SERVICE_2 0 0 "mediacharger" "Buran_9o"
+VCXMV2 WaitForMessages 5MINUTES KVCXMYVideosTestMessageDlRunning
+
+VCXMV CoolDown
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosDownloads EVcxTestMapping_KMPXMediaGeneralTitle "Downloads"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosDownloads EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 6
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosDownloads EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 3
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosDownloads EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "enginetest0_6megs"
+
+// Check category details after download is ready.
+VCXMV2 WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV2 // Dl complete
+
+VCXMV CoolDown
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosDownloads EVcxTestMapping_KMPXMediaGeneralTitle "Downloads"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosDownloads EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 6
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosDownloads EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 3
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosDownloads EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "enginetest0_6megs"
+
+print OK!
+delete VCXMV
+delete VCXMV2
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that category 'Downloads' details are updated when download is canceled.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30060 Downloads - download is canceled, category details
+
+var ORIGIN EVcxMyVideosOriginDownloaded
+callsub SetupVideos
+
+// Create client to modify videos.
+create VCXMyVideosCollectionPluginTest VCXMV2
+VCXMV2 Create
+VCXMV2 OpenCollection VCXCollectionMyVideos
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV2
+VCXMV2 OpenLevel EVcxMyVideosAllVideos
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV2
+
+// And second client to check categories.
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosDownloads EVcxTestMapping_KMPXMediaGeneralTitle "Downloads"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosDownloads EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 5
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosDownloads EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 2
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosDownloads EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "d"
+
+// Check category details when download is ongoing.
+VCXMV2 Download 3G_AP SERVICE_2 20 0 "mediacharger" "Buran_9o"
+//VCXMV2 WaitForMessages 5MINUTES KVCXMYVideosTestMessageDlRunning
+//waittestclass VCXMV2
+
+VCXMV CoolDown
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosDownloads EVcxTestMapping_KMPXMediaGeneralTitle "Downloads"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosDownloads EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 6
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosDownloads EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 3
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosDownloads EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "enginetest20_13megs"
+
+// Check category details after download is canceled.
+VCXMV2 CancelDownload SERVICE_2 20 0
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlCanceled
+waittestclass VCXMV2
+
+VCXMV CoolDown
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosDownloads EVcxTestMapping_KMPXMediaGeneralTitle "Downloads"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosDownloads EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 5
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosDownloads EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 2
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosDownloads EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "d"
+
+print OK!
+delete VCXMV
+delete VCXMV2
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that category 'All videos' details are updated when video is deleted.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30061 All videos - video is deleted, category details
+
+var ORIGIN EVcxMyVideosOriginOther
+callsub SetupVideos
+
+// Create client to modify videos.
+create VCXMyVideosCollectionPluginTest VCXMV2
+VCXMV2 Create
+VCXMV2 OpenCollection VCXCollectionMyVideos
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV2
+VCXMV2 OpenLevel EVcxMyVideosAllVideos
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV2
+
+// And second client to check categories.
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KMPXMediaGeneralTitle "All videos"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 5
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 2
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "d"
+
+// Delete last media, it doesn't have new flag.
+VCXMV2 DeleteMedia ANY_DRIVE 4 0
+
+VCXMV CoolDown
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KMPXMediaGeneralTitle "All videos"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 4
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 2
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "d"
+
+// Delete last media, it has new flag.
+VCXMV2 DeleteMedia ANY_DRIVE 3 0
+
+VCXMV CoolDown
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KMPXMediaGeneralTitle "All videos"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 3
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 1
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "b"
+
+print OK!
+delete VCXMV
+delete VCXMV2
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that category 'All videos' details are updated when video is added by sideloading.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30062 All videos - video is sideloaded, category details
+
+var ORIGIN EVcxMyVideosOriginOther
+callsub SetupVideos
+
+// Create client to modify videos.
+create VCXMyVideosCollectionPluginTest VCXMV2
+VCXMV2 Create
+VCXMV2 OpenCollection VCXCollectionMyVideos
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV2
+VCXMV2 OpenLevel EVcxMyVideosAllVideos
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV2
+
+// And second client to check categories.
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KMPXMediaGeneralTitle "All videos"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 5
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 2
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "d"
+
+VCXMV2 CreateVideoFile IptvTestVideo3Gp C_DRIVE "1.mp4"
+pause 500
+VCXMV2 CreateVideoFile IptvTestVideo3Gp C_DRIVE "2.mp4"
+pause 5000
+VCXMV2 CreateVideoFile IptvTestVideo3Gp C_DRIVE "3.mp4"
+
+VCXMV CoolDown
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KMPXMediaGeneralTitle "All videos"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 8
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 5
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "3"
+
+print OK!
+delete VCXMV
+delete VCXMV2
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that category 'All videos' details are updated when video is moved.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30063 All videos - video is moved, category details
+
+var ORIGIN EVcxMyVideosOriginOther
+callsub SetupVideos
+
+// Create client to modify videos.
+create VCXMyVideosCollectionPluginTest VCXMV2
+VCXMV2 Create
+VCXMV2 OpenCollection VCXCollectionMyVideos
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV2
+VCXMV2 OpenLevel EVcxMyVideosAllVideos
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV2
+
+// And second client to check categories.
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KMPXMediaGeneralTitle "All videos"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 5
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 2
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "d"
+
+// Move video with no new flag.
+VCXMV2 MoveMedia C_DRIVE 4 E_DRIVE 0
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageMoveResp KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCopyOrMoveStarted
+waittestclass VCXMV2
+
+VCXMV CoolDown
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KMPXMediaGeneralTitle "All videos"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 5
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 2
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "d"
+
+// Move video with new flag.
+VCXMV2 MoveMedia C_DRIVE 3 E_DRIVE 0
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageMoveResp KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCopyOrMoveStarted
+waittestclass VCXMV2
+
+VCXMV CoolDown
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KMPXMediaGeneralTitle "All videos"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 5
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 2
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "d"
+
+print OK!
+delete VCXMV
+delete VCXMV2
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that category 'All videos' details are updated when video is copied.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30064 All videos - video is copied, category details
+
+var ORIGIN EVcxMyVideosOriginOther
+callsub SetupVideos
+
+// Create client to modify videos.
+create VCXMyVideosCollectionPluginTest VCXMV2
+VCXMV2 Create
+VCXMV2 OpenCollection VCXCollectionMyVideos
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV2
+VCXMV2 OpenLevel EVcxMyVideosAllVideos
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV2
+
+// And second client to check categories.
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KMPXMediaGeneralTitle "All videos"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 5
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 2
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "d"
+
+// Copy video with no new flag.
+VCXMV2 CopyMedia C_DRIVE 4 E_DRIVE 0
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCopyResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCollectionItemChanged KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCollectionCategoryChanged
+waittestclass VCXMV2
+
+VCXMV CoolDown
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KMPXMediaGeneralTitle "All videos"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 6
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 2
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "d"
+
+// Copy video with new flag.
+VCXMV2 CopyMedia C_DRIVE 1 E_DRIVE 0
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCopyResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCollectionItemChanged KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCollectionCategoryChanged
+waittestclass VCXMV2
+
+VCXMV CoolDown
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KMPXMediaGeneralTitle "All videos"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 7
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 3
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "b"
+
+print OK!
+delete VCXMV
+delete VCXMV2
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that category 'All videos' details are updated when video is removed.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30065 All videos - video is removed, category details
+
+var ORIGIN EVcxMyVideosOriginOther
+callsub SetupVideos
+
+// Create client to modify videos.
+create VCXMyVideosCollectionPluginTest VCXMV2
+VCXMV2 Create
+VCXMV2 OpenCollection VCXCollectionMyVideos
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV2
+VCXMV2 OpenLevel EVcxMyVideosAllVideos
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV2
+
+// And second client to check categories.
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KMPXMediaGeneralTitle "All videos"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 5
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 2
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "d"
+
+// Delete last media, it doesn't have new flag.
+VCXMV2 RemoveMedia ANY_DRIVE 4 0
+VCXMV2 CoolDown
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KMPXMediaGeneralTitle "All videos"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 4
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 2
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "d"
+
+// Delete last media, it has new flag.
+VCXMV2 RemoveMedia ANY_DRIVE 3 0
+VCXMV2 CoolDown
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KMPXMediaGeneralTitle "All videos"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 3
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 1
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "b"
+
+print OK!
+delete VCXMV
+delete VCXMV2
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that category 'All videos' details are updated when file of a video is deleted.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30066 All videos - video file is deleted, category details
+
+var ORIGIN EVcxMyVideosOriginOther
+callsub SetupVideos
+
+// Create client to modify videos.
+create VCXMyVideosCollectionPluginTest VCXMV2
+VCXMV2 Create
+VCXMV2 OpenCollection VCXCollectionMyVideos
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV2
+VCXMV2 OpenLevel EVcxMyVideosAllVideos
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV2
+
+// And second client to check categories.
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KMPXMediaGeneralTitle "All videos"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 5
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 2
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "d"
+
+// Delete last media, it doesn't have new flag.
+VCXMV2 DeleteFileOfMedia ANY_DRIVE 4
+VCXMV2 CoolDown
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KMPXMediaGeneralTitle "All videos"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 4
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 2
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "d"
+
+// Delete last media, it has new flag.
+VCXMV2 DeleteFileOfMedia ANY_DRIVE 3
+VCXMV2 CoolDown
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KMPXMediaGeneralTitle "All videos"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 3
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 1
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "b"
+
+print OK!
+delete VCXMV
+delete VCXMV2
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that category 'All videos' details are updated when new flag of a video is modified.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30067 All videos - video new flag is modified, category details
+
+var ORIGIN EVcxMyVideosOriginOther
+callsub SetupVideos
+
+// Create client to modify videos.
+create VCXMyVideosCollectionPluginTest VCXMV2
+VCXMV2 Create
+VCXMV2 OpenCollection VCXCollectionMyVideos
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV2
+VCXMV2 OpenLevel EVcxMyVideosAllVideos
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV2
+
+// And second client to check categories.
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KMPXMediaGeneralTitle "All videos"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 5
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 2
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "d"
+
+// Set new flag off for a media.
+VCXMV2 CreateCopyOfMedia ANY_DRIVE 3
+VCXMV2 SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 0
+VCXMV2 SetMedia 1
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV2
+
+VCXMV CoolDown
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KMPXMediaGeneralTitle "All videos"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 5
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 1
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "b"
+
+// Set new flag on for another media.
+VCXMV2 CreateCopyOfMedia ANY_DRIVE 4
+VCXMV2 SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags EVcxMyVideosVideoNew
+VCXMV2 SetMedia 1
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV2
+
+VCXMV CoolDown
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KMPXMediaGeneralTitle "All videos"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 5
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 2
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "e"
+
+print OK!
+delete VCXMV
+delete VCXMV2
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that category 'All videos' details are updated when video is downloaded.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30068 All videos - video is downloaded, category details
+
+var ORIGIN EVcxMyVideosOriginOther
+callsub SetupVideos
+
+// Create client to modify videos.
+create VCXMyVideosCollectionPluginTest VCXMV2
+VCXMV2 Create
+VCXMV2 OpenCollection VCXCollectionMyVideos
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV2
+VCXMV2 OpenLevel EVcxMyVideosAllVideos
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV2
+
+// And second client to check categories.
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KMPXMediaGeneralTitle "All videos"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 5
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 2
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "d"
+
+// Check category details when download is ongoing.
+VCXMV2 Download 3G_AP SERVICE_2 0 0 "mediacharger" "Buran_9o"
+VCXMV2 WaitForMessages 5MINUTES KVCXMYVideosTestMessageDlRunning
+
+VCXMV CoolDown
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KMPXMediaGeneralTitle "All videos"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 6
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 3
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "enginetest0_6megs"
+
+// Check category details after download is ready.
+VCXMV2 WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV2 // Dl complete
+
+VCXMV CoolDown
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KMPXMediaGeneralTitle "All videos"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 6
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 3
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "enginetest0_6megs"
+
+print OK!
+delete VCXMV
+delete VCXMV2
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that category 'All videos' details are updated when download is canceled.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30069 All videos - download is canceled, category details
+
+var ORIGIN EVcxMyVideosOriginOther
+callsub SetupVideos
+
+// Create client to modify videos.
+create VCXMyVideosCollectionPluginTest VCXMV2
+VCXMV2 Create
+VCXMV2 OpenCollection VCXCollectionMyVideos
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV2
+VCXMV2 OpenLevel EVcxMyVideosAllVideos
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV2
+
+// And second client to check categories.
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KMPXMediaGeneralTitle "All videos"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 5
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 2
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "d"
+
+// Check category details when download is ongoing.
+VCXMV2 Download 3G_AP SERVICE_2 0 0 "mediacharger" "Buran_9o"
+VCXMV2 WaitForMessages 5MINUTES KVCXMYVideosTestMessageDlRunning
+
+VCXMV CoolDown
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KMPXMediaGeneralTitle "All videos"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 6
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 3
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "enginetest0_6megs"
+
+// Check category details after download is canceled.
+VCXMV2 CancelDownload SERVICE_2 0 0
+VCXMV2 WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlCanceled
+waittestclass VCXMV2
+
+VCXMV CoolDown
+
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KMPXMediaGeneralTitle "All videos"
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 5
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 2
+VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosAllVideos EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "d"
+
+print OK!
+delete VCXMV
+delete VCXMV2
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  This is a setup case for following cases by downloading and sideloading videos.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30014 Download and sideload video, setup
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "video0.mp4"
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download 3G_AP SERVICE_SMALLVIDEOS 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+VCXMV Download 3G_AP SERVICE_SMALLVIDEOS 2 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests count of videos for category 'All videos' when device has downloaded and sideloaded videos.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30015 All videos - downloaded
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests count of videos for category 'Downloads' when device has downloaded and sideloaded videos.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30016 Downloads - downloaded
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosDownloads
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 2
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginDownloaded
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginDownloaded
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests count of videos for category 'TV recordings' when device has downloaded and sideloaded videos.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30017 TV recordings - downloaded
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosTvRecordings
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 0
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests count of videos for category 'Captured videos' when device has downloaded and sideloaded videos.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30018 Captured videos - downloaded
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosCapturedVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 0
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests count of videos for category 'Other videos' when device has downloaded and sideloaded videos.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30019 Other videos - downloaded
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosOther
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginOther
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests getting medias by their MPX IDs when the request is set to have empty list.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30032 GetMediasByMpxId - Empty list when no videos
+
+callsub Cleanup
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV GetMediasByMpxId 0 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageGotMediasByKMpxId
+allownextresult KERRARGUMENT
+waittestclass VCXMV
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests getting medias by their MPX IDs when the request has invalid IDs.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30033 GetMediasByMpxId - Invalid IDs when no videos
+
+callsub Cleanup
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV GetMediasByMpxId -1 10
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageGotMediasByKMpxId
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 0
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  This is a setup case for following cases.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30023 Setup, DL 2, sideload 18
+
+callsub Cleanup
+
+// TESTCASE START
+
+// Sideload 48 videos and download 2
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "video.mp4" 50000 20
+
+VCXMV CoolDown
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 0 0
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginDownloaded
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 1 0
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginDownloaded
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+delete VCXMV
+
+// Open all videos
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 20
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests getting medias by their MPX IDs when request has IDs of all the videos in the device.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30024 GetMediasByMpxId - All videos
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV GetMediasByMpxId 0 20
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageGotMediasByKMpxId
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 20
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests getting medias by their MPX IDs when the request has only the ID of first video.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30025 GetMediasByMpxId - First only
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV GetMediasByMpxId 0 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageGotMediasByKMpxId
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests getting medias by their MPX IDs when the request has only the ID of last video.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30026 GetMediasByMpxId - Last only
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV GetMediasByMpxId 19 20
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageGotMediasByKMpxId
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests getting medias by their MPX IDs when the request has few IDs of videos.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30027 GetMediasByMpxId - Few from middle
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV GetMediasByMpxId 7 13
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageGotMediasByKMpxId
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 6
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests getting medias by their MPX IDs when the request has no IDs.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30028 GetMediasByMpxId - Empty list
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV GetMediasByMpxId 0 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageGotMediasByKMpxId
+allownextresult KERRARGUMENT
+waittestclass VCXMV
+
+VCXMV GetMediasByMpxId 0 8
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageGotMediasByKMpxId
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 8
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests getting medias by their MPX IDs when the request has invalid IDs.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30029 GetMediasByMpxId - Invalid IDs
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV GetMediasByMpxId -1 10
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageGotMediasByKMpxId
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 0
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests getting medias by their MPX IDs when the request has duplicate IDs.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30030 GetMediasByMpxId - Duplicate IDs
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV GetMediasByMpxId -2 5
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageGotMediasByKMpxId
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 10
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests getting medias by their MPX IDs when the request has every second ID of the videos in device.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30031 GetMediasByMpxId - Every second item
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV GetMediasByMpxId -3 10
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageGotMediasByKMpxId
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 5
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+print OK!
+delete VCXMV
+[Endtest]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXMyVideosCollectionPluginTestMediator.cfg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,906 @@
+#-----------------------------------------------------------------------------------
+#
+# STIF test script file for testing VCXMyVideosCollectionPluginTest.dll
+#
+# Tests that correct mediator events are sent in different operations.
+#
+#-----------------------------------------------------------------------------------
+
+[StifSettings]
+CapsModifier= IptvTestClientApiCapsMod.exe
+[EndStifSettings]
+
+[Define]
+INCLUDE c:\TestFramework\VCXMVCollectionPluginTest.inc
+INCLUDE c:\TestFramework\VCXDrives.inc
+INCLUDE c:\TestFramework\VCXConsts.inc
+INCLUDE c:\TestFramework\VCXErrors.inc
+[Enddefine]
+
+#************************************************************************************
+# Sub Cleanup
+# Removes all videos from the phone. Collection is opened.
+#************************************************************************************
+[Sub Cleanup]
+print cleanup start
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV RemoveAllMedia
+delete VCXMV
+
+print wait 30sec
+pause 30000
+print cleanup end
+[EndSub]
+#************************************************************************************
+
+#************************************************************************************
+
+#------------------------------------------------------------------------------------
+#
+#  Does configuration for cases in this script.
+#  Creates 'Internet' IAP into 'Internet' destination and sets connection as authorized.
+#  Sets preferred memory to first used drive and sorting order to none.
+#  Removes all video files from the device.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30550 <not a test> Setup
+var CASE ET30550
+
+create VCXTestUtilModule Util
+
+Util CreateMobilecrashWatcher
+
+// Remove all videos
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetPreferredMemory E_DRIVE
+VCXMV SetSortingOrder EVcxMyVideosSortingNone
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV RemoveAllMedia
+
+VCXMV CheckMediaCount ANY_DRIVE 0
+delete VCXMV
+
+// Copies some known 3G AP to "Internet" destination with "Internet" name for the AP.
+Util CopyMethod "Internet" "Internet" "Internet"
+// Disable connection dialog for "Internet" destination.
+Util SetConnectionMethodIntAttribute "Internet" "Internet" 507 2 // 507 is ECmSeamlessnessLevel
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+
+print OK!
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that correct mediator events are received during a download.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30551 Mediator events - Download video
+var CASE ET30551
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+create MediatorEventVerifier mediatorevents
+mediatorevents AddEvent KVcxNsMpxEventDownloadStarted
+mediatorevents AddEvent KVcxNsMpxEventDownloadCompleted
+mediatorevents AddEvent KVcxNsMpxEventAllDownloadsEnded
+
+// TESTCASE START
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download 3G_AP SERVICE_SMALLVIDEOS 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+VCXMV CheckMediaCount E_DRIVE 1
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralFlags EVcxMyVideosVideoNew
+
+print OK!
+delete VCXMV
+
+mediatorevents CheckEvents
+delete mediatorevents
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that correct mediator events are received when download is canceled.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30552 Mediator events - Cancel download
+var CASE ET30552
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+create MediatorEventVerifier mediatorevents
+mediatorevents AddEvent KVcxNsMpxEventDownloadStarted
+mediatorevents AddEvent KVcxNsMpxEventAllDownloadsEnded
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Start download
+VCXMV Download 3G_AP SERVICE_2 20 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV // Dl started
+
+// Cancel it
+VCXMV CancelDownload SERVICE_2 20 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlCanceled
+waittestclass VCXMV // Dl canceled
+
+// Should be no videos
+VCXMV CheckMediaCount ANY_DRIVE 0
+
+print OK!
+delete VCXMV
+
+mediatorevents CheckEvents
+delete mediatorevents
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that correct mediator events are received when download is paused.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30553 Mediator events - Pause download
+var CASE ET30553
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+create MediatorEventVerifier mediatorevents
+mediatorevents AddEvent KVcxNsMpxEventDownloadStarted
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Start download
+VCXMV Download 3G_AP SERVICE_2 20 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV // Command complete
+
+// Pause it
+VCXMV PauseDownload SERVICE_2 20 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlPaused
+waittestclass VCXMV // Dl paused
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+
+print OK!
+delete VCXMV
+
+mediatorevents CheckEvents
+delete mediatorevents
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that correct mediator events are received when download is resumed.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30554 Mediator events - Pause and resume download
+var CASE ET30554
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+create MediatorEventVerifier mediatorevents
+mediatorevents AddEvent KVcxNsMpxEventDownloadStarted
+mediatorevents AddEvent KVcxNsMpxEventDownloadCompleted
+mediatorevents AddEvent KVcxNsMpxEventAllDownloadsEnded
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Start download
+VCXMV Download 3G_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+// Pause it
+VCXMV PauseDownload SERVICE_2 1 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlPaused
+waittestclass VCXMV // Dl paused
+
+VCXMV ResumeDownload 3G_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+
+print OK!
+delete VCXMV
+
+mediatorevents CheckEvents
+delete mediatorevents
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that correct mediator events are received when paused download is canceled.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30555 Mediator events - Cancel paused download
+var CASE ET30555
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+create MediatorEventVerifier mediatorevents
+mediatorevents AddEvent KVcxNsMpxEventDownloadStarted
+mediatorevents AddEvent KVcxNsMpxEventAllDownloadsEnded
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Start download
+VCXMV Download 3G_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV // Command complete
+
+// Pause it
+VCXMV PauseDownload SERVICE_2 1 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlPaused
+waittestclass VCXMV // Dl paused
+
+// Cancel download
+VCXMV CancelDownload SERVICE_2 1 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlCanceled
+waittestclass VCXMV // Dl canceled
+
+VCXMV CheckMediaCount ANY_DRIVE 0
+
+print OK!
+delete VCXMV
+
+mediatorevents CheckEvents
+delete mediatorevents
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that correct mediator events are received when there's multiple downloads
+#  and one is canceled.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30556 Mediator events - Multiple downloads, cancel one
+var CASE ET30556
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+create MediatorEventVerifier mediatorevents
+mediatorevents AddEvent KVcxNsMpxEventDownloadStarted
+mediatorevents AddEvent KVcxNsMpxEventDownloadStarted
+mediatorevents AddEvent KVcxNsMpxEventDownloadStarted
+mediatorevents AddEvent KVcxNsMpxEventDownloadCompleted
+mediatorevents AddEvent KVcxNsMpxEventDownloadCompleted
+mediatorevents AddEvent KVcxNsMpxEventAllDownloadsEnded
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetPreferredMemory E_DRIVE
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download 3G_AP SERVICE_2 20 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV Download 3G_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV Download 3G_AP SERVICE_2 2 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+// Cancel download
+VCXMV CancelDownload SERVICE_2 20 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlCanceled
+waittestclass VCXMV // Dl canceled
+
+VCXMV WaitAllDownloads
+waittestclass VCXMV
+
+VCXMV CheckMediaCount E_DRIVE 2
+
+mediatorevents CheckEvents
+delete mediatorevents
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that correct mediator events are received when there's multiple downloads,
+#  one is paused and resumed.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30558 Mediator events - Multiple downloads, pause and resume
+var CASE ET30558
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+create MediatorEventVerifier mediatorevents
+mediatorevents AddEvent KVcxNsMpxEventDownloadStarted
+mediatorevents AddEvent KVcxNsMpxEventDownloadStarted
+mediatorevents AddEvent KVcxNsMpxEventDownloadStarted
+mediatorevents AddEvent KVcxNsMpxEventDownloadCompleted
+mediatorevents AddEvent KVcxNsMpxEventDownloadCompleted
+mediatorevents AddEvent KVcxNsMpxEventDownloadCompleted
+mediatorevents AddEvent KVcxNsMpxEventAllDownloadsEnded
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetPreferredMemory E_DRIVE
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download 3G_AP SERVICE_2 20 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV Download 3G_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV Download 3G_AP SERVICE_2 2 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+// Pause download
+VCXMV PauseDownload SERVICE_2 20 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlPaused
+waittestclass VCXMV
+
+VCXMV WaitAllDownloads
+waittestclass VCXMV
+
+VCXMV ResumeDownload 3G_AP SERVICE_2 20 0 "mediacharger" "Buran_9o"
+
+VCXMV WaitAllDownloads
+waittestclass VCXMV
+
+VCXMV CheckMediaCount E_DRIVE 3
+
+mediatorevents CheckEvents
+delete mediatorevents
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that correct mediator events are received when there's multiple downloads
+#  and one is paused and canceled.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30559 Mediator events - Multiple downloads, pause and cancel
+var CASE ET30559
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+create MediatorEventVerifier mediatorevents
+mediatorevents AddEvent KVcxNsMpxEventDownloadStarted
+mediatorevents AddEvent KVcxNsMpxEventDownloadStarted
+mediatorevents AddEvent KVcxNsMpxEventDownloadStarted
+mediatorevents AddEvent KVcxNsMpxEventDownloadCompleted
+mediatorevents AddEvent KVcxNsMpxEventDownloadCompleted
+mediatorevents AddEvent KVcxNsMpxEventAllDownloadsEnded
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetPreferredMemory E_DRIVE
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download 3G_AP SERVICE_2 20 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV Download 3G_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV Download 3G_AP SERVICE_2 2 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+// Pause download
+VCXMV PauseDownload SERVICE_2 20 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlPaused
+waittestclass VCXMV
+
+VCXMV WaitAllDownloads
+waittestclass VCXMV
+
+VCXMV CancelDownload SERVICE_2 20 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlCanceled
+waittestclass VCXMV
+
+VCXMV CheckMediaCount E_DRIVE 2
+
+mediatorevents CheckEvents
+delete mediatorevents
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that correct mediator events are received when new flag for a video is updated.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30560 Mediator events - update new video flag
+var CASE ET30560
+
+// Setup case
+
+callsub Cleanup
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+create MediatorEventVerifier mediatorevents
+
+VCXMV Download 3G_AP SERVICE_SMALLVIDEOS 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+// Set new flag off.
+
+mediatorevents AddEvent KVcxNsMpxEventNewVideosCountDecreased
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 0
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+mediatorevents WaitEvents
+
+// Set new flag on.
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags EVcxMyVideosVideoNew
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+// Set new flag off.
+
+mediatorevents AddEvent KVcxNsMpxEventNewVideosCountDecreased
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 0
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+mediatorevents WaitEvents
+
+mediatorevents CheckEvents
+delete mediatorevents
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that correct mediator events are received when video is deleted.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30561 Mediator events - video is deleted
+var CASE ET30561
+
+// Setup case
+
+callsub Cleanup
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+create MediatorEventVerifier mediatorevents
+
+VCXMV Download 3G_AP SERVICE_SMALLVIDEOS 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+VCXMV Download 3G_AP SERVICE_SMALLVIDEOS 2 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+mediatorevents AddEvent KVcxNsMpxEventNewVideosCountDecreased
+mediatorevents AddEvent KVcxNsMpxEventNewVideosCountDecreased
+
+VCXMV DeleteMedia E_DRIVE 0 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDeleteResp KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDeleteStarted KVCXMYVideosTestMessageMpxItemDeleted KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV DeleteMedia E_DRIVE 0 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDeleteResp KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDeleteStarted KVCXMYVideosTestMessageMpxItemDeleted KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+mediatorevents WaitEvents
+
+mediatorevents CheckEvents
+delete mediatorevents
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that correct mediator events are received when video is moved.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30562 Mediator events - video is moved
+var CASE ET30562
+
+// Setup case
+
+callsub Cleanup
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+create MediatorEventVerifier mediatorevents
+
+VCXMV Download 3G_AP SERVICE_SMALLVIDEOS 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+VCXMV MoveMedia E_DRIVE 0 C_DRIVE 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMoveResp KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCopyOrMoveStarted
+waittestclass VCXMV
+
+mediatorevents CheckEvents
+delete mediatorevents
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that correct mediator events are received when video is copied.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30563 Mediator events - video is copied
+var CASE ET30563
+
+// Setup case
+
+callsub Cleanup
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+create MediatorEventVerifier mediatorevents
+
+VCXMV Download 3G_AP SERVICE_SMALLVIDEOS 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+//mediatorevents AddEvent KVcxNsMpxEventNewVideosCountDecreased
+
+VCXMV CopyMedia E_DRIVE 0 C_DRIVE 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCopyResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCollectionItemChanged KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCollectionItemChanged KVCXMYVideosTestMessageCollectionCategoryChanged
+waittestclass VCXMV
+
+mediatorevents CheckEvents
+delete mediatorevents
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that correct mediator events are received when video is removed.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30564 Mediator events - video is removed
+var CASE ET30564
+
+// Setup case
+
+callsub Cleanup
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+create MediatorEventVerifier mediatorevents
+
+VCXMV Download 3G_AP SERVICE_SMALLVIDEOS 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+VCXMV Download 3G_AP SERVICE_SMALLVIDEOS 2 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+mediatorevents AddEvent KVcxNsMpxEventNewVideosCountDecreased
+mediatorevents AddEvent KVcxNsMpxEventNewVideosCountDecreased
+
+VCXMV RemoveMedia ANY_DRIVE 0 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV RemoveMedia ANY_DRIVE 0 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+mediatorevents WaitEvents
+
+mediatorevents CheckEvents
+delete mediatorevents
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that correct mediator events are received when the file of a video is deleted.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30565 Mediator events - file of video is removed
+var CASE ET30565
+
+// Setup case
+
+callsub Cleanup
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+create MediatorEventVerifier mediatorevents
+
+VCXMV Download 3G_AP SERVICE_SMALLVIDEOS 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+VCXMV Download 3G_AP SERVICE_SMALLVIDEOS 2 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+mediatorevents AddEvent KVcxNsMpxEventNewVideosCountDecreased
+mediatorevents AddEvent KVcxNsMpxEventNewVideosCountDecreased
+
+VCXMV DeleteFileOfMedia ANY_DRIVE 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV DeleteFileOfMedia ANY_DRIVE 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+mediatorevents WaitEvents
+
+mediatorevents CheckEvents
+delete mediatorevents
+
+print OK!
+delete VCXMV
+[Endtest]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXMyVideosCollectionPluginTestMoveCopy.cfg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,1574 @@
+#-----------------------------------------------------------------------------------
+#
+# STIF test script file for testing VCXMyVideosCollectionPluginTest.dll
+#
+# Tests functionality for move and copy of video files.
+#
+#-----------------------------------------------------------------------------------
+
+[StifSettings]
+CapsModifier= IptvTestClientApiCapsMod.exe
+[EndStifSettings]
+
+[Define]
+INCLUDE c:\TestFramework\VCXMVCollectionPluginTest.inc
+INCLUDE c:\TestFramework\VCXDrives.inc
+INCLUDE c:\TestFramework\VCXConsts.inc
+INCLUDE c:\TestFramework\VCXErrors.inc
+[Enddefine]
+
+#************************************************************************************
+# Sub Cleanup
+# Removes all videos from the phone. Collection is opened.
+#************************************************************************************
+[Sub Cleanup]
+print cleanup start
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV RemoveAllMedia
+delete VCXMV
+
+print wait 30sec
+pause 30000
+print cleanup end
+[EndSub]
+#************************************************************************************
+
+#************************************************************************************
+
+#------------------------------------------------------------------------------------
+#
+#  Does configuration for cases in this script.
+#  Creates 'Internet' IAP into 'Internet' destination and sets connection as authorized.
+#  Sets preferred memory to first used drive and sorting order to none.
+#  Removes all video files from the device.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30700 <not a test> Setup
+var CASE ET30700
+
+create VCXTestUtilModule Util
+// Copies some known 3G AP to "Internet" destination with "Internet" name for the AP.
+Util CopyMethod "Internet" "Internet" "Internet"
+// Disable connection dialog for "Internet" destination.
+Util SetConnectionMethodIntAttribute "Internet" "Internet" 507 2 // 507 is ECmSeamlessnessLevel
+delete Util
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetPreferredMemory E_DRIVE
+VCXMV SetSortingOrder EVcxMyVideosSortingNone
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV RemoveAllMedia
+
+VCXMV CheckMediaCount ANY_DRIVE 0
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests moving a video from first to second drive.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30701 Move from 1st to 2nd drive
+var CASE ET30701
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create sideloaded video
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+VCXMV CheckMediaCount C_DRIVE 1
+VCXMV CheckMediaCount E_DRIVE 0
+
+VCXMV MoveMedia C_DRIVE 0 E_DRIVE 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMoveResp KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCopyOrMoveStarted
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 0
+VCXMV CheckMediaCount E_DRIVE 1
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video attributes are kept when moving a video.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30702 Check attributes of moved file
+var CASE ET30702
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create sideloaded video
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+// Update attributes
+// Sets all possible attributes of video.
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "a"
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralDate 2
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 3
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralMimeType "d"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDownloadId 0
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 1
+VCXMV CheckMediaCount E_DRIVE 0
+
+VCXMV MoveMedia C_DRIVE 0 E_DRIVE 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMoveResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 0
+VCXMV CheckMediaCount E_DRIVE 1
+
+// Check attributes
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+// Size is set to right size of the file after move.
+allowerrorcodes KERRCORRUPT
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+// General date is read-only.
+allowerrorcodes KERRCORRUPT
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralDate 3
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralFlags 3
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+// Mime type is read-only.
+allowerrorcodes KERRCORRUPT
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralMimeType "d"
+allowerrorcodes KERRCORRUPT
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+allowerrorcodes KERRCORRUPT
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosDownloadId 0
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests moving video to one drive and back.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30703 Move back
+var CASE ET30703
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create sideloaded video
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+VCXMV CheckMediaCount C_DRIVE 1
+VCXMV CheckMediaCount E_DRIVE 0
+
+// Move the file
+
+VCXMV MoveMedia C_DRIVE 0 E_DRIVE 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMoveResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 0
+VCXMV CheckMediaCount E_DRIVE 1
+
+// File is locked, pause for a while
+pause 20000
+
+// Move it back
+
+VCXMV MoveMedia E_DRIVE 0 C_DRIVE 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMoveResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 1
+VCXMV CheckMediaCount E_DRIVE 0
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests moving a video to drive which already has videos.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30704 Move, drive has already videos
+var CASE ET30704
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create sideloaded videos
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+VCXMV CreateVideoFile IptvTestVideoMpeg4 E_DRIVE "video1.mp4"
+
+VCXMV CheckMediaCount C_DRIVE 1
+VCXMV CheckMediaCount E_DRIVE 1
+
+VCXMV MoveMedia C_DRIVE 0 E_DRIVE 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMoveResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 0
+VCXMV CheckMediaCount E_DRIVE 2
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests moving a video to drive which already has a video with same name.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30705 Move when file with same name exists
+var CASE ET30705
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create sideloaded videos
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+VCXMV CreateVideoFile IptvTestVideoMpeg4 E_DRIVE "video0.mp4"
+
+VCXMV CheckMediaCount C_DRIVE 1
+VCXMV CheckMediaCount E_DRIVE 1
+
+// Move the file
+
+VCXMV MoveMedia C_DRIVE 0 E_DRIVE 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMoveResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 0
+VCXMV CheckMediaCount E_DRIVE 2
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests moving a video from second to first drive.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30706 Move from 2nd to 1st drive
+var CASE ET30706
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create sideloaded video
+VCXMV CreateVideoFile IptvTestVideoMpeg4 E_DRIVE "video0.mp4"
+
+VCXMV CheckMediaCount E_DRIVE 1
+VCXMV CheckMediaCount C_DRIVE 0
+
+VCXMV MoveMedia E_DRIVE 0 C_DRIVE 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMoveResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCommandComplete
+waittestclass VCXMV
+
+VCXMV CheckMediaCount E_DRIVE 0
+VCXMV CheckMediaCount C_DRIVE 1
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests moving multiple videos.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30707 Move multiple
+var CASE ET30707
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create sideloaded video
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video.mp4" 50000 10
+
+VCXMV CheckMediaCount C_DRIVE 10
+VCXMV CheckMediaCount E_DRIVE 0
+
+VCXMV MoveMedias C_DRIVE 0 5 E_DRIVE 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMoveResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCommandComplete
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 5
+VCXMV CheckMediaCount E_DRIVE 5
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests moving a downloaded video.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30708 Move downloaded video
+var CASE ET30708
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Start download
+VCXMV Download 3G_AP SERVICE_SMALLVIDEOS 3 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+VCXMV CheckMediaCount E_DRIVE 1
+VCXMV CheckMediaCount C_DRIVE 0
+
+pause 30000
+
+VCXMV MoveMedia E_DRIVE 0 C_DRIVE 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMoveResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCommandComplete
+waittestclass VCXMV
+
+VCXMV CheckMediaCount E_DRIVE 0
+VCXMV CheckMediaCount C_DRIVE 1
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that moving a ongoing download cannot be done.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30709 Move ongoing download
+var CASE ET30709
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Start download
+VCXMV Download 3G_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV // Dl started
+
+VCXMV MoveMedia E_DRIVE 0 C_DRIVE 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMoveResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCommandComplete
+allownextresult KERRINUSE
+waittestclass VCXMV
+
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+VCXMV CheckMediaCount E_DRIVE 1
+VCXMV CheckMediaCount C_DRIVE 0
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests move video with invalid argument.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30710 Move nothing
+var CASE ET30710
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video 1 .mp4"
+
+VCXMV MoveMedias C_DRIVE 1 0 E_DRIVE 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMoveResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCommandComplete
+allownextresult KERRARGUMENT
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 1
+VCXMV CheckMediaCount E_DRIVE 0
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests canceling move operation.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30711 Cancel move
+var CASE ET30711
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video.mp4" 70000 30
+
+VCXMV CheckMediaCount C_DRIVE 30
+VCXMV CheckMediaCount E_DRIVE 0
+
+VCXMV CancelNextOperation
+VCXMV MoveMedias C_DRIVE 0 30 E_DRIVE 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandCanceled
+waittestclass VCXMV
+
+VCXMV CoolDown
+
+// Check that all videos have not been moved
+VCXMV CheckMinimumMediaCount C_DRIVE 5
+
+VCXMV CheckMediaCount ANY_DRIVE 30
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests canceling when there's video move operation is not ongoing.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30713 Cancel move without request
+var CASE ET30713
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CancelMove
+
+VCXMV CheckMediaCount C_DRIVE 0
+VCXMV CheckMediaCount E_DRIVE 0
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests moving a video to same drive where it already is.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30712 Move to same drive
+var CASE ET30712
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create sideloaded video
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+VCXMV CheckMediaCount C_DRIVE 1
+VCXMV CheckMediaCount E_DRIVE 0
+
+VCXMV MoveMedia C_DRIVE 0 C_DRIVE 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMoveResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCommandComplete
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 1
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests move operation when media array is not defined for the request.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30714 Move no array specified
+var CASE ET30714
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video 1 .mp4"
+
+VCXMV MoveMedias C_DRIVE -4 0 E_DRIVE 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMoveResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCommandComplete
+allownextresult KERRARGUMENT
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 1
+VCXMV CheckMediaCount E_DRIVE 0
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests copying a video from first to second drive.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30751 Copy from 1st to 2nd drive
+var CASE ET30751
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create sideloaded video
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+VCXMV CheckMediaCount C_DRIVE 1
+VCXMV CheckMediaCount E_DRIVE 0
+
+VCXMV CopyMedia C_DRIVE 0 E_DRIVE 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCopyResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCollectionItemChanged KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCollectionItemChanged KVCXMYVideosTestMessageCollectionCategoryChanged
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 1
+VCXMV CheckMediaCount E_DRIVE 1
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video details are kept when copying a video.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30752 Check attributes of copied file
+var CASE ET30752
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+pause 10000
+
+// Update attributes
+// Sets all possible attributes of video.
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralDate 2
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 3
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralMimeType "d"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDownloadId 0
+
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 1
+VCXMV CheckMediaCount E_DRIVE 0
+
+VCXMV CopyMedia C_DRIVE 0 E_DRIVE 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCopyResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+// Get list of all videos
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 1
+VCXMV CheckMediaCount E_DRIVE 1
+
+// Check attributes
+
+VCXMV CheckMediaDetail E_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+// Size is set by collection after copy.
+allowerrorcodes KERRCORRUPT
+VCXMV CheckMediaDetail E_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+// Read-only attribute.
+allowerrorcodes KERRCORRUPT
+VCXMV CheckMediaDetail E_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralDate 3
+VCXMV CheckMediaDetail E_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+allowerrorcodes KERRCORRUPT
+VCXMV CheckMediaDetail E_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosModifiedDate 4
+VCXMV CheckMediaDetail E_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV CheckMediaDetail E_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV CheckMediaDetail E_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+allowerrorcodes KERRCORRUPT
+VCXMV CheckMediaDetail E_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV CheckMediaDetail E_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+VCXMV CheckMediaDetail E_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosDownloadId 0
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests copying a video to same drive where the video was copied from.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30753 Copy back
+var CASE ET30753
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create sideloaded video
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 1
+VCXMV CheckMediaCount E_DRIVE 0
+
+// Copy the file
+
+VCXMV CopyMedia C_DRIVE 0 E_DRIVE 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCopyResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+// Get list of all videos
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 1
+VCXMV CheckMediaCount E_DRIVE 1
+
+// Copy it back
+
+VCXMV CopyMedia E_DRIVE 0 C_DRIVE 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCopyResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+// Get list of all videos
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 2
+VCXMV CheckMediaCount E_DRIVE 1
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests copying video to drive which already has videos.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30754 Copy, drive has already videos
+var CASE ET30754
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create sideloaded video
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+// Create sideloaded video
+VCXMV CreateVideoFile IptvTestVideoMpeg4 E_DRIVE "video1.mp4"
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 1
+VCXMV CheckMediaCount E_DRIVE 1
+
+VCXMV CopyMedia C_DRIVE 0 E_DRIVE 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCopyResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+// Get list of all videos
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 1
+VCXMV CheckMediaCount E_DRIVE 2
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests copying video to drive which already has video with same name.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30755 Copy when file with same name exists
+var CASE ET30755
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create sideloaded video
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 E_DRIVE "video0.mp4"
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 1
+VCXMV CheckMediaCount E_DRIVE 1
+
+// Copy the file
+
+VCXMV CopyMedia C_DRIVE 0 E_DRIVE 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCopyResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+// Get list of all videos
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 1
+VCXMV CheckMediaCount E_DRIVE 2
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests copying video from second to first drive.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30756 Copy from 2nd to 1st drive
+var CASE ET30756
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create sideloaded video
+VCXMV CreateVideoFile IptvTestVideoMpeg4 E_DRIVE "video0.mp4"
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount E_DRIVE 1
+VCXMV CheckMediaCount C_DRIVE 0
+
+VCXMV CopyMedia E_DRIVE 0 C_DRIVE 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCopyResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCommandComplete
+waittestclass VCXMV
+
+// Get list of all videos
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount E_DRIVE 1
+VCXMV CheckMediaCount C_DRIVE 1
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests copying multiple videos.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30757 Copy multiple
+var CASE ET30757
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create sideloaded video
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video.mp4" 50000 10
+
+VCXMV CheckMediaCount C_DRIVE 10
+VCXMV CheckMediaCount E_DRIVE 0
+
+VCXMV CopyMedias C_DRIVE 0 5 E_DRIVE 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCopyResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCommandComplete
+waittestclass VCXMV
+
+// Get list of all videos
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 10
+VCXMV CheckMediaCount E_DRIVE 5
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Test copying a downloaded video.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30758 Copy downloaded video
+var CASE ET30758
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Start download
+VCXMV Download 3G_AP SERVICE_SMALLVIDEOS 3 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 0
+VCXMV CheckMediaCount E_DRIVE 1
+
+VCXMV CopyMedia E_DRIVE 0 C_DRIVE 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCopyResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCommandComplete
+waittestclass VCXMV
+
+// Get list of all videos
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 1
+VCXMV CheckMediaCount E_DRIVE 1
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that copying an ongoing download cannot be done.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30759 Copy ongoing download
+var CASE ET30759
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Start download
+VCXMV Download 3G_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete
+waittestclass VCXMV // Dl started
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CopyMedia E_DRIVE 0 C_DRIVE 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCopyResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCommandComplete
+allownextresult KERRINUSE
+waittestclass VCXMV
+
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+// Get list of all videos
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 0
+VCXMV CheckMediaCount E_DRIVE 1
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests copying with invalid argument.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30760 Copy nothing
+var CASE ET30760
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video 1 .mp4"
+
+VCXMV CopyMedias C_DRIVE 1 0 E_DRIVE 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCopyResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCommandComplete
+allownextresult KERRARGUMENT
+waittestclass VCXMV
+
+// Get list of all videos
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 1
+VCXMV CheckMediaCount E_DRIVE 0
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests canceling a copy operation.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30761 Cancel copy
+var CASE ET30761
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video.mp4" 70000 30
+
+VCXMV CheckMediaCount C_DRIVE 30
+VCXMV CheckMediaCount E_DRIVE 0
+
+VCXMV CancelNextOperation
+VCXMV CopyMedias C_DRIVE 0 30 E_DRIVE 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandCanceled
+waittestclass VCXMV
+
+VCXMV CoolDown
+
+// Get list of all videos
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Check that at least few videos have been copied
+VCXMV CheckMaximumMediaCount E_DRIVE 25
+VCXMV CheckMediaCount C_DRIVE 30
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests cancel copy request when there's no copy ongoing.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30762 Cancel Copy without request
+var CASE ET30762
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CancelCopy
+
+// Get list of all videos
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 0
+VCXMV CheckMediaCount E_DRIVE 0
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests copying a video to same drive.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30763 Copy to same drive
+var CASE ET30763
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create sideloaded video
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 1
+VCXMV CheckMediaCount E_DRIVE 0
+
+VCXMV CopyMedia C_DRIVE 0 C_DRIVE 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCopyResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCommandComplete
+waittestclass VCXMV
+
+// Get list of all videos
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 1
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests copy operation when the request has no array defined.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30764 Copy no array specified
+var CASE ET30764
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video 1 .mp4"
+
+VCXMV CopyMedias C_DRIVE 1 0 E_DRIVE 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCopyResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCommandComplete
+allownextresult KERRARGUMENT
+waittestclass VCXMV
+
+// Get list of all videos
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE 1
+VCXMV CheckMediaCount E_DRIVE 0
+
+print OK!
+delete VCXMV
+[Endtest]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXMyVideosCollectionPluginTestMultiDrives.cfg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,1349 @@
+#-----------------------------------------------------------------------------------
+#
+# STIF test script file for testing VCXMyVideosCollectionPluginTest.dll
+#
+# Tests functionality for multiple drives.
+#
+#-----------------------------------------------------------------------------------
+
+[StifSettings]
+CapsModifier= IptvTestClientApiCapsMod.exe
+[EndStifSettings]
+
+[Define]
+INCLUDE c:\TestFramework\VCXMVCollectionPluginTest.inc
+INCLUDE c:\TestFramework\VCXDrives.inc
+INCLUDE c:\TestFramework\VCXConsts.inc
+INCLUDE c:\TestFramework\VCXErrors.inc
+[Enddefine]
+
+#************************************************************************************
+# Sub Cleanup
+# Removes all videos from the phone. Collection is opened.
+#************************************************************************************
+[Sub Cleanup]
+print cleanup start
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV RemoveAllMedia
+delete VCXMV
+
+print wait 30sec
+pause 30000
+print cleanup end
+[EndSub]
+
+
+#------------------------------------------------------------------------------------
+#
+#  Does configuration for cases in this script.
+#  Creates 'Internet' IAP into 'Internet' destination and sets connection as authorized.
+#  Sets preferred memory to first used drive and sorting order to none.
+#  Removes all video files from the device.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30160 <not a test> Setup
+var CASE ET30160
+
+create VCXTestUtilModule Util
+// Copies some known 3G AP to "Internet" destination with "Internet" name for the AP.
+Util SetUsedDestination "Internet"
+Util CopyMethod "Internet" "Internet" "Internet"
+// Disable connection dialog for "Internet" destination.
+Util SetConnectionMethodIntAttribute "Internet" "Internet" 507 2 // 507 is ECmSeamlessnessLevel
+Util SetDefaultIapCenrep
+delete Util
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+// Remove all videos
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetPreferredMemory C_DRIVE
+VCXMV SetSortingOrder EVcxMyVideosSortingNone
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV RemoveAllMedia
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+delete VCXMV
+
+pause 2000
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 0
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+
+print OK!
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests downloading a video to 3rd drive.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30161 Download video to F drive
+var CASE ET30161
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV SetPreferredMemory F_DRIVE_FORCED
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download 3G_AP SERVICE_SMALLVIDEOS 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount F_DRIVE_FORCED 1
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralFlags EVcxMyVideosVideoNew
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests downloading multiple videos at same time to F drive
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30162 3 downloads to F drive
+var CASE ET30162
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV SetPreferredMemory F_DRIVE_FORCED
+VCXMV Create
+
+VCXMV SetPreferredMemory E_DRIVE
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download 3G_AP SERVICE_2 20 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV Download 3G_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV Download 3G_AP SERVICE_2 2 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV WaitAllDownloads
+waittestclass VCXMV
+
+VCXMV CheckMediaCount F_DRIVE_FORCED 3
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests pause and resume download on F drive.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30163 Pause and resume download on F drive
+var CASE ET30163
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV SetPreferredMemory F_DRIVE_FORCED
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Start download
+VCXMV Download 3G_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+// Pause it
+VCXMV PauseDownload SERVICE_2 1 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlPaused
+waittestclass VCXMV // Dl paused
+
+VCXMV ResumeDownload 3G_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+VCXMV CheckMediaCount F_DRIVE_FORCED 1
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests downloading to multiple drives same time.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30164 Download to E and F drives
+var CASE ET30164
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV SetPreferredMemory F_DRIVE_FORCED
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Start download
+VCXMV Download 3G_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV SetPreferredMemory E_DRIVE_FORCED
+pause 1000
+
+// Start download
+VCXMV Download 3G_AP SERVICE_2 2 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV WaitAllDownloads
+waittestclass VCXMV
+
+VCXMV CheckMediaCount F_DRIVE_FORCED 1
+VCXMV CheckMediaCount E_DRIVE_FORCED 1
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests downloading to multiple drives same time and cancel download.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30165 Download to E and F drives, cancel E
+var CASE ET30165
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV SetPreferredMemory F_DRIVE_FORCED
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Start download
+VCXMV Download 3G_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV SetPreferredMemory E_DRIVE_FORCED
+pause 1000
+
+// Start download
+VCXMV Download 3G_AP SERVICE_2 2 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+// Cancel download
+VCXMV CancelDownload SERVICE_2 2 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlCanceled
+waittestclass VCXMV
+
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+VCXMV CheckMediaCount F_DRIVE_FORCED 1
+VCXMV CheckMediaCount E_DRIVE_FORCED 0
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests downloading to multiple drives same time, pause and resume the download on E drive.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30167 Download to E and F drives, pause and resume E
+var CASE ET30167
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV SetPreferredMemory F_DRIVE_FORCED
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Start download
+VCXMV Download 3G_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV SetPreferredMemory E_DRIVE_FORCED
+pause 1000
+
+// Start download
+VCXMV Download 3G_AP SERVICE_2 2 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+// Pause it
+VCXMV PauseDownload SERVICE_2 2 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlPaused
+waittestclass VCXMV // Dl paused
+
+VCXMV ResumeDownload 3G_AP SERVICE_2 2 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV WaitAllDownloads
+waittestclass VCXMV
+
+VCXMV CheckMediaCount F_DRIVE_FORCED 1
+VCXMV CheckMediaCount E_DRIVE_FORCED 1
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests downloading to multiple drives same time, pause and resume the download on F drive.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30168 Download to E and F drives, pause and resume F
+var CASE ET30168
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV SetPreferredMemory F_DRIVE_FORCED
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Start download
+VCXMV Download 3G_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV SetPreferredMemory E_DRIVE_FORCED
+pause 1000
+
+// Start download
+VCXMV Download 3G_AP SERVICE_2 2 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+// Pause it
+VCXMV PauseDownload SERVICE_2 1 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlPaused
+waittestclass VCXMV // Dl paused
+
+VCXMV ResumeDownload 3G_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV WaitAllDownloads
+waittestclass VCXMV
+
+VCXMV CheckMediaCount F_DRIVE_FORCED 1
+VCXMV CheckMediaCount E_DRIVE_FORCED 1
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that downloading to C drive is not possible.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30169 Download to C
+var CASE ET30169
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV SetPreferredMemory C_DRIVE_FORCED
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Start download
+VCXMV Download 3G_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+// File is downloaded to E drive.
+
+VCXMV CheckMediaCount C_DRIVE_FORCED 0
+VCXMV CheckMediaCount F_DRIVE_FORCED 0
+VCXMV CheckMediaCount E_DRIVE_FORCED 1
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests sideloading videos one by one to different drives.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30170 Sideload to multiple drives one by one
+var CASE ET30170
+
+callsub Cleanup
+
+// TESTCASE START
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+loop 5
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE_FORCED "C LOOP_COUNTER .mp4"
+VCXMV CreateVideoFile IptvTestVideo3Gp E_DRIVE_FORCED "E LOOP_COUNTER .mp4"
+VCXMV CreateVideoFile IptvTestVideo3Gp F_DRIVE_FORCED "F LOOP_COUNTER .mp4"
+endloop
+
+VCXMV CheckMediaCount C_DRIVE_FORCED 5
+VCXMV CheckMediaCount E_DRIVE_FORCED 5
+VCXMV CheckMediaCount F_DRIVE_FORCED 5
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#   Tests sideloading videos to multiple drives at the same time.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30171 Sideload to multiple drives
+var CASE ET30171
+
+callsub Cleanup
+
+// TESTCASE START
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV CreateVideoFileNoWait IptvTestVideo3Gp C_DRIVE_FORCED "C video.mp4" 60000 5
+VCXMV CreateVideoFileNoWait IptvTestVideo3Gp E_DRIVE_FORCED "E video.mp4" 60000 5
+VCXMV CreateVideoFileNoWait IptvTestVideo3Gp F_DRIVE_FORCED "F video.mp4" 60000 5
+
+pause 60000
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE_FORCED 5
+VCXMV CheckMediaCount E_DRIVE_FORCED 5
+VCXMV CheckMediaCount F_DRIVE_FORCED 5
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests copying video from C to E drive.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30172 Copy from C to E
+var CASE ET30172
+
+callsub Cleanup
+
+// TESTCASE START
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE_FORCED "video.mp4"
+
+VCXMV CopyMedia C_DRIVE_FORCED 0 E_DRIVE_FORCED 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCopyResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCollectionItemChanged KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCollectionItemChanged KVCXMYVideosTestMessageCollectionCategoryChanged
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE_FORCED 1
+VCXMV CheckMediaCount E_DRIVE_FORCED 1
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests copying video from C to F drive.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30173 Copy from C to F
+var CASE ET30173
+
+callsub Cleanup
+
+// TESTCASE START
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE_FORCED "video.mp4"
+
+VCXMV CopyMedia C_DRIVE_FORCED 0 F_DRIVE_FORCED 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCopyResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCollectionItemChanged KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCollectionItemChanged KVCXMYVideosTestMessageCollectionCategoryChanged
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE_FORCED 1
+VCXMV CheckMediaCount F_DRIVE_FORCED 1
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests copying video from F to E drive.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30174 Copy from F to E
+var CASE ET30174
+
+callsub Cleanup
+
+// TESTCASE START
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateVideoFile IptvTestVideo3Gp F_DRIVE_FORCED "video.mp4"
+
+VCXMV CopyMedia F_DRIVE_FORCED 0 E_DRIVE_FORCED 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCopyResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCollectionItemChanged KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCollectionItemChanged KVCXMYVideosTestMessageCollectionCategoryChanged
+waittestclass VCXMV
+
+VCXMV CheckMediaCount E_DRIVE_FORCED 1
+VCXMV CheckMediaCount F_DRIVE_FORCED 1
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests copying video from F to C drive.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30175 Copy from F to C
+var CASE ET30175
+
+callsub Cleanup
+
+// TESTCASE START
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateVideoFile IptvTestVideo3Gp F_DRIVE_FORCED "video.mp4"
+
+VCXMV CopyMedia F_DRIVE_FORCED 0 C_DRIVE_FORCED 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCopyResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCollectionItemChanged KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCollectionItemChanged KVCXMYVideosTestMessageCollectionCategoryChanged
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE_FORCED 1
+VCXMV CheckMediaCount F_DRIVE_FORCED 1
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests moving a video from C to E drive.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30176 Move from C to E
+var CASE ET30176
+
+callsub Cleanup
+
+// TESTCASE START
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE_FORCED "video.mp4"
+
+VCXMV MoveMedia C_DRIVE_FORCED 0 E_DRIVE_FORCED 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMoveResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCollectionItemChanged KVCXMYVideosTestMessageCommandComplete
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE_FORCED 0
+VCXMV CheckMediaCount E_DRIVE_FORCED 1
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests moving a video from C to F drive.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30177 Move from C to F
+var CASE ET30177
+
+callsub Cleanup
+
+// TESTCASE START
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE_FORCED "video.mp4"
+
+VCXMV MoveMedia C_DRIVE_FORCED 0 F_DRIVE_FORCED 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMoveResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCollectionItemChanged KVCXMYVideosTestMessageCommandComplete
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE_FORCED 0
+VCXMV CheckMediaCount F_DRIVE_FORCED 1
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests moving a video from F to E drive.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30178 Move from F to E
+var CASE ET30178
+
+callsub Cleanup
+
+// TESTCASE START
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateVideoFile IptvTestVideo3Gp F_DRIVE_FORCED "video.mp4"
+
+VCXMV MoveMedia F_DRIVE_FORCED 0 E_DRIVE_FORCED 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMoveResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCollectionItemChanged KVCXMYVideosTestMessageCommandComplete
+waittestclass VCXMV
+
+VCXMV CheckMediaCount E_DRIVE_FORCED 1
+VCXMV CheckMediaCount F_DRIVE_FORCED 0
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests moving a video from F to C drive.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30179 Move from F to C
+var CASE ET30179
+
+callsub Cleanup
+
+// TESTCASE START
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateVideoFile IptvTestVideo3Gp F_DRIVE_FORCED "video.mp4"
+
+VCXMV MoveMedia F_DRIVE_FORCED 0 C_DRIVE_FORCED 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMoveResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCollectionItemChanged KVCXMYVideosTestMessageCommandComplete
+waittestclass VCXMV
+
+VCXMV CheckMediaCount C_DRIVE_FORCED 1
+VCXMV CheckMediaCount F_DRIVE_FORCED 0
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests moving multiple videos from F drive.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30180 Move multiple from F
+var CASE ET30180
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create sideloaded video
+VCXMV CreateVideoFile IptvTestVideo3Gp F_DRIVE_FORCED "video.mp4" 50000 5
+
+VCXMV CheckMediaCount F_DRIVE_FORCED 5
+
+VCXMV MoveMedias F_DRIVE_FORCED 0 5 E_DRIVE_FORCED 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMoveResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCommandComplete
+waittestclass VCXMV
+
+VCXMV CheckMediaCount F_DRIVE_FORCED 0
+VCXMV CheckMediaCount E_DRIVE_FORCED 5
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests moving multiple videos from F drive.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30181 Move multiple to F
+var CASE ET30181
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create sideloaded video
+VCXMV CreateVideoFile IptvTestVideo3Gp E_DRIVE_FORCED "video.mp4" 50000 5
+
+VCXMV CheckMediaCount E_DRIVE_FORCED 5
+
+VCXMV MoveMedias E_DRIVE_FORCED 0 5 F_DRIVE_FORCED 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMoveResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCommandComplete
+waittestclass VCXMV
+
+VCXMV CheckMediaCount F_DRIVE_FORCED 5
+VCXMV CheckMediaCount E_DRIVE_FORCED 0
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests moving videos from C and E drive to F drive.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30182 Move from C and E to F
+var CASE ET30182
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create sideloaded video
+VCXMV CreateVideoFile IptvTestVideo3Gp E_DRIVE_FORCED "F video.mp4" 50000 5
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE_FORCED "C video.mp4" 50000 5
+
+VCXMV CheckMediaCount E_DRIVE_FORCED 5
+VCXMV CheckMediaCount C_DRIVE_FORCED 5
+
+VCXMV MoveMedias ANY_DRIVE 0 10 F_DRIVE_FORCED 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMoveResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCommandComplete
+waittestclass VCXMV
+
+VCXMV CheckMediaCount F_DRIVE_FORCED 10
+VCXMV CheckMediaCount E_DRIVE_FORCED 0
+VCXMV CheckMediaCount C_DRIVE_FORCED 0
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests moving videos from C, E and F drives to F drive.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30183 Move from C, E and F to F
+var CASE ET30183
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create sideloaded video
+VCXMV CreateVideoFile IptvTestVideo3Gp E_DRIVE_FORCED "E video.mp4" 50000 3
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE_FORCED "C video.mp4" 50000 3
+VCXMV CreateVideoFile IptvTestVideo3Gp F_DRIVE_FORCED "F video.mp4" 50000 3
+
+VCXMV CheckMediaCount E_DRIVE_FORCED 3
+VCXMV CheckMediaCount C_DRIVE_FORCED 3
+VCXMV CheckMediaCount F_DRIVE_FORCED 3
+
+VCXMV MoveMedias ANY_DRIVE 0 9 F_DRIVE_FORCED 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMoveResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCommandComplete
+waittestclass VCXMV
+
+VCXMV CheckMediaCount F_DRIVE_FORCED 9
+VCXMV CheckMediaCount E_DRIVE_FORCED 0
+VCXMV CheckMediaCount C_DRIVE_FORCED 0
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests copying multiple videos from F drive.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30184 Copy multiple from F
+var CASE ET30184
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create sideloaded video
+VCXMV CreateVideoFile IptvTestVideo3Gp F_DRIVE_FORCED "video.mp4" 50000 5
+
+VCXMV CheckMediaCount F_DRIVE_FORCED 5
+
+VCXMV CopyMedias F_DRIVE_FORCED 0 5 E_DRIVE_FORCED 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCopyResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCommandComplete
+waittestclass VCXMV
+
+VCXMV CheckMediaCount F_DRIVE_FORCED 5
+VCXMV CheckMediaCount E_DRIVE_FORCED 5
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests copying multiple videos to F drive.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30185 Copy multiple to F
+var CASE ET30185
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create sideloaded video
+VCXMV CreateVideoFile IptvTestVideo3Gp E_DRIVE_FORCED "video.mp4" 50000 5
+
+VCXMV CheckMediaCount E_DRIVE_FORCED 5
+
+VCXMV CopyMedias E_DRIVE_FORCED 0 5 F_DRIVE_FORCED 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCopyResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCommandComplete
+waittestclass VCXMV
+
+VCXMV CheckMediaCount F_DRIVE_FORCED 5
+VCXMV CheckMediaCount E_DRIVE_FORCED 5
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests copying from C and E drives to F drive.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30186 Copy from C and E to F
+var CASE ET30186
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create sideloaded video
+VCXMV CreateVideoFile IptvTestVideo3Gp E_DRIVE_FORCED "F video.mp4" 50000 5
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE_FORCED "C video.mp4" 50000 5
+
+VCXMV CheckMediaCount E_DRIVE_FORCED 5
+VCXMV CheckMediaCount C_DRIVE_FORCED 5
+
+VCXMV CopyMedias ANY_DRIVE 0 10 F_DRIVE_FORCED 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCopyResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCommandComplete
+waittestclass VCXMV
+
+VCXMV CheckMediaCount F_DRIVE_FORCED 10
+VCXMV CheckMediaCount E_DRIVE_FORCED 5
+VCXMV CheckMediaCount C_DRIVE_FORCED 5
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests copying from C, E and F drives to F drive.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30187 Copy from C, E and F to F
+var CASE ET30187
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create sideloaded video
+VCXMV CreateVideoFile IptvTestVideo3Gp E_DRIVE_FORCED "E video.mp4" 50000 3
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE_FORCED "C video.mp4" 50000 3
+VCXMV CreateVideoFile IptvTestVideo3Gp F_DRIVE_FORCED "F video.mp4" 50000 3
+
+VCXMV CheckMediaCount E_DRIVE_FORCED 3
+VCXMV CheckMediaCount C_DRIVE_FORCED 3
+VCXMV CheckMediaCount F_DRIVE_FORCED 3
+
+VCXMV CopyMedias ANY_DRIVE 0 9 F_DRIVE_FORCED 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCopyResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCommandComplete
+waittestclass VCXMV
+
+VCXMV CheckMediaCount F_DRIVE_FORCED 9
+VCXMV CheckMediaCount E_DRIVE_FORCED 3
+VCXMV CheckMediaCount C_DRIVE_FORCED 3
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests deleting from multiple drives at the same time.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30188 Delete from C, E and F
+var CASE ET30188
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create sideloaded video
+VCXMV CreateVideoFile IptvTestVideo3Gp E_DRIVE_FORCED "E video.mp4" 50000 3
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE_FORCED "C video.mp4" 50000 3
+VCXMV CreateVideoFile IptvTestVideo3Gp F_DRIVE_FORCED "F video.mp4" 50000 3
+
+VCXMV CheckMediaCount E_DRIVE_FORCED 3
+VCXMV CheckMediaCount C_DRIVE_FORCED 3
+VCXMV CheckMediaCount F_DRIVE_FORCED 3
+
+VCXMV DeleteMedias ANY_DRIVE 0 9 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDeleteResp KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDeleteStarted
+waittestclass VCXMV
+
+VCXMV CoolDown
+
+VCXMV CheckMediaCount F_DRIVE_FORCED 0
+VCXMV CheckMediaCount E_DRIVE_FORCED 0
+VCXMV CheckMediaCount C_DRIVE_FORCED 0
+
+print OK!
+delete VCXMV
+[Endtest]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXMyVideosCollectionPluginTestMultipleDls.cfg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,1040 @@
+#-----------------------------------------------------------------------------------
+#
+# STIF test script file for testing VCXMyVideosCollectionPluginTest.dll
+#
+# Tests functionality for downloading multiple videos.
+#
+#-----------------------------------------------------------------------------------
+
+[StifSettings]
+CapsModifier= IptvTestClientApiCapsMod.exe
+[EndStifSettings]
+
+[Define]
+INCLUDE c:\TestFramework\VCXMVCollectionPluginTest.inc
+INCLUDE c:\TestFramework\VCXDrives.inc
+INCLUDE c:\TestFramework\VCXConsts.inc
+INCLUDE c:\TestFramework\VCXErrors.inc
+[Enddefine]
+
+#************************************************************************************
+# Sub Cleanup
+# Removes all videos from the phone. Collection is opened.
+#************************************************************************************
+[Sub Cleanup]
+print cleanup start
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV RemoveAllMedia
+delete VCXMV
+
+print wait 30sec
+pause 30000
+print cleanup end
+[EndSub]
+#************************************************************************************
+
+#------------------------------------------------------------------------------------
+#
+#  Does configuration for cases in this script.
+#  Creates 'Internet' IAP into 'Internet' destination and sets connection as authorized.
+#  Sets preferred memory to first used drive and sorting order to none.
+#  Removes all video files from the device.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30650 <not a test> Setup
+var CASE ET30650
+
+create VCXTestUtilModule Util
+// Copies some known 3G AP to "Internet" destination with "Internet" name for the AP.
+Util SetUsedDestination "Internet"
+Util CopyMethod "Internet" "Internet" "Internet"
+// Disable connection dialog for "Internet" destination.
+Util SetConnectionMethodIntAttribute "Internet" "Internet" 507 2 // 507 is ECmSeamlessnessLevel
+Util SetDefaultIapCenrep
+delete Util
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+// Remove all videos
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetPreferredMemory E_DRIVE
+VCXMV SetSortingOrder EVcxMyVideosSortingNone
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV RemoveAllMedia
+
+VCXMV CheckMediaCount ANY_DRIVE 0
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+
+print OK!
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests multiple downloads: Starts two downloads, first of them is then paused and canceled.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30651 2 downloads, pause and cancel first
+var CASE ET30651
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetPreferredMemory E_DRIVE
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 20 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+// Pause first
+VCXMV PauseDownload SERVICE_2 20 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlPaused
+waittestclass VCXMV // Dl paused
+
+// Cancel download
+VCXMV CancelDownload SERVICE_2 20 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlCanceled
+waittestclass VCXMV // Dl canceled
+
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+VCXMV CheckMediaCount E_DRIVE 1
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests multiple downloads: Starts two downloads, both are paused and then resumed.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30652 2 downloads, pause both, cancel and resume
+var CASE ET30652
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetPreferredMemory E_DRIVE
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 20 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+// Pause both
+VCXMV PauseDownload SERVICE_2 20 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlPaused
+waittestclass VCXMV // Dl paused
+
+VCXMV PauseDownload SERVICE_2 1 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlPaused
+waittestclass VCXMV // Dl paused
+
+// Cancel download
+VCXMV CancelDownload SERVICE_2 20 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlCanceled
+waittestclass VCXMV // Dl canceled
+
+// Resume download
+VCXMV ResumeDownload DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+VCXMV CheckMediaCount E_DRIVE 1
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests multiple downloads: Starts three downloads, first is canceled.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30653 3 downloads, Cancel first download
+var CASE ET30653
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetPreferredMemory E_DRIVE
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 20 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 2 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+// Cancel download
+VCXMV CancelDownload SERVICE_2 20 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlCanceled
+waittestclass VCXMV // Dl canceled
+
+VCXMV WaitAllDownloads
+waittestclass VCXMV
+
+VCXMV CheckMediaCount E_DRIVE 2
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests multiple downloads: Starts three downloads, second is canceled.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30654 3 downloads, Cancel second download
+var CASE ET30654
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetPreferredMemory E_DRIVE
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 20 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 2 0 "mediacharger" "Buran_9o"
+//VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+//waittestclass VCXMV
+
+// Cancel download
+VCXMV CancelDownload SERVICE_2 20 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlCanceled
+waittestclass VCXMV // Dl canceled
+
+VCXMV WaitAllDownloads
+waittestclass VCXMV
+
+VCXMV CheckMediaCount E_DRIVE 2
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests multiple downloads: Starts three downloads, third is canceled.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30655 3 downloads, Cancel last download
+var CASE ET30655
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetPreferredMemory E_DRIVE
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 2 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 20 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+// Cancel download
+VCXMV CancelDownload SERVICE_2 20 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlCanceled
+waittestclass VCXMV // Dl canceled
+
+VCXMV WaitAllDownloads
+waittestclass VCXMV
+
+VCXMV CheckMediaCount E_DRIVE 2
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests multiple downloads: Starts three downloads, all are canceled.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30656 3 downloads, Cancel all
+var CASE ET30656
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetPreferredMemory E_DRIVE
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 20 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 2 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+// Cancel download
+VCXMV CancelDownload SERVICE_2 1 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlCanceled
+waittestclass VCXMV // Dl canceled
+
+// Cancel download
+VCXMV CancelDownload SERVICE_2 2 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlCanceled
+waittestclass VCXMV // Dl canceled
+
+// Cancel download
+VCXMV CancelDownload SERVICE_2 20 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlCanceled
+waittestclass VCXMV // Dl canceled
+
+VCXMV CheckMediaCount E_DRIVE 0
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests multiple downloads: Starts three downloads, pauses and resumes the first download.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30657 3 downloads, Pause and resume first download
+var CASE ET30657
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetPreferredMemory E_DRIVE
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 20 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 2 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+// Pause download
+VCXMV PauseDownload SERVICE_2 20 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlPaused
+waittestclass VCXMV
+
+VCXMV ResumeDownload DEFAULT_AP SERVICE_2 20 0 "mediacharger" "Buran_9o"
+
+VCXMV WaitAllDownloads
+waittestclass VCXMV
+
+VCXMV CheckMediaCount E_DRIVE 3
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests multiple downloads: Starts three downloads, pauses and resumes the second download.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30658 3 downloads, Pause and resume second download
+var CASE ET30658
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetPreferredMemory E_DRIVE
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 0 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 2 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+// Pause download
+VCXMV PauseDownload SERVICE_2 0 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlPaused
+waittestclass VCXMV
+
+VCXMV ResumeDownload DEFAULT_AP SERVICE_2 0 0 "mediacharger" "Buran_9o"
+
+VCXMV WaitAllDownloads
+waittestclass VCXMV
+
+VCXMV CheckMediaCount E_DRIVE 3
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests multiple downloads: Starts three downloads, pauses and resumes the third download.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30659 3 downloads, Pause and resume last download
+var CASE ET30659
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetPreferredMemory E_DRIVE
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 2 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 0 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+// Pause download
+VCXMV PauseDownload SERVICE_2 0 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlPaused
+waittestclass VCXMV
+
+VCXMV ResumeDownload DEFAULT_AP SERVICE_2 0 0 "mediacharger" "Buran_9o"
+
+VCXMV WaitAllDownloads
+waittestclass VCXMV
+
+VCXMV CheckMediaCount E_DRIVE 3
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests multiple downloads: Starts three downloads, pauses and resumes all the downloads.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30660 3 downloads, Pause and resume all
+var CASE ET30660
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetPreferredMemory E_DRIVE
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 2 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 3 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+// Pause download
+VCXMV PauseDownload SERVICE_2 3 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlPaused
+waittestclass VCXMV
+
+// Pause download
+VCXMV PauseDownload SERVICE_2 1 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlPaused
+waittestclass VCXMV
+
+// Pause download
+VCXMV PauseDownload SERVICE_2 2 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlPaused
+waittestclass VCXMV
+
+VCXMV ResumeDownload DEFAULT_AP SERVICE_2 3 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+
+VCXMV ResumeDownload DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+
+VCXMV ResumeDownload DEFAULT_AP SERVICE_2 2 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+
+VCXMV WaitAllDownloads
+waittestclass VCXMV
+
+VCXMV CheckMediaCount E_DRIVE 3
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests multiple downloads: Starts three downloads, pauses first, cancels second,
+#  waits third to finish and then resumes first download.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30661 3 downloads, pause 1st, cancel 2nd, wait 3rd, resume 1st
+var CASE ET30661
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetPreferredMemory E_DRIVE
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 20 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 2 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV PauseDownload SERVICE_2 1 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlPaused
+waittestclass VCXMV
+
+VCXMV CancelDownload SERVICE_2 20 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlCanceled
+waittestclass VCXMV
+
+VCXMV WaitAllDownloads
+waittestclass VCXMV
+
+VCXMV ResumeDownload DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+
+VCXMV WaitAllDownloads
+waittestclass VCXMV
+
+VCXMV CheckMediaCount E_DRIVE 2
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests multiple downloads: Starts three downloads, cancels first, pauses third, waits second and
+#  finally resumes third download.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30662 3 downloads, cancel 1st, pause 3rd, wait 2nd, resume 3rd
+var CASE ET30662
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetPreferredMemory E_DRIVE
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 20 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 0 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV CancelDownload SERVICE_2 20 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlCanceled
+waittestclass VCXMV
+
+VCXMV PauseDownload SERVICE_2 0 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlPaused
+waittestclass VCXMV
+
+VCXMV WaitAllDownloads
+waittestclass VCXMV
+
+VCXMV ResumeDownload DEFAULT_AP SERVICE_2 0 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV WaitAllDownloads
+waittestclass VCXMV
+
+VCXMV CheckMediaCount E_DRIVE 2
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests multiple downloads: Starts three downloads, pauses second, cancels third, waits first
+#  and resumes second download.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30663 3 downloads, pause 2nd, cancel 3rd, wait 1st, resume 2nd
+var CASE ET30663
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetPreferredMemory E_DRIVE
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 2 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 0 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 20 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete
+waittestclass VCXMV
+
+VCXMV PauseDownload SERVICE_2 0 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlPaused
+waittestclass VCXMV
+
+VCXMV CancelDownload SERVICE_2 20 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlCanceled
+waittestclass VCXMV
+
+VCXMV WaitAllDownloads
+waittestclass VCXMV
+
+VCXMV ResumeDownload DEFAULT_AP SERVICE_2 0 0 "mediacharger" "Buran_9o"
+
+VCXMV WaitAllDownloads
+waittestclass VCXMV
+
+VCXMV CheckMediaCount E_DRIVE 2
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests multiple downloads: Starts three downloads, pauses second one, cancels third,
+#  waits first to finish and resumes second download.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30664 3 downloads, pause 2nd, cancel 3rd, wait 1st, resume 2nd
+var CASE ET30664
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetPreferredMemory E_DRIVE
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 2 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 20 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+waittestclass VCXMV
+
+VCXMV PauseDownload SERVICE_2 1 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlPaused
+waittestclass VCXMV
+
+VCXMV CancelDownload SERVICE_2 20 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlCanceled
+waittestclass VCXMV
+
+VCXMV CoolDown
+
+VCXMV CancelDownload SERVICE_2 1 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlCanceled
+waittestclass VCXMV
+
+VCXMV CheckMediaCount E_DRIVE 1
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests multiple downloads: Starts three downloads, cancels first download, pauses third,
+#  waits second to finish and finally cancels third download.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30665 3 downloads, cancel 1st, pause 3rd, wait 2nd, cancel 3rd
+var CASE ET30665
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetPreferredMemory E_DRIVE
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 20 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete
+waittestclass VCXMV
+
+VCXMV Download DEFAULT_AP SERVICE_2 0 0 "mediacharger" "Buran_9o"
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete
+waittestclass VCXMV
+
+VCXMV CancelDownload SERVICE_2 20 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlCanceled
+waittestclass VCXMV
+
+VCXMV PauseDownload SERVICE_2 0 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlPaused
+waittestclass VCXMV
+
+VCXMV CoolDown
+
+VCXMV CancelDownload SERVICE_2 0 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDlCanceled
+waittestclass VCXMV
+
+VCXMV CheckMediaCount E_DRIVE 1
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXMyVideosCollectionPluginTestRobustness.cfg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,1051 @@
+#-----------------------------------------------------------------------------------
+#
+# STIF test script file for testing VCXMyVideosCollectionPluginTest.dll
+#
+#-----------------------------------------------------------------------------------
+
+[StifSettings]
+CapsModifier= IptvTestClientApiCapsMod.exe
+[EndStifSettings]
+
+[Define]
+INCLUDE c:\TestFramework\VCXMVCollectionPluginTest.inc
+INCLUDE c:\TestFramework\VCXDrives.inc
+INCLUDE c:\TestFramework\VCXConsts.inc
+INCLUDE c:\TestFramework\VCXErrors.inc
+LOOP1000 1000
+LOOP500  500
+LOOP250  250
+LOOP200  200
+LOOP100  100
+LOOP50   50
+LOOP20   20
+[Enddefine]
+
+#************************************************************************************
+# Sub Cleanup
+# Removes all videos from the phone. Collection is opened.
+#************************************************************************************
+[Sub Cleanup]
+print cleanup start
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV RemoveAllMedia
+delete VCXMV
+
+print wait 30sec
+pause 30000
+print cleanup end
+[EndSub]
+#************************************************************************************
+
+#------------------------------------------------------------------------------------
+#
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ETXXXXX <not a test> Setup
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+// Remove all videos
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetPreferredMemory C_DRIVE
+VCXMV SetSortingOrder EVcxMyVideosSortingNone
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV RemoveAllMedia
+
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+
+create VCXTestUtilModule Util
+// Copies some known 3G AP to "Internet" destination with "Internet" name for the AP.
+Util SetUsedDestination "Internet"
+Util CopyMethod "Internet" "Internet" "Internet"
+// Disable connection dialog for "Internet" destination.
+Util SetConnectionMethodIntAttribute "Internet" "Internet" 507 2 // 507 is ECmSeamlessnessLevel
+Util SetDefaultIapCenrep
+delete Util
+
+print OK!
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ETXXXXX Download 100 videos, one at a time
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV EnableStats "Download 100 videos, one at a time" "C:\logs\fusion\ETXXXXXstats.txt"
+
+VCXMV SetAutoResume 0
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+loop 100
+    VCXMV Download 3G_AP SERVICE_SMALLVIDEOS 1 0 "mediacharger" "Buran_9o"
+    VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+    waittestclass VCXMV // Dl complete
+    print LOOP_COUNTER / LOOP100
+    VCXMV CoolDown
+endloop
+
+VCXMV CoolDown
+
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ETXXXXX Download 100 videos 5 at once
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV EnableStats "Download 100 videos 5 at once" "C:\logs\fusion\ETXXXXXstats.txt"
+VCXMV SetAutoResume 0
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+loop 20
+    VCXMV Download 3G_AP SERVICE_SMALLVIDEOS 1 0 "mediacharger" "Buran_9o"
+    VCXMV Download 3G_AP SERVICE_SMALLVIDEOS 2 0 "mediacharger" "Buran_9o"
+    VCXMV Download 3G_AP SERVICE_SMALLVIDEOS 3 0 "mediacharger" "Buran_9o"
+    VCXMV Download 3G_AP SERVICE_SMALLVIDEOS 4 0 "mediacharger" "Buran_9o"
+    VCXMV Download 3G_AP SERVICE_SMALLVIDEOS 5 0 "mediacharger" "Buran_9o"
+    VCXMV CoolDown
+    print LOOP_COUNTER / LOOP20
+endloop
+
+VCXMV CoolDown
+
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+
+#------------------------------------------------------------------------------------
+#
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ETXXXXX Pause, resume and cancel download, 100 times
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV EnableStats "Pause, resume and cancel download, 100 times" "C:\logs\fusion\ETXXXXXstats.txt"
+VCXMV SetAutoResume 0
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+loop 100
+    VCXMV Download 3G_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+    VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlRunning
+    waittestclass VCXMV
+
+    VCXMV PauseDownload SERVICE_2 1 0
+    VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDlPaused
+    waittestclass VCXMV // Dl paused
+    
+    VCXMV ResumeDownload 3G_AP SERVICE_2 1 0 "mediacharger" "Buran_9o"
+    VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlRunning
+    waittestclass VCXMV // Dl complete
+
+    VCXMV CancelDownload SERVICE_2 1 0
+    VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete
+    waittestclass VCXMV // Dl canceled
+    
+    print LOOP_COUNTER / LOOP100
+    VCXMV CoolDown
+endloop
+
+VCXMV CoolDown
+
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ETXXXXX Sideload 100 videos, one at time
+
+callsub Cleanup
+
+// TESTCASE START
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV EnableStats "Sideload 100 videos, one at time" "C:\logs\fusion\ETXXXXXstats.txt"
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+loop 100
+    print delete LOOP_COUNTER / 100    
+    VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video LOOP_COUNTER .mp4"
+    VCXMV CoolDown
+endloop
+
+VCXMV CoolDown
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ETXXXXX Sideload and delete 200 videos, one at time
+
+callsub Cleanup
+
+// TESTCASE START
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV EnableStats "Sideload and delete 200 videos, one at time" "C:\logs\fusion\ETXXXXXstats.txt"
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+loop 200
+    VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video LOOP_COUNTER .mp4"
+    print Sideload LOOP_COUNTER / 200
+    VCXMV CoolDown
+    
+    VCXMV DeleteMedia ANY_DRIVE 0 0
+    VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageDeleteResp KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDeleteStarted KVCXMYVideosTestMessageMpxItemDeleted KVCXMYVideosTestMessageCollectionOpened
+    waittestclass VCXMV
+    
+    print delete LOOP_COUNTER / 200    
+    VCXMV CoolDown
+endloop
+
+VCXMV CoolDown
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ETXXXXX Sideload and delete 300 videos, 30 at once
+
+callsub Cleanup
+
+// TESTCASE START
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV EnableStats "Sideload 300 videos, 30 at once" "C:\logs\fusion\ETXXXXXstats.txt"
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+loop 10
+    VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video LOOP_COUNTER .mp4" 0 30
+    print Sideload LOOP_COUNTER / 10
+    VCXMV CoolDown
+    
+    VCXMV DeleteMedias C_DRIVE 0 30 0
+    VCXMV WaitForMessages 10MINUTES KVCXMYVideosTestMessageDeleteResp KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDeleteStarted KVCXMYVideosTestMessageCollectionOpened
+    waittestclass VCXMV
+    
+    print delete LOOP_COUNTER / 10
+    VCXMV CoolDown
+endloop
+
+VCXMV CoolDown
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ETXXXXX Cancel delete 30 videos for 20 times
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV EnableStats "Cancel delete 30 videos for 20 times" "C:\logs\fusion\ETXXXXXstats.txt"
+
+loop 20
+    // Create sideloaded videos
+    VCXMV EnsureDriveForVideos C_DRIVE 30 "video LOOP_COUNTER .mp4"
+    VCXMV CoolDown
+    
+    VCXMV CancelNextOperation
+    VCXMV DeleteMedias C_DRIVE 0 30 0
+    VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandCanceled
+    waittestclass VCXMV
+    
+    VCXMV CoolDown
+    print LOOP_COUNTER / LOOP20
+endloop
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+
+#------------------------------------------------------------------------------------
+#
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ETXXXXX Move video 200 times
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV EnableStats "Move video 200 times" "C:\logs\fusion\ETXXXXXstats.txt"
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+loop 100
+
+    VCXMV EnsureDriveForVideos E_DRIVE 0 
+    VCXMV EnsureDriveForVideos C_DRIVE 1 "video LOOP_COUNTER .mp4"
+
+    VCXMV MoveMedia C_DRIVE 0 E_DRIVE 0
+    VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMoveResp KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCopyOrMoveStarted
+    waittestclass VCXMV
+    VCXMV CoolDown
+    
+    VCXMV EnsureDriveForVideos C_DRIVE 0 
+    VCXMV EnsureDriveForVideos E_DRIVE 1 "video LOOP_COUNTER .mp4"
+    
+    VCXMV MoveMedia E_DRIVE 0 C_DRIVE 0
+    VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMoveResp KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCopyOrMoveStarted
+    waittestclass VCXMV
+    VCXMV CoolDown
+    
+    print LOOP_COUNTER / 100
+endloop
+
+VCXMV CoolDown
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+
+#------------------------------------------------------------------------------------
+#
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ETXXXXX Move 20 videos 100 times
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV EnableStats "Move 20 videos 100 times" "C:\logs\fusion\ETXXXXXstats.txt"
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+loop 50
+    VCXMV EnsureDriveForVideos E_DRIVE 0 
+    VCXMV EnsureDriveForVideos C_DRIVE 20 "video LOOP_COUNTER .mp4"
+    VCXMV CoolDown
+
+    VCXMV MoveMedias C_DRIVE 0 20 E_DRIVE 0
+    VCXMV WaitForMessages 10MINUTES KVCXMYVideosTestMessageMoveResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCommandComplete
+    waittestclass VCXMV
+    VCXMV CoolDown
+    
+    VCXMV EnsureDriveForVideos C_DRIVE 0 
+    VCXMV EnsureDriveForVideos E_DRIVE 20 "video LOOP_COUNTER .mp4"
+    VCXMV CoolDown
+
+    VCXMV MoveMedias E_DRIVE 0 20 C_DRIVE 0
+    VCXMV WaitForMessages 10MINUTES KVCXMYVideosTestMessageMoveResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCommandComplete
+    waittestclass VCXMV
+    VCXMV CoolDown
+
+    print LOOP_COUNTER / 50
+endloop
+
+VCXMV CoolDown
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+
+#------------------------------------------------------------------------------------
+#
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ETXXXXX Cancel move of 30 videos 50 times
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV EnableStats "Cancel move of 30 videos 50 times" "C:\logs\fusion\ETXXXXXstats.txt"
+
+    // Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+loop 50
+    VCXMV EnsureDriveForVideos E_DRIVE 0 
+    VCXMV EnsureDriveForVideos C_DRIVE 30 "video LOOP_COUNTER .mp4"
+    VCXMV CoolDown
+    
+    VCXMV CancelNextOperation
+    VCXMV MoveMedias C_DRIVE 0 30 E_DRIVE 0
+    VCXMV WaitForMessages 2MINUTES KVCXMYVideosTestMessageCommandCanceled
+    waittestclass VCXMV
+    VCXMV CoolDown
+
+    print LOOP_COUNTER / LOOP50
+endloop
+
+VCXMV CoolDown
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+
+#------------------------------------------------------------------------------------
+#
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ETXXXXX Copy video 200 times
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV EnableStats "Copy video 200 times" "C:\logs\fusion\ETXXXXXstats.txt"
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0.mp4"
+VCXMV CoolDown
+
+loop 200
+    VCXMV CopyMedia C_DRIVE 0 E_DRIVE 0
+    VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCopyResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCollectionItemChanged KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCollectionCategoryChanged
+    waittestclass VCXMV
+    print LOOP_COUNTER / 200
+    VCXMV CoolDown
+endloop
+
+VCXMV CoolDown
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+
+#------------------------------------------------------------------------------------
+#
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ETXXXXX Copy 20 videos 100 times
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV EnableStats "Copy 20 videos 100 times" "C:\logs\fusion\ETXXXXXstats.txt"
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+loop 100
+    VCXMV EnsureDriveForVideos C_DRIVE 20 "video LOOP_COUNTER .mp4"
+    VCXMV EnsureDriveForVideos E_DRIVE 0
+    VCXMV CoolDown
+    pause 60000
+
+    VCXMV CopyMedias C_DRIVE 0 20 E_DRIVE 0
+    VCXMV WaitForMessages 10MINUTES KVCXMYVideosTestMessageCopyResp KVCXMYVideosTestMessageCopyOrMoveStarted KVCXMYVideosTestMessageCommandComplete
+    waittestclass VCXMV
+    VCXMV CoolDown
+    
+    print LOOP_COUNTER / LOOP100
+endloop
+
+VCXMV CoolDown
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+
+#------------------------------------------------------------------------------------
+#
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ETXXXXX Cancel copy of 30 videos 50 times
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV EnableStats "Cancel copy of 30 videos 50 times" "C:\logs\fusion\ETXXXXXstats.txt"
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+loop 50
+    VCXMV EnsureDriveForVideos E_DRIVE 0 
+    VCXMV EnsureDriveForVideos C_DRIVE 30 "video LOOP_COUNTER .mp4"
+    VCXMV CoolDown
+    
+    VCXMV CancelNextOperation
+    VCXMV CopyMedias C_DRIVE 0 30 E_DRIVE 0
+    VCXMV WaitForMessages 2MINUTES KVCXMYVideosTestMessageCommandCanceled
+    waittestclass VCXMV
+    VCXMV CoolDown
+
+    print LOOP_COUNTER / LOOP50
+endloop
+
+VCXMV CoolDown
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+
+#------------------------------------------------------------------------------------
+#
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ETXXXXX GetMediasByMpxId - 50 videos, 100 times
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV EnableStats "GetMediasByMpxId 50 videos, 100 times" "C:\logs\fusion\ETXXXXXstats.txt"
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video.mp4" 0 50
+
+VCXMV CoolDown
+
+loop 100
+    // Almost all.
+    VCXMV GetMediasByMpxId 2 48
+    VCXMV WaitForMessages 10MINUTES KVCXMYVideosTestMessageGotMediasByKMpxId
+    waittestclass VCXMV
+
+    VCXMV RefreshContents
+    VCXMV WaitForMessages 10MINUTES KVCXMYVideosTestMessageCollectionOpened
+    waittestclass VCXMV
+
+    // Only first.
+    VCXMV GetMediasByMpxId 0 1
+    VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageGotMediasByKMpxId
+    waittestclass VCXMV
+    
+    VCXMV RefreshContents
+    VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+    waittestclass VCXMV
+    
+    // Only last.
+    VCXMV GetMediasByMpxId 19 20
+    VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageGotMediasByKMpxId
+    waittestclass VCXMV
+
+    VCXMV RefreshContents
+    VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+    waittestclass VCXMV
+    
+    // Only every second one.
+    VCXMV GetMediasByMpxId -3 50
+    VCXMV WaitForMessages 10MINUTES KVCXMYVideosTestMessageGotMediasByKMpxId
+    waittestclass VCXMV
+    
+    VCXMV RefreshContents
+    VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+    waittestclass VCXMV
+
+    print LOOP_COUNTER / LOOP100
+endloop
+
+VCXMV CoolDown
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+
+#------------------------------------------------------------------------------------
+#
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ETXXXXX Get media full details for 10 videos for 500 times.
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV EnableStats "Get media full details for 10 videos for 500 times." "C:\logs\fusion\ETXXXXXstats.txt"
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video.mp4" 0 10
+
+VCXMV CoolDown
+
+loop 500
+    VCXMV GetMediaFullDetails ANY_DRIVE 0
+    VCXMV GetMediaFullDetails ANY_DRIVE 1
+    VCXMV GetMediaFullDetails ANY_DRIVE 2
+    VCXMV GetMediaFullDetails ANY_DRIVE 3
+    VCXMV GetMediaFullDetails ANY_DRIVE 4
+    VCXMV GetMediaFullDetails ANY_DRIVE 5
+    VCXMV GetMediaFullDetails ANY_DRIVE 6
+    VCXMV GetMediaFullDetails ANY_DRIVE 7
+    VCXMV GetMediaFullDetails ANY_DRIVE 8
+    VCXMV GetMediaFullDetails ANY_DRIVE 9
+    
+    print LOOP_COUNTER / 500
+endloop
+
+VCXMV CoolDown
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ETXXXXX Repeat category change 200 times
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+callsub Cleanup
+
+// Setup all origins
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingName
+
+VCXMV SetFileCheck 0
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create some video objects.
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "a.mp4"
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "b.mp4"
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "c.mp4"
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "d.mp4"
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "e.mp4"
+
+VCXMV CoolDown
+
+VCXMV SetAutomaticRefresh 0
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "OriginOther"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginOther
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "OriginCamera"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginCapturedWithCamera
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 2
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "OriginDownloaded"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginDownloaded
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 3
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "OriginSideloaded"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginSideLoaded
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 4
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "OriginRecording"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginTvRecording
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV SetAutomaticRefresh 1
+
+VCXMV GetAllMediaFullDetails
+
+delete VCXMV
+
+pause 2000
+
+// TESTCASE START
+
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV EnableStats "Repeat category change 200 times" "C:\logs\fusion\ETXXXXXstats.txt"
+
+// Get list of videos
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+loop 200
+    
+    // All videos.
+    
+    VCXMV OpenLevel EVcxMyVideosAllVideos
+    VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+    waittestclass VCXMV
+    VCXMV CheckMediaCount ANY_DRIVE 5
+    
+    VCXMV CloseLevel
+    VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+    waittestclass VCXMV
+    VCXMV CoolDown
+    
+    // Downloads
+    
+    VCXMV OpenLevel EVcxMyVideosDownloads
+    VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+    waittestclass VCXMV
+    VCXMV CheckMediaCount ANY_DRIVE 1
+    
+    VCXMV CloseLevel
+    VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+    waittestclass VCXMV
+    VCXMV CoolDown
+    
+    // Recordings
+    
+    VCXMV OpenLevel EVcxMyVideosTvRecordings
+    VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+    waittestclass VCXMV
+    VCXMV CheckMediaCount ANY_DRIVE 1
+    
+    VCXMV CloseLevel
+    VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+    waittestclass VCXMV
+    VCXMV CoolDown
+
+    // Captured videos.
+    VCXMV OpenLevel EVcxMyVideosCapturedVideos
+    VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+    waittestclass VCXMV
+    VCXMV CheckMediaCount ANY_DRIVE 1
+
+    VCXMV CloseLevel
+    VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+    waittestclass VCXMV
+    VCXMV CoolDown
+
+    // Other videos.
+    
+    VCXMV OpenLevel EVcxMyVideosOther
+    VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+    waittestclass VCXMV
+    VCXMV CheckMediaCount ANY_DRIVE 2    
+    
+    VCXMV CloseLevel
+    VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+    waittestclass VCXMV
+    VCXMV CoolDown
+
+    print LOOP_COUNTER / LOOP200
+endloop
+
+print OK!
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXMyVideosCollectionPluginTestSideload.cfg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,684 @@
+#-----------------------------------------------------------------------------------
+#
+# STIF test script file for testing VCXMyVideosCollectionPluginTest.dll
+#
+# Tests functionality for sideloading video files.
+#
+#-----------------------------------------------------------------------------------
+
+[StifSettings]
+CapsModifier= IptvTestClientApiCapsMod.exe
+[EndStifSettings]
+
+[Define]
+INCLUDE c:\TestFramework\VCXMVCollectionPluginTest.inc
+INCLUDE c:\TestFramework\VCXDrives.inc
+INCLUDE c:\TestFramework\VCXConsts.inc
+INCLUDE c:\TestFramework\VCXErrors.inc
+[Enddefine]
+
+#************************************************************************************
+# Sub Cleanup
+# Removes all videos from the phone. Collection is opened.
+#************************************************************************************
+[Sub Cleanup]
+print cleanup start
+create  VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV RemoveAllMedia
+delete VCXMV
+
+print wait 30sec
+pause 30000
+print cleanup end
+[EndSub]
+#************************************************************************************
+
+#************************************************************************************
+# Sub CreateVideo
+# Create a single video file with case id attached in the filename
+#************************************************************************************
+[Sub CreateVideo]
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video CASE .mp4"
+[EndSub]
+
+#------------------------------------------------------------------------------------
+#
+#  Does configuration for cases in this script.
+#  Creates 'Internet' IAP into 'Internet' destination and sets connection as authorized.
+#  Sets preferred memory to first used drive and sorting order to none.
+#  Removes all video files from the device.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30200 <not a test> Setup
+var CASE ET30200
+
+create VCXTestUtilModule Util
+// Copies some known 3G AP to "Internet" destination with "Internet" name for the AP.
+Util SetUsedDestination "Internet"
+Util CopyMethod "Internet" "Internet" "Internet"
+// Disable connection dialog for "Internet" destination.
+Util SetConnectionMethodIntAttribute "Internet" "Internet" 507 2 // 507 is ECmSeamlessnessLevel
+Util SetDefaultIapCenrep
+delete Util
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetPreferredMemory E_DRIVE
+VCXMV SetSortingOrder EVcxMyVideosSortingNone
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV RemoveAllMedia
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 0
+delete VCXMV
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests sideloading video to device when 'All videos' category is open.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30207 Sideload video while category is open.
+var CASE ET30207
+
+callsub Cleanup
+
+// TESTCASE START
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+callsub CreateVideo
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralFlags EVcxMyVideosVideoNew
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginOther
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests sideloading video to 1st drive.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30208 Sideload video 1st drive
+var CASE ET30208
+
+callsub Cleanup
+
+// TESTCASE START
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+callsub CreateVideo
+
+pause PAUSE_SIDELOAD
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralFlags EVcxMyVideosVideoNew
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests fetching video details for sideloaded video on 1st drive.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30209 Get sideloaded video details 1st drive
+var CASE ET30209
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV GetMediaFullDetails ANY_DRIVE 0
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests deleting sideloaded video details from 1st drive.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30210 Delete sideloaded video 1st drive
+var CASE ET30210
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV DeleteFileOfMedia ANY_DRIVE 0
+
+pause PAUSE_SIDELOAD
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 0
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests sideloading video to second drive.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30211 Sideload video 2nd drive
+var CASE ET30211
+
+callsub Cleanup
+
+// TESTCASE START
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+callsub CreateVideo
+
+pause PAUSE_SIDELOAD
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 1
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests fetching video details for sideloaded video on second drive.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30212 Get sideloaded video details 2nd drive
+var CASE ET30212
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV GetMediaFullDetails ANY_DRIVE 0
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests deleting file of a sideloaded video from second drive.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30213 Delete sideloaded video 2nd drive
+var CASE ET30213
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV DeleteFileOfMedia ANY_DRIVE 0
+
+pause PAUSE_SIDELOAD
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 0
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests sideloading multiple videos at the same time to the device.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30214 Sideload multiple videos
+var CASE ET30214
+
+callsub Cleanup
+
+// TESTCASE START
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0 CASE .mp4"
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video1 CASE .mp4"
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video2 CASE .mp4"
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video3 CASE .mp4"
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video4 CASE .mp4"
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video5 CASE .mp4"
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video6 CASE .mp4"
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video7 CASE .mp4"
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video8 CASE .mp4"
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video9 CASE .mp4"
+
+pause PAUSE_SIDELOAD
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 10
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests fetching video details for all videos.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30215 Get sideloaded video details for all videos
+var CASE ET30215
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+loop 10
+print Details LOOP_COUNTER
+VCXMV GetMediaFullDetails ANY_DRIVE LOOP_COUNTER
+endloop
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests deleting files of videos for multiple sideloaded videos.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30216 Delete multiple sideloaded videos
+var CASE ET30216
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV DeleteFilesOfAllMedias
+
+pause PAUSE_SIDELOAD
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 0
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests sideloading videos to multiple drives at the same time.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30217 Sideload videos to 1st and 2nd drive
+var CASE ET30217
+
+callsub Cleanup
+
+// TESTCASE START
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV CreateVideoFile IptvTestVideoMpeg4 C_DRIVE "video0 CASE .mp4"
+pause 1000
+VCXMV CreateVideoFile IptvTestVideoMpeg4 E_DRIVE "video1 CASE .mp4"
+
+pause PAUSE_SIDELOAD
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 2
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests deleting files of sideloaded videos from multiple drives.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30218 Delete sideloaded video from 1st and 2nd drive
+var CASE ET30218
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV DeleteFileOfMedia ANY_DRIVE 0
+VCXMV DeleteFileOfMedia ANY_DRIVE 1
+
+pause PAUSE_SIDELOAD
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 0
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests sideloading videos with different codecs.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30219 Sideload videos - different codecs
+var CASE ET30219
+
+callsub Cleanup
+
+// TESTCASE START
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV CreateVideoFile  IptvTestVideo3Gp             C_DRIVE "video1 CASE .3gp"
+VCXMV CreateVideoFile  IptvTestVideo3Gp2            C_DRIVE "video2 CASE .3gp"
+VCXMV CreateVideoFile  IptvTestVideoMpeg4           C_DRIVE "video3 CASE .mp4"
+VCXMV CreateVideoFile  IptvTestVideoMpeg4           C_DRIVE "video4 CASE .m4v"
+VCXMV CreateVideoFile  IptvTestVideoRealVideo       C_DRIVE "video5 CASE .rm"
+VCXMV CreateVideoFile  IptvTestVideoWmv             C_DRIVE "video6 CASE .wmv"
+VCXMV CreateVideoFile  IptvTestVideoMpeg4           C_DRIVE "video7 CASE .mp4"
+VCXMV CreateVideoFile  IptvTestVideoQuicktime       C_DRIVE "video8 CASE .mp4"
+VCXMV CreateVideoFile  IptvTestVideoAviAC3          C_DRIVE "video9 CASE .avi"
+//VCXMV CreateVideoFile  IptvTestVideoMpeg4           C_DRIVE "video9.dcf" // Cannot be deleted so do not use.
+
+// These are not supported.
+//VCXMV CreateVideoFile  IptvTestVideoMpeg4           C_DRIVE "video42.avi"
+//VCXMV CreateVideoFile  IptvTestVideoAvi             C_DRIVE "video10.mp4"
+//VCXMV CreateVideoFile  IptvTestVideoMp2             C_DRIVE "video11.mp4"
+//VCXMV CreateVideoFile  IptvTestVideoSuperVideoCd    C_DRIVE "video12.mp4"
+//VCXMV CreateVideoFile  IptvTestVideoAppleMpeg       C_DRIVE "video13.mp4"
+//VCXMV CreateVideoFile  IptvTestVideoMpegAvc         C_DRIVE "video14.mp4"
+
+pause PAUSE_SIDELOAD
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 9
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests getting details of sideloaded videos with different codecs.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30220 Get sideloaded video details - different codecs
+var CASE ET30220
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+loop 9
+print Details LOOP_COUNTER
+VCXMV GetMediaFullDetails ANY_DRIVE LOOP_COUNTER
+endloop
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests deleting files of videos with multiple codecs.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30221 Delete sideloaded videos - different codecs
+var CASE ET30221
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV DeleteFilesOfAllMedias
+
+pause PAUSE_SIDELOAD
+
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 0
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that files without video file extensions are not added to collection.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30222 Sideload videos - bad file extensions
+var CASE ET30222
+
+callsub Cleanup
+
+// TESTCASE START
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetDeleteSideloadedVideos 1
+VCXMV CreateVideoFile  IptvTestVideoMpeg4 C_DRIVE "video02.3gp2x"
+VCXMV CreateVideoFile  IptvTestVideoMpeg4 C_DRIVE "video03.mp4x"
+VCXMV CreateVideoFile  IptvTestVideoMpeg4 C_DRIVE "video04.m4vx"
+VCXMV CreateVideoFile  IptvTestVideoMpeg4 C_DRIVE "video05.rmx"
+VCXMV CreateVideoFile  IptvTestVideoMpeg4 C_DRIVE "video06.3g2x"
+VCXMV CreateVideoFile  IptvTestVideoMpeg4 C_DRIVE "video07.dcfx"
+VCXMV CreateVideoFile  IptvTestVideoMpeg4 C_DRIVE "video08.dmx"
+VCXMV CreateVideoFile  IptvTestVideoMpeg4 C_DRIVE "video11.x3gp"
+VCXMV CreateVideoFile  IptvTestVideoMpeg4 C_DRIVE "video12.x3gp2"
+VCXMV CreateVideoFile  IptvTestVideoMpeg4 C_DRIVE "video13.xmp4"
+VCXMV CreateVideoFile  IptvTestVideoMpeg4 C_DRIVE "video14.xm4v"
+VCXMV CreateVideoFile  IptvTestVideoMpeg4 C_DRIVE "video15.xrm"
+VCXMV CreateVideoFile  IptvTestVideoMpeg4 C_DRIVE "video16.x3g2"
+VCXMV CreateVideoFile  IptvTestVideoMpeg4 C_DRIVE "video17.xdcf"
+VCXMV CreateVideoFile  IptvTestVideoMpeg4 C_DRIVE "video18.xdm"
+VCXMV CreateVideoFile  IptvTestVideoMpeg4 C_DRIVE "video21.3g"
+VCXMV CreateVideoFile  IptvTestVideoMpeg4 C_DRIVE "video22.3p2"
+VCXMV CreateVideoFile  IptvTestVideoMpeg4 C_DRIVE "video23.mp"
+VCXMV CreateVideoFile  IptvTestVideoMpeg4 C_DRIVE "video24.m4"
+VCXMV CreateVideoFile  IptvTestVideoMpeg4 C_DRIVE "video25.r"
+VCXMV CreateVideoFile  IptvTestVideoMpeg4 C_DRIVE "video26.3g"
+VCXMV CreateVideoFile  IptvTestVideoMpeg4 C_DRIVE "video27.dc"
+VCXMV CreateVideoFile  IptvTestVideoMpeg4 C_DRIVE "video28.d"
+VCXMV CreateVideoFile  IptvTestVideoMpeg4 C_DRIVE "video31.gp"
+VCXMV CreateVideoFile  IptvTestVideoMpeg4 C_DRIVE "video32.gp2"
+VCXMV CreateVideoFile  IptvTestVideoMpeg4 C_DRIVE "video33.p4"
+VCXMV CreateVideoFile  IptvTestVideoMpeg4 C_DRIVE "video34.4v"
+VCXMV CreateVideoFile  IptvTestVideoMpeg4 C_DRIVE "video35.m"
+VCXMV CreateVideoFile  IptvTestVideoMpeg4 C_DRIVE "video36.g2"
+VCXMV CreateVideoFile  IptvTestVideoMpeg4 C_DRIVE "video37.cf"
+VCXMV CreateVideoFile  IptvTestVideoMpeg4 C_DRIVE "video38.m"
+VCXMV CreateVideoFile  IptvTestVideoMpeg4 C_DRIVE "video41.divx"
+VCXMV CreateVideoFile  IptvTestVideoMpeg4 C_DRIVE "video44.mov"
+VCXMV CreateVideoFile  IptvTestVideoMpeg4 C_DRIVE "video46.swf"
+VCXMV CreateVideoFile  IptvTestVideoMpeg4 C_DRIVE "video47.mpg"
+VCXMV CreateVideoFile  IptvTestVideoMpeg4 C_DRIVE "video48.mp3"
+VCXMV CreateVideoFile  IptvTestVideoMpeg4 C_DRIVE "video50.wav"
+VCXMV CreateVideoFile  IptvTestVideoMpeg4 C_DRIVE "video51."
+VCXMV CreateVideoFile  IptvTestVideoMpeg4 C_DRIVE "video52.."
+VCXMV CreateVideoFile  IptvTestVideoMpeg4 C_DRIVE ".video54.mov."
+VCXMV CreateVideoFile  IptvTestVideoMpeg4 C_DRIVE "xvideo563gp"
+VCXMV CreateVideoFile  IptvTestVideoMpeg4 C_DRIVE "video57."
+VCXMV CreateVideoFile  IptvTestVideoMpeg4 C_DRIVE "video58.xxxxxxxxxxx"
+VCXMV CreateVideoFile  IptvTestVideoMpeg4 C_DRIVE "video59.xxxxxxxxxxxxxxxxxxxxxxxxx"
+VCXMV CreateVideoFile  IptvTestVideoMpeg4 C_DRIVE "video60.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
+
+pause PAUSE_SIDELOAD
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 0
+print OK!
+delete VCXMV
+[Endtest]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXMyVideosCollectionPluginTestSorting.cfg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,3192 @@
+#-----------------------------------------------------------------------------------
+#
+# STIF test script file for testing VCXMyVideosCollectionPluginTest.dll
+#
+# Tests functionality for sorting video files.
+#
+#-----------------------------------------------------------------------------------
+
+[StifSettings]
+CapsModifier= IptvTestClientApiCapsMod.exe
+[EndStifSettings]
+
+[Define]
+INCLUDE c:\TestFramework\VCXMVCollectionPluginTest.inc
+INCLUDE c:\TestFramework\VCXDrives.inc
+INCLUDE c:\TestFramework\VCXConsts.inc
+INCLUDE c:\TestFramework\VCXErrors.inc
+[Enddefine]
+
+#-----------------------------------------------------------------------------------
+# Sub Cleanup
+# Removes all videos from the phone. Collection is opened.
+#-----------------------------------------------------------------------------------
+[Sub Cleanup]
+print cleanup start
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV GetAllMediaFullDetails
+
+VCXMV RemoveAllMedia
+VCXMV CheckMediaCount ANY_DRIVE 0
+
+print Cleanup OK!
+delete VCXMV
+
+print wait 30sec
+pause 30000
+print cleanup end
+[EndSub]
+#-----------------------------------------------------------------------------------
+
+#-----------------------------------------------------------------------------------
+# Sub SetupVideos
+# Creates 3 videos to drive defined by constant C_DRIVE. Creation and modified
+# dates are set at file creation. Videos listed in creation order:
+#   3.mp4, attributes: title: c, size 51000 bytes
+#   1.mp4, attributes: title: a, size 49000 bytes
+#   2.mp4, attributes: title: b, size 50000 bytes
+# Parameters:
+#  OPTION_ORIGIN origin attribute for videos
+#-----------------------------------------------------------------------------------
+[Sub SetupVideos]
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetSortingOrder EVcxMyVideosSortingName
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create some video objects.
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "1.mp4"
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "2.mp4"
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "3.mp4"
+pause 1000
+
+VCXMV SetAutomaticRefresh 0
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "c"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDateCurrent
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 50000
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin OPTION_ORIGIN
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDateCurrent
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 49000
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin OPTION_ORIGIN
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 2
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "b"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDateCurrent
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 51000
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin OPTION_ORIGIN
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV SetAutomaticRefresh 1
+
+delete VCXMV
+[EndSub]
+
+#------------------------------------------------------------------------------------
+#
+#  Does configuration for cases in this script.
+#  Creates 'Internet' IAP into 'Internet' destination and sets connection as authorized.
+#  Sets preferred memory to first used drive and sorting order to none.
+#  Removes all video files from the device.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30800 <not a test> Setup origin to downloaded
+var CASE ET30800
+
+create VCXTestUtilModule Util
+
+Util SetUsedDestination "Internet"
+// Copies some known 3G AP to "Internet" destination with "Internet" name for the AP.
+Util CopyMethod "Internet" "Internet" "Internet"
+// Disable connection dialog for "Internet" destination.
+Util SetConnectionMethodIntAttribute "Internet" "Internet" 507 2 // 507 is ECmSeamlessnessLevel
+Util SetDefaultIapCenrep
+delete Util
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetPreferredMemory E_DRIVE
+VCXMV SetSortingOrder EVcxMyVideosSortingNone
+delete VCXMV
+
+callsub Cleanup
+
+var OPTION_ORIGIN EVcxMyVideosOriginDownloaded
+callsub SetupVideos
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests getting video list of category 'All videos' when videos are sorted by nothing.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30801 EVcxMyVideosAllVideos - EVcxMyVideosSortingNone
+var CASE ET30801
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetSortingOrder EVcxMyVideosSortingNone
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Check count. Order can be anything.
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests getting video list of category 'All videos' when videos are sorted by ID.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30802 EVcxMyVideosAllVideos - EVcxMyVideosSortingId
+var CASE ET30802
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingId
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Check count and sort order
+VCXMV CheckMediaCount ANY_DRIVE 3
+VCXMV GetAllMediaFullDetails
+
+// SORTING ORDER NOT SUPPORTED
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests getting video list of category 'All videos' when videos are sorted by creation date.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30803 EVcxMyVideosAllVideos - EVcxMyVideosSortingCreationDate
+var CASE ET30803
+
+// Check video sorting
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingCreationDate
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Check count and sort order
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+VCXMV GetAllMediaFullDetails
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests getting video list of category 'All videos' when videos are sorted by modified date.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30804 EVcxMyVideosAllVideos - EVcxMyVideosSortingModified
+var CASE ET30804
+
+// Check order
+
+// ORDER NOT SUPPORTED SO NO CHECKING!
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingModified
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV GetAllMediaFullDetails
+
+//VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+//VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+//VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "e"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests getting video list of category 'All videos' when videos are sorted by name.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30805 EVcxMyVideosAllVideos - EVcxMyVideosSortingName
+var CASE ET30805
+
+// Check sorting
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingName
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests getting video list of category 'All videos' when videos are sorted by size.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30806 EVcxMyVideosAllVideos - EVcxMyVideosSortingSize
+var CASE ET30806
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingSize
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'Downloads' when videos are sorted by nothing.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30831 EVcxMyVideosDownloads - EVcxMyVideosSortingNone
+var CASE ET30831
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetSortingOrder EVcxMyVideosSortingNone
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosDownloads
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Check count. Order can be anything.
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'Downloads' when videos are sorted by id.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30832 EVcxMyVideosDownloads - EVcxMyVideosSortingId
+var CASE ET30832
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingId
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosDownloads
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Check count and sort order
+VCXMV CheckMediaCount ANY_DRIVE 3
+VCXMV GetAllMediaFullDetails
+
+// SORTING ORDER NOT SUPPORTED
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'Downloads' when videos are sorted by creation date.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30833 EVcxMyVideosDownloads - EVcxMyVideosSortingCreationDate
+var CASE ET30833
+
+// Check video sorting
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingCreationDate
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosDownloads
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Check count and sort order
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+VCXMV GetAllMediaFullDetails
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'Downloads' when videos are sorted by modified date.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30834 EVcxMyVideosDownloads - EVcxMyVideosSortingModified
+var CASE ET30834
+
+// Check order
+
+// ORDER NOT SUPPORTED SO NO CHECKING!
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingModified
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosDownloads
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV GetAllMediaFullDetails
+
+//VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+//VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+//VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "e"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'Downloads' when videos are sorted by name.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30835 EVcxMyVideosDownloads - EVcxMyVideosSortingName
+var CASE ET30835
+
+// Check sorting
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingName
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosDownloads
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'Downloads' when videos are sorted by size.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30836 EVcxMyVideosDownloads - EVcxMyVideosSortingSize
+var CASE ET30836
+
+// Get videos sorted
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingSize
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosDownloads
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+# Setup for other origin videos
+#------------------------------------------------------------------------------------
+[Test]
+title ET30899 <not a test> Setup origin to other
+var CASE ET30899
+
+create VCXTestUtilModule Util
+
+// Copies some known 3G AP to "Internet" destination with "Internet" name for the AP.
+Util SetUsedDestination "Internet"
+Util CopyMethod "Internet" "Internet" "Internet"
+// Disable connection dialog for "Internet" destination.
+Util SetConnectionMethodIntAttribute "Internet" "Internet" 507 2 // 507 is ECmSeamlessnessLevel
+Util SetDefaultIapCenrep
+delete Util
+
+create VCXTestUtilModule Util
+Util CreateMobilecrashWatcher
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetPreferredMemory E_DRIVE
+VCXMV SetSortingOrder EVcxMyVideosSortingNone
+delete VCXMV
+
+callsub Cleanup
+
+var OPTION_ORIGIN EVcxMyVideosOriginOther
+callsub SetupVideos
+
+Util CheckMobilecrashes
+pause 1000
+delete Util
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'Other' when videos are sorted by nothing.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30861 EVcxMyVideosOther - EVcxMyVideosSortingNone
+var CASE ET30861
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV SetSortingOrder EVcxMyVideosSortingNone
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosOther
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Check count. Order can be anything.
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'Other' when videos are sorted by ID.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30862 EVcxMyVideosOther - EVcxMyVideosSortingId
+var CASE ET30862
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingId
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosOther
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Check count and sort order
+VCXMV CheckMediaCount ANY_DRIVE 3
+VCXMV GetAllMediaFullDetails
+
+// SORTING ORDER NOT SUPPORTED
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'Other' when videos are sorted by creation date.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30863 EVcxMyVideosOther - EVcxMyVideosSortingCreationDate
+var CASE ET30863
+
+// Check video sorting
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingCreationDate
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosOther
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Check count and sort order
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+VCXMV GetAllMediaFullDetails
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'Other' when videos are sorted by modified date.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30864 EVcxMyVideosOther - EVcxMyVideosSortingModified
+var CASE ET30864
+
+// Check order
+
+// ORDER NOT SUPPORTED SO NO CHECKING!
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingModified
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosOther
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV GetAllMediaFullDetails
+
+//VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+//VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+//VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "e"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'Other' when videos are sorted by name.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30865 EVcxMyVideosOther - EVcxMyVideosSortingName
+var CASE ET30865
+
+// Check sorting
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingName
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosOther
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'Other' when videos are sorted by size.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30866 EVcxMyVideosOther - EVcxMyVideosSortingSize
+var CASE ET30866
+
+// Get videos sorted
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingSize
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosOther
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'All videos' when video is removed
+#  and videos are sorted by name.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30813 EVcxMyVideosAllVideos - EVcxMyVideosSortingName, remove video
+var CASE ET30813
+
+callsub Cleanup
+
+var OPTION_ORIGIN EVcxMyVideosOriginDownloaded
+callsub SetupVideos
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingName
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Check count and sort order
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+
+// Remove one of them
+
+VCXMV RemoveMedia ANY_DRIVE 1 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 2
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'All videos' when video is removed
+#  and videos are sorted by nothing.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30814 EVcxMyVideosAllVideos - EVcxMyVideosSortingNone, remove video
+var CASE ET30814
+
+callsub Cleanup
+
+var OPTION_ORIGIN EVcxMyVideosOriginDownloaded
+callsub SetupVideos
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingNone
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+// Remove one of them
+
+VCXMV RemoveMedia ANY_DRIVE 1 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 2
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'All videos' when video is removed
+#  and videos are sorted by ID.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30815 EVcxMyVideosAllVideos - EVcxMyVideosSortingId, remove video
+var CASE ET30815
+
+callsub Cleanup
+
+var OPTION_ORIGIN EVcxMyVideosOriginDownloaded
+callsub SetupVideos
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingId
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// ORDER NOT SUPPORTED, NO CHECKING
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+//VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+//VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+//VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+
+// Remove one of them
+
+VCXMV RemoveMedia ANY_DRIVE 1 0
+
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 2
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'All videos' when video is removed
+#  and videos are sorted by creation date.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30816 EVcxMyVideosAllVideos - EVcxMyVideosSortingCreationDate, remove video
+var CASE ET30816
+
+callsub Cleanup
+
+var OPTION_ORIGIN EVcxMyVideosOriginDownloaded
+callsub SetupVideos
+
+// Get videos sorted
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingCreationDate
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+
+// Remove one of them
+
+VCXMV RemoveMedia ANY_DRIVE 1 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 2
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'All videos' when video is removed
+#  and videos are sorted by modified date.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30817 EVcxMyVideosAllVideos - EVcxMyVideosSortingModified, remove video
+var CASE ET30817
+
+callsub Cleanup
+
+var OPTION_ORIGIN EVcxMyVideosOriginDownloaded
+callsub SetupVideos
+
+// Get videos sorted
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingModified
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// NOT SUPPORTED SO NO CHECKING
+
+// Check count and sort order
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+//VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+//VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+//VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+
+// Remove one of them
+
+VCXMV RemoveMedia ANY_DRIVE 1 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 2
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'All videos' when video is removed
+#  and videos are sorted by size.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30818 EVcxMyVideosAllVideos - EVcxMyVideosSortingSize, remove video
+var CASE ET30818
+
+callsub Cleanup
+
+var OPTION_ORIGIN EVcxMyVideosOriginDownloaded
+callsub SetupVideos
+
+// Get videos sorted
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingSize
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+
+// Remove one of them
+
+VCXMV RemoveMedia ANY_DRIVE 1 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 2
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'All videos' when video is modifed
+#  so that order changes and videos are sorted by name.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30819 EVcxMyVideosAllVideos - EVcxMyVideosSortingName, modify video
+var CASE ET30819
+
+callsub Cleanup
+
+var OPTION_ORIGIN EVcxMyVideosOriginDownloaded
+callsub SetupVideos
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingName
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Check count and sort order
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+
+// Modify one of the videos and check order
+VCXMV CreateCopyOfMedia ANY_DRIVE 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "x"
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMyVideosTestMessageVideoListOrderChanged KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "x"
+
+// Modify one of the videos and check order
+VCXMV CreateCopyOfMedia ANY_DRIVE 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "0"
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMyVideosTestMessageVideoListOrderChanged KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "0"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "x"
+
+// Modify one of the videos and check order
+VCXMV CreateCopyOfMedia ANY_DRIVE 2
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "1"
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMyVideosTestMessageVideoListOrderChanged KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "0"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "1"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'All videos' when video is modifed
+#  and videos are sorted by nothing.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30820 EVcxMyVideosAllVideos - EVcxMyVideosSortingNone, modify video
+var CASE ET30820
+
+callsub Cleanup
+
+var OPTION_ORIGIN EVcxMyVideosOriginDownloaded
+callsub SetupVideos
+
+// Get videos sorted
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingNone
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+// Modify one of the videos and check order
+VCXMV CreateCopyOfMedia ANY_DRIVE 1
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "x"
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 0
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDateCurrent
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDownloadId 11
+
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "x"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'All videos' when video is modifed
+#  and videos are sorted by id.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30821 EVcxMyVideosAllVideos - EVcxMyVideosSortingId, modify video
+var CASE ET30821
+
+callsub Cleanup
+
+var OPTION_ORIGIN EVcxMyVideosOriginDownloaded
+callsub SetupVideos
+
+// Get videos sorted
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingId
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+//VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+//VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+//VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+
+VCXMV GetAllMediaFullDetails
+
+// Modify one of the videos and check order
+VCXMV CreateCopyOfMedia ANY_DRIVE 1
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "x"
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 0
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDateCurrent
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDownloadId 11
+
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+//VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+//VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "x"
+//VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'All videos' when video is modifed
+#  and videos are sorted by modified date.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30822 EVcxMyVideosAllVideos - EVcxMyVideosSortingModified, modify video
+var CASE ET30822
+
+callsub Cleanup
+
+var OPTION_ORIGIN EVcxMyVideosOriginDownloaded
+callsub SetupVideos
+
+// Get videos sorted
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingModified
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+// NOT SUPPORTED SO NO CHECKING
+
+//VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+//VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+//VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 1
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDateCurrent
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV GetAllMediaFullDetails
+
+//VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+//VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+//VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'All videos' when video is modifed
+#  so that order changes and videos are sorted by size.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30823 EVcxMyVideosAllVideos - EVcxMyVideosSortingSize, modify video
+var CASE ET30823
+
+callsub Cleanup
+
+var OPTION_ORIGIN EVcxMyVideosOriginDownloaded
+callsub SetupVideos
+
+// The test case
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingSize
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Check count and sort order
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a" // 49k
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "c" // 50k
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "b" // 51k
+
+// Modify one of the videos and check order
+VCXMV CreateCopyOfMedia ANY_DRIVE 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 48000
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMyVideosTestMessageVideoListOrderChanged KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+
+// Modify one of the videos and check order
+VCXMV CreateCopyOfMedia ANY_DRIVE 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 60000
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMyVideosTestMessageVideoListOrderChanged KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+
+// Modify one of the videos and check order
+VCXMV CreateCopyOfMedia ANY_DRIVE 2
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 40000
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMyVideosTestMessageVideoListOrderChanged KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'All videos' when sorting order
+#  changes because video is added by sideloading. Videos are sorted by name.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30824 EVcxMyVideosAllVideos - EVcxMyVideosSortingName, sideload video
+var CASE ET30824
+
+callsub Cleanup
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingName
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create some video objects.
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "video3.mp4" 52000
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "video0.mp4" 50000
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "video2.mp4" 51000
+pause 1000
+
+delete VCXMV
+
+// Get videos sorted
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingName
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "video0"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "video2"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "video3"
+
+// Sideload video
+
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "video1.mp4"
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "video0"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "video1"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "video2"
+VCXMV CheckMediaDetail ANY_DRIVE 3 EVcxTestMapping_KMPXMediaGeneralTitle "video3"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'All videos' when sorting order
+#  changes because video is added by download. Videos are sorted by name.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30825 EVcxMyVideosAllVideos - EVcxMyVideosSortingName, download video
+var CASE ET30825
+
+callsub Cleanup
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingName
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create some video objects.
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "small3.mp4" 52000
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "small2.mp4" 50000
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "small0.mp4" 51000
+pause 1000
+
+delete VCXMV
+
+// Get videos sorted
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingName
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "small0"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "small2"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "small3"
+
+// Download video
+
+VCXMV Download 3G_AP SERVICE_SMALLVIDEOS 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "small0"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "small1"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "small2"
+VCXMV CheckMediaDetail ANY_DRIVE 3 EVcxTestMapping_KMPXMediaGeneralTitle "small3"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'Downloads' when video is
+#  removed and videos are sorted by name.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30843 EVcxMyVideosDownloads - EVcxMyVideosSortingName, remove video
+var CASE ET30843
+
+callsub Cleanup
+
+var OPTION_ORIGIN EVcxMyVideosOriginDownloaded
+callsub SetupVideos
+
+// Get videos sorted
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingName
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosDownloads
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Check count and sort order
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+
+// Remove one of them
+
+VCXMV RemoveMedia ANY_DRIVE 1 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 2
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'Downloads' when video is
+#  removed and videos are sorted by nothing.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30844 EVcxMyVideosDownloads - EVcxMyVideosSortingNone, remove video
+var CASE ET30844
+
+callsub Cleanup
+
+var OPTION_ORIGIN EVcxMyVideosOriginDownloaded
+callsub SetupVideos
+
+// Get videos sorted
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingNone
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosDownloads
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+// Remove one of them
+
+VCXMV RemoveMedia ANY_DRIVE 1 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 2
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'Downloads' when video is
+#  removed and videos are sorted by ID.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30845 EVcxMyVideosDownloads - EVcxMyVideosSortingId, remove video
+var CASE ET30845
+
+callsub Cleanup
+
+var OPTION_ORIGIN EVcxMyVideosOriginDownloaded
+callsub SetupVideos
+
+// Get videos sorted
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingId
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosDownloads
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// ORDER NOT SUPPORTED, NO CHECKING
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+//VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+//VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+//VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+
+// Remove one of them
+
+VCXMV RemoveMedia ANY_DRIVE 1 0
+
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 2
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'Downloads' when video is
+#  removed and videos are sorted by creation date.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30846 EVcxMyVideosDownloads - EVcxMyVideosSortingCreationDate, remove video
+var CASE ET30846
+
+callsub Cleanup
+
+var OPTION_ORIGIN EVcxMyVideosOriginDownloaded
+callsub SetupVideos
+
+// Get videos sorted
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingCreationDate
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosDownloads
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+
+// Remove one of them
+
+VCXMV RemoveMedia ANY_DRIVE 1 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 2
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'Downloads' when video is
+#  removed and videos are sorted by modified date.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30847 EVcxMyVideosDownloads - EVcxMyVideosSortingModified, remove video
+var CASE ET30847
+
+callsub Cleanup
+
+var OPTION_ORIGIN EVcxMyVideosOriginDownloaded
+callsub SetupVideos
+
+// Get videos sorted
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingModified
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosDownloads
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// NOT SUPPORTED SO NO CHECKING
+
+// Check count and sort order
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+//VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+//VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+//VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+
+// Remove one of them
+
+VCXMV RemoveMedia ANY_DRIVE 1 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 2
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'Downloads' when video is
+#  removed and videos are sorted by size.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30848 EVcxMyVideosDownloads - EVcxMyVideosSortingSize, remove video
+var CASE ET30848
+
+callsub Cleanup
+
+var OPTION_ORIGIN EVcxMyVideosOriginDownloaded
+callsub SetupVideos
+
+// Get videos sorted
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingSize
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosDownloads
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+
+// Remove one of them
+
+VCXMV RemoveMedia ANY_DRIVE 1 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 2
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'Downloads' when sorting order
+#  changes because video is modified. Videos are sorted by name.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30849 EVcxMyVideosDownloads - EVcxMyVideosSortingName, modify video
+var CASE ET30849
+
+callsub Cleanup
+
+var OPTION_ORIGIN EVcxMyVideosOriginDownloaded
+callsub SetupVideos
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingName
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosDownloads
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Check count and sort order
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+
+// Modify one of the videos and check order
+VCXMV CreateCopyOfMedia ANY_DRIVE 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "x"
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMyVideosTestMessageVideoListOrderChanged KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "x"
+
+// Modify one of the videos and check order
+VCXMV CreateCopyOfMedia ANY_DRIVE 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "0"
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMyVideosTestMessageVideoListOrderChanged KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "0"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "x"
+
+// Modify one of the videos and check order
+VCXMV CreateCopyOfMedia ANY_DRIVE 2
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "1"
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMyVideosTestMessageVideoListOrderChanged KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "0"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "1"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'Downloads' when video is modified.
+#  Videos are sorted by nothing.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30850 EVcxMyVideosDownloads - EVcxMyVideosSortingNone, modify video
+var CASE ET30850
+
+callsub Cleanup
+
+var OPTION_ORIGIN EVcxMyVideosOriginDownloaded
+callsub SetupVideos
+
+// Get videos sorted
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingNone
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosDownloads
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+// Modify one of the videos and check order
+VCXMV CreateCopyOfMedia ANY_DRIVE 1
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "x"
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 0
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDateCurrent
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDownloadId 11
+
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "x"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'Downloads' when video is modified.
+#  Videos are sorted by ID.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30851 EVcxMyVideosDownloads - EVcxMyVideosSortingId, modify video
+var CASE ET30851
+
+callsub Cleanup
+
+var OPTION_ORIGIN EVcxMyVideosOriginDownloaded
+callsub SetupVideos
+
+// Get videos sorted
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingId
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosDownloads
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+//VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+//VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+//VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+
+VCXMV GetAllMediaFullDetails
+
+// Modify one of the videos and check order
+VCXMV CreateCopyOfMedia ANY_DRIVE 1
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "x"
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 0
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDateCurrent
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDownloadId 11
+
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+//VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+//VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "x"
+//VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'Downloads' when video is modified.
+#  Videos are sorted by nothing.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30852 EVcxMyVideosDownloads - EVcxMyVideosSortingModified, modify video
+var CASE ET30852
+
+callsub Cleanup
+
+var OPTION_ORIGIN EVcxMyVideosOriginDownloaded
+callsub SetupVideos
+
+// Get videos sorted
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingModified
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosDownloads
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+// NOT SUPPORTED SO NO CHECKING
+
+//VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+//VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+//VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 1
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDateCurrent
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV GetAllMediaFullDetails
+
+//VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+//VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+//VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'Downloads' when video is modified
+#  causing sorting order to change. Videos are sorted by size.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30853 EVcxMyVideosDownloads - EVcxMyVideosSortingSize, modify video
+var CASE ET30853
+
+callsub Cleanup
+
+var OPTION_ORIGIN EVcxMyVideosOriginDownloaded
+callsub SetupVideos
+
+// The test case
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingSize
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosDownloads
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Check count and sort order
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a" // 49k
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "c" // 50k
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "b" // 51k
+
+// Modify one of the videos and check order
+VCXMV CreateCopyOfMedia ANY_DRIVE 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 48000
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMyVideosTestMessageVideoListOrderChanged KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+
+// Modify one of the videos and check order
+VCXMV CreateCopyOfMedia ANY_DRIVE 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 60000
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMyVideosTestMessageVideoListOrderChanged KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+
+// Modify one of the videos and check order
+VCXMV CreateCopyOfMedia ANY_DRIVE 2
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 40000
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMyVideosTestMessageVideoListOrderChanged KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'Downloads' when sorting order
+#  changes because video is added by sideloading. Videos are sorted by name.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30854 EVcxMyVideosDownloads - EVcxMyVideosSortingName, sideload video
+var CASE ET30854
+
+callsub Cleanup
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingName
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create some video objects.
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "video3.mp4" 52000
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "video0.mp4" 50000
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "video2.mp4" 51000
+pause 1000
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginDownloaded
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 1
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginDownloaded
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 2
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginDownloaded
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+delete VCXMV
+
+// List videos
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+delete VCXMV
+
+// Get videos sorted
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingName
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosDownloads
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "video0"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "video2"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "video3"
+
+// Sideload video
+
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "video1.mp4"
+
+// It's not downloaded video.
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "video0"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "video2"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "video3"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'Downloads' when sorting order
+#  changes because video is added by download. Videos are sorted by name.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30855 EVcxMyVideosDownloads - EVcxMyVideosSortingName, download video
+var CASE ET30855
+
+callsub Cleanup
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingName
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create some video objects.
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "small3.mp4" 52000
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "small2.mp4" 50000
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "small0.mp4" 51000
+pause 1000
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginDownloaded
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 1
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginDownloaded
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 2
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginDownloaded
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+delete VCXMV
+
+// Get videos sorted
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingName
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosDownloads
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "small0"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "small2"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "small3"
+
+// Download video
+
+VCXMV Download 3G_AP SERVICE_SMALLVIDEOS 1 0 "mediacharger" "Buran_9o"
+VCXMV WaitForAnyMessage 5MINUTES KVCXMYVideosTestMessageDlSucceeded KVCXMYVideosTestMessageDlFailed KVCXMYVideosTestMessageDlGeneral
+waittestclass VCXMV // Dl complete
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "small0"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "small1"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "small2"
+VCXMV CheckMediaDetail ANY_DRIVE 3 EVcxTestMapping_KMPXMediaGeneralTitle "small3"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'Other' when video is removed
+#  and videos are sorted by name.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30873 EVcxMyVideosOther - EVcxMyVideosSortingName, remove video
+var CASE ET30873
+
+callsub Cleanup
+
+var OPTION_ORIGIN EVcxMyVideosOriginOther
+callsub SetupVideos
+
+// Get videos sorted
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingName
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosOther
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Check count and sort order
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+
+// Remove one of them
+
+VCXMV RemoveMedia ANY_DRIVE 1 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 2
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'Other' when video is removed
+#  and videos are sorted by nothing.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30874 EVcxMyVideosOther - EVcxMyVideosSortingNone, remove video
+var CASE ET30874
+
+callsub Cleanup
+
+var OPTION_ORIGIN EVcxMyVideosOriginOther
+callsub SetupVideos
+
+// Get videos sorted
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingNone
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosOther
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+// Remove one of them
+
+VCXMV RemoveMedia ANY_DRIVE 1 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 2
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'Other' when video is removed
+#  and videos are sorted by ID.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30875 EVcxMyVideosOther - EVcxMyVideosSortingId, remove video
+var CASE ET30875
+
+callsub Cleanup
+
+var OPTION_ORIGIN EVcxMyVideosOriginOther
+callsub SetupVideos
+
+// Get videos sorted
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingId
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosOther
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// ORDER NOT SUPPORTED, NO CHECKING
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+//VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+//VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+//VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+
+// Remove one of them
+
+VCXMV RemoveMedia ANY_DRIVE 1 0
+
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 2
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'Other' when video is removed
+#  and videos are sorted by creation date.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30876 EVcxMyVideosOther - EVcxMyVideosSortingCreationDate, remove video
+var CASE ET30876
+
+callsub Cleanup
+
+var OPTION_ORIGIN EVcxMyVideosOriginOther
+callsub SetupVideos
+
+// Get videos sorted
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingCreationDate
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosOther
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+
+// Remove one of them
+
+VCXMV RemoveMedia ANY_DRIVE 1 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 2
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'Other' when video is removed
+#  and videos are sorted by modified date.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30877 EVcxMyVideosOther - EVcxMyVideosSortingModified, remove video
+var CASE ET30877
+
+callsub Cleanup
+
+var OPTION_ORIGIN EVcxMyVideosOriginOther
+callsub SetupVideos
+
+// Get videos sorted
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingModified
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosOther
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// NOT SUPPORTED SO NO CHECKING
+
+// Check count and sort order
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+//VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+//VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+//VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+
+// Remove one of them
+
+VCXMV RemoveMedia ANY_DRIVE 1 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 2
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'Other' when video is removed
+#  and videos are sorted by size.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30878 EVcxMyVideosOther - EVcxMyVideosSortingSize, remove video
+var CASE ET30878
+
+callsub Cleanup
+
+var OPTION_ORIGIN EVcxMyVideosOriginOther
+callsub SetupVideos
+
+// Get videos sorted
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingSize
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosOther
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+
+// Remove one of them
+
+VCXMV RemoveMedia ANY_DRIVE 1 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 2
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'Other' when video is modifed
+#  so that order changes and videos are sorted by name.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30879 EVcxMyVideosOther - EVcxMyVideosSortingName, modify video
+var CASE ET30879
+
+callsub Cleanup
+
+var OPTION_ORIGIN EVcxMyVideosOriginOther
+callsub SetupVideos
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingName
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosOther
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Check count and sort order
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+
+// Modify one of the videos and check order
+VCXMV CreateCopyOfMedia ANY_DRIVE 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "x"
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMyVideosTestMessageVideoListOrderChanged KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "x"
+
+// Modify one of the videos and check order
+VCXMV CreateCopyOfMedia ANY_DRIVE 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "0"
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMyVideosTestMessageVideoListOrderChanged KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "0"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "x"
+
+// Modify one of the videos and check order
+VCXMV CreateCopyOfMedia ANY_DRIVE 2
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "1"
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMyVideosTestMessageVideoListOrderChanged KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "0"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "1"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'Other' when video is modifed
+#  and videos are sorted by nothing.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30880 EVcxMyVideosOther - EVcxMyVideosSortingNone, modify video
+var CASE ET30880
+
+callsub Cleanup
+
+var OPTION_ORIGIN EVcxMyVideosOriginOther
+callsub SetupVideos
+
+// Get videos sorted
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingNone
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosOther
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+// Modify one of the videos and check order
+VCXMV CreateCopyOfMedia ANY_DRIVE 1
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "x"
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 0
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDateCurrent
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDownloadId 11
+
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "x"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'Other' when video is modifed
+#  and videos are sorted by id.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30881 EVcxMyVideosOther - EVcxMyVideosSortingId, modify video
+var CASE ET30881
+
+callsub Cleanup
+
+var OPTION_ORIGIN EVcxMyVideosOriginOther
+callsub SetupVideos
+
+// Get videos sorted
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingId
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosOther
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+//VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+//VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+//VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+
+VCXMV GetAllMediaFullDetails
+
+// Modify one of the videos and check order
+VCXMV CreateCopyOfMedia ANY_DRIVE 1
+
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralTitle "x"
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralFlags 0
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralCopyright "c"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDateCurrent
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAgeProfile 5
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAudioLanguage "e"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosAuthor "f"
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDuration 7 8
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 9 10
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosDownloadId 11
+
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+//VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+//VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "x"
+//VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'Other' when video is modifed
+#  and videos are sorted by modified date.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30882 EVcxMyVideosOther - EVcxMyVideosSortingModified, modify video
+var CASE ET30882
+
+callsub Cleanup
+
+var OPTION_ORIGIN EVcxMyVideosOriginOther
+callsub SetupVideos
+
+// Get videos sorted
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingModified
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosOther
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+// NOT SUPPORTED SO NO CHECKING
+
+//VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+//VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+//VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 1
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosModifiedDateCurrent
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV GetAllMediaFullDetails
+
+//VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+//VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+//VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'Other' when video is modifed
+#  so that order changes and videos are sorted by size.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30883 EVcxMyVideosOther - EVcxMyVideosSortingSize, modify video
+var CASE ET30883
+
+callsub Cleanup
+
+var OPTION_ORIGIN EVcxMyVideosOriginOther
+callsub SetupVideos
+
+// The test case
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingSize
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosOther
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Check count and sort order
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a" // 49k
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "c" // 50k
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "b" // 51k
+
+// Modify one of the videos and check order
+VCXMV CreateCopyOfMedia ANY_DRIVE 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 48000
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMyVideosTestMessageVideoListOrderChanged KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+
+// Modify one of the videos and check order
+VCXMV CreateCopyOfMedia ANY_DRIVE 1
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 60000
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMyVideosTestMessageVideoListOrderChanged KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+
+// Modify one of the videos and check order
+VCXMV CreateCopyOfMedia ANY_DRIVE 2
+VCXMV SetMediaDetail EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 40000
+VCXMV SetMedia 1
+VCXMV WaitForMessages 1MINUTE KVCXMyVideosTestMessageVideoListOrderChanged KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "a"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "c"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "b"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'Other' when sorting order
+#  changes because video is added by sideloading. Videos are sorted by name.
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title ET30884 EVcxMyVideosOther - EVcxMyVideosSortingName, sideload video
+var CASE ET30884
+
+callsub Cleanup
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingName
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create some video objects.
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "video3.mp4" 52000
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "video0.mp4" 50000
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "video2.mp4" 51000
+pause 1000
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginOther
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 1
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginOther
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 2
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginOther
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+delete VCXMV
+
+// Get videos sorted
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingName
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosOther
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "video0"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "video2"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "video3"
+
+// Sideload video
+
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "video1.mp4"
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "video0"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "video1"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "video2"
+VCXMV CheckMediaDetail ANY_DRIVE 3 EVcxTestMapping_KMPXMediaGeneralTitle "video3"
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#  Tests that video list is in correct order in category 'All videos' when sorting order
+#  changes because video is added by download. Videos are sorted by name.
+#
+#------------------------------------------------------------------------------------
+[Test]
+title ET30885 EVcxMyVideosOther - EVcxMyVideosSortingName, download video
+var CASE ET30885
+
+callsub Cleanup
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingName
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+// Create some video objects.
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "small3.mp4" 52000
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "small2.mp4" 50000
+pause 1000
+VCXMV CreateVideoFile IptvTestVideo3Gp C_DRIVE "small0.mp4" 51000
+pause 1000
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 0
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginOther
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 1
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginOther
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+VCXMV CreateCopyOfMedia ANY_DRIVE 2
+VCXMV SetMediaDetail EVcxTestMapping_KVcxMediaMyVideosOrigin EVcxMyVideosOriginOther
+VCXMV OutsideMediaUpdate
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionItemChanged
+waittestclass VCXMV
+
+delete VCXMV
+
+// Get videos sorted
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+VCXMV SetSortingOrder EVcxMyVideosSortingName
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosOther
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV GetAllMediaFullDetails
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "small0"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "small2"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "small3"
+
+// Download video
+
+VCXMV Download 3G_AP SERVICE_SMALLVIDEOS 1 0 "mediacharger" "Buran_9o"
+pause 60000 // pause for a minute and hope download succeeds
+
+VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "small0"
+VCXMV CheckMediaDetail ANY_DRIVE 1 EVcxTestMapping_KMPXMediaGeneralTitle "small2"
+VCXMV CheckMediaDetail ANY_DRIVE 2 EVcxTestMapping_KMPXMediaGeneralTitle "small3"
+
+print OK!
+delete VCXMV
+[Endtest]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/atsconf.txt	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,15 @@
+;Run \vado\videoplayer\tsrc\testing\tools\genATSdrop.pl from 
+;the tsrc folder to create ATS3 drop.
+[DROP]
+NAME VaDo - videoplayer_plat - mpxmyvideoscollection
+DEVICE INSERT_DEVICE
+FLASH INSERT_FLASH_IMAGE
+FLASH INSERT_FLASH_IMAGE
+FLASH INSERT_FLASH_IMAGE
+SIS \VideoApp_Domain\videoplayer\videoplayerapp\mpxvideoplayer\sis\VideoPlayer.sisx
+PKG group\VCXMyVideosCollectionPluginTest.pkg
+BOOT
+INI init\TestFramework.ini 600
+EMAIL INSERT_EMAIL
+RUN
+[ENDDROP]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/vcxmvcollectionplugintest.inc	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,232 @@
+
+VCXCollectionMyVideos "20016B97" old
+// 0 is mapped to the VCXCollectionMyVideos constant
+//VCXCollectionMyVideos "0"
+
+VCXCollectionMusic "101FFC3A"
+VCXCollectionPodcast "101FFC3C"
+
+// Index, not id of the item. always same?
+// From vcxmyvideoscollection.hrh
+EVcxMyVideosAllVideos      0
+//EVcxMyVideosPlaylists
+EVcxMyVideosDownloads      1
+EVcxMyVideosTvRecordings   2
+EVcxMyVideosCapturedVideos 3 // NO SUPPORT ON UI
+EVcxMyVideosOther          4
+//EVcxMyVideosDownloadList   5 // NOT SUPPORTED
+
+// Download state
+EVcxMyVideosDlStateNone 0
+EVcxMyVideosDlStateDownloading 1
+EVcxMyVideosDlStateFailed 2
+EVcxMyVideosDlStatePaused 3
+EVcxMyVideosDlStateDownloaded 4
+
+// Origin
+EVcxMyVideosOriginOther 0
+EVcxMyVideosOriginCapturedWithCamera 1
+EVcxMyVideosOriginDownloaded 2
+EVcxMyVideosOriginSideLoaded 3 // sideloaded videos to actually to the first cat
+EVcxMyVideosOriginTvRecording 4
+
+// Sorting order
+EVcxMyVideosSortingNone 0
+EVcxMyVideosSortingId 1
+EVcxMyVideosSortingCreationDate 2
+EVcxMyVideosSortingModified 3
+EVcxMyVideosSortingName 4
+EVcxMyVideosSortingSize 5
+
+SIDELOADER_WAIT 25000
+PAUSE_MV_CASE_BEGIN 500
+MV_LOOP_COUNT 100
+
+// From CIptvTestVideoCreator.h
+IptvTestVideo3Gp            0       // Extension .3GP
+IptvTestVideo3Gp2           1       // Extension .3G2
+IptvTestVideoMp2            2       // Extension .MP2
+IptvTestVideoMpeg1          3       // Extension .MPG
+IptvTestVideoMpeg2          4       // Extension .MPG
+IptvTestVideoSuperVideoCd   5       // Extension .MPG
+IptvTestVideoMp3            6       // Extension .MP3
+IptvTestVideoAppleMpeg      7       // Extension .MP4
+IptvTestVideoMpeg4          8       // Extension .MP4
+IptvTestVideoMpegAvc        9       // Extension .MP4
+IptvTestVideoQuicktime      10      // Extension .MOV
+IptvTestVideoRealVideo      11      // Extension .RM
+IptvTestVideoAvi            12      // Extension .AVI
+IptvTestVideoWmv            13      // Extension .WMV
+IptvTestVideoAviAC3         14      // Extension .AVI
+
+PAUSE_SIDELOAD              30000   // 30 seconds
+PAUSE_SIDELOAD_LONG         60000   // a minute
+PAUSE_SIDELOAD_VERY_LONG    300000  // 10 minutes
+
+KVCXMYVideosTestMessageNotAccepted                    0
+
+KVCXMYVideosTestMessageDlSucceeded                    1000
+KVCXMYVideosTestMessageDlFailed                       1001
+KVCXMYVideosTestMessageDlPaused                       1002
+KVCXMYVideosTestMessageDlGeneral                      1003
+KVCXMYVideosTestMessageDlRunning                      1020
+KVCXMYVideosTestMessageDlCanceled                     1021
+KVCXMYVideosTestMessageDlProgressed                   1022
+
+KVCXMYVideosTestMessageCollectionMessageError         2000
+KVCXMYVideosTestMessageCollectionOpened               2001
+KVCXMYVideosTestMessagePlaylistOpened                 2002
+KVCXMYVideosTestMessageCollectionMedia                2003
+KVCXMYVideosTestMessageCommandComplete                2004
+KVCXMYVideosTestMessageGotMediasByKMpxId              2005
+KVCXMYVideosTestMessageMoveResp                       2006
+KVCXMYVideosTestMessageCopyResp                       2007
+KVCXMYVideosTestMessageListComplete                   2008
+KVCXMYVideosTestMessageCopyOrMoveStarted              2009
+KVCXMYVideosTestMessageDeleteStarted                  2010
+KVCXMYVideosTestMessageDeleteResp                     2011
+KVCXMYVideosTestMessageCommandCanceled                2012
+
+KVCXMYVideosTestMessageCollectionGeneral              3000
+KVCXMYVideosTestMessageCollectionItemChanged          3001
+KVCXMYVideosTestMessageCollectionCategoryChanged      3002
+
+KVCXMYVideosTestMessageMpxItemInserted                4000
+KVCXMYVideosTestMessageMpxItemDeleted                 4001
+KVCXMYVideosTestMessageMpxItemModified                4002
+
+KVCXMyVideosTestMessageVideoListOrderChanged          5000
+
+KVCXMYVideosTestErrorDownloadNotFound                 10001
+KVCXMYVideosTestErrorFileNotFound                     10002
+
+10SECONDS 10
+30SECONDS 30
+1MINUTE 60
+2MINUTES 120
+5MINUTES 300
+10MINUTES 600
+15MINUTES 900
+30MINUTES 2300
+
+VCXMYVideosTest2kURL                                 "XXX2kURLXXX"
+VCXMYVideosTest1200charsURL                          "1kcharsurl"
+VCXMYVideosTest1kURL                                 "XXX1kURLXXX"
+VCXTestZeroUrl                                       "VcxTestZeroUrl"
+
+// Iap ID is 0
+VCXTestZeroIap                                       "VcxTestZeroIap"
+// Iap ID is 10001
+VCXTestInvalidIap                                    "VcxTestInvalidIap"
+
+
+// Attribute mapping IDs
+// MPX ID (BRIEF), TMPXItemId, iId2  - Ready only.
+EVcxTestMapping_KMPXMediaGeneralId 1
+// Descriptor, contains video name (BRIEF)
+EVcxTestMapping_KMPXMediaGeneralTitle 2
+// Descriptor, description of the video
+EVcxTestMapping_KMPXMediaGeneralComment 3
+//  Descriptor. File path. (BRIEF)
+EVcxTestMapping_KMPXMediaGeneralUri 4
+//  TInt, size in bytes. (BRIEF, OBSOLETE)
+EVcxTestMapping_KMPXMediaGeneralSize 5
+//	TInt64, size in bytes. (BRIEF)
+EVcxTestMapping_KMPXMediaGeneralExtSizeInt64 6
+// TInt64 - Ready only.
+EVcxTestMapping_KMPXMediaGeneralDate 7
+//  TUint32
+EVcxTestMapping_KMPXMediaGeneralFlags 8
+//  Descriptor
+EVcxTestMapping_KMPXMediaGeneralCopyright 9
+// Descriptor - Ready only.
+EVcxTestMapping_KMPXMediaGeneralMimeType 10
+// TInt64
+EVcxTestMapping_KVcxMediaMyVideosModifiedDate 11
+// TInt32, Age profile / rating age. (BRIEF)
+EVcxTestMapping_KVcxMediaMyVideosAgeProfile 12
+// Descriptor
+EVcxTestMapping_KVcxMediaMyVideosAudioLanguage 13
+// Descriptor
+EVcxTestMapping_KVcxMediaMyVideosAuthor 14
+// TUint8, The origin of the object, see values from TVcxMyVideosOrigin.
+EVcxTestMapping_KVcxMediaMyVideosOrigin 15
+// TReal32, duration of the video (play time).
+EVcxTestMapping_KVcxMediaMyVideosDuration 16
+// TReal32, last playback position in seconds.
+EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition 17
+// TUint32. Download ID in Download Manager, 0 means none.
+EVcxTestMapping_KVcxMediaMyVideosDownloadId 18
+
+// Rest are not saved into MDS
+
+//Descriptor. remote url. (BRIEF)
+EVcxTestMapping_KVcxMediaMyVideosRemoteUrl 19
+// TUint8, download state, see values from TVcxMyVideosDownloadState. (BRIEF)
+EVcxTestMapping_KVcxMediaMyVideosDownloadState 20
+// TUint32, IAP ID in CommsDb.
+EVcxTestMapping_KVcxMediaMyVideosIapId 21
+// Descriptor. Username. This is used in KVcxCommandMyVideosStartDownload only.
+EVcxTestMapping_KVcxMediaMyVideosUsername 22
+// Descriptor. Password. This is used in KVcxCommandMyVideosStartDownload only.
+EVcxTestMapping_KVcxMediaMyVideosPassword 23
+// TUint. My Videos command/message ID. Used when sending commands to my videos collection
+EVcxTestMapping_KVcxMediaMyVideosCommandId 24
+// TInt8. Download progress. My Videos collection updates this value when download is
+EVcxTestMapping_KVcxMediaMyVideosDownloadProgress 25
+// TUint32, This attribute is only used in category items. Indicates how many items are under it.
+EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 26
+//  TUint32. This attribute is only used in category items. Indicates how many new items are under it.
+EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 27
+
+// Same as before modified date but when used will set the time to current
+EVcxTestMapping_KVcxMediaMyVideosModifiedDateCurrent 28
+EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName 29
+EVcxTestMapping_KVcxMediaMyVideosAudioFourCc 30
+
+// Flags
+// New video flag.
+EVcxMyVideosVideoNew                1
+// Scheduled flag, not downloaded yet.
+EVcxMyVideosVideoScheduledDownload  2
+// Deletion warning flag.
+EVcxMyVideosVideoDeleteWarning      4
+// Protection flag.
+EVcxMyVideosVideoProtected          8
+// DRM protection flag.
+EVcxMyVideosVideoDrmProtected       16
+// Video located at the memorycard flag.
+EVcxMyVideosVideoMemoryCard         32
+// Preview, not full clip.
+EVcxMyVideosVideoPreview            64
+// Recording partially failed  // DUPLICATE in harvesterrtpmetadatarader.h
+EVcxMyVideosVideoRecPartiallyFailed 128
+// Recording failed  // DUPLICATE in harvesterrtpmetadatarader.h
+EVcxMyVideosVideoRecFailed          256
+EVcxMyVideosServiceHasReadOnlyIap   512
+// Set to indicate that there is no UI present, used in KVcxCommandMyVideosStartDownload command only
+EVcxMyVideosSilent                  1024
+
+
+FREESPACE_100KB                     102400
+FREESPACE_500KB                     512000
+FREESPACE_4MBPLUS100KB              4296704
+FREESPACE_1MB                       1024000
+FREESPACE_2MB                       2048000
+FREESPACE_5MB                       5120000
+FREESPACE_10MB                      10240000
+
+// http://193.65.182.78/nokia_vod.xml
+SERVICE_1                          "NokiaVideos"
+// http://193.65.182.78/testingfeed_iptvengine.xml
+SERVICE_2                          "Enginetestingfeed"
+// http://193.65.182.78/miscvideos.xml
+SERVICE_MISCVIDEOS                          "Miscvideos"
+// http://193.65.182.78/misc/smallvideos/smallvideos.xml
+SERVICE_SMALLVIDEOS                "SmallVideos"
+
+
+KVcxNsMpxEventDownloadStarted            1
+KVcxNsMpxEventAllDownloadsEnded          2
+KVcxNsMpxEventDownloadCompleted          4 
+KVcxNsMpxEventNewVideosCountDecreased    5
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/custom/postrun_custom.xml	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,64 @@
+<step name="Fetch Test module Report" harness="STIF" enabled="true" passrate="100" significant="false">
+       <command>fetch-log</command>
+       <params>
+	    <param type="text"/>
+	    <param delete="true"/>
+	    <param path="C:\Logs\TestFramework\*"/>
+       </params>
+</step>
+<step name="Fetch Fusion logs" harness="STIF" enabled="true" passrate="100" significant="false">
+       <command>fetch-log</command>
+       <params>
+	    <param type="text"/>
+	    <param delete="true"/>
+	    <param path="c:\logs\Fusion\*"/>
+       </params>
+</step>
+<step name="Fetch Livetv logs" harness="STIF" enabled="true" passrate="100" significant="false">
+       <command>fetch-log</command>
+       <params>
+	    <param type="text"/>
+	    <param delete="true"/>
+	    <param path="c:\logs\Livetv\*"/>
+       </params>
+</step>
+<step name="Fetch IPTV logs" harness="STIF" enabled="true" passrate="100" significant="false">
+       <command>fetch-log</command>
+       <params>
+	    <param type="text"/>
+	    <param delete="true"/>
+	    <param path="c:\logs\iptv\*"/>
+       </params>
+</step>
+<step name="Fetch verify files" harness="STIF" enabled="true" passrate="100" significant="false">
+       <command>fetch-log</command>
+       <params>
+	    <param type="text"/>
+	    <param delete="true"/>
+	    <param path="c:\testing\data\verifynew\*"/>
+       </params>
+</step>
+<step name="Fetch TestScripter logs" harness="STIF" enabled="true" passrate="100" significant="false">
+       <command>fetch-log</command>
+       <params>
+	    <param type="text"/>
+	    <param delete="true"/>
+	    <param path="C:\Logs\TestFramework\TestScripter\*"/>
+       </params>
+</step>
+<step name="Fetch Testengine logs" harness="STIF" enabled="true" passrate="100" significant="false">
+       <command>fetch-log</command>
+       <params>
+	    <param type="text"/>
+	    <param delete="true"/>
+	    <param path="C:\Logs\TestFramework\Testengine\*"/>
+       </params>
+</step>
+<step name="Fetch Testserver logs" harness="STIF" enabled="true" passrate="100" significant="false">
+       <command>fetch-log</command>
+       <params>
+	    <param type="text"/>
+	    <param delete="true"/>
+	    <param path="C:\Logs\TestFramework\Testserver\*"/>
+       </params>
+</step>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/custom/prerun_custom.xml	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,54 @@
+<step name="Create log directory for testmodule" harness="STIF" enabled="true" passrate="100" significant="false">
+    	<command>makedir</command>
+    	<params>
+        <param dir="c:\logs\testframework"/>
+    	</params>
+</step>
+<step name="Create log directory for fusion" harness="STIF" enabled="true" passrate="100" significant="false">
+    	<command>makedir</command>
+    	<params>
+        <param dir="c:\logs\Fusion"/>
+    	</params>
+</step>
+<step name="Create log directory for livetv" harness="STIF" enabled="true" passrate="100" significant="false">
+    	<command>makedir</command>
+    	<params>
+        <param dir="c:\logs\Livetv"/>
+    	</params>
+</step>
+<step name="Create log directory for iptv" harness="STIF" enabled="true" passrate="100" significant="false">
+    	<command>makedir</command>
+    	<params>
+        <param dir="c:\logs\iptv"/>
+    	</params>
+</step>
+<step name="Create directory for verify files" harness="STIF" enabled="true" passrate="100" significant="false">
+    	<command>makedir</command>
+    	<params>
+        <param dir="c:\testing\data\verifyzip"/>
+    	</params>
+</step>
+<step name="Create directory for verify files" harness="STIF" enabled="true" passrate="100" significant="false">
+    	<command>makedir</command>
+    	<params>
+        <param dir="c:\testing\data\verifynew"/>
+    	</params>
+</step>
+<step name="Create directory for TestScripter logs" harness="STIF" enabled="true" passrate="100" significant="false">
+    	<command>makedir</command>
+    	<params>
+        <param dir="c:\logs\testframework\TestScripter"/>
+    	</params>
+</step>
+<step name="Create directory for Testengine logs" harness="STIF" enabled="true" passrate="100" significant="false">
+    	<command>makedir</command>
+    	<params>
+        <param dir="c:\logs\testframework\Testengine"/>
+    	</params>
+</step>
+<step name="Create directory for Testserver logs" harness="STIF" enabled="true" passrate="100" significant="false">
+    	<command>makedir</command>
+    	<params>
+        <param dir="c:\logs\testframework\Testserver"/>
+    	</params>
+</step>
\ No newline at end of file
Binary file videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/data/cccccc00.cre has changed
Binary file videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/data/mmc/video_3gp.3gp has changed
Binary file videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/data/mmc/video_3gp2.3g2 has changed
Binary file videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/data/mmc/video_applempeg.mp4 has changed
Binary file videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/data/mmc/video_avi.avi has changed
Binary file videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/data/mmc/video_aviac3.avi has changed
Binary file videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/data/mmc/video_mp2.mp2 has changed
Binary file videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/data/mmc/video_mp3.mp3 has changed
Binary file videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/data/mmc/video_mpeg1.mpg has changed
Binary file videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/data/mmc/video_mpeg2.mpg has changed
Binary file videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/data/mmc/video_mpeg4.mp4 has changed
Binary file videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/data/mmc/video_mpegavc.mp4 has changed
Binary file videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/data/mmc/video_quicktime.mov has changed
Binary file videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/data/mmc/video_realvideo.rm has changed
Binary file videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/data/mmc/video_supervideocd.mpg has changed
Binary file videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/data/mmc/video_wmv.dat has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/group/VCXMyVideosCollectionPluginTest.mmp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,79 @@
+/*TYPE TESTCLASS*//*
+* 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 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:  MMP file for STIF Test Framework's TestScripter*
+*/
+
+
+#include <platform_paths.hrh>
+
+TARGET          vcxmyvideoscollectionplugintest.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E3
+
+CAPABILITY      CAP_GENERAL_DLL
+/* Remove comments and replace 0x00000000 with correct vendor id */
+// VENDORID     0x00000000
+/* Remove comments and replace 0x00000000 with correct secure id */
+// SECUREID     0x00000000
+
+//TARGETPATH      ?target_path
+DEFFILE         VCXMyVideosCollectionPluginTest.def
+
+USERINCLUDE     ../inc
+USERINCLUDE		../../../inc
+USERINCLUDE     ../../../../../tsrc/VCXTestCommon/inc
+
+SYSTEMINCLUDE /Epoc32/include/ecom
+APP_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH      ../src
+
+SOURCE          VCXMyVideosCollectionPluginTest.cpp
+SOURCE          VCXMyVideosCollectionPluginTestBlocks.cpp
+SOURCE          VCXMyVideosCollectionPluginTester.cpp
+SOURCE          VCXMyVideosTestDlWatcher.cpp
+SOURCE          VCXMyVideosTestServiceEmu.cpp
+SOURCE          VCXTestMdsDbModifier.cpp
+SOURCE          VCXMyVideosTestTransactions.cpp
+
+//RESOURCE        resource_file
+//RESOURCE        resource_file2
+
+LIBRARY         euser.lib
+LIBRARY         mpxcommon.lib
+LIBRARY         mpxcollectionutility.lib
+LIBRARY         estor.lib
+LIBRARY         stiftestinterface.lib
+LIBRARY         vcxtestcommon.lib
+LIBRARY         flogger.lib
+LIBRARY         efsrv.lib
+LIBRARY         bafl.lib
+LIBRARY         edbms.lib // rdbstoredatabase
+LIBRARY         centralrepository.lib
+
+LIBRARY         contextengine.lib
+LIBRARY         contextplugininterface.lib
+LIBRARY         harvesterplugininterface.lib
+LIBRARY         mdeclient.lib
+LIBRARY         mdccommon.lib
+LIBRARY         harvestercommon.lib
+LIBRARY		    harvesterdata.lib
+LIBRARY         harvesterclient.lib
+
+LANG            SC
+
+// DEFFILE ?filename
+// AIF ?filename
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/group/VCXMyVideosCollectionPluginTest.pkg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,99 @@
+;
+; 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 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:  Package file for My videos mpx collection plugin STIF tests;
+
+; Languages
+&EN
+
+; Provide value for uid
+#{"VCXMyVideosCollectionPluginTest"},(0x00000000),1,1,0,TYPE=SA
+
+; 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
+"/epoc32/release/armv5/udeb/VCXMyVideosCollectionPluginTest.dll"   - "!:/Sys/Bin/VCXMyVideosCollectionPluginTest.dll"
+"/epoc32/release/armv5/udeb/MediatorEventVerifier.dll"             - "!:/Sys/Bin/MediatorEventVerifier.dll"
+"/epoc32/release/armv5/udeb/VCXTestUtilModule.dll"                 - "!:/Sys/Bin/VCXTestUtilModule.dll"
+"/epoc32/release/armv5/udeb/VCXTestCommon.dll"                     - "!:/Sys/Bin/VCXTestCommon.dll"
+"/epoc32/release/armv5/udeb/VCXTestMyVideosCollectionClient.dll"   - "!:/Sys/Bin/VCXTestMyVideosCollectionClient.dll"
+"../conf/VCXMyVideosCollectionPluginTestAttributes.cfg"            - "C:/TestFramework/VCXMyVideosCollectionPluginTestAttributes.cfg"
+"../conf/VCXMyVideosCollectionPluginTestDelete.cfg"                - "C:/TestFramework/VCXMyVideosCollectionPluginTestDelete.cfg"
+"../conf/VCXMyVideosCollectionPluginTestDownload.cfg"              - "C:/TestFramework/VCXMyVideosCollectionPluginTestDownload.cfg"
+"../conf/VCXMyVideosCollectionPluginTestDownload2.cfg"             - "C:/TestFramework/VCXMyVideosCollectionPluginTestDownload2.cfg"
+"../conf/VCXMyVideosCollectionPluginTestMultipleDls.cfg"           - "C:/TestFramework/VCXMyVideosCollectionPluginTestMultipleDls.cfg"
+"../conf/VCXMyVideosCollectionPluginTestFullMemory.cfg"            - "C:/TestFramework/VCXMyVideosCollectionPluginTestFullMemory.cfg"
+"../conf/VCXMyVideosCollectionPluginTestLists.cfg"                 - "C:/TestFramework/VCXMyVideosCollectionPluginTestLists.cfg"
+"../conf/VCXMyVideosCollectionPluginTestMoveCopy.cfg"              - "C:/TestFramework/VCXMyVideosCollectionPluginTestMoveCopy.cfg"
+"../conf/VCXMyVideosCollectionPluginTestMultiDrives.cfg"           - "C:/TestFramework/VCXMyVideosCollectionPluginTestMultiDrives.cfg"
+"../conf/VCXMyVideosCollectionPluginTestSideload.cfg"              - "C:/TestFramework/VCXMyVideosCollectionPluginTestSideload.cfg"
+"../conf/VCXMyVideosCollectionPluginTestSorting.cfg"               - "C:/TestFramework/VCXMyVideosCollectionPluginTestSorting.cfg"
+"../conf/VCXMyVideosCollectionPluginTestRobustness.cfg"            - "C:/TestFramework/VCXMyVideosCollectionPluginTestRobustness.cfg"
+"../conf/VCXMyVideosCollectionPluginTestHelium.cfg"                - "C:/TestFramework/VCXMyVideosCollectionPluginTestHelium.cfg"
+"../conf/VCXMyVideosCollectionPluginTestMediator.cfg"              - "C:/TestFramework/VCXMyVideosCollectionPluginTestMediator.cfg"
+"../conf/vcxmvcollectionplugintest.inc"                            - "C:/TestFramework/vcxmvcollectionplugintest.inc"
+"../conf/VCXConsts.inc"                                            - "C:/TestFramework/VCXConsts.inc"
+"../conf/VCXDrives.inc"                                            - "C:/TestFramework/VCXDrives.inc"
+"../conf/VCXErrors.inc"                                            - "C:/TestFramework/VCXErrors.inc"
+
+; The cenrep and testframework.ini files won't install with sis, only for ATS test runs.
+"../init/TestFramework.ini"                                    -  "C:/TestFramework/TestFramework.ini"
+"../data/cccccc00.cre"                                         -   "c:\private\10202be9\persists\cccccc00.cre"
+
+"../Data/MMC/video_3gp.3gp"                                     -  "e:/testing/data/video_3gp.xxx"
+"../Data/MMC/video_3gp2.3g2"                                    -  "e:/testing/data/video_3gp2.xxx"
+"../Data/MMC/video_wmv.dat"                                     -  "e:/testing/data/video_wmv.xxx"
+"../Data/MMC/video_mp2.mp2"                                     -  "e:/testing/data/video_mp2.xxx"
+"../Data/MMC/video_mpeg1.mpg"                                   -  "e:/testing/data/video_mpeg1.xxx"
+"../Data/MMC/video_mpeg2.mpg"                                   -  "e:/testing/data/video_mpeg2.xxx"
+"../Data/MMC/video_supervideocd.mpg"                            -  "e:/testing/data/video_supervideocd.xxx"
+"../Data/MMC/video_mp3.mp3"                                     -  "e:/testing/data/video_mp3.xxx"
+"../Data/MMC/video_applempeg.mp4"                               -  "e:/testing/data/video_applempeg.xxx"
+"../Data/MMC/video_mpeg4.mp4"                                   -  "e:/testing/data/video_mpeg4.xxx"
+"../Data/MMC/video_mpegavc.mp4"                                 -  "e:/testing/data/video_mpegavc.xxx"
+"../Data/MMC/video_quicktime.mov"                               -  "e:/testing/data/video_quicktime.xxx"
+"../Data/MMC/video_realvideo.rm"                                -  "e:/testing/data/video_realvideo.xxx"
+"../Data/MMC/video_avi.avi"                                     -  "e:/testing/data/video_avi.xxx"
+"../Data/MMC/video_aviac3.avi"                                  -  "e:/testing/data/video_aviac3.xxx"
+
+; Embedded SIS
+; None
+
+; End of Package body
+
+; PKG dependencies
+; None
+
+; PKG capabilities
+; None
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/group/VCXMyVideosCollectionPluginTest_udeb.pkg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,99 @@
+;
+; 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 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:  Package file for My videos mpx collection plugin STIF tests;
+
+; Languages
+&EN
+
+; Provide value for uid
+#{"VCXMyVideosCollectionPluginTest"},(0x00000000),1,1,0,TYPE=SA
+
+; 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
+"/epoc32/release/armv5/udeb/VCXMyVideosCollectionPluginTest.dll"   - "!:/Sys/Bin/VCXMyVideosCollectionPluginTest.dll"
+"/epoc32/release/armv5/udeb/MediatorEventVerifier.dll"             - "!:/Sys/Bin/MediatorEventVerifier.dll"
+"/epoc32/release/armv5/udeb/VCXTestUtilModule.dll"                 - "!:/Sys/Bin/VCXTestUtilModule.dll"
+"/epoc32/release/armv5/udeb/VCXTestCommon.dll"                     - "!:/Sys/Bin/VCXTestCommon.dll"
+"/epoc32/release/armv5/udeb/VCXTestMyVideosCollectionClient.dll"   - "!:/Sys/Bin/VCXTestMyVideosCollectionClient.dll"
+"../conf/VCXMyVideosCollectionPluginTestAttributes.cfg"            - "C:/TestFramework/VCXMyVideosCollectionPluginTestAttributes.cfg"
+"../conf/VCXMyVideosCollectionPluginTestDelete.cfg"                - "C:/TestFramework/VCXMyVideosCollectionPluginTestDelete.cfg"
+"../conf/VCXMyVideosCollectionPluginTestDownload.cfg"              - "C:/TestFramework/VCXMyVideosCollectionPluginTestDownload.cfg"
+"../conf/VCXMyVideosCollectionPluginTestDownload2.cfg"             - "C:/TestFramework/VCXMyVideosCollectionPluginTestDownload2.cfg"
+"../conf/VCXMyVideosCollectionPluginTestMultipleDls.cfg"           - "C:/TestFramework/VCXMyVideosCollectionPluginTestMultipleDls.cfg"
+"../conf/VCXMyVideosCollectionPluginTestFullMemory.cfg"            - "C:/TestFramework/VCXMyVideosCollectionPluginTestFullMemory.cfg"
+"../conf/VCXMyVideosCollectionPluginTestLists.cfg"                 - "C:/TestFramework/VCXMyVideosCollectionPluginTestLists.cfg"
+"../conf/VCXMyVideosCollectionPluginTestMoveCopy.cfg"              - "C:/TestFramework/VCXMyVideosCollectionPluginTestMoveCopy.cfg"
+"../conf/VCXMyVideosCollectionPluginTestMultiDrives.cfg"           - "C:/TestFramework/VCXMyVideosCollectionPluginTestMultiDrives.cfg"
+"../conf/VCXMyVideosCollectionPluginTestSideload.cfg"              - "C:/TestFramework/VCXMyVideosCollectionPluginTestSideload.cfg"
+"../conf/VCXMyVideosCollectionPluginTestSorting.cfg"               - "C:/TestFramework/VCXMyVideosCollectionPluginTestSorting.cfg"
+"../conf/VCXMyVideosCollectionPluginTestRobustness.cfg"            - "C:/TestFramework/VCXMyVideosCollectionPluginTestRobustness.cfg"
+"../conf/VCXMyVideosCollectionPluginTestHelium.cfg"                - "C:/TestFramework/VCXMyVideosCollectionPluginTestHelium.cfg"
+"../conf/VCXMyVideosCollectionPluginTestMediator.cfg"              - "C:/TestFramework/VCXMyVideosCollectionPluginTestMediator.cfg"
+"../conf/vcxmvcollectionplugintest.inc"                            - "C:/TestFramework/vcxmvcollectionplugintest.inc"
+"../conf/VCXConsts.inc"                                            - "C:/TestFramework/VCXConsts.inc"
+"../conf/VCXDrives.inc"                                            - "C:/TestFramework/VCXDrives.inc"
+"../conf/VCXErrors.inc"                                            - "C:/TestFramework/VCXErrors.inc"
+
+; The cenrep and testframework.ini files won't install with sis, only for ATS test runs.
+;TEMPCOMMENT "../init/TestFramework.ini"                                    -  "C:/TestFramework/TestFramework.ini"
+;TEMPCOMMENT "../data/cccccc00.cre"                                         -   "c:\private\10202be9\persists\cccccc00.cre"
+
+"../Data/MMC/video_3gp.3gp"                                     -  "e:/testing/data/video_3gp.xxx"
+"../Data/MMC/video_3gp2.3g2"                                    -  "e:/testing/data/video_3gp2.xxx"
+"../Data/MMC/video_wmv.dat"                                     -  "e:/testing/data/video_wmv.xxx"
+"../Data/MMC/video_mp2.mp2"                                     -  "e:/testing/data/video_mp2.xxx"
+"../Data/MMC/video_mpeg1.mpg"                                   -  "e:/testing/data/video_mpeg1.xxx"
+"../Data/MMC/video_mpeg2.mpg"                                   -  "e:/testing/data/video_mpeg2.xxx"
+"../Data/MMC/video_supervideocd.mpg"                            -  "e:/testing/data/video_supervideocd.xxx"
+"../Data/MMC/video_mp3.mp3"                                     -  "e:/testing/data/video_mp3.xxx"
+"../Data/MMC/video_applempeg.mp4"                               -  "e:/testing/data/video_applempeg.xxx"
+"../Data/MMC/video_mpeg4.mp4"                                   -  "e:/testing/data/video_mpeg4.xxx"
+"../Data/MMC/video_mpegavc.mp4"                                 -  "e:/testing/data/video_mpegavc.xxx"
+"../Data/MMC/video_quicktime.mov"                               -  "e:/testing/data/video_quicktime.xxx"
+"../Data/MMC/video_realvideo.rm"                                -  "e:/testing/data/video_realvideo.xxx"
+"../Data/MMC/video_avi.avi"                                     -  "e:/testing/data/video_avi.xxx"
+"../Data/MMC/video_aviac3.avi"                                  -  "e:/testing/data/video_aviac3.xxx"
+
+; Embedded SIS
+; None
+
+; End of Package body
+
+; PKG dependencies
+; None
+
+; PKG capabilities
+; None
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,66 @@
+/*
+* 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 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: 
+*
+*/
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_TESTEXPORTS
+../data/mmc/video_3gp.3gp                /epoc32/winscw/c/testing/data/video_3gp.xxx
+../data/mmc/video_3gp2.3g2               /epoc32/winscw/c/testing/data/video_3gp2.xxx
+../data/mmc/video_applempeg.mp4          /epoc32/winscw/c/testing/data/video_applempeg.xxx
+../data/mmc/video_avi.avi                /epoc32/winscw/c/testing/data/video_avi.xxx
+../data/mmc/video_aviac3.avi             /epoc32/winscw/c/testing/data/video_aviac3.xxx
+../data/mmc/video_mp2.mp2                /epoc32/winscw/c/testing/data/video_mp2.xxx
+../data/mmc/video_mp3.mp3                /epoc32/winscw/c/testing/data/video_mp3.xxx
+../data/mmc/video_mpeg1.mpg              /epoc32/winscw/c/testing/data/video_mpeg1.xxx
+../data/mmc/video_mpeg2.mpg              /epoc32/winscw/c/testing/data/video_mpeg2.xxx
+../data/mmc/video_mpeg4.mp4              /epoc32/winscw/c/testing/data/video_mpeg4.xxx
+../data/mmc/video_mpegavc.mp4            /epoc32/winscw/c/testing/data/video_mpegavc.xxx
+../data/mmc/video_quicktime.mov          /epoc32/winscw/c/testing/data/video_quicktime.xxx
+../data/mmc/video_realvideo.rm           /epoc32/winscw/c/testing/data/video_realvideo.xxx
+../data/mmc/video_supervideocd.mpg       /epoc32/winscw/c/testing/data/video_supervideocd.xxx
+../data/mmc/video_wmv.dat                /epoc32/winscw/c/testing/data/video_wmv.xxx
+
+../conf/VCXConsts.inc                                           /epoc32/winscw/c/testframework/VCXConsts.inc
+../conf/VCXDrives.inc                                           /epoc32/winscw/c/testframework/VCXDrives.inc
+../conf/VCXErrors.inc                                           /epoc32/winscw/c/testframework/VCXErrors.inc
+../conf/vcxmvcollectionplugintest.inc                           /epoc32/winscw/c/testframework/vcxmvcollectionplugintest.inc
+../conf/VCXMyVideosCollectionPluginTestAttributes.cfg           /epoc32/winscw/c/testframework/VCXMyVideosCollectionPluginTestAttributes.cfg
+../conf/VCXMyVideosCollectionPluginTestDelete.cfg               /epoc32/winscw/c/testframework/VCXMyVideosCollectionPluginTestDelete.cfg
+../conf/VCXMyVideosCollectionPluginTestDownload.cfg             /epoc32/winscw/c/testframework/VCXMyVideosCollectionPluginTestDownload.cfg
+../conf/VCXMyVideosCollectionPluginTestDownload2.cfg            /epoc32/winscw/c/testframework/VCXMyVideosCollectionPluginTestDownload2.cfg
+../conf/VCXMyVideosCollectionPluginTestMultipleDls.cfg          /epoc32/winscw/c/testframework/VCXMyVideosCollectionPluginTestMultipleDls.cfg
+../conf/VCXMyVideosCollectionPluginTestFullMemory.cfg           /epoc32/winscw/c/testframework/VCXMyVideosCollectionPluginTestFullMemory.cfg
+../conf/VCXMyVideosCollectionPluginTestLists.cfg                /epoc32/winscw/c/testframework/VCXMyVideosCollectionPluginTestLists.cfg
+../conf/VCXMyVideosCollectionPluginTestMoveCopy.cfg             /epoc32/winscw/c/testframework/VCXMyVideosCollectionPluginTestMoveCopy.cfg
+../conf/VCXMyVideosCollectionPluginTestMultiDrives.cfg          /epoc32/winscw/c/testframework/VCXMyVideosCollectionPluginTestMultiDrives.cfg
+../conf/VCXMyVideosCollectionPluginTestSideload.cfg             /epoc32/winscw/c/testframework/VCXMyVideosCollectionPluginTestSideload.cfg
+../conf/VCXMyVideosCollectionPluginTestSorting.cfg              /epoc32/winscw/c/testframework/VCXMyVideosCollectionPluginTestSorting.cfg
+../conf/VCXMyVideosCollectionPluginTestRobustness.cfg           /epoc32/winscw/c/testframework/VCXMyVideosCollectionPluginTestRobustness.cfg
+../conf/VCXMyVideosCollectionPluginTestHelium.cfg               /epoc32/winscw/c/testframework/VCXMyVideosCollectionPluginTestHelium.cfg
+../conf/VCXMyVideosCollectionPluginTestMediator.cfg             /epoc32/winscw/c/testframework/VCXMyVideosCollectionPluginTestMediator.cfg
+
+PRJ_EXPORTS
+
+PRJ_TESTMMPFILES
+VCXMyVideosCollectionPluginTest.mmp
+../mediatorevents/group/MediatorEventVerifier.mmp
+
+PRJ_MMPFILES
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/inc/MVCXMyVideosCollectionPluginTesterObserver.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2002 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:   ?Description*
+*/
+
+
+
+#ifndef MVCXMYVIDEOSCOLLECTIONPLUGINTESTEROBSERVER_H
+#define MVCXMYVIDEOSCOLLECTIONPLUGINTESTEROBSERVER_H
+
+//  INCLUDES
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// DATA TYPES
+//enum ?declaration
+//typedef ?declaration
+//extern ?data_type;
+
+// CLASS DECLARATION
+
+/**
+*  MVCXMyVideosCollectionPluginTesterObserver
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class MVCXMyVideosCollectionPluginTesterObserver
+    {
+    public: // New functions
+
+        /*
+         * Message from CVCXMyVideosCollectionPluginTester.
+         */        
+        virtual void HandleVcxMvTesterMessageL( TInt aMessage, TInt aError ) = 0;
+    };
+
+#endif      // MVCXMYVIDEOSCOLLECTIONPLUGINTESTEROBSERVER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/inc/VCXMyVideosCollectionPluginTest.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,892 @@
+/*
+* Copyright (c) 2002 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:   ?Description*
+*/
+
+
+
+#ifndef VCXMYVIDEOSCOLLECTIONPLUGINTEST_H
+#define VCXMYVIDEOSCOLLECTIONPLUGINTEST_H
+
+//  INCLUDES
+#include <StifLogger.h>
+#include <TestScripterInternal.h>
+#include <StifTestModule.h>
+#include "MVCXMyVideosCollectionPluginTesterObserver.h"
+#include <f32file.h>
+#include "MIptvTestTimerObserver.h"
+//#ifdef __WINSCW__
+#include <harvesterclient.h>
+//#endif // __WINSCW__
+#include "CIptvTestVideoCreator.h"
+
+// CONSTANTS
+const TInt KTimeoutMinute = 60 * 1000000; // a minute
+const TInt KTimeoutSecond = 1000000;
+_LIT( KVCXMYVideosTest2kURLTag, "XXX2kURLXXX" );
+_LIT( KVCXMYVideosTest1200CharsURLTag, "XXX21200charsURLXXX" );
+_LIT( KVCXMYVideosTest1kURLTag, "XXX1kURLXXX" );
+_LIT( KVCXMYVideosTest2kURL, "http://193.65.182.78/Nseries/video1.3gp?123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456_END" );
+//_LIT( KVCXMYVideosTest1200charsURL, "http://193.65.182.78/Nseries/video1.3gp?123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012_END" );
+_LIT( KVCXMYVideosTest1kURL, "http://193.65.182.78/Nseries/video1.3gp?123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012ASDFASDFAADSFDSFASDFSDAFSDFASDFADFASDF_END" );
+_LIT( KVCXTestZeroIap, "VcxTestZeroIap" );
+_LIT( KVCXTestInvalidIap, "VcxTestInvalidIap" );
+_LIT( KVCXTestZeroUrl, "VcxTestZeroUrl" );
+
+// MACROS
+//#define ?macro ?macro_def
+// Logging path
+_LIT( KVCXMyVideosCollectionPluginTestLogPath, "\\logs\\testframework\\VCXMyVideosCollectionPluginTest\\" );
+// Log file
+_LIT( KVCXMyVideosCollectionPluginTestLogFile, "VCXMyVideosCollectionPluginTest.txt" );
+
+// FORWARD DECLARATIONS
+class CVCXMyVideosCollectionPluginTest;
+class CVCXMyVideosCollectionPluginTester;
+class CVCXTestCommon;
+class CIptvTestActiveWait;
+class CIptvTestTimer;
+class CMPXMedia;
+class TMPXAttributeData;
+class CIptvVodContentContentBriefDetails;
+class CVCXMyVideosTestServiceEmu;
+class CVCXTestMdsDbModifier;
+class CFileMan;
+class CMPXMediaArray;
+class CVCXTestStatsKeeper;
+
+// DATA TYPES
+//enum ?declaration
+//typedef ?declaration
+//extern ?data_type;
+enum TVcxTestMediaAttributeType
+    {
+    EVcxTestMediaAttributeTypeString = 1,
+    EVcxTestMediaAttributeTypeTTime,
+    EVcxTestMediaAttributeTypeTDateTime,
+    EVcxTestMediaAttributeTypeTInt,
+    EVcxTestMediaAttributeTypeTUint,
+    EVcxTestMediaAttributeTypeTUint8,
+    EVcxTestMediaAttributeTypeTUint32,
+    EVcxTestMediaAttributeTypeTReal32,
+    EVcxTestMediaAttributeTypeTInt32,
+    EVcxTestMediaAttributeTypeTMPXItemId,
+    EVcxTestMediaAttributeTypeTInt8,
+    EVcxTestMediaAttributeTypeTInt64,
+    EVcxTestMediaAttributeTypeMvFlags,
+    };
+
+enum TVcxTestMediaAttributeIdMapping
+    {
+    EVcxTestMapping_KMPXMediaGeneralId = 1, /* Brief */
+    EVcxTestMapping_KMPXMediaGeneralTitle, /* Brief */
+    EVcxTestMapping_KMPXMediaGeneralComment,
+    EVcxTestMapping_KMPXMediaGeneralUri, /* Brief */
+    EVcxTestMapping_KMPXMediaGeneralSize, /* Brief, not used */
+    EVcxTestMapping_KMPXMediaGeneralExtSizeInt64, /* Brief */
+    EVcxTestMapping_KMPXMediaGeneralDate,
+    EVcxTestMapping_KMPXMediaGeneralFlags,
+    EVcxTestMapping_KMPXMediaGeneralCopyright,
+    EVcxTestMapping_KMPXMediaGeneralMimeType,
+    EVcxTestMapping_KVcxMediaMyVideosModifiedDate,
+    EVcxTestMapping_KVcxMediaMyVideosAgeProfile, /* Brief */
+    EVcxTestMapping_KVcxMediaMyVideosAudioLanguage,
+    EVcxTestMapping_KVcxMediaMyVideosAuthor,
+    EVcxTestMapping_KVcxMediaMyVideosOrigin,
+    EVcxTestMapping_KVcxMediaMyVideosDuration,
+    EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition,
+    EVcxTestMapping_KVcxMediaMyVideosDownloadId,
+    /* Rest are not saved into MDS */
+    EVcxTestMapping_KVcxMediaMyVideosRemoteUrl,
+    EVcxTestMapping_KVcxMediaMyVideosDownloadState,
+    EVcxTestMapping_KVcxMediaMyVideosIapId,
+    EVcxTestMapping_KVcxMediaMyVideosUsername,
+    EVcxTestMapping_KVcxMediaMyVideosPassword,
+    EVcxTestMapping_KVcxMediaMyVideosCommandId,
+    EVcxTestMapping_KVcxMediaMyVideosDownloadProgress,
+    EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount,
+    EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount,
+    EVcxTestMapping_KVcxMediaMyVideosModifiedDateCurrent,
+    EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName,
+    EVcxTestMapping_KVcxMediaMyVideosAudioFourCc
+    };
+
+typedef RPointerArray<CIptvVodContentContentBriefDetails> TVcxTestContentArray;
+
+// CLASS DECLARATION
+
+/**
+*  CVCXMyVideosCollectionPluginTest test class for STIF Test Framework TestScripter.
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+NONSHARABLE_CLASS(CVCXMyVideosCollectionPluginTest) : public CScriptBase,
+            public MVCXMyVideosCollectionPluginTesterObserver, public MIptvTestTimerObserver
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CVCXMyVideosCollectionPluginTest* NewL( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CVCXMyVideosCollectionPluginTest();
+
+    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 );
+
+        /*
+         * From CVCXMyVideosCollectionPluginTesterObserver.
+         */
+        virtual void HandleVcxMvTesterMessageL( TInt aMessage, TInt aError );
+
+        /**
+        * From MIptvTestTimerObserver Handles timer completion
+        * @since
+        * @param aTimerId
+        * @param aError
+        */
+        void TimerComplete(TInt aTimerId, TInt aError);
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CVCXMyVideosCollectionPluginTest( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        /**
+        * Frees all resources allocated from test methods.
+        * @since ?Series60_version
+        */
+        void Delete();
+
+        /**
+         * Methods for STIF testscripter.
+         */
+
+        /**
+        * Initializes the test module.
+        *
+        * @param CaseId When this is given then events and other major calls are logged into a
+        *        separate text file.
+        */
+        virtual TInt CreateL( CStifItemParser& aItem );
+
+        /**
+         * Enables statistics for this instance. Disables error reporting to STIF for errors from collection plugin.
+         *
+         * @param Name for the stats.
+         * @param Filename for the stats. 
+         */
+         virtual TInt EnableStatsL( CStifItemParser& aItem );
+             
+        /**
+         * Sets CenRep value for My Videos MPX plugin preferred memory for downloads.
+         *
+         * @param aPreferredMemory, a drive letter
+         */
+        virtual TInt SetPreferredMemoryL( CStifItemParser& aItem );
+
+        /**
+         * Sets CenRep value for My Videos MPX plugin sort.
+         * If category is whole collection is refreshed:
+         *  - Sort order set to none.
+         *  - Close/Open(index) called for Mpx collection.
+         *  - Sort order set as specified.
+         *  - Close/Open(index) called for Mpx collection.
+         *
+         * @param aSortingOrder
+         */
+        virtual TInt SetSortingOrderL( CStifItemParser& aItem );
+
+        /**
+         * Use to toggle automatic refresh of contents when open collection changes.
+         * Use with caution, some actions need the refresh.
+         */
+        virtual TInt SetAutomaticRefresh( CStifItemParser& aItem );
+
+        /**
+         * Use to disable some of the logging of test module.
+         */
+        virtual TInt SetQuietMode( CStifItemParser& aItem );
+
+        /**
+         * Waits until VCX MV plugin stops sending messages.
+         * Messages are processed but not signaled to test script.
+         *
+         * @param timeout minutes (default 10)
+         */
+        virtual TInt CoolDownL( CStifItemParser& aItem );
+
+        /**
+         * Disables check for missing downloads.
+         */
+        virtual TInt DisableDownloadCheckL( CStifItemParser& aItem );
+
+        /**
+         * Toggle filecheck on/off.
+         */
+        virtual TInt SetFileCheckL( CStifItemParser& aItem );
+
+        /**
+         * Enables or disables the resuming paused downloads automaticly.
+         *
+         * @param TBool
+         */
+        virtual TInt SetAutoResumeL( CStifItemParser& aItem );
+
+        /**
+         * Opens MPX collection.
+         * Asynchronous, test script will be signaled.
+         *
+         * @param collection UID as hex.
+         */
+        virtual TInt OpenCollectionL( CStifItemParser& aItem );
+
+        /**
+         * Opens collection level, e.g. My Videos category.
+         * Asynchronous, test script will be signaled.
+         *
+         * @param index number of the level.
+         */
+        virtual TInt OpenLevelL( CStifItemParser& aItem );
+
+        /**
+         * Closes collection level, e.g. My Videos category.
+         * Asynchronous, test script will be signaled.
+         */
+        virtual TInt CloseLevelL( CStifItemParser& aItem );
+
+        /**
+         * Refreshes the contents of currently open level.
+         * Asynchronous, test script will be signaled.
+         */
+        virtual TInt RefreshContentsL( CStifItemParser& aItem );
+
+        /**
+         * Gets medias by their MPX IDs
+         * Video category must be open, current entries will be the items with
+         * requested MPX IDs when this succeeds.
+         * Asynchronous, test script will be signaled.
+         *
+         * See CVCXMyVideosCollectionPluginTester header for SelectMediasL for selection rules.
+         *
+         * @param aStartIndex index at current entries.
+         * @param aEndIndex, index at current entries.
+         * @param aSyncCall, sync call, default is false for async. 
+         */
+        virtual TInt GetMediasByMpxIdL( CStifItemParser& aItem );
+
+        /**
+         * Gets details of the selected MPX item, e.g. My Videos video.
+         * Synchronous.
+         *
+         * @param driveLetter
+         * @param index
+         */
+        virtual TInt GetMediaFullDetailsL( CStifItemParser& aItem );
+
+        /**
+         * Gets details of the selected MPX item, e.g. My Videos video.
+         * Synchronous.
+         *
+         * @param driveLetter
+         * @param index
+         */
+        virtual TInt GetMediaFullDetailsByMpxIdL( CStifItemParser& aItem );
+
+        /**
+         * Gets details of all current MPX items and prints them into debug output.
+         */
+        virtual TInt GetAllMediaFullDetailsL( CStifItemParser& aItem );
+
+        /**
+         * Checks an attribute of a video item.
+         *
+         * This will fetch the full media from MPX.
+         *
+         * @param driveLetter
+         * @param itemIndex
+         * @param media attribute mapping id, see vcxmvcollectionplugintest.inc
+         * @param expectedValue
+         * @param expectedValue2...X
+         * @param When checking for real number use expectedValue2 for digits.
+         *        For TMPXItemId expectedValue2 is the iId2 member.
+         *        For KMPXMediaGeneralFlags there can be multiple expected values.
+         */
+        virtual TInt CheckMediaDetailL( CStifItemParser& aItem );
+
+        /**
+         * Sets attribute of media item made with CreateCopyOfMediaL.
+         *
+         * @param media attribute mapping id, see vcxmvcollectionplugintest.inc
+         * @param value
+         * @param value2...X
+         *       When setting real number use value2 for digits.
+         *        For TMPXItemId value2 is the iId2 member.
+         *        For KMPXMediaGeneralFlags there can be multiple values.
+         */
+        virtual TInt SetMediaDetailL( CStifItemParser& aItem );
+
+        /**
+         * Checks the video count and that the videos really exist.
+         *
+         * @param driveLetter, if specified checks only videos only on that drive
+         * @param expectedCount
+         */
+        virtual TInt CheckMediaCountL( CStifItemParser& aItem );
+
+        /**
+         * Checks the video count and that the videos really exist.
+         *
+         * @param driveLetter, if specified checks only videos only on that drive
+         * @param minimumCount
+         */
+        virtual TInt CheckMinimumMediaCountL( CStifItemParser& aItem );
+
+        /**
+         * Checks the video count and that the videos really exist.
+         *
+         * @param driveLetter, if specified checks only videos only on that drive
+         * @param maximumCount
+         */
+        virtual TInt CheckMaximumMediaCountL( CStifItemParser& aItem );
+
+        /**
+         * Checks the download count.
+         *
+         * @param expectedCount
+         */
+        virtual TInt CheckDownloadCountL( CStifItemParser& aItem );
+        
+        /**
+         * Checks the download progress.
+         *
+         * @param minimum progress
+         */
+        virtual TInt CheckDownloadProgressL( CStifItemParser& aItem );
+
+        /**
+         * Creates copy of a media from currently listed medias and stores it to
+         * a member variable. It is used by AddMediaL, SetMediaL and
+         * SetMediaDetailsL.
+         *
+         * This will fetch the full media from MPX.
+         *
+         * @param aDrive
+         * @param aIndex
+         * @param aFullCopy Optional, default is 1. If set to 0 then empty
+         *        MPX media item is created which only has the ID of original.
+         */
+        virtual TInt CreateCopyOfMediaL( CStifItemParser& aItem );
+
+        /**
+         * Creates empty media item to member variable.
+         */
+        virtual TInt CreateEmptyMediaL( CStifItemParser& aItem );
+
+        /**
+         * Adds media to the collection. Uses the media created with CreateCopyOfMediaL / CreateEmptyMediaL,
+         * if they are not called then empty item will be used instead.
+         *
+         * @param aSyncCall
+         */
+        virtual TInt AddMediaL( CStifItemParser& aItem );
+
+        /**
+         * Updates media to the collection. Uses the media created with CreateCopyOfMediaL / CreateEmptyMediaL
+         *
+         * @param aSyncCall
+         */
+        virtual TInt SetMediaL( CStifItemParser& aItem );
+
+        /**
+         * Makes a direct media update to MDS DB without using My Videos MPX plugin.
+         *
+         * Uses the media created with CreateCopyOfMediaL.
+         */
+        virtual TInt OutsideMediaUpdateL( CStifItemParser& aItem );
+
+        /**
+         * Media item will be removed with MPX MV plugin command KMPXCommandIdCollectionRemoveMedia.
+         * Asynchronous, test script will be signaled.
+         *
+         * @param aDrive
+         * @param aIndex
+         * @param aSyncCall
+         */
+        virtual TInt RemoveMediaL( CStifItemParser& aItem );
+
+        /**
+         * Removes all media items with MPX MV plugin command KMPXCommandIdCollectionRemoveMedia.
+         *
+         * @param aOneByOne, if true then each removal is waited to complete before next is done.
+         */
+        virtual TInt RemoveAllMediaL( CStifItemParser& aItem );
+
+        /**
+         * Moves a media.
+         *
+         * @param aSourceDriveLetter, where file will be selected from.
+         * @param aIndex, index of moved file on source disk.
+         * @param aDestDriveLetter, dest drive letter.
+         * @param aSyncCall
+         *
+         * See CVCXMyVideosCollectionPluginTester header for SelectMediasL for selection rules.
+         */
+        virtual TInt MoveMediaL( CStifItemParser& aItem );
+
+        /**
+         * Moves multiple medias.
+         *
+         * @param aSourceDriveLetter, where file will be selected from.
+         * @param aIndex, index of moved file on source disk.
+         * @param aStartIndex
+         * @param aEndIndex
+         * @param aDestDriveLetter
+         * @param aSyncCall
+         *
+         * See CVCXMyVideosCollectionPluginTester header for SelectMediasL for selection rules.
+         */
+        virtual TInt MoveMediasL( CStifItemParser& aItem );
+
+        /**
+         * Cancels move request.
+         *
+         * @param aSyncCall
+         */
+        virtual TInt CancelMoveL( CStifItemParser& aItem );
+
+        /**
+         * Copies a media.
+         *
+         * @param aSourceDriveLetter, where file will be selected from.
+         * @param aIndex, index of moved file on source disk.
+         * @param aDestDriveLetter, dest drive letter.
+         * @param aSyncCall
+         *
+         * See CVCXMyVideosCollectionPluginTester header for SelectMediasL for selection rules.
+         */
+        virtual TInt CopyMediaL( CStifItemParser& aItem );
+
+        /**
+         * Copies multiple medias.
+         *
+         * @param aSourceDriveLetter, where file will be selected from.
+         * @param aStartIndex
+         * @param aEndIndex
+         * @param aDestDriveLetter, dest drive letter.
+         * @param aSyncCall
+         *
+         * See CVCXMyVideosCollectionPluginTester header for SelectMediasL for selection rules.
+         */
+        virtual TInt CopyMediasL( CStifItemParser& aItem );
+
+        /**
+         * Cancels copy request.
+         *
+         * @param aSyncCall
+         */
+        virtual TInt CancelCopyL( CStifItemParser& aItem );
+
+        /**
+         * Deletes a media.
+         *
+         * @param aSourceDriveLetter, where file will be selected from.
+         * @param aIndex, index of moved file on source disk.
+         * @param aSyncCall
+         *
+         * See CVCXMyVideosCollectionPluginTester header for SelectMediasL for selection rules.
+         */
+        virtual TInt DeleteMediaL( CStifItemParser& aItem );
+
+        /**
+         * Delete multiple medias.
+         *
+         * @param aSourceDriveLetter, where file will be selected from.
+         * @param aIndex, index of moved file on source disk.
+         * @param aStartIndex
+         * @param aEndIndex
+         * @param aSyncCall
+         *
+         * See CVCXMyVideosCollectionPluginTester header for SelectMediasL for selection rules.
+         */
+        virtual TInt DeleteMediasL( CStifItemParser& aItem );
+
+        /**
+         * Cancels Delete request.
+         *
+         * @param aSyncCall
+         */
+        virtual TInt CancelDeleteL( CStifItemParser& aItem );
+
+        /**
+         * Cancels operation right after it starts. For Move/Copy/Delete.
+         */
+        virtual TInt CancelNextOperationL( CStifItemParser& aItem );
+
+        /**
+         * Deletes the file of selected media in current entries.
+         *
+         * @param aDrive
+         * @param aIndex
+         */
+        virtual TInt DeleteFileOfMediaL( CStifItemParser& aItem );
+
+        /**
+         * Delete files of all the current media entries.
+         */
+        virtual TInt DeleteFilesOfAllMediasL( CStifItemParser& aItem );
+
+        /**
+         * Creates a video file to the file system.
+         * Test module keeps track of these files with iSideloadedFiles array.
+         * If size is -1 video size will not be altered.
+         * If category is open then this will wait until collection is refreshed with new data.
+         */
+        virtual TInt CreateVideoFileL( CStifItemParser& aItem );
+
+        /**
+         * Creates a video file to the file system.
+         * Test module keeps track of these files with iSideloadedFiles array.
+         * If size is -1 video size will not be altered.
+         */
+        virtual TInt CreateVideoFileNoWaitL( CStifItemParser& aItem );
+
+        /**
+         * Creates video file(s).
+         */
+        void CreateVideoFileL( CIptvTestVideoCreator::TIptvTestVideoType aType, const TDesC& aDriveLetter, const TDesC& aFileName, TInt aSize, TInt aVideoCount, TBool aDoSync );
+
+        /**
+         * Ensures that drive has specified amount of videos, they are created and removed if needed.
+         * 
+         * @param drive
+         * @param amount of videos
+         * @param filename for new videos
+         */
+        virtual TInt EnsureDriveForVideosL( CStifItemParser& aItem );
+        
+        /**
+         * Deletes all videos created with CreateVideoFileL method.
+         */
+        virtual TInt EmptySideloadFoldersL( CStifItemParser& aItem );
+
+        /**
+         * Toggle deletion of created videos in the destructor.
+         */
+        virtual TInt SetDeleteSideloadedVideos( CStifItemParser& aItem );
+
+        /**
+         * Start a download using My Videos MPX plugin.
+         *
+         * @param iapName
+         * @param serviceName
+         * @param contentId
+         * @param syncCall
+         * @param userName (optional)
+         * @param password (optional)
+         */
+        virtual TInt DownloadL( CStifItemParser& aItem );
+        
+        /**
+         * Resume a download using My Videos MPX plugin.
+         *
+         * See DownloadL for parameters.
+         */
+        virtual TInt ResumeDownloadL( CStifItemParser& aItem );        
+
+        /**
+         * Resumes all paused downloads.
+         */
+        virtual TInt ResumeAllDownloadsL( CStifItemParser& aItem );        
+
+        /**
+         * Start a download using My Videos MPX plugin.
+         * The current media from CreateEmptyMediaL or CreateCopyOfMediaL is used to pass
+         * attributes to My Videos MPX plugin.
+         *
+         * See DownloadL for parameters.
+         */
+        virtual TInt DownloadUsingMediaL( CStifItemParser& aItem );
+        
+        /**
+         * Resume a download using My Videos MPX plugin.
+         * The current media from CreateEmptyMediaL or CreateCopyOfMediaL is used to pass
+         * attributes to My Videos MPX plugin.
+         *
+         * See DownloadL for parameters.
+         */
+        virtual TInt ResumeDownloadUsingMediaL( CStifItemParser& aItem );        
+
+        /**
+         * Starts download or resumes one. Cannot be called from STIF script.
+         * 
+         * @param aUseCurrentMedia, use the attributes of the current media.
+         * @param aResume, is this resume download.
+         */
+        void DownloadOrResumeL( CStifItemParser& aItem, TBool aUseCurrentMedia, TBool aResume );
+        
+        /**
+         * Start or resume a download using My Videos MPX plugin.
+         *
+         * Can be called with 'Download' and 'ResumeDownload' commands from STIF script.
+         *
+         * @param iapName
+         * @param URL
+         * @param syncCall
+         * @param userName (optional)
+         * @param password (optional)
+         */
+        virtual TInt DownloadUrlL( CStifItemParser& aItem );
+
+        /**
+         * Cancel a download using My Videos MPX plugin.
+         *
+         * @param serviceName
+         * @param contentId
+         * @param syncCall
+         */
+        virtual TInt CancelDownloadL( CStifItemParser& aItem );
+
+        /**
+         * Cancel a download using My Videos MPX plugin.
+         *
+         * @param mpxId, if -1 then first DL's mpxId is used.
+         * @param downloadId, if -1 then first DL's downloadId is used.
+         * @param syncCall
+         */
+        virtual TInt CancelDownloadByIdL( CStifItemParser& aItem );
+
+        /**
+         * Pause a download using My Videos MPX plugin.
+         * Also disables automatic resuming of paused downloads.
+         *
+         * @param serviceName
+         * @param contentId
+         * @param syncCall
+         */
+        virtual TInt PauseDownloadL( CStifItemParser& aItem );
+
+        /**
+         * Pause a download using My Videos MPX plugin.
+         * Also disables automatic resuming of paused downloads.
+         *
+         * @param url
+         */
+        TInt PauseDownloadByUrlL( CStifItemParser& aItem );
+
+        /**
+         * Wait all downloads to complete.
+         *
+         * @param timeout minutes (default 10)
+         */
+        virtual TInt WaitAllDownloadsL( CStifItemParser& aItem );
+
+        /**
+         * Starts a wait for message or messages of same type.
+         * STIF script is signaled when all of the messages have been
+         * received.
+         *
+         * @param message type
+         * @param timeout (optional. seconds, default is 5 seconds )
+         * @param message count (optional)
+         */
+        virtual TInt WaitForMessageL( CStifItemParser& aItem );
+
+        /**
+         * Starts a wait for messages
+         * STIF script is signaled when any of specified messages
+         * is received.
+         *
+         * @param timeout ( seconds )
+         * @param message type
+         * @param message type2
+         * @param message type3 etc...
+         */
+        virtual TInt WaitForAnyMessageL( CStifItemParser& aItem );
+
+        /**
+         * Starts a wait for messages.
+         * STIF script is signaled when all of specified messages
+         * have been received.
+         *
+         * @param timeout ( seconds )
+         * @param message type
+         * @param message type2
+         * @param message type3 etc...
+         */
+        virtual TInt WaitForMessagesL( CStifItemParser& aItem );
+
+        void WaitForMessagesL( TBool aBlock, RArray<TInt>& aMessages, TInt aTimeout, TBool aWaitAll );
+
+        /**
+         *  Other methods.
+         */
+
+        /**
+         * Delete directory if it's empty.
+         */
+        TInt DeleteDirectoryIfEmpty( RFs& aFs, CFileMan& aFileMan, const TDesC& aDirectory );
+
+        /**
+         *
+         */
+        TInt MapMpxMediaAttribute( TVcxTestMediaAttributeIdMapping aMapping, TMPXAttributeData& aAttribute,
+                TVcxTestMediaAttributeType& aType );
+
+        /**
+         *
+         */
+        void GetMessageDesc( TInt aMessage, TDes& aMsgBuff );
+
+        /**
+         * CheckMediasL
+         *
+         * aExpectedVideoCount
+         * aDrive
+         * aCheckType, 0 = exact, 1 no more than specified count, -1 no less than specified count.
+         */
+        void CheckMediasL( TInt aExpectedVideoCount, TInt aDrive, TInt aCheckType );
+
+        /**
+         * Gets drive parameter from aItem.
+         */
+        TInt GetDriveParam( CStifItemParser& aItem, TInt& aDrive );
+
+        /**
+         * MPX collection -> Close & Open( index ) & Open
+         */
+        void DoTotalRefreshL();
+        
+        /**
+         * Waits ongoing refresh to finish, can be forced to wait for next refresh.
+         */
+        void WaitForRefreshL( TBool aForcedWait );
+        
+        /**
+         * Gets medias for the specified level. 
+         */
+        CMPXMediaArray* GetMediasForLevelL( TInt aLevel, TUint aFlagsFilter );
+        
+    private:    // Data
+
+        // Instance of class holding the test logic to test MV MPX collection.
+        CVCXMyVideosCollectionPluginTester *iTester;
+
+        // CVCXTestCommon
+        CVCXTestCommon* iTestCommon;
+
+        // RFs
+        RFs iFs;
+        
+        // I'm a FileMan
+        CFileMan* iFileMan;
+
+        // Filenames created with CreateVideoFileL method are stored here.
+        RPointerArray<HBufC> iSideloadedFiles;
+
+        // Folders used for sideloading.
+        RPointerArray<HBufC> iSideloadFolders;
+
+        // CIptvTestActiveWait
+        CIptvTestActiveWait* iActiveWait;
+
+        // CIptvTestActiveWait
+        CIptvTestActiveWait* iActiveWaitBlocking;
+
+        TBool iDeleteSideloadedFilesAndFolders;
+
+        // List of messages which are in currently waited.
+        // Failed messages cause signal always.
+        RArray<TInt> iWaitedTestMessages;
+
+        TInt iLastReceivedMessage;
+
+        TBool iWaitingForAllMessages;
+
+        // Seconds to wait before message is got, default is 5
+        TInt iMessageWaitTimeout;
+
+        TBool iWaitingForAllDownloads;
+
+        // Wait is not called from script but from test module.
+        TBool iMessageWaitIsBlocking;
+
+//#ifdef __WINSCW__
+        RHarvesterClient iClient;
+//#endif // __WINSCW__
+
+        // Timeout timer
+        CIptvTestTimer* iTimeoutTimer;
+
+        TBuf<256> iCaseId;
+
+        TBool iLoggingEnabled;
+
+        CIptvTestTimer* iCoolDownTimer;
+
+        TBool iCoolDownWait;
+
+        TInt iEventError;
+
+        // Autoresume downloads
+        TBool iAutoResume;
+
+        CMPXMedia* iMpxMedia;
+
+        TBool iFileCheckDisabled;
+
+        TInt iLastDownloadError;
+
+        CVCXMyVideosTestServiceEmu* iServiceEmu;
+
+        CVCXTestMdsDbModifier* iMdsDbModifier;
+
+        TInt iCurrentSortOrder;
+
+        // To cancel move/copy/delete operations right after they start.
+        TBool iCancelNextOperation;
+        
+        // This is for passing media count check when mpx plugin build is urel, 
+        // which causes add media cmd to fail. 
+        TInt iAddMediaCmdCount;
+        
+        // Class to hold robustness and performance data.
+        CVCXTestStatsKeeper* iStats;
+
+        TBool iStatsEnabled;        
+    };
+
+#endif      // VCXMYVIDEOSCOLLECTIONPLUGINTEST_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/inc/VCXMyVideosCollectionPluginTester.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,599 @@
+/*
+* Copyright (c) 2002 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:   ?Description*
+*/
+
+
+
+#ifndef VCXMYVIDEOSCOLLECTIONPLUGINTESTER_H
+#define VCXMYVIDEOSCOLLECTIONPLUGINTESTER_H
+
+//  INCLUDES
+#include <StifLogger.h>
+#include <TestScripterInternal.h>
+#include <StifTestModule.h>
+#include <mpxcollectionobserver.h>
+#include "MVCXMyVideosCollectionPluginTesterObserver.h"
+#include <mpxmediabase.h>
+#include <f32file.h>
+#include "MIptvTestTimerObserver.h"
+#include "VCXMyVideosTestTransactions.h"
+
+// CONSTANTS
+const TUint KOpenCollectionActionId =        10000001;
+const TUint KOpenCollectionLevelActionId =   10000002;
+const TUint KRefreshCollectionActionId =     10000003;
+const TUint KGetMediaFullDetailsActionId =   10000004;
+const TUint KSideloadVideoActionId =         10000005;
+const TUint KRemoveMediaActionId =           10000006;
+
+// MACROS
+
+// FORWARD DECLARATIONS
+class MMPXCollectionUtility;
+class CVCXTestCommon;
+class CVCXMyVideosTestDlWatcher;
+class CIptvTestActiveWait;
+class CVCXMyVideosTestDownload;
+class CIptvTestTimer;
+class CVCXTestStatsKeeper;
+
+// DATA TYPES
+
+// CLASS DECLARATION
+
+/**
+*  CVCXMyVideosCollectionPluginTester test class
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class CVCXMyVideosCollectionPluginTester : public CBase, 
+                                           public MMPXCollectionObserver,
+                                           public MIptvTestTimerObserver
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CVCXMyVideosCollectionPluginTester* NewL( MVCXMyVideosCollectionPluginTesterObserver* aObserver,
+                CVCXTestCommon* aTestCommon, CVCXTestStatsKeeper* aStatsKeeper );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CVCXMyVideosCollectionPluginTester();
+
+    public: // New functions
+
+        /**
+         * Opens MPX collection.
+         * Observer gets message when action is finished.
+         */
+        void OpenCollectionL( TUint32 aCollectionUid );
+
+        /**
+         * Opens MPX collection level.
+         * Observer gets message when action is finished.
+         */
+        void OpenLevelL( TInt aIndex );
+
+        /**
+         * Gets medias by their MPX IDs. A collection must be opened before calling this.
+         * The returned medias are handled as when opening collection.
+         * @param aStartIndex, start index in iMediaArray, first media to get.
+         * @param aEndIndex, end index in iMediaArray, last media to get.
+         */
+        void GetMediasByMpxIdL( TInt aStartIndex, TInt aEndIndex, TBool aSync );
+
+        /**
+         * Opens MPX collection level.
+         * Observer gets message when action is finished.
+         */
+        void RefreshContentsL();
+
+        /**
+         * Closes MPX collection level or collection.
+         * Observer gets message when action is finished.
+         */
+        void CloseLevelL();
+
+        /**
+         * Gets item from MPX and prints details for it. Copy of the media is 
+         * stored to member variable and can be fetched with GetLastFullMedia. 
+         * Observer gets message when action is finished.
+         */
+        void GetMediaFullDetailsL( TInt aDrive, TInt aIndex );
+        
+        /**
+         * Gets item from MPX and prints details for it. Copy of the media is 
+         * stored to member variable and can be fetched with GetLastFullMedia. 
+         * Observer gets message when action is finished.
+         */
+        void GetMediaFullDetailsByMpxIdL( TInt aDrive, TInt aIndex, TBool aSync );
+        
+        /**
+         * Gets the full details for all of the medias and prints them to debug output. 
+         */
+        void GetAllMediaFullDetailsL();
+
+        /**
+         * Prints details for items in the current MPX level and
+         * updates the downloads. This is done when collection or collection
+         * level is opened.
+         */
+        void ProcessCurrentEntriesL();
+
+        /**
+         * Prints MPX media object properties.
+         */
+        void PrintMediasL( CMPXMediaArray* aMediaArray, TBool aCheckChanges, const TDesC& aTitle );
+        
+        /**
+         * Prints MPX media object properties to debug output.
+         */
+        void PrintMPXMediaL( const CMPXMedia& aMedia, TBool aPrintAllDetails );
+        
+        /**
+         * Returns count of items of the open MPX level.
+         */
+        TInt GetMediaCount();
+
+        /**
+         * Adds media to the collection.
+         * Observer gets message when action is finished.
+         */
+        void AddMediaL( CMPXMedia* aMedia, TBool aSync );
+
+        /**
+         * Updates media in the collection.
+         * Observer gets message when action is finished.
+         */
+        void SetMediaL( CMPXMedia* aMedia, TBool aSync );
+
+        /**
+         * Removes media item with command KMPXCommandIdCollectionRemoveMedia to MV MPX plugin.
+         */
+        void RemoveMediaL( TInt aDrive, TInt aIndex, TBool aSync );
+        
+        /**
+         * Removes media item with command KMPXCommandIdCollectionRemoveMedia to MV MPX plugin.
+         */
+        void RemoveMediaByMpxIdL( TInt aMpxId, TBool aSync );
+
+        /**
+         * Deletes files of the current media entries.
+         */
+        void DeleteAllMediaFilesL();
+
+        /**
+         * Deletes a file of a media in current entries.
+         */
+        void DeleteFileOfMediaL( TInt aDrive, TInt aIndex );
+
+        /**
+         * Gets MPX media from current entries. Contains only brief details of the item.
+         */
+        CMPXMedia* GetMediaL( TInt aDrive, TInt aIndex );
+
+        /**
+         * Moves multiple medias to specified drive.
+         * 
+         * @param aSourceDrive, -1 is all drives 
+         * @param aStartIndex
+         * @param aEndIndex 
+         * @param aDestDrive
+         * @param aSync
+         */
+        void MoveMediasL(  TInt aSourceDrive, TInt aStartIndex, TInt aEndIndex, TInt aDestDrive, TBool aSync );
+
+        /**
+         * Cancels move or copy request.
+         */
+        void CancelMoveOrCopyL( TBool aSync );
+
+        /**
+         * Copies multiple medias to specified drive.
+         * 
+         * @param aSourceDrive, -1 is all drives 
+         * @param aStartIndex
+         * @param aEndIndex 
+         * @param aDestDrive
+         * @param aSync
+         */
+        void CopyMediasL(  TInt aSourceDrive, TInt aStartIndex, TInt aEndIndex, TInt aDestDrive, TBool aSync );
+        
+        /**
+         * Deletes multiple medias on specified drive.
+         * 
+         * @param aSourceDrive, -1 is all drives 
+         * @param aStartIndex
+         * @param aEndIndex 
+         * @param aSync
+         */
+        void DeleteMediasL(  TInt aSourceDrive, TInt aStartIndex, TInt aEndIndex, TBool aSync );
+        
+        void DeleteMediasByMpxIdsL( CMPXMediaArray* aMedias, TBool aSync );        
+        
+        void DeleteMediaByMpxIdL( TMPXItemId& aMpxId, TBool aSync );
+
+        /**
+         * Cancels move request.
+         */
+        void CancelDeleteL( TBool aSync );
+        
+        /**
+         * Use to toggle automatic refresh of contents when open collection changes.
+         */
+        void SetAutomaticRefresh( TBool aValue );
+        
+        /**
+         * Returns true if refresh is ongoing.
+         */
+        TBool IsRefreshing();
+        
+        /**
+         * Use to disable some of the logging.
+         */
+        void SetQuietMode( TBool aValue );
+
+        /**
+         * Starts MPX My Videos download.
+         * @param aTitle
+         * @param aIapId
+         * @param aServiceId
+         * @param aContentId
+         * @param aUrl
+         * @param aSync
+         * @param aUserName
+         * @param aPassword
+         * @param aMedia
+         */
+        void StartDownloadL( const TDesC& aTitle, TInt aIapId, TInt aServiceId, TInt aContentId,
+                const TDesC& aUrl, TBool aSync, const TDesC& aUserName, const TDesC& aPassword,
+                CMPXMedia* aMedia );
+        
+        /**
+         * Resumes MPX My Videos download.
+         * If download is not found from cache then fake download ID is used.
+         * 
+         * @param aTitle
+         * @param aIapId
+         * @param aServiceId
+         * @param aContentId
+         * @param aUrl
+         * @param aSync
+         * @param aUserName
+         * @param aPassword
+         * @param aMedia
+         */
+        void ResumeDownloadL( const TDesC& aTitle, TInt aIapId, TInt aServiceId, TInt aContentId,
+                const TDesC& aUrl, TBool aSync, const TDesC& aUserName, const TDesC& aPassword,
+                CMPXMedia* aMedia );        
+
+        /**
+         * Resumes MPX My Videos downloads.
+         */
+        void ResumeAllDownloadsL();
+        
+        /**
+         * Cancels MPX My Videos download.
+         */
+        void CancelDownloadL( CVCXMyVideosTestDownload* aDownload, TBool aSync );
+
+        /**
+         * Cancels MPX My Videos download.
+         */
+        void CancelDownloadL( TInt aMpxId, TInt aDownloadId, const TPtrC& aDownloadPath, TBool aSync );
+
+        /**
+         * Pauses MPX My Videos download.
+         */
+        void PauseDownloadL( TInt aServiceId, TInt aContentId, const TDesC& aUrl, TBool aSync );
+
+        /**
+         * Pauses MPX My Videos download.
+         */
+        void PauseDownloadL( const TDesC& aUrl, TBool aSync  );
+
+        /**
+         * Returns instance of the download watcher.
+         */
+        CVCXMyVideosTestDlWatcher* GetDownloadWatcher();
+
+        /**
+         * Returns number of active downloads.
+         */
+        TInt GetActiveDownloadCountL();
+
+        /**
+         * Sets automatic resuming of paused download.
+         */
+        void SetAutoResume( TBool aValue );
+
+        /**
+         * Returns the index of current collection level.
+         */
+        TInt GetCurrentLevel();
+        
+        /**
+         * Returns the currently opened level index (category).
+         */
+        TInt GetCurrentOpenLevelIndex();
+
+        /**
+         * Returns the media from last call to GetMediaDetailsL.
+         */
+        CMPXMedia* GetLastFullMedia();
+
+        /**
+         * Gets index of media in collection side array.  
+         */
+        TInt GetMediaIndexInCollectionL( TInt aDrive, TInt aIndex );
+        
+        /**
+         * Returns the video count on specified drive. 
+         */
+        TInt GetVideoCountForDrive( TInt aDrive );
+        
+        /**
+         * Returns all medias from collection side.
+         */
+        const CMPXMediaArray* GetAllCollectionMedia();
+
+        /**
+         * Ensures that files are not in use.
+         */
+        void EnsureMediaFilesAreNotInUseL();
+        
+        /**
+         * Creates media array with following rules:
+         * If startIndex is > 0 and < endIndex then these files will be selected from specified drive.
+         * If startIndex is -1 then invalid IDs will be used and end index is count.
+         * If startIndex is -2 then duplicate MPX IDs are requested starting from 0.
+         * If startIndex is -3 then only every second MPX item is used in request and starting from 0.
+         * If startIndex > endIndex then empty array is returned. 
+         *
+         * @param aDriveFilter, -1 is all files. This is ignored for all other rules but the first.
+         *                      When drive is specified selection starts from index 0. 
+         * @param aStartIndex index at current entries.
+         * @param aEndIndex, index at current entries.
+         */
+        CMPXMediaArray* SelectMediasL( TInt aDriveFilter, TInt aStartIndex, TInt aEndIndex );
+        
+    private:
+        /**
+         * Updates the downloads using current MPX entries.
+         */
+        void UpdateDownloadsL( TBool aQuietMode );
+        
+        /** 
+         * Creates a MPX command.
+         * 
+         * @param aCommandGeneralId
+         * @param aMyVideosCommandId ( this is used only if aCommandGeneralId is My Videos collection specific.    
+         * @param aAsync
+         */
+        CMPXCommand* CreateMpxCommandLC( TInt aCommandGeneralId, TInt aMyVideosCommandId, TBool aAsync );
+            
+        /**
+         * Ensures that result medias array has all the medias of requested array. 
+         */
+        void CheckRequestMediaArrayL( CMPXMediaArray& aRequestResultMedias, RArray<TInt32>& aRequestedMediaIds );
+
+        /**
+         * Creates copies of medias in iCollectionEntries to iMediaArray and old media array is moved to 
+         * iOldMediaArray.
+         */
+        void UpdateOwnedMediaArrayL();
+        
+        /**
+         * Compares iMediaArray to iOldMediaArray and returns copies if any of the medias are different.
+         */
+        CMPXMediaArray* GetChangedMedias( const CMPXMediaArray* aNewMedias );        
+        
+        /**
+         * Returns media from the aMedias array for specified mpx id.
+         */
+        CMPXMedia* GetMediaByMpxId( CMPXMediaArray* aMedias, TMPXItemId& aMpxId );
+        
+        /**
+         * Sets status of refresh.
+         */
+        void SetRefreshStatus( TBool aRefreshingCollection );
+        
+    public: // Functions from base classes
+
+        /**
+        *  From MMPXCollectionObserver->MMPXCollectionMediaObserver
+        *  Handle extended media properties
+        *
+        *  @param aMedia media
+        *  @param aError error code
+        */
+        virtual void HandleCollectionMediaL( const CMPXMedia& aMedia, TInt aError );
+
+        /**
+        *  From MMPXCollectionUtilityObserver.
+        *  Handle collection message
+        *  NOTE: only one of HandleCollectionMessage callback can be implemented
+        *
+        *  @param aMessage collection message, ownership not transferred.
+        *         Please check aMsg is not NULL before using it. If aErr is not
+        *         KErrNone, plugin might still call back with more info in the aMsg.
+        *  @param aErr system error code.
+        */
+        void HandleCollectionMessage( CMPXMessage* aMsg, TInt /*aErr*/ );
+
+        void HandleSingleCollectionMessageL( CMPXMessage* aMessage );
+
+        /**
+        *  From MMPXCollectionUtilityObserver.
+        *  Handles the collection entries being opened. Typically called
+        *  when client has Open()'d a folder
+        *
+        *  @param aEntries collection entries opened
+        *  @param aIndex focused entry
+        *  @param aComplete ETrue no more entries. EFalse more entries
+        *                   expected
+        *  @param aError error code
+        */
+        void HandleOpenL( const CMPXMedia& aEntries,
+                          TInt aIndex,TBool aComplete,TInt aError );
+
+        /**
+        *  From MMPXCollectionUtilityObserver.
+        *  Handles the item being opened. Typically called
+        *  when client has Open()'d an item. Client typically responds by
+        *  'playing' the item via the playlist
+        *
+        *  @param aPlaylist collection playlist
+        *  @param aError error code
+        */
+        void HandleOpenL( const CMPXCollectionPlaylist& aPlaylist,TInt aError );
+
+        /**
+        *  From MMPXCollectionUtilityObserver.
+        *  Handle completion of a asynchronous command
+        *  @param aCommandResult result of the command, NULL if error
+        *  @param aError error code
+        */
+        void HandleCommandComplete( CMPXCommand* aCommandResult,
+                                    TInt aError);
+
+        /**
+        * From MIptvTestTimerObserver Handles timer completion
+        * @since
+        * @param aTimerId
+        * @param aError
+        */
+        void TimerComplete(TInt aTimerId, TInt aError);
+        
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CVCXMyVideosCollectionPluginTester( MVCXMyVideosCollectionPluginTesterObserver* aObserver, 
+                CVCXTestCommon* aTestCommon, CVCXTestStatsKeeper* aStatsKeeper );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+    private:    // Data
+
+        // MVCXMyVideosCollectionPluginTesterObserver
+        MVCXMyVideosCollectionPluginTesterObserver* iObserver;
+
+        // UID of currently open collection.
+        TUid iCollectionUid;
+
+        // The index of last level which was opened.
+        TInt iCurrentOpenedLevelIndex;
+        
+        HBufC* iCurrentLevelName;
+
+        // MMPXCollectionUtility.
+        MMPXCollectionUtility* iCollectionUtility;
+
+        // Entries from collection.
+        CMPXMedia* iCollectionEntries;
+
+        // Media array of videos on collection side. 
+        CMPXMediaArray* iCollectionMediaArray;
+        
+        // Media array of videos tests uses.
+        CMPXMediaArray* iMediaArray;
+
+        // Media array of previous videos.
+        CMPXMediaArray* iOldMediaArray;
+
+        // Count of current medias in iMediaArray.
+        TUint32 iMediaCount;
+
+        // CVCXTestCommon.
+        CVCXTestCommon* iTestCommon;
+
+        // RFs.
+        RFs iFs;
+
+        // Refresh is already ongoing.
+        TBool iRefreshingCollection;
+
+        // Member to keep track of downnloads.
+        CVCXMyVideosTestDlWatcher* iDlWatcher;
+
+        // Active wait
+        CIptvTestActiveWait* iActiveWait;
+
+        // Refresh contents of open collection when they change
+        TBool iAutomaticContentRefresh;
+
+        // Tester is waiting for item change.
+        TBool iWaitingForItemChange;
+
+        // Autoresume downloads
+        TBool iAutoResume;
+
+        // Downloads do not start updating before we get DL related commands from script.
+        TBool iUpdateDownloads;
+
+        TUint32 iCurrentMyVideosMessageId;
+
+        RArray<TInt32> iRequestedMediaIds;
+        
+        // Full details of media got from GetMediaDetailsL
+        CMPXMedia* iFullMedia;
+
+        TBool iGettingFullDetailsForAllMedia;
+
+        // Item ids which have been deleted in change event.
+        RArray<TUint32> iDeletedItemIds;
+
+        // Item ids which have been inserted in change event.
+        RArray<TUint32> iInsertedItemIds;
+        
+        CVCXMyVideosTestTransactions* iTransactions;
+        
+        TBool iQuietMode;
+        
+        // Canceling Move, Copy or Delete cause commmand completion with error KErrCancel  
+        TBool iCancelRequested;
+        
+        // Update downloads only after first one is started.
+        TBool iDownloadsStarted;
+        
+        TInt iActionCount;
+        
+        // Download progress update timer.
+        CIptvTestTimer* iProgressTimer;
+        
+        TInt iVideosOnRomCount;
+        
+        // Variable to follow what kind of collection opening is going on.  
+        TInt iCurrentActionId; 
+        
+        // Variable to follow where action ending should be handled. 
+        TBool iCurrentActionHasResponse;
+        
+        // Class to hold robustness and performance data.
+        CVCXTestStatsKeeper* iStats;
+    };
+
+#endif      // VCXMYVIDEOSCOLLECTIONPLUGINTESTER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/inc/VCXMyVideosTestCommon.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2002 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:   ?Description*
+*/
+
+
+
+#ifndef VCXMYVIDEOSTESTCOMMON_H
+#define VCXMYVIDEOSTESTCOMMON_H
+
+const TInt KVCXMYVideosTestMessageNotAccepted                    = 0;
+
+const TInt KVCXMYVideosTestMessageDlSucceeded                    = 1000;
+const TInt KVCXMYVideosTestMessageDlFailed                       = 1001;
+const TInt KVCXMYVideosTestMessageDlPaused                       = 1002;
+const TInt KVCXMYVideosTestMessageDlGeneral                      = 1003;
+const TInt KVCXMYVideosTestMessageDlRunning                      = 1020;
+const TInt KVCXMYVideosTestMessageDlCanceled                     = 1021;
+const TInt KVCXMYVideosTestMessageDlProgressed                   = 1022;
+
+const TInt KVCXMYVideosTestMessageCollectionMessageError         = 2000;
+const TInt KVCXMYVideosTestMessageCollectionOpened               = 2001;
+const TInt KVCXMYVideosTestMessagePlaylistOpened                 = 2002;
+const TInt KVCXMYVideosTestMessageCollectionMedia                = 2003;
+const TInt KVCXMYVideosTestMessageCommandComplete                = 2004;
+const TInt KVCXMYVideosTestMessageGotMediasByKMpxId              = 2005;
+const TInt KVCXMYVideosTestMessageMoveResp                       = 2006;
+const TInt KVCXMYVideosTestMessageCopyResp                       = 2007;
+const TInt KVCXMYVideosTestMessageListComplete                   = 2008;
+const TInt KVCXMYVideosTestMessageCopyOrMoveStarted              = 2009;
+const TInt KVCXMYVideosTestMessageDeleteStarted                  = 2010;
+const TInt KVCXMYVideosTestMessageDeleteResp                     = 2011;
+const TInt KVCXMYVideosTestMessageCommandCanceled                = 2012;
+
+// These are only handled when WaitForMessage is called.
+const TInt KVCXMYVideosTestMessageCollectionGeneral              = 3000;
+const TInt KVCXMYVideosTestMessageCollectionItemChanged          = 3001;
+const TInt KVCXMYVideosTestMessageCollectionCategoryChanged      = 3002;
+
+const TInt KVCXMYVideosTestMessageMpxItemInserted                = 4000;
+const TInt KVCXMYVideosTestMessageMpxItemDeleted                 = 4001;
+const TInt KVCXMYVideosTestMessageMpxItemModified                = 4002;
+
+const TInt KVCXMyVideosTestMessageVideoListOrderChanged          = 5000;                 
+
+const TInt KVCXMYVideosTestErrorDownloadNotFound                 = 10001;
+const TInt KVCXMYVideosTestErrorFileNotFound                     = 10002;
+
+#endif      // VCXMyVideosTestCommon.h
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/inc/VCXMyVideosTestDlWatcher.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,269 @@
+/*
+* Copyright (c) 2002 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:   ?Description*
+*/
+
+
+
+#ifndef VCXMYVIDEOSTESTDLWATCHER_H
+#define VCXMYVIDEOSTESTDLWATCHER_H
+
+//  INCLUDES
+#include <f32file.h>
+#include <vcxmyvideosdefs.h>
+
+#include "MVCXMyVideosCollectionPluginTesterObserver.h"
+
+// CONSTANTS
+const TInt KVCXTestProgressUpdateInterval( 10 );
+
+// MACROS
+
+// FORWARD DECLARATIONS
+
+// DATA TYPES
+
+// FORWARD DECLARATIONS
+class CVCXTestStatsKeeper;
+
+// CLASS DECLARATION
+
+/**
+*  CVCXMyVideosTestDownload test class
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class CVCXMyVideosTestDownload : public CBase
+{
+    public:  // Constructors and destructor
+        /**
+        * Two-phased constructor.
+        */
+        static CVCXMyVideosTestDownload* NewL();
+
+        /**
+        * Destructor.
+        */
+        virtual ~CVCXMyVideosTestDownload();
+
+    public: // Functions from base classes
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CVCXMyVideosTestDownload();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL( );
+
+    public: // Data
+        HBufC* iTitle;
+
+        HBufC* iUrl;
+
+        HBufC* iPath;
+
+        HBufC* iUserName;
+
+        HBufC* iPassword;
+
+        TBool iSyncCall;
+
+        TInt iIapId;
+
+        TInt iState;
+
+        TInt iProgress;
+
+        TUint32 iServiceId;
+
+        TUint32 iContentId;
+
+        TInt iDownloadError;
+
+        TInt iGlobalError;
+
+        TInt iMpxId;
+
+        TUint32 iDownloadId;
+
+        TInt iInformed;
+
+        // This is set during download check.
+        TBool iExists;
+
+        // Set when download is marked to be canceled.
+        TBool iCanceled;
+
+        TBool iWaitingResume;
+        
+        TBool iWaitingPause;
+};
+
+/**
+*  CVCXMyVideosTestDlWatcher test class
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class CVCXMyVideosTestDlWatcher : public CBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CVCXMyVideosTestDlWatcher* NewL( MVCXMyVideosCollectionPluginTesterObserver* aObserver, CVCXTestStatsKeeper* aStatsKeeper  );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CVCXMyVideosTestDlWatcher();
+
+    public: // New functions
+
+        /**
+         * Creates an empty download item.
+         */
+        void CreateDownloadL( TInt aIapId, TInt aServiceId, TInt aContentId, const TDesC& aUrl, TBool aSync, const TDesC& aUserName, const TDesC& aPassword );
+
+        /**
+         * Called when downloads starts. Updates the attributes of download.
+         */
+        void StartDownloadL( const TDesC& aUrl, const TDesC& aPath, TInt aDownloadId, TInt aMpxId, const TDesC& aTitle, TVcxMyVideosDownloadState aState, TInt aProgress );
+
+        /**
+         * Updates download state.
+         */
+        void UpdateDownloadStateL( TInt aMpxId, TInt aDownloadId, TVcxMyVideosDownloadState aState, TInt aProgress, TInt aDownloadError, TInt aGlobalError );
+
+        /**
+         * Updates download progress.
+         */
+        void UpdateDownloadProgressL( TInt aMpxId, TInt aDownloadId, TInt aProgress );
+
+        /**
+         * Cancels a download.
+         */
+        void CancelDownloadL( TInt aServiceId, TInt aContentId, const TDesC& aUrl );
+
+        void SetDownloadResumedFlagL( TInt aMpxId, TInt aDownloadId );
+        
+        void SetDownloadPausedFlagL( TInt aMpxId, TInt /* aDownloadId */ );
+
+        /**
+         * Returns DL with specified mpx ID.
+         */
+        CVCXMyVideosTestDownload* GetDownloadByMpxId( TInt aMpxId );
+
+        /**
+         * Returns DL with specified download ID.
+         */
+        CVCXMyVideosTestDownload* GetDownloadByDownloadId( TInt aDownloadId );
+
+
+        /**
+         * Returns DL with specified parameters.
+         */
+        CVCXMyVideosTestDownload* GetDownload( TInt aServiceId, TInt aContentId, const TDesC& aUrl );
+
+        /**
+         * Returns DL with specified URL. If there's several DLs with same URL then DL with state none is preferred.
+         */
+        CVCXMyVideosTestDownload* GetDownload( const TDesC& aUrl );
+
+        /**
+         * Returns DL at specified index.
+         */
+        CVCXMyVideosTestDownload* GetDownloadByIndex( TInt aIndex );
+
+        TInt GetDownloadCount();
+
+        TInt GetFailedDownloadCount();
+
+        void CleanupDownloadsL( TInt aServiceId, TInt aContentId, const TDesC& aUrl );
+
+        /**
+         * Prints download information to debug output.
+         */
+        void PrintDownloads();
+
+        /**
+         * Prints URL to debug output.
+         */
+        void PrintUrl( const TDesC& aPre, const TDesC& aUrl );
+
+        /**
+         * Call before updating all the downloads. Upon update downloads are checked for validity.
+         */
+        void PrepareCheck();
+
+        /**
+         * Call after updating the downloads. If there's any inconsistencies with downloads the test scripter
+         * will be signaled.
+         */
+        void FinishCheckL();
+
+        /**
+         * Disables check for missing downloads.
+         */
+        void DisableDownloadCheck();
+
+        /**
+         * Removes all download entries.
+         */
+        void Reset();
+
+    private: // New functions
+
+        const TDesC& GetStateDesc( TVcxMyVideosDownloadState aState );
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CVCXMyVideosTestDlWatcher( CVCXTestStatsKeeper* aStatsKeeper );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL( MVCXMyVideosCollectionPluginTesterObserver* aObserver );
+        
+    private:    // Data
+
+        MVCXMyVideosCollectionPluginTesterObserver* iObserver;
+
+        RPointerArray<CVCXMyVideosTestDownload> iDownloads;
+
+        TBool iDlCheckActive;
+        TBool iDlCheckDisabled;
+
+        RFs iFs;
+
+        TBool iMpxCollectionRefreshing;
+        
+        CVCXTestStatsKeeper* iStats;
+    };
+
+#endif      // VCXMYVIDEOSTESTDLWATCHER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/inc/VCXMyVideosTestServiceEmu.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,135 @@
+/*
+* Copyright (c) 2002 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 to emulate IPTV services and ECG content.*
+*/
+
+
+
+#ifndef VCXMYVIDEOSTESTSERVICEEMU_H
+#define VCXMYVIDEOSTESTSERVICEEMU_H
+
+//  INCLUDES
+#include <e32base.h>
+
+// CONSTANTS
+
+_LIT( KVcxTestServiceName1, "OOPS" ); // http://193.65.182.78/oops.xml
+_LIT( KVcxTestServiceName2, "NokiaVideos" ); // http://193.65.182.78/nokia_vod.xml
+_LIT( KVcxTestServiceName3, "Enginetestingfeed" ); // http://193.65.182.78/testingfeed_iptvengine.xml
+_LIT( KVcxTestServiceName4, "SmallVideos" ); // http://193.65.182.78/misc/smallvideos/smallvideos.xml
+_LIT( KVcxTestServiceName5, "Miscvideos" ); // http://193.65.182.78/miscvideos.xml
+
+// MACROS
+//#define ?macro ?macro_def
+
+// FORWARD DECLARATIONS
+
+// DATA TYPES
+//enum ?declaration
+//typedef ?declaration
+//extern ?data_type;
+
+// CLASS DECLARATION
+
+class CVCXMyVideosTestContent : public CBase
+    {
+    public:  // Constructors and destructor
+        /**
+        * Two-phased constructor.
+        */
+        static CVCXMyVideosTestContent* NewL( TInt aServiceId, TInt aContentId, const TPtrC& aUrl, const TPtrC& aTitle );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CVCXMyVideosTestContent();
+
+    private: // New functions
+
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CVCXMyVideosTestContent();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL( TInt aServiceId, TInt aContentId, const TPtrC& aUrl, const TPtrC& aTitle );
+
+    public:    // Data
+
+        HBufC* iUrl;
+        HBufC* iTitle;
+        TInt iServiceId;
+        TInt iContentId;
+    };
+
+/**
+*  CVCXMyVideosTestServiceEmu test class
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class CVCXMyVideosTestServiceEmu : public CBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CVCXMyVideosTestServiceEmu* NewL();
+
+        /**
+        * Destructor.
+        */
+        virtual ~CVCXMyVideosTestServiceEmu();
+
+    public: // New functions
+
+        TInt GetServiceIdL( const TDesC& aServiceName, TInt& aServiceId );
+
+        const TPtrC GetContentUrlL( TInt aServiceId, TInt aContentId );
+
+        const TPtrC GetContentTitleL( TInt aServiceId, TInt aContentId );
+
+    public: // Functions from base classes
+
+    private: // New functions
+
+        void AddServiceContentL( const TDesC& aServiceName, TInt aContentId, const TDesC& aUrl, const TDesC& aTitle );
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CVCXMyVideosTestServiceEmu( );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL( );
+
+    private:    // Data
+
+        RPointerArray<CVCXMyVideosTestContent> iContents;
+    };
+
+#endif      // VCXMYVIDEOSTESTSERVICEEMU_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/inc/VCXMyVideosTestTransactions.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,111 @@
+/*
+* Copyright (c) 2002 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:   ?Description*
+*/
+
+
+#ifndef VCXMYVIDEOSTESTTRANSACTIONS_H
+#define VCXMYVIDEOSTESTTRANSACTIONS_H
+
+//  INCLUDES
+#include <e32base.h>
+
+// CONSTANTS
+
+// MACROS
+
+// FORWARD DECLARATIONS
+
+// DATA TYPES
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*  CVCXMyVideosTestTransactions
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class CVCXMyVideosTestTransactions : public CBase
+{
+    public:  // Constructors and destructor
+        /**
+        * Two-phased constructor.
+        */
+        static CVCXMyVideosTestTransactions* NewL();
+
+        /**
+        * Destructor.
+        */
+        virtual ~CVCXMyVideosTestTransactions();
+
+    public: // Functions from base classes
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CVCXMyVideosTestTransactions();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL( );
+        
+    public: // New functions
+    
+        /**
+         * Returns the current transaction ID.
+         */
+        TUint32 TransactionId();
+        
+        /**
+        * Increments the current transaction ID.
+        * @return Current transaction id.
+        */
+        TUint32 NextTransactionId();        
+        
+        /**
+         * Adds transaction to queue for the current id.
+         * @return Current transaction id.
+         */
+        void AddTransactionId( TUint32 aCommandId );
+        
+        /**
+         * User calls this when response for transaction is got. 
+         * Transaction is removed from queue if found.
+         * @return ETrue if found from queue, else EFalse.      
+         */
+        TBool TransactionResponse( TUint32 aTransactionId );
+        
+        /**
+         * Checks that all transactions have responses, meaning the queue is empty. 
+         */
+        TInt CheckTransactions();
+
+    public: // Data
+  
+        TUint32 iTransactionId;
+        
+        RArray<TUint32> iTransactionIds;
+        RArray<TUint32> iCommandIds;
+};
+
+#endif      // VCXMYVIDEOSTESTTRANSACTIONS_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/inc/VCXTestMdsDbModifier.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,344 @@
+/*
+* 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 CVCXTESTMDSDBMODIFIER_H
+#define CVCXTESTMDSDBMODIFIER_H
+
+#include <mdesession.h>
+#include <mdequery.h>
+#include <harvesterclient.h>
+#include <mpxcollectionmessagedefs.h>
+
+// Copied from vcxmyvideosmdsdb.cpp, keep up to date.
+
+/**
+ *  MDS database class for VCX testing.
+ */
+NONSHARABLE_CLASS(CVCXTestMdsDbModifier) :
+                                public CBase,
+                                public MMdESessionObserver,
+                                public MMdEQueryObserver,
+                                public MMdESchemaObserver,
+                                public MMdEObjectObserver
+    {
+
+public:
+
+    /**
+     * Two-phased constructor.
+     */
+    static CVCXTestMdsDbModifier* NewL();
+
+    /**
+     * Two-phased constructor.
+     */
+    static CVCXTestMdsDbModifier* NewLC();
+
+
+    /**
+    * Destructor.
+    */
+    virtual ~CVCXTestMdsDbModifier();
+
+    /**
+     * Remove video.
+     *
+     * @param aMdsId Id of the item to be removed.
+     * @return       KErrNotFound if video was not found, KErrNone if found and deleted.
+     */
+    TInt RemoveVideoL(
+        TUint32 aMdsId );
+
+    /**
+     * Update video.
+     *
+     * @param aVideo Video to update in MDS database.
+     */
+    void UpdateVideoL(
+        CMPXMedia& aVideo );
+
+    /**
+     * Delete an existing video.
+     *
+     * @param aFileId      File id (key) of the video to delete.
+     * @param aResultCount Result count is saved to this parameter.
+     * @return KErrNone if successful, otherwise another of the system-wide
+     *         error codes.
+     */
+    TInt DeleteVideoL(
+        TUint32 aFileId,
+        TInt& aResultCount,
+        TBool aForcedDelete = EFalse );
+
+// 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    <code>KErrNone</code>, 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  <code>KErrNone</code>, if the query was completed
+     *                successfully. Otherwise one of the system-wide error
+     *                codes.
+     */
+    void HandleQueryCompleted( CMdEQuery& aQuery, TInt aError );
+
+
+//  from MMdESchemaObserver
+
+	/**
+	 * Called to notify the observer that the schema has been modified.
+	 *
+	 * @param none
+	 */
+	void HandleSchemaModified();
+
+// from MMdEObjectObserver
+
+    void HandleObjectNotification( CMdESession& aSession,
+            TObserverNotificationType aType,
+            const RArray<TItemId>& aObjectIdArray);
+
+private:
+
+    /**
+     * Constructor.
+     * @param aObserver The db change observer.
+     */
+    CVCXTestMdsDbModifier();
+
+    void ConstructL();
+
+    /**
+     * 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();
+
+private: // data
+
+    /**
+     * The MDS session object. Own.
+     */
+    CMdESession* iMDSSession;
+
+    /**
+     * The error code saved from the callbacks.
+     */
+    TInt iMDSError;
+
+    /**
+     * 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;
+
+    /**
+     * 17.
+     * The Download ID property definition. Not own.
+     */
+    CMdEPropertyDef* iDownloadIdPropertyDef;
+	
+    /**
+    * 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;
+
+
+    /**
+     * Active scheduled waiter Own..
+     */
+    CActiveSchedulerWait* iActiveSchedulerWait;
+
+    /**
+     * The file server session.
+     */
+    RFs iRfs;
+
+    /**
+     * Is the db already in use. If so, return KErrInUse.
+     */
+    TBool iDbInUse;
+
+    public:
+
+    };
+
+#endif // CVCXTESTMDSDBMODIFIER_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/init/All/TestFramework.ini	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,176 @@
+#
+# This is STIFTestFramework 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.
+
+[Engine_Defaults]
+
+TestReportMode= FullReport    # Possible values are: 
+                              # 'Summary', 'Environment', 'TestCases' or 'FullReport'
+
+CreateTestReport= YES         # Possible values: YES or NO
+
+TestReportFilePath= C:\Logs\Fusion\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT         # Possible values: TXT or HTML
+TestReportOutput= FILE        # Possible values: FILE or RDEBUG
+TestReportFileCreationMode= APPEND # Possible values: OVERWRITE or APPEND
+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\VCXMyVideosCollectionPluginTestDownload.cfg
+TestCaseFile= c:\testframework\VCXMyVideosCollectionPluginTestDownload2.cfg
+TestCaseFile= c:\testframework\VCXMyVideosCollectionPluginTestMoveCopy.cfg
+TestCaseFile= c:\testframework\VCXMyVideosCollectionPluginTestDelete.cfg
+TestCaseFile= c:\testframework\VCXMyVideosCollectionPluginTestSideload.cfg
+TestCaseFile= c:\testframework\VCXMyVideosCollectionPluginTestLists.cfg
+TestCaseFile= c:\testframework\VCXMyVideosCollectionPluginTestSorting.cfg
+TestCaseFile= c:\testframework\VCXMyVideosCollectionPluginTestAttributes.cfg
+TestCaseFile= c:\testframework\VCXMyVideosCollectionPluginTestDownloadMultipleDls.cfg
+TestCaseFile= c:\testframework\VCXMyVideosCollectionPluginTestFullMemory.cfg
+TestCaseFile= c:\testframework\VCXMyVideosCollectionPluginTestMultipleDrives.cfg
+TestCaseFile= c:\testframework\VCXMyVideosCollectionPluginTestBigFiles.cfg
+[End_Module]
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework 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)'#' 
+
+CreateLogDirectories= YES    # Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML         # Possible values: TXT or HTML
+#EmulatorOutput= FILE         # Possible values: FILE or RDEBUG
+
+#HardwareBasePath=  C:\
+#HardwareFormat= TXT			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+FileCreationMode= APPEND  # 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
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/init/TestFramework.ini	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,165 @@
+#
+# This is STIFTestFramework 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.
+
+[Engine_Defaults]
+
+TestReportMode= FullReport    # Possible values are: 
+                              # 'Summary', 'Environment', 'TestCases' or 'FullReport'
+
+CreateTestReport= YES         # Possible values: YES or NO
+
+TestReportFilePath= C:\Logs\Fusion\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT         # Possible values: TXT or HTML
+TestReportOutput= FILE        # Possible values: FILE or RDEBUG
+TestReportFileCreationMode= APPEND # Possible values: OVERWRITE or APPEND
+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\VCXMyVideosCollectionPluginTestHelium.cfg
+[End_Module]
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework 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)'#' 
+
+CreateLogDirectories= YES    # Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML         # Possible values: TXT or HTML
+#EmulatorOutput= FILE         # Possible values: FILE or RDEBUG
+
+#HardwareBasePath=  C:\
+#HardwareFormat= TXT			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+FileCreationMode= APPEND  # 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
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/mediatorevents/Bwins/MediatorEventVerifierU.DEF	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * LibEntryL(class CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/mediatorevents/EABI/MediatorEventVerifierU.def	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,5 @@
+EXPORTS
+	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
+	_ZTI24CVCXMediatorEventWatcher @ 2 NONAME ; #<TI>#
+	_ZTV24CVCXMediatorEventWatcher @ 3 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/mediatorevents/group/MediatorEventVerifier.mmp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,73 @@
+/*TYPE TESTCLASS*//*
+* 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 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 <platform_paths.hrh>
+
+TARGET          mediatoreventverifier.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E3
+
+CAPABILITY      ALL -TCB
+/* Remove comments and replace 0x00000000 with correct vendor id */
+// VENDORID     0x00000000
+/* Remove comments and replace 0x00000000 with correct secure id */
+// SECUREID     0x00000000
+
+//TARGETPATH      ?target_path
+DEFFILE         MediatorEventVerifier.def
+
+USERINCLUDE     ../inc 
+USERINCLUDE     ../../../../../../tsrc/VCXTestCommon/inc
+USERINCLUDE     ../../../../../../tsrc/VCXTestMyVideosCollectionClient/inc
+
+SYSTEMINCLUDE /Epoc32/include/ecom
+APP_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH      ../src
+
+SOURCE          MediatorEventVerifier.cpp
+SOURCE          MediatorEventVerifierBlocks.cpp
+SOURCE          VCXMediatorEventWatcher.cpp
+
+LIBRARY         euser.lib
+LIBRARY         stiftestinterface.lib
+LIBRARY         stiftestengine.lib
+LIBRARY         mpxcommon.lib
+LIBRARY         mpxcollectionutility.lib
+LIBRARY         estor.lib
+LIBRARY         vcxtestcommon.lib
+LIBRARY         vcxtestmyvideoscollectionclient.lib
+LIBRARY         flogger.lib
+LIBRARY         efsrv.lib
+LIBRARY         bafl.lib
+LIBRARY         edbms.lib // rdbstoredatabase
+LIBRARY         centralrepository.lib
+LIBRARY         mediatorclient.lib
+
+LIBRARY         contextengine.lib
+LIBRARY         contextplugininterface.lib
+LIBRARY         harvesterplugininterface.lib
+LIBRARY         mdeclient.lib
+LIBRARY         mdccommon.lib
+LIBRARY         harvestercommon.lib
+LIBRARY		harvesterdata.lib
+LIBRARY         harvesterclient.lib
+
+LANG            SC
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/mediatorevents/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,29 @@
+/*
+* 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 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: 
+*
+*/
+
+
+PRJ_PLATFORMS
+	DEFAULT
+
+PRJ_TESTEXPORTS
+
+PRJ_EXPORTS
+
+PRJ_TESTMMPFILES
+	MediatorEventVerifier.mmp
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/mediatorevents/inc/MediatorEventVerifier.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,131 @@
+/*
+* 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 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:  STIF testclass declaration*
+*/
+
+
+#ifndef MEDIATOREVENTVERIFIER_H
+#define MEDIATOREVENTVERIFIER_H
+
+//  INCLUDES
+#include <StifLogger.h>
+#include <TestScripterInternal.h>
+#include <StifTestModule.h>
+#include <TestclassAssert.h>
+
+// CONSTANTS
+
+// MACROS
+#define TEST_CLASS_VERSION_MAJOR 0
+#define TEST_CLASS_VERSION_MINOR 0
+#define TEST_CLASS_VERSION_BUILD 0
+
+// Logging path
+_LIT( KMediatorEventVerifierLogPath, "\\logs\\testframework\\MediatorEventVerifier\\" ); 
+// Log file
+_LIT( KMediatorEventVerifierLogFile, "MediatorEventVerifier.txt" ); 
+_LIT( KMediatorEventVerifierLogFileWithTitle, "MediatorEventVerifier_[%S].txt" );
+
+// FORWARD DECLARATIONS
+class CMediatorEventVerifier;
+class CVCXMediatorEventWatcher;
+
+// DATA TYPES
+
+// CLASS DECLARATION
+
+/**
+*  CMediatorEventVerifier test class for STIF Test Framework TestScripter.
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+NONSHARABLE_CLASS(CMediatorEventVerifier) : public CScriptBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CMediatorEventVerifier* NewL( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CMediatorEventVerifier();
+
+    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.
+        */
+        CMediatorEventVerifier( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        /**
+        * Frees all resources allocated from test methods.
+        * @since ?Series60_version
+        */
+        void Delete();
+
+        /**
+        * Test methods are listed below. 
+        */
+
+        /**
+         * Checks for errors in events.  
+         */
+        virtual TInt CheckEvents( CStifItemParser& aItem );
+        
+        /**
+         * Adds expected mediator event. 
+         */
+        virtual TInt AddEvent( CStifItemParser& aItem );
+        
+        /**
+         * Waits until expected events have been got. Blocks.
+         * @param timeout minutes, default is 2.
+         */
+        virtual TInt WaitEvents( CStifItemParser& aItem );
+        
+        /**
+         * Method used to log version of test class
+         */
+        void SendTestClassVersion();
+
+        //[TestMethods] - Do not remove
+
+    private:    // Data
+        
+        CVCXMediatorEventWatcher* iMediatorEventWatcher;
+    };
+
+#endif      // MEDIATOREVENTVERIFIER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/mediatorevents/inc/VCXMediatorEventWatcher.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,170 @@
+/*
+* 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 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 VCXMEDIATOREVENTWATCHER_H
+#define VCXMEDIATOREVENTWATCHER_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <mediatoreventconsumer.h>
+
+#include "VCXTestMyVideosObserver.h"
+#include "VCXTestMessageWait.h"
+
+// CONSTANTS
+
+// MACROS
+
+// FORWARD DECLARATIONS
+class CVCXTestMyVideosCollectionClient;
+
+// DATA TYPES
+
+// CLASS DECLARATION
+
+/**
+*  CVCXMediatorEventWatcher class.
+* 
+* Looks after mediator events from mpx my videos collection plugin. 
+* Monitoring starts right at creation time.
+*
+* KVcxNsMpxEventDownloadStarted 
+* KVcxNsMpxEventDownloadCompleted
+* KVcxNsMpxEventAllDownloadsEnded
+*  - these are checked with counter, messages from collection client increase 
+*    counters and mediator events decrease them.   
+*  
+* KVcxNsMpxEventNewVideosCountDecreased
+*  - checked by refreshing collection and count of new videos.   
+* 
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class CVCXMediatorEventWatcher : public CBase,
+                                 public MVCXTestMyVideosObserver,
+                                 public MVCXTestMessageWaitObserver,
+                                 public MMediatorEventObserver
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CVCXMediatorEventWatcher* NewL();
+
+        /**
+        * Destructor.
+        */
+        ~CVCXMediatorEventWatcher();
+
+    public: // Functions from base classes
+        
+        /**
+         * Received when there's change in mpx my videos plugin contents.
+         */
+        void VideoEventL( TVCXTestVideoEvent aEvent, TUint32 aParam1, TUint32 aParam2, TInt aError );
+
+        /**
+         * Callback for message waiter.
+         */
+        void MessageWaitComplete( TInt aError );
+        
+        /**
+         * From MMediatorEventObserver
+         * 
+         * Catches the events
+         */
+        void MediatorEventL( TUid aDomain, TUid aCategory, TInt aEventId, const TDesC8& aData );       
+        
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CVCXMediatorEventWatcher();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+        
+    public: // New functions.
+
+        /**
+         * Adds event that is expected to be received before check.
+         */
+        void AddExpectedEventL( TInt aEvent );
+        
+        /**
+         * Leaves if there has been any error with the events.
+         */
+        void CheckEventsL();
+        
+        /**
+         * Waits until all expected events have arrived.
+         */
+        void WaitEventsL( TInt aTimeoutSeconds );
+
+    private:
+        
+        /**
+         * Registers and subscribes for mediator event.
+         */
+        void RegisterAndSubscribeEventL( TInt aEvent );
+        
+        /**
+         * Deregisters and unsubscribes for all mediator events.
+         */
+        void UnsubscribeAndDeregisterEvents();
+        
+        /**
+         * Checks if video count has decreased.
+         */
+        TBool HasVideoCountDecreased( TBool aForceUpdate );
+        
+    private:    // Data
+        
+        CMediatorEventConsumer* iMediatorEventConsumer; 
+        
+        TUid iMediatorDomain;
+        TUid iMediatorCategory;
+        TVersion iMediatorVersion;
+        // Arry of subscribed mediator event IDs.
+        RArray<TInt> iSubscribedEvents;
+        
+        CVCXTestMyVideosCollectionClient* iMyVideosCollectionClient;
+        CVCXTestMessageWait* iVideoMessageWait;
+        
+        CVCXTestMessageWait* iMediatorEventWait;
+        
+        TInt iDownloadStartedEventCount;
+        TInt iDownloadCompletedEventCount;
+        TInt iAllDownloadsCompletedEventCount;
+        
+        TInt iLastNewVideoCount;
+        TBool iNewVideoCountHasDecreased;
+        
+        TInt iError;
+        
+        RArray<TInt> iExpectedEvents;
+    };
+
+#endif      // VCXMEDIATOREVENTWATCHER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/mediatorevents/src/MediatorEventVerifier.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,160 @@
+/*
+* 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 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:  This file contains testclass implementation.*
+*/
+
+
+// INCLUDE FILES
+#include <Stiftestinterface.h>
+#include "MediatorEventVerifier.h"
+#include <SettingServerClient.h>
+
+#include "VCXMediatorEventWatcher.h"
+
+// CONSTANTS
+
+// MACROS
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CMediatorEventVerifier::CMediatorEventVerifier
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CMediatorEventVerifier::CMediatorEventVerifier( 
+    CTestModuleIf& aTestModuleIf ):
+        CScriptBase( aTestModuleIf )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CMediatorEventVerifier::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CMediatorEventVerifier::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(KMediatorEventVerifierLogFileWithTitle, &title);
+        }
+    else
+        {
+        logFileName.Copy(KMediatorEventVerifierLogFile);
+        }
+
+    iLog = CStifLogger::NewL( KMediatorEventVerifierLogPath, 
+                          logFileName,
+                          CStifLogger::ETxt,
+                          CStifLogger::EFile,
+                          EFalse );
+    
+    SendTestClassVersion();
+    
+    iMediatorEventWatcher = CVCXMediatorEventWatcher::NewL();
+    }
+
+// -----------------------------------------------------------------------------
+// CMediatorEventVerifier::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CMediatorEventVerifier* CMediatorEventVerifier::NewL( 
+    CTestModuleIf& aTestModuleIf )
+    {
+    CMediatorEventVerifier* self = new (ELeave) CMediatorEventVerifier( aTestModuleIf );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+
+    }
+
+// Destructor
+CMediatorEventVerifier::~CMediatorEventVerifier()
+    { 
+
+    // Delete resources allocated from test methods
+    Delete();
+
+    delete iMediatorEventWatcher;
+    iMediatorEventWatcher = NULL;
+    
+    // Delete logger
+    delete iLog; 
+    }
+
+//-----------------------------------------------------------------------------
+// CMediatorEventVerifier::SendTestClassVersion
+// Method used to send version of test class
+//-----------------------------------------------------------------------------
+//
+void CMediatorEventVerifier::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("MediatorEventVerifier.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 ) // Backpointer to STIF Test Framework
+    {
+
+    return ( CScriptBase* ) CMediatorEventVerifier::NewL( aTestModuleIf );
+
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/mediatorevents/src/MediatorEventVerifierBlocks.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,146 @@
+/*
+* 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 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:  This file contains testclass implementation.*
+*/
+
+
+// [INCLUDE FILES] - do not remove
+#include <e32svr.h>
+#include <StifParser.h>
+#include <Stiftestinterface.h>
+
+#include "MediatorEventVerifier.h"
+#include "VCXMediatorEventWatcher.h"
+#include "VCXTestLog.h"
+
+// CONSTANTS
+
+// MACROS
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CMediatorEventVerifier::Delete
+// Delete here all resources allocated and opened from test methods. 
+// Called from destructor. 
+// -----------------------------------------------------------------------------
+//
+void CMediatorEventVerifier::Delete() 
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// CMediatorEventVerifier::RunMethodL
+// Run specified method. Contains also table of test mothods and their names.
+// -----------------------------------------------------------------------------
+//
+TInt CMediatorEventVerifier::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( "CheckEvents", CMediatorEventVerifier::CheckEvents ),
+        ENTRY( "AddEvent", CMediatorEventVerifier::AddEvent ),
+        ENTRY( "WaitEvents", CMediatorEventVerifier::WaitEvents ),
+        
+        //ADD NEW ENTRY HERE
+        // [test cases entries] - Do not remove
+
+        };
+
+    const TInt count = sizeof( KFunctions ) / 
+                        sizeof( TStifFunctionInfo );
+
+    return RunInternalL( KFunctions, count, aItem );
+
+    }
+
+// -----------------------------------------------------------------------------
+// CMediatorEventVerifier::CheckEvents
+// -----------------------------------------------------------------------------
+//
+TInt CMediatorEventVerifier::CheckEvents( CStifItemParser& /* aItem */ )
+    {
+    VCXLOGLO1(">>>CVCXMediatorEventWatcher::CheckEvents");
+         
+    // Print to UI
+    _LIT( KMediatorEventVerifier, "MediatorEventVerifier" );
+    _LIT( KWhere, "In CheckEvents" );
+    TestModuleIf().Printf( 0, KMediatorEventVerifier, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    TRAPD( err, iMediatorEventWatcher->CheckEventsL() );
+            
+    VCXLOGLO1("<<<CVCXMediatorEventWatcher::CheckEvents");
+    return err;
+    }
+
+// -----------------------------------------------------------------------------
+// CMediatorEventVerifier::AddEvent
+// -----------------------------------------------------------------------------
+//
+TInt CMediatorEventVerifier::AddEvent( CStifItemParser& aItem )
+    {  
+    VCXLOGLO1(">>>CVCXMediatorEventWatcher::AddEvent");
+         
+    // Print to UI
+    _LIT( KMediatorEventVerifier, "MediatorEventVerifier" );
+    _LIT( KWhere, "In AddEvent" );
+    TestModuleIf().Printf( 0, KMediatorEventVerifier, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+    
+    TInt event;
+    User::LeaveIfError( aItem.GetNextInt( event ) );
+    TRAPD( err, iMediatorEventWatcher->AddExpectedEventL( event ) ); 
+    
+    VCXLOGLO1("<<<CVCXMediatorEventWatcher::AddEvent");
+    return err;
+    }
+
+// -----------------------------------------------------------------------------
+// CMediatorEventVerifier::WaitEvents
+// -----------------------------------------------------------------------------
+//
+TInt CMediatorEventVerifier::WaitEvents( CStifItemParser& aItem )
+    {  
+    VCXLOGLO1(">>>CVCXMediatorEventWatcher::WaitEvents");
+         
+    // Print to UI
+    _LIT( KMediatorEventVerifier, "MediatorEventVerifier" );
+    _LIT( KWhere, "In WaitEvents" );
+    TestModuleIf().Printf( 0, KMediatorEventVerifier, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+    
+    TInt seconds;
+    if( aItem.GetNextInt( seconds ) != KErrNone ) 
+        {
+        seconds = 2 * 60;
+        }
+        
+    TRAPD( err, iMediatorEventWatcher->WaitEventsL( seconds ) );
+    
+    VCXLOGLO1("<<<CVCXMediatorEventWatcher::WaitEvents");
+    return err;
+    }
+
+
+//  [End of File] - Do not remove
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/mediatorevents/src/VCXMediatorEventWatcher.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,472 @@
+/*
+* 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 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: 
+*
+*/
+
+
+// INCLUDES
+#include <vcxmyvideosdefs.h>
+
+#include <MediatorEventConsumer.h>
+#include <mediatoreventprovider.h>
+#include <mediatorservicedefs.h>
+
+#include "VCXMediatorEventWatcher.h"
+#include "VCXTestMyVideosCollectionClient.h"
+#include "VCXTestCommon.h"
+#include "VCXTestLog.h"
+#include "CIptvTestActiveWait.h"
+
+// CONSTANTS
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CVCXMediatorEventWatcher::NewL
+// -----------------------------------------------------------------------------
+//
+CVCXMediatorEventWatcher* CVCXMediatorEventWatcher::NewL()
+    {
+    CVCXMediatorEventWatcher* self = new (ELeave) CVCXMediatorEventWatcher();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMediatorEventWatcher::~CVCXMediatorEventWatcher
+// -----------------------------------------------------------------------------
+//
+CVCXMediatorEventWatcher::~CVCXMediatorEventWatcher()
+     {
+     VCXLOGLO1(">>>CVCXMediatorEventWatcher::~CVCXMediatorEventWatcher");
+     
+     delete iMyVideosCollectionClient;
+     iMyVideosCollectionClient = NULL;
+     
+     delete iVideoMessageWait;
+     iVideoMessageWait = NULL;
+     
+     delete iMediatorEventWait;
+     iMediatorEventWait = NULL;
+     
+     UnsubscribeAndDeregisterEvents();
+     
+     delete iMediatorEventConsumer;
+     iMediatorEventConsumer = NULL;
+     
+     iSubscribedEvents.Close();
+     iExpectedEvents.Close();
+     
+     VCXLOGLO1("<<<CVCXMediatorEventWatcher::~CVCXMediatorEventWatcher");
+     }
+
+ // -----------------------------------------------------------------------------
+ // CVCXMediatorEventWatcher::CVCXMediatorEventWatcher
+ // -----------------------------------------------------------------------------
+ //
+CVCXMediatorEventWatcher::CVCXMediatorEventWatcher()
+    {
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMediatorEventWatcher::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CVCXMediatorEventWatcher::ConstructL( )
+    {
+    VCXLOGLO1(">>>CVCXMediatorEventWatcher::ConstructL");
+    
+    iVideoMessageWait = CVCXTestMessageWait::NewL( this );
+    iMediatorEventWait = CVCXTestMessageWait::NewL( this );
+     
+    iMyVideosCollectionClient = CVCXTestMyVideosCollectionClient::NewL( this );
+
+    // Wait for video list to open.
+    iVideoMessageWait->WaitForMessageL( EVCXTestVideoListRefreshed, 30, ETrue );
+    
+    iLastNewVideoCount = iMyVideosCollectionClient->GetCountOfNewVideos( ETrue );
+    
+    // Start listening mediator events.
+    
+    iMediatorEventConsumer = CMediatorEventConsumer::NewL( this );
+    
+    iMediatorDomain   = TUid::Uid( KVcxNsMpxMediatorDomain );
+    iMediatorCategory = TUid::Uid( KVcxNsMpxMediatorCategory );
+    iMediatorVersion = TVersion( KVcxNsMpxEventVersion, 0, 0 );
+    
+    RegisterAndSubscribeEventL( TInt( KVcxNsMpxEventDownloadStarted ) );
+    RegisterAndSubscribeEventL( TInt( KVcxNsMpxEventDownloadCompleted ) );
+    RegisterAndSubscribeEventL( TInt( KVcxNsMpxEventAllDownloadsEnded ) );
+    RegisterAndSubscribeEventL( TInt( KVcxNsMpxEventNewVideosCountDecreased ) );
+    
+    VCXLOGLO1("<<<CVCXMediatorEventWatcher::ConstructL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMediatorEventWatcher::AddExpectedEventL
+// -----------------------------------------------------------------------------
+//
+void CVCXMediatorEventWatcher::AddExpectedEventL( TInt aEvent )
+    {
+    VCXLOGLO1(">>>CVCXMediatorEventWatcher::AddExpectedEventL");
+    iExpectedEvents.Append( aEvent );
+    VCXLOGLO1("<<<CVCXMediatorEventWatcher::AddExpectedEventL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMediatorEventWatcher::CheckEventsL
+// -----------------------------------------------------------------------------
+//
+void CVCXMediatorEventWatcher::CheckEventsL()
+    {
+    VCXLOGLO1(">>>CVCXMediatorEventWatcher::CheckEventsL");
+    
+    TInt err( iError );
+    
+    if( iError == KErrCorrupt )
+        {
+        VCXLOGLO1("CVCXMediatorEventWatcher::CheckEventsL: Error. Check for KVcxNsMpxEventNewVideosCountDecreased has failed before.");
+        }
+    
+    if( iDownloadStartedEventCount > 0 )
+        {
+        VCXLOGLO2("CVCXMediatorEventWatcher::CheckEventsL: Error. 'Download started' events do not match from mpx plugin and mediator: %d", iDownloadStartedEventCount);
+        err = KErrCorrupt;
+        }
+    
+    if( iDownloadCompletedEventCount > 0 )
+        {
+        VCXLOGLO2("CVCXMediatorEventWatcher::CheckEventsL: Error. 'Download completed' events do not match from mpx plugin and mediator: %d", iDownloadCompletedEventCount);
+        err = KErrCorrupt;
+        }
+    
+    if( iAllDownloadsCompletedEventCount > 0 )
+        {
+        VCXLOGLO2("CVCXMediatorEventWatcher::CheckEventsL: Error. 'All downloads completed' events do not match from mpx plugin and mediator: %d", iDownloadCompletedEventCount);
+        err = KErrCorrupt;
+        }
+    
+    if( iExpectedEvents.Count() > 0 )
+        {
+        VCXLOGLO1("CVCXMediatorEventWatcher::CheckEventsL: Error. Did not get all expected events.");
+        for( TInt i = 0; i < iExpectedEvents.Count(); i++ )
+            {
+            VCXLOGLO2("CVCXMediatorEventWatcher::CheckEventsL: Event not received: %d", iExpectedEvents[i]);
+            }
+        err = KErrCorrupt;
+        }
+    
+    iError = KErrNone;
+    
+    User::LeaveIfError( err );
+
+    VCXLOGLO1("<<<CVCXMediatorEventWatcher::CheckEventsL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMediatorEventWatcher::WaitEventsL
+// -----------------------------------------------------------------------------
+//
+void CVCXMediatorEventWatcher::WaitEventsL( TInt aTimeoutSeconds )
+    {
+    VCXLOGLO1(">>>CVCXMediatorEventWatcher::WaitEventsL");
+    
+    iError = KErrNone;
+        
+    if( iExpectedEvents.Count() > 0 )
+        {
+        for( TInt i = iExpectedEvents.Count(); --i >= 0; )
+            {
+            iMediatorEventWait->AddMessage( iExpectedEvents[i] );
+            }
+        
+        iMediatorEventWait->WaitForAllL( aTimeoutSeconds, ETrue );    
+        }
+    
+    User::LeaveIfError( iError );
+    
+    VCXLOGLO1("<<<CVCXMediatorEventWatcher::WaitEventsL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMediatorEventWatcher::RegisterAndSubscribeEventL
+// -----------------------------------------------------------------------------
+//
+void CVCXMediatorEventWatcher::RegisterAndSubscribeEventL( TInt aEvent )
+    {
+    VCXLOGLO1(">>>CVCXMediatorEventWatcher::RegisterAndSubscribeEventL");
+    
+    TCapabilitySet caps = TCapabilitySet( ECapabilityReadUserData ); 
+    CMediatorEventProvider* provider = CMediatorEventProvider::NewL();
+    
+    TInt ret = provider->RegisterEvent( iMediatorDomain, iMediatorCategory, aEvent, 
+                                        iMediatorVersion, caps );
+    delete provider;
+         
+    if( ret != KErrNone && ret != KErrMediatorEventAlreadyExists )
+        {        
+        User::Leave( ret );
+        }
+     
+    User::LeaveIfError( iMediatorEventConsumer->SubscribeEvent( iMediatorDomain, 
+                                                        iMediatorCategory,
+                                                        aEvent, 
+                                                        iMediatorVersion ) );
+
+    iSubscribedEvents.AppendL( aEvent );        
+    
+    VCXLOGLO1("<<<CVCXMediatorEventWatcher::RegisterAndSubscribeEventL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMediatorEventWatcher::UnsubscribeAndDeregisterEvents
+// -----------------------------------------------------------------------------
+//
+void CVCXMediatorEventWatcher::UnsubscribeAndDeregisterEvents( )
+    {
+    VCXLOGLO1(">>>CVCXMediatorEventWatcher::UnsubscribeAndDeregisterEvents");
+    
+    CMediatorEventProvider* provider = NULL;
+        
+    TRAPD( err, provider = CMediatorEventProvider::NewL() );
+    if( err != KErrNone )
+        {
+        return;
+        }
+    
+    TInt count = iSubscribedEvents.Count(); 
+    for( TInt i = 0; i < count; ++i )
+        {
+        iMediatorEventConsumer->UnsubscribeEvent( iMediatorDomain, 
+                                          iMediatorCategory,
+                                          iSubscribedEvents[ i ] );
+        
+        provider->UnregisterEvent( iMediatorDomain,
+                                   iMediatorCategory,
+                                   iSubscribedEvents[ i ] );        
+        }
+    delete provider;      
+    
+    VCXLOGLO1("<<<CVCXMediatorEventWatcher::UnsubscribeAndDeregisterEvents");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMediatorEventWatcher::HasVideoCountDecreased
+// -----------------------------------------------------------------------------
+//
+TBool CVCXMediatorEventWatcher::HasVideoCountDecreased( TBool aForceUpdate )
+    {
+    VCXLOGLO1(">>>CVCXMediatorEventWatcher::HasVideoCountDecreased");
+    
+    // Don't check again if count has decreased earlier. 
+    if( !iNewVideoCountHasDecreased )
+        {
+        if( aForceUpdate )
+            {
+            iMyVideosCollectionClient->RefreshCollectionL();
+            iVideoMessageWait->WaitForMessageL( EVCXTestVideoListRefreshed, 30, ETrue );
+            }
+    
+        // Check again here because if there was previous force update then this has been called
+        // at refresh event.
+        if( !iNewVideoCountHasDecreased )
+            {
+            TInt newVideoCount = iMyVideosCollectionClient->GetCountOfNewVideos( ETrue );
+            
+            VCXLOGLO3("CVCXMediatorEventWatcher::HasVideoCountDecreased: new videos count, last: %d, now: %d", iLastNewVideoCount, newVideoCount);
+           
+            iNewVideoCountHasDecreased = newVideoCount < iLastNewVideoCount;
+            iLastNewVideoCount = newVideoCount;
+            
+            VCXLOGLO1("<<<CVCXMediatorEventWatcher::HasVideoCountDecreased");
+            }
+        }
+    
+    return iNewVideoCountHasDecreased;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMediatorEventWatcher::MediatorEventL
+// -----------------------------------------------------------------------------
+//
+void CVCXMediatorEventWatcher::MediatorEventL( TUid aDomain, TUid aCategory, TInt aEventId, const TDesC8& /* aData */ )
+    {
+    if( aDomain != TUid::Uid( KVcxNsMpxMediatorDomain ) || 
+        aCategory != TUid::Uid( KVcxNsMpxMediatorCategory ) )
+        {
+        return;
+        }
+   
+    iMediatorEventWait->ReceiveMessage( aEventId, KErrNone );
+    
+    switch( aEventId ) 
+        {
+        case KVcxNsMpxEventDownloadStarted:
+            {
+            VCXLOGLO1("CVCXMediatorEventWatcher::MediatorEventL: KVcxNsMpxEventDownloadStarted");
+            iDownloadStartedEventCount--;
+            }
+            break;
+            
+        case KVcxNsMpxEventDownloadCompleted:
+            {
+            VCXLOGLO1("CVCXMediatorEventWatcher::MediatorEventL: KVcxNsMpxEventDownloadCompleted");
+            iDownloadCompletedEventCount--;
+            }
+            break;
+            
+        case KVcxNsMpxEventAllDownloadsEnded:
+            {
+            VCXLOGLO1("CVCXMediatorEventWatcher::MediatorEventL: KVcxNsMpxEventAllDownloadsEnded");
+            iAllDownloadsCompletedEventCount--;
+            }
+            break;            
+
+        case KVcxNsMpxEventNewVideosCountDecreased:
+            {
+            VCXLOGLO1("CVCXMediatorEventWatcher::MediatorEventL: KVcxNsMpxEventNewVideosCountDecreased");
+            
+            HasVideoCountDecreased( ETrue );
+
+            if( !iNewVideoCountHasDecreased && iLastNewVideoCount  > 0 )
+                {
+                VCXLOGLO1("CVCXMediatorEventWatcher::MediatorEventL: Error. Count of new videos has not decreased.");
+                iError = KErrCorrupt;
+                }
+            
+            iNewVideoCountHasDecreased = EFalse;
+            }
+            break;
+            
+        default:
+            break;
+        }
+    
+    for( TInt i = iExpectedEvents.Count(); --i >= 0; )
+        {
+        if( iExpectedEvents[i] == aEventId )
+            {
+            iExpectedEvents.Remove( i );
+            }
+        }
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMediatorEventWatcher::VideoEventL
+// -----------------------------------------------------------------------------
+//
+void CVCXMediatorEventWatcher::VideoEventL( TVCXTestVideoEvent aEvent, TUint32 aParam1, TUint32 aParam2, TInt aError )
+    {
+    VCXLOGLO1(">>>CVCXMediatorEventWatcher::VideoEventL");
+        
+    iVideoMessageWait->ReceiveMessage( aEvent, aError );
+    
+    switch( aEvent )
+        {
+        case EVCXTestVideoGeneral:
+            {
+            VCXLOGLO1("CVCXMediatorEventWatcher::VideoEventL: EVCXTestVideoGeneral =----->");            
+            }
+            break;
+            
+        case EVCXTestVideoListRefreshed:
+            {
+            VCXLOGLO1("CVCXMediatorEventWatcher::VideoEventL: EVCXTestVideoListRefreshed =----->");
+            HasVideoCountDecreased( EFalse );
+            }
+            break;
+
+        case EVCXTestVideoVideoAdded:
+            {
+            VCXLOGLO2("CVCXMediatorEventWatcher::VideoEventL: EVCXTestVideoVideoAdded. Id: %d =----->", aParam1);
+            }
+            break;
+
+        case EVCXTestVideoVideoDeleted:
+            {
+            VCXLOGLO2("CVCXMediatorEventWatcher::VideoEventL: EVCXTestVideoVideoDeleted. Id: %d =----->", aParam1);
+            HasVideoCountDecreased( EFalse );
+            }
+            break;
+
+        case EVCXTestVideoDownloadStarted:
+            {
+            VCXLOGLO2("CVCXMediatorEventWatcher::VideoEventL: EVCXTestVideoDownloadStarted. Id: %d =----->", aParam1);
+            iDownloadStartedEventCount++;
+            }
+            break;
+            
+        case EVCXTestVideoDownloadPaused:
+            {
+            VCXLOGLO2("CVCXMediatorEventWatcher::VideoEventL: EVCXTestVideoDownloadPaused. Id: %d =----->", aParam1);
+            }
+            break;
+
+        case EVCXTestVideoDownloadFailed:
+            {
+            VCXLOGLO2("CVCXMediatorEventWatcher::VideoEventL: EVCXTestVideoDownloadFailed. Id: %d =----->", aParam1);
+            }
+            break;
+        
+        case EVCXTestVideoDownloadCompleted:
+            {
+            VCXLOGLO2("CVCXMediatorEventWatcher::VideoEventL: EVCXTestVideoDownloadCompleted. Id: %d =----->", aParam1);
+            iDownloadCompletedEventCount++;
+            }
+            break;
+            
+        case EVCXTestVideoDownloadProgressed:
+            {
+            VCXLOGLO3("CVCXMediatorEventWatcher::VideoEventL: EVCXTestVideoDownloadProgressed. Id: %d, progress: %d =----->", aParam1, aParam2);
+            }
+            break;
+            
+        case EVCXTestVideoAllDownloadsCompleted:
+             {
+             VCXLOGLO1("CVCXMediatorEventWatcher::VideoEventL: EVCXTestVideoAllDownloadsCompleted.");
+             iAllDownloadsCompletedEventCount++;
+             }
+             break;            
+
+        default:
+            break;
+        }
+    
+    if( aError != KErrNone )
+        {
+        VCXLOGLO2("CVCXMediatorEventWatcher::VideoEventL: aError: %d =----->", aError);
+        }    
+    
+    VCXLOGLO1("<<<CVCXMediatorEventWatcher::VideoEventL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMediatorEventWatcher::MessageWaitComplete
+// -----------------------------------------------------------------------------
+//
+void CVCXMediatorEventWatcher::MessageWaitComplete( TInt aError )
+    {
+    if( aError )
+        {
+        VCXLOGLO1("CVCXMediatorEventWatcher:: Message wait TIMEOUT!");
+        iError = KErrTimedOut;
+        }
+    }
+
+// EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/src/VCXMyVideosCollectionPluginTest.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,141 @@
+/*
+* Copyright (c) 2002 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:   ?Description*
+*/
+
+
+// INCLUDE FILES
+#include <Stiftestinterface.h>
+#include "VCXMyVideosCollectionPluginTest.h"
+#include "VCXMyVideosCollectionPluginTester.h"
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosCollectionPluginTest::CVCXMyVideosCollectionPluginTest
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CVCXMyVideosCollectionPluginTest::CVCXMyVideosCollectionPluginTest( 
+    CTestModuleIf& aTestModuleIf ):
+        CScriptBase( aTestModuleIf )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosCollectionPluginTest::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTest::ConstructL()
+    {
+    iLog = CStifLogger::NewL( KVCXMyVideosCollectionPluginTestLogPath, 
+                          KVCXMyVideosCollectionPluginTestLogFile,
+                          CStifLogger::ETxt,
+                          CStifLogger::EFile,
+                          EFalse );
+
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosCollectionPluginTest::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CVCXMyVideosCollectionPluginTest* CVCXMyVideosCollectionPluginTest::NewL( 
+    CTestModuleIf& aTestModuleIf )
+    {
+    CVCXMyVideosCollectionPluginTest* self = new (ELeave) CVCXMyVideosCollectionPluginTest( aTestModuleIf );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// Destructor
+CVCXMyVideosCollectionPluginTest::~CVCXMyVideosCollectionPluginTest()
+    { 
+    // Delete resources allocated from test methods
+    Delete();
+
+    // Delete logger
+    delete iLog; 
+    }
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// LibEntryL is a polymorphic Dll entry point.
+// Returns: CScriptBase: New CScriptBase derived object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CScriptBase* LibEntryL( 
+    CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
+    {
+    return ( CScriptBase* ) CVCXMyVideosCollectionPluginTest::NewL( aTestModuleIf );
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/src/VCXMyVideosCollectionPluginTestBlocks.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,4913 @@
+/*
+* Copyright (c) 2002 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:   ?Description*
+*/
+
+
+// INCLUDE FILES
+#include <mmf/common/mmfcontrollerpluginresolver.h> // CleanupResetAndDestroyPushL
+#include <e32svr.h>
+#include <StifParser.h>
+#include <Stiftestinterface.h>
+#include <centralrepository.h>
+#include <collate.h>
+
+#include "VCXTestLog.h"
+#include "VCXTestCommon.h"
+#include "CIptvTestActiveWait.h"
+#include "CIptvTestTimer.h"
+#include "VCXTestStatsKeeper.h"
+
+#include "VCXMyVideosCollectionPluginTest.h"
+#include "VCXMyVideosCollectionPluginTester.h"
+#include "VCXMyVideosTestCommon.h"
+#include "VCXMyVideosTestDlWatcher.h"
+#include "VCXMyVideosTestServiceEmu.h"
+#include "VCXTestMdsDbModifier.h"
+
+#include <mpxmedia.h>
+#include <mpxmediageneraldefs.h>
+#include <mpxmediageneralextdefs.h>
+
+#include "vcxmyvideosuids.h"
+
+// CONSTANTS
+
+const TInt KVcxTestFileSize3GB = -999;
+
+// MACROS
+#define VCXMVTEST_ERR(err) ( iStatsEnabled ) ? KErrNone : err 
+
+// MODULE DATA STRUCTURES
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosCollectionPluginTest::Delete
+// Delete here all resources allocated and opened from test methods.
+// Called from destructor.
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTest::Delete()
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::Delete ---------->");
+    
+    delete iTester;
+    iTester = NULL;
+
+    if( iDeleteSideloadedFilesAndFolders )
+        {
+        iDeleteSideloadedFilesAndFolders = EFalse;
+        CStifItemParser* parser = NULL;
+        TRAP_IGNORE( EmptySideloadFoldersL( *parser ) ); // oeh noes
+        }
+
+    iSideloadedFiles.ResetAndDestroy();
+
+    // Remove folders used in sideloading, if they'r empty
+    for( TInt i=0; i < iSideloadFolders.Count(); i++ )
+        {
+        HBufC* path = iSideloadFolders[i];
+        TInt pos = 0;
+        TInt firstPos = 0;
+        while( ETrue )
+            {
+            pos = path->Des().LocateReverse('\\');
+            firstPos = path->Des().Locate('\\');
+            // Check that it's not the root folder.
+            if( pos != KErrNotFound && pos != firstPos )
+                {
+                // Remove last folder from the path string, or the filename.
+                path->Des().SetLength( pos+1 );
+                if( DeleteDirectoryIfEmpty( iFs, *iFileMan, *path ) != KErrNone)
+                    {
+                    break;
+                    }
+                // Remove trailing backslash.
+                path->Des().SetLength( pos );
+                }
+            else
+                {
+                break;
+                }
+            }
+        }
+
+    iSideloadFolders.ResetAndDestroy();
+
+    delete iTestCommon;
+    iTestCommon = NULL;
+
+#ifdef __WINSCW__
+    iClient.Close();
+#endif // __WINSCW__
+
+    if( iActiveWait )
+        {
+        iActiveWait->Stop();
+        delete iActiveWait;
+        iActiveWait = NULL;
+        }
+
+    if( iActiveWaitBlocking )
+        {
+        iActiveWaitBlocking->Stop();
+        delete iActiveWaitBlocking;
+        iActiveWaitBlocking = NULL;
+        }
+    
+    if( iTimeoutTimer )
+        {
+        iTimeoutTimer->CancelTimer();
+        delete iTimeoutTimer;
+        iTimeoutTimer = NULL;
+        }
+    
+    if( iCoolDownTimer )
+        {
+        iCoolDownTimer->CancelTimer();
+        delete iCoolDownTimer;
+        iCoolDownTimer = NULL;
+        }
+
+    delete iMpxMedia;
+    iMpxMedia = NULL;
+    
+    delete iServiceEmu;
+    iServiceEmu = NULL;
+    
+    delete iMdsDbModifier;
+    iMdsDbModifier = NULL;
+
+    delete iFileMan;
+    iFileMan = NULL;
+
+    iFs.Close();
+    
+    delete iStats;
+    iStats = NULL;    
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::Delete <----------");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosCollectionPluginTest::RunMethodL
+// Run specified method. Contains also table of test mothods and their names.
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::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( "Create", CVCXMyVideosCollectionPluginTest::CreateL ),
+        
+        ENTRY( "EnableStats", CVCXMyVideosCollectionPluginTest::EnableStatsL ),
+        ENTRY( "SetPreferredMemory", CVCXMyVideosCollectionPluginTest::SetPreferredMemoryL ),
+        ENTRY( "SetSortingOrder", CVCXMyVideosCollectionPluginTest::SetSortingOrderL ),
+        ENTRY( "SetAutomaticRefresh", CVCXMyVideosCollectionPluginTest::SetAutomaticRefresh ),
+        ENTRY( "SetQuietMode", CVCXMyVideosCollectionPluginTest::SetQuietMode ),
+        ENTRY( "CoolDown", CVCXMyVideosCollectionPluginTest::CoolDownL ),
+        ENTRY( "DisableDownloadCheck", CVCXMyVideosCollectionPluginTest::DisableDownloadCheckL ),
+        ENTRY( "SetFileCheck", CVCXMyVideosCollectionPluginTest::SetFileCheckL ),
+        ENTRY( "SetAutoResume", CVCXMyVideosCollectionPluginTest::SetAutoResumeL ),
+
+        ENTRY( "OpenCollection", CVCXMyVideosCollectionPluginTest::OpenCollectionL ),
+        ENTRY( "OpenLevel", CVCXMyVideosCollectionPluginTest::OpenLevelL ),
+        ENTRY( "RefreshContents", CVCXMyVideosCollectionPluginTest::RefreshContentsL ),
+        ENTRY( "GetMediasByMpxId", CVCXMyVideosCollectionPluginTest::GetMediasByMpxIdL ),
+        ENTRY( "CloseLevel", CVCXMyVideosCollectionPluginTest::CloseLevelL ),
+        
+        ENTRY( "GetMediaFullDetails", CVCXMyVideosCollectionPluginTest::GetMediaFullDetailsL ),
+        ENTRY( "GetMediaFullDetailsByMpxId", CVCXMyVideosCollectionPluginTest::GetMediaFullDetailsByMpxIdL ),
+        ENTRY( "GetAllMediaFullDetails", CVCXMyVideosCollectionPluginTest::GetAllMediaFullDetailsL ),
+        ENTRY( "SetMediaDetail", CVCXMyVideosCollectionPluginTest::SetMediaDetailL ),
+        ENTRY( "CheckMediaDetail", CVCXMyVideosCollectionPluginTest::CheckMediaDetailL ),
+        ENTRY( "CheckMediaCount", CVCXMyVideosCollectionPluginTest::CheckMediaCountL ),
+        ENTRY( "CheckMinimumMediaCount", CVCXMyVideosCollectionPluginTest::CheckMinimumMediaCountL ),
+        ENTRY( "CheckMaximumMediaCount", CVCXMyVideosCollectionPluginTest::CheckMaximumMediaCountL ),
+        ENTRY( "CheckDownloadCount", CVCXMyVideosCollectionPluginTest::CheckDownloadCountL ),
+        
+        ENTRY( "CreateCopyOfMedia", CVCXMyVideosCollectionPluginTest::CreateCopyOfMediaL ),
+        ENTRY( "CreateEmptyMedia", CVCXMyVideosCollectionPluginTest::CreateEmptyMediaL ),
+        ENTRY( "AddMedia", CVCXMyVideosCollectionPluginTest::AddMediaL ),
+        ENTRY( "SetMedia", CVCXMyVideosCollectionPluginTest::SetMediaL ),
+        ENTRY( "OutsideMediaUpdate", CVCXMyVideosCollectionPluginTest::OutsideMediaUpdateL ),
+        ENTRY( "CancelNextOperation", CVCXMyVideosCollectionPluginTest::CancelNextOperationL ),
+        
+        ENTRY( "DeleteFileOfMedia", CVCXMyVideosCollectionPluginTest::DeleteFileOfMediaL ),
+        ENTRY( "DeleteFilesOfAllMedias", CVCXMyVideosCollectionPluginTest::DeleteFilesOfAllMediasL ),
+        ENTRY( "RemoveMedia", CVCXMyVideosCollectionPluginTest::RemoveMediaL ),
+        ENTRY( "RemoveAllMedia", CVCXMyVideosCollectionPluginTest::RemoveAllMediaL ),
+        ENTRY( "MoveMedia", CVCXMyVideosCollectionPluginTest::MoveMediaL ),
+        ENTRY( "MoveMedias", CVCXMyVideosCollectionPluginTest::MoveMediasL ),
+        ENTRY( "CancelMove", CVCXMyVideosCollectionPluginTest::CancelMoveL ),
+        ENTRY( "CopyMedia", CVCXMyVideosCollectionPluginTest::CopyMediaL ),
+        ENTRY( "CopyMedias", CVCXMyVideosCollectionPluginTest::CopyMediasL ),
+        ENTRY( "CancelCopy", CVCXMyVideosCollectionPluginTest::CancelCopyL ),
+        ENTRY( "DeleteMedia", CVCXMyVideosCollectionPluginTest::DeleteMediaL ),
+        ENTRY( "DeleteMedias", CVCXMyVideosCollectionPluginTest::DeleteMediasL ),
+        ENTRY( "CancelDelete", CVCXMyVideosCollectionPluginTest::CancelDeleteL ),
+        
+        ENTRY( "CreateVideoFile", CVCXMyVideosCollectionPluginTest::CreateVideoFileL ),
+        ENTRY( "CreateVideoFileNoWait", CVCXMyVideosCollectionPluginTest::CreateVideoFileNoWaitL ),
+        ENTRY( "EnsureDriveForVideos", CVCXMyVideosCollectionPluginTest::EnsureDriveForVideosL ),
+        ENTRY( "EmptySideloadFolders", CVCXMyVideosCollectionPluginTest::EmptySideloadFoldersL ),
+        ENTRY( "SetDeleteSideloadedVideos", CVCXMyVideosCollectionPluginTest::SetDeleteSideloadedVideos ),
+        
+        ENTRY( "Download", CVCXMyVideosCollectionPluginTest::DownloadL ),
+        ENTRY( "ResumeDownload", CVCXMyVideosCollectionPluginTest::ResumeDownloadL ),
+        ENTRY( "ResumeAllDownloads", CVCXMyVideosCollectionPluginTest::ResumeAllDownloadsL ),
+        ENTRY( "DownloadUsingMedia", CVCXMyVideosCollectionPluginTest::DownloadUsingMediaL ),
+        ENTRY( "ResumeDownloadUsingMedia", CVCXMyVideosCollectionPluginTest::ResumeDownloadUsingMediaL ),
+        ENTRY( "DownloadUrl", CVCXMyVideosCollectionPluginTest::DownloadUrlL ),
+        ENTRY( "CancelDownload", CVCXMyVideosCollectionPluginTest::CancelDownloadL ),
+        ENTRY( "CancelDownloadById", CVCXMyVideosCollectionPluginTest::CancelDownloadByIdL ),
+        ENTRY( "PauseDownload", CVCXMyVideosCollectionPluginTest::PauseDownloadL ),
+        ENTRY( "PauseDownloadByUrl", CVCXMyVideosCollectionPluginTest::PauseDownloadByUrlL ),
+        ENTRY( "CheckDownloadProgress", CVCXMyVideosCollectionPluginTest::CheckDownloadProgressL ),
+        
+        ENTRY( "WaitAllDownloads", CVCXMyVideosCollectionPluginTest::WaitAllDownloadsL ),
+        ENTRY( "WaitForMessage", CVCXMyVideosCollectionPluginTest::WaitForMessageL ),
+        ENTRY( "WaitForAnyMessage", CVCXMyVideosCollectionPluginTest::WaitForAnyMessageL ),
+        ENTRY( "WaitForMessages", CVCXMyVideosCollectionPluginTest::WaitForMessagesL ),
+
+        };
+
+    const TInt count = sizeof( KFunctions ) /
+                        sizeof( TStifFunctionInfo );
+
+    return RunInternalL( KFunctions, count, aItem );
+
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosCollectionPluginTest::EnableStatsL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::EnableStatsL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::EnableStatsL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In EnableStatsL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+
+    TPtrC statsName;
+    TPtrC fileName;
+    User::LeaveIfError( aItem.GetNextString( statsName) );
+    User::LeaveIfError( aItem.GetNextString( fileName) );
+
+    TRAP_IGNORE( iStats->StartStatsKeepingL( statsName, fileName ) );
+    iStatsEnabled = ETrue;
+    
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::EnableStatsL <----------");
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosCollectionPluginTest::CreateL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::CreateL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CreateL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In CreateL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    User::LeaveIfError( iFs.Connect() );
+    iFileMan = CFileMan::NewL( iFs );
+
+    aItem.SetParsingType(CStifItemParser::EQuoteStyleParsing);
+
+    iTestCommon = CVCXTestCommon::NewL();
+    iStats = CVCXTestStatsKeeper::NewL();
+    iTester = CVCXMyVideosCollectionPluginTester::NewL( this, iTestCommon, iStats );
+    iActiveWait = CIptvTestActiveWait::NewL();
+    iActiveWaitBlocking = CIptvTestActiveWait::NewL();
+    iTimeoutTimer = CIptvTestTimer::NewL(*this, 0);
+    iCoolDownTimer = CIptvTestTimer::NewL(*this, 1);   
+    
+#ifdef __WINSCW__
+    TInt err = iClient.Connect();
+    if( KErrNone != err )
+        {
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: Could not start MDS server session! Err: %d", err);
+        }
+#endif // __WINSCW__
+
+    iAutoResume = ETrue;
+
+    iTester->SetAutoResume( iAutoResume );
+
+    iServiceEmu = CVCXMyVideosTestServiceEmu::NewL();
+
+    iMdsDbModifier = CVCXTestMdsDbModifier::NewL();
+
+    iCurrentSortOrder = EVcxMyVideosSortingNone;
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CreateL <----------");
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosCollectionPluginTest::SetPreferredMemoryL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::SetPreferredMemoryL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::SetPreferredMemoryL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In SetPreferredMemoryL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+
+    TInt drive(0);
+    User::LeaveIfError( GetDriveParam( aItem, drive ) );
+
+    // These were defined in CVcxMyVideosDownloadUtil::PreferredMemoryDesL()
+    const TInt KVcxCenRepUid = 0x102750E2; // same as KIptvCenRepUid in CIptvUtil.h
+    const TInt KVcxCenRepPreferredMemoryKey = 0x01; // same as KIptvCenRepPreferredMemoryKey in CIptvUtil.h
+
+    TUid uid;
+    uid.iUid = KVcxCenRepUid;
+
+    CRepository* cenRep = CRepository::NewLC( uid );
+    User::LeaveIfError( cenRep->Set( KVcxCenRepPreferredMemoryKey, drive ) );
+    CleanupStack::PopAndDestroy( cenRep );
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::SetPreferredMemoryL <----------");
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosCollectionPluginTest::SetSortingOrderL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::SetSortingOrderL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::SetSortingOrderL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In SetSortingOrderL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    TInt value(0);
+    TInt err = aItem.GetNextInt( value );
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: New sorting order: %d", value);
+
+    TUid uid;
+    uid.iUid = KVcxMyVideosCollectionCenrepUid;
+
+    CRepository* cenRep = CRepository::NewLC( uid );
+    User::LeaveIfError( cenRep->Set( KVcxMyVideosCollectionCenrepKeySortingOrder, value ) );
+    CleanupStack::PopAndDestroy( cenRep );
+
+    TRAP( err, DoTotalRefreshL() );
+
+    iCurrentSortOrder = value;
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::SetSortingOrderL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosCollectionPluginTest::SetAutomaticRefresh
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::SetAutomaticRefresh( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::SetAutomaticRefresh ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In SetAutomaticRefresh" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    TInt value(0);
+    TInt err = aItem.GetNextInt( value );
+
+    if( iTester )
+        {
+        iTester->SetAutomaticRefresh( static_cast<TBool>(value) );
+        }
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::SetAutomaticRefresh <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosCollectionPluginTest::SetQuietMode
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::SetQuietMode( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::SetQuietMode ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In SetQuietMode" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    TInt value(0);
+    TInt err = aItem.GetNextInt( value );
+
+    if( iTester )
+        {
+        iTester->SetQuietMode( static_cast<TBool>(value) );
+        }
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::SetQuietMode <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::CoolDownL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::CoolDownL( CStifItemParser& /* aItem */ )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CoolDownL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In CoolDownL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    iCoolDownWait = ETrue;
+    iCoolDownTimer->After( KTimeoutSecond * 5 );
+    iActiveWait->Start();
+    
+    if( iEventError == KErrAbort )
+        {
+        iEventError = KErrNone;
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Error, ABORTING!");
+        User::Leave( KErrAbort );
+        }
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CoolDownL <----------");
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::DisableDownloadCheckL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::DisableDownloadCheckL( CStifItemParser& /* aItem */ )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::DisableDownloadCheckL");
+    if( iTester )
+        {
+        iTester->GetDownloadWatcher()->DisableDownloadCheck();
+        }
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::DisableDownloadCheckL");
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::SetFileCheckL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::SetFileCheckL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::SetFileCheckL");
+
+    TInt value(0);
+    User::LeaveIfError( aItem.GetNextInt( value ) );
+    iFileCheckDisabled = !(static_cast<TBool>(value));
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::SetFileCheckL");
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::SetAutoResumeL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::SetAutoResumeL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::SetAutoResumeL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In SetAutoResumeL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    TInt autoResume(0);
+    User::LeaveIfError( aItem.GetNextInt( autoResume ) );
+    iAutoResume = autoResume;
+    if( iTester )
+        {
+        iTester->SetAutoResume( iAutoResume );
+        }
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::SetAutoResumeL <----------");
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosCollectionPluginTest::OpenCollectionL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::OpenCollectionL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::OpenCollectionL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In OpenCollectionL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+    TUint32 collectionId( 0 );
+    TPtrC collectionIdStr;
+    if( aItem.GetNextString( collectionIdStr ) == KErrNone )
+        {
+        TLex lex( collectionIdStr );
+        User::LeaveIfError( lex.Val( collectionId, EHex ) );
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: collectionId: 0x%x", collectionId);
+        }
+
+    if( collectionId == 0 )
+        {
+        collectionId = KVcxUidMyVideosMpxCollection;
+        }
+
+    iLastReceivedMessage = -1;
+
+    TInt err( KErrNotReady );
+    if( iTester )
+        {
+        TRAP( err, iTester->OpenCollectionL( collectionId ) );
+        }
+
+    if( err != KErrNone )
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err);
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::OpenCollectionL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosCollectionPluginTest::OpenLevelL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::OpenLevelL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::OpenLevelL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In OpenLevelL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+    TInt index;
+    User::LeaveIfError( aItem.GetNextInt( index ) );
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: index: %d", index);
+
+    iLastReceivedMessage = -1;
+
+    TInt err( KErrNotReady );
+    if( iTester )
+        {
+        TRAP( err, iTester->OpenLevelL( index ) );
+        }
+
+    if( err != KErrNone )
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err);
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::OpenLevelL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosCollectionPluginTest::CloseLevelL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::CloseLevelL( CStifItemParser& /* aItem */ )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CloseLevelL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In CloseLevelL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    iLastReceivedMessage = -1;
+
+    TInt err( KErrNotReady );
+    if( iTester )
+        {
+        TRAP( err, iTester->CloseLevelL() );
+        }
+
+    if( err != KErrNone )
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err);
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CloseLevelL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosCollectionPluginTest::RefreshContentsL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::RefreshContentsL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::RefreshContentsL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In RefreshContentsL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    iLastReceivedMessage = -1;
+
+    aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+
+    TInt err( KErrNotReady );
+    if( iTester )
+        {
+        TRAP( err, iTester->RefreshContentsL() );
+        }
+
+    if( err != KErrNone )
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err);
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::RefreshContentsL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosCollectionPluginTest::RefreshContentsL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::GetMediasByMpxIdL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::GetMediasByMpxIdL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In GetMediasByMpxIdL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    iLastReceivedMessage = -1;
+
+    aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+
+    TInt startIndex;
+    User::LeaveIfError( aItem.GetNextInt( startIndex ) );
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: startIndex: %d", startIndex);
+
+    TInt endIndex;
+    User::LeaveIfError( aItem.GetNextInt( endIndex ) );
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: endIndex: %d", endIndex);
+    
+    TBool syncCall( EFalse );
+    TInt syncCallInt(0);
+    if( aItem.GetNextInt( syncCallInt ) == KErrNone )
+        {
+        syncCall = static_cast<TBool>(syncCallInt);
+        }
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: callTypeInt: %d", syncCall );
+
+    TInt err( KErrNotReady );
+    if( iTester )
+        {
+        TRAP( err, iTester->GetMediasByMpxIdL( startIndex, endIndex, syncCall ) );
+        }
+
+    if( err != KErrNone )
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err);
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::GetMediasByMpxIdL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosCollectionPluginTest::GetMediaFullDetailsL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::GetMediaFullDetailsL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::GetMediaFullDetailsL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In GetMediaFullDetailsL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    iLastReceivedMessage = -1;
+
+    aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+
+    TInt drive(0);
+    User::LeaveIfError( GetDriveParam( aItem, drive ) );
+
+    TInt index;
+    User::LeaveIfError( aItem.GetNextInt( index ) );
+
+    RArray<TInt> messages;
+    messages.Append( KVCXMYVideosTestMessageCollectionMedia );
+
+    TInt err( KErrNotReady );
+    if( iTester )
+        {
+        TRAP( err, iTester->GetMediaFullDetailsL( drive, index ) );
+        }
+
+    if( err == KErrNone )
+        {
+        TRAPD( err, WaitForMessagesL( ETrue, messages, 1, ETrue ) );
+        messages.Reset();
+        
+        if( err == KErrNone )
+            {
+            CMPXMedia* media = iTester->GetLastFullMedia();
+            TRAP_IGNORE( iTester->PrintMPXMediaL( *media, ETrue ) );
+            }
+        }
+
+    if( err != KErrNone )
+        {
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest::GetMediaFullDetailsL err: %d", err);            
+        }
+    
+    messages.Reset();
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::GetMediaFullDetailsL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosCollectionPluginTest::GetMediaFullDetailsByMpxIdL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::GetMediaFullDetailsByMpxIdL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::GetMediaFullDetailsByMpxIdL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In GetMediaFullDetailsByMpxIdL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    iLastReceivedMessage = -1;
+
+    aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+
+    TInt drive(0);
+    User::LeaveIfError( GetDriveParam( aItem, drive ) );
+
+    TInt index;
+    User::LeaveIfError( aItem.GetNextInt( index ) );
+
+    TBool sync;
+    TInt syncInt;
+    if( aItem.GetNextInt( syncInt ) != KErrNone )
+        {
+        sync = EFalse;
+        }
+    else
+        {
+        sync = static_cast<TBool>( syncInt );
+        }
+    
+    RArray<TInt> messages;
+    messages.Append( KVCXMYVideosTestMessageCollectionMedia );
+
+    TInt err( KErrNotReady );
+    if( iTester )
+        {
+        TRAP( err, iTester->GetMediaFullDetailsByMpxIdL( drive, index, sync ) );
+        }
+
+    if( err == KErrNone )
+        {
+        TRAPD( err, WaitForMessagesL( ETrue, messages, 1, ETrue ) );
+        messages.Reset();
+        
+        if( err == KErrNone )
+            {
+            CMPXMedia* media = iTester->GetLastFullMedia();
+            TRAP_IGNORE( iTester->PrintMPXMediaL( *media, ETrue ) );
+            }
+        }
+
+    if( err != KErrNone )
+        {
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest::GetMediaFullDetailsByMpxIdL err: %d", err);            
+        }
+    
+    messages.Reset();
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::GetMediaFullDetailsByMpxIdL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosCollectionPluginTest::GetAllMediaFullDetailsL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::GetAllMediaFullDetailsL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::GetAllMediaFullDetailsL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In GetAllMediaFullDetailsL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    iLastReceivedMessage = -1;
+
+    aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+
+    TInt err( KErrNotReady );
+    if( iTester )
+        {
+        TRAP( err, iTester->GetAllMediaFullDetailsL( ) );
+        }
+
+    if( err != KErrNone )
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err);
+
+    iLastReceivedMessage = -1;
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::GetAllMediaFullDetailsL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosCollectionPluginTest::CheckMediaDetailL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::CheckMediaDetailL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CheckMediaDetailL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In CheckMediaDetailL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    TInt err( KErrNone );
+
+    TRAP_IGNORE( WaitForRefreshL( EFalse ) ); // Wait for possible refresh to finish.
+ 
+    iLastReceivedMessage = -1;
+
+    aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+
+    TInt drive(0);
+    User::LeaveIfError( GetDriveParam( aItem, drive ) );
+
+    TInt itemIndex(0);
+    User::LeaveIfError( aItem.GetNextInt( itemIndex ) );
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: item index: %d", itemIndex);
+
+    if( itemIndex < 0 || itemIndex >= iTester->GetMediaCount() )
+        {
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: Error. Index (%d) out of bounds.", itemIndex);
+        User::Leave( KErrArgument );
+        }
+
+    TInt mpxAttributeMappingId(0);
+    User::LeaveIfError( aItem.GetNextInt( mpxAttributeMappingId ) );
+
+    TVcxTestMediaAttributeType type;
+    TMPXAttributeData mpxMediaAttribute;
+    User::LeaveIfError( MapMpxMediaAttribute(
+            static_cast<TVcxTestMediaAttributeIdMapping>(mpxAttributeMappingId),
+            mpxMediaAttribute, type ) );
+    
+    
+    CMPXMedia* media( NULL );        
+    TRAP( err, media = iTester->GetMediaL( drive, itemIndex ) );    
+    
+    // If attribute is not supported, fetch full media details.
+    if( media && !media->IsSupported( mpxMediaAttribute ) )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Requesting full media details.");
+        RArray<TInt> messages;
+        messages.Append( KVCXMYVideosTestMessageCollectionMedia );
+        TRAP( err, iTester->GetMediaFullDetailsL( drive, itemIndex ) );
+        if( err == KErrNone )
+        	{
+        	TRAP( err, WaitForMessagesL( ETrue, messages, 5, ETrue ) );
+            media = iTester->GetLastFullMedia();
+        	}
+        messages.Reset();
+        }
+
+    if( err != KErrNone )
+        {
+        VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CheckMediaDetailL <----------");
+        return VCXMVTEST_ERR( err );
+        }
+
+    if( !media->IsSupported( mpxMediaAttribute ) )
+        {
+        VCXLOGLO3("CVCXMyVideosCollectionPluginTest:: error: iAttributeId: %d, iContentId: %d is not supported.",
+                mpxMediaAttribute.iAttributeId == 0, mpxMediaAttribute.iContentId);
+
+        iTester->PrintMPXMediaL( *media, ETrue );
+        
+        VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CheckMediaDetailL <---------");
+        return VCXMVTEST_ERR( KErrNotSupported );
+        }
+
+    if( type == EVcxTestMediaAttributeTypeString )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Getting attribute of type text");
+
+        TPtrC expectedValue;
+        User::LeaveIfError( aItem.GetNextString( expectedValue ) );
+
+        const TDesC& value = media->ValueText( mpxMediaAttribute );
+
+        if( expectedValue != value )
+            {
+            VCXLOGLO3("CVCXMyVideosCollectionPluginTest:: error, values do not match: %S and expected: %S", &value, &expectedValue);
+            err = KErrCorrupt;
+            }
+        }
+
+    if( type == EVcxTestMediaAttributeTypeTTime )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Getting attribute of type TInt64(date)");
+
+        User::Leave( KErrNotSupported );
+#if 0
+        //TPtrC expectedValue;
+        //User::LeaveIfError( aItem.GetNextString( expectedValue ) );
+
+        TInt64 value = *(*media).Value<TInt64>( mpxMediaAttribute );
+
+        TTime time ( value );
+        TBuf<60> timeStr;
+        _LIT(KDateTimeString, "%D%M%Y%/0%1%/1%2%/2%3%/3 %-B%:0%H%:1%T%:2%S%.%*C2%:3%-B");
+        time.FormatL(timeStr, KDateTimeString);
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: date value: %S", &timeStr);
+#endif
+        }
+
+    if( type == EVcxTestMediaAttributeTypeTDateTime )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Getting attribute of type TDateTime");
+
+        User::Leave( KErrNotSupported );
+#if 0
+        TInt expectedValue;
+        User::LeaveIfError( aItem.GetNextInt( expectedValue ) );
+
+        TTime time ( *(*media).Value<TDateTime>( mpxMediaAttribute ) );
+
+        TBuf<60> timeStr;
+        _LIT(KDateTimeString, "%D%M%Y%/0%1%/1%2%/2%3%/3 %-B%:0%H%:1%T%:2%S%.%*C2%:3%-B");
+        time.FormatL(timeStr, KDateTimeString);
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: date value: %S", &timeStr);
+#endif
+        }
+
+    if( type == EVcxTestMediaAttributeTypeTInt )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Getting attribute of type TInt");
+        TInt expectedValue;
+        User::LeaveIfError( aItem.GetNextInt( expectedValue ) );
+
+        TInt value = *(*media).Value<TInt>( mpxMediaAttribute );
+
+        if( expectedValue != value )
+            {
+            err = KErrCorrupt;
+            VCXLOGLO3("CVCXMyVideosCollectionPluginTest:: error, values do not match: %d and expected: %d", value, expectedValue);
+            }
+        }
+
+    if( type == EVcxTestMediaAttributeTypeTUint )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Getting attribute of type TUint");
+
+        TInt expectedValue;
+        User::LeaveIfError( aItem.GetNextInt( expectedValue ) );
+
+        TUint value = *(*media).Value<TUint>( mpxMediaAttribute );
+
+        if( expectedValue != value )
+            {
+            err = KErrCorrupt;
+            VCXLOGLO3("CVCXMyVideosCollectionPluginTest:: error, values do not match: %d and expected: %d", value, expectedValue);
+            }
+        }
+
+    if( type == EVcxTestMediaAttributeTypeTUint8 )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Getting attribute of type TUint8");
+
+        TInt expectedValue;
+        User::LeaveIfError( aItem.GetNextInt( expectedValue ) );
+
+        TUint8 value = *(*media).Value<TUint8>( mpxMediaAttribute );
+
+        if( expectedValue != value )
+            {
+            err = KErrCorrupt;
+            VCXLOGLO3("CVCXMyVideosCollectionPluginTest:: error, values do not match: %d and expected: %d", value, expectedValue);
+            }
+        }
+    
+    TBool isCategoryNewItemCount = 
+            mpxMediaAttribute.iAttributeId == KVcxMediaMyVideosCategoryNewItemCount.iAttributeId &&
+            mpxMediaAttribute.iContentId == KVcxMediaMyVideosCategoryNewItemCount.iContentId;
+    TInt isCategoryItemCount = 
+            mpxMediaAttribute.iAttributeId == KVcxMediaMyVideosCategoryItemCount.iAttributeId &&
+            mpxMediaAttribute.iContentId == KVcxMediaMyVideosCategoryItemCount.iContentId;
+    
+    // Category item counts.
+    if( isCategoryNewItemCount || isCategoryItemCount )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Getting item counts for category.");
+        
+        TInt expectedValue;
+        User::LeaveIfError( aItem.GetNextInt( expectedValue ) );
+
+        // Get actual count from item.
+        TUint32 count = *(*media).Value<TUint32>( mpxMediaAttribute );
+        
+        // Get count of ROM medias for this category.
+        
+        TUint flags = ( isCategoryNewItemCount ? EVcxMyVideosVideoNew : 0 );
+
+        CMPXMediaArray* medias = GetMediasForLevelL( itemIndex, flags );
+                
+        TInt romCount = 0;
+        for( TInt i = 0; i < medias->Count(); i++ )
+            {
+            CMPXMedia* collectionMedia = (*medias)[i];
+            if( collectionMedia->IsSupported( KMPXMediaGeneralUri ) )
+                {
+                const TDesC& url = collectionMedia->ValueText( KMPXMediaGeneralUri );
+                if( url.FindC( _L("z:" ) ) != KErrNotFound )
+                    {
+                    romCount++;
+                    }
+                }
+            }
+
+        delete medias;
+        
+        if( expectedValue != count )
+            {
+            // Check ROM videos are not interfering. 
+            if( romCount != count - expectedValue )
+                {
+                err = KErrCorrupt;
+                VCXLOGLO3("CVCXMyVideosCollectionPluginTest:: error, values do not match: %d and expected: %d", count, expectedValue);
+                }
+            }
+        }
+    else
+    // Other TUInt32 values.
+    if( type == EVcxTestMediaAttributeTypeTUint32 )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Getting attribute of type TUint32");
+
+        TInt expectedValue;
+        User::LeaveIfError( aItem.GetNextInt( expectedValue ) );
+
+        TUint32 value = *(*media).Value<TUint32>( mpxMediaAttribute );
+
+        if( expectedValue != value )
+            {
+            err = KErrCorrupt;
+            VCXLOGLO3("CVCXMyVideosCollectionPluginTest:: error, values do not match: %d and expected: %d", value, expectedValue);
+            }
+        }
+
+    if( type == EVcxTestMediaAttributeTypeTReal32 )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Getting attribute of type TReal32");
+
+        TInt num;
+        User::LeaveIfError( aItem.GetNextInt( num ) );
+        TReal32 expectedValue( num );
+
+        TInt digits;
+        if( aItem.GetNextInt( digits ) == KErrNone )
+            {
+            expectedValue += static_cast<TReal32>(digits)/10000;
+            }
+
+        TReal32 value = *(*media).Value<TReal32>( mpxMediaAttribute );
+
+        if( expectedValue != value )
+            {
+            err = KErrCorrupt;
+            VCXLOGLO3("CVCXMyVideosCollectionPluginTest:: error, values do not match: %f and expected: %f", value, expectedValue);
+            }
+        }
+
+    if( type == EVcxTestMediaAttributeTypeTInt32 )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Getting attribute of type TInt32");
+
+        TInt expectedValue;
+        User::LeaveIfError( aItem.GetNextInt( expectedValue ) );
+
+        TInt32 value = *(*media).Value<TUint32>( mpxMediaAttribute );
+
+        if( expectedValue != value )
+            {
+            err = KErrCorrupt;
+            VCXLOGLO3("CVCXMyVideosCollectionPluginTest:: error, values do not match: %d and expected: %d", value, expectedValue);
+            }
+        }
+
+    if( type == EVcxTestMediaAttributeTypeTInt8 )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Getting attribute of type TInt8");
+
+        TInt expectedValue;
+        User::LeaveIfError( aItem.GetNextInt( expectedValue ) );
+
+        TInt8 value = *(*media).Value<TInt8>( mpxMediaAttribute );
+
+        if( expectedValue != value )
+            {
+            err = KErrCorrupt;
+            VCXLOGLO3("CVCXMyVideosCollectionPluginTest:: error, values do not match: %d and expected: %d", value, expectedValue);
+            }
+        }
+
+    if( type == EVcxTestMediaAttributeTypeTMPXItemId )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Getting attribute of type TMPXItemId");
+
+        TInt expectedValue;
+        User::LeaveIfError( aItem.GetNextInt( expectedValue ) );
+
+        TInt expectedValue2;
+        User::LeaveIfError( aItem.GetNextInt( expectedValue2 ) );
+
+        TMPXItemId itemId;
+        itemId.iId1 = expectedValue;
+        itemId.iId2 = expectedValue2;
+
+        TMPXItemId value = *(*media).Value<TMPXItemId>( mpxMediaAttribute );
+
+        if( itemId != value )
+            {
+            err = KErrCorrupt;
+            VCXLOGLO3("CVCXMyVideosCollectionPluginTest:: expected Id1: %d, Id2: %d", itemId.iId1, itemId.iId2);
+            VCXLOGLO3("CVCXMyVideosCollectionPluginTest:: actual Id1: %d, Id2: %d", value.iId1, value.iId2);
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: ERROR no match!");
+            }
+        }
+
+    if( type == EVcxTestMediaAttributeTypeTInt64 )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Getting attribute of type TInt64");
+
+        TInt expectedValue;
+        User::LeaveIfError( aItem.GetNextInt( expectedValue ) );
+
+        TInt64 value = *(*media).Value<TInt64>( mpxMediaAttribute );
+
+        if( expectedValue != value )
+            {
+            err = KErrCorrupt;
+            VCXLOGLO3("CVCXMyVideosCollectionPluginTest:: error, values do not match: %d and expected: %d", value, expectedValue);
+            }
+        }
+
+    if ( type == EVcxTestMediaAttributeTypeMvFlags )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Getting attribute of type MV flags ( TUint32 )");
+
+        TUint32 value = *(*media).Value<TUint32>( mpxMediaAttribute );
+
+        TInt expectedValue(0);
+        while( aItem.GetNextInt( expectedValue ) == KErrNone )
+            {
+            if( ! (value & expectedValue) )
+                {
+                err = KErrCorrupt;
+                VCXLOGLO3("CVCXMyVideosCollectionPluginTest:: error, flag is: %d, flag %d is not set!", value, expectedValue);
+                }
+            }
+        }
+    
+    if( err != KErrNone )
+        {
+        TRAP_IGNORE( iTester->PrintMediasL( NULL, EFalse, _L("Videos") ) );
+        }
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CheckMediaDetailL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosCollectionPluginTest::SetItemDetailsL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::SetMediaDetailL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::SetMediaDetailL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In SetMediaDetailL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+
+    if( !iMpxMedia )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Error. iMpxMedia not set!");
+        User::Leave( KErrArgument );
+        }
+
+    TInt mpxAttributeMappingId(0);
+    User::LeaveIfError( aItem.GetNextInt( mpxAttributeMappingId ) );
+
+    TVcxTestMediaAttributeType type;
+    TMPXAttributeData mpxMediaAttribute;
+    User::LeaveIfError( MapMpxMediaAttribute(
+            static_cast<TVcxTestMediaAttributeIdMapping>(mpxAttributeMappingId),
+            mpxMediaAttribute, type ) );
+
+    TInt err( KErrNone );
+
+    if( type == EVcxTestMediaAttributeTypeString )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Setting attribute of type text");
+
+        TPtrC value;
+        User::LeaveIfError( aItem.GetNextString( value ) );
+
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: Set to %S", &value);
+        iMpxMedia->SetTextValueL( mpxMediaAttribute, value );
+        }
+
+    if( type == EVcxTestMediaAttributeTypeTTime )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Setting attribute of type TInt64(date)");
+
+        TTime time;
+        time.UniversalTime();
+        TTimeIntervalSeconds timeOffset = User::UTCOffset();
+        TTime localTime = time + timeOffset;
+
+        TInt64 value = localTime.Int64();
+        iMpxMedia->SetTObjectValueL<TInt64>( mpxMediaAttribute, value );
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Set to current time.");
+        }
+
+    if( type == EVcxTestMediaAttributeTypeTDateTime )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Setting attribute of type TDateTime");
+
+        User::Leave( KErrNotSupported );
+#if 0
+        TDateTime time;
+        iMpxMedia->SetTObjectValueL<TDateTime>( mpxMediaAttribute, time );
+        //VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: Set to %d", value);
+#endif
+        }
+
+    if( type == EVcxTestMediaAttributeTypeTInt )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Setting attribute of type TInt");
+        TInt value;
+        User::LeaveIfError( aItem.GetNextInt( value ) );
+        iMpxMedia->SetTObjectValueL<TInt>( mpxMediaAttribute, value );
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: Set to %d", value);
+        }
+
+    if( type == EVcxTestMediaAttributeTypeTUint )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Setting attribute of type TUint");
+
+        TInt value;
+        User::LeaveIfError( aItem.GetNextInt( value ) );
+        iMpxMedia->SetTObjectValueL<TUint>( mpxMediaAttribute, value );
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: Set to %d", value);
+        }
+
+    if( type == EVcxTestMediaAttributeTypeTUint8 )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Setting attribute of type TUint8");
+
+        TInt value;
+        User::LeaveIfError( aItem.GetNextInt( value ) );
+        iMpxMedia->SetTObjectValueL<TUint8>( mpxMediaAttribute, value );
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: Set to %d", value);
+        }
+
+    if( type == EVcxTestMediaAttributeTypeTUint32 )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Setting attribute of type TUint32");
+
+        TInt value;
+        User::LeaveIfError( aItem.GetNextInt( value ) );
+        iMpxMedia->SetTObjectValueL<TUint32>( mpxMediaAttribute, value );
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: Set to %d", value);
+        }
+
+    if( type == EVcxTestMediaAttributeTypeTReal32 )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Setting attribute of type TReal32");
+
+        TInt num;
+        User::LeaveIfError( aItem.GetNextInt( num ) );
+        TReal32 value( num );
+
+        TInt digits;
+        if( aItem.GetNextInt( digits ) == KErrNone )
+            {
+            value += static_cast<TReal32>(digits)/10000;
+            }
+
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: Set to %f", value);
+
+        iMpxMedia->SetTObjectValueL<TReal32>( mpxMediaAttribute, value );
+        }
+
+    if( type == EVcxTestMediaAttributeTypeTInt32 )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Setting attribute of type TInt32");
+
+        TInt value;
+        User::LeaveIfError( aItem.GetNextInt( value ) );
+        iMpxMedia->SetTObjectValueL<TInt32>( mpxMediaAttribute, value );
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: Set to %d", value);
+        }
+
+    if( type == EVcxTestMediaAttributeTypeTMPXItemId )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Setting attribute of type EVcxTestMediaAttributeTypeTMPXItemId");
+
+        TInt value;
+        User::LeaveIfError( aItem.GetNextInt( value ) );
+
+        TInt value2;
+        User::LeaveIfError( aItem.GetNextInt( value2 ) );
+
+        TMPXItemId itemId;
+        itemId.iId1 = value;
+        itemId.iId2 = value2;
+
+        iMpxMedia->SetTObjectValueL<TMPXItemId>( mpxMediaAttribute, itemId );
+        VCXLOGLO3("CVCXMyVideosCollectionPluginTest:: Set to Id1: %d, Id2: %d", value, value2);
+        }
+
+    if( type == EVcxTestMediaAttributeTypeTInt8 )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Setting attribute of type TInt8");
+
+        TInt value;
+        User::LeaveIfError( aItem.GetNextInt( value ) );
+        iMpxMedia->SetTObjectValueL<TInt8>( mpxMediaAttribute, value );
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: Set to %d", value);
+        }
+
+    if( type == EVcxTestMediaAttributeTypeTInt64 )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Setting attribute of type TInt64");
+
+        TInt value;
+        User::LeaveIfError( aItem.GetNextInt( value ) );
+        if( value == KVcxTestFileSize3GB )
+            {
+            iMpxMedia->SetTObjectValueL<TInt64>( mpxMediaAttribute, 3000000000 );
+            }
+        else
+            {
+            iMpxMedia->SetTObjectValueL<TInt64>( mpxMediaAttribute, value );
+            }
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: Set to %d", value);
+        }
+
+    if ( type == EVcxTestMediaAttributeTypeMvFlags )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Setting attribute of type MV flags ( TUint32 )");
+
+        TInt value(0);
+        while( aItem.GetNextInt( value ) == KErrNone )
+            {
+            value |= value;
+            }
+        iMpxMedia->SetTObjectValueL<TUint32>( mpxMediaAttribute, value );
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: Set to %d", value);
+        }
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::SetMediaDetailL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::CheckMediaCountL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::CheckMediaCountL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CheckMediaCountL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In CheckMediaCountL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    WaitForRefreshL( EFalse ); // Wait for possible refresh to finish.
+    
+    aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+
+    TInt drive(0);
+    User::LeaveIfError( GetDriveParam( aItem, drive ) );
+
+    TInt expectedCount(0);
+    User::LeaveIfError(aItem.GetNextInt(expectedCount));
+
+    TRAPD( err, CheckMediasL( expectedCount, drive, 0 ) );
+    
+    if( err != KErrNone ) 
+        {
+        iTester->PrintMediasL( NULL, EFalse, _L("Videos") );
+        }
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CheckMediaCountL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::CheckMinimumMediaCountL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::CheckMinimumMediaCountL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CheckMinimumMediaCountL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In CheckMinimumMediaCountL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+    
+    WaitForRefreshL( EFalse ); // Wait for possible refresh to finish.
+
+    aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+
+    TInt drive(0);
+    User::LeaveIfError( GetDriveParam( aItem, drive ) );
+
+    TInt expectedCount(0);
+    User::LeaveIfError(aItem.GetNextInt(expectedCount));
+
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: drive: %d", drive);
+
+    TRAPD( err, CheckMediasL( expectedCount, drive, -1 ) );
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CheckMinimumMediaCountL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::CheckMaximumMediaCountL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::CheckMaximumMediaCountL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CheckMaximumMediaCountL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In CheckMaximumMediaCountL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+    
+    WaitForRefreshL( EFalse ); // Wait for possible refresh to finish.
+
+    aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+
+    TInt drive(0);
+    User::LeaveIfError( GetDriveParam( aItem, drive ) );
+
+    TInt expectedCount(0);
+    User::LeaveIfError( aItem.GetNextInt(expectedCount) );
+
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: drive: %d", drive);
+
+    TRAPD( err, CheckMediasL( expectedCount, drive, 1 ) );
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CheckMaximumMediaCountL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::CheckDownloadCountL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::CheckDownloadCountL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CheckDownloadCountL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In CheckMediaCountL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+    
+    WaitForRefreshL( EFalse ); // Wait for possible refresh to finish.
+
+    TInt expectedCount(0);
+    User::LeaveIfError(aItem.GetNextInt(expectedCount));
+
+    TInt err( KErrNotReady );
+    if( iTester )
+        {
+        err = KErrNone;
+        if( iTester->GetDownloadWatcher()->GetDownloadCount() != expectedCount )
+            {
+            err = KErrCorrupt;
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: ERROR: Not expected count of downloads!");
+            }
+        }
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CheckDownloadCountL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosCollectionPluginTest::CreateCopyOfMediaL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::CreateCopyOfMediaL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CreateCopyOfMediaL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In CreateCopyOfMediaL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+
+    TInt drive(0);
+    User::LeaveIfError( GetDriveParam( aItem, drive ) );
+
+    TInt index(0);
+    User::LeaveIfError( aItem.GetNextInt( index ) );
+
+    if( index < 0 || index >= iTester->GetMediaCount() )
+        {
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: Error. Index (%d) out of bounds.", index);
+        User::Leave( KErrArgument );
+        }
+
+    TInt fullCopy(1);
+    if( aItem.GetNextInt( fullCopy ) != KErrNone )
+        {
+        fullCopy = 1;
+        }
+
+    if( iTester->GetMediaCount() <= 0 )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: ERROR: There's zero medias!");
+        VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CreateCopyOfMediaL <----------");
+        return VCXMVTEST_ERR( KErrArgument );
+        }
+
+    if( iMpxMedia )
+        {
+        delete iMpxMedia;
+        iMpxMedia = NULL;
+        }
+
+    TInt err( KErrNone );
+    
+    if( fullCopy )
+        {
+        iLastReceivedMessage = -1;
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Requesting full media details.");
+        RArray<TInt> messages;
+        messages.Append( KVCXMYVideosTestMessageCollectionMedia );
+        TRAP( err, iTester->GetMediaFullDetailsL( drive, index ) );
+        if( err == KErrNone )
+            {
+            TRAP( err, WaitForMessagesL( ETrue, messages, 5, ETrue ) );
+
+            if( err == KErrNone )
+                {
+                CMPXMedia* copiedMedia = iTester->GetLastFullMedia();
+    
+                const TDesC& title = copiedMedia->ValueText( KMPXMediaGeneralTitle );
+                TMPXItemId itemId = *(copiedMedia->Value<TMPXItemId>( KMPXMediaGeneralId ));
+                
+                VCXLOGLO4("CVCXMyVideosCollectionPluginTest:: Creating copy of MPX media: %S, id1: %d, id2: %d.", &title, itemId.iId1, itemId.iId2);
+                TRAP( err, iMpxMedia = copiedMedia->CopyL( *copiedMedia ) );            
+                }
+            }
+        messages.Reset();
+        }
+    else
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Creating empty MPX media.");
+        iMpxMedia = CMPXMedia::NewL();
+
+        CMPXMedia* copiedMedia( NULL );
+        
+        TRAP( err, copiedMedia = iTester->GetMediaL( drive, index ) );
+
+        if( copiedMedia )
+            {
+            TMPXItemId mpxId = *(copiedMedia->Value<TMPXItemId>( KMPXMediaGeneralId ));
+            iMpxMedia->SetTObjectValueL<TMPXItemId>( KMPXMediaGeneralId, mpxId );
+            }
+        }
+    
+    if( err != KErrNone )
+        {
+        VCXLOGLO2("<<<CVCXMyVideosCollectionPluginTest:: err: %d", err);
+        }
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CreateCopyOfMediaL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosCollectionPluginTest::CreateEmptyMediaL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::CreateEmptyMediaL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CreateEmptyMediaL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In CreateEmptyMediaL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+
+    if( iMpxMedia )
+        {
+        delete iMpxMedia;
+        iMpxMedia = NULL;
+        }
+
+    iMpxMedia = CMPXMedia::NewL();
+
+    TMPXItemId mpxId;
+    mpxId.iId1 = 0;
+    mpxId.iId2 = 0;
+    iMpxMedia->SetTObjectValueL<TMPXItemId>( KMPXMediaGeneralId, mpxId );
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CreateEmptyMediaL <----------");
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosCollectionPluginTest::AddMediaL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::AddMediaL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::AddMediaL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In AddMediaL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    iLastReceivedMessage = -1;
+
+    aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+
+    TInt syncCallInt(0);
+    User::LeaveIfError( aItem.GetNextInt( syncCallInt ) );
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: callTypeInt: %d", syncCallInt);
+    TBool syncCall = static_cast<TBool>(syncCallInt);
+
+    TRAPD( err, iTester->AddMediaL( iMpxMedia, syncCall ) );
+
+#ifndef  __WINSCW__
+    // In urel builds add media is not supported, check mpx plugin file size if this is urel or udeb build.
+    if( err == KErrNotSupported )
+        {
+        RFile rf;
+        _LIT( KVCXTestSystemDriveMpxPluginPath, "z:\\sys\\bin\\vcxmyvideoscollectionplugin.dll" );
+        _LIT( KVCXTestUserDriveMpxPluginPath, "c:\\sys\\bin\\vcxmyvideoscollectionplugin.dll" );
+
+        TInt err2( KErrNone );
+        if( BaflUtils::FileExists( iFs, KVCXTestUserDriveMpxPluginPath ) )
+            {
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Open C drive bin.");
+            err2 = rf.Open( iFs, KVCXTestUserDriveMpxPluginPath, EFileRead|EFileShareAny );
+            }
+        else
+            {
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Open Z drive bin.");
+            err2 = rf.Open( iFs, KVCXTestSystemDriveMpxPluginPath, EFileRead|EFileShareAny );
+            }
+
+        if( err2 == KErrNone )
+            {
+            TInt size(0);
+            if( rf.Size( size ) == KErrNone )
+                {
+                if( size < 1024*40 )
+                    {
+                    err = KErrNone;
+                    VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: !OBS! Looks like UREL build, Add media failed as expected.");
+                    iAddMediaCmdCount++; // Increase 'fake' video count for media count check.
+                    }
+                else
+                    {
+                    VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: !OBS! ERROR: UDEB build I guess, add media failed, check this.");
+                    }
+                }
+            rf.Close();
+            }
+        else
+            {
+            VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: Open plugin binary failed: %d", err2);
+            }
+        }
+#endif // __WINSCW__
+
+
+    if( err != KErrNone )
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err);
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::AddMediaL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosCollectionPluginTest::SetMediaL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::SetMediaL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::SetMediaL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In SetMediaL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    if( !iMpxMedia )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Error. iMpxMedia not set!");
+        User::Leave( KErrArgument );
+        }
+
+    iLastReceivedMessage = -1;
+
+    aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+
+    TInt syncCallInt(0);
+    User::LeaveIfError( aItem.GetNextInt( syncCallInt ) );
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: callTypeInt: %d", syncCallInt);
+    TBool syncCall = static_cast<TBool>(syncCallInt);
+
+    TInt err( KErrNotReady );
+    if( iTester )
+        {
+        TRAP( err, iTester->SetMediaL( iMpxMedia, syncCall ) );
+        }
+
+    if( err != KErrNone )
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err);
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::SetMediaL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosCollectionPluginTest::OutsideMediaUpdateL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::OutsideMediaUpdateL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::OutsideMediaUpdateL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In OutsideMediaUpdateL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    if( !iMpxMedia )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Error. iMpxMedia not set!");
+        User::Leave( KErrArgument );
+        }
+
+    iLastReceivedMessage = -1;
+
+    aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+
+    TRAPD( err, iMdsDbModifier->UpdateVideoL( *iMpxMedia ) );
+
+    if( err != KErrNone )
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err);
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::OutsideMediaUpdateL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::RemoveMediaL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::RemoveMediaL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::RemoveMediaL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In RemoveMediaL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+
+    TInt drive(0);
+    User::LeaveIfError( GetDriveParam( aItem, drive ) );
+
+    TInt index(0);
+    User::LeaveIfError( aItem.GetNextInt( index ) );
+
+    TBool syncCall( EFalse );
+    TInt syncCallInt(0);
+    if( aItem.GetNextInt( syncCallInt ) == KErrNone )
+        {
+        syncCall = static_cast<TBool>(syncCallInt);
+        }
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: callTypeInt: %d", syncCall );
+
+    iLastReceivedMessage = -1;
+
+    TInt err( KErrNotReady );
+    if( iTester )
+        {
+        TRAP( err, iTester->RemoveMediaL( drive, index, syncCall ) );
+        }
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::RemoveMediaL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::RemoveAllMediaL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::RemoveAllMediaL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::RemoveAllMediaL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In RemoveAllMediaL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+
+    iLastReceivedMessage = -1;
+
+    TRAP_IGNORE( iTester->EnsureMediaFilesAreNotInUseL() );
+    
+    TInt error( KErrNone );
+    
+    TInt mediaCount = iTester->GetMediaCount();
+    
+    // Store info about the mpx items. 
+    RArray<TUint> mpxIds;
+    CleanupClosePushL( mpxIds ); 
+            
+    RArray<TUint> downloadIds;
+    CleanupClosePushL( downloadIds );
+    
+    RArray<TInt> downloadStates;
+    CleanupClosePushL( downloadStates );
+
+    RPointerArray<HBufC> filePaths;
+    CleanupResetAndDestroyPushL( filePaths );
+    
+    // Get ids and other needed details. 
+    
+    for( TInt i=0; i<mediaCount; i++ )
+        {
+        CMPXMedia* media( NULL );
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest::RemoveAllMediaL: GetMedia %d", i);
+        TRAP( error, media = iTester->GetMediaL( -1, i ) );
+
+        if( error != KErrNone )
+            {
+            CleanupStack::PopAndDestroy( &filePaths );
+            CleanupStack::PopAndDestroy( &downloadStates );
+            CleanupStack::PopAndDestroy( &downloadIds );
+            CleanupStack::PopAndDestroy( &mpxIds );
+            
+            VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::RemoveAllMediaL <----------");
+            return VCXMVTEST_ERR( error );
+            }
+        
+        if( media && media->IsSupported( KMPXMediaGeneralUri ) )
+            {
+            TUint32 downloadId = 0;
+            if( media->IsSupported( KVcxMediaMyVideosDownloadId ) )
+                {
+                downloadId = media->ValueTObjectL<TUint32>( KVcxMediaMyVideosDownloadId );
+                }
+
+            TInt state = -1;
+            if( media->IsSupported( KVcxMediaMyVideosDownloadState ) )
+                {
+                state = media->ValueTObjectL<TUint8>( KVcxMediaMyVideosDownloadState );
+                }                
+                
+            HBufC* path( NULL );
+            if( media->IsSupported( KMPXMediaGeneralUri ) )
+                {
+                path = media->ValueText( KMPXMediaGeneralUri ).AllocL();
+                }
+            else
+                {
+                path = HBufC::NewL( 32 );
+                }
+            
+            TMPXItemId itemId = *(media->Value<TMPXItemId>( KMPXMediaGeneralId ));
+            
+            filePaths.Append( path );
+            downloadIds.Append( downloadId );
+            downloadStates.Append( state );
+            mpxIds.Append( itemId.iId1 );
+            }
+        }
+    
+    // Cancel downloads.
+    
+    for( TInt i = mpxIds.Count()-1; i >= 0; i-- )
+        {
+        if( downloadIds[i] != 0 || downloadStates[i] != -1 )
+            {
+            // Cancel the download.
+            RArray<TInt> messages;
+            if( BaflUtils::FileExists( iFs, filePaths[i]->Des() ) )
+                {
+                messages.Append( KVCXMYVideosTestMessageMpxItemDeleted );
+                }
+            messages.Append( KVCXMYVideosTestMessageCommandComplete );
+            messages.Append( KVCXMYVideosTestMessageCollectionOpened );
+            TRAP( error, iTester->CancelDownloadL( mpxIds[i], downloadIds[i], filePaths[i]->Des(), EFalse ) );
+            if( error == KErrNone )
+                {
+                TRAP( error, WaitForMessagesL( ETrue, messages, 30, ETrue ) );
+                }
+            messages.Reset();
+            // Error occured, lets hope deleting works.
+            if( error != KErrNone )
+                {
+                downloadIds[i] = 0;
+                downloadStates[i] = -1;
+                }
+            }    
+        }
+    
+    // Get current list of medias.
+    
+    CMPXMediaArray* medias( NULL );
+    medias = iTester->SelectMediasL( -1, 0, iTester->GetMediaCount() );
+    CleanupStack::PushL( medias );
+
+    TInt retries = 3;
+    
+    // Delete the videos, and retry few times if needed.
+    while( iTester->GetMediaCount() > 0 && retries-- > 0 )
+        {
+        // Get medias to delete.
+        TRAP( error, iTester->DeleteMediasByMpxIdsL( medias, EFalse ) );
+    
+        if( error == KErrNone )
+            {
+            // Wait for deletion to complete.
+            RArray<TInt> messages;
+            CleanupClosePushL( messages );
+            messages.Append( KVCXMYVideosTestMessageDeleteResp );
+            messages.Append( KVCXMYVideosTestMessageCommandComplete );
+            messages.Append( KVCXMYVideosTestMessageDeleteStarted );
+    
+            TInt timeout = medias->Count()*5 + 60;
+    
+            TRAP( error, WaitForMessagesL( ETrue, messages, timeout, ETrue ) );
+            CleanupStack::PopAndDestroy( &messages );
+            }
+        
+        CleanupStack::PopAndDestroy( medias );
+        
+        // Refresh the medias.
+        RArray<TInt> messages;
+        messages.Append( KVCXMYVideosTestMessageCollectionOpened );
+        TRAP( error, iTester->RefreshContentsL() );
+        if( error == KErrNone )
+            {
+            TRAP( error, WaitForMessagesL( ETrue, messages, 120, ETrue ) );
+            }
+        messages.Reset();
+        
+        medias = iTester->SelectMediasL( -1, 0, iTester->GetMediaCount() );
+        CleanupStack::PushL( medias );        
+        
+        if( iTester->GetMediaCount() > 0 )
+            {
+            User::After( 60 * 1000000 ); // Wait a minute.
+            }
+        }
+
+    CleanupStack::PopAndDestroy( medias );
+
+    iLastReceivedMessage = -1;
+
+    CleanupStack::PopAndDestroy( &filePaths );
+    CleanupStack::PopAndDestroy( &downloadStates );
+    CleanupStack::PopAndDestroy( &downloadIds );
+    CleanupStack::PopAndDestroy( &mpxIds );
+
+    if( iTester && iTester->GetDownloadWatcher() )
+        {
+        iTester->GetDownloadWatcher()->Reset();
+        }
+
+    if( iTester->GetMediaCount() > 0 )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: All medias could not be removed."); 
+        error = KErrCorrupt;
+        }
+    
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::RemoveAllMediaL <----------");
+    return VCXMVTEST_ERR( error ); 
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::MoveMediaL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::MoveMediaL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::MoveMediaL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In MoveMediaL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+
+    iLastReceivedMessage = -1;
+
+    TInt sourceDrive(0);
+    User::LeaveIfError( GetDriveParam( aItem, sourceDrive ) );
+
+    TInt index(0);
+    User::LeaveIfError( aItem.GetNextInt( index ) );
+
+    TInt destDrive(0);
+    User::LeaveIfError( GetDriveParam( aItem, destDrive ) );
+
+    TBool syncCall( EFalse );
+    TInt syncCallInt(0);
+    if( aItem.GetNextInt( syncCallInt ) == KErrNone )
+        {
+        syncCall = static_cast<TBool>(syncCallInt);
+        }
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: callTypeInt: %d", syncCall );
+
+    TInt err( KErrNotReady );
+    if( iTester )
+        {
+        TRAP( err, iTester->EnsureMediaFilesAreNotInUseL() );
+        err = VCXMVTEST_ERR( err );
+        if( err == KErrNone )
+            {
+            TRAP( err, iTester->MoveMediasL( sourceDrive, index, index+1, destDrive, syncCall ) );
+            }
+        }
+
+    if( err != KErrNone )
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err);
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::MoveMediaL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::MoveMediasL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::MoveMediasL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::MoveMediasL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In MoveMediasL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+
+    iLastReceivedMessage = -1;
+
+    TInt sourceDrive(0);
+    User::LeaveIfError( GetDriveParam( aItem, sourceDrive ) );
+
+    TInt index(0);
+    User::LeaveIfError( aItem.GetNextInt( index ) );
+
+    TInt endIndex(0);
+    User::LeaveIfError( aItem.GetNextInt( endIndex ) );
+
+    TInt destDrive(0);
+    User::LeaveIfError( GetDriveParam( aItem, destDrive ) );
+
+    TBool syncCall( EFalse );
+    TInt syncCallInt(0);
+    if( aItem.GetNextInt( syncCallInt ) == KErrNone )
+        {
+        syncCall = static_cast<TBool>(syncCallInt);
+        }
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: callTypeInt: %d", syncCall );
+
+    TInt err( KErrNotReady );
+    if( iTester )
+        {
+        TRAP( err, iTester->EnsureMediaFilesAreNotInUseL() );
+        err = VCXMVTEST_ERR( err );
+        if( err == KErrNone )
+            {
+            TRAP( err, iTester->MoveMediasL( sourceDrive, index, endIndex, destDrive, syncCall ) );
+            }
+        }
+
+    if( err != KErrNone )
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err);
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::MoveMediasL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::CancelMoveL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::CancelMoveL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CancelMoveL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In CancelMoveL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+
+    iLastReceivedMessage = -1;
+
+    TBool syncCall( ETrue );
+    TInt syncCallInt(0);
+    if( aItem.GetNextInt( syncCallInt ) == KErrNone )
+        {
+        syncCall = static_cast<TBool>(syncCallInt);
+        }
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: callTypeInt: %d", syncCall );
+
+    TInt err( KErrNotReady );
+    if( iTester )
+        {
+        TRAP( err, iTester->CancelMoveOrCopyL( syncCall ) );
+        }
+
+    if( err != KErrNone )
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err);
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CancelMoveL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::CopyMediaL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::CopyMediaL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CopyMediaL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In CopyMediaL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+
+    iLastReceivedMessage = -1;
+
+    TInt sourceDrive(0);
+    User::LeaveIfError( GetDriveParam( aItem, sourceDrive ) );
+
+    TInt index(0);
+    User::LeaveIfError( aItem.GetNextInt( index ) );
+
+    TInt destDrive(0);
+    User::LeaveIfError( GetDriveParam( aItem, destDrive ) );
+
+    TBool syncCall( EFalse );
+    TInt syncCallInt(0);
+    if( aItem.GetNextInt( syncCallInt ) == KErrNone )
+        {
+        syncCall = static_cast<TBool>(syncCallInt);
+        }
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: callTypeInt: %d", syncCall );
+
+    TInt err( KErrNotReady );
+    if( iTester )
+        {
+        TRAP( err, iTester->CopyMediasL( sourceDrive, index, index+1, destDrive, syncCall ) );
+        }
+
+    if( err != KErrNone )
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err);
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CopyMediaL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::CopyMediasL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::CopyMediasL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CopyMediasL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In CopyMediasL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+
+    iLastReceivedMessage = -1;
+
+    TInt sourceDrive(0);
+    User::LeaveIfError( GetDriveParam( aItem, sourceDrive ) );
+
+    TInt index(0);
+    User::LeaveIfError( aItem.GetNextInt( index ) );
+
+    TInt endIndex(0);
+    User::LeaveIfError( aItem.GetNextInt( endIndex ) );
+
+    TInt destDrive(0);
+    User::LeaveIfError( GetDriveParam( aItem, destDrive ) );
+
+    TBool syncCall( EFalse );
+    TInt syncCallInt(0);
+    if( aItem.GetNextInt( syncCallInt ) == KErrNone )
+        {
+        syncCall = static_cast<TBool>(syncCallInt);
+        }
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: callTypeInt: %d", syncCall );
+
+    TInt err( KErrNotReady );
+    if( iTester )
+        {
+        TRAP( err, iTester->CopyMediasL( sourceDrive, index, endIndex, destDrive, syncCall ) );
+        }
+
+    if( err != KErrNone )
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err);
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CopyMediasL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::CancelCopyL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::CancelCopyL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CancelCopyL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In CancelCopyL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+
+    iLastReceivedMessage = -1;
+
+    TBool syncCall( EFalse );
+    TInt syncCallInt(0);
+    if( aItem.GetNextInt( syncCallInt ) == KErrNone )
+        {
+        syncCall = static_cast<TBool>(syncCallInt);
+        }
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: callTypeInt: %d", syncCall );
+
+    TInt err( KErrNotReady );
+    if( iTester )
+        {
+        TRAP( err, iTester->CancelMoveOrCopyL( syncCall ) );
+        }
+
+    if( err != KErrNone )
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err);
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CancelCopyL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::DeleteMediaL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::DeleteMediaL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::DeleteMediaL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In DeleteMediaL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+
+    iLastReceivedMessage = -1;
+
+    TInt sourceDrive(0);
+    User::LeaveIfError( GetDriveParam( aItem, sourceDrive ) );
+
+    TInt index(0);
+    User::LeaveIfError( aItem.GetNextInt( index ) );
+
+    TBool syncCall( ETrue );
+    TInt syncCallInt(0);
+    if( aItem.GetNextInt( syncCallInt ) == KErrNone )
+        {
+        syncCall = static_cast<TBool>(syncCallInt);
+        }
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: callTypeInt: %d", syncCall );
+
+    TInt err( KErrNotReady );
+    if( iTester )
+        {
+        TRAP( err, iTester->EnsureMediaFilesAreNotInUseL() );
+        err = VCXMVTEST_ERR( err );
+        if( err == KErrNone )
+            {
+            TRAP( err, iTester->DeleteMediasL( sourceDrive, index, index+1, syncCall ) );
+            }
+        }
+
+    if( err != KErrNone )
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err);
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::DeleteMediaL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::DeleteMediasL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::DeleteMediasL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::DeleteMediasL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In DeleteMediasL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+
+    iLastReceivedMessage = -1;
+
+    TInt sourceDrive(0);
+    User::LeaveIfError( GetDriveParam( aItem, sourceDrive ) );
+
+    TInt index(0);
+    User::LeaveIfError( aItem.GetNextInt( index ) );
+
+    TInt endIndex(0);
+    User::LeaveIfError( aItem.GetNextInt( endIndex ) );
+
+    TBool syncCall( EFalse );
+    TInt syncCallInt(0);
+    if( aItem.GetNextInt( syncCallInt ) == KErrNone )
+        {
+        syncCall = static_cast<TBool>(syncCallInt);
+        }
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: callTypeInt: %d", syncCall );
+
+    TInt err( KErrNotReady );
+    if( iTester )
+        {
+        TRAP( err, iTester->EnsureMediaFilesAreNotInUseL() );
+        err = VCXMVTEST_ERR( err );
+        if( err == KErrNone )
+            {
+            TRAP( err, iTester->DeleteMediasL( sourceDrive, index, endIndex, syncCall ) );
+            }
+        }
+
+    if( err != KErrNone )
+        {
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err);
+        }
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::DeleteMediasL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::CancelDeleteL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::CancelDeleteL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CancelDeleteL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In CancelDeleteL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+
+    iLastReceivedMessage = -1;
+
+    TBool syncCall( ETrue );
+    TInt syncCallInt(0);
+    if( aItem.GetNextInt( syncCallInt ) == KErrNone )
+        {
+        syncCall = static_cast<TBool>(syncCallInt);
+        }
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: callTypeInt: %d", syncCall );
+
+    TInt err( KErrNotReady );
+    if( iTester )
+        {
+        TRAP( err, iTester->CancelDeleteL( syncCall ) );
+        }
+
+    if( err != KErrNone )
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err);
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CancelDeleteL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+//----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::CancelNextOperationL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::CancelNextOperationL( CStifItemParser& /* aItem */ )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CancelNextOperationL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In CancelNextOperationL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    iCancelNextOperation = ETrue;
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CancelNextOperationL <----------");
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::DeleteFileOfMediaL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::DeleteFileOfMediaL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::DeleteFileOfMediaL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In DeleteFileOfMediaL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+
+    TInt drive(0);
+    User::LeaveIfError( GetDriveParam( aItem, drive ) );
+
+    TInt index(0);
+    User::LeaveIfError( aItem.GetNextInt( index ) );
+
+    if( index < 0 || index >= iTester->GetMediaCount() )
+        {
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: Error. Index (%d) out of bounds.", index);
+        User::Leave( KErrArgument );
+        }
+
+    iLastReceivedMessage = -1;
+
+    TRAPD( err, iTester->DeleteFileOfMediaL( drive, index ) );
+
+    if( err != KErrNone )
+        {
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err);
+        }
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::DeleteFileOfMediaL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::DeleteFilesOfAllMediasL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::DeleteFilesOfAllMediasL( CStifItemParser& /* aItem */ )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::DeleteFilesOfAllMediasL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In DeleteFilesOfAllMediasL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    iLastReceivedMessage = -1;
+
+    TInt err( KErrNotReady );
+    if( iTester )
+        {
+        TRAP( err, iTester->EnsureMediaFilesAreNotInUseL() );
+        err = VCXMVTEST_ERR( err );
+        if( err == KErrNone )
+            {        
+            TRAP( err, iTester->DeleteAllMediaFilesL() );
+            }
+        }
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::DeleteFilesOfAllMediasL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::CreateVideoFileL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::CreateVideoFileL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CreateVideoFileL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In CreateVideoFileL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+
+    TInt temp(0);
+
+    // Parameter video type
+    CIptvTestVideoCreator::TIptvTestVideoType videoType;
+    User::LeaveIfError( aItem.GetNextInt(temp) );
+    videoType = static_cast<CIptvTestVideoCreator::TIptvTestVideoType>(temp);
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: videoType: %d", videoType);
+
+    // Parameter drive letter
+    TPtrC driveLetter;
+    User::LeaveIfError(aItem.GetNextString(driveLetter));
+#ifdef __WINSCW__
+    driveLetter.Set(_L("C"));
+#endif
+
+    // Parameter path and filename
+    TPtrC filename;
+    User::LeaveIfError(aItem.GetNextString(filename));
+    if(filename.Length() < 64)
+        {
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: filename: %S", &filename);
+        }
+
+    // Parameter video size
+    TInt size(-1);
+    if( aItem.GetNextInt(size) != KErrNone )
+        {
+        size = -1;
+        }
+    
+    // Parameter video count
+    TInt count(1);
+    if( aItem.GetNextInt( count ) != KErrNone || count <= 0 )
+        {
+        count = 1;
+        }
+
+    TRAPD( err, CreateVideoFileL( videoType, driveLetter, filename, size, count, ETrue ) );
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CreateVideoFileL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::CreateVideoFileNoWaitL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::CreateVideoFileNoWaitL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CreateVideoFileNoWaitL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In CreateVideoFileNoWaitL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+
+    TInt temp(0);
+
+    // Parameter video type
+    CIptvTestVideoCreator::TIptvTestVideoType videoType;
+    User::LeaveIfError( aItem.GetNextInt(temp) );
+    videoType = static_cast<CIptvTestVideoCreator::TIptvTestVideoType>(temp);
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: videoType: %d", videoType);
+
+    // Parameter drive letter
+    TPtrC driveLetter;
+    User::LeaveIfError(aItem.GetNextString(driveLetter));
+#ifdef __WINSCW__
+    driveLetter.Set(_L("C"));
+#endif
+    
+    // Parameter path and filename
+    TPtrC filename;
+    User::LeaveIfError(aItem.GetNextString(filename));
+    if(filename.Length() < 64)
+        {
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: filename: %S", &filename);
+        }
+
+    // Parameter video size
+    TInt size(-1);
+    if( aItem.GetNextInt( size ) != KErrNone )
+        {
+        size = -1;
+        }
+    
+    size = size == 0 ? size -1 : size;
+
+    // Parameter video count
+    TInt count(1);
+    if( aItem.GetNextInt( count ) != KErrNone || count <= 0 )
+        {
+        count = 1;
+        }
+
+    TRAPD( err, CreateVideoFileL( videoType, driveLetter, filename, size, count, EFalse ) );
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CreateVideoFileNoWaitL ---------->");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::CreateVideoFileL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTest::CreateVideoFileL( CIptvTestVideoCreator::TIptvTestVideoType aType, const TDesC& aDriveLetter, const TDesC& aFileName, TInt aSize, TInt aVideoCount, TBool aDoSync )
+    {
+    HBufC* path = HBufC::NewL( 2048 );
+    CleanupStack::PushL(path);
+
+    // Make sure path exists and resolve path + filename
+    TInt pos = aFileName.LocateReverse('\\');
+    // Folder is specified in the test case
+    if(pos != KErrNotFound)
+        {
+        path->Des().Copy( aDriveLetter );
+        path->Des().Append( aFileName.Left( pos+1 ) );
+        if( path->Des().Length() < 64 )
+            {
+            VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: path: %S", path);
+            }
+        BaflUtils::EnsurePathExistsL(iFs, path->Des());
+
+        path->Des().Copy( aDriveLetter );
+        path->Des().Append( aFileName );
+        }
+    // No folder specified. If drive is C use :\data\my videos, else :\my videos
+    else
+        {
+        path->Des().Copy( aDriveLetter );
+        TInt driveNum(0);
+        RFs::CharToDrive( aDriveLetter[0], driveNum );
+        if( driveNum == EDriveC )
+            {
+            path->Des().Append( _L(":\\data\\my videos\\") );
+            }
+        else
+            {
+            path->Des().Append( _L(":\\my videos\\") );
+            }
+
+        if( path->Des().Length() < 64 )
+            {
+            VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: path: %S", path);
+            }
+
+        BaflUtils::EnsurePathExistsL( iFs, path->Des() );
+        path->Des().Append( aFileName );
+        }
+
+    path->ReAllocL( path->Des().Length()+1 );
+
+    // Save path for later cleanup
+    HBufC* pathOnly = path->Des().Left( path->Des().LocateReverse('\\') + 1 ).AllocL();
+    CleanupStack::PushL( pathOnly );
+    TBool pathStoredAlready = EFalse;
+    for( TInt i = 0; i < iSideloadFolders.Count(); i++ )
+        {
+        if( iSideloadFolders[i]->Des().Find( *pathOnly ) != KErrNotFound )
+            {
+            pathStoredAlready = ETrue;
+            break;
+            }
+        }
+    if( !pathStoredAlready )
+        {
+        CleanupStack::Pop( pathOnly );
+        iSideloadFolders.Append( pathOnly );
+        }
+    else
+        {
+        CleanupStack::PopAndDestroy( pathOnly );
+        }
+
+    // Create file(s)
+    TInt err( KErrNone );
+
+    iLastReceivedMessage = -1;
+
+    if( aVideoCount == 1 )
+        {
+        // Save the path for later use.
+        CleanupStack::Pop( path );
+        iSideloadedFiles.Append( path );
+
+        // Create the video.
+        TRAP( err, iTestCommon->CreateVideoFileL( aType, *path, aSize ) );
+        if(err != KErrNone)
+            {
+            VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: CreateVideoFileL returned error: %d:", err);
+            }
+        TRAP_IGNORE( iStats->ActionStartL( KSideloadVideoActionId, _L("Sideload video") ) );
+        }
+    else
+        {
+        TRAP( err, iTestCommon->CreateVideoFilesL( aType, *path, aVideoCount, iSideloadedFiles ) );
+        if(err != KErrNone)
+            {
+            VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: CreateVideoFilesL returned error: %d:", err);
+            }
+        for( TInt i = 0; i < aVideoCount; i++ )
+            {
+            TRAP_IGNORE( iStats->ActionStartL( KSideloadVideoActionId, _L("Sideload video") ) );
+            }
+        CleanupStack::PopAndDestroy( path );
+        }
+
+    if( iTester )
+        {
+        // Wait until videos have been created and collection refreshed.
+        // Only if category is open.
+        if( aDoSync && iTester->GetCurrentLevel() == 3 )
+            {
+            // Disable automatic refresh if adding multiple videos.
+            if( aVideoCount > 1 )
+                {
+                iTester->SetAutomaticRefresh( EFalse );
+                }
+
+            // Wait for insertion events.
+            RArray<TInt> messages;
+            for( TInt i=0; i<aVideoCount; i++ )
+                {
+                messages.Append( KVCXMYVideosTestMessageMpxItemInserted );
+                }
+            // Only one video added, refresh is automatic.
+            if( aVideoCount <= 1 )
+                {
+                messages.Append( KVCXMYVideosTestMessageCollectionOpened );
+                }
+            
+            TInt timeout = aVideoCount*5 + 60;
+            
+            WaitForMessagesL( ETrue, messages, timeout, ETrue );
+            messages.Reset();
+
+            // Multiple videos added, refresh.
+            if( aVideoCount > 1 )
+                {
+                iTester->RefreshContentsL();
+                messages.Append( KVCXMYVideosTestMessageCollectionOpened );
+                CleanupClosePushL( messages );
+                WaitForMessagesL( ETrue, messages, 60, ETrue );
+                CleanupStack::PopAndDestroy( &messages );
+                iTester->SetAutomaticRefresh( ETrue );
+                }
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosCollectionPluginTest::EnsureDriveForVideosL
+// Delete everything from sideloading folders.
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::EnsureDriveForVideosL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::EnsureDriveForVideosL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In EnsureDriveForVideosL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+    
+    // Parameter drive letter
+    TPtrC driveLetter;
+    User::LeaveIfError(aItem.GetNextString(driveLetter));
+    
+    TInt drive(0);
+    if( driveLetter == _L("anydrive") )
+        {
+        drive = -1;
+        }
+    else
+        {
+        User::LeaveIfError( iFs.CharToDrive( driveLetter[0], drive ) );
+        VCXLOGLO3("CVCXMyVideosCollectionPluginTest:: drive: %S = %d", &driveLetter, drive );
+        }    
+    
+    TInt amount(0);
+    User::LeaveIfError( aItem.GetNextInt( amount ) );
+    
+    TInt videoCount = iTester->GetVideoCountForDrive( drive );
+    
+    TInt err( KErrNone );
+    
+    if( videoCount < amount )
+        {
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest::EnsureDriveForVideosL: drive has less than %d videos.", amount);
+        
+        // Parameter path and filename
+        TPtrC filename;
+        User::LeaveIfError(aItem.GetNextString(filename));
+        if(filename.Length() < 64)
+            {
+            VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: filename: %S", &filename);
+            }
+        
+        TInt createCount = amount - videoCount;
+        
+        TRAP( err, CreateVideoFileL( 
+                CIptvTestVideoCreator::IptvTestVideoMpeg4, driveLetter, filename, -1, createCount, ETrue ) );    
+        }
+    else
+    if( videoCount > amount )
+        {
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest::EnsureDriveForVideosL: drive has more than %d videos.", amount);
+
+        TInt deleteCount = videoCount - amount;
+
+        TRAP_IGNORE( iTester->EnsureMediaFilesAreNotInUseL() );
+        TRAP( err, iTester->DeleteMediasL( drive, 0, deleteCount, EFalse ) );
+
+        if( err == KErrNone )
+            {
+            // Wait for deletion to complete.
+            RArray<TInt> messages;
+            CleanupClosePushL( messages );
+            messages.Append( KVCXMYVideosTestMessageDeleteResp );
+            messages.Append( KVCXMYVideosTestMessageCommandComplete );
+            messages.Append( KVCXMYVideosTestMessageDeleteStarted );
+    
+            TInt timeout = deleteCount*5 + 60;
+    
+            TRAP_IGNORE( WaitForMessagesL( ETrue, messages, timeout, ETrue ) ); 
+            CleanupStack::PopAndDestroy( &messages );
+            }
+        }
+    else
+        {
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest::EnsureDriveForVideosL: drive already has %d videos.", amount);
+        }
+        
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::EnsureDriveForVideosL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosCollectionPluginTest::EmptySideloadFoldersL
+// Delete everything from sideloading folders.
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::EmptySideloadFoldersL( CStifItemParser& /*aItem*/ )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::EmptySideloadFoldersL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In EmptySideloadFoldersL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: Sideloaded file count: %d", iSideloadedFiles.Count());
+
+    if( iSideloadedFiles.Count() <= 0 )
+        {
+        VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::EmptySideloadFoldersL <----------");
+        return KErrNone;
+        }
+
+    RPointerArray<HBufC> filesInUse;
+    CleanupResetAndDestroyPushL( filesInUse );
+
+    iLastReceivedMessage = -1;
+
+    TInt i;
+    // Delete files
+    for(i=iSideloadedFiles.Count()-1; i>=0; i--)
+        {
+        HBufC16* path = iSideloadedFiles[i];
+        CleanupStack::PushL( path );
+        iSideloadedFiles.Remove( i );
+
+        TInt err = iFs.Delete( path->Des() );
+        if( err == KErrInUse )
+            {
+            CleanupStack::Pop( path );
+            filesInUse.Append( path );
+            }
+        else
+            {
+            CleanupStack::PopAndDestroy( path );
+            if( err != KErrNone )
+                {
+                VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: delete error: %d", err);
+                }
+            }
+        }
+
+    // Try again deleting files which were in use
+    for( i = filesInUse.Count()-1; i >= 0; i--)
+        {
+        HBufC16* path = filesInUse[i];
+        CleanupStack::PushL( path );
+        filesInUse.Remove( i );
+
+        // Delete file
+        iTestCommon->EnsureFileIsNotInUse( *path );
+        TInt err = iFs.Delete( path->Des() );
+        if( err != KErrNone )
+            {
+            VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: delete 2nd error: %d", err);
+            }
+
+        CleanupStack::PopAndDestroy( path );
+        }
+
+    CleanupStack::PopAndDestroy( &filesInUse );
+    
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::EmptySideloadFoldersL <----------");
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::SetDeleteSideloadedVideos
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::SetDeleteSideloadedVideos( CStifItemParser& /* aItem */ )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::SetDeleteSideloadedVideos ---------->");
+    iDeleteSideloadedFilesAndFolders = ETrue;
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::SetDeleteSideloadedVideos <----------");
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::DownloadL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::DownloadL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::DownloadL ---------->");
+    iLastReceivedMessage = -1;
+    TRAPD( err, DownloadOrResumeL( aItem, EFalse, EFalse ) );
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::DownloadL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::ResumeDownloadL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::ResumeDownloadL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::ResumeDownloadL ---------->");
+    iLastReceivedMessage = -1;
+    TRAPD( err, DownloadOrResumeL( aItem, EFalse, ETrue ) );
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::ResumeDownloadL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::ResumeAllDownloadsL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::ResumeAllDownloadsL( CStifItemParser& /* aItem */ )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::ResumeAllDownloadsL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In ResumeAllDownloadsL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    TRAPD( err, iTester->ResumeAllDownloadsL() );
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::ResumeAllDownloadsL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::DownloadUsingMediaL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::DownloadUsingMediaL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::DownloadUsingMediaL ---------->");
+
+    if( !iMpxMedia )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Error. iMpxMedia not set!");
+        User::Leave( KErrArgument );
+        }
+
+    iLastReceivedMessage = -1;
+
+    TRAPD( err, DownloadOrResumeL( aItem, ETrue, EFalse ) );
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::DownloadUsingMediaL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::ResumeDownloadUsingMediaL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::ResumeDownloadUsingMediaL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::ResumeDownloadUsingMediaL ---------->");
+
+    if( !iMpxMedia )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Error. iMpxMedia not set!");
+        User::Leave( KErrArgument );
+        }
+
+    iLastReceivedMessage = -1;
+
+    TRAPD( err, DownloadOrResumeL( aItem, ETrue, ETrue ) );
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::ResumeDownloadUsingMediaL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::DownloadOrResumeL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTest::DownloadOrResumeL( CStifItemParser& aItem, TBool aUseCurrentMedia, TBool aResume )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::DownloadOrResumeL");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In DownloadOrResumeL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+
+    iLastReceivedMessage = -1;
+
+    TUint32 iapId(0);
+    TPtrC iapName;
+    User::LeaveIfError( aItem.GetNextString( iapName ) );
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: iapName: %S", &iapName);
+
+    if( iapName == KVCXTestZeroIap )
+        {
+        iapId = 0;
+        }
+    else
+    if( iapName == KVCXTestInvalidIap )
+        {
+        iapId = 10001;
+        }
+    else
+        {
+        User::LeaveIfError( iTestCommon->GetIapIdL(iapName, iapId) );
+        }
+
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: iapId: %d", iapId);
+
+    TPtrC serviceName;
+    User::LeaveIfError( aItem.GetNextString( serviceName ) );
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: serviceName: %S", &serviceName);
+
+    TInt serviceId(0);
+    User::LeaveIfError( iServiceEmu->GetServiceIdL(serviceName, serviceId) );
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: serviceId: %d", serviceId);
+
+    TInt contentId(0);
+    User::LeaveIfError( aItem.GetNextInt( contentId ) );
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: contentId: %d", contentId);
+
+    TInt syncCallInt(0);
+    User::LeaveIfError( aItem.GetNextInt( syncCallInt ) );
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: callTypeInt: %d", syncCallInt);
+    TBool syncCall = static_cast<TBool>(syncCallInt);
+
+    TPtrC userName;
+    if( KErrNone == aItem.GetNextString( userName ) )
+        {
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: userName: %S", &userName);
+        }
+    else
+        {
+        userName.Set( _L("") );
+        }
+
+    TPtrC password;
+    if( KErrNone == aItem.GetNextString( password ) )
+        {
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: password: %S", &password);
+        }
+    else
+        {
+        password.Set( _L("") );
+        }
+
+    const TPtrC url = iServiceEmu->GetContentUrlL( serviceId, contentId );
+    const TPtrC title = iServiceEmu->GetContentTitleL( serviceId, contentId );
+
+    TInt err(0);
+    if( !aUseCurrentMedia )
+        {
+        if( !aResume )
+            {
+            TRAP( err, iTester->StartDownloadL( title, iapId, serviceId, contentId, url, syncCall, userName, password, NULL ) );
+            }
+        else
+            {
+            TRAP( err, iTester->ResumeDownloadL( title, iapId, serviceId, contentId, url, syncCall, userName, password, NULL ) );
+            }
+        }
+    else
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: passing current media to MPX plugin.");
+        if( !aResume )
+            {
+            TRAP( err, iTester->StartDownloadL( title, iapId, serviceId, contentId, url, syncCall, userName, password, iMpxMedia ) );
+            }
+        else
+            {
+            TRAP( err, iTester->ResumeDownloadL( title, iapId, serviceId, contentId, url, syncCall, userName, password, iMpxMedia ) );
+            }
+        }
+
+    // Set autoresume on if there's only one paused download.
+    CVCXMyVideosTestDlWatcher* dlWatcher = iTester->GetDownloadWatcher();
+    if( aResume && dlWatcher && !iAutoResume )
+        {
+        TInt pausedDlCount = 0;
+        for( TInt i=0; i<dlWatcher->GetDownloadCount(); i++ ) 
+            {
+            CVCXMyVideosTestDownload* dl = dlWatcher->GetDownloadByIndex( i );
+            if( dl->iState == EVcxMyVideosDlStatePaused )
+                {
+                pausedDlCount++;
+                }
+            }
+            if( pausedDlCount == 1 ) 
+                {
+                iAutoResume = ETrue;
+                iTester->SetAutoResume( ETrue );
+                }
+        }
+    
+    if( err != KErrNone )
+        {
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err);
+        User::Leave( err );
+        }
+    
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::DownloadOrResumeL");
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::DownloadUrlL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::DownloadUrlL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::DownloadUrlL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In DownloadUrlL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    iLastReceivedMessage = -1;
+
+    aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+
+    TUint32 iapId(0);
+    TPtrC iapName;
+    User::LeaveIfError( aItem.GetNextString( iapName ) );
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: iapName: %S", &iapName);
+    User::LeaveIfError( iTestCommon->GetIapIdL(iapName, iapId) );
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: iapId: %d", iapId);
+
+    TPtrC url;
+    User::LeaveIfError( aItem.GetNextString( url ) );
+    
+    TInt syncCallInt(0);
+    User::LeaveIfError( aItem.GetNextInt( syncCallInt ) );
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: callTypeInt: %d", syncCallInt);
+    TBool syncCall = static_cast<TBool>(syncCallInt);
+
+    TPtrC userName;
+    if( KErrNone == aItem.GetNextString( userName ) )
+        {
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: userName: %S", &userName);
+        }
+    else
+        {
+        userName.Set( _L("") );
+        }
+
+    TPtrC password;
+    if( KErrNone == aItem.GetNextString( password ) )
+        {
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: password: %S", &password);
+        }
+    else
+        {
+        password.Set( _L("") );
+        }
+
+    if( url == KVCXTestZeroUrl)
+        {
+        url.Set( _L("" ) );
+        }
+
+    TInt err( KErrNone );
+    
+    if( iTester )
+        {
+        if( url == KVCXMYVideosTest2kURLTag )
+            {
+            TRAP( err, iTester->StartDownloadL( _L("2kcharsurl"), iapId, 0, 0, KVCXMYVideosTest2kURL, syncCall, userName, password, NULL ) );
+            }
+        else
+        if( url == KVCXMYVideosTest1kURLTag )
+            {
+            TRAP( err, iTester->StartDownloadL( _L("1kcharsurl"), iapId, 0, 0, KVCXMYVideosTest1kURL, syncCall, userName, password, NULL ) );
+            }
+        else
+            {
+            TRAP( err, iTester->StartDownloadL( _L("urldl"), iapId, 0, 0, url, syncCall, userName, password, NULL ) );
+            }
+        }
+
+    if( err != KErrNone )
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err);
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::DownloadUrlL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::CancelDownloadL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::CancelDownloadL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CancelDownloadL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In CancelDownloadL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    iLastReceivedMessage = -1;
+
+    aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+
+    TPtrC serviceName;
+    User::LeaveIfError( aItem.GetNextString( serviceName ) );
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: serviceName: %S", &serviceName);
+
+    TInt serviceId(0);
+    User::LeaveIfError( iServiceEmu->GetServiceIdL(serviceName, serviceId) );
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: serviceId: %d", serviceId);
+
+    TInt contentId(0);
+    User::LeaveIfError( aItem.GetNextInt( contentId ) );
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: contentId: %d", contentId);
+
+    TInt syncCallInt(0);
+    User::LeaveIfError( aItem.GetNextInt( syncCallInt ) );
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: callTypeInt: %d", syncCallInt);
+    TBool syncCall = static_cast<TBool>(syncCallInt);
+
+    const TPtrC url = iServiceEmu->GetContentUrlL( serviceId, contentId );
+
+    CVCXMyVideosTestDownload* dl = iTester->GetDownloadWatcher()->GetDownload( serviceId, contentId, url );
+
+    TInt err( KErrNotReady );
+    if( !dl )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Could not find download with specified params!");
+        }
+    else
+    if( iTester )
+        {
+        TRAP( err, iTester->CancelDownloadL( dl, syncCall ) );
+        }
+
+    if( err != KErrNone )
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err);
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CancelDownloadL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::CancelDownloadByIdL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::CancelDownloadByIdL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CancelDownloadByIdL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In CancelDownloadByIdL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    iLastReceivedMessage = -1;
+
+    aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+
+    TInt mpxId(0);
+    User::LeaveIfError( aItem.GetNextInt( mpxId ) );
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: mpxId: %d", mpxId);
+
+    TInt downloadId(0);
+    User::LeaveIfError( aItem.GetNextInt( downloadId ) );
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: downloadId: %d", downloadId);
+
+    TInt syncCallInt(0);
+    User::LeaveIfError( aItem.GetNextInt( syncCallInt ) );
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: callTypeInt: %d", syncCallInt);
+    TBool syncCall = static_cast<TBool>(syncCallInt);
+
+    _LIT(KVCxTestEmptyString, "NULL");
+    TPtrC downloadPath;
+    if( aItem.GetNextString( downloadPath ) != KErrNone )
+        {
+        downloadPath.Set( KVCxTestEmptyString );
+        }
+
+    TInt err( KErrNotReady );
+    if( iTester )
+        {
+        TRAP( err, iTester->CancelDownloadL( mpxId, downloadId, downloadPath, syncCall ) );
+        }
+
+    if( err != KErrNone )
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err);
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CancelDownloadByIdL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::PauseDownloadL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::PauseDownloadL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::PauseDownloadL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In PauseDownloadL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    iLastReceivedMessage = -1;
+
+    aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+
+    TPtrC serviceName;
+    User::LeaveIfError( aItem.GetNextString( serviceName ) );
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: serviceName: %S", &serviceName);
+
+    TInt serviceId(0);
+    User::LeaveIfError( iServiceEmu->GetServiceIdL(serviceName, serviceId) );
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: serviceId: %d", serviceId);
+
+    TInt contentId(0);
+    User::LeaveIfError( aItem.GetNextInt( contentId ) );
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: contentId: %d", contentId);
+
+    TInt syncCallInt(0);
+    User::LeaveIfError( aItem.GetNextInt( syncCallInt ) );
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: callTypeInt: %d", syncCallInt);
+    TBool syncCall = static_cast<TBool>(syncCallInt);
+
+    const TPtrC url = iServiceEmu->GetContentUrlL( serviceId, contentId );
+
+    TInt err( KErrNotReady );
+    if( iTester )
+        {
+        // Disable autoresume
+        iAutoResume = EFalse;
+        iTester->SetAutoResume( iAutoResume );
+
+        TRAP( err, iTester->PauseDownloadL( serviceId, contentId, url, syncCall ) );
+        }
+
+    if( err != KErrNone )
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err);
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::PauseDownloadL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::PauseDownloadByUrlL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::PauseDownloadByUrlL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::PauseDownloadByUrlL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In PauseDownloadByUrlL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    iLastReceivedMessage = -1;
+
+    aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+
+    TPtrC url;
+    User::LeaveIfError( aItem.GetNextString( url ) );
+
+    TInt err( KErrNotReady );
+    if( iTester )
+        {
+        // Disable autoresume
+        iAutoResume = EFalse;
+        iTester->SetAutoResume( iAutoResume );
+
+        TRAP( err, iTester->PauseDownloadL( url, EFalse ) );
+        }
+
+    if( err != KErrNone )
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err);
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::PauseDownloadL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::CheckDownloadProgressL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::CheckDownloadProgressL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CheckDownloadProgressL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In CheckDownloadProgressL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    iLastReceivedMessage = -1;
+
+    aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+
+    TPtrC serviceName;
+    User::LeaveIfError( aItem.GetNextString( serviceName ) );
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: serviceName: %S", &serviceName);
+
+    TInt serviceId(0);
+    User::LeaveIfError( iServiceEmu->GetServiceIdL(serviceName, serviceId) );
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: serviceId: %d", serviceId);
+
+    TInt contentId(0);
+    User::LeaveIfError( aItem.GetNextInt( contentId ) );
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: contentId: %d", contentId);
+
+    TInt minimumProgress( 0 );
+    User::LeaveIfError( aItem.GetNextInt( minimumProgress ) );
+
+    const TPtrC url = iServiceEmu->GetContentUrlL( serviceId, contentId );
+
+    CVCXMyVideosTestDlWatcher* dlWatcher = iTester->GetDownloadWatcher();
+
+    TInt err( KErrNotReady );
+
+    if( dlWatcher )
+        {
+        CVCXMyVideosTestDownload* dl = dlWatcher->GetDownload( serviceId, contentId, url );
+
+        if( dl )
+            {
+            if( dl->iProgress < minimumProgress )
+                {
+                err = KErrCorrupt;
+                }
+            else
+                {
+                err = KErrNone;
+                }
+            }
+        }
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CheckDownloadProgressL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::WaitAllDownloadsL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::WaitAllDownloadsL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::WaitAllDownloadsL ---------->");
+    // Print to UI
+    _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
+    _LIT( KWhere, "In WaitAllDownloadsL" );
+    TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    TInt err( KErrNone );
+
+    TInt minutes(0);
+    if( aItem.GetNextInt( minutes ) != KErrNone )
+        {
+        minutes = 10;
+        }
+    iTimeoutTimer->After( KTimeoutMinute * minutes );
+
+    iWaitingForAllDownloads = ETrue;
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::WaitAllDownloadsL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::WaitForMessageL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::WaitForMessageL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::WaitForMessageL ---------->");
+
+    _LIT( KWhere, "In WaitForMessageL" );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    TInt message(0);
+    User::LeaveIfError( aItem.GetNextInt( message ) );
+
+    TInt timeout(0);
+    User::LeaveIfError( aItem.GetNextInt( timeout ) );
+
+    TInt count(0);
+    if( aItem.GetNextInt( count ) != KErrNone )
+        {
+        count = 1;
+        }
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: count: %d", count);
+
+    _LIT(KWhat,"MsgWait");
+    _LIT(KDesc, "All: %d");
+    TestModuleIf().Printf( 0, KWhat, KDesc, count );
+    
+    RArray<TInt> messages;
+
+    iWaitedTestMessages.Reset();
+    for( TInt i=0; i<count; i++ )
+        {
+        messages.Append( message );
+        }
+
+    TRAPD( err, WaitForMessagesL( EFalse, messages, timeout, ETrue ) );
+    
+    messages.Reset();
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::WaitForMessageL <----------");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::WaitForAnyMessageL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::WaitForAnyMessageL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::WaitForAnyMessageL ---------->");
+    // Print to UI
+    _LIT( KWhere, "In WaitForAnyMessageL" );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    TInt timeout(0);
+    User::LeaveIfError( aItem.GetNextInt( timeout ) );
+
+    RArray<TInt> messages;
+
+    TInt message(0);
+    TInt error = KErrNone;
+    while( error == KErrNone )
+        {
+        error = aItem.GetNextInt( message );
+        if( error == KErrNone )
+            {
+            messages.Append( message );
+            }
+        }
+
+    _LIT(KWhat,"MsgWait");
+    _LIT(KDesc, "Any: %d");
+    TestModuleIf().Printf( 0, KWhat, KDesc, messages.Count() );
+
+    if( error != KErrNone && error != KErrNotFound )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Error reading parameters from script.");
+        }
+    else
+        {
+        TRAP( error, WaitForMessagesL( EFalse, messages, timeout, EFalse ) );
+        }
+
+    messages.Reset();
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::WaitForAnyMessageL <----------");
+    return VCXMVTEST_ERR( error );
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::WaitForMessagesL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::WaitForMessagesL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::WaitForMessagesL ---------->");
+    // Print to UI
+    _LIT( KWhere, "In WaitForMessagesL" );
+    // Print to log file
+    iLog->Log( KWhere );
+
+    TInt timeout(0);
+    User::LeaveIfError( aItem.GetNextInt( timeout ) );
+
+    RArray<TInt> messages;
+
+    TInt message(0);
+    TInt error = KErrNone;
+    while( error == KErrNone )
+        {
+        error = aItem.GetNextInt( message );
+        if( error == KErrNone )
+            {
+            messages.Append( message );
+            }
+        }
+
+    _LIT(KWhat,"MsgWait");
+    _LIT(KDesc, "All: %d");
+    TestModuleIf().Printf( 0, KWhat, KDesc, messages.Count() );
+    
+    if( error != KErrNone && error != KErrNotFound )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Error reading parameters from script.");
+        }
+    else
+        {
+        TRAP( error, WaitForMessagesL( EFalse, messages, timeout, ETrue ) );
+        }
+
+    messages.Reset();
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::WaitForMessagesL <----------");
+    return VCXMVTEST_ERR( error );
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::WaitForMessagesL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTest::WaitForMessagesL( TBool aBlock, RArray<TInt>& aMessages, TInt aTimeout,
+        TBool aWaitAll )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::WaitForMessagesL 2");
+    if( aMessages.Count() <= 0 )
+        {
+        User::Leave( KErrArgument );
+        }
+
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: Timeout: %d seconds", aTimeout);
+
+    iWaitingForAllMessages = aWaitAll;
+
+    iMessageWaitTimeout = aTimeout;
+    iTimeoutTimer->After( aTimeout * KTimeoutSecond );
+
+    iWaitedTestMessages.Reset();
+
+    TBool messageReceivedAlready( EFalse );
+
+    for( TInt i=0; i<aMessages.Count(); i++ )
+        {
+        TBuf<256> msgStr;
+        GetMessageDesc( aMessages[i], msgStr);
+
+        VCXLOGLO3("CVCXMyVideosCollectionPluginTest:: MsgQueue: wait: %S (%d)", &msgStr, aMessages[i]);
+
+        iWaitedTestMessages.Append( aMessages[i] );
+
+        if( aMessages[i] == iLastReceivedMessage )
+            {
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Received this message already.");
+            iLastReceivedMessage = -1;
+
+            HandleVcxMvTesterMessageL( aMessages[i], KErrNone );
+            messageReceivedAlready = ETrue;
+            }
+        }
+
+    if( aBlock && !messageReceivedAlready )
+        {
+        iMessageWaitIsBlocking = ETrue;
+        iActiveWaitBlocking->Start();
+        iMessageWaitIsBlocking = EFalse;
+        
+        // Only leave if it was blocking call.
+        TInt error( iEventError );
+        iEventError = KErrNone;
+        User::LeaveIfError( error );
+        }
+    
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::WaitForMessagesL 2");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosCollectionPluginTest::DeleteDirectoryIfEmpty()
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::DeleteDirectoryIfEmpty( RFs& aFs, CFileMan& aFileMan, const TDesC& aDirectory )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::DeleteDirectoryIfEmpty");
+    CDir* dirList = NULL;
+
+    TInt result = aFs.GetDir( aDirectory, KEntryAttNormal | KEntryAttMatchMask, ESortByName, dirList );
+    if( result != KErrNone ) VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: getdir result: %d", result );
+    if( result == KErrNone && dirList->Count() == 0 )
+        {
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: deleting folder: %S", &aDirectory );
+        TInt err(KErrNone);
+        err = aFileMan.RmDir( aDirectory );
+        if( err != KErrNone )
+            VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: delete error: %d", err );
+        }
+
+    delete dirList;
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::DeleteDirectoryIfEmpty");
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::MapMpxMediaAttribute
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::MapMpxMediaAttribute(
+        TVcxTestMediaAttributeIdMapping aMapping, TMPXAttributeData& aAttribute, TVcxTestMediaAttributeType& aType )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::MapMpxMediaAttribute");
+
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: mapping id: %d", aMapping);
+
+    aAttribute.iAttributeId = 0;
+    aAttribute.iContentId = 0;
+
+    switch( aMapping )
+        {
+        case EVcxTestMapping_KMPXMediaGeneralId:
+            {
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: KMPXMediaGeneralId");
+            aAttribute = KMPXMediaGeneralId;
+            aType = EVcxTestMediaAttributeTypeTMPXItemId;
+            }
+        break;
+
+        case EVcxTestMapping_KMPXMediaGeneralTitle:
+            {
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: KMPXMediaGeneralTitle");
+            aAttribute = KMPXMediaGeneralTitle;
+            aType = EVcxTestMediaAttributeTypeString;
+            }
+            break;
+
+        case EVcxTestMapping_KMPXMediaGeneralComment:
+            {
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: KMPXMediaGeneralComment");
+            aAttribute = KMPXMediaGeneralComment;
+            aType = EVcxTestMediaAttributeTypeString;
+            }
+            break;
+
+        case EVcxTestMapping_KMPXMediaGeneralUri:
+            {
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: KMPXMediaGeneralUri");
+            aAttribute = KMPXMediaGeneralUri;
+            aType = EVcxTestMediaAttributeTypeString;
+            }
+            break;
+
+        case EVcxTestMapping_KMPXMediaGeneralSize:
+            {
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: KMPXMediaGeneralSize");
+            aAttribute = KMPXMediaGeneralSize;
+            aType = EVcxTestMediaAttributeTypeTInt;
+            }
+            break;
+
+        case EVcxTestMapping_KMPXMediaGeneralExtSizeInt64:
+            {
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: KMPXMediaGeneralExtSizeInt64");
+            aAttribute = KMPXMediaGeneralExtSizeInt64;
+            aType = EVcxTestMediaAttributeTypeTInt64;
+            }
+            break;            
+            
+        case EVcxTestMapping_KMPXMediaGeneralDate:
+            {
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: KMPXMediaGeneralDate");
+            aAttribute = KMPXMediaGeneralDate;
+            aType = EVcxTestMediaAttributeTypeTInt64;
+            }
+            break;
+
+        case EVcxTestMapping_KMPXMediaGeneralFlags:
+            {
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: KMPXMediaGeneralFlags");
+            aAttribute = KMPXMediaGeneralFlags;
+            aType = EVcxTestMediaAttributeTypeMvFlags;
+            }
+            break;
+
+        case EVcxTestMapping_KMPXMediaGeneralCopyright:
+            {
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: KMPXMediaGeneralCopyright");
+            aAttribute = KMPXMediaGeneralCopyright;
+            aType = EVcxTestMediaAttributeTypeString;
+            }
+            break;
+
+        case EVcxTestMapping_KMPXMediaGeneralMimeType:
+            {
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: KMPXMediaGeneralMimeType");
+            aAttribute = KMPXMediaGeneralMimeType;
+            aType = EVcxTestMediaAttributeTypeString;
+            }
+            break;
+
+        case EVcxTestMapping_KVcxMediaMyVideosModifiedDate:
+            {
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: KVcxMediaMyVideosModifiedDate");
+            aAttribute = KVcxMediaMyVideosModifiedDate;
+            aType = EVcxTestMediaAttributeTypeTInt64;
+            }
+            break;
+
+        case EVcxTestMapping_KVcxMediaMyVideosModifiedDateCurrent:
+            {
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: KVcxMediaMyVideosModifiedDate");
+            aAttribute = KVcxMediaMyVideosModifiedDate;
+            aType = EVcxTestMediaAttributeTypeTTime;
+            }
+            break;
+
+        case EVcxTestMapping_KVcxMediaMyVideosAgeProfile:
+            {
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: KVcxMediaMyVideosAgeProfile");
+            aAttribute = KVcxMediaMyVideosAgeProfile;
+            aType = EVcxTestMediaAttributeTypeTInt32;
+            }
+            break;
+
+        case EVcxTestMapping_KVcxMediaMyVideosAudioLanguage:
+            {
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: KVcxMediaMyVideosAudioLanguage");
+            aAttribute = KVcxMediaMyVideosAudioLanguage;
+            aType = EVcxTestMediaAttributeTypeString;
+            }
+            break;
+
+        case EVcxTestMapping_KVcxMediaMyVideosAuthor:
+            {
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: KVcxMediaMyVideosAuthor");
+            aAttribute = KVcxMediaMyVideosAuthor;
+            aType = EVcxTestMediaAttributeTypeString;
+            }
+            break;
+
+        case EVcxTestMapping_KVcxMediaMyVideosOrigin:
+            {
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: KVcxMediaMyVideosOrigin");
+            aAttribute = KVcxMediaMyVideosOrigin;
+            aType = EVcxTestMediaAttributeTypeTUint8;
+            }
+            break;
+
+        case EVcxTestMapping_KVcxMediaMyVideosDuration:
+            {
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: KVcxMediaMyVideosDuration");
+            aAttribute = KVcxMediaMyVideosDuration;
+            aType = EVcxTestMediaAttributeTypeTReal32;
+            }
+            break;
+
+        case EVcxTestMapping_KMPXMediaGeneralLastPlaybackPosition:
+            {
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: KMPXMediaGeneralLastPlaybackPosition");
+            aAttribute = KMPXMediaGeneralLastPlaybackPosition;
+            aType = EVcxTestMediaAttributeTypeTInt;
+            }
+            break;
+
+        case EVcxTestMapping_KVcxMediaMyVideosDownloadId:
+            {
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: KVcxMediaMyVideosDownloadId");
+            aAttribute = KVcxMediaMyVideosDownloadId;
+            aType = EVcxTestMediaAttributeTypeTUint32;
+            }
+            break;
+
+        case EVcxTestMapping_KVcxMediaMyVideosRemoteUrl:
+            {
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: KVcxMediaMyVideosRemoteUrl");
+            aAttribute = KVcxMediaMyVideosRemoteUrl;
+            aType = EVcxTestMediaAttributeTypeString;
+            }
+            break;
+
+        case EVcxTestMapping_KVcxMediaMyVideosDownloadState:
+            {
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: KVcxMediaMyVideosDownloadState");
+            aAttribute = KVcxMediaMyVideosDownloadState;
+            aType = EVcxTestMediaAttributeTypeTUint8;
+            }
+            break;
+
+        case EVcxTestMapping_KVcxMediaMyVideosIapId:
+            {
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: KVcxMediaMyVideosIapId");
+            aAttribute = KVcxMediaMyVideosIapId;
+            aType = EVcxTestMediaAttributeTypeTUint32;
+            }
+            break;
+
+        case EVcxTestMapping_KVcxMediaMyVideosUsername:
+            {
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: KVcxMediaMyVideosUsername");
+            aAttribute = KVcxMediaMyVideosUsername;
+            aType = EVcxTestMediaAttributeTypeString;
+            }
+            break;
+
+        case EVcxTestMapping_KVcxMediaMyVideosPassword:
+            {
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: KVcxMediaMyVideosPassword");
+            aAttribute = KVcxMediaMyVideosPassword;
+            aType = EVcxTestMediaAttributeTypeString;
+            }
+            break;
+
+        case EVcxTestMapping_KVcxMediaMyVideosCommandId:
+            {
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: KVcxMediaMyVideosCommandId");
+            aAttribute = KVcxMediaMyVideosCommandId;
+            aType = EVcxTestMediaAttributeTypeTUint;
+            }
+            break;
+
+        case EVcxTestMapping_KVcxMediaMyVideosDownloadProgress:
+            {
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: KVcxMediaMyVideosDownloadProgress");
+            aAttribute = KVcxMediaMyVideosDownloadProgress;
+            aType = EVcxTestMediaAttributeTypeTInt8;
+            }
+            break;
+
+        case EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount:
+            {
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: KVcxMediaMyVideosCategoryItemCount");
+            aAttribute = KVcxMediaMyVideosCategoryItemCount;
+            aType = EVcxTestMediaAttributeTypeTUint32;
+            }
+            break;
+
+        case EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount:
+            {
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: KVcxMediaMyVideosCategoryNewItemCount");
+            aAttribute = KVcxMediaMyVideosCategoryNewItemCount;
+            aType = EVcxTestMediaAttributeTypeTUint32;
+            }
+            break;
+
+        case EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName:
+            {
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: KVcxMediaMyVideosCategoryNewItemName");
+            aAttribute = KVcxMediaMyVideosCategoryNewItemName;
+            aType = EVcxTestMediaAttributeTypeString;
+            }
+            break;
+
+        case EVcxTestMapping_KVcxMediaMyVideosAudioFourCc:
+            {
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: KVcxMediaMyVideosCategoryNewItemName");
+            aAttribute = KVcxMediaMyVideosAudioFourCc;
+            aType = EVcxTestMediaAttributeTypeTUint32;
+            }
+            break;
+        }
+
+    VCXLOGLO3("CVCXMyVideosCollectionPluginTest:: iAttributeId: %d, iContentId: %d", aAttribute.iAttributeId == 0, aAttribute.iContentId);
+
+    TInt err( KErrNone );
+    if( aAttribute.iAttributeId == 0 && aAttribute.iContentId == 0 )
+        {
+        err = KErrNotFound;
+        }
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::MapMpxMediaAttribute");
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::GetMessageDesc
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTest::GetMessageDesc( TInt aMessage, TDes& aMsgBuff )
+    {
+    switch( aMessage )
+        {
+        case KVCXMYVideosTestMessageNotAccepted:
+            {
+            aMsgBuff.Copy( _L("KVCXMYVideosTestMessageNotAccepted") );
+            }
+            break;
+
+        case KVCXMYVideosTestMessageDlSucceeded:
+            {
+            aMsgBuff.Copy( _L("KVCXMYVideosTestMessageDlSucceeded") );
+            }
+            break;
+        case KVCXMYVideosTestMessageDlFailed:
+            {
+            aMsgBuff.Copy( _L("KVCXMYVideosTestMessageDlFailed") );
+            }
+            break;
+        case KVCXMYVideosTestMessageDlPaused:
+            {
+            aMsgBuff.Copy( _L("KVCXMYVideosTestMessageDlPaused") );
+            }
+            break;
+        case KVCXMYVideosTestMessageDlGeneral:
+            {
+            aMsgBuff.Copy( _L("KVCXMYVideosTestMessageDlGeneral") );
+            }
+            break;
+        case KVCXMYVideosTestMessageDlRunning:
+            {
+            aMsgBuff.Copy( _L("KVCXMYVideosTestMessageDlRunning") );
+            }
+            break;
+        case KVCXMYVideosTestMessageDlCanceled:
+            {
+            aMsgBuff.Copy( _L("KVCXMYVideosTestMessageDlCanceled") );
+            }
+            break;
+        case KVCXMYVideosTestMessageDlProgressed:
+            {
+            aMsgBuff.Copy( _L("KVCXMYVideosTestMessageDlProgressed") );
+            }
+            break;
+        case KVCXMYVideosTestMessageCollectionMessageError:
+            {
+            aMsgBuff.Copy( _L("KVCXMYVideosTestMessageCollectionMessageError") );
+            }
+            break;
+        case KVCXMYVideosTestMessageCollectionOpened:
+            {
+            aMsgBuff.Copy( _L("KVCXMYVideosTestMessageCollectionOpened") );
+            }
+            break;
+        case KVCXMYVideosTestMessagePlaylistOpened:
+            {
+            aMsgBuff.Copy( _L("KVCXMYVideosTestMessagePlaylistOpened") );
+            }
+            break;
+        case KVCXMYVideosTestMessageCollectionMedia:
+            {
+            aMsgBuff.Copy( _L("KVCXMYVideosTestMessageCollectionMedia") );
+            }
+            break;
+        case KVCXMYVideosTestMessageCommandComplete:
+            {
+            aMsgBuff.Copy( _L("KVCXMYVideosTestMessageCommandComplete") );
+            }
+            break;
+        case KVCXMYVideosTestMessageGotMediasByKMpxId:
+            {
+            aMsgBuff.Copy( _L("KVCXMYVideosTestMessageGotMediasByKMpxId") );
+            }
+            break;
+        case KVCXMYVideosTestMessageMoveResp:
+            {
+            aMsgBuff.Copy( _L("KVCXMYVideosTestMessageMoveResp") );
+            }
+            break;
+        case KVCXMYVideosTestMessageCopyResp:
+            {
+            aMsgBuff.Copy( _L("KVCXMYVideosTestMessageCopyResp") );
+            }
+            break;
+        case KVCXMYVideosTestMessageCopyOrMoveStarted:
+            {
+            aMsgBuff.Copy( _L("KVCXMYVideosTestMessageCopyOrMoveStarted") );
+            }
+            break;
+        case KVCXMYVideosTestMessageDeleteStarted:
+            {
+            aMsgBuff.Copy( _L("KVCXMYVideosTestMessageDeleteStarted") );
+            }
+            break;
+        case KVCXMYVideosTestMessageDeleteResp:
+            {
+            aMsgBuff.Copy( _L("KVCXMYVideosTestMessageDeleteResp") );
+            }
+            break;
+        case KVCXMYVideosTestMessageCommandCanceled:
+            {
+            aMsgBuff.Copy( _L("KVCXMYVideosTestMessageCommandCanceled") );
+            }
+            break;
+        case KVCXMYVideosTestMessageCollectionGeneral:
+            {
+            aMsgBuff.Copy( _L("KVCXMYVideosTestMessageCollectionGeneral") );
+            }
+            break;
+        case KVCXMYVideosTestMessageCollectionItemChanged:
+            {
+            aMsgBuff.Copy( _L("KVCXMYVideosTestMessageCollectionItemChanged") );
+            }
+            break;
+        case KVCXMYVideosTestMessageCollectionCategoryChanged:
+            {
+            aMsgBuff.Copy( _L("KVCXMYVideosTestMessageCollectionCategoryChanged") );
+            }
+            break;
+        case KVCXMYVideosTestMessageMpxItemInserted:
+            {
+            aMsgBuff.Copy( _L("KVCXMYVideosTestMessageMpxItemInserted") );
+            }
+            break;
+        case KVCXMYVideosTestMessageMpxItemDeleted:
+            {
+            aMsgBuff.Copy( _L("KVCXMYVideosTestMessageMpxItemDeleted") );
+            }
+            break;
+        case KVCXMYVideosTestMessageMpxItemModified:
+            {
+            aMsgBuff.Copy( _L("KVCXMYVideosTestMessageMpxItemModified") );
+            }
+            break;
+        case KVCXMyVideosTestMessageVideoListOrderChanged:
+            {
+            aMsgBuff.Copy( _L("KVCXMyVideosTestMessageVideoListOrderChanged") );
+            }
+            break;
+        case KVCXMYVideosTestErrorDownloadNotFound:
+            {
+            aMsgBuff.Copy( _L("KVCXMYVideosTestErrorDownloadNotFound") );
+            }
+            break;
+        case KVCXMYVideosTestErrorFileNotFound:
+            {
+            aMsgBuff.Copy( _L("KVCXMYVideosTestErrorFileNotFound") );
+            }
+            break;
+
+        default:
+            {
+            aMsgBuff.Copy( _L("") );
+            }
+            break;
+
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::CheckMediasL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTest::CheckMediasL( TInt aExpectedVideoCount, TInt aDrive, TInt aCheckType )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CheckMediasL");
+
+    TInt actualVideoCount(0);
+
+    // File check
+    TInt videoCount = iTester->GetMediaCount();
+
+    // attribute check that they are in allowed values
+
+    for( TInt i = videoCount-1; i >= 0; i-- )
+        {
+        CMPXMedia* media = iTester->GetMediaL( -1, i );
+
+        if( media->IsSupported( KMPXMediaGeneralUri ) )
+            {
+            TMPXItemId itemId  = *( media->Value<TMPXItemId>( KMPXMediaGeneralId ) );
+
+            const TDesC& localFilePath = media->ValueText( KMPXMediaGeneralUri );
+
+            // Drive specified
+            if( aDrive != -1 )
+                {
+                TInt drive(0);
+                User::LeaveIfError( iFs.CharToDrive( localFilePath[0], drive ) );
+                // Don't count/check this file.
+                if( drive != aDrive )
+                    {
+                    continue;
+                    }
+                }
+
+            actualVideoCount++;
+
+            TInt state = -1;
+            if( media->IsSupported( KVcxMediaMyVideosDownloadState ) )
+                {
+                state = media->ValueTObjectL<TUint8>( KVcxMediaMyVideosDownloadState );
+                }
+
+            TUint32 downloadId = 0;
+            if( media->IsSupported( KVcxMediaMyVideosDownloadId ) )
+                {
+                downloadId = media->ValueTObjectL<TUint32>( KVcxMediaMyVideosDownloadId );
+                }
+
+            // No file check for ongoing downloads
+            if( !iFileCheckDisabled && ( downloadId == 0 || state == EVcxMyVideosDlStateDownloaded ) )
+                {
+                if( !iFs.IsValidName( localFilePath ) )
+                    {
+                    VCXLOGLO1("CVCXMyVideosCollectionPluginTest: ERROR. File path is not valid.");
+                    VCXLOGLO2("Local file path: %S", &localFilePath);
+                    User::Leave( KErrCorrupt );
+                    }
+
+                if( !BaflUtils::FileExists( iFs, localFilePath ) )
+                    {
+                    VCXLOGLO2("CVCXMyVideosCollectionPluginTest: ERROR. File doesn't exist! Mpx id: %d", itemId.iId1);
+                    VCXLOGLO2("Local file path: %S", &localFilePath);
+                    User::Leave( KErrGeneral );
+                    }
+
+                for( TInt e = videoCount-1; e >= 0; e-- )
+                    {
+                    CMPXMedia* media2 = iTester->GetMediaL( -1, e );
+                    TMPXItemId itemId2 = *( media2->Value<TMPXItemId>( KMPXMediaGeneralId ) );
+                    if( media2->IsSupported( KMPXMediaGeneralUri ) )
+                        {
+                        const TDesC& localFilePath2 = media2->ValueText( KMPXMediaGeneralUri );
+
+                        TCollationMethod cm = *Mem::CollationMethodByIndex( 0 );
+                        cm.iFlags |= TCollationMethod::EFoldCase;
+
+                        if( localFilePath.CompareC( localFilePath2, 0, &cm ) == KErrNone && itemId.iId1 != itemId2.iId1 )
+                            {
+                            VCXLOGLO3("CVCXMyVideosCollectionPluginTest: ERROR. 2 items with same path! Mpx id: %d & id: %d", itemId.iId1, itemId2.iId1);
+                            User::Leave( KErrGeneral );
+                            }
+                        }
+                    }
+                }
+            }
+        }
+
+    _LIT(KWhat,"CountCheck");
+    _LIT(KDesc, "%d/%d");
+    TestModuleIf().Printf( 0, KWhat, KDesc, actualVideoCount, aExpectedVideoCount);
+
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTest: Actual count: %d", actualVideoCount );
+
+    if( aCheckType < 0 )
+        {
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest: Minimum count: %d", aExpectedVideoCount );
+
+        if ( actualVideoCount < aExpectedVideoCount )
+            {
+            User::Leave( KErrGeneral );
+            }
+        }
+    else
+    if( aCheckType > 0 )
+        {
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest: Maximum count: %d", aExpectedVideoCount );
+
+        if ( actualVideoCount > aExpectedVideoCount )
+            {
+            User::Leave( KErrGeneral );
+            }
+        }
+    else
+        {
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest: Expected count: %d", aExpectedVideoCount );
+
+        if ( aExpectedVideoCount + iAddMediaCmdCount != actualVideoCount )
+            {
+            User::Leave( KErrGeneral );
+            }
+        }
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CheckMediasL");
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::GetDriveParam
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTest::GetDriveParam( CStifItemParser& aItem, TInt& aDrive )
+    {
+    aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+
+    TPtrC driveLetter;
+    TInt err = aItem.GetNextString( driveLetter );
+    if( err == KErrNone )
+        {
+        if( driveLetter == _L("anydrive") )
+            {
+            aDrive = -1;
+            }
+        else
+            {
+            err = iFs.CharToDrive( driveLetter[0], aDrive );
+            VCXLOGLO3("CVCXMyVideosCollectionPluginTest:: drive: %S = %d", &driveLetter, aDrive );
+            }
+        }
+
+    return VCXMVTEST_ERR( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::DoTotalRefreshL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTest::DoTotalRefreshL()
+    {
+    if( iTester && iTester->GetCurrentLevel() == 3 )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Close & Open ------>");
+
+        TInt currentOpenLevelIndex = iTester->GetCurrentOpenLevelIndex();
+
+        // Close current level
+        TRAPD( err, iTester->CloseLevelL() );
+        if( err == KErrNone ) 
+        	{
+        	WaitForRefreshL( ETrue );
+        	}
+
+        // Open it again
+        TRAP( err, iTester->OpenLevelL( currentOpenLevelIndex ) );
+        if( err == KErrNone ) 
+        	{
+        	WaitForRefreshL( ETrue );
+        	}
+
+        
+        // And refresh
+        TRAP( err, iTester->RefreshContentsL() );
+        if( err == KErrNone ) 
+        	{
+        	WaitForRefreshL( ETrue );
+        	}
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::WaitForRefreshL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTest::WaitForRefreshL( TBool aForcedWait )
+    {
+    if( iTester && ( iTester->IsRefreshing() || aForcedWait ) )
+        {
+        RArray<TInt> messages;
+        messages.Append( KVCXMYVideosTestMessageCollectionOpened );
+        CleanupClosePushL( messages );
+        WaitForMessagesL( ETrue, messages, 10, ETrue );
+        CleanupStack::PopAndDestroy( &messages );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::GetMediasForLevelL
+// -----------------------------------------------------------------------------
+//
+CMPXMediaArray* CVCXMyVideosCollectionPluginTest::GetMediasForLevelL( TInt aLevel, TUint aFlagsFilter )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::GetMediasForLevelL ---------->");
+
+    iLastReceivedMessage = -1;
+
+    TInt prevCurrentLevel = iTester->GetCurrentLevel();
+    TInt prevOpenLevelIndex = iTester->GetCurrentOpenLevelIndex();
+    
+    TInt error( KErrNotReady );
+    
+    TBool wrongLevelOpen = ( prevCurrentLevel == 3 && prevOpenLevelIndex != aLevel );
+    TBool levelNotOpen = ( prevCurrentLevel >= 2 );
+    
+    if( wrongLevelOpen || levelNotOpen )
+        {
+        RArray<TInt> messages;
+        CleanupClosePushL( messages );
+        if( !levelNotOpen )
+            {
+            // Close current level.
+            messages.Append( KVCXMYVideosTestMessageCollectionOpened );
+            TRAP( error, iTester->CloseLevelL() );
+            if( error == KErrNone )
+                {
+                WaitForMessagesL( ETrue, messages, 10, ETrue );
+                }
+            messages.Reset();
+            }
+            
+        // Open the wanted level.
+        messages.Append( KVCXMYVideosTestMessageCollectionOpened );
+        TRAP( error, iTester->OpenLevelL( aLevel ) );
+        if( error == KErrNone )
+            {
+            WaitForMessagesL( ETrue, messages, 30, ETrue );
+            }
+        
+        CleanupStack::PopAndDestroy( &messages );
+        }
+
+    // Get the medias.
+    const CMPXMediaArray* collectionMediaArray = iTester->GetAllCollectionMedia();
+    
+    CMPXMediaArray* medias = CMPXMediaArray::NewL();
+    
+    for( TInt i = 0; i < collectionMediaArray->Count(); i++ )
+        {
+        CMPXMedia* media = (*collectionMediaArray)[i];
+        // Default flags is none if item does not have the detail.
+        TInt flags( 0 ); 
+        if( media->IsSupported( KMPXMediaGeneralFlags ) )
+            {
+            flags = *media->Value<TUint>( KMPXMediaGeneralFlags );
+            }
+        // No flags specified or it matches with medias flags
+        TBool fagsMatch = static_cast<TBool>( flags & aFlagsFilter );
+        if( !aFlagsFilter || fagsMatch )
+            {
+            if( media->IsSupported( KMPXMediaGeneralTitle ) )
+                {
+                const TDesC& title = media->ValueText( KMPXMediaGeneralTitle );
+                VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: Adding media: %S", &title);
+                }
+            
+            medias->AppendL( *media );
+            }
+        }
+    
+    if( levelNotOpen || wrongLevelOpen )
+        {
+        // Close current level.        
+        TRAP( error, iTester->CloseLevelL() );
+        if( error == KErrNone )
+            {
+            RArray<TInt> messages;
+            CleanupClosePushL( messages );
+            messages.Append( KVCXMYVideosTestMessageCollectionOpened );
+            WaitForMessagesL( ETrue, messages, 10, ETrue );
+            CleanupStack::PopAndDestroy( &messages );
+            }
+
+        // Open the previous level.
+        if( wrongLevelOpen ) 
+            {
+            TRAP( error, iTester->OpenLevelL( prevOpenLevelIndex ) );
+            if( error == KErrNone )
+                {
+                RArray<TInt> messages;
+                CleanupClosePushL( messages );
+                messages.Append( KVCXMYVideosTestMessageCollectionOpened );
+                WaitForMessagesL( ETrue, messages, 30, ETrue );
+                CleanupStack::PopAndDestroy( &messages );
+                }
+            }
+        }
+    
+    User::LeaveIfError( error );
+    
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::GetMediasForLevelL <----------");
+    return medias;
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvMyVideosApiTest::HandleVcxMvTesterMessageL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTest::HandleVcxMvTesterMessageL( TInt aMessage, TInt aError )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::HandleVcxMvTesterMessageL");
+
+    TBuf<256> msgStr;
+    GetMessageDesc( aMessage, msgStr);
+
+    iLastReceivedMessage = aMessage;
+    
+    VCXLOGLO4("CVCXMyVideosCollectionPluginTest:: MsgQueue: received: %S (%d), aError: %d", &msgStr, aMessage, aError);
+
+    // Tester requires to abort test run.
+    if( aMessage == KVCXMYVideosTestMessageCollectionGeneral && aError == KErrAbort ) 
+        {
+        iEventError = aError;
+        Signal( aError );
+        VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::HandleVcxMvTesterMessageL");
+        return;
+        }
+
+    // Print info about video count to STIF UI.
+    if( aMessage == KVCXMYVideosTestMessageCollectionOpened ||
+        aMessage == KVCXMYVideosTestMessageListComplete ||
+        aMessage == KVCXMYVideosTestMessageCollectionOpened ||
+        aMessage == KVCXMYVideosTestMessageGotMediasByKMpxId )
+        {
+        _LIT(KWhat, "VidCount");
+        _LIT(KDesc, "%d");
+        TInt videoCount = iTester->GetMediaCount();
+        TestModuleIf().Printf( 0, KWhat, KDesc, videoCount );
+        }
+
+
+    // Waiting for messages from mpx plugin to stop.
+    if( iCoolDownWait )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: MsgQueue: Cooling down.");
+        iCoolDownTimer->After( KTimeoutSecond * 5 );
+        VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::HandleVcxMvTesterMessageL");
+        return;
+        }    
+    
+    if( aMessage == KVCXMYVideosTestMessageDlSucceeded ||
+        aMessage == KVCXMYVideosTestMessageDlFailed ||
+        aMessage == KVCXMYVideosTestMessageDlPaused ||
+        aMessage == KVCXMYVideosTestMessageDlGeneral ||
+        aMessage == KVCXMYVideosTestErrorDownloadNotFound )
+        {
+        TInt activeDownloads = iTester->GetActiveDownloadCountL();
+        TInt downloads = iTester->GetDownloadWatcher()->GetDownloadCount();
+        _LIT(KWhat, "Downloads");
+        _LIT(KDesc, "%d/%d");
+        TestModuleIf().Printf( 0, KWhat, KDesc, activeDownloads, downloads );
+
+        if( aError != KErrNone )
+            {
+            iLastDownloadError = aError;
+            }        
+        }
+    
+    // Inform script of paused download when auto resume is off.
+    if( !iWaitingForAllDownloads && aMessage == KVCXMYVideosTestMessageDlPaused && !iAutoResume )
+        {
+        // Add message to waited list and continue processing, check for signaling is done later.
+        iWaitedTestMessages.Reset();
+        iWaitedTestMessages.AppendL( aMessage );
+        }
+    
+    // Waiting for all downloads to complete. Check downloads and signal if needed.
+    if( iWaitingForAllDownloads )
+        {
+        TInt activeDownloads = iTester->GetActiveDownloadCountL();
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: Ongoing download count: %d", activeDownloads);
+        
+        if( activeDownloads <= 0 )
+            {
+            iTimeoutTimer->CancelTimer();
+            iWaitingForAllDownloads = EFalse;
+
+            TInt downloadCount = iTester->GetDownloadWatcher()->GetDownloadCount();
+            TInt maxFailsToSucceed = downloadCount / 3;
+            TInt fails = iTester->GetDownloadWatcher()->GetFailedDownloadCount();
+
+            if( maxFailsToSucceed <= 0 )
+                {
+                maxFailsToSucceed = 0;
+                }
+
+            VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: download count: %d", downloadCount);
+            VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: failed download count: %d", fails);
+            VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: max allowed fails: %d", maxFailsToSucceed);
+
+            if( fails > maxFailsToSucceed )
+                {
+                if( iLastDownloadError != KErrNone )
+                    {
+                    iEventError = iLastDownloadError;
+                    }
+                else
+                    {
+                    iEventError = KVCXMYVideosTestMessageDlFailed;
+                    }
+                }
+            else
+                {
+                iEventError = KErrNone;
+                }
+
+            // Add message to waited list and continue processing, check for signaling is done later.
+            iWaitedTestMessages.Reset();
+            iWaitedTestMessages.AppendL( aMessage );
+            }
+        }
+
+    // See if there's cancel needed for move, copy or delete.
+    if( aError == KErrNone && iCancelNextOperation )
+        {
+        if( aMessage == KVCXMYVideosTestMessageCopyOrMoveStarted )
+            {
+            TRAP( aError, iTester->CancelMoveOrCopyL( ETrue ) );
+            }
+
+        if( aMessage == KVCXMYVideosTestMessageDeleteStarted )
+            {
+            TRAP( aError, iTester->CancelDeleteL( ETrue ) );
+            iCancelNextOperation = EFalse;
+            }
+        }
+
+    // Check for errors. 
+    if( aError != KErrNone && !iWaitingForAllDownloads )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: ----------> MsgQueue: Error: %d <----------", aError);
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
+
+        iLastReceivedMessage = 0;
+        if( !iMessageWaitIsBlocking )
+            {
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: ----------> MsgQueue: Signaling <----------");
+            Signal( VCXMVTEST_ERR( aError ) );
+            TestModuleIf().Printf( 0, _L("Signal"), _L("%d"), aError );
+            iEventError = KErrNone;
+            }
+        else
+            {
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: ----------> MsgQueue: Stop wait <----------");
+            iActiveWaitBlocking->Stop();
+            iEventError = aError;
+            }
+
+        VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::HandleVcxMvTesterMessageL");
+        return;
+        }
+
+    // Signal script if message is waited for. 
+    for( TInt i = 0; i < iWaitedTestMessages.Count(); i++ )
+        {
+        if( aMessage == iWaitedTestMessages[i] )
+            {
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: MsgQueue: found from wait queue.");
+            iWaitedTestMessages.Remove(i);
+
+            TBool doSignal = EFalse;
+
+            // Signal for any matching message.
+            if( !iWaitingForAllMessages )
+                {
+                VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: MsgQueue: Waiting any message, signal ok.");
+                doSignal = ETrue;
+                }
+            // Signal if all messages have been received.
+            else
+                {
+                if( iWaitedTestMessages.Count() >= 0 )
+                    {
+                    _LIT(KWhat,"MsgWait");
+                    _LIT(KDesc, "Left: %d");
+                    TestModuleIf().Printf( 0, KWhat, KDesc, iWaitedTestMessages.Count() );
+                    }
+
+                VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: MsgQueue: %d messages left in queue.", iWaitedTestMessages.Count() );
+                if( iWaitedTestMessages.Count() == 0 )
+                    {
+                    doSignal = ETrue;
+                    }
+                else
+                    {
+                    // Restart the timeout for next message.
+                    iTimeoutTimer->Cancel();
+                    iTimeoutTimer->After( iMessageWaitTimeout * KTimeoutSecond );
+                    break;
+                    }
+                }
+
+            if( doSignal )
+                {
+                iWaitedTestMessages.Reset();
+
+                if( iEventError != KErrNone )
+                    {
+                    VCXLOGLO1( "CVCXMyVideosCollectionPluginTest:: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
+                    VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: ----------> MsgQueue: Error: %d <---------", iEventError);
+                    VCXLOGLO1( "CVCXMyVideosCollectionPluginTest:: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
+                    }
+
+                if( !iMessageWaitIsBlocking )
+                    {
+                    VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: ----------> MsgQueue: Signaling <----------");
+                    Signal( VCXMVTEST_ERR( iEventError ) );
+                    TestModuleIf().Printf( 0, _L("Signal"), _L("%d"), iEventError );
+                    iEventError = KErrNone;
+                    }
+                else
+                    {
+                    VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: ----------> MsgQueue: Stop wait <----------");
+                    iActiveWaitBlocking->Stop();
+                    }
+
+                iTimeoutTimer->CancelTimer();
+                iLastReceivedMessage = 0;
+                break;
+                }
+            }
+        }
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::HandleVcxMvTesterMessageL");
+    }
+
+// -----------------------------------------------------------------------------
+// CIptvEpgEngineTest::TimerComplete
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTest::TimerComplete(TInt aTimerId, TInt aError)
+    {
+    if( aTimerId == 0 )
+        {
+        if( iActiveWaitBlocking )
+            iActiveWaitBlocking->Stop();
+        
+        if( aError == KErrNone )
+            {
+            VCXLOGLO2( "CVCXMyVideosCollectionPluginTest::TimerComplete: TESTCASE TIMEOUT -------> Last error from events: %d.", 
+                    iEventError );
+
+            iEventError = ( iEventError != KErrNone ? iEventError : KErrTimedOut );
+            
+            // Script is waiting for signal.
+            if( !iMessageWaitIsBlocking )
+                {
+                VCXLOGLO2( "CVCXMyVideosCollectionPluginTest:: Signaling: %d", iEventError);
+                Signal( VCXMVTEST_ERR( iEventError ) );
+                }
+            
+            TRAP_IGNORE( iStats->ActionEndL( 0, iEventError ) );
+
+            TestModuleIf().Printf( 0, _L("Timedout"), _L("%d"), iEventError );
+            }
+        }
+
+    if( aTimerId == 1 )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTest::TimerComplete: Cooldown done. ------->");
+        iActiveWait->Stop();
+        iCoolDownWait = EFalse;
+
+        iWaitingForAllDownloads = EFalse;
+        iWaitedTestMessages.Reset();
+        iLastReceivedMessage = 0;
+        }
+    }
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/src/VCXMyVideosCollectionPluginTester.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,3383 @@
+/*
+* Copyright (c) 2002 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:   ?Description*
+*/
+
+
+// INCLUDE FILES
+#include <e32svr.h>
+#include <e32std.h>
+#include <StifParser.h>
+#include <Stiftestinterface.h>
+#include <mmf/common/mmfcontrollerpluginresolver.h> // CleanupResetAndDestroyPushL
+
+#include <e32cons.h>
+#include <mpxcollectionutility.h>
+#include <mpxmediacontainerdefs.h>
+#include <mpxmediageneraldefs.h>
+#include <mpxmediageneralextdefs.h>
+#include <mpxmessagegeneraldefs.h>
+#include <mpxcollectionmessagedefs.h>
+#include <mpxcollectionpath.h>
+#include <mpxmessage2.h>
+#include <mpxcollectionmessage.h>
+#include <mpxmessagecontainerdefs.h>
+#include <mpxmediabase.h>
+#include <mpxcommandgeneraldefs.h>
+#include <mpxcollectioncommanddefs.h>
+
+#include "VCXTestCommon.h"
+#include "VCXTestLog.h"
+#include "CIptvTestTimer.h"
+#include "CIptvTestActiveWait.h"
+#include "VCXTestStatsKeeper.h"
+
+#include "VCXMyVideosCollectionPluginTester.h"
+#include "VCXMyVideosTestDlWatcher.h"
+#include "VCXMyVideosTestCommon.h"
+
+#include "vcxmyvideoscollection.hrh"
+#include "vcxmyvideosmdsdb.h"
+#include "vcxmyvideosdefs.h"
+
+// CONSTANTS
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosCollectionPluginTester::NewL
+// -----------------------------------------------------------------------------
+//
+CVCXMyVideosCollectionPluginTester* CVCXMyVideosCollectionPluginTester::NewL(
+            MVCXMyVideosCollectionPluginTesterObserver* aObserver, CVCXTestCommon* aTestCommon, CVCXTestStatsKeeper* aStatsKeeper )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTester::NewL");
+    CVCXMyVideosCollectionPluginTester* self = 
+        new (ELeave) CVCXMyVideosCollectionPluginTester( aObserver, aTestCommon, aStatsKeeper );
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::NewL");
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosCollectionPluginTester::CVCXMyVideosCollectionPluginTester
+// -----------------------------------------------------------------------------
+//
+CVCXMyVideosCollectionPluginTester::CVCXMyVideosCollectionPluginTester( 
+        MVCXMyVideosCollectionPluginTesterObserver* aObserver,
+        CVCXTestCommon* aTestCommon, CVCXTestStatsKeeper* aStatsKeeper )
+ : iObserver( aObserver ), iTestCommon( aTestCommon ), iStats( aStatsKeeper )
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosCollectionPluginTester::~CVCXMyVideosCollectionPluginTester
+// -----------------------------------------------------------------------------
+//
+CVCXMyVideosCollectionPluginTester::~CVCXMyVideosCollectionPluginTester( )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTester::~CVCXMyVideosCollectionPluginTester");
+
+    if( iProgressTimer )
+        {
+        iProgressTimer->CancelTimer();
+        delete iProgressTimer;
+        iProgressTimer = NULL;
+        }
+
+    delete iDlWatcher;
+    iDlWatcher = NULL;
+
+    if( iCollectionUtility )
+        {
+        iCollectionUtility->Close();
+        }
+    iCollectionUtility = NULL;
+    
+    delete iCollectionEntries;
+    iCollectionEntries = NULL;
+
+    if( iOldMediaArray )
+        {
+        iOldMediaArray->Reset();
+        delete iOldMediaArray;
+        iOldMediaArray = NULL;
+        }
+
+    if( iMediaArray )
+        {
+        iMediaArray->Reset();
+        delete iMediaArray;
+        iMediaArray = NULL;
+        }
+
+    iFs.Close();
+
+    if( iActiveWait )
+        {
+        iActiveWait->Stop();
+        delete iActiveWait;
+        iActiveWait = NULL;
+        }
+
+    iRequestedMediaIds.Close();
+
+    if( iFullMedia )
+        {
+        delete iFullMedia;
+        iFullMedia = NULL;
+        }
+
+    iInsertedItemIds.Close();
+    iDeletedItemIds.Close();
+
+    delete iCurrentLevelName;
+    iCurrentLevelName = NULL;
+    
+    iTransactions->CheckTransactions();
+    delete iTransactions;
+    iTransactions = NULL;
+    
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::~CVCXMyVideosCollectionPluginTester");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosCollectionPluginTester::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::ConstructL()
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTester::ConstructL");
+    iAutomaticContentRefresh = ETrue;
+
+    iActiveWait = CIptvTestActiveWait::NewL();
+    User::LeaveIfError( iFs.Connect() );
+    
+    iTransactions = CVCXMyVideosTestTransactions::NewL();
+    iCollectionUtility = MMPXCollectionUtility::NewL( this, KMcModeIsolated );
+    iDlWatcher = CVCXMyVideosTestDlWatcher::NewL( iObserver, iStats );
+    iUpdateDownloads = ETrue;
+    iCurrentOpenedLevelIndex = -1;
+    iProgressTimer = CIptvTestTimer::NewL( *this, 0 );
+    iProgressTimer->After( 1000000 );
+    
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::ConstructL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosCollectionPluginTester::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::OpenCollectionL( TUint32 aCollectionUid )
+    {
+    VCXLOGLO2(">>>CVCXMyVideosCollectionPluginTester::OpenCollectionL (%d)", this);
+    
+    CMPXCollectionPath* path = CMPXCollectionPath::NewL();
+    CleanupStack::PushL( path );
+    iCollectionUid = TUid::Uid( aCollectionUid );
+    path->AppendL( aCollectionUid );
+    
+    TRAP_IGNORE( iStats->ActionStartL( KOpenCollectionActionId, _L("Open collection") ) );
+    iCurrentActionHasResponse = EFalse;
+    iCurrentActionId = KOpenCollectionActionId;
+    SetRefreshStatus( ETrue );
+    
+    iCollectionUtility->Collection().OpenL( *path );
+    
+    CleanupStack::PopAndDestroy( path );
+    
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::OpenCollectionL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosCollectionPluginTester::OpenLevelL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::OpenLevelL( TInt aIndex )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTester::OpenLevelL");
+
+    if( GetCurrentLevel() != 2 )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: Error. My videos collection must be open!");
+        User::Leave( KErrGeneral );
+        }
+
+    if( aIndex < 0 || aIndex > iMediaArray->Count() )
+        {
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTester:: Error. Index (%d) out of bounds!", aIndex);
+        User::Leave( KErrGeneral );
+        }
+
+    // Save the name of level
+
+    CMPXMedia* media(NULL);
+    media = (*iMediaArray)[aIndex];
+
+    if( media->IsSupported( KMPXMediaGeneralTitle ) )
+        {
+        delete iCurrentLevelName;
+        iCurrentLevelName = NULL;
+        iCurrentLevelName = media->ValueText( KMPXMediaGeneralTitle ).AllocL();
+        }
+
+    // Open the level
+    TRAP_IGNORE( iStats->ActionStartL( KOpenCollectionLevelActionId, _L("Open level") ) );
+    iCurrentActionHasResponse = EFalse;
+    iCurrentActionId = KOpenCollectionLevelActionId;
+    
+    iCollectionUtility->Collection().OpenL( aIndex );
+    
+    iCurrentOpenedLevelIndex = aIndex;
+    SetRefreshStatus( ETrue );
+    
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::OpenLevelL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosCollectionPluginTester::RefreshContentsL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::RefreshContentsL()
+    {
+    //VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTester::RefreshContentsL");
+
+    // No need to refresh if My Videos category is not open.
+    if( GetCurrentLevel() != 3)
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: No refresh because level.");
+        return;
+        }
+
+    // Wait previous refresh to complete.
+    if( IsRefreshing() )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: Refresh already active.");
+        return;
+        }
+
+    VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: ----------------------------");
+    VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: Refreshing video list ----->");
+    VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: ----------------------------");
+
+    TRAP_IGNORE( iStats->ActionStartL( KRefreshCollectionActionId, _L("Refreshing collection") ) );
+    iCurrentActionHasResponse = EFalse;
+    iCurrentActionId = KRefreshCollectionActionId;
+    iCollectionUtility->Collection().OpenL();
+    SetRefreshStatus( ETrue );
+
+    //VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::RefreshContentsL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosCollectionPluginTester::GetMediasByMpxIdL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::GetMediasByMpxIdL( TInt aStartIndex, TInt aEndIndex, TBool aSync )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTester::GetMediasByMpxIdL");
+
+    if ( iCollectionUid.iUid == 0 )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: Error, collection must be opened!");
+        VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::GetMediasByMpxIdL");
+        User::Leave( KErrNotReady );
+        }
+
+    if( IsRefreshing() )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: Refresh already active.");
+        VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::GetMediasByMpxIdL");
+        return;
+        }
+    
+    CMPXCommand* cmd( NULL );
+    
+    cmd = CreateMpxCommandLC( KVcxCommandIdMyVideos, KVcxCommandMyVideosGetMediasByMpxId, aSync );    
+    
+    CMPXMediaArray* requestedMediaObjects = SelectMediasL( -1, aStartIndex, aEndIndex );
+    CleanupStack::PushL( requestedMediaObjects );
+
+    if( requestedMediaObjects )
+        {
+        cmd->SetCObjectValueL( KMPXMediaArrayContents, requestedMediaObjects );
+        cmd->SetTObjectValueL( KMPXMediaArrayCount, requestedMediaObjects->Count() );
+        }
+
+    VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: Doing request.");
+    iActionCount++;
+    TRAP_IGNORE( iStats->ActionStartL( iTransactions->TransactionId(), _L("Get medias by MPX ID") ) );
+    iCurrentActionHasResponse = ETrue;
+    iCollectionUtility->Collection().CommandL( *cmd );
+
+    SetRefreshStatus( ETrue );
+
+    CleanupStack::PopAndDestroy( requestedMediaObjects );
+    CleanupStack::PopAndDestroy( cmd );
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::GetMediasByMpxIdL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosCollectionPluginTester::GetMediaFullDetailsL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::GetMediaFullDetailsL( TInt aDrive, TInt aIndex )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTester::GetMediaFullDetailsL");
+
+    if( GetCurrentLevel() < 2 )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: Error. My videos category must be open!");
+        User::Leave( KErrGeneral );
+        }
+
+    TInt realIndex = GetMediaIndexInCollectionL( aDrive, aIndex );
+
+    RArray<TMPXAttribute> attrs;
+    CleanupClosePushL(attrs);
+    // Empty attributes to get all the details.
+    CMPXCollectionPath* path = iCollectionUtility->Collection().PathL();
+    CleanupStack::PushL( path );
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTester:: Selecting %d", realIndex);
+    path->SelectL( realIndex );
+    TRAP_IGNORE( iStats->ActionStartL( KGetMediaFullDetailsActionId, _L("Get media full details") ) );
+    iCurrentActionHasResponse = EFalse;
+    iCollectionUtility->Collection().MediaL( *path, attrs.Array() );
+    CleanupStack::PopAndDestroy( path );
+    CleanupStack::PopAndDestroy( &attrs );
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::GetMediaFullDetailsL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosCollectionPluginTester::GetMediaFullDetailsByMpxIdL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::GetMediaFullDetailsByMpxIdL( TInt aDrive, TInt aIndex, TBool aSync )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTester::GetMediaFullDetailsByMpxIdL");
+
+    if( GetCurrentLevel() < 2 )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: Error. My videos category must be open!");
+        User::Leave( KErrGeneral );
+        }
+
+    TInt realIndex = GetMediaIndexInCollectionL( aDrive, aIndex );
+    CMPXMedia* media = media = (*iCollectionMediaArray)[realIndex];
+    TMPXItemId itemId = *(media->Value<TMPXItemId>( KMPXMediaGeneralId ));
+    
+    CMPXCommand* cmd( NULL );
+
+    cmd = CreateMpxCommandLC( KVcxCommandIdMyVideos, KVcxCommandMyVideosGetMediaFullDetailsByMpxId, aSync );    
+    cmd->SetTObjectValueL( KMPXMediaGeneralId, itemId );    
+    TRAP_IGNORE( iStats->ActionStartL( KGetMediaFullDetailsActionId, _L("Get media full details by MPX ID") ) );
+    iCollectionUtility->Collection().CommandL( *cmd );
+    
+    iCurrentActionHasResponse = EFalse;
+    
+    CleanupStack::PopAndDestroy( cmd );
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::GetMediaFullDetailsByMpxIdL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosCollectionPluginTester::CloseLevelL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::CloseLevelL( )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTester::CloseLevelL");
+
+    if( GetCurrentLevel() <= 1 )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: Error. Cannot go back from root level!");
+        User::Leave( KErrGeneral );
+        }
+
+    iCurrentOpenedLevelIndex = -1;
+
+    delete iCurrentLevelName;
+    iCurrentLevelName = NULL;
+
+    iCollectionUtility->Collection().BackL();
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::CloseLevelL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosCollectionPluginTester::ProcessCurrentEntriesL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::ProcessCurrentEntriesL()
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTester::ProcessCurrentEntriesL");
+
+    if( GetCurrentLevel() > 0 )
+        {
+        if( iMediaArray )
+            {
+            if( !iQuietMode )
+                {
+                if( !iCurrentLevelName )
+                    {
+                    PrintMediasL( iMediaArray, ETrue, _L("Collection") );
+                    }
+                else
+                    {
+                    PrintMediasL( iMediaArray, ETrue, *iCurrentLevelName );
+                    }
+                }
+
+            // Update download states and info
+            if( GetCurrentLevel() == 3 && iUpdateDownloads && iDownloadsStarted )
+                {
+                UpdateDownloadsL( iQuietMode );
+                }
+            }
+        else
+            {
+            VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester:: iMediaArray is NULL");
+            }
+        }
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::ProcessCurrentEntriesL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::UpdateDownloadsL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::UpdateDownloadsL( TBool aQuietMode )
+    {
+    if( !iMediaArray || !iDlWatcher )
+        {
+        return;
+        }
+
+    if( !aQuietMode )
+        VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTester::UpdateDownloadsL ---------->");
+
+    iDlWatcher->PrepareCheck();
+
+    // Print short info about downloads
+    CMPXMedia* media( NULL );
+
+    for( TInt i = 0; i < iMediaArray->Count(); i++ )
+        {
+        media = (*iMediaArray)[i];
+
+        // If it's download then get info about it and update download watcher.
+        if( media->IsSupported( KVcxMediaMyVideosDownloadState ) )
+            {
+            TInt state = media->ValueTObjectL<TUint8>( KVcxMediaMyVideosDownloadState );
+
+            TMPXItemId itemId = *(media->Value<TMPXItemId>( KMPXMediaGeneralId ));
+
+            HBufC* titleBuff = NULL;
+            HBufC* urlBuff = NULL;
+            HBufC* pathBuff = NULL;
+
+            if( media->IsSupported( KMPXMediaGeneralUri ) )
+                {
+                const TDesC& url = media->ValueText( KMPXMediaGeneralUri );
+                pathBuff = url.AllocL();
+                CleanupStack::PushL( pathBuff );
+                }
+
+            if( media->IsSupported( KMPXMediaGeneralTitle ) )
+                {
+                const TDesC& title = media->ValueText( KMPXMediaGeneralTitle );
+                titleBuff = title.AllocL();
+                CleanupStack::PushL( titleBuff );
+                }
+
+            if( media->IsSupported( KVcxMediaMyVideosRemoteUrl ) )
+                {
+                const TDesC& url = media->ValueText( KVcxMediaMyVideosRemoteUrl );
+                urlBuff = url.AllocL();
+                CleanupStack::PushL( urlBuff );
+                }
+
+            TInt progress = 0;
+            if( media->IsSupported( KVcxMediaMyVideosDownloadProgress ) )
+                {
+                progress = media->ValueTObjectL<TInt8>( KVcxMediaMyVideosDownloadProgress );
+                }
+
+            TUint32 downloadId = 0;
+            if( media->IsSupported( KVcxMediaMyVideosDownloadId ) )
+                {
+                downloadId = media->ValueTObjectL<TUint32>( KVcxMediaMyVideosDownloadId );
+                }
+
+            TInt downloadError = 0;
+            if( media->IsSupported( KVcxMediaMyVideosDownloadError ) )
+                {
+                downloadError = media->ValueTObjectL<TInt32>( KVcxMediaMyVideosDownloadError );
+                }
+
+            TInt globalError = 0;
+            if( media->IsSupported( KVcxMediaMyVideosDownloadGlobalError ) )
+                {
+                globalError = media->ValueTObjectL<TInt32>( KVcxMediaMyVideosDownloadGlobalError );
+                }
+
+            CVCXMyVideosTestDownload* dl = iDlWatcher->GetDownloadByMpxId( itemId.iId1 );
+
+            if( !dl )
+                {
+                // Tell dl watcher that dl has started. 
+                if( state != EVcxMyVideosDlStateNone )
+                    {
+                    iDlWatcher->StartDownloadL( *urlBuff, *pathBuff, downloadId, itemId.iId1, *titleBuff,
+                            static_cast<TVcxMyVideosDownloadState>( state ), progress );
+                    }
+                }
+            else
+                {
+                // Update download. 
+                    iDlWatcher->UpdateDownloadStateL( itemId.iId1, downloadId, 
+                            static_cast<TVcxMyVideosDownloadState>( state ), progress, 
+                            downloadError, globalError );
+                    
+                }
+            
+            if( state == EVcxMyVideosDlStatePaused && iAutoResume )
+                {
+                if( dl && !dl->iWaitingResume )
+                    {
+                    VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: <---------- Autoresuming the paused download. ---------->");
+                    ResumeDownloadL( _L("resume"), dl->iIapId, dl->iServiceId, dl->iContentId, *dl->iUrl, dl->iSyncCall, *dl->iUserName, *dl->iPassword, NULL );
+                    iDlWatcher->SetDownloadResumedFlagL( itemId.iId1, downloadId );
+                    dl->iWaitingPause = EFalse;
+                    VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: <---------- Resume ok ---------->");
+                    }
+                }
+
+            if( urlBuff )
+                {
+                CleanupStack::PopAndDestroy( urlBuff );
+                }
+            if( titleBuff )
+                {                
+                CleanupStack::PopAndDestroy( titleBuff );
+                }
+            if( pathBuff )
+                {                       
+                CleanupStack::PopAndDestroy( pathBuff );
+                }
+            }
+        }
+
+    if( !aQuietMode )
+        {
+        iDlWatcher->PrintDownloads();
+        }
+
+    iDlWatcher->FinishCheckL();
+    if( !aQuietMode )
+        VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::UpdateDownloadsL <----------");
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::CreateMpxCommandLC
+// -----------------------------------------------------------------------------
+//
+CMPXCommand* CVCXMyVideosCollectionPluginTester::CreateMpxCommandLC( TInt aCommandGeneralId, TInt aMyVideosCommandId, TBool aSync )
+    {
+    CMPXCommand* cmd = CMPXCommand::NewL();
+    CleanupStack::PushL( cmd );
+
+    cmd->SetTObjectValueL( KMPXCommandGeneralId, aCommandGeneralId );
+    if( aCommandGeneralId == KVcxCommandIdMyVideos )
+        {
+        cmd->SetTObjectValueL( KVcxMediaMyVideosCommandId, aMyVideosCommandId );
+        }
+
+    cmd->SetTObjectValueL( KMPXCommandGeneralDoSync, aSync );
+
+    if( !aSync )
+        {
+        // Transaction id is used also tracking stats, so increment for every command.
+        iTransactions->NextTransactionId();
+
+        if( aCommandGeneralId == KVcxCommandIdMyVideos )
+            {
+            cmd->SetTObjectValueL( KVcxMediaMyVideosTransactionId, iTransactions->TransactionId() );
+            iTransactions->AddTransactionId( aMyVideosCommandId );
+            }
+        }
+
+    cmd->SetTObjectValueL( KMPXCommandGeneralCollectionId, iCollectionUid.iUid );
+
+    return cmd;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::SelectMediasL
+// -----------------------------------------------------------------------------
+//
+CMPXMediaArray* CVCXMyVideosCollectionPluginTester::SelectMediasL( TInt aDriveFilter, TInt aStartIndex, TInt aEndIndex )
+    {
+    if( aStartIndex == -4 )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTester::SelectMediasL - returning NULL");
+        return NULL;
+        }
+
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTester::SelectMediasL");
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTester::SelectMediasL: aStartIndex: %d", aStartIndex);
+
+    if( !iMediaArray )
+        {
+        User::Leave( KErrNotReady );
+        }
+
+    iRequestedMediaIds.Reset();
+
+    CMPXMediaArray* medias = CMPXMediaArray::NewL();
+
+    // None
+    if( aStartIndex > aEndIndex )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: Selected none of the videos.");
+        VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::SelectMediasL");
+        return medias;
+        }
+
+    CleanupStack::PushL( medias );
+
+    if( aStartIndex >= 0 )
+        {
+        if( aEndIndex > iMediaArray->Count() )
+            {
+            VCXLOGLO2("CVCXMyVideosCollectionPluginTester::SelectMediasL end index: %d is out of bounds.", aEndIndex);
+            User::Leave( KErrArgument );
+            }
+
+        TInt countToSelect = aEndIndex - aStartIndex;
+        TInt indexOfVideoOnDrive = 0;
+        
+        for( TInt i = 0; i < iMediaArray->Count(); i++ )
+            {
+            CMPXMedia* media = (*iMediaArray)[i];
+
+            if( media )
+                {
+                TBool selectThis( EFalse );
+                
+                if( aDriveFilter != -1 )
+                    {
+                    // Drive specified, check path and index of video on the drive.
+                    const TDesC& localFilePath = media->ValueText( KMPXMediaGeneralUri );
+                    TInt drive( 0 );
+                    User::LeaveIfError( iFs.CharToDrive( localFilePath[0], drive ) );
+
+                    if( drive == aDriveFilter )
+                        {
+                        if( indexOfVideoOnDrive >= aStartIndex && indexOfVideoOnDrive < aEndIndex )
+                            {
+                            selectThis = ETrue;
+                            }
+                        indexOfVideoOnDrive++;                        
+                        }
+                    }
+                else
+                    {
+                    // No drive specified, just index check.
+                    if( i >= aStartIndex && i < aEndIndex )
+                        {
+                        selectThis = ETrue;
+                        }
+                    }
+
+                if( selectThis )
+                    {
+                    TMPXItemId mpxId = *(*media).Value<TMPXItemId>( KMPXMediaGeneralId );
+                    VCXLOGLO2("CVCXMyVideosCollectionPluginTester:: Selected media. MPX ID: %d", mpxId.iId1);
+                    iRequestedMediaIds.Append( mpxId.iId1 );
+                    CMPXMedia* newMedia = CMPXMedia::NewL();
+                    CleanupStack::PushL( newMedia );
+                    newMedia->SetTObjectValueL( KMPXMessageMediaGeneralId, mpxId );
+                    newMedia->SetTObjectValueL( KMPXMediaGeneralId, mpxId );
+                    medias->AppendL( *newMedia );
+                    CleanupStack::PopAndDestroy( newMedia );
+    
+                    if( medias->Count() >= countToSelect )
+                        {
+                        break;
+                        }
+                    }
+                }
+            }
+        }
+
+    // Invalid IDs
+    if( aStartIndex == -1 )
+        {
+        for( TInt i = 0; i < aEndIndex; i++ )
+            {
+            TMPXItemId mpxId;
+            mpxId.iId1 = i+66666;
+            mpxId.iId2 = 0;
+
+            VCXLOGLO2("CVCXMyVideosCollectionPluginTester:: Selected media. Invalid MPX ID: %d", mpxId.iId1);
+
+            CMPXMedia* newMedia = CMPXMedia::NewL();
+            CleanupStack::PushL( newMedia );
+            newMedia->SetTObjectValueL( KMPXMessageMediaGeneralId, mpxId );
+            newMedia->SetTObjectValueL( KMPXMediaGeneralId, mpxId );
+            medias->AppendL( *newMedia );
+            CleanupStack::PopAndDestroy( newMedia );
+            }
+        }
+
+    // Duplicate IDs
+    if( aStartIndex == -2 )
+        {
+        if( aEndIndex > iMediaArray->Count() )
+            {
+            VCXLOGLO2("CVCXMyVideosCollectionPluginTester::SelectMediasL end index: %d is out of bounds.", aEndIndex);
+            User::Leave( KErrArgument );
+            }
+
+        for( TInt i = 0; i < aEndIndex; i++ )
+            {
+            CMPXMedia* media = (*iMediaArray)[i];
+
+            if( media )
+                {
+                TMPXItemId mpxId = *(*media).Value<TMPXItemId>( KMPXMediaGeneralId );
+
+                VCXLOGLO2("CVCXMyVideosCollectionPluginTester:: Selected media. Add twice MPX ID: %d", mpxId.iId1);
+                iRequestedMediaIds.Append( mpxId.iId1 );
+                iRequestedMediaIds.Append( mpxId.iId1 );
+                CMPXMedia* newMedia = CMPXMedia::NewL();
+                CleanupStack::PushL( newMedia );
+                newMedia->SetTObjectValueL( KMPXMessageMediaGeneralId, mpxId );
+                newMedia->SetTObjectValueL( KMPXMediaGeneralId, mpxId );
+                medias->AppendL( *newMedia );
+                medias->AppendL( *newMedia );
+                CleanupStack::PopAndDestroy( newMedia );
+                }
+            }
+        }
+
+    // Every second ID
+    if( aStartIndex == -3 )
+        {
+        if( aEndIndex > iMediaArray->Count() )
+            {
+            VCXLOGLO2("CVCXMyVideosCollectionPluginTester::SelectMediasL end index: %d is out of bounds.", aEndIndex);
+            User::Leave( KErrArgument );
+            }
+
+        for( TInt i = 0; i < aEndIndex; i+=2 )
+            {
+            CMPXMedia* media = (*iMediaArray)[i];
+
+            if( media )
+                {
+                TMPXItemId mpxId = *(*media).Value<TMPXItemId>( KMPXMediaGeneralId );
+
+                VCXLOGLO2("CVCXMyVideosCollectionPluginTester:: Selected media. MPX ID: %d", mpxId.iId1);
+                iRequestedMediaIds.Append( mpxId.iId1 );
+                CMPXMedia* newMedia = CMPXMedia::NewL();
+                CleanupStack::PushL( newMedia );
+                newMedia->SetTObjectValueL( KMPXMessageMediaGeneralId, mpxId );
+                newMedia->SetTObjectValueL( KMPXMediaGeneralId, mpxId );
+                medias->AppendL( *newMedia );
+                CleanupStack::PopAndDestroy( newMedia );
+                }
+            }
+        }
+
+    CleanupStack::Pop( medias );
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::SelectMediasL");
+    return medias;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::UpdateOwnedMediaArray
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::UpdateOwnedMediaArrayL()
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTester::UpdateOwnedMediaArrayL");
+
+    if ( !iCollectionEntries )
+        {
+        return;
+        }
+
+    if( !iCollectionEntries->IsSupported( KMPXMediaArrayContents ) )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: No support for KMPXMediaArrayContents, cannot continue!");
+        User::Leave( KErrNotSupported );
+        }
+
+    // Get up to date list of all medias in collection.
+    CMPXMediaArray* medias = iCollectionEntries->Value<CMPXMediaArray>( KMPXMediaArrayContents );
+    
+    // Delete array of old medias
+    if( iOldMediaArray )
+        {
+        iOldMediaArray->Reset();
+        delete iOldMediaArray;
+        }
+
+    // Update the old array and create new
+    iOldMediaArray = iMediaArray;
+    iMediaArray = CMPXMediaArray::NewL();
+
+    TBool categories( EFalse );
+    
+    // Make copies of the medias.
+    for( TInt i=0; i<medias->Count(); i++ )
+        {
+        CMPXMedia* media = (*medias)[i];
+        
+        TMPXItemId itemId = *(media->Value<TMPXItemId>( KMPXMediaGeneralId ));
+        if( itemId.iId2 != 0 )
+             {
+             categories = ETrue;
+             }
+        
+        // Ignore medias on ROM.
+        TBool isOnRom( EFalse );
+        
+        if( media->IsSupported( KMPXMediaGeneralUri ) )
+            {
+            const TDesC& url = media->ValueText( KMPXMediaGeneralUri );
+            if( url.FindC( _L("z:" ) ) != KErrNotFound )
+                {
+                isOnRom = ETrue;
+                }
+            }
+        
+        if( !isOnRom )
+            {
+            iMediaArray->AppendL( *media );
+            }
+        }
+    
+    iMediaCount = iMediaArray->Count();
+    
+    // Update count of videos on ROM.
+    if( !categories )
+        {
+        iVideosOnRomCount = 0;
+
+        for( TInt i=0; i<medias->Count(); i++ )
+            {
+            CMPXMedia* media = (*medias)[i];            
+            
+            if( media->IsSupported( KMPXMediaGeneralUri ) )
+                {
+                const TDesC& url = media->ValueText( KMPXMediaGeneralUri );
+                if( url.FindC( _L("z:" ) ) != KErrNotFound )
+                    {
+                    iVideosOnRomCount++;
+                    }
+                }
+            }
+
+            VCXLOGLO2("CVCXMyVideosCollectionPluginTester:: iVideosOnRom: %d", iVideosOnRomCount);
+        }
+    
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::UpdateOwnedMediaArrayL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::GetChangedMedias
+// -----------------------------------------------------------------------------
+//
+CMPXMediaArray* CVCXMyVideosCollectionPluginTester::GetChangedMedias( const CMPXMediaArray* aNewMedias )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTester::GetChangedMedias");
+
+    CMPXMediaArray* changedMedias = CMPXMediaArray::NewL();
+
+    if( !aNewMedias )
+        {
+        VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::GetChangedMedias");
+        return changedMedias;
+        }
+
+    CleanupStack::PushL( changedMedias );
+
+    for( TInt i=0; i<aNewMedias->Count(); i++ )
+        {
+        CMPXMedia* media(NULL);
+        media = (*aNewMedias)[i];
+        
+        if( !media )
+            {
+            continue;
+            }
+        
+        TMPXItemId mpxId = *(*media).Value<TMPXItemId>( KMPXMediaGeneralId );
+
+        CMPXMedia* oldMedia = GetMediaByMpxId( iOldMediaArray, mpxId );
+
+        TBool add( EFalse );
+
+        // It's a new.
+        if( !oldMedia )
+            {
+            add = ETrue;
+            }
+        // Check changes
+        else
+            {
+            const TArray<TMPXAttribute> newAttributes = media->Attributes();
+            const TArray<TMPXAttribute> oldAttributes = oldMedia->Attributes();
+            if( newAttributes.Count() != oldAttributes.Count() )
+                {
+                add = ETrue;
+                }
+            else
+                {
+                for( TInt e=0; e<newAttributes.Count(); e++ )
+                    {
+                    if( !oldMedia->Match( *media, newAttributes[e] ) )
+                        {
+                        add = ETrue;
+                        break;
+                        }
+                    }
+                }
+            }
+
+        // Add a copy of the media.
+        if( add )
+            {
+            changedMedias->AppendL( *media );
+            }
+        }
+
+    CleanupStack::Pop( changedMedias );
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::GetChangedMedias");
+    return changedMedias;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::GetMediaByMpxId
+// -----------------------------------------------------------------------------
+//
+CMPXMedia* CVCXMyVideosCollectionPluginTester::GetMediaByMpxId( CMPXMediaArray* aMedias, TMPXItemId& aMpxId )
+    {
+    if( !aMedias )
+        {
+        return NULL;
+        }
+
+    for( TInt i=0; i<aMedias->Count(); i++ )
+        {
+        CMPXMedia* media = (*aMedias)[i];
+        TMPXItemId mpxId = *(*media).Value<TMPXItemId>( KMPXMediaGeneralId );
+
+        if( mpxId == aMpxId )
+            {
+            return media;
+            }
+        }
+    return NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::SetRefreshStatus
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::SetRefreshStatus( TBool aRefreshingCollection )
+    {
+    iRefreshingCollection = aRefreshingCollection;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::CheckRequestMediaArrayL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::CheckRequestMediaArrayL( CMPXMediaArray& aRequestResultMedias, RArray<TInt32>& aRequestedMediaIds )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTester::CheckRequestMediaArrayL");
+
+    // Print requested ids
+    VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: Requested IDs:");
+    for( TInt i = 0; i < aRequestedMediaIds.Count(); i++ )
+        {
+        VCXLOGLO2("Requested: iId1: %d", aRequestedMediaIds[i] );
+        }
+
+    // Print actual result ids and check for errors
+    VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: Request result media IDs:");
+    for( TInt i = 0; i < aRequestResultMedias.Count(); i++ )
+        {
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTester:: at index: %d:", i);
+        CMPXMedia* media = aRequestResultMedias[i];
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: got media");
+        if( media )
+            {
+            TMPXItemId mpxId = *(*media).Value<TMPXItemId>( KMPXMediaGeneralId );
+            VCXLOGLO3("Result: iId1: %d, iId2: %d", mpxId.iId1, mpxId.iId2 );
+            if( media->IsSupported( KVcxMediaMyVideosInt32Value ) )
+                {
+                TInt32 result = (*media).ValueTObjectL<TInt32>( KVcxMediaMyVideosInt32Value );
+                VCXLOGLO2("CVCXMyVideosCollectionPluginTester:: result: %d:", result);
+                if( result != KErrNone && !( result == KErrCancel && iCancelRequested ) )
+                    {
+                    VCXLOGLO2("CVCXMyVideosCollectionPluginTester:: ERROR in results: %d!", result);
+                    User::Leave( result );
+                    }
+                }
+            }
+        else
+            {
+            VCXLOGLO2("CVCXMyVideosCollectionPluginTester:: Result is NULL at index: %d", i);
+            }
+        }
+
+    VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: rest of the checks");
+    
+    // First check the counts match
+    if( aRequestResultMedias.Count() != aRequestedMediaIds.Count() )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: Did not get all the requested entries!");
+        User::Leave( KErrCorrupt );
+        }
+    else
+    // Check that all requested ids are in the results
+    for( TInt i = 0; i < aRequestedMediaIds.Count(); i++ )
+        {
+        TMPXItemId mpxId;
+        mpxId.iId1 = aRequestedMediaIds[i];
+        mpxId.iId2 = 0;
+
+        TBool found( EFalse );
+        for( TInt e = 0; e < aRequestResultMedias.Count(); e++ )
+            {
+            CMPXMedia* media2 = aRequestResultMedias[e];
+            if( media2 )
+                {
+                TMPXItemId mpxId2 = *(*media2).Value<TMPXItemId>( KMPXMediaGeneralId );
+
+                if( mpxId == mpxId2 )
+                    {
+                    found = ETrue;
+                    }
+                }
+            }
+
+        if( !found )
+            {
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: Requested media not found from results!");
+            User::Leave( KErrCorrupt );
+            }
+        }
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::CheckRequestMediaArrayL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::PrintMediasL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::PrintMediasL( CMPXMediaArray* aMediaArray, TBool aCheckChanges, const TDesC& aTitle )
+    {
+    if( aMediaArray == NULL )
+        {
+        aMediaArray = iMediaArray;
+        }
+    
+    TInt count(0);
+    TInt changedCount(0);
+
+    CMPXMediaArray* medias( NULL );
+
+    if( aCheckChanges )
+        {
+         medias = GetChangedMedias( aMediaArray );
+         changedCount = medias->Count();
+         count = aMediaArray->Count();
+         CleanupStack::PushL( medias );
+        }
+    else
+        {
+        medias = aMediaArray;
+        count = aMediaArray->Count();
+        }
+
+    if( count == 0 )
+        {
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTester:: <----------- %S - No Entries ----------->", &aTitle);
+        }
+    else if( changedCount == 0 )
+        {
+        VCXLOGLO3("CVCXMyVideosCollectionPluginTester:: <----------- %S - %d Entries, no changes ----------->", &aTitle, count );
+        }
+    else
+        {
+        VCXLOGLO4("CVCXMyVideosCollectionPluginTester:: <----------- %S - %d Entries, %d has changed ----------->", &aTitle, count, changedCount );
+        }
+
+    CMPXMedia* media(NULL);
+    for( TInt i = 0; i < medias->Count(); i++ )
+        {
+        media = (*medias)[i];
+        if( media )
+            PrintMPXMediaL( *media, ETrue );
+        }
+
+    if( aCheckChanges )
+        {
+        medias->Reset();
+        CleanupStack::PopAndDestroy( medias );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::PrintMPXMediaL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::PrintMPXMediaL( const CMPXMedia& aMedia, TBool aPrintAllDetails )
+    {
+    TMPXItemId itemId = *aMedia.Value<TMPXItemId>( KMPXMediaGeneralId );
+
+    if( !aPrintAllDetails )
+        {
+        TBuf<256> title;
+        if( aMedia.IsSupported( KMPXMediaGeneralTitle ) )
+            {
+            title = aMedia.ValueText( KMPXMediaGeneralTitle );
+            }
+
+        // Category
+        if( itemId.iId2 != 0 )
+            {
+            TInt itemCount(0);
+            TInt newItemCount(0);
+            TBuf<256> newItemName;
+            if( aMedia.IsSupported( KVcxMediaMyVideosCategoryNewItemName ) )
+                {
+                newItemName = aMedia.ValueText( KVcxMediaMyVideosCategoryNewItemName );
+                }
+            if( aMedia.IsSupported( KVcxMediaMyVideosCategoryItemCount ) )
+                 {
+                 itemCount = *aMedia.Value<TUint32>( KVcxMediaMyVideosCategoryItemCount );
+                 }
+            if( aMedia.IsSupported( KVcxMediaMyVideosCategoryNewItemCount ) )
+                 {
+                 newItemCount = *aMedia.Value<TUint32>( KVcxMediaMyVideosCategoryNewItemCount );
+                 }
+            VCXLOGLO5("KMPXMediaGeneralTitle: title: %S, medias: %d, new: %d, new media: %S", &title, itemCount, newItemCount, &newItemName);
+            }
+        // Media
+        else
+            {
+            TBuf<256> path;
+            if( aMedia.IsSupported( KMPXMediaGeneralUri ) )
+                {
+                const TDesC& localFilePath = aMedia.ValueText( KMPXMediaGeneralUri );
+                if( localFilePath.Length() >= 256 )
+                    {
+                    path = localFilePath.Left( 255 );
+                    }
+                else
+                    {
+                    path = localFilePath;
+                    }
+                }
+            TInt64 size(0);
+            TInt origin(-1);
+            if( aMedia.IsSupported( KMPXMediaGeneralExtSizeInt64 ) )
+                 {
+                 size = *aMedia.Value<TInt64>( KMPXMediaGeneralExtSizeInt64 );
+                 }
+            if( aMedia.IsSupported( KVcxMediaMyVideosOrigin ) )
+                {
+                origin = *aMedia.Value<TUint>( KVcxMediaMyVideosOrigin );
+                }
+            VCXLOGLO3("iId1: %d, iId2: %d", itemId.iId1, itemId.iId2 );
+            VCXLOGLO5("KMPXMediaGeneralTitle: title: %S, size: %d, origin: %d, path: %S", &title, size, origin, &path);
+            }
+
+        return;
+        }
+
+    // Print all details
+
+    if( itemId.iId2 != 0 )
+        {
+        VCXLOGLO1("--------------------------- MEDIA CATEGORY -------------------------------");
+        }
+    else
+        {
+        VCXLOGLO1("--------------------------- MEDIA OBJECT -------------------------------");
+        }
+
+    VCXLOGLO3("iId1: %d, iId2: %d", itemId.iId1, itemId.iId2 );
+
+    if( aMedia.IsSupported( KVcxMediaMyVideosCategoryItemCount ) )
+         {
+         TUint32 value = *aMedia.Value<TUint32>( KVcxMediaMyVideosCategoryItemCount );
+         VCXLOGLO2("KVcxMediaMyVideosCategoryItemCount: %d", value);
+         }
+
+    if( aMedia.IsSupported( KVcxMediaMyVideosCategoryNewItemCount ) )
+         {
+         TUint32 value = *aMedia.Value<TUint32>( KVcxMediaMyVideosCategoryNewItemCount );
+         VCXLOGLO2("KVcxMediaMyVideosCategoryNewItemCount: %d", value);
+         }
+
+    if( aMedia.IsSupported( KVcxMediaMyVideosCategoryNewItemName ) )
+        {
+        const TDesC& itemName = aMedia.ValueText( KVcxMediaMyVideosCategoryNewItemName );
+        VCXLOGLO2("KVcxMediaMyVideosCategoryNewItemName: %S", &itemName);
+        }
+
+    if( aMedia.IsSupported( KMPXMediaGeneralTitle ) )
+        {
+        const TDesC& title = aMedia.ValueText( KMPXMediaGeneralTitle );
+        VCXLOGLO2("KMPXMediaGeneralTitle: %S", &title);
+        }
+
+    if( aMedia.IsSupported( KMPXMediaGeneralComment ) )
+        {
+        const TDesC& desc = aMedia.ValueText( KMPXMediaGeneralComment );
+        VCXLOGLO2("KMPXMediaGeneralComment: %S", &desc);
+        }
+
+    if( aMedia.IsSupported( KMPXMediaGeneralUri ) )
+        {
+        const TDesC& localFilePath = aMedia.ValueText( KMPXMediaGeneralUri );
+        VCXLOGLO2("KMPXMediaGeneralUri: %S", &localFilePath);
+        }
+
+    if( aMedia.IsSupported( KMPXMediaGeneralExtSizeInt64 ) )
+         {
+         TInt64 value = *aMedia.Value<TInt64>( KMPXMediaGeneralExtSizeInt64 );
+         VCXLOGLO2("KMPXMediaGeneralExtSizeInt64 (bytes): %Ld", value);
+         }
+
+    if( aMedia.IsSupported( KMPXMediaGeneralDate ) )
+        {
+        TInt64 value = *aMedia.Value<TInt64>( KMPXMediaGeneralDate );
+        TTime time ( value );
+        TBuf<60> timeStr;
+        _LIT(KDateTimeString,"%D%M%Y%/0%1%/1%2%/2%3%/3 %-B%:0%H%:1%T%:2%S%.%*C2%:3%-B");
+        time.FormatL(timeStr, KDateTimeString);
+        VCXLOGLO2("KMPXMediaGeneralDate: %S", &timeStr);
+        }
+
+    if( aMedia.IsSupported( KMPXMediaGeneralFlags ) )
+         {
+         TUint value = *aMedia.Value<TUint>( KMPXMediaGeneralFlags );
+
+         if( value & EVcxMyVideosVideoNew )
+             {
+             VCXLOGLO1("KMPXMediaGeneralFlags: EVcxMyVideosVideoNew");
+             }
+         if( value & EVcxMyVideosVideoScheduledDownload )
+             {
+             VCXLOGLO1("KMPXMediaGeneralFlags: EVcxMyVideosVideoScheduledDownload");
+             }
+         if( value & EVcxMyVideosVideoDeleteWarning )
+             {
+             VCXLOGLO1("KMPXMediaGeneralFlags: EVcxMyVideosVideoDeleteWarning");
+             }
+         if( value & EVcxMyVideosVideoProtected )
+             {
+             VCXLOGLO1("KMPXMediaGeneralFlags: EVcxMyVideosVideoProtected");
+             }
+         if( value & EVcxMyVideosVideoDrmProtected )
+             {
+             VCXLOGLO1("KMPXMediaGeneralFlags: EVcxMyVideosVideoDrmProtected");
+             }
+         if( value & EVcxMyVideosVideoMemoryCard )
+             {
+             VCXLOGLO1("KMPXMediaGeneralFlags: EVcxMyVideosVideoMemoryCard");
+             }
+         if( value & EVcxMyVideosVideoPreview )
+             {
+             VCXLOGLO1("KMPXMediaGeneralFlags: EVcxMyVideosVideoPreview");
+             }
+         if( value & EVcxMyVideosVideoRecPartiallyFailed )
+             {
+             VCXLOGLO1("KMPXMediaGeneralFlags: EVcxMyVideosVideoRecPartiallyFailed");
+             }
+         if( value & EVcxMyVideosVideoRecFailed )
+             {
+             VCXLOGLO1("KMPXMediaGeneralFlags: EVcxMyVideosVideoRecFailed");
+             }
+         if( value & EVcxMyVideosServiceHasReadOnlyIap )
+             {
+             VCXLOGLO1("KMPXMediaGeneralFlags: EVcxMyVideosServiceHasReadOnlyIap");
+             }
+         if( value & EVcxMyVideosSilent )
+             {
+             VCXLOGLO1("KMPXMediaGeneralFlags: EVcxMyVideosSilent");
+             }
+         }
+
+    if( aMedia.IsSupported( KMPXMediaGeneralCopyright ) )
+        {
+        const TDesC& copyright = aMedia.ValueText( KMPXMediaGeneralCopyright );
+        VCXLOGLO2("KMPXMediaGeneralCopyright: %S", &copyright);
+        }
+
+    if( aMedia.IsSupported( KMPXMediaGeneralMimeType ) )
+        {
+        const TDesC& mimeType = aMedia.ValueText( KMPXMediaGeneralMimeType );
+        VCXLOGLO2("KMPXMediaGeneralMimeType: %S", &mimeType);
+        }
+
+    if( aMedia.IsSupported( KVcxMediaMyVideosModifiedDate ) )
+        {
+        TInt64 value = *aMedia.Value<TInt64>( KVcxMediaMyVideosModifiedDate );
+        TTime time ( value );
+        TBuf<60> timeStr;
+        _LIT(KDateTimeString,"%D%M%Y%/0%1%/1%2%/2%3%/3 %-B%:0%H%:1%T%:2%S%.%*C2%:3%-B");
+        time.FormatL(timeStr, KDateTimeString);
+        VCXLOGLO2("KVcxMediaMyVideosModifiedDate: %S", &timeStr);
+        }
+
+    /* 
+          //10.
+    if ( aObject.Property( *iLastModifiedDatePropertyDef, property, 0 ) != KErrNotFound
+        && aFullDetails )
+        {
+        aVideo.SetTObjectValueL<TInt64>( KVcxMediaMyVideosModifiedDate,
+                static_cast<CMdETimeProperty*>(property)->Value().Int64() );
+        }
+      */
+
+    if( aMedia.IsSupported( KVcxMediaMyVideosAgeProfile ) )
+        {
+        TUint value = *aMedia.Value<TUint>( KVcxMediaMyVideosAgeProfile );
+        VCXLOGLO2("KVcxMediaMyVideosAgeProfile: %d", value);
+        }
+
+    if( aMedia.IsSupported( KVcxMediaMyVideosAudioLanguage ) )
+        {
+        const TDesC& value = aMedia.ValueText( KVcxMediaMyVideosAudioLanguage );
+        VCXLOGLO2("KVcxMediaMyVideosAudioLanguage: %S", &value);
+        }
+
+    if( aMedia.IsSupported( KVcxMediaMyVideosAuthor ) )
+        {
+        const TDesC& value = aMedia.ValueText( KVcxMediaMyVideosAuthor );
+        VCXLOGLO2("KVcxMediaMyVideosAuthor: %S", &value);
+        }
+
+    if( aMedia.IsSupported( KVcxMediaMyVideosOrigin ) )
+        {
+        TUint8 value = *aMedia.Value<TUint>( KVcxMediaMyVideosOrigin );
+        VCXLOGLO2("KVcxMediaMyVideosOrigin: %d", value);
+        }
+
+    if( aMedia.IsSupported( KVcxMediaMyVideosDuration ) )
+        {
+        TReal32 value = *aMedia.Value<TReal32>( KVcxMediaMyVideosDuration );
+        VCXLOGLO2("KVcxMediaMyVideosDuration: %f", value);
+        }
+
+    if( aMedia.IsSupported( KMPXMediaGeneralLastPlaybackPosition ) )
+        {
+        TReal32 value = *aMedia.Value<TReal32>( KMPXMediaGeneralLastPlaybackPosition );
+        VCXLOGLO2("KMPXMediaGeneralLastPlaybackPosition: %f", value);
+        }
+
+    if( aMedia.IsSupported( KVcxMediaMyVideosRemoteUrl ) )
+        {
+        const TDesC& value = aMedia.ValueText( KVcxMediaMyVideosRemoteUrl );
+        VCXLOGLO2("KVcxMediaMyVideosRemoteUrl: %S", &value);
+        }
+
+    if( aMedia.IsSupported( KMPXMediaGeneralDrive ) )
+        {
+        const TDesC& drive = aMedia.ValueText( KMPXMediaGeneralDrive );
+        VCXLOGLO2("KMPXMediaGeneralDrive: %S", &drive);
+        }
+
+    if( aMedia.IsSupported( KMPXMediaGeneralCount ) )
+        {
+        TInt value = *aMedia.Value<TInt>( KMPXMediaGeneralCount );
+        VCXLOGLO2("KMPXMediaGeneralCount: %d", value);
+        }
+
+    if( aMedia.IsSupported( KMPXMediaGeneralLastPlaybackPosition ) )
+        {
+        TInt value = *aMedia.Value<TInt>( KMPXMediaGeneralLastPlaybackPosition );
+        VCXLOGLO2("KMPXMediaGeneralLastPlaybackPosition: %d", value);
+        }
+
+    if( aMedia.IsSupported( KMPXMediaGeneralLastPlaybackTime ) )
+        {
+        TInt64 value = *aMedia.Value<TInt64>( KMPXMediaGeneralLastPlaybackTime );
+        TTime time ( value );
+        TBuf<60> timeStr;
+        _LIT(KDateTimeString,"%D%M%Y%/0%1%/1%2%/2%3%/3 %-B%:0%H%:1%T%:2%S%.%*C2%:3%-B");
+        time.FormatL(timeStr, KDateTimeString);
+        VCXLOGLO2("KMPXMediaGeneralLastPlaybackTime: %S", &timeStr);
+        }
+
+    if( aMedia.IsSupported( KMPXMediaGeneralPlayCount ) )
+        {
+        TUint value = *aMedia.Value<TUint>( KMPXMediaGeneralPlayCount );
+        VCXLOGLO2("KMPXMediaGeneralPlayCount: %d", value);
+        }
+
+    if( aMedia.IsSupported( KMPXMediaGeneralContainerPath ) )
+        {
+        const TDesC& value = aMedia.ValueText( KMPXMediaGeneralContainerPath );
+        VCXLOGLO2("KMPXMediaGeneralContainerPath: %S", &value);
+        }
+
+    if( aMedia.IsSupported( KMPXMediaGeneralPath ) )
+        {
+        // Media collection path; CMPXCollectionPath
+        const TDesC& value = aMedia.ValueText( KMPXMediaGeneralPath );
+        VCXLOGLO2("KMPXMediaGeneralPath: %S", &value);
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::HandleCollectionMessage
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::HandleCollectionMessage( CMPXMessage* aMessage, TInt aError )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTester::HandleCollectionMessage");
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTester:: aError: %d", aError);
+
+    if( !aMessage )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: aMessage is NULL");
+        aError = KErrGeneral;
+        }
+
+    if( aError == KErrNone )
+        {
+        TInt err( KErrNone );
+
+        TMPXMessageId messageId = *(aMessage->Value<TMPXMessageId>( KMPXMessageGeneralId ));
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTester:: Message id: %d", messageId);
+
+        TInt myVideosCmd = -1;
+        if ( messageId == KVcxCommandIdMyVideos )
+            {
+            myVideosCmd = aMessage->ValueTObjectL<TInt>( KVcxMediaMyVideosCommandId );
+            }
+
+        if ( myVideosCmd != KVcxMessageMyVideosMessageArray )
+            {
+            TRAP( err, HandleSingleCollectionMessageL( aMessage ) );
+            }
+        else
+            {
+            if( err == KErrNone && aMessage->IsSupported( KMPXMessageArrayContents ) )
+                {
+                const CMPXMessageArray* messageArray =
+                        aMessage->Value<CMPXMessageArray>(KMPXMessageArrayContents);
+
+                TInt count = messageArray->Count();
+                VCXLOGLO2("CVCXMyVideosCollectionPluginTester:: Message has array of %d messages.", count);
+
+                for( TInt i = 0; i < count; i++ )
+                    {
+                    VCXLOGLO2("CVCXMyVideosCollectionPluginTester:: Handling message at index: %d", i);
+                    TRAP( err, HandleSingleCollectionMessageL( (*messageArray)[i] ) );
+                    }
+                }
+            else
+                {
+                VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: MY VIDEOS MESSAGE ARRAY WITHOUT ARRAY ARRIVED");
+                err = KErrCorrupt;
+                }
+            }
+
+        if( err != KErrNone )
+            {
+            VCXLOGLO2("CVCXMyVideosCollectionPluginTester:: Error %d while handling messages!", err );
+            aError = err;
+            }
+        }
+
+    if( aError != KErrNone )
+        {
+        SetRefreshStatus( EFalse );
+        iWaitingForItemChange = EFalse;
+        iActiveWait->Stop();
+        TRAP_IGNORE( iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageCollectionMessageError, aError ) );
+        }
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::HandleCollectionMessage");
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::HandleSingleCollectionMessage
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::HandleSingleCollectionMessageL( CMPXMessage* aMessage )
+    {
+    if( !aMessage || !aMessage->IsSupported( KMPXMessageGeneralId ) ) return;
+    
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTester::HandleSingleCollectionMessage");    
+    
+    TMPXMessageId messageId = *(aMessage->Value<TMPXMessageId>( KMPXMessageGeneralId ));
+
+    if( aMessage->IsSupported( KMPXMessageCollectionId ) )
+        {
+        TUid uid( *(aMessage->Value<TUid>( KMPXMessageCollectionId )) );
+        if( iCollectionUid != uid )
+            {
+            VCXLOGLO3("CVCXMyVideosCollectionPluginTester:: Collection UIDs don't match: iCollectionUid %d, uid %d", iCollectionUid.iUid, uid.iUid);
+            VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::HandleSingleCollectionMessage");
+            return;
+            }
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTester:: Collection UID: %d", uid.iUid);
+        }
+
+    TUint32 transactionId( 0 );
+    if( aMessage->IsSupported( KVcxMediaMyVideosTransactionId ) )
+        {
+        transactionId = aMessage->ValueTObjectL<TUint32>( KVcxMediaMyVideosTransactionId );
+        iTransactions->TransactionResponse( transactionId );
+        }
+
+    switch( messageId )
+        {
+        // Handle My Videos specific command results.
+        case KVcxCommandIdMyVideos:
+            {
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: -------------------------------------------");
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: KMPXMessageGeneralId: KVcxCommandIdMyVideos");
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: -------------------------------------------");
+            if ( aMessage->IsSupported( KVcxMediaMyVideosCommandId ) )
+                {
+                TInt myVideosCommandId = *(aMessage->Value<TInt>( KVcxMediaMyVideosCommandId ));
+
+                switch ( myVideosCommandId )
+                    {
+                    case KVcxMessageMyVideosGetMediasByMpxIdResp:
+                        {
+                        VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: -------------------------------------------------------------------");
+                        VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: KVcxMediaMyVideosCommandId: KVcxMessageMyVideosGetMediasByMpxIdResp");
+                        VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: -------------------------------------------------------------------");
+
+                        if( iActionCount <= 0 )
+                            {
+                            break;
+                            }
+                        iActionCount--;
+
+                       // Update current entries
+                        delete iCollectionEntries;
+                        iCollectionEntries = NULL;
+                        iCollectionEntries = CMPXMedia::NewL( *aMessage );
+
+                        UpdateOwnedMediaArrayL();
+
+                        SetRefreshStatus( EFalse );
+
+                        // add downloads to the requested ID array always and update downloads too.
+                        TBool backup = iUpdateDownloads;
+                        iUpdateDownloads = EFalse;
+                        ProcessCurrentEntriesL();
+                        iUpdateDownloads = backup;
+
+                        // Check
+                        TRAPD( err, CheckRequestMediaArrayL( *iMediaArray, iRequestedMediaIds ) );
+                        if( err != KErrNone )
+                            {
+                            iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageCollectionMessageError, err );
+                            }
+
+                        // Inform observer
+                        iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageGotMediasByKMpxId, KErrNone );
+                        
+                        TRAPD( actionErr, iStats->ActionEndL( transactionId, err ) );
+                        if( actionErr == KErrAbort )
+                            iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageCollectionGeneral, actionErr );
+                        
+                        }
+                        break;
+
+                    // This is received when list is open already and the list contains new items
+                    case KVcxMessageMyVideosItemsAppended:
+                        {
+                        VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: ------------------------------------------------------------");
+                        VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: KVcxMediaMyVideosCommandId: KVcxMessageMyVideosItemsAppended");
+                        VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: ------------------------------------------------------------");
+
+                        if( !iCollectionEntries )
+                            {
+                            break;
+                            }
+
+                        TInt before = iMediaCount;
+
+                        UpdateOwnedMediaArrayL();
+
+                        // New items were appended or removed
+                        VCXLOGLO2("CVCXMyVideosCollectionPluginTester:: Items before: %d", before);
+                        VCXLOGLO2("CVCXMyVideosCollectionPluginTester:: Items now: %d", iMediaArray->Count());
+
+                        ProcessCurrentEntriesL();
+                        }
+                        break;
+
+                    /**
+                    * Collection sends this message when media list fetching has ended
+                    * and no more KVcxMessageMyVideosItemsAppended will be sent.
+                    * If client has fetched items with KVcxCommandMyVideosGetMediasByMpxId,
+                    * it should refetch items when this event arrives.
+                    */
+                    case KVcxMessageMyVideosListComplete:
+                        {
+                        VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: ----------------------------------------------------------------");
+                        VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: KVcxMediaMyVideosCommandId: KVcxMessageMyVideosListComplete");
+                        VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: ----------------------------------------------------------------");
+                        iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageListComplete, KErrNone );
+                        }
+                        break;
+
+                    case KVcxMessageMyVideosMoveOrCopyStarted:
+                        {
+                        VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: ----------------------------------------------------------------");
+                        VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: KVcxMediaMyVideosCommandId: KVcxMessageMyVideosMoveOrCopyStarted");
+                        VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: ----------------------------------------------------------------");
+
+                        if( iActionCount <= 0 )
+                            {
+                            break;
+                            }
+                        iActionCount--;
+
+                        iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageCopyOrMoveStarted, KErrNone );
+                        
+                        TRAP_IGNORE( iStats->ActionProgressL( transactionId, _L("Move/Copy started.") ) );
+                        }
+                        break;
+
+                    case KVcxMessageMyVideosMoveResp:
+                        {
+                        VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: -------------------------------------------------------");
+                        VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: KVcxMediaMyVideosCommandId: KVcxMessageMyVideosMoveResp");
+                        VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: -------------------------------------------------------");
+
+                        if( iActionCount <= 0 )
+                            {
+                            break;
+                            }
+                        iActionCount--;
+
+                        CMPXMedia* medias = CMPXMedia::NewL( *aMessage );
+                        CleanupStack::PushL( medias );
+                        CMPXMediaArray* results = medias->Value<CMPXMediaArray>( KMPXMediaArrayContents );
+
+                        TRAPD( err, CheckRequestMediaArrayL( *results, iRequestedMediaIds ) );
+
+                        if( err != KErrNone )
+                            {
+                            iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageCollectionMessageError, err );
+                            }
+                        else
+                            {
+                            iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageMoveResp, KErrNone );
+                            }
+                        
+                        if( iCancelRequested )
+                            {
+                            TRAP_IGNORE( iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageCommandCanceled, KErrNone ) );
+                            iCancelRequested = EFalse;
+                            }                        
+
+                        TRAPD( actionErr, iStats->ActionEndL( transactionId, err ) );
+                        if( actionErr == KErrAbort )
+                            iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageCollectionGeneral, actionErr );
+                        
+                        CleanupStack::PopAndDestroy( medias );
+                        }
+                        break;
+
+                    case KVcxMessageMyVideosCopyResp:
+                        {
+                        VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: -------------------------------------------------------");
+                        VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: KVcxMediaMyVideosCommandId: KVcxMessageMyVideosCopyResp");
+                        VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: -------------------------------------------------------");
+
+                        if( iActionCount <= 0 )
+                            {
+                            break;
+                            }
+                        iActionCount--;
+
+                        CMPXMedia* medias = CMPXMedia::NewL( *aMessage );
+                        CleanupStack::PushL( medias );
+                        CMPXMediaArray* results = medias->Value<CMPXMediaArray>( KMPXMediaArrayContents );
+
+                        TRAPD( err, CheckRequestMediaArrayL( *results, iRequestedMediaIds ) );
+                        if( err != KErrNone )
+                            {
+                            iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageCollectionMessageError, err );
+                            }
+                        else
+                            {
+                            iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageCopyResp, KErrNone );
+                            }
+
+                        if( iCancelRequested )
+                            {
+                            TRAP_IGNORE( iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageCommandCanceled, KErrNone ) );
+                            iCancelRequested = EFalse;
+                            }                        
+                        
+                        TRAPD( actionErr, iStats->ActionEndL( transactionId, err ) );
+                        if( actionErr == KErrAbort )
+                            iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageCollectionGeneral, actionErr );
+                        
+                        CleanupStack::PopAndDestroy( medias );
+                        }
+                        break;
+
+                    case KVcxMessageMyVideosDeleteStarted:
+                        {
+                        VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: ----------------------------------------------------------------");
+                        VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: KVcxMediaMyVideosCommandId: KVcxMessageMyVideosDeleteStarted");
+                        VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: ----------------------------------------------------------------");
+
+                        if( iActionCount <= 0 )
+                            {
+                            break;
+                            }
+                        iActionCount--;
+
+                        iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageDeleteStarted, KErrNone );
+                        
+                        TRAP_IGNORE( iStats->ActionProgressL( transactionId, _L("Delete started.") ) );
+                        }
+                        break;
+
+                    case KVcxMessageMyVideosDeleteResp:
+                        {
+                        VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: ----------------------------------------------------------------");
+                        VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: KVcxMediaMyVideosCommandId: KVcxMessageMyVideosDeleteResp");
+                        VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: ----------------------------------------------------------------");
+
+                        if( iActionCount <= 0 )
+                            {
+                            break;
+                            }
+                        iActionCount--;
+
+                        CMPXMedia* medias = CMPXMedia::NewL( *aMessage );
+                        CleanupStack::PushL( medias );
+                        CMPXMediaArray* results = medias->Value<CMPXMediaArray>( KMPXMediaArrayContents );
+
+                        TRAPD( err, CheckRequestMediaArrayL( *results, iRequestedMediaIds ) );
+
+                        if( err != KErrNone )
+                            {
+                            iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageCollectionMessageError, err );
+                            }
+                        else
+                            {
+                            iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageDeleteResp, KErrNone );
+                            }
+
+                        if( iCancelRequested )
+                            {
+                            TRAP_IGNORE( iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageCommandCanceled, KErrNone ) );
+                            iCancelRequested = EFalse;
+                            }
+                        
+                        TRAPD( actionErr, iStats->ActionEndL( transactionId, err ) );
+                        if( actionErr == KErrAbort )
+                            iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageCollectionGeneral, actionErr );
+                        
+                        CleanupStack::PopAndDestroy( medias );
+                        }
+                        break;
+
+                    default:
+                        {
+                        VCXLOGLO2("CVCXMyVideosCollectionPluginTester:: ERROR. message %d has no handler!", myVideosCommandId );
+                        iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageCollectionMessageError, KErrCorrupt );
+                        }
+                        break;
+                    }
+                }
+            else
+                {
+                VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: ERROR: KVcxCommandIdMyVideos NOT SUPPORTED!");
+                iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageCollectionMessageError, KErrCorrupt );
+                }
+            }
+            break;
+
+        // Handle general collection messages
+        case KMPXMessageGeneral:
+            {
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: ----------------------------------------");
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: KMPXMessageGeneralId: KMPXMessageGeneral");
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: ----------------------------------------");
+
+            iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageCollectionGeneral, KErrNone );
+
+            TInt event( *(aMessage->Value<TInt>( KMPXMessageGeneralEvent )) );
+            TInt type( *(aMessage->Value<TInt>( KMPXMessageGeneralType )) );
+            TInt data( *(aMessage->Value<TInt>( KMPXMessageGeneralData )) );
+
+            VCXLOGLO4("CVCXMyVideosCollectionPluginTester:: event: %d, type: %d, data: %d", event, type, data);
+
+            // Next message will be EPathChanged, nothing to do here.
+            if ( event == TMPXCollectionMessage::ECollectionChanged )
+                {
+                VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: event ECollectionChanged.");
+                }
+
+            if ( event == TMPXCollectionMessage::EPathChanged )
+                {
+                VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: event EPathChanged");
+
+                // Collection or level changed, get entries for it.
+                if( data == EMcContainerOpened )
+                    {
+                    VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: data EMcContainerOpened");
+                    TRAP_IGNORE( iCollectionUtility->Collection().OpenL() );
+                    }
+                else if ( data == EMcItemOpened )
+                    {
+                    VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: data EMcItemOpened");
+                    }
+                }
+            }
+            break;
+
+        case KMPXMessageIdItemChanged:
+            {
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: ----------------------------------------------");
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: KMPXMessageGeneralId: KMPXMessageIdItemChanged");
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: ----------------------------------------------");
+
+            TMPXItemId itemId = *aMessage->Value<TMPXItemId>(KMPXMessageMediaGeneralId);
+            VCXLOGLO3("CVCXMyVideosCollectionPluginTester:: Item Id1: %d, Id2: %d", itemId.iId1, itemId.iId2);
+
+#if 1
+            // Check the IDs for categories
+            if( itemId.iId2 != 0 && ( itemId.iId1 != KVcxMvcCategoryIdAll &&
+                    itemId.iId1 != KVcxMvcCategoryIdDownloads &&
+                    itemId.iId1 != KVcxMvcCategoryIdTvRecordings &&
+                    itemId.iId1 != KVcxMvcCategoryIdCaptured &&
+                    itemId.iId1 != KVcxMvcCategoryIdOther ) )
+                {
+                iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageCollectionCategoryChanged, KErrCorrupt );
+                VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: Error. INVALID ITEM ID.");
+                break;
+                }
+#endif
+            // If event if for category, skip it if it's not for the open category.
+            if( iCurrentOpenedLevelIndex != -1 && itemId.iId2 > 0 && itemId.iId1 != iCurrentOpenedLevelIndex )
+                {
+                VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: Not for open category. Skip.");
+                break;
+                }
+
+            if( iWaitingForItemChange && itemId.iId2 == 0 )
+                {
+                VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: Stop wait for item change");
+                iWaitingForItemChange = EFalse;
+                iActiveWait->Stop();
+                }
+
+            TBool refreshNeeded( EFalse );
+
+            TMPXChangeEventType changeEvent( *aMessage->Value<TMPXChangeEventType>( KMPXMessageChangeEventType ) );
+            switch( changeEvent )
+                {
+                case EMPXItemInserted:
+                    {
+                    VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: changeEvent EMPXItemInserted");
+                    iInsertedItemIds.Append( itemId.iId1 );
+
+                    refreshNeeded = ETrue;
+                    iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageMpxItemInserted, KErrNone );
+                    
+                    TRAPD( actionErr, iStats->ActionEndL( KSideloadVideoActionId, KErrNone ) );
+                    if( actionErr == KErrAbort )
+                        iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageCollectionGeneral, actionErr );
+                    
+                    }
+                    break;
+
+                case EMPXItemDeleted:
+                    {
+                    VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: changeEvent EMPXItemDeleted");
+                    iDeletedItemIds.Append( itemId.iId1 );
+                    refreshNeeded = ETrue;
+                    iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageMpxItemDeleted, KErrNone );
+                    
+                    TRAPD( actionErr, iStats->ActionEndL( KRemoveMediaActionId, KErrNone ) );
+                    if( actionErr == KErrAbort )
+                        iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageCollectionGeneral, actionErr );
+                    }
+                    break;
+
+                case EMPXItemModified:
+                    {
+                    VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: changeEvent EMPXItemModified");
+                    refreshNeeded = EFalse;
+                    if ( aMessage->IsSupported( KVcxMediaMyVideosInt32Value ) )
+                        {
+                        TInt32 extraInfo = aMessage->ValueTObjectL<TInt32>( KVcxMediaMyVideosInt32Value );
+                        if ( extraInfo == EVcxMyVideosVideoListOrderChanged )
+                            {
+                            VCXLOGLO1("CVcxMyVideosCollectionTester:: Received EVcxMyVideosVideoListOrderChanged ------->");
+                            iObserver->HandleVcxMvTesterMessageL( KVCXMyVideosTestMessageVideoListOrderChanged, KErrNone );
+                            refreshNeeded = ETrue;
+                            }
+                        }
+                    iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageMpxItemModified, KErrNone );
+                    }
+                    break;
+
+                default:
+                    {
+                    VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: changeEvent UNKNOWN!");
+                    iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageCollectionMessageError, KErrCorrupt );
+                    }
+                    break;
+                }
+
+            if( itemId.iId2 == 0 )
+                {
+                iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageCollectionItemChanged, KErrNone );
+                }
+            else
+                {
+                iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageCollectionCategoryChanged, KErrNone );
+                }
+
+            // Refresh if there's need and it's possible.
+            if( refreshNeeded  )
+                {
+                if( IsRefreshing() )
+                    {
+                    VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: Refresh already active.");
+                    refreshNeeded = EFalse;
+                    }
+
+                // No automatic refresh
+                if( !iAutomaticContentRefresh )
+                     {
+                     VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: Auto refresh disabled");
+                     refreshNeeded = EFalse;
+                     }
+
+                // No need to refresh if My Videos category is not open.
+                if( GetCurrentLevel() != 3 )
+                    {
+                    VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: No refresh because level");
+                    refreshNeeded = EFalse;
+                    }
+
+                if( refreshNeeded )
+                    {
+                    TRAP_IGNORE( RefreshContentsL() );
+                    }
+                }
+            else
+                {
+                UpdateOwnedMediaArrayL();
+                ProcessCurrentEntriesL();
+                }
+            }
+            break;
+
+        default:
+            {
+            VCXLOGLO2("CVCXMyVideosCollectionPluginTester:: Unknown collection message, id: %d!", messageId);
+            iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageCollectionMessageError, KErrCorrupt );
+            }
+            break;
+        }
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::HandleSingleCollectionMessage");
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::HandleOpenL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::HandleOpenL( const CMPXMedia& aEntries,
+                                                TInt aIndex,
+                                                TBool aComplete,
+                                                TInt aError )
+    {
+    VCXLOGLO2(">>>CVCXMyVideosCollectionPluginTester::HandleOpenL (%d)", this);
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTester:: aIndex: %d", aIndex);
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTester:: aComplete: %d", aComplete);
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTester:: aError: %d", aError);
+    
+    SetRefreshStatus( EFalse );
+
+    TRAPD( actionErr, iStats->ActionEndL( iCurrentActionId, aError ) );
+    if( actionErr == KErrAbort )
+        iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageCollectionGeneral, actionErr );
+    
+    iCurrentActionId = -1;
+    
+    if( aError == KErrNone )
+        {
+        // Update current entries
+        delete iCollectionEntries;
+        iCollectionEntries = NULL;
+        iCollectionEntries = CMPXMedia::NewL( aEntries );
+        
+        iCollectionMediaArray = iCollectionEntries->Value<CMPXMediaArray>( KMPXMediaArrayContents );        
+
+        UpdateOwnedMediaArrayL();
+
+        // There could have been changes to the content during update.
+        // Check that entries are up to date.
+
+        TBool reRefreshNeeded( EFalse );
+
+        TInt foundInsertedItemCount(0);
+
+        for( TInt e=0; e<iMediaCount; e++ )
+            {
+            CMPXMedia* media = (*iMediaArray)[e];
+            TMPXItemId itemId = *(*media).Value<TMPXItemId>( KMPXMediaGeneralId );
+
+            // Check that deleted items are not on the list.
+            for( TInt i=0; i<iDeletedItemIds.Count(); i++ )
+                {
+                if( itemId.iId1 == iDeletedItemIds[i] )
+                    {
+                    VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: Current entries contain deleted  item. Refresh needed. ------->");
+                    reRefreshNeeded = ETrue;
+                    break;
+                    }
+                }
+
+            // Check that all inserted items are on the list.
+            for( TInt i=0; i<iInsertedItemIds.Count(); i++ )
+                {
+                if( itemId.iId1 == iInsertedItemIds[i] )
+                    {
+                    foundInsertedItemCount++;
+                    }
+                }
+            }
+
+        iInsertedItemIds.Reset();
+        iDeletedItemIds.Reset();
+
+        if( !reRefreshNeeded && foundInsertedItemCount < iInsertedItemIds.Count() )
+            {
+            VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: Current entries does not contain all inserted items. Rerefresh needed. ------->");
+            reRefreshNeeded = ETrue;
+            }
+
+        if( reRefreshNeeded )
+            {
+            TRAP_IGNORE( RefreshContentsL() );
+            }
+        else
+            {
+            // Print current entries and update downloads.
+            ProcessCurrentEntriesL();
+
+            // Inform observer
+            iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageCollectionOpened, aError );
+            }
+        }
+
+    if( aError != KErrNone )
+        {
+        iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageCollectionOpened, aError );
+        }
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::HandleOpenL (entries)");
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::HandleOpenL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::HandleOpenL( const CMPXCollectionPlaylist& /*aPlaylist*/,
+                                                TInt aError )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTester::HandleOpenL (playlist)");
+    // Inform observer
+    iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessagePlaylistOpened, aError );
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::HandleOpenL (playlist)");
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::HandleCollectionMediaL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::HandleCollectionMediaL(const CMPXMedia& aMedia,
+                                        TInt aError)
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTester::HandleCollectionMediaL");
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTester:: aError: %d", aError);
+
+    TRAPD( actionErr, iStats->ActionEndL( KGetMediaFullDetailsActionId, aError ) );
+    if( actionErr == KErrAbort )
+        iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageCollectionGeneral, actionErr );
+
+    if( iGettingFullDetailsForAllMedia )
+        {
+        iActiveWait->Stop();
+        }
+
+    delete iFullMedia;
+    iFullMedia = NULL;
+    iFullMedia = aMedia.CopyL( aMedia );
+
+    // Inform observer
+    iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageCollectionMedia, aError );
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::HandleCollectionMediaL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::HandleCommandComplete
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::HandleCommandComplete( CMPXCommand* aCommandResult,
+                                                                TInt aError )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTester::HandleCommandComplete");
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTester::HandleCommandComplete: aError: %d", aError);
+    
+    if( iCancelRequested && aError == KErrCancel )
+        {
+        aError = KErrNone;
+        }
+    
+    if( !iObserver )
+        {
+        VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::HandleCommandComplete");
+        return;
+        }
+    
+    if( aError == KErrNone )
+        {
+        TUint32 transactionId( 0 );
+        if( aCommandResult->IsSupported( KVcxMediaMyVideosTransactionId ) )
+            {
+            transactionId = *aCommandResult->Value<TUint32>( KVcxMediaMyVideosTransactionId );
+            iTransactions->TransactionResponse( transactionId );
+            if( !iCurrentActionHasResponse )
+                {
+                TRAPD( actionErr, iStats->ActionEndL( transactionId, aError ) );
+                if( actionErr == KErrAbort )
+                    iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageCollectionGeneral, actionErr );
+                }
+            }
+        
+        if( aCommandResult->IsSupported( KMPXCommandGeneralId ) )
+            {
+            TInt cmd = 0;
+            cmd = *aCommandResult->Value<TUint>( KMPXCommandGeneralId );
+            VCXLOGLO2("CVCXMyVideosCollectionPluginTester::HandleCommandComplete: KMPXCommandGeneralId: %d", cmd);
+    
+            if( cmd == KVcxCommandIdMyVideos )
+                {
+                cmd = 0;
+                cmd = *aCommandResult->Value<TUint>( KVcxMediaMyVideosCommandId );
+                VCXLOGLO2("CVCXMyVideosCollectionPluginTester::HandleCommandComplete: KVcxMediaMyVideosCommandId: %d", cmd);
+                }
+            }
+        
+        if( aCommandResult->IsSupported( KVcxMediaMyVideosCommandId ) )
+            {
+            TUint32 cmdId;
+            cmdId = aCommandResult->ValueTObjectL<TUint32>( KVcxMediaMyVideosCommandId );
+            
+            if ( cmdId == KVcxCommandMyVideosGetMediaFullDetailsByMpxId )
+                {
+                HandleCollectionMediaL( *(aCommandResult->Value<CMPXMedia>(
+                        KMPXCommandColAddMedia)), KErrNone );
+                }
+            }
+
+        if( aCommandResult->IsSupported( KVcxMediaMyVideosInt32Value ) )
+            {
+            TInt32 result = aCommandResult->ValueTObjectL<TUint32>( KVcxMediaMyVideosInt32Value );
+            
+            if( result != KErrNone && !( iCancelRequested && result == KErrCancel ) )
+                {
+                VCXLOGLO2("CVCXMyVideosCollectionPluginTester::HandleCommandComplete: KVcxMediaMyVideosInt32Value contains error: %d", result);
+                aError = result;
+                }
+            }
+        }
+    
+    if( !iWaitingForItemChange || aError != KErrNone )
+        {
+        SetRefreshStatus(  EFalse );
+        iWaitingForItemChange = EFalse;
+        
+        if( iActiveWait )
+            {
+            iActiveWait->Stop();
+            }
+
+        if( aError == KErrNotFound )
+            {
+            // transaction ids and cancel download to accept -1 when file doesn't exist.
+            TRAP_IGNORE( iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageCommandComplete, KErrNone ) );
+            }
+        else
+            {
+            // Inform observer
+            TRAP_IGNORE( iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageCommandComplete, aError ) );
+            }
+        }
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::HandleCommandComplete");
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::GetMediaCount
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTester::GetMediaCount()
+    {
+    TInt count = 0;
+    if( iMediaArray )
+        {
+        count = iMediaArray->Count();
+        }
+    return count;
+    }
+
+// ---------------------------------------------------------------------------
+// CVCXMyVideosCollectionPluginTester::AddMediaL()
+// ---------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::AddMediaL( CMPXMedia* aMedia, TBool aSync )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTester::AddMediaL");
+
+    TBool newCreated( EFalse );
+    if( aMedia )
+        {
+        PrintMPXMediaL( *aMedia, ETrue );
+        }
+    else
+        {
+        newCreated = ETrue;
+        aMedia = CMPXMedia::NewL();
+        CleanupStack::PushL( aMedia );
+        }
+
+    CMPXCommand* cmd = CreateMpxCommandLC( KMPXCommandIdCollectionAdd, 0, aSync );
+    cmd->SetCObjectValueL(KMPXCommandColAddMedia, aMedia );
+    TRAP_IGNORE( iStats->ActionStartL( iTransactions->TransactionId(), _L("Add media") ) );
+    iCurrentActionHasResponse = EFalse;
+    iCollectionUtility->Collection().CommandL(*cmd);
+
+    CleanupStack::PopAndDestroy( cmd );
+
+    if( newCreated )
+        {
+        CleanupStack::PopAndDestroy( aMedia );
+        }
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::AddMediaL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosCollectionPluginTester::SetMediaL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::SetMediaL( CMPXMedia* aMedia, TBool aSync )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTester::SetMediaL");
+
+    CMPXCommand* cmd = CreateMpxCommandLC( KMPXCommandIdCollectionSet, 0, aSync );
+    cmd->SetCObjectValueL<CMPXMedia>( KMPXCommandColSetMedia, aMedia );
+
+    PrintMPXMediaL( *aMedia, ETrue );
+
+    iCollectionUtility->Collection().CommandL( *cmd );
+    TRAP_IGNORE( iStats->ActionStartL( iTransactions->TransactionId(), _L("Set media") ) );
+    iCurrentActionHasResponse = EFalse;
+    CleanupStack::PopAndDestroy( cmd );
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::SetMediaL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::RemoveMediaL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::RemoveMediaL( TInt aDrive, TInt aIndex, TBool aSync )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTester::RemoveMediaL");
+
+    CMPXMedia* media = NULL;
+
+    TInt realIndex = GetMediaIndexInCollectionL( aDrive, aIndex );
+
+    media = (*iCollectionMediaArray)[realIndex];
+    
+    const TDesC& localFilePath = media->ValueText( KMPXMediaGeneralUri );
+    iTestCommon->EnsureFileIsNotInUse( localFilePath );
+    
+    TMPXItemId itemId = *(media->Value<TMPXItemId>( KMPXMediaGeneralId ));
+
+    CMPXCommand* cmd = CreateMpxCommandLC( KMPXCommandIdCollectionRemoveMedia, 0, aSync );
+    cmd->SetTObjectValueL( KMPXMediaGeneralId, itemId );
+
+    TRAP_IGNORE( iStats->ActionStartL( KRemoveMediaActionId, _L("Remove media") ) );
+    iCurrentActionHasResponse = EFalse;
+    iCollectionUtility->Collection().CommandL( *cmd );
+
+    CleanupStack::PopAndDestroy( cmd );
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::RemoveMediaL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::RemoveMediaByMpxIdL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::RemoveMediaByMpxIdL( TInt aMpxId, TBool aSync )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTester::RemoveMediaByMpxIdL");
+
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTester:: mpx ID: %d", aMpxId);
+
+    CMPXCommand* cmd = CreateMpxCommandLC( KMPXCommandIdCollectionRemoveMedia, 0, aSync );
+    cmd->SetTObjectValueL( KMPXMediaGeneralId, aMpxId );
+
+    TRAP_IGNORE( iStats->ActionStartL( iTransactions->TransactionId(), _L("Remove media") ) );
+    iCurrentActionHasResponse = EFalse;
+    iCollectionUtility->Collection().CommandL( *cmd );
+    CleanupStack::PopAndDestroy( cmd );
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::RemoveMediaByMpxIdL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::GetAllMediaFullDetailsL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::GetAllMediaFullDetailsL()
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTester::GetAllMediaFullDetailsL");
+
+    CMPXMediaArray* fullMedias = CMPXMediaArray::NewL();
+
+    CleanupStack::PushL( fullMedias );
+
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTester:: media count: %d", iMediaArray->Count() );
+
+    if( GetCurrentLevel() != 3 )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: My videos category must be open!");
+        User::Leave( KErrGeneral );
+        }
+
+    for( TInt i=0; i<iMediaArray->Count(); i++ )
+        {
+        RArray<TMPXAttribute> attrs;
+        CleanupClosePushL(attrs);
+        // Empty attributes to get all the details.
+        CMPXCollectionPath* path = iCollectionUtility->Collection().PathL();
+        CleanupStack::PushL( path );
+        path->SelectL( i );
+
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTester:: Details for media at index: %d", i );
+
+        iGettingFullDetailsForAllMedia = ETrue;
+        iCollectionUtility->Collection().MediaL( *path, attrs.Array() );
+        CleanupStack::PopAndDestroy( path );
+        CleanupStack::PopAndDestroy( &attrs );
+
+        iActiveWait->Start();
+        iGettingFullDetailsForAllMedia = EFalse;
+
+        fullMedias->AppendL( iFullMedia->CopyL( *iFullMedia ) );
+        }
+
+    PrintMediasL( fullMedias, EFalse, _L("FullMedias") );
+
+    for( TInt i=0; i<fullMedias->Count(); i++ )
+        {
+        CMPXMedia* media = fullMedias->AtL(i);
+        }
+
+    CleanupStack::PopAndDestroy( fullMedias );
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::GetAllMediaFullDetailsL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::DeleteAllMediaFilesL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::DeleteAllMediaFilesL( )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTester::DeleteAllMediaFilesL");
+
+    RPointerArray<HBufC> fileList;
+    CleanupResetAndDestroyPushL( fileList );
+    
+    CMPXMedia* media = NULL;
+
+    for( TInt i = 0; i < iMediaArray->Count(); i++ )
+        {
+        media = (*iMediaArray)[i];
+
+        if( media->IsSupported( KMPXMediaGeneralUri ) )
+            {
+            const TDesC& localFilePath = media->ValueText( KMPXMediaGeneralUri );
+            fileList.Append( localFilePath.AllocL() );
+            }
+        }
+
+    for( TInt i = 0; i < fileList.Count(); i++ )
+        {
+        VCXLOGLO3("Item: %d, Local file path: %S", i, fileList[i]);
+
+        TInt err = iFs.Delete( *fileList[i] );
+        if( err != KErrNone )
+            {
+            VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: delete error: %d", err);
+            }
+        }
+
+    CleanupStack::PopAndDestroy( &fileList );
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::DeleteAllMediaFilesL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::DeleteFileOfMediaL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::DeleteFileOfMediaL( TInt aDrive, TInt aIndex )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTester::DeleteFileOfMediaL");
+
+    CMPXMedia* media = NULL;
+
+    TInt realIndex = GetMediaIndexInCollectionL( aDrive, aIndex );
+
+    media = (*iCollectionMediaArray)[realIndex];
+    if( media->IsSupported( KMPXMediaGeneralUri ) )
+        {
+        const TDesC& localFilePath = media->ValueText( KMPXMediaGeneralUri );
+        VCXLOGLO2("Local file path: %S", &localFilePath);
+
+        iTestCommon->EnsureFileIsNotInUse( localFilePath );
+        TInt err = iFs.Delete( localFilePath );
+        if( err != KErrNone )
+            {
+            VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: delete error: %d", err);
+            }
+        }
+    else
+        {
+        VCXLOGLO2("Item: %d, KMPXMediaGeneralUri not supported!", aIndex);
+        }
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::DeleteFileOfMediaL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::GetMediaL
+// -----------------------------------------------------------------------------
+//
+CMPXMedia* CVCXMyVideosCollectionPluginTester::GetMediaL( TInt aDrive, TInt aIndex )
+    {
+    CMPXMedia* media = NULL;
+
+    TInt realIndex = GetMediaIndexInCollectionL( aDrive, aIndex );
+
+    media = (*iCollectionMediaArray)[realIndex];
+    return media;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::MoveMediasL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::MoveMediasL( TInt aSourceDrive, TInt aStartIndex, TInt aEndIndex, TInt aDestDrive, TBool aSync )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTester::MoveMediasL");
+
+    CMPXMediaArray* medias = SelectMediasL( aSourceDrive, aStartIndex, aEndIndex );
+    CleanupStack::PushL( medias );
+
+    CMPXCommand* cmd = CreateMpxCommandLC( KVcxCommandIdMyVideos, KVcxCommandMyVideosMove, aSync );
+    cmd->SetTObjectValueL( KVcxMediaMyVideosInt32Value, aDestDrive );
+    if( medias )
+        {
+        cmd->SetCObjectValueL( KMPXMediaArrayContents, medias );
+        }
+    
+    TRAP_IGNORE( iStats->ActionStartL( iTransactions->TransactionId(), _L("Move medias") ) );
+    iCurrentActionHasResponse = ETrue;
+    iCollectionUtility->Collection().CommandL( *cmd );
+
+    CleanupStack::PopAndDestroy( cmd );
+    CleanupStack::PopAndDestroy( medias );
+
+    iActionCount += 2;
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::MoveMediasL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::CancelMoveL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::CancelMoveOrCopyL( TBool aSync )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTester::CancelMoveOrCopyL");
+
+    CMPXCommand* cmd = CreateMpxCommandLC( KVcxCommandIdMyVideos, KVcxCommandMyVideosCancelMoveOrCopy, aSync );
+    TRAP_IGNORE( iStats->ActionStartL( iTransactions->TransactionId(), _L("Cancel move or copy") ) );
+    iCurrentActionHasResponse = EFalse;
+    iCollectionUtility->Collection().CommandL( *cmd );
+    CleanupStack::PopAndDestroy( cmd );
+    
+    iCancelRequested = ETrue;
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::CancelMoveOrCopyL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::CopyMediasL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::CopyMediasL( TInt aSourceDrive, TInt aStartIndex, TInt aEndIndex, TInt aDestDrive, TBool aSync )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTester::CopyMediasL");
+
+    CMPXMediaArray* medias = SelectMediasL( aSourceDrive, aStartIndex, aEndIndex );
+    CleanupStack::PushL( medias );
+
+    CMPXCommand* cmd = CreateMpxCommandLC( KVcxCommandIdMyVideos, KVcxCommandMyVideosCopy, aSync );
+    cmd->SetTObjectValueL( KVcxMediaMyVideosInt32Value, aDestDrive );
+    if( medias )
+        {
+        cmd->SetCObjectValueL( KMPXMediaArrayContents, medias );
+        }
+    
+    TRAP_IGNORE( iStats->ActionStartL( iTransactions->TransactionId(), _L("Copy medias") ) );
+    iCurrentActionHasResponse = ETrue;
+    iCollectionUtility->Collection().CommandL( *cmd );
+
+    CleanupStack::PopAndDestroy( cmd );
+    CleanupStack::PopAndDestroy( medias );
+
+    iActionCount += 2;
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::CopyMediasL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::DeleteMediasL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::DeleteMediasL( TInt aSourceDrive, TInt aStartIndex, TInt aEndIndex, TBool aSync )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTester::DeleteMediasL");
+
+    CMPXMediaArray* medias = SelectMediasL( aSourceDrive, aStartIndex, aEndIndex );
+    CleanupStack::PushL( medias );
+
+    CMPXCommand* cmd = CreateMpxCommandLC( KVcxCommandIdMyVideos, KVcxCommandMyVideosDelete, aSync );
+    if( medias )
+        {
+        cmd->SetCObjectValueL( KMPXMediaArrayContents, medias );
+        }
+    TRAP_IGNORE( iStats->ActionStartL( iTransactions->TransactionId(), _L("Delete media") ) );
+    iCurrentActionHasResponse = ETrue;
+    iCollectionUtility->Collection().CommandL( *cmd );
+
+    CleanupStack::PopAndDestroy( cmd );
+    CleanupStack::PopAndDestroy( medias );
+
+    iActionCount += 2;
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::DeleteMediasL");
+    }
+
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::DeleteMediasByMpxIdsL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::DeleteMediasByMpxIdsL( CMPXMediaArray* aMedias, TBool aSync )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTester::DeleteMediasByMpxIdsL");
+
+    iRequestedMediaIds.Reset();
+    for( TInt i = 0; i < aMedias->Count(); i++ )
+        {
+        CMPXMedia* media = (*aMedias)[i];
+        TMPXItemId mpxId = *( media->Value<TMPXItemId>( KMPXMediaGeneralId ) );
+        iRequestedMediaIds.Append( mpxId.iId1 );
+        }
+        
+    CMPXCommand* cmd = CreateMpxCommandLC( KVcxCommandIdMyVideos, KVcxCommandMyVideosDelete, aSync );
+    if( aMedias )
+        {
+        cmd->SetCObjectValueL( KMPXMediaArrayContents, aMedias );
+        }
+    TRAP_IGNORE( iStats->ActionStartL( iTransactions->TransactionId(), _L("Delete media") ) );
+    iCurrentActionHasResponse = ETrue;
+    iCollectionUtility->Collection().CommandL( *cmd );
+
+    CleanupStack::PopAndDestroy( cmd );
+
+    iActionCount += 2;
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::DeleteMediasByMpxIdsL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::DeleteMediaByMpxIdL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::DeleteMediaByMpxIdL( TMPXItemId& aMpxId, TBool aSync )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTester::DeleteMediaByMpxIdL");
+    
+    CMPXMediaArray* medias = CMPXMediaArray::NewL();
+    CleanupStack::PushL( medias );
+
+    iRequestedMediaIds.Reset();
+    iRequestedMediaIds.Append( aMpxId.iId1 );
+    
+    CMPXMedia* newMedia = CMPXMedia::NewL();
+    CleanupStack::PushL( newMedia );
+    newMedia->SetTObjectValueL( KMPXMessageMediaGeneralId, aMpxId );
+    newMedia->SetTObjectValueL( KMPXMediaGeneralId, aMpxId );
+    medias->AppendL( *newMedia );
+    CleanupStack::PopAndDestroy( newMedia );
+    
+    CMPXCommand* cmd = CreateMpxCommandLC( KVcxCommandIdMyVideos, KVcxCommandMyVideosDelete, aSync );
+    if( medias )
+        {
+        cmd->SetCObjectValueL( KMPXMediaArrayContents, medias );
+        }
+    TRAP_IGNORE( iStats->ActionStartL( iTransactions->TransactionId(), _L("Delete media") ) );
+    iCurrentActionHasResponse = ETrue;
+    iCollectionUtility->Collection().CommandL( *cmd );
+
+    CleanupStack::PopAndDestroy( cmd );
+    CleanupStack::PopAndDestroy( medias );
+
+    iActionCount += 2;
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::DeleteMediaByMpxIdL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::CancelDeleteL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::CancelDeleteL( TBool aSync )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTester::CancelDeleteL");
+
+    CMPXCommand* cmd = CreateMpxCommandLC( KVcxCommandIdMyVideos, KVcxCommandMyVideosCancelDelete, aSync );
+    TRAP_IGNORE( iStats->ActionStartL( iTransactions->TransactionId(), _L("Cancel delete") ) );
+    iCurrentActionHasResponse = EFalse;
+    iCollectionUtility->Collection().CommandL( *cmd );
+    CleanupStack::PopAndDestroy( cmd );
+
+    iCancelRequested = ETrue;
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::CancelDeleteL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::SetAutomaticRefresh
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::SetAutomaticRefresh( TBool aValue )
+    {
+    iAutomaticContentRefresh = aValue;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::IsRefreshing
+// -----------------------------------------------------------------------------
+//
+TBool CVCXMyVideosCollectionPluginTester::IsRefreshing()
+    {
+    return iRefreshingCollection;
+    }
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::SetQuietMode
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::SetQuietMode( TBool aValue )
+    {
+    iQuietMode = aValue;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::StartDownloadL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::StartDownloadL( const TDesC& aTitle, TInt aIapId, TInt aServiceId,
+        TInt aContentId, const TDesC& aUrl, TBool aSync, const TDesC& aUserName, const TDesC& aPassword,
+        CMPXMedia* aMedia )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTester::StartDownloadL");
+
+    iUpdateDownloads = ETrue;
+    iDownloadsStarted = ETrue;
+
+    CMPXCommand* cmd = CreateMpxCommandLC( KVcxCommandIdMyVideos, KVcxCommandMyVideosStartDownload, aSync );
+
+    CMPXMedia* startDownloadReq(NULL);
+    if( !aMedia )
+        {
+        startDownloadReq = CMPXMedia::NewL();
+        CleanupStack::PushL( startDownloadReq );
+        }
+    else
+        {
+        startDownloadReq = aMedia;
+        }
+
+    //startDownloadReq->SetTObjectValueL( KVcxMediaMyVideosIapId, aIapId );
+    startDownloadReq->SetTObjectValueL( KVcxMediaMyVideosIapId, 0 );
+
+    // read only iap needed?
+    TUint flags = EVcxMyVideosServiceHasReadOnlyIap | EVcxMyVideosSilent;
+
+    startDownloadReq->SetTObjectValueL( KMPXMediaGeneralFlags, flags );
+
+    VCXLOGLO3("CVCXMyVideosCollectionPluginTester:: UserName: %S, Password: %S.", &aUserName, &aPassword);
+    
+    startDownloadReq->SetTextValueL( KMPXMediaGeneralTitle, aTitle );
+    startDownloadReq->SetTextValueL( KVcxMediaMyVideosRemoteUrl, aUrl );
+    startDownloadReq->SetTextValueL( KVcxMediaMyVideosUsername, aUserName);
+    startDownloadReq->SetTextValueL( KVcxMediaMyVideosPassword, aPassword);
+    
+    cmd->SetCObjectValueL<CMPXMedia>( KMPXCommandColAddMedia, startDownloadReq );
+
+    iDlWatcher->CreateDownloadL( aIapId, aServiceId, aContentId, aUrl, aSync, aUserName, aPassword );
+
+    VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: Making command.");
+    iCollectionUtility->Collection().CommandL( *cmd );
+
+    if( !aMedia )
+        {
+        CleanupStack::PopAndDestroy( startDownloadReq );
+        }
+
+    CleanupStack::PopAndDestroy( cmd );
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::StartDownloadL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::ResumeDownloadL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::ResumeDownloadL( const TDesC& aTitle, TInt aIapId, TInt aServiceId,
+        TInt aContentId, const TDesC& aUrl, TBool aSync, const TDesC& aUserName, const TDesC& aPassword,
+        CMPXMedia* aMedia
+        )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTester::ResumeDownloadL");
+
+    iUpdateDownloads = ETrue;
+    iDownloadsStarted = ETrue;
+
+    CMPXCommand* cmd = CreateMpxCommandLC( KVcxCommandIdMyVideos, KVcxCommandMyVideosStartDownload, aSync );
+
+    CMPXMedia* startDownloadReq(NULL);
+    if( !aMedia )
+        {
+        startDownloadReq = CMPXMedia::NewL();
+        CleanupStack::PushL( startDownloadReq );
+        }
+    else
+        {
+        startDownloadReq = aMedia;
+        }
+
+    //startDownloadReq->SetTObjectValueL( KVcxMediaMyVideosIapId, aIapId );
+    startDownloadReq->SetTObjectValueL( KVcxMediaMyVideosIapId, 0 );
+
+    // read only iap needed?
+    TUint flags = EVcxMyVideosServiceHasReadOnlyIap | EVcxMyVideosSilent;
+
+    startDownloadReq->SetTObjectValueL( KMPXMediaGeneralFlags, flags );
+
+    startDownloadReq->SetTextValueL( KMPXMediaGeneralTitle, aTitle );
+    startDownloadReq->SetTextValueL( KVcxMediaMyVideosRemoteUrl, aUrl );
+    startDownloadReq->SetTextValueL( KVcxMediaMyVideosUsername, aUserName);
+    startDownloadReq->SetTextValueL( KVcxMediaMyVideosPassword, aPassword);
+
+    cmd->SetCObjectValueL<CMPXMedia>( KMPXCommandColAddMedia, startDownloadReq );
+
+    CVCXMyVideosTestDownload* dl = iDlWatcher->GetDownload( aServiceId, aContentId, aUrl );
+    if( dl )
+        {
+        startDownloadReq->SetTObjectValueL( KVcxMediaMyVideosDownloadId, dl->iDownloadId );
+
+        TMPXItemId itemId;
+        itemId.iId1 = dl->iMpxId;
+        itemId.iId2 = 0;
+        startDownloadReq->SetTObjectValueL( KMPXMediaGeneralId, itemId );
+        
+        dl->iInformed = EFalse;
+        dl->iWaitingPause = EFalse;
+        }
+    else
+        {
+        startDownloadReq->SetTObjectValueL( KVcxMediaMyVideosDownloadId, 6666 );
+        iDlWatcher->CreateDownloadL( aIapId, aServiceId, aContentId, aUrl, aSync, aUserName, aPassword );
+        }
+
+    EnsureMediaFilesAreNotInUseL();
+    
+    VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: Making command.");
+    TRAP_IGNORE( iStats->ActionStartL( iTransactions->TransactionId(), _L("Resume download") ) );
+    iCurrentActionHasResponse = EFalse;
+    iCollectionUtility->Collection().CommandL( *cmd );
+
+    if( !aMedia )
+        {
+        CleanupStack::PopAndDestroy( startDownloadReq );
+        }
+
+    CleanupStack::PopAndDestroy( cmd );
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::ResumeDownloadL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::ResumeAllDownloadsL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::ResumeAllDownloadsL()
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTester::ResumeAllDownloadsL");
+
+    iUpdateDownloads = ETrue;
+    iDownloadsStarted = ETrue;
+
+    for( TInt i = 0; i < iDlWatcher->GetDownloadCount(); i++ )
+        {
+        CVCXMyVideosTestDownload* dl;
+        dl = iDlWatcher->GetDownloadByIndex( i );
+        if( dl && dl->iState == EVcxMyVideosDlStatePaused )
+            {
+            ResumeDownloadL( _L("resume"), dl->iIapId, dl->iServiceId, dl->iContentId, *dl->iUrl, dl->iSyncCall, *dl->iUserName, *dl->iPassword, NULL );
+            }
+        }
+     
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::ResumeAllDownloadsL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::CancelDownloadL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::CancelDownloadL( CVCXMyVideosTestDownload* aDownload, TBool aSync )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTester::CancelDownloadL");
+
+    if( !aDownload )
+        {
+        User::Leave( KErrArgument );
+        }
+
+    iUpdateDownloads = ETrue;
+
+    CMPXCommand* cmd = CreateMpxCommandLC( KVcxCommandIdMyVideos, KVcxCommandMyVideosCancelDownload, aSync );
+
+    CMPXMedia* cancelDownloadReq = CMPXMedia::NewL();
+    CleanupStack::PushL( cancelDownloadReq );
+
+    cancelDownloadReq->SetTObjectValueL<TMPXItemId>( KMPXMediaGeneralId, TMPXItemId ( aDownload->iMpxId, 0 ) );
+    cancelDownloadReq->SetTObjectValueL<TUint32>( KVcxMediaMyVideosDownloadId, aDownload->iDownloadId );
+    cancelDownloadReq->SetTextValueL( KMPXMediaGeneralUri, aDownload->iPath->Des() );
+
+    cmd->SetCObjectValueL<CMPXMedia>( KMPXCommandColAddMedia, cancelDownloadReq );
+    
+    iDlWatcher->CancelDownloadL( aDownload->iServiceId, aDownload->iContentId, *aDownload->iUrl );
+
+    VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: Making command.");
+    TRAP_IGNORE( iStats->ActionStartL( iTransactions->TransactionId(), _L("Cancel download") ) );
+    iCurrentActionHasResponse = EFalse;
+    iCollectionUtility->Collection().CommandL( *cmd );
+
+    CleanupStack::PopAndDestroy( cancelDownloadReq );
+    CleanupStack::PopAndDestroy( cmd );
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::CancelDownloadL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::CancelDownloadL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::CancelDownloadL( TInt aMpxId, TInt aDownloadId, const TPtrC& aDownloadPath, TBool aSync )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTester::CancelDownloadL (by IDs)");
+
+    iUpdateDownloads = ETrue;
+
+    CMPXCommand* cmd = CreateMpxCommandLC( KVcxCommandIdMyVideos, KVcxCommandMyVideosCancelDownload, aSync );
+
+    CMPXMedia* cancelDownloadReq = CMPXMedia::NewL();
+    CleanupStack::PushL( cancelDownloadReq );
+
+    CVCXMyVideosTestDownload* dl = iDlWatcher->GetDownloadByIndex(0);
+
+    TPtrC downloadPath( aDownloadPath );
+
+    if( aMpxId == -1 && dl )
+        {
+        aMpxId = dl->iMpxId;
+        }
+
+    if( aDownloadId == -1 && dl )
+        {
+        aDownloadId = dl->iDownloadId;
+        }
+
+    if( aDownloadPath == _L("NULL") && dl )
+        {
+        downloadPath.Set( *dl->iPath );
+        }
+
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTester:: mpxId: %d", aMpxId);
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTester:: downloadId: %d", aDownloadId);
+    VCXLOGLO2("CVCXMyVideosCollectionPluginTester:: downloadPath: %S", &aDownloadPath);
+
+    cancelDownloadReq->SetTObjectValueL<TMPXItemId>( KMPXMediaGeneralId, TMPXItemId ( aMpxId, 0 ) );
+    cancelDownloadReq->SetTObjectValueL<TUint32>( KVcxMediaMyVideosDownloadId, aDownloadId );
+    cancelDownloadReq->SetTextValueL( KMPXMediaGeneralUri, downloadPath );
+
+    cmd->SetCObjectValueL<CMPXMedia>( KMPXCommandColAddMedia, cancelDownloadReq );
+
+    VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: Making command.");
+    TRAP_IGNORE( iStats->ActionStartL( iTransactions->TransactionId(), _L("Cancel download") ) );
+    iCurrentActionHasResponse = EFalse;
+    iCollectionUtility->Collection().CommandL( *cmd );
+
+    CleanupStack::PopAndDestroy( cancelDownloadReq );
+    CleanupStack::PopAndDestroy( cmd );
+
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::CancelDownloadL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::PauseDownloadL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::PauseDownloadL( TInt aServiceId, TInt aContentId, const TDesC& aUrl, TBool aSync )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTester::PauseDownloadL");
+
+    iUpdateDownloads = ETrue;
+
+    CVCXMyVideosTestDownload* dl = iDlWatcher->GetDownload( aServiceId, aContentId, aUrl );
+    if( dl )
+        {
+        dl->iWaitingPause = ETrue;
+        }
+    else
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: Download not found!");
+        User::Leave( KErrNotFound );
+        }
+    CMPXCommand* cmd = CreateMpxCommandLC( KVcxCommandIdMyVideos, KVcxCommandMyVideosPauseDownload, aSync );
+
+    cmd->SetTObjectValueL( KVcxMediaMyVideosDownloadId, dl->iDownloadId );
+
+    VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: Making command.");
+    TRAP_IGNORE( iStats->ActionStartL( iTransactions->TransactionId(), _L("Pause download") ) );
+    iCurrentActionHasResponse = EFalse;
+    iCollectionUtility->Collection().CommandL( *cmd );
+
+    CleanupStack::PopAndDestroy( cmd );
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::PauseDownloadL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::PauseDownloadL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::PauseDownloadL( const TDesC& aUrl, TBool aSync )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTester::PauseDownloadL");
+
+    iUpdateDownloads = ETrue;
+
+    CMPXCommand* cmd = CreateMpxCommandLC( KVcxCommandIdMyVideos, KVcxCommandMyVideosPauseDownload, aSync );
+
+    CVCXMyVideosTestDownload* dl = iDlWatcher->GetDownload( aUrl );
+    if( !dl )
+        {
+        VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: Download not found!");
+        User::Leave( KErrNotFound );
+        }
+    else
+        {
+        dl->iWaitingPause = ETrue;
+        }
+    
+
+    cmd->SetTObjectValueL( KVcxMediaMyVideosDownloadId, dl->iDownloadId );
+
+    VCXLOGLO1("CVCXMyVideosCollectionPluginTester:: Making command.");
+    TRAP_IGNORE( iStats->ActionStartL( iTransactions->TransactionId(), _L("Pause download") ) );
+    iCurrentActionHasResponse = EFalse;
+    iCollectionUtility->Collection().CommandL( *cmd );
+
+    CleanupStack::PopAndDestroy( cmd );
+    VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::PauseDownloadL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::GetDownloadWatcher
+// -----------------------------------------------------------------------------
+//
+CVCXMyVideosTestDlWatcher* CVCXMyVideosCollectionPluginTester::GetDownloadWatcher()
+    {
+    return iDlWatcher;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::GetActiveDownloadCountL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTester::GetActiveDownloadCountL()
+    {
+    TInt count = 0;
+
+    CMPXMedia* media ( NULL );
+    for( TInt i = 0; i < iMediaArray->Count(); i++ )
+        {
+        media = (*iMediaArray)[i];
+
+        if( media->IsSupported( KVcxMediaMyVideosDownloadState ) )
+            {
+            TInt state = media->ValueTObjectL<TUint8>( KVcxMediaMyVideosDownloadState );
+
+            if( state == EVcxMyVideosDlStateDownloading || ( state == EVcxMyVideosDlStatePaused && iAutoResume ) )
+                {
+                count++;
+                }
+            }
+        }
+
+    VCXLOGLO2(">>>CVCXMyVideosCollectionPluginTester:: Active downloads: %d", count);
+
+    return count;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::SetAutoResume
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::SetAutoResume( TBool aValue )
+    {
+    iAutoResume = aValue;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::GetCurrentLevel
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTester::GetCurrentLevel()
+    {
+    if ( iCollectionUtility )
+        {
+        CMPXCollectionPath* path = iCollectionUtility->Collection().PathL();
+        TInt levels = path->Levels();
+        delete path;
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTester:: levels: %d", levels);
+        return levels;
+        }    
+    return KErrNotFound;    
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::GetCurrentOpenLevelIndex
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTester::GetCurrentOpenLevelIndex()
+    {
+    return iCurrentOpenedLevelIndex;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::GetLastFullMedia
+// -----------------------------------------------------------------------------
+//
+CMPXMedia* CVCXMyVideosCollectionPluginTester::GetLastFullMedia()
+    {
+    return iFullMedia;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::GetMediaIndexInCollectionL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTester::GetMediaIndexInCollectionL( TInt aDrive, TInt aIndex )
+    {
+    if( aIndex >= iMediaArray->Count() )
+        {
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTester:: Index (%d) out of bounds.", aIndex);
+        User::Leave( KErrArgument );
+        }
+
+    TInt foundIndex( KErrNotFound );
+    
+    if( aDrive == -1 )
+        {
+        // No drive specified.
+        foundIndex = aIndex;
+        }
+    else
+        {
+        // Get the index in iMediaArray for a video on aDrive at aIndex.
+        TInt indexOfMediaWithDrive(0);
+           
+        for( TInt i=0; i<iMediaArray->Count(); i++ )
+            {
+            CMPXMedia* media = (*iMediaArray)[i];
+    
+            if( media->IsSupported( KMPXMediaGeneralUri ) )
+                {
+                const TDesC& localFilePath = media->ValueText( KMPXMediaGeneralUri );
+                TInt drive(0);
+                User::LeaveIfError( iFs.CharToDrive( localFilePath[0], drive ) );
+               
+                if( drive == aDrive )
+                    {
+                    // We are at requested index for the drive. 
+                    if( indexOfMediaWithDrive == aIndex )
+                        {
+                        foundIndex = i;
+                        break;
+                        }
+                    indexOfMediaWithDrive++;
+                    }            
+                }
+            }
+        }
+    
+    if( foundIndex == KErrNotFound )
+        {
+        VCXLOGLO3("CVCXMyVideosCollectionPluginTester:: media not found with drive: %d, index: %d", aDrive, aIndex);
+        User::Leave( KErrNotFound );
+        }
+
+    // Get the video index in My Videos collection, it's not always same because videos on ROM are ignored.  
+
+    CMPXMedia* media = (*iMediaArray)[foundIndex];
+    
+    for( TInt i = 0; i < iCollectionMediaArray->Count(); i++ )
+        {
+        CMPXMedia* collMedia = (*iCollectionMediaArray)[i];
+        TMPXItemId itemId1 = *(media->Value<TMPXItemId>( KMPXMediaGeneralId ));
+        TMPXItemId itemId2 = *(collMedia->Value<TMPXItemId>( KMPXMediaGeneralId ));
+        
+        if( itemId1 == itemId2 )
+            {
+            foundIndex = i;
+            break;
+            }
+        }
+    
+    if( foundIndex == KErrNotFound )
+         {
+         VCXLOGLO3("CVCXMyVideosCollectionPluginTester:: media not found in collection array. drive: %d, index: %d", aDrive, aIndex);
+         User::Leave( KErrNotFound );
+         }    
+    
+    return foundIndex;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::GetVideoCountForDrive
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosCollectionPluginTester::GetVideoCountForDrive( TInt aDrive )
+    {  
+    if( !iMediaArray || iMediaArray->Count() == 0 ) return 0;
+    
+    TInt count( 0 );
+    
+    for( TInt i=0; i<iMediaArray->Count(); i++ )
+        {
+        CMPXMedia* media = (*iMediaArray)[i];
+
+        if( media->IsSupported( KMPXMediaGeneralUri ) )
+            {
+            const TDesC& localFilePath = media->ValueText( KMPXMediaGeneralUri );
+            TInt drive(0);
+            User::LeaveIfError( iFs.CharToDrive( localFilePath[0], drive ) );
+           
+            if( drive == aDrive )
+                {
+                count++;
+                }     
+            }
+        }
+    return count;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::GetAllCollectionMedia
+// -----------------------------------------------------------------------------
+//
+const CMPXMediaArray* CVCXMyVideosCollectionPluginTester::GetAllCollectionMedia()
+    {
+    return iCollectionMediaArray;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionTester::EnsureMediaFilesAreNotInUseL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::EnsureMediaFilesAreNotInUseL()
+    {
+    if( iMediaArray->Count() <= 0 ) return; 
+    
+    TInt retries = 200;
+    RFile64 file;
+    TInt error( KErrInUse );
+    
+    const TInt KEnsureMediasNotInUseID = 1234567;
+    
+    TRAP_IGNORE( iStats->ActionStartL( KEnsureMediasNotInUseID, _L("Ensure files.") ) );
+    
+    TBool filesLocked( ETrue );
+    // Check all files that they are not in use, retry few times.
+    while( --retries >= 0 && filesLocked ) 
+        {
+        filesLocked = EFalse;
+        
+        for( TInt i=0; i<iMediaArray->Count(); i++ )
+            {
+            CMPXMedia* media = (*iMediaArray)[i];
+            
+            if( media->IsSupported( KMPXMediaGeneralUri ) )
+                {
+                const TDesC& localFilePath = media->ValueText( KMPXMediaGeneralUri );
+
+                error = file.Open( iFs, localFilePath, EFileShareExclusive );
+                if( error == KErrInUse || error == KErrLocked )
+                    {
+                    filesLocked = ETrue;
+                    User::After( 1000000 * 5 ); // Wait
+                    break;
+                    }
+                file.Close();
+                }
+            }
+        }
+
+    if( error != KErrNone && error != KErrNotFound && error != KErrBadName )
+        {
+        TRAP_IGNORE( iStats->ActionEndL( KEnsureMediasNotInUseID, error ) );
+        VCXLOGLO2("CVCXMyVideosCollectionPluginTester::EnsureMediaFilesAreNotInUseL: error: %d", error);
+        User::Leave( error );
+        }
+    else
+        {
+        TRAP_IGNORE( iStats->ActionEndL( KEnsureMediasNotInUseID, KErrNone ) );
+        }
+    
+    VCXLOGLO1("CVCXMyVideosCollectionPluginTester::EnsureMediaFilesAreNotInUseL: All ok.");
+    }
+    
+// -----------------------------------------------------------------------------
+// CVCXMyVideosCollectionPluginTester::TimerComplete
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosCollectionPluginTester::TimerComplete( TInt /* aTimerId */, TInt /* aError */ )
+    {
+    if( iProgressTimer )
+        {
+        iProgressTimer->After( 1000000 );
+        }
+
+    if( !iMediaArray || !iDlWatcher )
+       {
+       return;
+       }
+
+    if( iDownloadsStarted && iUpdateDownloads && GetCurrentLevel() == 3 )
+        {
+       // Print short info about downloads
+       CMPXMedia* media( NULL );
+
+       VCXLOGLO2("CVCXMyVideosCollectionPluginTester::TimerComplete: medias: %d", iMediaArray->Count());
+       for( TInt i = 0; i < iMediaArray->Count(); i++ )
+           {
+           media = (*iMediaArray)[i];
+
+           if( media->IsSupported( KVcxMediaMyVideosDownloadState ) )
+               {
+               TInt state = media->ValueTObjectL<TUint8>( KVcxMediaMyVideosDownloadState );
+
+               TMPXItemId itemId = *(media->Value<TMPXItemId>( KMPXMediaGeneralId ));
+
+               TInt progress = -1;
+               if( media->IsSupported( KVcxMediaMyVideosDownloadProgress ) )
+                   {
+                   progress = media->ValueTObjectL<TInt8>( KVcxMediaMyVideosDownloadProgress );
+                   }
+
+               TUint32 downloadId = 0;
+               if( media->IsSupported( KVcxMediaMyVideosDownloadId ) )
+                   {
+                   downloadId = media->ValueTObjectL<TUint32>( KVcxMediaMyVideosDownloadId );
+                   }
+
+               CVCXMyVideosTestDownload* dl = iDlWatcher->GetDownloadByMpxId( itemId.iId1 );
+
+               if( dl )
+                   {
+//                   VCXLOGLO5("CVCXMyVideosCollectionPluginTester:: DL ID: %d, MPX ID: %d, state: %d, progress: %d", downloadId, itemId.iId1, state, progress );
+//                   VCXLOGLO3("CVCXMyVideosCollectionPluginTester:: serviceId: %d, contentId: %d", dl->iServiceId, dl->iContentId );
+                   iDlWatcher->UpdateDownloadProgressL( itemId.iId1, downloadId, progress );
+                   }
+               }
+           }
+        }
+    }
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/src/VCXMyVideosTestDlWatcher.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,840 @@
+/*
+* Copyright (c) 2002 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:   ?Description*
+*/
+
+
+// INCLUDE FILES
+#include <e32svr.h>
+#include "VCXMyVideosTestDlWatcher.h"
+#include "MVCXMyVideosCollectionPluginTesterObserver.h"
+#include "VCXMyVideosTestCommon.h"
+#include "VCXTestStatsKeeper.h"
+
+#include <BAUTILS.H>
+#include <HttpDownloadMgrCommon.h>
+
+#include "VCXTestLog.h"
+
+// CONSTANTS
+_LIT(KEVcxMyVideosDlStateNone, "EVcxMyVideosDlStateNone");
+_LIT(KEVcxMyVideosDlStateDownloading, "EVcxMyVideosDlStateDownloading");
+_LIT(KEVcxMyVideosDlStateFailed, "EVcxMyVideosDlStateFailed");
+_LIT(KEVcxMyVideosDlStatePaused, "EVcxMyVideosDlStatePaused");
+_LIT(KEVcxMyVideosDlStateDownloaded, "EVcxMyVideosDlStateDownloaded");
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestDlWatcher::NewL
+// -----------------------------------------------------------------------------
+//
+CVCXMyVideosTestDownload* CVCXMyVideosTestDownload::NewL()
+    {
+    VCXLOGLO1(">>>CVCXMyVideosTestDownload::NewL");
+    CVCXMyVideosTestDownload* self = new (ELeave) CVCXMyVideosTestDownload();
+    CleanupStack::PushL(self);
+    self->ConstructL( );
+    CleanupStack::Pop(self);
+    VCXLOGLO1("<<<CVCXMyVideosTestDownload::NewL");
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestDownload::CVCXMyVideosTestDownload
+// -----------------------------------------------------------------------------
+//
+CVCXMyVideosTestDownload::CVCXMyVideosTestDownload()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestDownload::~CVCXMyVideosTestDownload
+// -----------------------------------------------------------------------------
+//
+CVCXMyVideosTestDownload::~CVCXMyVideosTestDownload( )
+    {
+    delete iTitle;
+    iTitle = NULL;
+    delete iUrl;
+    iUrl = NULL;
+    delete iPath;
+    iPath = NULL;
+    delete iUserName;
+    iUserName = NULL;
+    delete iPassword;
+    iPassword = NULL;
+    delete iPath;
+    iPath = NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestDlWatcher::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosTestDownload::ConstructL( )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosTestDownload::ConstructL");
+    VCXLOGLO1("<<<CVCXMyVideosTestDownload::ConstructL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestDlWatcher::NewL
+// -----------------------------------------------------------------------------
+//
+CVCXMyVideosTestDlWatcher* CVCXMyVideosTestDlWatcher::NewL(
+            MVCXMyVideosCollectionPluginTesterObserver* aObserver, CVCXTestStatsKeeper* aStatsKeeper )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosTestDlWatcher::NewL");
+    CVCXMyVideosTestDlWatcher* self = new (ELeave) CVCXMyVideosTestDlWatcher( aStatsKeeper );
+    CleanupStack::PushL(self);
+    self->ConstructL( aObserver );
+    CleanupStack::Pop(self);
+    VCXLOGLO1("<<<CVCXMyVideosTestDlWatcher::NewL");
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestDlWatcher::CVCXMyVideosTestDlWatcher
+// -----------------------------------------------------------------------------
+//
+CVCXMyVideosTestDlWatcher::CVCXMyVideosTestDlWatcher( CVCXTestStatsKeeper* aStatsKeeper )
+  : iStats( aStatsKeeper )
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestDlWatcher::~CVCXMyVideosTestDlWatcher
+// -----------------------------------------------------------------------------
+//
+CVCXMyVideosTestDlWatcher::~CVCXMyVideosTestDlWatcher( )
+    {
+    iDownloads.ResetAndDestroy();
+    iFs.Close();
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestDlWatcher::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosTestDlWatcher::ConstructL( MVCXMyVideosCollectionPluginTesterObserver* aObserver )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosTestDlWatcher::ConstructL");
+    iObserver = aObserver;
+    User::LeaveIfError( iFs.Connect() );
+    iDlCheckDisabled = ETrue;
+    VCXLOGLO1("<<<CVCXMyVideosTestDlWatcher::ConstructL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestDlWatcher::CreateDownloadL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosTestDlWatcher::CreateDownloadL( TInt aIapId, TInt aServiceId, TInt aContentId, const TDesC& aUrl, TBool aSync, const TDesC& aUserName, const TDesC& aPassword )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosTestDlWatcher::CreateDownloadL");
+
+    VCXLOGLO3("CVCXMyVideosTestDlWatcher:: aServiceId: %d, aContentId: %d", aServiceId, aContentId);
+    PrintUrl( _L("CVCXMyVideosTestDlWatcher:: aUrl:"), aUrl );
+
+    CVCXMyVideosTestDownload* dl = CVCXMyVideosTestDownload::NewL();
+    iDownloads.Append( dl );
+
+    CleanupDownloadsL( aServiceId, aContentId, aUrl );
+    
+    dl->iState = EVcxMyVideosDlStateNone;
+    dl->iSyncCall = aSync;
+    dl->iUrl = aUrl.AllocL();
+    dl->iIapId = aIapId;
+    dl->iUserName = aUserName.AllocL();
+    dl->iPassword = aPassword.AllocL();
+    dl->iServiceId = aServiceId;
+    dl->iContentId = aContentId;
+
+    iDlCheckDisabled = EFalse;
+    
+    TRAP_IGNORE( iStats->ActionStartL( aUrl, _L("Download "), ETrue ) );
+
+    VCXLOGLO1("<<<CVCXMyVideosTestDlWatcher::CreateDownloadL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestDlWatcher::StartDownloadL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosTestDlWatcher::StartDownloadL( const TDesC& aUrl, const TDesC& aPath, TInt aDownloadId, TInt aMpxId,
+        const TDesC& aTitle, TVcxMyVideosDownloadState aState, TInt aProgress )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosTestDlWatcher::StartDownloadL");
+
+    VCXLOGLO3("CVCXMyVideosTestDlWatcher:: aMpxId: %d, aDownloadId: %d", aMpxId, aDownloadId);
+    PrintUrl( _L("aUrl:"), aUrl );
+
+    CVCXMyVideosTestDownload* dl = GetDownload( aUrl );
+    if( !dl )
+        {
+        CreateDownloadL( -1, -1, -1, aUrl, ETrue, _L(""), _L("") );
+        dl = GetDownload( aUrl );
+        if( !dl )
+            {
+            iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestErrorDownloadNotFound, KVCXMYVideosTestErrorDownloadNotFound );
+            VCXLOGLO1("<<<CVCXMyVideosTestDlWatcher::StartDownloadL");
+            return;
+            }
+        }
+
+    dl->iMpxId = aMpxId;
+    if( dl->iTitle )
+        {
+        delete dl->iTitle;
+        dl->iTitle = NULL;
+        }
+    dl->iTitle = aTitle.AllocL();
+    
+    if( dl->iPath )
+        {
+        delete dl->iPath;
+        }    
+    dl->iPath = aPath.AllocL();
+    
+    dl->iMpxId = aMpxId;
+
+    UpdateDownloadStateL( aMpxId, aDownloadId, aState, aProgress, KErrNone, KErrNone );
+    
+    VCXLOGLO1("<<<CVCXMyVideosTestDlWatcher::StartDownloadL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestDlWatcher::UpdateDownloadStateL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosTestDlWatcher::UpdateDownloadStateL( TInt aMpxId, TInt aDownloadId,
+        TVcxMyVideosDownloadState aState, TInt aProgress, TInt aDownloadError, TInt aGlobalError )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosTestDlWatcher::UpdateDownloadStateL");
+    
+    CVCXMyVideosTestDownload* dl = GetDownloadByMpxId( aMpxId );
+    if( !dl )
+        {
+        iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestErrorDownloadNotFound, KVCXMYVideosTestErrorDownloadNotFound );
+        VCXLOGLO1("<<<CVCXMyVideosTestDlWatcher::UpdateDownloadStateL");
+        return;
+        }
+    
+    TBool finishedDownload = dl && aState == EVcxMyVideosDlStateDownloaded && aDownloadId != 0
+                            && dl->iProgress >= 100 && dl->iState == EVcxMyVideosDlStateDownloaded;
+    
+    if( finishedDownload )
+        {
+        VCXLOGLO1("<<<CVCXMyVideosTestDlWatcher::UpdateDownloadStateL");
+        return;
+        }
+    
+    VCXLOGLO3("CVCXMyVideosTestDlWatcher:: aDownloadError: %d, aGlobalError: %d", aDownloadError, aGlobalError);
+    VCXLOGLO4("CVCXMyVideosTestDlWatcher:: aMpxId: %d, aState: %d, aProgress: %d", aMpxId, aState, aProgress);
+
+    // This is main error and will be informed to client always.
+    TInt error ( aGlobalError );
+
+    // For other download manager related errors the global error code should be better
+    if( aDownloadError == EInternal
+            | aDownloadError == EContentFileIntegrity
+            | aDownloadError == EDiskFull
+            | aDownloadError == EConnectionFailed
+            | aDownloadError == EMoveFailed
+            | aDownloadError == EDestFileWriteFailed
+            | aDownloadError == EMMCRemoved
+            | aDownloadError == EBadUrl
+            | aDownloadError == EWrongDestFilename
+            | aDownloadError == EDestFileInUse
+            | aDownloadError == EHttpUnhandled
+            | aDownloadError == EHttpAuthenticationFailed
+            | aDownloadError == EProxyAuthenticationFailed
+            | aDownloadError == EObjectNotFound
+            | aDownloadError == EPartialContentModified
+            | aDownloadError == EContentExpired
+            | aDownloadError == EHttpRestartFailed )
+        {
+        error = aDownloadError;
+        }
+
+    // Check for DL existance
+    dl->iExists = ETrue;
+
+    // Download was failed at previous update, inform client now.
+    if( dl->iGlobalError == KVCXMYVideosTestMessageDlFailed && !dl->iInformed )
+        {
+        if( error != KErrNone )
+            {
+            VCXLOGLO1("CVCXMyVideosTestDlWatcher::UpdateDownloadStateL - DL failed at last update, we have error now.");
+            iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageDlFailed, error );
+            dl->iInformed = ETrue;
+            TRAPD( actionErr, iStats->ActionEndL( *dl->iUrl, error ) );
+            if( actionErr == KErrAbort )
+                iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageCollectionGeneral, actionErr );
+            }
+        else
+            {
+            VCXLOGLO1("CVCXMyVideosTestDlWatcher::UpdateDownloadStateL - DL failed at last update, still no error.");
+            iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageDlFailed, dl->iGlobalError );
+            dl->iInformed = ETrue;
+            TRAPD( actionErr, iStats->ActionEndL( *dl->iUrl, dl->iGlobalError ) );
+            if( actionErr == KErrAbort )
+                iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageCollectionGeneral, actionErr );
+            }
+        }
+
+    // Inform the new state
+    if( dl->iState != aState )
+        {
+        VCXLOGLO2("CVCXMyVideosTestDlWatcher:: New state: %d", aState);
+        VCXLOGLO2("CVCXMyVideosTestDlWatcher:: Old state: %d", dl->iState);
+
+        // Unusual case, signal error to script.
+        if( dl->iState != EVcxMyVideosDlStateNone && aState == EVcxMyVideosDlStateNone && !dl->iCanceled )
+            {
+            VCXLOGLO1("CVCXMyVideosTestDlWatcher:: DL state changed to EVcxMyVideosDlStateNone, reporting as error.");
+            iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageDlGeneral, KVCXMYVideosTestMessageDlGeneral );
+            }
+
+        if( dl->iState == EVcxMyVideosDlStatePaused && dl->iWaitingResume )
+            {
+            dl->iWaitingResume = EFalse;
+            }
+
+        dl->iInformed = EFalse;
+        dl->iState = aState;
+        dl->iDownloadError = aDownloadError;
+        dl->iGlobalError = aGlobalError;
+        
+        TBuf<50> stateBuff;
+        TPtrC stateStr = GetStateDesc( static_cast<TVcxMyVideosDownloadState>( dl->iState ) );
+        stateBuff.Format( _L("State: %S"), &stateStr );
+        TRAP_IGNORE( iStats->ActionProgressL( *dl->iUrl, stateBuff ) );
+        }
+
+    UpdateDownloadProgressL( aMpxId, aDownloadId, aProgress );
+
+    dl->iDownloadId = aDownloadId;
+
+    // Handle states which are informed to observer.
+    if( !dl ->iInformed )
+    switch( dl->iState )
+        {
+        case EVcxMyVideosDlStateNone:
+            {
+
+            }
+            break;
+
+        case EVcxMyVideosDlStateDownloading:
+            {
+            dl->iInformed = ETrue;
+            iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageDlRunning, error );
+            }
+            break;
+
+        case EVcxMyVideosDlStateFailed:
+            {
+            if( error != KErrNone )
+                {
+                VCXLOGLO1("CVCXMyVideosTestDlWatcher::UpdateDownloadStateL - DL failed, we have error.");
+                iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageDlFailed, error );
+                TRAPD( actionErr, iStats->ActionEndL( *dl->iUrl, error ) );
+                if( actionErr == KErrAbort )
+                    iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageCollectionGeneral, actionErr );
+                
+                dl->iInformed = ETrue;
+                }
+            else
+                {
+                VCXLOGLO1("CVCXMyVideosTestDlWatcher::UpdateDownloadStateL - DL failed, no error yet.");
+                //iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageDlFailed, KVCXMYVideosTestMessageDlFailed );
+                // This will be informed at next update to client.
+                dl->iGlobalError = KVCXMYVideosTestMessageDlFailed;
+                }
+            }
+            break;
+
+        case EVcxMyVideosDlStatePaused:
+            {
+            dl->iInformed = ETrue;
+            iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageDlPaused, error );
+            // Unexpected pause state, stop action.
+            if( !dl->iWaitingPause )
+                {
+                TRAPD( actionErr, iStats->ActionEndL( *dl->iUrl, KErrGeneral ) );
+                if( actionErr == KErrAbort )
+                    iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageCollectionGeneral, actionErr );
+                }
+            dl->iWaitingPause = EFalse;
+            }
+            break;
+
+        case EVcxMyVideosDlStateDownloaded:
+            {
+            if( !BaflUtils::FileExists( iFs, *dl->iPath ) )
+                {
+                VCXLOGLO1("CVCXMyVideosTestDlWatcher:: DL finished without errors but file doesn't exist!");
+                iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestErrorFileNotFound, KVCXMYVideosTestErrorFileNotFound );
+                TRAPD( actionErr, iStats->ActionEndL( *dl->iUrl, KVCXMYVideosTestErrorFileNotFound ) );
+                if( actionErr == KErrAbort )
+                    iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageCollectionGeneral, actionErr );
+                dl->iInformed = ETrue;
+                }
+            else
+                {
+                dl->iInformed = ETrue;
+                iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageDlSucceeded, error );
+                TRAPD( actionErr, iStats->ActionEndL( *dl->iUrl, error ) );
+                if( actionErr == KErrAbort )
+                    iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageCollectionGeneral, actionErr );
+                }
+            }
+            break;
+
+        default:
+            break;
+        }
+
+    if( error != KErrNone && !dl->iInformed )
+        {
+        dl->iInformed = ETrue;
+        iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageDlGeneral, error );
+        }
+
+    VCXLOGLO1("<<<<CVCXMyVideosTestDlWatcher::UpdateDownloadStateL");
+    }
+
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestDlWatcher::UpdateDownloadProgressL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosTestDlWatcher::UpdateDownloadProgressL( TInt aMpxId, TInt aDownloadId, TInt aProgress )
+    {
+    CVCXMyVideosTestDownload* dl = GetDownloadByMpxId( aMpxId );
+    if( dl )
+        {
+        if( ( aProgress > dl->iProgress + KVCXTestProgressUpdateInterval ) || ( aProgress == 100 && dl->iProgress != 100 ) )
+            {
+            dl->iProgress = aProgress;
+            iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageDlProgressed, KErrNone );
+            TBuf<50> progressBuff;
+            progressBuff.Format( _L("Progress: %d"), aProgress );
+            TRAP_IGNORE( iStats->ActionProgressL( *dl->iUrl, progressBuff ) );
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestDlWatcher::CancelDownloadL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosTestDlWatcher::CancelDownloadL( TInt aServiceId, TInt aContentId, const TDesC& aUrl )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosTestDlWatcher::CancelDownloadL");
+    CVCXMyVideosTestDownload* dl = GetDownload( aServiceId, aContentId, aUrl );
+    if( dl )
+        {
+        dl->iCanceled = ETrue;
+        }
+    else
+        {
+        iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestErrorDownloadNotFound, KVCXMYVideosTestErrorDownloadNotFound );
+        }
+    VCXLOGLO1("<<<CVCXMyVideosTestDlWatcher::CancelDownloadL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestDlWatcher::SetDownloadResumedFlagL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosTestDlWatcher::SetDownloadResumedFlagL( TInt aMpxId, TInt /* aDownloadId */ )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosTestDlWatcher::SetDownloadResumedFlagL");
+
+    CVCXMyVideosTestDownload* dl = GetDownloadByMpxId( aMpxId );
+    if( dl )
+        {
+        dl->iWaitingResume = ETrue;
+        dl->iWaitingPause = EFalse;
+        dl->iInformed = EFalse;
+        dl->iDownloadError = KErrNone;
+        dl->iGlobalError = KErrNone;
+        }
+
+    VCXLOGLO1("<<<CVCXMyVideosTestDlWatcher::SetDownloadResumedFlagL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestDlWatcher::SetDownloadPausedFlagL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosTestDlWatcher::SetDownloadPausedFlagL( TInt aMpxId, TInt /* aDownloadId */ )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosTestDlWatcher::SetDownloadPausedFlagL");
+
+    CVCXMyVideosTestDownload* dl = GetDownloadByMpxId( aMpxId );
+    if( dl )
+        {
+        dl->iWaitingResume = EFalse;
+        dl->iWaitingPause = ETrue;
+        dl->iInformed = EFalse;
+        dl->iDownloadError = KErrNone;
+        dl->iGlobalError = KErrNone;
+        }
+
+    VCXLOGLO1("<<<CVCXMyVideosTestDlWatcher::SetDownloadPausedFlagL");
+    }
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestDlWatcher::GetDownloadByMpxId
+// -----------------------------------------------------------------------------
+//
+CVCXMyVideosTestDownload* CVCXMyVideosTestDlWatcher::GetDownloadByMpxId( TInt aMpxId )
+    {
+    for( TInt i=0; i<iDownloads.Count(); i++ )
+        {
+        if( iDownloads[i]->iMpxId == aMpxId )
+            {
+            return iDownloads[i];
+            }
+        }
+    return NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestDlWatcher::GetDownloadByDownloadId
+// -----------------------------------------------------------------------------
+//
+CVCXMyVideosTestDownload* CVCXMyVideosTestDlWatcher::GetDownloadByDownloadId( TInt aDownloadId )
+    {
+    for( TInt i=0; i<iDownloads.Count(); i++ )
+        {
+        if( iDownloads[i]->iDownloadId == aDownloadId )
+            {
+            return iDownloads[i];
+            }
+        }
+    return NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestDlWatcher::GetDownload
+// -----------------------------------------------------------------------------
+//
+CVCXMyVideosTestDownload* CVCXMyVideosTestDlWatcher::GetDownload( TInt aServiceId, TInt aContentId, const TDesC& aUrl )
+    {
+    for( TInt i=0; i<iDownloads.Count(); i++ )
+        {
+        if( iDownloads[i]->iServiceId == aServiceId &&
+            iDownloads[i]->iContentId == aContentId &&
+            iDownloads[i]->iUrl->Des() == aUrl )
+            {
+            return iDownloads[i];
+            }
+        }
+    return NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestDlWatcher::GetDownloadByIndex
+// -----------------------------------------------------------------------------
+//
+CVCXMyVideosTestDownload* CVCXMyVideosTestDlWatcher::GetDownloadByIndex( TInt aIndex )
+    {
+    if( aIndex >= iDownloads.Count() ) return NULL;
+    return iDownloads[aIndex];
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestDlWatcher::GetDownloadCount
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosTestDlWatcher::GetDownloadCount()
+    {
+    return iDownloads.Count();
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestDlWatcher::GetFailedDownloadCount
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosTestDlWatcher::GetFailedDownloadCount()
+    {
+    TInt count( 0 );
+
+    for( TInt i=0; i<iDownloads.Count(); i++ )
+        {
+        if( iDownloads[i]->iState == EVcxMyVideosDlStateFailed )
+            {
+            count++;
+            }
+        }
+
+    return count;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestDlWatcher::CleanupDownloadsL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosTestDlWatcher::CleanupDownloadsL( TInt aServiceId, TInt aContentId, const TDesC& aUrl )
+    {
+    if( aUrl.Length() <= 0 ) return;
+
+    // Remove duplicates which are finished.
+    for( TInt i=iDownloads.Count()-1; i>=0; i-- )
+        {
+        if( iDownloads[i]->iUrl &&
+            iDownloads[i]->iServiceId == aServiceId &&
+            iDownloads[i]->iContentId == aContentId &&
+            iDownloads[i]->iUrl->Des() == aUrl &&
+            ( iDownloads[i]->iState == EVcxMyVideosDlStateDownloaded ||
+              iDownloads[i]->iState == EVcxMyVideosDlStateFailed ) )
+            {
+            CVCXMyVideosTestDownload* dl = iDownloads[i];
+            iDownloads.Remove( i );
+            delete dl;
+            }
+        }
+    
+    // Keep only 10 newest downloads.
+    if( iDownloads.Count() > 10 )
+        {
+        TInt tooMany = iDownloads.Count() - 10;
+        for( TInt i = tooMany - 1; i >= 0; i-- )
+            {
+            CVCXMyVideosTestDownload* dl = iDownloads[i];
+            iDownloads.Remove( i );
+            delete dl;
+            }
+        }
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestDlWatcher::GetDownload
+// -----------------------------------------------------------------------------
+//
+CVCXMyVideosTestDownload* CVCXMyVideosTestDlWatcher::GetDownload( const TDesC& aUrl )
+    {
+    CVCXMyVideosTestDownload* dl( NULL );
+
+    for( TInt i=0; i<iDownloads.Count(); i++ )
+        {
+        if( iDownloads[i]->iUrl->Des() == aUrl )
+            {
+            // Take first with same URL.
+            if( dl == NULL )
+                {
+                dl = iDownloads[i];
+                }
+            else
+                {
+                // If there's more dl items with same URL then prefer one with dl state none.
+                if( iDownloads[i]->iState == EVcxMyVideosDlStateNone )
+                    {
+                    dl = iDownloads[i];
+                    }
+                }
+            }
+        }
+    return dl;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestDlWatcher::PrintDownloads
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosTestDlWatcher::PrintDownloads( )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosTestDlWatcher::PrintDownloads");
+
+    for( TInt i=0; i<iDownloads.Count(); i++ )
+        {
+        CVCXMyVideosTestDownload* dl = iDownloads[i];
+        VCXLOGLO1("--------------------------------------------------------------------------------");
+
+        if( dl->iTitle )
+            {
+            TPtr titlePtr = dl->iTitle->Des();
+            VCXLOGLO2("CVCXMyVideosTestDlWatcher:: iTitle: %S", &titlePtr);
+            }
+        if( dl->iPath )
+            {
+            TPtr pathPtr = dl->iPath->Des();
+            VCXLOGLO2("CVCXMyVideosTestDlWatcher:: iPath: %S", &pathPtr);
+            }
+        VCXLOGLO2("CVCXMyVideosTestDlWatcher:: iMpxId: %d", dl->iMpxId);
+        VCXLOGLO2("CVCXMyVideosTestDlWatcher:: iDownloadId: %d", dl->iDownloadId);
+        VCXLOGLO2("CVCXMyVideosTestDlWatcher:: iContentId: %d", dl->iContentId);
+        VCXLOGLO2("CVCXMyVideosTestDlWatcher:: iServiceId: %d", dl->iServiceId);
+        PrintUrl( _L("CVCXMyVideosTestDlWatcher:: iUrl:"), *dl->iUrl );
+        VCXLOGLO2("CVCXMyVideosTestDlWatcher:: iProgress: %d", dl->iProgress);
+        VCXLOGLO2("CVCXMyVideosTestDlWatcher:: iDownloadError: %d", dl->iDownloadError);
+        VCXLOGLO2("CVCXMyVideosTestDlWatcher:: iGlobalError: %d", dl->iGlobalError);
+        VCXLOGLO2("CVCXMyVideosTestDlWatcher:: iInformed: %d", dl->iInformed);
+        VCXLOGLO2("CVCXMyVideosTestDlWatcher:: iWaitingResume: %d", dl->iWaitingResume);
+
+        TPtrC stateDesc = GetStateDesc( static_cast<TVcxMyVideosDownloadState>( dl->iState ) );
+        
+        VCXLOGLO2("CVCXMyVideosTestDlWatcher:: State: %S", &stateDesc);
+        }
+    VCXLOGLO1("<<<CVCXMyVideosTestDlWatcher::PrintDownloads");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestDlWatcher::PrintUrl
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosTestDlWatcher::PrintUrl( const TDesC& aPre, const TDesC& aUrl )
+    {
+    if( aUrl.Length() > 80 )
+        {
+        TPtrC left( aUrl.Left( 38 ) );
+        TPtrC right( aUrl.Right( 38 ) );
+        VCXLOGLO4("%S %S..%S", &aPre, &left, &right );
+        }
+    else
+        {
+        VCXLOGLO3("%S %S", &aPre, &aUrl );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestDlWatcher::PrepareCheck
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosTestDlWatcher::PrepareCheck( )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosTestDlWatcher::PrepareCheck");
+
+    for( TInt i=0; i<iDownloads.Count(); i++ )
+        {
+        iDownloads[i]->iExists = EFalse;
+        }
+
+    iDlCheckActive = ETrue;
+    VCXLOGLO1("<<<CVCXMyVideosTestDlWatcher::PrepareCheck");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestDlWatcher::FinishCheckL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosTestDlWatcher::FinishCheckL( )
+    {
+    if( iDownloads.Count() <= 0) return;
+
+    VCXLOGLO1(">>>CVCXMyVideosTestDlWatcher::FinishCheckL");
+
+    // Check that all downloads exist.
+    for( TInt i = iDownloads.Count()-1; i>=0; i-- )
+        {
+        if( !iDownloads[i]->iExists )
+            {
+            if( iDownloads[i]->iCanceled )
+                {
+                TRAPD( actionErr, iStats->ActionEndL( *iDownloads[i]->iUrl, KErrNone ) );
+                if( actionErr == KErrAbort )
+                    iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageCollectionGeneral, actionErr );
+                VCXLOGLO2("CVCXMyVideosTestDlWatcher:: Dl is canceled, mpxId: %d.", iDownloads[i]->iMpxId);
+                CVCXMyVideosTestDownload* dl = iDownloads[i];
+                iDownloads.Remove( i );
+                delete dl;
+                iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageDlCanceled, KErrNone );
+                }
+            else
+                {
+                if( iDownloads[i]->iState != EVcxMyVideosDlStateNone &&
+                    iDownloads[i]->iState != EVcxMyVideosDlStateDownloaded &&
+                    !iDlCheckDisabled )
+                    {
+                    TRAP_IGNORE( iStats->ActionTraceL( _L("Download item was not found.") ) );
+                    TRAPD( actionErr, iStats->ActionEndL( *iDownloads[i]->iUrl, KErrNone ) );
+                    if( actionErr == KErrAbort )
+                        iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageCollectionGeneral, actionErr );
+                    
+                    VCXLOGLO2("CVCXMyVideosTestDlWatcher:: Dl doesn't exist anymore, mpxId: %d. Error!", iDownloads[i]->iMpxId);
+                    iObserver->HandleVcxMvTesterMessageL( KVCXMYVideosTestMessageDlFailed, KErrCorrupt );
+                    CVCXMyVideosTestDownload* dl = iDownloads[i];
+                    iDownloads.Remove( i );
+                    delete dl;                    
+                    }
+                }
+            }
+        }
+
+    iDlCheckActive = EFalse;
+    VCXLOGLO1("<<<CVCXMyVideosTestDlWatcher::FinishCheckL");
+    }
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestDlWatcher::DisableDownloadCheck
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosTestDlWatcher::DisableDownloadCheck( )
+    {
+    iDlCheckDisabled = ETrue;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestDlWatcher::Reset
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosTestDlWatcher::Reset( )
+    {
+    iDownloads.ResetAndDestroy();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestDlWatcher::GetStateDesc
+// -----------------------------------------------------------------------------
+//
+const TDesC& CVCXMyVideosTestDlWatcher::GetStateDesc( TVcxMyVideosDownloadState aState )
+    {
+    switch( aState )
+        {
+        default:
+        case EVcxMyVideosDlStateNone:
+            {
+            return KEVcxMyVideosDlStateNone;
+            }
+
+        case EVcxMyVideosDlStateDownloading:
+            {
+            return KEVcxMyVideosDlStateDownloading;
+            }
+
+        case EVcxMyVideosDlStateFailed:
+            {
+            return KEVcxMyVideosDlStateFailed;
+            }
+
+        case EVcxMyVideosDlStatePaused:
+            {
+            return KEVcxMyVideosDlStatePaused;
+            }
+
+        case EVcxMyVideosDlStateDownloaded:
+            {
+            return KEVcxMyVideosDlStateDownloaded;
+            }
+        }
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/src/VCXMyVideosTestServiceEmu.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,299 @@
+/*
+* Copyright (c) 2002 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:   ?Description*
+*/
+
+
+
+// INCLUDE FILES
+#include "VCXMyVideosTestServiceEmu.h"
+#include "VCXTestLog.h"
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+CVCXMyVideosTestContent* CVCXMyVideosTestContent::NewL( TInt aServiceId, TInt aContentId, const TPtrC& aUrl, const TPtrC& aTitle )
+    {
+    CVCXMyVideosTestContent* self = new (ELeave) CVCXMyVideosTestContent();
+    CleanupStack::PushL(self);
+    self->ConstructL( aServiceId, aContentId, aUrl, aTitle );
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+CVCXMyVideosTestContent::CVCXMyVideosTestContent()
+    {
+    }
+
+CVCXMyVideosTestContent::~CVCXMyVideosTestContent()
+    {
+    delete iUrl;
+    iUrl = NULL;
+    delete iTitle;
+    iTitle = NULL;
+    }
+
+void CVCXMyVideosTestContent::ConstructL( TInt aServiceId, TInt aContentId, const TPtrC& aUrl, const TPtrC& aTitle )
+    {
+    iServiceId = aServiceId;
+    iContentId = aContentId;
+    iUrl = aUrl.AllocL();
+    iTitle = aTitle.AllocL();
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestServiceEmu::NewL
+// -----------------------------------------------------------------------------
+//
+CVCXMyVideosTestServiceEmu* CVCXMyVideosTestServiceEmu::NewL()
+    {
+    VCXLOGLO1(">>>CVCXMyVideosTestServiceEmu::NewL");
+    CVCXMyVideosTestServiceEmu* self = new (ELeave) CVCXMyVideosTestServiceEmu();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    VCXLOGLO1("<<<CVCXMyVideosTestServiceEmu::NewL");
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestServiceEmu::CVCXMyVideosTestServiceEmu
+// -----------------------------------------------------------------------------
+//
+CVCXMyVideosTestServiceEmu::CVCXMyVideosTestServiceEmu( )
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestServiceEmu::~CVCXMyVideosTestServiceEmu
+// -----------------------------------------------------------------------------
+//
+CVCXMyVideosTestServiceEmu::~CVCXMyVideosTestServiceEmu( )
+    {
+    iContents.ResetAndDestroy();
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestServiceEmu::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosTestServiceEmu::ConstructL()
+    {
+    VCXLOGLO1(">>>CVCXMyVideosTestServiceEmu::ConstructL");
+
+    AddServiceContentL( KVcxTestServiceName1, 0, _L("rtsp://vishnu.wipsl.com/oops/winter_fun.mp4"), _L("rtsp1") );
+	AddServiceContentL( KVcxTestServiceName1, 1, _L("rtsp://vishnu.wipsl.com/oops/oops1_1.mp4"), _L("rtsp2") );
+	AddServiceContentL( KVcxTestServiceName1, 2, _L("rtsp://vishnu.wipsl.com/oops/oops1_2.mp4"), _L("rtsp3") );
+	AddServiceContentL( KVcxTestServiceName1, 3, _L("rtsp://vishnu.wipsl.com/oops/oops1_3.mp4"), _L("rtsp4") );
+	AddServiceContentL( KVcxTestServiceName1, 4, _L("rtsp://vishnu.wipsl.com/oops/oops2_1.mp4"), _L("rtsp5") );
+	AddServiceContentL( KVcxTestServiceName1, 5, _L("rtsp://vishnu.wipsl.com/oops/oops2_2.mp4"), _L("rtsp6") );
+	AddServiceContentL( KVcxTestServiceName1, 6, _L("rtsp://vishnu.wipsl.com/oops/oops2_3.mp4"), _L("rtsp7") );
+	AddServiceContentL( KVcxTestServiceName1, 7, _L("rtsp://vishnu.wipsl.com/oops/speedway1.mp4"), _L("rtsp8") );
+	AddServiceContentL( KVcxTestServiceName1, 8, _L("rtsp://vishnu.wipsl.com/oops/speedway1.mp4"), _L("rtsp9") );
+	AddServiceContentL( KVcxTestServiceName1, 9, _L("rtsp://vishnu.wipsl.com/oops/speedway1.mp4"), _L("rtsp10") );
+
+    AddServiceContentL( KVcxTestServiceName2, 0, _L("http://193.65.182.78/nokia_vod/bar.mp4"), _L("nokiavod1") );
+    AddServiceContentL( KVcxTestServiceName2, 1, _L("http://193.65.182.78/nokia_vod/gallery.mp4"), _L("nokiavod2") );
+    AddServiceContentL( KVcxTestServiceName2, 2, _L("http://193.65.182.78/nokia_vod/restaurant.mp4"), _L("nokiavod3") );
+    AddServiceContentL( KVcxTestServiceName2, 3, _L("http://193.65.182.78/nokia_vod/waterski.mp4"), _L("nokiavod4") );
+    AddServiceContentL( KVcxTestServiceName2, 4, _L("http://193.65.182.78/nokia_vod/wedding.mp4"), _L("nokiavod5") );
+    AddServiceContentL( KVcxTestServiceName2, 5, _L("http://193.65.182.78/nokia_vod/videos/Nokia_N93_Sample_Video_Clip_3.mp4"), _L("nokiavod6") );
+    AddServiceContentL( KVcxTestServiceName2, 6, _L("http://193.65.182.78/nokia_vod/videos/Nokia_N93_sample_nosound_1.mov"), _L("nokiavod7") );
+    AddServiceContentL( KVcxTestServiceName2, 7, _L("http://193.65.182.78/nokia_vod/videos/Nokia_N93_sample_nosound_2.mov"), _L("nokiavod8") );
+    AddServiceContentL( KVcxTestServiceName2, 8, _L("http://193.65.182.78/nokia_vod/videos/N80160AVC3gp15f.3gp"), _L("nokiavod9") );
+
+    AddServiceContentL( KVcxTestServiceName3, 0, _L("http://193.65.182.78/videos/enginetesting.mp4"), _L("enginetest0_6megs") );
+    AddServiceContentL( KVcxTestServiceName3, 1, _L("http://193.65.182.78/videos/enginetesting2.mp4"), _L("enginetest1_6megs") );
+    AddServiceContentL( KVcxTestServiceName3, 2, _L("http://193.65.182.78/videos/enginetesting3.mp4"), _L("enginetest2_6megs") );
+    AddServiceContentL( KVcxTestServiceName3, 3, _L("http://193.65.182.78/videos/enginetesting4.mp4"), _L("enginetest3_3megs") );
+    AddServiceContentL( KVcxTestServiceName3, 4, _L("http://193.65.182.78/videos/enginetesting5.mp4"), _L("enginetest4_3megs") );
+    AddServiceContentL( KVcxTestServiceName3, 5, _L("http://193.65.182.78/videos/enginetesting6.mp4"), _L("enginetest5_3megs") );
+    AddServiceContentL( KVcxTestServiceName3, 6, _L("http://193.65.182.78/videos/enginetesting7.mp4"), _L("enginetest6_3megs") );
+    AddServiceContentL( KVcxTestServiceName3, 7, _L("http://193.65.182.78/videos/enginetesting8.mp4"), _L("enginetest7_3megs") );
+    AddServiceContentL( KVcxTestServiceName3, 8, _L("http://193.65.182.78/videos/enginetesting9.mp4"), _L("enginetest8_3megs") );
+    AddServiceContentL( KVcxTestServiceName3, 9, _L("http://193.65.182.78/videos/enginetesting10.mp4"), _L("enginetest9_3megs") );
+    AddServiceContentL( KVcxTestServiceName3, 10, _L("http://193.65.182.78/Nseries/video1.3gp"), _L("enginetest10_3megs") );
+    AddServiceContentL( KVcxTestServiceName3, 11, _L("http://193.65.182.78/Nseries/video2.3gp"), _L("enginetest11_3megs") );
+    AddServiceContentL( KVcxTestServiceName3, 12, _L("http://193.65.182.78/Nseries/video3.3gp"), _L("enginetest12_3megs") );
+    AddServiceContentL( KVcxTestServiceName3, 13, _L("http://193.65.182.78/Nseries/video4.3gp"), _L("enginetest13_3megs") );
+    AddServiceContentL( KVcxTestServiceName3, 14, _L("http://193.65.182.78/Nseries/video5.3gp"), _L("enginetest14_3megs") );
+    AddServiceContentL( KVcxTestServiceName3, 15, _L("http://193.65.182.78/Nseries/video6.3gp"), _L("enginetest15_3megs") );
+    AddServiceContentL( KVcxTestServiceName3, 16, _L("http://193.65.182.78/Nseries/video7.3gp"), _L("enginetest16_3megs") );
+    AddServiceContentL( KVcxTestServiceName3, 17, _L("http://193.65.182.78/Nseries/video8.3gp"), _L("enginetest17_3megs") );
+    AddServiceContentL( KVcxTestServiceName3, 18, _L("http://193.65.182.78/Nseries/video9.3gp"), _L("enginetest18_3megs") );
+    AddServiceContentL( KVcxTestServiceName3, 19, _L("http://193.65.182.78/videos/enginetesting.mp4"), _L("enginetest19_sameurlwith0") );
+    AddServiceContentL( KVcxTestServiceName3, 20, _L("http://193.65.182.78/videos/Malchik_Gei.3gp"), _L("enginetest20_13megs") );
+
+    AddServiceContentL( KVcxTestServiceName4, 0, _L("http://193.65.182.78/misc/smallvideos/small1.3gp"), _L("small0") );
+    AddServiceContentL( KVcxTestServiceName4, 1, _L("http://193.65.182.78/misc/smallvideos/small2.3gp"), _L("small1") );
+    AddServiceContentL( KVcxTestServiceName4, 2, _L("http://193.65.182.78/misc/smallvideos/small3.3gp"), _L("small2") );
+    AddServiceContentL( KVcxTestServiceName4, 3, _L("http://193.65.182.78/misc/smallvideos/small4.3gp"), _L("small3") );
+    AddServiceContentL( KVcxTestServiceName4, 4, _L("http://193.65.182.78/misc/smallvideos/small5.3gp"), _L("small4") );
+    AddServiceContentL( KVcxTestServiceName4, 5, _L("http://193.65.182.78/misc/smallvideos/small6.3gp"), _L("small5") );
+    AddServiceContentL( KVcxTestServiceName4, 6, _L("http://193.65.182.78/misc/smallvideos/small7.3gp"), _L("small6") );
+    AddServiceContentL( KVcxTestServiceName4, 7, _L("http://193.65.182.78/misc/smallvideos/small8.3gp"), _L("small7") );
+    AddServiceContentL( KVcxTestServiceName4, 8, _L("http://193.65.182.78/misc/smallvideos/small9.3gp"), _L("small8") );
+    AddServiceContentL( KVcxTestServiceName4, 9, _L("http://193.65.182.78/misc/smallvideos/small10.3gp"), _L("smal9l") );
+    AddServiceContentL( KVcxTestServiceName4, 10, _L("http://193.65.182.78/misc/smallvideos/small11.3gp"), _L("small10") );
+    AddServiceContentL( KVcxTestServiceName4, 11, _L("http://193.65.182.78/misc/smallvideos/small12.3gp"), _L("small11") );
+    AddServiceContentL( KVcxTestServiceName4, 12, _L("http://193.65.182.78/misc/smallvideos/small13.3gp"), _L("small12") );
+    AddServiceContentL( KVcxTestServiceName4, 13, _L("http://193.65.182.78/misc/smallvideos/small14.3gp"), _L("small13") );
+    AddServiceContentL( KVcxTestServiceName4, 14, _L("http://193.65.182.78/misc/smallvideos/small15.3gp"), _L("small14") );
+    AddServiceContentL( KVcxTestServiceName4, 15, _L("http://193.65.182.78/misc/smallvideos/small16.3gp"), _L("small15") );
+    AddServiceContentL( KVcxTestServiceName4, 16, _L("http://193.65.182.78/misc/smallvideos/small17.3gp"), _L("small16") );
+    AddServiceContentL( KVcxTestServiceName4, 17, _L("http://193.65.182.78/misc/smallvideos/small18.3gp"), _L("small17") );
+    AddServiceContentL( KVcxTestServiceName4, 18, _L("http://193.65.182.78/misc/smallvideos/small19.3gp"), _L("small18") );
+    AddServiceContentL( KVcxTestServiceName4, 19, _L("http://193.65.182.78/misc/smallvideos/small20.3gp"), _L("small19") );
+    AddServiceContentL( KVcxTestServiceName4, 19, _L("http://193.65.182.78/misc/smallvideos/small20.3gp"), _L("small19") );
+
+    AddServiceContentL( KVcxTestServiceName5, 0, _L("http://193.65.182.78/videos/misc/TuntematonSotilas_mpeg4_QVGA_768.mp4"), _L("GIGAHUGE") );
+    AddServiceContentL( KVcxTestServiceName5, 1, _L("http://193.65.182.78/videos/misc/elephantsdream-480-ipod.mp4"), _L("elephant_83MB") );
+    AddServiceContentL( KVcxTestServiceName5, 2, _L("http://193.65.182.78/videos/misc/Tatu-Live_at_Muz-TV_Awards_2005-XviD-TATU.RU.mp4"), _L("tatulive_53MB") );
+    AddServiceContentL( KVcxTestServiceName5, 3, _L("http://193.65.182.78/videos/misc/Bob%20Marley%20-%20No%20woman%20no%20cry.mp4"), _L("bob_33MB") );
+    AddServiceContentL( KVcxTestServiceName5, 4, _L("http://193.65.182.78/videos/misc/PrettyFU.mp4"), _L("FU_39MB") );
+    AddServiceContentL( KVcxTestServiceName5, 5, _L("http://193.65.182.78/videos/misc/Starz.mp4"), _L("starz_29MB") );
+    AddServiceContentL( KVcxTestServiceName5, 6, _L("http://193.65.182.78/videos/misc/Prostye%20Dvizinya.mp4"), _L("tatuprosty_26MB") );
+    AddServiceContentL( KVcxTestServiceName5, 7, _L("http://193.65.182.78/videos/misc/Taty-Nas_ne_dogonyat.mp4"), _L("tatu_nas_ne_25MB") );
+    AddServiceContentL( KVcxTestServiceName5, 8, _L("http://193.65.182.78/videos/misc/All_the_Things_She_Said_Carson_Daily_Live_tatumedia.net.mp4"), _L("tatu_allthings_25MB") );
+    AddServiceContentL( KVcxTestServiceName5, 9, _L("http://193.65.182.78/videos/misc/Ya%20Soshla%20S%20Uma.mp4"), _L("tatu_soshla_24MB") );
+    AddServiceContentL( KVcxTestServiceName5, 10, _L("http://193.65.182.78/videos/misc/Loves%20Me%20Not%20(Otro%20Rollo).mp4"), _L("loves_me_not_23MB") );
+    AddServiceContentL( KVcxTestServiceName5, 11, _L("http://193.65.182.78/videos/misc/Malchik_Gei_(MTV_Poland).mp4"), _L("tatu_malchik_21MB") );
+    AddServiceContentL( KVcxTestServiceName5, 12, _L("http://193.65.182.78/videos/misc/Depeche%20Mode%20-%20Suffer%20Well.mp4"), _L("SUFFER_WELL_21MB") );
+    AddServiceContentL( KVcxTestServiceName5, 13, _L("http://193.65.182.78/videos/misc/how_soon_is_now.mp4"), _L("how_soon_is_now_WAT_21MB") );
+    AddServiceContentL( KVcxTestServiceName5, 14, _L("http://193.65.182.78/videos/misc/Depeche%20Mode%20-%20John%20The%20Revelator.mp4"), _L("John_revelator_19MB") );
+    AddServiceContentL( KVcxTestServiceName5, 15, _L("http://193.65.182.78/videos/misc/Depeche%20Mode%20-%20Enjoy%20the%20silence.mp4"), _L("depeche_enjoy_silence_18MB") );
+    AddServiceContentL( KVcxTestServiceName5, 16, _L("http://193.65.182.78/videos/misc/PCD_Musica2.mp4"), _L("PCD_18MB") );
+    AddServiceContentL( KVcxTestServiceName5, 17, _L("http://193.65.182.78/videos/short/2seconds.mp4"), _L("2seconds") );
+    AddServiceContentL( KVcxTestServiceName5, 18, _L("http://193.65.182.78/videos/short/6seconds.mp4"), _L("6seconds") );
+    AddServiceContentL( KVcxTestServiceName5, 19, _L("http://193.65.182.78/videos/short/11seconds.mp4"), _L("11seconds") );
+    AddServiceContentL( KVcxTestServiceName5, 20, _L("http://193.65.182.78/videos/short/16seconds.mp4"), _L("16seconds") );
+    AddServiceContentL( KVcxTestServiceName5, 21, _L("http://193.65.182.78/videos/misc/video_18kb.3gp"), _L("tiny_18KB") );
+
+    VCXLOGLO1("<<<CVCXMyVideosTestServiceEmu::ConstructL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestServiceEmu::GetServiceIdL
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosTestServiceEmu::GetServiceIdL( const TDesC& aServiceName, TInt& aServiceId )
+    {
+
+    aServiceId = -1;
+
+    if( aServiceName == KVcxTestServiceName1 )
+        {
+        aServiceId = 1;
+        }
+
+    if( aServiceName == KVcxTestServiceName2 )
+        {
+        aServiceId = 2;
+        }
+
+    if( aServiceName == KVcxTestServiceName3 )
+        {
+        aServiceId = 3;
+        }
+
+    if( aServiceName == KVcxTestServiceName4 )
+        {
+        aServiceId = 4;
+        }
+
+    if( aServiceName == KVcxTestServiceName5 )
+        {
+        aServiceId = 5;
+        }
+
+    TInt ret = KErrNone;
+
+    if( aServiceId == -1 )
+        {
+        ret = KErrNotFound;
+        }
+
+    return ret;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestServiceEmu::GetContentUrlL
+// -----------------------------------------------------------------------------
+//
+const TPtrC CVCXMyVideosTestServiceEmu::GetContentUrlL( TInt aServiceId, TInt aContentId )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosTestServiceEmu::GetContentUrlL");
+
+    for( TInt i=0; i<iContents.Count(); i++ )
+        {
+        if( iContents[i]->iServiceId == aServiceId && iContents[i]->iContentId == aContentId )
+            {
+            return iContents[i]->iUrl->Des();
+            }
+        }
+
+    User::Leave( KErrNotFound );
+
+    VCXLOGLO1("<<<CVCXMyVideosTestServiceEmu::GetContentUrlL");
+    return NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestServiceEmu::GetContentTitleL
+// -----------------------------------------------------------------------------
+//
+const TPtrC CVCXMyVideosTestServiceEmu::GetContentTitleL( TInt aServiceId, TInt aContentId )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosTestServiceEmu::GetContentTitleL");
+
+    for( TInt i=0; i<iContents.Count(); i++ )
+        {
+        if( iContents[i]->iServiceId == aServiceId && iContents[i]->iContentId == aContentId )
+            {
+            return iContents[i]->iTitle->Des();
+            }
+        }
+
+    User::Leave( KErrNotFound );
+
+    VCXLOGLO1("<<<CVCXMyVideosTestServiceEmu::GetContentTitleL");
+    return NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestServiceEmu::AddServiceContentL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosTestServiceEmu::AddServiceContentL( const TDesC& aServiceName, TInt aContentId, const TDesC& aUrl, const TDesC& aTitle )
+    {
+    TInt serviceId(0);
+    GetServiceIdL( aServiceName, serviceId );
+    CVCXMyVideosTestContent* content = CVCXMyVideosTestContent::NewL( serviceId, aContentId, aUrl, aTitle );
+    iContents.Append( content );
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/src/VCXMyVideosTestTransactions.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,138 @@
+/*
+* Copyright (c) 2002 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:   ?Description*
+*/
+
+
+// INCLUDE FILES
+#include "VCXMyVideosTestTransactions.h"
+#include "VCXTestLog.h"
+
+// CONSTANTS
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestDlWatcher::NewL
+// -----------------------------------------------------------------------------
+//
+CVCXMyVideosTestTransactions* CVCXMyVideosTestTransactions::NewL()
+    {
+    VCXLOGLO1(">>>CVCXMyVideosTestTransactions::NewL");
+    CVCXMyVideosTestTransactions* self = new (ELeave) CVCXMyVideosTestTransactions();
+    CleanupStack::PushL(self);
+    self->ConstructL( );
+    CleanupStack::Pop(self);
+    VCXLOGLO1("<<<CVCXMyVideosTestTransactions::NewL");
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestTransactions::CVCXMyVideosTestTransactions
+// -----------------------------------------------------------------------------
+//
+CVCXMyVideosTestTransactions::CVCXMyVideosTestTransactions()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestTransactions::~CVCXMyVideosTestTransactions
+// -----------------------------------------------------------------------------
+//
+CVCXMyVideosTestTransactions::~CVCXMyVideosTestTransactions( )
+    {
+        
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestDlWatcher::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosTestTransactions::ConstructL( )
+    {
+    VCXLOGLO1(">>>CVCXMyVideosTestTransactions::ConstructL");
+    
+    VCXLOGLO1("<<<CVCXMyVideosTestTransactions::ConstructL");
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestDlWatcher::TransactionId
+// -----------------------------------------------------------------------------
+//
+TUint32 CVCXMyVideosTestTransactions::TransactionId( )
+    {
+    return iTransactionId;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestDlWatcher::NextTransactionId
+// -----------------------------------------------------------------------------
+//
+TUint32 CVCXMyVideosTestTransactions::NextTransactionId()
+    {
+    return ++iTransactionId;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestDlWatcher::AddTransactionId
+// -----------------------------------------------------------------------------
+//
+void CVCXMyVideosTestTransactions::AddTransactionId( TUint32 aCommandId )
+    {
+    VCXLOGLO3("CVCXMyVideosTestTransactions::AddTransactionId: add transactionId: %d, commandId: %d", iTransactionId, aCommandId);
+    iTransactionIds.Append( iTransactionId );
+    iCommandIds.Append( aCommandId );
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestDlWatcher::TransactionResponse
+// -----------------------------------------------------------------------------
+//
+TBool CVCXMyVideosTestTransactions::TransactionResponse( TUint32 aTransactionId )
+    {
+    VCXLOGLO2("CVCXMyVideosTestTransactions::TransactionResponse: %d", aTransactionId );
+    
+    for( TInt i = iTransactionIds.Count() - 1; i >= 0; i-- )
+        {
+        if( iTransactionIds[i] == aTransactionId )
+            {
+            iTransactionIds.Remove( i );
+            iCommandIds.Remove( i );
+            VCXLOGLO1("CVCXMyVideosTestTransactions::TransactionResponse: found transaction.");
+            return ETrue;
+            }
+        }
+    
+    return EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// CVCXMyVideosTestDlWatcher::CheckTransactions
+// -----------------------------------------------------------------------------
+//
+TInt CVCXMyVideosTestTransactions::CheckTransactions( )
+    {
+    for( TInt i = 0; i < iTransactionIds.Count(); i++ )
+        {
+        VCXLOGLO3("CVCXMyVideosTestTransactions::CheckTransactions: transactionId: %d, commandId: %d", iTransactionIds[i], iCommandIds[i]);
+        }
+    
+    if( iTransactionIds.Count() > 0 )
+        {
+        return KErrCorrupt;
+        }
+    return KErrNone;
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/src/VCXTestMdsDbModifier.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,794 @@
+/*
+* Copyright (c) 2002 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:   ?Description*
+*/
+
+
+// Copied from vcxmyvideosmdsdb.cpp, keep up to date.
+
+//#include <harvesterclient.h>
+#include <e32svr.h>
+#include <e32def.h>
+#include <bautils.h>
+#include <mpxmedia.h>
+#include <mpxmediacontainerdefs.h>
+#include <mpxmediageneraldefs.h>
+#include <mpxmediageneralextdefs.h>
+#include <mpxmediaarray.h>
+#include <mpxmediavideodefs.h>
+#include <mdeconstants.h>
+#include <mdequery.h>
+
+#include <vcxmyvideosdefs.h>
+
+#include "VCXTestLog.h"
+#include "VCXTestMdsDbModifier.h"
+//#include "vcxmyvideoscollectionutil.h"
+
+_LIT( KVcxVideoObjectName, "Video" );
+                                                              //1 (ID)
+_LIT( KVcxTitlePropertyName, "Title" );                       //2
+_LIT( KVcxDescriptionPropertyName, "Description" );           //3
+                                                              //4 (file path = URI)
+_LIT( KVcxSizePropertyName, "Size" );                         //5
+
+_LIT( KVcxCreationDatePropertyName, "CreationDate" );         //6 creation date is saved to 2 properties
+_LIT( KVcxTimeOffsetPropertyName, "TimeOffset" );             //6
+
+_LIT( KVcxFlagsPropertyName, "RecordingFlags" );              //7 flags are saved
+_LIT( KVcxDrmPropertyName, "DRM");                            //7 to both of these
+
+_LIT( KVcxCopyrightPropertyName, "Copyright" );               //8
+_LIT( KVcxItemTypePropertyName, "ItemType" );                 //9 (mime type)
+_LIT( KVcxLastModifiedDatePropertyName, "LastModifiedDate" ); //10
+_LIT( KVcxAgeProfilePropertyName, "AgeProfile" );             //11
+_LIT( KVcxAudioLanguagePropertyName, "AudioLanguage" );       //12
+_LIT( KVcxAuthorPropertyName, "Author" );                     //13
+_LIT( KVcxOriginPropertyName, "Origin" );                     //14
+_LIT( KVcxDurationPropertyName, "Duration" );                 //15
+_LIT( KVcxLastPlayPositionPropertyName, "LastPlayPosition" ); //16
+_LIT( KVcxDownloadIdPropertyName, "DownloadID" );             //17
+_LIT( KVcxRatingPropertyName, "Rating" );                     //19
+_LIT( KVcxBitratePropertyName, "Bitrate" );                   //20
+_LIT( KVcxAudioFourCcPropertyName, "AudioFourCC" );           //21
+
+// ---------------------------------------------------------------------------
+// This is TCleanupOperation function which clears the db in use flag
+// ---------------------------------------------------------------------------
+//
+static void ClearDbInUseFlag( TAny* aBoolPtr )
+    {
+    *(static_cast<TBool*>(aBoolPtr)) = EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+CVCXTestMdsDbModifier::CVCXTestMdsDbModifier()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CVCXTestMdsDbModifier::ConstructL()
+    {
+    VCXLOGLO1( "CVCXTestMdsDbModifier::ConstructL" );
+
+    User::LeaveIfError( iRfs.Connect() );
+
+    iActiveSchedulerWait = new (ELeave) CActiveSchedulerWait;
+
+    //  Mark the db to be in use
+    iDbInUse = ETrue;
+
+    CleanupStack::PushL( TCleanupItem( ClearDbInUseFlag, &iDbInUse ) );
+
+    VCXLOGLO1( "CVCXTestMdsDbModifier::ConstructL CMdESession::NewL" );
+
+    //  Create session
+    iMDSError = KErrNone;
+
+    iMDSSession = CMdESession::NewL( *this );
+    if (!iMDSSession)
+        {
+        //  Failed to create session, leave
+        User::Leave( iMDSError );
+        }
+
+    //  Wait until session opened
+    iActiveSchedulerWait->Start();
+
+    VCXLOGLO1( "CVCXTestMdsDbModifier::ConstructL iActiveSchedulerWait->Start done" );
+
+    if ( iMDSError != KErrNone )
+        {
+        VCXLOGLO2("Failed to create session to MDS: %d", iMDSError);
+        User::LeaveIfError( iMDSError );
+        }
+
+    //  Get the schema definitions
+    iMDSError = KErrNone;
+    GetSchemaDefinitionsL();
+
+    iDbInUse = EFalse;
+
+    //  Is schema ok
+    if ( iMDSError != KErrNone )
+        {
+        //  Schema not loaded, abort
+        User::Leave( iMDSError );
+        }
+
+    //  The db is not in use anymore, iDbInUse clearer item
+    CleanupStack::PopAndDestroy();
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+CVCXTestMdsDbModifier* CVCXTestMdsDbModifier::NewL()
+    {
+    CVCXTestMdsDbModifier* self =
+            CVCXTestMdsDbModifier::NewLC();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+CVCXTestMdsDbModifier* CVCXTestMdsDbModifier::NewLC()
+    {
+    CVCXTestMdsDbModifier* self = new( ELeave ) CVCXTestMdsDbModifier();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+CVCXTestMdsDbModifier::~CVCXTestMdsDbModifier()
+    {
+    VCXLOGLO1( "CVCXTestMdsDbModifier::~CVCXTestMdsDbModifier()" );
+
+    if ( iMDSSession )
+        {
+        TRAP_IGNORE( iMDSSession->RemoveObjectObserverL( *this ) );
+        }
+
+    delete iMDSSession;
+    delete iActiveSchedulerWait;
+
+    iRfs.Close();
+    }
+
+// ---------------------------------------------------------------------------
+// CVCXTestMdsDbModifier::RemoveVideoL
+// ---------------------------------------------------------------------------
+//
+TInt CVCXTestMdsDbModifier::RemoveVideoL(
+        TUint32 aMdsId )
+    {
+    VCXLOGLO1( "CVCXTestMdsDbModifier::RemoveVideoL" );
+
+    TInt retValue = KErrNone;
+
+    VCXLOGLO2( "CVCXTestMdsDbModifier:: removing object %d", aMdsId );
+
+    TItemId id = iMDSSession->RemoveObjectL( aMdsId );
+
+    if ( id == KNoId )
+        {
+        VCXLOGLO1( "CVCXTestMdsDbModifier:: video not found" );
+        retValue = KErrNotFound;
+        }
+    else
+        {
+        VCXLOGLO1( "CVCXTestMdsDbModifier:: remove successful" );
+        }
+
+    return retValue;
+    }
+
+// ---------------------------------------------------------------------------
+// CVCXTestMdsDbModifier::UpdateVideoL
+// ---------------------------------------------------------------------------
+//
+void CVCXTestMdsDbModifier::UpdateVideoL(
+        CMPXMedia& aVideo )
+    {
+    VCXLOGLO1( "CVCXTestMdsDbModifier::UpdateVideoL" );
+
+    TMPXItemId mpxId = aVideo.ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId );
+
+    VCXLOGLO2("CVCXTestMdsDbModifier::UpdateVideoL updating object %d ", mpxId.iId1);
+
+    CMdEObject* object =
+            iMDSSession->OpenObjectL( mpxId.iId1, *iVideoObjectDef );
+    if ( !object )
+        {
+        // No object with this ID was found!
+        VCXLOGLO1("CVCXTestMdsDbModifier::UpdateVideoL no object found");
+        User::Leave( KErrNotFound );
+        }
+    else
+        {
+        VCXLOGLO1("CVCXTestMdsDbModifier::UpdateVideoL object found");
+
+        if ( object->OpenForModifications() )
+            {
+            CleanupStack::PushL( object ); // 1->
+
+            Media2ObjectL( aVideo, *object );
+
+            iMDSSession->CommitObjectL(*object);
+
+            CleanupStack::PopAndDestroy(object);
+            }
+        else
+            {
+            // Object is already locked!
+            VCXLOGLO1("CVCXTestMdsDbModifier::UpdateVideoL object was locked!");
+            delete object;
+            User::Leave( KErrInUse );
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CVCXTestMdsDbModifier::DeleteVideoL.
+// ---------------------------------------------------------------------------
+//
+TInt CVCXTestMdsDbModifier::DeleteVideoL(
+        TUint32 aFileId,
+        TInt& aResultCount,
+        TBool aForcedDelete /*= EFalse */ )
+    {
+    VCXLOGLO1( "CVCXTestMdsDbModifier::DeleteVideoL" );
+
+    TInt err = KErrNone;
+    aResultCount = 0;
+
+    if (aForcedDelete)
+        {
+        TItemId id = iMDSSession->RemoveObjectL( aFileId );
+
+        err = (id == KNoId) ? KErrNotFound : KErrNone;
+        }
+
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MMdEQueryObserver.
+// ---------------------------------------------------------------------------
+//
+void CVCXTestMdsDbModifier::HandleQueryNewResults(
+        CMdEQuery& /* aQuery */,
+        TInt /* aFirstNewItemIndex */,
+        TInt /* aNewItemCount */ )
+    {
+    VCXLOGLO1( "CVCXTestMdsDbModifier::HandleQueryNewResults" );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MMdEQueryObserver.
+// ---------------------------------------------------------------------------
+//
+void CVCXTestMdsDbModifier::HandleQueryCompleted(
+        CMdEQuery& /*aQuery*/,
+        TInt /*aError*/)
+    {
+    VCXLOGLO1( "CVCXTestMdsDbModifier::HandleQueryCompleted" );
+
+    if (iActiveSchedulerWait->IsStarted())
+        {
+        iActiveSchedulerWait->AsyncStop();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From class MMdESessionObserver.
+// ---------------------------------------------------------------------------
+//
+void CVCXTestMdsDbModifier::HandleSessionOpened(
+        CMdESession& /*aSession*/,
+        TInt aError)
+    {
+    VCXLOGLO1( "CVCXTestMdsDbModifier::HandleSessionOpened" );
+
+    iActiveSchedulerWait->AsyncStop();
+
+    if (aError != KErrNone)
+        {
+        VCXLOGLO2( "CVCXTestMdsDbModifier::HandleSessionOpened: %d", aError );
+
+        iMDSError = aError;
+        delete iMDSSession;
+        iMDSSession = NULL;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From class MMdESessionObserver.
+// ---------------------------------------------------------------------------
+//
+void CVCXTestMdsDbModifier::HandleSessionError(
+        CMdESession& /*aSession*/,
+        TInt aError)
+    {
+    VCXLOGLO1( "CVCXTestMdsDbModifier::HandleSessionError" );
+
+    if (iActiveSchedulerWait->IsStarted())
+        {
+        iActiveSchedulerWait->AsyncStop();
+        }
+
+    VCXLOGLO2( "CVCXTestMdsDbModifier::HandleSessionError: %d", aError );
+
+    iMDSError = aError;
+    delete iMDSSession;
+    iMDSSession = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MMdESchemaObserver.
+// ---------------------------------------------------------------------------
+//
+void CVCXTestMdsDbModifier::HandleSchemaModified()
+    {
+    VCXLOGLO1( "CVCXTestMdsDbModifier::HandleSchemaModified" );
+    TRAP( iMDSError, GetSchemaDefinitionsL() );
+    }
+
+// ---------------------------------------------------------------------------
+// CVCXTestMdsDbModifier::HandleObjectNotification
+// ---------------------------------------------------------------------------
+//
+void CVCXTestMdsDbModifier::HandleObjectNotification(
+        CMdESession& /*aSession*/,
+        TObserverNotificationType /* aType */,
+        const RArray<TItemId>& /* aObjectIdArray */ )
+    {
+    VCXLOGLO1( "CVCXTestMdsDbModifier::HandleObjectNotification" );
+    }
+
+// ---------------------------------------------------------------------------
+// CVCXTestMdsDbModifier::Media2ObjectL
+// Called by AddVideoL()
+// ---------------------------------------------------------------------------
+//
+void CVCXTestMdsDbModifier::Media2ObjectL(
+        CMPXMedia& aVideo,
+        CMdEObject& aObject)
+    {
+    VCXLOGLO1( "CVCXTestMdsDbModifier::Media2ObjectL" );
+
+    CMdEProperty* property;
+
+    // 1. MDS ID
+
+    // 2. TITLE (NAME)
+    if ( aVideo.IsSupported( KMPXMediaGeneralTitle ) )
+        {
+        VCXLOGLO1( "CVCXTestMdsDbModifier::Media2ObjectL: Setting KMPXMediaGeneralTitle" );
+        if ( aObject.Property( *iTitlePropertyDef, property, 0 ) != KErrNotFound )
+            {
+            static_cast<CMdETextProperty*>(property)->SetValueL(
+                    aVideo.ValueText( KMPXMediaGeneralTitle ) );
+            }
+        else
+            {
+            aObject.AddTextPropertyL(
+                    *iTitlePropertyDef, aVideo.ValueText( KMPXMediaGeneralTitle ) );
+            }
+        }
+
+    // 3. DESC
+    if ( aVideo.IsSupported( KMPXMediaGeneralComment ) )
+        {
+        VCXLOGLO1( "CVCXTestMdsDbModifier::Media2ObjectL: Setting KMPXMediaGeneralComment" );
+        if ( aObject.Property( *iDescriptionPropertyDef, property, 0 ) != KErrNotFound )
+            {
+            static_cast<CMdETextProperty*>(property)->SetValueL(
+                    aVideo.ValueText( KMPXMediaGeneralComment ) );
+            }
+        else
+            {
+            aObject.AddTextPropertyL(
+                    *iDescriptionPropertyDef, aVideo.ValueText( KMPXMediaGeneralComment ) );
+            }
+        }
+#if 0
+    // 4. URI ( = file path )
+    if ( aVideo.IsSupported( KMPXMediaGeneralUri ) )
+        {
+        VCXLOGLO1( "CVCXTestMdsDbModifier::Media2ObjectL: Setting KMPXMediaGeneralUri" );
+        aObject.SetUriL( aVideo.ValueText( KMPXMediaGeneralUri ) );
+        TVolumeInfo volInfo;
+        // 4.1 MEDIA ID ( = drive number )
+        if ( iRfs.Volume( volInfo, TVcxMyVideosCollectionUtil::DriveLetter2DriveNumber(
+                aObject.Uri() ) ) == KErrNone)
+            {
+            aObject.SetMediaId( volInfo.iUniqueID );
+            }
+        }
+#endif
+
+    // 5. KMPXMediaGeneralSize
+    if ( aVideo.IsSupported( KMPXMediaGeneralSize ) )
+        {
+        TUint32 size = 0;
+        TInt sizeInMediaObject = aVideo.ValueTObjectL<TInt>( KMPXMediaGeneralSize );
+        VCXLOGLO2( "CVCXTestMdsDbModifier::Media2ObjectL: Setting KMPXMediaGeneralSize: %d", sizeInMediaObject );
+        size = static_cast<TUint32>( sizeInMediaObject );
+
+        if ( aObject.Property( *iSizePropertyDef, property, 0 ) != KErrNotFound )
+            {
+            static_cast<CMdEUint32Property*>( property )->SetValueL( size );
+            }
+        else
+            {
+            aObject.AddUint32PropertyL( *iSizePropertyDef, size );
+            }
+        }
+
+    // KMPXMediaGeneralExtSizeInt64
+    if ( aVideo.IsSupported( KMPXMediaGeneralExtSizeInt64 ) )
+        {
+        TUint32 size = 0;
+        TInt64 sizeInMediaObject = aVideo.ValueTObjectL<TInt64>( KMPXMediaGeneralExtSizeInt64 );
+        VCXLOGLO2( "CVCXTestMdsDbModifier::Media2ObjectL: Setting KMPXMediaGeneralExtSizeInt64: %Ld", sizeInMediaObject );
+        size = static_cast<TUint32>( sizeInMediaObject );
+
+        if ( aObject.Property( *iSizePropertyDef, property, 0 ) != KErrNotFound )
+            {
+            static_cast<CMdEUint32Property*>( property )->SetValueL( size );
+            }
+        else
+            {
+            aObject.AddUint32PropertyL( *iSizePropertyDef, size );
+            }
+        }
+
+    // 6. KMPXMediaGeneralDate ( creation date )
+    if ( aVideo.IsSupported( KMPXMediaGeneralDate ) )
+        {
+        VCXLOGLO1( "CVCXTestMdsDbModifier::Media2ObjectL: Setting KMPXMediaGeneralDate" );
+        TInt64 creationDateInt64 = 0;
+        creationDateInt64 = aVideo.ValueTObjectL<TInt64>( KMPXMediaGeneralDate );
+        TTime creationDate( creationDateInt64 );
+        if ( aObject.Property( *iCreationDatePropertyDef, property, 0 ) != KErrNotFound )
+            {
+            static_cast<CMdETimeProperty*>(property)->SetValueL( creationDate );
+            }
+        else
+            {
+            aObject.AddTimePropertyL( *iCreationDatePropertyDef, creationDate );
+            }
+        }
+
+    // 7. KMPXMediaGeneralFlags (including DRM flag)
+    if ( aVideo.IsSupported( KMPXMediaGeneralFlags ) )
+        {
+        TUint32 flags = aVideo.ValueTObjectL<TUint32>( KMPXMediaGeneralFlags );
+        VCXLOGLO2( "CVCXTestMdsDbModifier::Media2ObjectL: Setting KMPXMediaGeneralFlags: %d", KMPXMediaGeneralFlags );
+        if ( aObject.Property( *iFlagsPropertyDef, property, 0 ) != KErrNotFound )
+            {
+            static_cast<CMdEUint32Property*>(property)->SetValueL( flags );
+            }
+        else
+            {
+            aObject.AddUint32PropertyL( *iFlagsPropertyDef, flags );
+            }
+
+        TBool drmProtected;
+        if ( flags & EVcxMyVideosVideoDrmProtected )
+            {
+            drmProtected = ETrue;
+            }
+        else
+            {
+            drmProtected = EFalse;
+            }
+
+        VCXLOGLO2( "CVCXTestMdsDbModifier::Media2ObjectL: Setting drmProtected: %d", drmProtected );
+
+        if ( aObject.Property( *iDrmPropertyDef, property, 0 ) != KErrNotFound )
+            {
+            static_cast<CMdEBoolProperty*>(property)->SetValueL( drmProtected );
+            }
+        else
+            {
+            aObject.AddBoolPropertyL( *iDrmPropertyDef, drmProtected );
+            }
+        }
+
+    // 8. KMPXMediaGeneralCopyright
+    if ( aVideo.IsSupported( KMPXMediaGeneralCopyright ))
+        {
+        VCXLOGLO1( "CVCXTestMdsDbModifier::Media2ObjectL: Setting KMPXMediaGeneralCopyright" );
+        if ( aObject.Property( *iCopyrightPropertyDef, property, 0 ) != KErrNotFound )
+            {
+            static_cast<CMdETextProperty*>(property)->SetValueL(
+                    aVideo.ValueText( KMPXMediaGeneralCopyright ) );
+            }
+        else
+            {
+            if ( aVideo.ValueText( KMPXMediaGeneralCopyright ).Length() )
+                {
+                aObject.AddTextPropertyL(
+                        *iCopyrightPropertyDef,
+                        aVideo.ValueText( KMPXMediaGeneralCopyright ) );
+                }
+            }
+        }
+
+    // 9. KMPXMediaGeneralMimeType
+    if ( aVideo.IsSupported( KMPXMediaGeneralMimeType ))
+        {
+        VCXLOGLO1( "CVCXTestMdsDbModifier::Media2ObjectL: Setting KMPXMediaGeneralMimeType" );
+        if ( aObject.Property( *iItemTypePropertyDef, property, 0 ) != KErrNotFound )
+            {
+            static_cast<CMdETextProperty*>(property)->SetValueL(
+                    aVideo.ValueText( KMPXMediaGeneralMimeType ) );
+            }
+        else
+            {
+            aObject.AddTextPropertyL(
+                    *iItemTypePropertyDef,
+                    aVideo.ValueText( KMPXMediaGeneralMimeType ) );
+            }
+        }
+
+    // 10. KVcxMediaMyVideosModifiedDate
+    if ( aVideo.IsSupported( KVcxMediaMyVideosModifiedDate ) )
+        {
+        VCXLOGLO1( "CVCXTestMdsDbModifier::Media2ObjectL: Setting KVcxMediaMyVideosModifiedDate" );
+        TInt64 modifiedDateInt64 = aVideo.ValueTObjectL<TInt64>( KVcxMediaMyVideosModifiedDate );
+        TTime modifiedDate( modifiedDateInt64 );
+        if ( aObject.Property( *iLastModifiedDatePropertyDef, property, 0 ) != KErrNotFound )
+            {
+            static_cast<CMdETimeProperty*>(property)->SetValueL( modifiedDate );
+            }
+        else
+            {
+            aObject.AddTimePropertyL( *iLastModifiedDatePropertyDef, modifiedDate );
+            }
+        }
+
+    // 11. KVcxMediaMyVideosAgeProfile
+    if ( aVideo.IsSupported( KVcxMediaMyVideosAgeProfile ) )
+        {
+        TInt32 ageProfile = aVideo.ValueTObjectL<TInt32>(KVcxMediaMyVideosAgeProfile );
+        VCXLOGLO2( "CVCXTestMdsDbModifier::Media2ObjectL: Setting KVcxMediaMyVideosAgeProfile: %d", ageProfile );
+        if ( aObject.Property( *iAgeProfilePropertyDef, property, 0 ) != KErrNotFound )
+            {
+            static_cast<CMdEInt32Property*>(property)->SetValueL( ageProfile );
+            }
+        else
+            {
+            aObject.AddInt32PropertyL( *iAgeProfilePropertyDef, ageProfile );
+            }
+        }
+
+    // 12. KVcxMediaMyVideosAudioLanguage
+    if ( aVideo.IsSupported( KVcxMediaMyVideosAudioLanguage ) )
+        {
+        VCXLOGLO1( "CVCXTestMdsDbModifier::Media2ObjectL: Setting KVcxMediaMyVideosAudioLanguage" );
+        if ( aObject.Property( *iAudioLanguagePropertyDef, property, 0 ) != KErrNotFound )
+            {
+            static_cast<CMdETextProperty*>(property)->SetValueL(
+                    aVideo.ValueText( KVcxMediaMyVideosAudioLanguage ) );
+            }
+        else
+            {
+            aObject.AddTextPropertyL(
+                    *iAudioLanguagePropertyDef,
+                    aVideo.ValueText( KVcxMediaMyVideosAudioLanguage ) );
+            }
+        }
+
+    // 13. KVcxMediaMyVideosAuthor
+    if ( aVideo.IsSupported( KVcxMediaMyVideosAuthor ) )
+        {
+        VCXLOGLO1( "CVCXTestMdsDbModifier::Media2ObjectL: Setting KVcxMediaMyVideosAuthor" );
+        if ( aObject.Property( *iAuthorPropertyDef, property, 0 ) != KErrNotFound )
+            {
+            static_cast<CMdETextProperty*>(property)->SetValueL(
+                    aVideo.ValueText( KVcxMediaMyVideosAuthor ) );
+            }
+        else
+            {
+            aObject.AddTextPropertyL(
+                    *iAuthorPropertyDef,
+                    aVideo.ValueText( KVcxMediaMyVideosAuthor ) );
+            }
+        }
+
+    // 14. KVcxMediaMyVideosOrigin
+    if ( aVideo.IsSupported( KVcxMediaMyVideosOrigin ) )
+        {
+        TUint8 origin = aVideo.ValueTObjectL<TUint8>( KVcxMediaMyVideosOrigin );
+        VCXLOGLO1( "CVCXTestMdsDbModifier::Media2ObjectL: Setting xxx" );
+        if ( aObject.Property( *iOriginPropertyDef, property, 0 ) != KErrNotFound )
+            {
+            static_cast<CMdEUint8Property*>(property)->SetValueL( origin );
+            }
+        else
+            {
+            aObject.AddUint8PropertyL( *iOriginPropertyDef, origin );
+            }
+        }
+
+    // 15. KVcxMediaMyVideosDuration
+    if ( aVideo.IsSupported( KVcxMediaMyVideosDuration ))
+        {
+        VCXLOGLO1( "CVCXTestMdsDbModifier::Media2ObjectL: Setting KVcxMediaMyVideosDuration" );
+        TReal32 duration = aVideo.ValueTObjectL<TReal32>( KVcxMediaMyVideosDuration );
+
+        if ( aObject.Property( *iDurationPropertyDef, property, 0 ) != KErrNotFound )
+            {
+            static_cast<CMdEReal32Property*>(property)->SetValueL( duration );
+            }
+        else
+            {
+            aObject.AddReal32PropertyL( *iDurationPropertyDef, duration );
+            }
+        }
+
+    // 16. KVcxMediaMyVideosLastPlaybackPosition
+    if ( aVideo.IsSupported( KMPXMediaGeneralLastPlaybackPosition ))
+        {
+        VCXLOGLO1( "CVCXTestMdsDbModifier::Media2ObjectL: Setting KMPXMediaGeneralLastPlaybackPosition" );
+        TInt pos = static_cast<CMdEReal32Property*>(property)->Value();
+        aVideo.SetTObjectValueL<TInt>( KMPXMediaGeneralLastPlaybackPosition, pos );
+        }
+
+    // 17. DOWNLOAD ID
+    if ( aVideo.IsSupported( KVcxMediaMyVideosDownloadId ) )
+        {
+        TUint32 dlId = aVideo.ValueTObjectL<TUint32>( KVcxMediaMyVideosDownloadId );
+
+        VCXLOGLO2( "CVCXTestMdsDbModifier::Media2ObjectL: DL ID = %d", dlId );
+
+        if ( aObject.Property( *iDownloadIdPropertyDef, property, 0 ) != KErrNotFound )
+            {
+            static_cast<CMdEUint32Property*>(property)->SetValueL( dlId );
+            }
+        else
+            {
+            aObject.AddUint32PropertyL( *iDownloadIdPropertyDef, dlId );
+            }
+        }
+
+    // 19. RATING
+    if ( aVideo.IsSupported( KVcxMediaMyVideosRating ) )
+        {
+        TUint8 rating = aVideo.ValueTObjectL<TUint8>( KVcxMediaMyVideosRating );
+        
+        if ( aObject.Property( *iRatingPropertyDef, property, 0 ) != KErrNotFound )
+            {
+            static_cast<CMdEUint8Property*>(property)->SetValueL( rating );
+            }
+        else
+            {
+            aObject.AddUint8PropertyL( *iRatingPropertyDef, rating );
+            }
+        }
+    // 20. BITRATE
+    if ( aVideo.IsSupported( KMPXMediaVideoBitRate ) )
+        {           
+        TUint16 bitrate = aVideo.ValueTObjectL<TUint16>( KMPXMediaVideoBitRate );
+        
+        if ( aObject.Property( *iBitratePropertyDef, property, 0 ) != KErrNotFound )
+            {
+            static_cast<CMdEUint16Property*>(property)->SetValueL( bitrate );
+            }
+        else
+            {
+            aObject.AddUint16PropertyL( *iBitratePropertyDef, bitrate );
+            }
+        }
+
+    // 21. AUDIOFOURCC
+    if ( aVideo.IsSupported( KVcxMediaMyVideosAudioFourCc ) )
+        {
+        TUint32 audioFourCc = aVideo.ValueTObjectL<TUint32>( KVcxMediaMyVideosAudioFourCc );
+        
+        if ( aObject.Property( *iAudioFourCcPropertyDef, property, 0 ) != KErrNotFound )
+            {
+            static_cast<CMdEUint32Property*>(property)->SetValueL( audioFourCc );
+            }
+        else
+            {
+            aObject.AddUint32PropertyL( *iAudioFourCcPropertyDef, audioFourCc );
+            }
+        }
+
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CVCXTestMdsDbModifier::GetSchemaDefinitionsL()
+    {
+    VCXLOGLO1( "CVCXTestMdsDbModifier::GetSchemaDefinitionsL" );
+
+    //  Namespace
+    iNamespaceDef = &(iMDSSession->GetDefaultNamespaceDefL());
+
+    //  Default object definitions
+    iVideoObjectDef = &(iNamespaceDef->GetObjectDefL( KVcxVideoObjectName ));
+
+    //  Base object property definitions
+    iTitlePropertyDef = &(iVideoObjectDef->GetPropertyDefL(
+            KVcxTitlePropertyName )); //2
+    iSizePropertyDef = &(iVideoObjectDef->GetPropertyDefL(
+            KVcxSizePropertyName )); //5
+    iCreationDatePropertyDef = &(iVideoObjectDef->GetPropertyDefL(
+            KVcxCreationDatePropertyName )); //6
+    iTimeOffsetPropertyDef = &(iVideoObjectDef->GetPropertyDefL(
+            KVcxTimeOffsetPropertyName )); //6
+    iItemTypePropertyDef = &(iVideoObjectDef->GetPropertyDefL(
+            KVcxItemTypePropertyName )); //9
+    iLastModifiedDatePropertyDef = &(iVideoObjectDef->GetPropertyDefL(
+            KVcxLastModifiedDatePropertyName )); //10
+
+    //  Media object property definitions
+    iDescriptionPropertyDef = &(iVideoObjectDef->GetPropertyDefL(
+            KVcxDescriptionPropertyName)); //3
+    iCopyrightPropertyDef = &(iVideoObjectDef->GetPropertyDefL(
+            KVcxCopyrightPropertyName )); //8
+    iAuthorPropertyDef = &(iVideoObjectDef->GetPropertyDefL(
+            KVcxAuthorPropertyName )); //13
+    iOriginPropertyDef = &(iVideoObjectDef->GetPropertyDefL(
+            KVcxOriginPropertyName )); //14
+    iDurationPropertyDef = &(iVideoObjectDef->GetPropertyDefL(
+            KVcxDurationPropertyName )); //15
+    iDrmPropertyDef = &(iVideoObjectDef->GetPropertyDefL(
+            KVcxDrmPropertyName )); //part of flags (7)
+    iRatingPropertyDef = &(iVideoObjectDef->GetPropertyDefL(
+            KVcxRatingPropertyName )); //19
+    iBitratePropertyDef = &(iVideoObjectDef->GetPropertyDefL(
+                KVcxBitratePropertyName )); //20
+    iAudioFourCcPropertyDef = &(iVideoObjectDef->GetPropertyDefL(
+                KVcxAudioFourCcPropertyName )); //21
+
+    //  Video object property definitions
+    iLastPlayPositionPropertyDef = &(iVideoObjectDef->GetPropertyDefL(
+            KVcxLastPlayPositionPropertyName )); //16
+
+    // remove these when default mds has all fields
+    TRAP_IGNORE(
+
+    iFlagsPropertyDef = &(iVideoObjectDef->GetPropertyDefL(
+            KVcxFlagsPropertyName )); //7
+
+    iAgeProfilePropertyDef = &(iVideoObjectDef->GetPropertyDefL(
+            KVcxAgeProfilePropertyName )); //11
+
+    iAudioLanguagePropertyDef = &(iVideoObjectDef->GetPropertyDefL(
+            KVcxAudioLanguagePropertyName )); //12
+
+    iDownloadIdPropertyDef = &(iVideoObjectDef->GetPropertyDefL(
+            KVcxDownloadIdPropertyName )); //17
+
+          );
+
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/bwins/ut_collectionplugintestu.def	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * LibEntryL(class CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/conf/ut_collectionplugintest.cfg	Thu Nov 04 11:16:56 2010 +0200
@@ -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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/eabi/ut_collectionplugintestu.def	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,5 @@
+EXPORTS
+	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
+	_ZTI22CVcxMdsShutdownMonitor @ 2 NONAME
+	_ZTV22CVcxMdsShutdownMonitor @ 3 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/group/ut_collectionplugintest.mmp	Thu Nov 04 11:16:56 2010 +0200
@@ -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: 2 %
+
+
+
+#include <platform_paths.hrh>
+
+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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/group/ut_collectionplugintest.pkg	Thu Nov 04 11:16:56 2010 +0200
@@ -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"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/mpxlog.h	Thu Nov 04 11:16:56 2010 +0200
@@ -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 <e32std.h>
+#include <e32svr.h>
+
+#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 <flogger.h>
+
+_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<const TDesC>(tempIPTVLogDes()),BBB); }
+#define MPX_DEBUG3(AAA,BBB,CCC)          { _LIT(tempIPTVLogDes,AAA); RFileLogger::WriteFormat(KIPTVLogFolder2(),KIPTVLogFile2(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempIPTVLogDes()),BBB,CCC); }
+#define MPX_DEBUG4(AAA,BBB,CCC,DDD)      { _LIT(tempIPTVLogDes,AAA); RFileLogger::WriteFormat(KIPTVLogFolder2(),KIPTVLogFile2(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempIPTVLogDes()),BBB,CCC,DDD); }
+#define MPX_DEBUG5(AAA,BBB,CCC,DDD,EEE)  { _LIT(tempIPTVLogDes,AAA); RFileLogger::WriteFormat(KIPTVLogFolder2(),KIPTVLogFile2(),EFileLoggingModeAppend,TRefByValue<const TDesC>(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<const TDesC> 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<dlevels;++i)\
+        {\
+        MPX_DEBUG4("Collection Path debug: Level[%d] = (index %d, id 0x%08x)", i, (aPath).Index(i), (aPath).Id(i).iId1);\
+        }\
+    if (dcount > 0)\
+        {\
+        TInt index = (aPath).Index();\
+        MPX_DEBUG2("Collection Path debug current index %d", index);\
+        if (index>=0 && index<dcount)\
+            {\
+            CMPXCollectionPath* dpath = const_cast<CMPXCollectionPath*>(&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<const TDesC> 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/ut_collectionplugintest.h	Thu Nov 04 11:16:56 2010 +0200
@@ -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 <StifLogger.h>
+#include <TestScripterInternal.h>
+#include <StifTestModule.h>
+#include <TestclassAssert.h>
+#include <e32base.h>
+#include <e32def.h>
+#include <StifItemParser.h>
+#include <W32STD.H>
+
+//#include "mpxlog.h"
+//#include "mpxvideo_debug.h"
+#include <mpxcollectionpluginobserver.h>
+
+#include <mpxcollectionplugin.h>
+#include <mpxcollectionpath.h>
+#include <mpxcollectionmessagedefs.h>
+#include <vcxmyvideosdefs.h>
+#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<CMPXMessage*>(&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<TMPXAttribute> iAttrs;
+        
+        CMPXMediaArray* iMessageList;
+        
+        CMPXMedia* iMedia;
+        CMPXCommand* iCommand;
+};
+
+#endif      // COLLECTIONPLUGIN_TEST_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/vcxmyvideosactivetask.h	Thu Nov 04 11:16:56 2010 +0200
@@ -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 <mpxcommand.h>
+#include <mpxmessage2.h>
+
+/**
+* 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/vcxmyvideosalbum.h	Thu Nov 04 11:16:56 2010 +0200
@@ -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 <e32std.h>
+#include <e32base.h>
+
+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<TUint32>& 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<TVcxMyVideosAlbumVideo> 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<TVcxMyVideosAlbumVideo> iVideoList;
+            
+    };
+
+#endif // CVCXMYVIDEOSALBUM_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/vcxmyvideosalbums.h	Thu Nov 04 11:16:56 2010 +0200
@@ -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 <mdequery.h>
+#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<TUint32>& 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<TUint32>& aAlbumIds );
+
+        /**
+         * Updates albums from MDS. This is called from MDS modify event.
+         * 
+         * @param aAlbumIds  Album IDs to update.
+         */
+        void UpdateAlbumsFromMdsL( RArray<TUint32>& 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<TVcxMyVideosAlbumVideo>& 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<TVcxMyVideosAlbumVideo>& 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<CMdEInstanceItem>& aItemArray );
+
+        /**
+         * From MVcxMyVideosMdsAlbumsObserver.
+         * Response to CVcxMyVideosMdsAlbums::RemoveRelationsL.
+         */
+        void HandleRemoveRelationsResp( RArray<TUint32>& aRelationIds,
+                RArray<TUint32>& aResults );
+
+        /**
+         * From MVcxMyVideosMdsAlbumsObserver.
+         * Response to CVcxMyVideosMdsAlbums::RemoveAlbumsL.
+         */
+        void HandleRemoveAlbumsResp( CMPXMedia* aCmd,
+                RArray<TUint32>& 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<TMdERelation>& 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<CMdEInstanceItem>& 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<CVcxMyVideosAlbum*> 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<TUint32> iMdsOpTargetIds;
+        
+        /**
+         * Stores album video data during relation deletion. This is to
+         * avoid second search when resp arrives.
+         */
+        RArray<TVcxMyVideosAlbumVideo> iRemoveFromAlbumVideos;
+        
+        /**
+         * Used in MDS operations to store operation results. Is in sync with iMdsOpTargetIds. 
+         */
+        RArray<TInt> iMdsOpResults;
+
+        /**
+         * Used in MDS operations to store operation results. Is in sync with iMdsOpTargetIds. 
+         */
+        RArray<TUint32> 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<TInt> iChangedAlbums;
+        
+    };
+
+#endif   // VCXMYVIDEOSALBUMS_H
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/vcxmyvideosasyncfileoperations_stub.h	Thu Nov 04 11:16:56 2010 +0200
@@ -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 <mpxcollectionplugin.h>
+#include <mpxcollectionpath.h>
+#include <mpxcollectionmessagedefs.h>
+#include <vcxmyvideosdefs.h>
+
+// 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<TUint32> iOperationIdArray;
+    
+        /**
+        * Array containing results for move/copy/delete operations. Array positions
+        * are in sync with iOperationIdArray.
+        */
+        RArray<TInt> 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
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/vcxmyvideoscategories_stub.h	Thu Nov 04 11:16:56 2010 +0200
@@ -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 <vcxmyvideosdefs.h>
+
+// 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<TUint32>& 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<TUint32>& 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<TInt>& aVideosIncrements, RArray<TInt>& 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<TUint32>& 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<TUint32>& 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<TUint32>& 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<TBool> iModifiedCategories;
+
+    public:     // Friend classes
+        
+        friend class CCollectionPluginTest;        
+    };
+
+#endif   // VCXMYVIDEOSCATEGORIES_H
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/vcxmyvideoscollectionutil.h	Thu Nov 04 11:16:56 2010 +0200
@@ -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 <vcxmyvideosdefs.h>
+
+// 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<TUint32>& 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<CMPXMedia*>& aFromArray,
+                CMPXMedia& aToList,
+                RArray<TUint32>& 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<TMPXAttribute>& 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<TUint32>& 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
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/vcxmyvideosmdsalbums.h	Thu Nov 04 11:16:56 2010 +0200
@@ -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 <mdequery.h>
+#include <mpxmedia.h>
+#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<TVcxMyVideosAlbumVideo>& 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<TUint32>& aRelationIds,
+                RArray<TUint32>& 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<TVcxMyVideosAlbumVideo>& 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<TUint32>& aRelationIds,
+                RArray<TUint32>& 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  <code>KErrNone</code>, 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  <code>KErrNone</code>, 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  <code>KErrNone</code>, 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  <code>KErrNone</code>, 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<TMdERelation>& aRelationArray);
+
+        /**
+         * From MMdERelationObserver
+         */
+        void HandleRelationNotification(CMdESession& aSession, 
+                TObserverNotificationType aType,
+                const RArray<TItemId>& 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<TVcxMyVideosAlbumVideo>* iAlbumContent;
+
+        /**
+         * The pending async operation ID is stored here.
+         */
+        TVcxAsyncOperation iAsyncOperation;
+
+        /**
+         * Used for storing items during async mds operations.
+         */
+        RPointerArray<CMdEInstanceItem> 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<TInt>* iResultArray;
+
+        /**
+         * Used in async operations to store
+         * pointer to result array (which is owned by the user). 
+         */
+        RArray<TUint32>* iResultArrayUint32;
+        
+        /**
+         * Used in async oprations (EVcxAddVideosToAlbum and EVcxRemoveVideosFromAlbum) to store
+         * pointer to item ID array (which is owned by the user). 
+         */
+        RArray<TUint32>* 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
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/vcxmyvideosmdsdb_stub.h	Thu Nov 04 11:16:56 2010 +0200
@@ -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 <mdesession.h>
+#include <mdequery.h>
+#include <harvesterclient.h>
+#include <mpxcollectionmessagedefs.h>
+#include <vcxmyvideosdefs.h>
+#include <e32property.h>
+#include "vcxmyvideosalbum.h"
+#include <f32file.h>
+
+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<TUint32>& 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<TVcxMyVideosAlbumVideo>& 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<CMdEInstanceItem>& 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<TUint32>& aRelationIds,
+                RArray<TUint32>& 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<TUint32>& 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<TMdERelation>& 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<TUint32>& 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    <code>KErrNone</code>, 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  <code>KErrNone</code>, 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<TItemId>& aObjectIdArray);
+
+// from MMdEObjectPresentObserver
+    void HandleObjectPresentNotification(CMdESession& aSession, 
+			TBool aPresent, const RArray<TItemId>& 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<TItemId>& 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<TEvent> iEvents;
+        
+public:     // Friend classes
+    
+    friend class CCollectionPluginTest;
+    
+    };
+
+#endif // VCXMYVIDEOSMDSDB_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/vcxmyvideosmessagelist_stub.h	Thu Nov 04 11:16:56 2010 +0200
@@ -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 <mpxcollectionmessagedefs.h>
+#include <vcxmyvideosdefs.h>
+
+// 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
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/vcxmyvideosopenhandler_stub.h	Thu Nov 04 11:16:56 2010 +0200
@@ -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<TVcxMyVideosAlbumVideo>& /*aContentArray*/ ) {}
+
+    /**
+     * From MVcxMyVideosMdsAlbumsObserver, no implementation.
+     */
+    void HandleAddVideosToAlbumResp( CMPXMedia* /*aCmd*/,
+            RPointerArray<CMdEInstanceItem>& /*aItemArray*/ ) {}
+
+    /**
+     * From MVcxMyVideosMdsAlbumsObserver, no implementation.
+     */
+    void HandleRemoveRelationsResp( RArray<TUint32>& /*aRelationIds*/,
+            RArray<TUint32>& /*aResults*/ ) {}
+
+    /**
+     * From MVcxMyVideosMdsAlbumsObserver, no implementation.
+     */
+    void HandleRemoveAlbumsResp( CMPXMedia* /*aCmd*/,
+            RArray<TUint32>& /*aResultIds*/ ) {}
+
+    /**
+     * From MVcxMyVideosMdsAlbumsObserver, no implementation.
+     */
+    void HandleRelationEvent( TObserverNotificationType /*aType*/,
+            const RArray<TMdERelation>& /*aRelationArray*/ ) {}
+    
+    /**
+     * Called as a response to GetAlbumContentVideosL.
+     * 
+     * @param aAlbumId           ID of the album containing the result videos.
+     * @param aVideoList         Media containing array of videos.
+     * @param aError             Error code in case of failure.
+     * @param aFirstNewItemIndex Index of the first new item.
+     * @param aNewItemCount      How many new items in the query since the last results.
+     * @param aComplete          ETrue if query is complete, EFalse if there is more to come.
+     */
+    void HandleGetAlbumContentVideosResp( TUint32 aAlbumId, CMPXMedia& aVideoList,
+            TInt aError, TInt aFirstNewItemIndex, TInt aNewItemCount, TBool aComplete );
+
+
+    void DoHandleCreateVideoListRespL(
+            CMPXMedia* aVideoList, TInt aNewItemsStartIndex, TBool aComplete );
+
+private:
+    /**
+    * 2nd-phase Constructor
+    */
+    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<TInt> iCategoryIdsBeingOpened;
+    
+    /**
+    * Video lists for categories being opened are stored here.
+    * This is in sync with iCategoryIdsBeingOpened.
+    */
+    RArray<CMPXMedia*> iVideoListsBeingOpened;
+
+    /**
+    * The album IDs being opened are stored here. These values are used
+    * to filter list when items arrive from MDS.
+    * This is in sync with iAlbumVideoListsBeingOpened.
+    */
+    RArray<TInt> iAlbumIdsBeingOpened;
+
+    /**
+    * Video lists for albums being opened are stored here.
+    * This is in sync with iAlbumIdsBeingOpened.
+    */
+    RArray<CMPXMedia*> iAlbumVideoListsBeingOpened;
+    
+    /**
+     * Path being opened is stored here for the HandleOpenL call.
+     * Not Own.
+     */
+    const CMPXCollectionPath* iPath;
+	
+public:     // Friend classes
+    
+    friend class CCollectionPluginTest;         
+    
+    };
+
+#endif // VCXMYVIDEOSACTIVETASK_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/vcxmyvideosvideocache_stub.h	Thu Nov 04 11:16:56 2010 +0200
@@ -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<TVcxMyVideosVideo>& VideoArray();
+#endif
+    
+private:
+    /**
+    * Constructor
+    */
+    CVcxMyVideosVideoListIndex();
+    
+    /**
+    * Symbian 2nd phase constructor.
+    */
+    void ConstructL ();
+
+    /**
+     * Sorts iVideoArray by MDS ID.
+     */
+    void Sort();
+    
+    /**
+     * Used for keeping RArray<TVcxMyVideosVideo> 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<TVcxMyVideosVideo> 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<TUint32>& 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<TUint32>& 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<TUint32>& aMdsIds, TBool& aListFetchingWasCanceled,
+                RArray<TUint32>* 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<CMPXMedia*> 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
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/init/testframework.ini	Thu Nov 04 11:16:56 2010 +0200
@@ -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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/ut_collectionplugintest.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -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 <Stiftestinterface.h>
+#include <ecom.h>
+#include <SettingServerClient.h>
+
+#include <mpxcollectionplugin.h>
+#include <mpxcollectionmessagedefs.h>
+#include <vcxmyvideosdefs.h>
+#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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/ut_collectionplugintestBlocks.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -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 <e32svr.h>
+#include <e32std.h>
+#include <w32std.h>
+#include <coeaui.h>
+#include <aknutils.h>
+#include <aknviewappui.h>
+#include <StifParser.h>
+#include <Stiftestinterface.h>
+
+#include "ut_collectionplugintest.h"
+
+#include "mpxlog.h"
+#include <vcxmyvideosuids.h>
+#include <vcxmyvideosdefs.h>
+#include <mpxcommandgeneraldefs.h>
+#include <mpxcollectioncommanddefs.h>
+#include <mpxmediageneraldefs.h>
+#include <mpxmediacontainerdefs.h>
+#include <mpxmessagecontainerdefs.h>
+#include <mpxmessagegeneraldefs.h>
+
+#include <mpxcollectionplugin.h>
+#include <mpxcollectionpath.h>
+#include <mpxcollectionmessagedefs.h>
+#include <vcxmyvideosdefs.h>
+#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<TMPXCommandId>( KMPXCommandGeneralId );
+    if( commandId != cmdId )
+        {
+        error = KErrCorrupt;
+        }
+
+    if( commandId == KVcxCommandIdMyVideos )
+        {
+        TInt currCmdMV = iCollection->iActiveTask->iCurCommand->ValueTObjectL<TUint32>( 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<TMPXItemId>( 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<CMPXMedia>( KMPXCommandColAddMedia, iMedia );
+            }
+            break;
+        
+        case KMPXCommandIdCollectionSet: // SYNC
+            {
+            iCommand->SetCObjectValueL<CMPXMedia>( KMPXCommandColSetMedia, iMedia );
+            }
+            break;
+        
+        case KMPXCommandIdCollectionRemoveMedia:
+            {
+            TMPXItemId itemId = iMedia->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId );
+            iCommand->SetTObjectValueL( KMPXMediaGeneralId, itemId );
+            }
+            break;
+        default:
+            break;
+        }
+
+    switch( cmdMV )
+        {
+        case KVcxCommandMyVideosGetMediaFullDetailsByMpxId:
+            {
+            TMPXItemId itemId = iMedia->ValueTObjectL<TMPXItemId>( 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<TMPXItemId>( KMPXMediaGeneralId, itemId );
+                mediaArray->AppendL( *item );
+                CleanupStack::PopAndDestroy( item );
+                }
+            if( id != KErrNotFound )
+                {
+                iCommand->SetCObjectValueL<CMPXMediaArray>( 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<CMPXMedia>( 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<CMPXMediaArray>( KMPXMediaArrayContents );
+    TRAPD( error, cache->AppendL( *iMedia ) );
+    iCollection->iCache->iVideoList->SetCObjectValueL<CMPXMediaArray>( 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<TMPXItemId>( KMPXMediaGeneralId, mpxId );
+    
+    CMPXMediaArray* medias = iCollection->iCache->iVideoList->Value<CMPXMediaArray>( 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<CMPXMediaArray>( KMPXMediaArrayContents );
+    for ( TInt i = 0; i < medias->Count(); i++ )
+        {
+        CMPXMedia* media = (*medias)[i];    
+        TMPXItemId itemId = *(media->Value<TMPXItemId>( 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<TMPXAttribute> 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<TCapability> 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<CMPXMediaArray>( 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<TMPXCommandId>( 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<TMPXAttribute> 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<TMPXAttribute> 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<TUint32>& 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<TUint32> ids;
+    RArray<TItemId> 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<TMPXItemId>( 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<TMPXMessageId>( KMPXMessageGeneralId, itemId );
+        message->SetTObjectValueL<TInt>( 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<CMPXMessageArray>(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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/vcxmyvideosactivetask_stub.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -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 <e32base.h>
+#include <mpxlog.h>
+#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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/vcxmyvideosalbum_stub.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -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 <mpxlog.h>
+#include <mpxmedia.h>
+#include <mpxmediaarray.h>
+#include <mpxmediacontainerdefs.h>
+#include <mpxmediageneraldefs.h>
+#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<TUint32>& /*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;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/vcxmyvideosalbums_stub.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -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<TUint32>& /*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<TUint32>& /*aAlbumIds*/ )
+    {
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::HandleGetAlbumsRespL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::HandleGetAlbumsRespL( CMPXMedia* /*aAlbumList*/ )
+    {
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::HandleGetAlbumContentIdsRespL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::HandleGetAlbumContentIdsRespL( TUint32 /*aAlbumId*/,
+        RArray<TVcxMyVideosAlbumVideo>& /*aAlbumContentIds*/ )
+    {    
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::HandleGetAlbumsResp
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::HandleGetAlbumsResp( CMPXMedia* /*aAlbumList*/ )
+    {
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::HandleGetAlbumContentIdsResp
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::HandleGetAlbumContentIdsResp( TUint32 /*aAlbumId*/,
+        RArray<TVcxMyVideosAlbumVideo>& /*aAlbumContent*/ )
+    {   
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::HandleAddVideosToAlbumResp
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::HandleAddVideosToAlbumResp( CMPXMedia* /*aCmd*/,
+        RPointerArray<CMdEInstanceItem>& /*aItemArray*/ )
+    {    
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::DoHandleAddVideosToAlbumResp
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::DoHandleAddVideosToAlbumRespL( CMPXMedia* /*aCmd*/,
+        RPointerArray<CMdEInstanceItem>& /*aItemArray*/ )
+    {
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::HandleRemoveRelationsResp
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::HandleRemoveRelationsResp( RArray<TUint32>& /*aRelationIds*/,
+        RArray<TUint32>& /*aResults*/ )
+    {
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::HandleRemoveAlbumsResp
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::HandleRemoveAlbumsResp( CMPXMedia* /*aCmd*/,
+        RArray<TUint32>& /*aResultIds*/ )
+    {    
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::HandleRelationEvent
+// Only relation removed events are received here.
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::HandleRelationEvent( TObserverNotificationType /*aType*/,
+        const RArray<TMdERelation>& /*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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/vcxmyvideosasyncfileoperations_stub.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -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;
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/vcxmyvideoscategories_stub.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -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 <mpxmediageneraldefs.h>
+#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<TInt>& /*aVideosIncrements*/, RArray<TInt>& /*aNewVideosIncrements*/ )
+    {
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCategories::UpdateVideosCountL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosCategories::UpdateVideosCountL( CMPXMedia& /*aCategory*/,
+    TInt /*aIncrement*/, TMPXAttributeData /*aCountAttribute*/, TInt /*aEventInfo*/ )
+    {
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCategories::VideosAddedL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosCategories::VideosAddedL( RArray<TUint32>& /*aIds*/ )
+    {
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCategories::VideosRemovedL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosCategories::VideosRemovedL( RArray<TUint32>& /*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<TUint32>& /*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<TUint32>& /*aIgnoredIds*/ )
+    {   
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCategories::CalculateNewVideoNameL
+// ----------------------------------------------------------------------------
+//    
+const TDesC& CVcxMyVideosCategories::CalculateNewVideoNameL( CMPXMedia& /*aVideoList*/,
+        TInt /*aOrigin*/, RArray<TUint32>& /*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
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/vcxmyvideoscollectionutil_stub.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -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 <mpxmedia.h>
+#include <mpxmediaarray.h>
+#include <mpxlog.h>
+#include <mpxmediacontainerdefs.h>
+#include <mpxmediageneraldefs.h>
+#include <vcxmyvideosdefs.h>
+#include <mpxmessagecontainerdefs.h>
+#include <bautils.h>
+#include <mpxmediavideodefs.h>
+#ifdef _DEBUG
+#include <flogger.h>
+#include <f32file.h> 
+#endif
+#include "vcxmyvideoscollectionutil.h"
+
+// ============================ MEMBER FUNCTIONS ==============================
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCollectionUtil::CreateEmptyMediaListL
+// ----------------------------------------------------------------------------
+//
+CMPXMedia* TVcxMyVideosCollectionUtil::CreateEmptyMediaListL()
+    {
+    RArray<TInt> 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<TInt> 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<TUint32>& 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<CMPXMediaArray>( KMPXMediaArrayContents );
+    CMPXMediaArray* toArray   = aToList.Value<CMPXMediaArray>( 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<TMPXItemId>( 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<CMPXMedia*>& aFromArray,
+        CMPXMedia& aToList,
+        RArray<TUint32>& 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<CMPXMediaArray>( 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<TMPXItemId>( 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<CMPXMediaArray>( KMPXMediaArrayContents );
+    CMPXMediaArray* fromArray = aFromList.Value<CMPXMediaArray>( 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<KMaxDigits> 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<TUint8>( 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<TUint32>( KMPXMediaGeneralFlags );                
+        }
+    return flags;
+    }
+
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::CreationDateL
+// ----------------------------------------------------------------------------
+//
+TInt64 TVcxMyVideosCollectionUtil::CreationDateL( CMPXMedia& aVideo )
+    {
+    TInt64 creationDate = 0;
+                            
+    if ( aVideo.IsSupported( KMPXMediaGeneralDate ) )
+        {
+        creationDate = aVideo.ValueTObjectL<TInt64>( KMPXMediaGeneralDate );                
+        }
+    return creationDate;
+    }
+
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::DownloadIdL
+// ----------------------------------------------------------------------------
+//
+TUint32 TVcxMyVideosCollectionUtil::DownloadIdL( CMPXMedia& aVideo )
+    {
+    TUint32 downloadId = 0;
+                            
+    if ( aVideo.IsSupported( KVcxMediaMyVideosDownloadId ) )
+        {
+        downloadId = aVideo.ValueTObjectL<TUint32>( KVcxMediaMyVideosDownloadId );                
+        }
+    return downloadId;
+    }
+
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::DownloadStateL
+// ----------------------------------------------------------------------------
+//
+TVcxMyVideosDownloadState TVcxMyVideosCollectionUtil::DownloadStateL( CMPXMedia& aVideo )
+    {
+    TVcxMyVideosDownloadState downloadState = EVcxMyVideosDlStateNone;
+                            
+    if ( aVideo.IsSupported( KVcxMediaMyVideosDownloadState ) )
+        {
+        downloadState = static_cast<TVcxMyVideosDownloadState>(
+                aVideo.ValueTObjectL<TUint8>( KVcxMediaMyVideosDownloadState ) );
+        }
+    return downloadState;
+    }
+
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::IdL
+// ----------------------------------------------------------------------------
+//
+TMPXItemId TVcxMyVideosCollectionUtil::IdL( const CMPXMedia& aVideo )
+    {
+    TMPXItemId id( 0, 0 );
+                            
+    if ( aVideo.IsSupported( KMPXMediaGeneralId ) )
+        {
+        id = aVideo.ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId );
+        }
+    return id;
+    }
+
+
+
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::DurationL
+// ----------------------------------------------------------------------------
+//
+TReal32 TVcxMyVideosCollectionUtil::DurationL( CMPXMedia& aVideo )
+    {
+    TReal32 duration = -1;
+                            
+    if ( aVideo.IsSupported( KVcxMediaMyVideosDuration ) )
+        {
+        duration = aVideo.ValueTObjectL<TReal32>( 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<TUint8>( KVcxMediaMyVideosRating );                
+        }
+    return rating;
+    }
+
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::AudioFourCcL
+// ----------------------------------------------------------------------------
+//
+TUint32 TVcxMyVideosCollectionUtil::AudioFourCcL( CMPXMedia& aVideo )
+    {
+    TUint32 audioFourCc = 0;
+                            
+    if ( aVideo.IsSupported( KVcxMediaMyVideosAudioFourCc ) )
+        {
+        audioFourCc = aVideo.ValueTObjectL<TUint32>( KVcxMediaMyVideosAudioFourCc );                
+        }
+    return audioFourCc;
+    }
+
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::AreSupported
+// ----------------------------------------------------------------------------
+//
+TBool TVcxMyVideosCollectionUtil::AreSupported( CMPXMedia& aVideo,
+        const TArray<TMPXAttribute>& 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<TUint32>& /*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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/vcxmyvideosmdsalbums_stub.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -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 <e32base.h>
+#include <mpxlog.h>
+#include <mpxmedia.h>
+#include <mpxmediaarray.h>
+#include <mpxmediacontainerdefs.h>
+#include <mpxmediageneraldefs.h>
+#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<TVcxMyVideosAlbumVideo>& /*aContentArray*/,
+        MVcxMyVideosMdsAlbumsObserver& /*aClient*/ )
+    {
+    }
+    
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::DoGetAlbumContentIdsL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::DoGetAlbumContentIdsL( TUint32 /*aAlbumId*/,
+        RArray<TVcxMyVideosAlbumVideo>& /*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<TUint32>& /*aRelationIds*/,
+        RArray<TUint32>& /*aResults*/, MVcxMyVideosMdsAlbumsObserver& /*aClient*/ )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::DoRemoveRelationsL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::DoRemoveRelationsL( RArray<TUint32>& /*aRelationIds*/,
+        RArray<TUint32>& /*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<TMdERelation>& aRelationArray)
+    {
+    if ( iObserver )
+        {
+        iObserver->HandleRelationEvent( aType, aRelationArray );
+        }
+    }
+
+// END OF FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/vcxmyvideosmdsdb_stub.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -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 <harvesterclient.h>
+//#include <mpxlog.h>
+#include <mdequery.h>
+#include <mdeconstants.h>
+#include <mdequery.h>
+#include <mpxmedia.h>
+#include <vcxmyvideosdefs.h>
+#include <mpxmediacontainerdefs.h>
+#include <mpxmediageneraldefs.h>
+#include <mpxmediageneralextdefs.h>
+#include <mpxmediaarray.h>
+#include <mpxmediavideodefs.h>
+#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<TItemId>& /*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<CMPXMediaArray>(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<TMPXItemId>( 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<TItemId>& /*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<TItemId>& /*aObjectIdArray*/ )
+    {     
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsDb::SetCreationAndModifiedDatesL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsDb::SetCreationAndModifiedDatesL( CMdEObject& /*aObject*/ )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsDb::MdsSessionL
+// ---------------------------------------------------------------------------
+//
+CMdESession& CVcxMyVideosMdsDb::MdsSessionL()
+    {
+    return *iMdsSession;
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsDb::ShutdownNotification
+// From MVcxMdsShutDownMonitorObserver
+// ---------------------------------------------------------------------------
+//    
+void CVcxMyVideosMdsDb::ShutdownNotification( TInt /*aShutdownState*/ )
+    {
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/vcxmyvideosmessagelist_stub.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -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 <e32cmn.h>
+#include <mpxvideo_debug.h>
+#include <mpxmediacontainerdefs.h>
+#include <mpxmediageneraldefs.h>
+#include <mpxmessagegeneraldefs.h>
+#include <mpxcommandgeneraldefs.h>
+#include <mpxcollectioncommanddefs.h>
+#include <mpxmessagecontainerdefs.h>
+#include <vcxmyvideosuids.h>
+#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<TMPXMessageId>(KMPXMessageGeneralId, KMPXMessageIdItemChanged);
+    message->SetTObjectValueL<TUid>(KMPXMessageCollectionId, TUid::Uid(KVcxUidMyVideosMpxCollection));        
+    message->SetTObjectValueL<TMPXChangeEventType>(KMPXMessageChangeEventType, aChange);        
+    message->SetTObjectValueL<TMPXItemId>(KMPXMessageMediaGeneralId, aId);
+    message->SetTObjectValueL<TMPXGeneralCategory>( KMPXMessageMediaGeneralCategory, EMPXCollection );
+    
+    if ( aVideo && aChange == EMPXItemInserted )
+        {
+        message->SetCObjectValueL<CMPXMedia>( KMPXCommandColAddMedia, aVideo );
+        }
+        
+    if ( aExtraInfo )
+        {
+        message->SetTObjectValueL<TInt32>( KVcxMediaMyVideosInt32Value, aExtraInfo );
+        }
+        
+    //MPX_DEBUG1("CVcxMyVideosMessageList:: appending to message array");
+    
+    iMessageArray->AppendL( message ); // ownership moves
+
+    CleanupStack::Pop( message ); // <-1        
+
+    iMessageCount++;
+    iMessageList->SetTObjectValueL<TInt>( KMPXMessageArrayCount, iMessageCount );
+    }
+
+// ----------------------------------------------------------------------------------------------------------
+// CVcxMyVideosMessageList::AddEventL
+// ----------------------------------------------------------------------------------------------------------
+//
+void CVcxMyVideosMessageList::AddEventL( TInt aEvent )
+    {
+    TMPXItemId itemId;
+    itemId.iId1 = KVcxCommandIdMyVideos;
+    CMPXMedia* msg = CMPXMedia::NewL();
+    CleanupStack::PushL( msg ); // 1->
+    msg->SetTObjectValueL<TMPXMessageId>( KMPXMessageGeneralId, itemId );
+    msg->SetTObjectValueL<TUid>(KMPXMessageCollectionId, TUid::Uid(KVcxUidMyVideosMpxCollection));        
+
+    msg->SetTObjectValueL<TInt>( 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<TMPXItemId>( KMPXMessageMediaGeneralId );
+            event  = media->ValueTObjectL<TMPXChangeEventType>( KMPXMessageChangeEventType );
+            
+            if ( aId == itemId && aChange == event )
+                {
+                extraInfo = 0;
+                if ( media->IsSupported( KVcxMediaMyVideosInt32Value ) )
+                    {
+                    extraInfo = media->ValueTObjectL<TInt32>( 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<TUint32>( 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<TInt>( 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<CMPXMessageArray>( KMPXMessageArrayContents ); 
+
+        iMessageList->SetTObjectValueL<TMPXMessageId>(KMPXMessageGeneralId, KVcxCommandIdMyVideos);
+        iMessageList->SetTObjectValueL<TInt>(KVcxMediaMyVideosCommandId, KVcxMessageMyVideosMessageArray );
+        iMessageList->SetTObjectValueL<TUid>(KMPXMessageCollectionId, TUid::Uid(KVcxUidMyVideosMpxCollection));        
+        //iMessageList->SetTObjectValueL<TMPXChangeEventType>(KMPXMessageChangeEventType, aChange);        
+        //iMessageList->SetTObjectValueL<TMPXItemId>(KMPXMessageMediaGeneralId, TMPXItemId(0, 0) );
+        iMessageCount = 0;
+        }
+    }
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/vcxmyvideosopenhandler_stub.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -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 <e32base.h>
+#include <mpxlog.h>
+#include <mpxcollectionplugin.h>
+#include <mpxcollectionpluginobserver.h>
+#include <mpxmediacontainerdefs.h>
+#include <mpxmediageneraldefs.h>
+
+#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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/vcxmyvideosvideocache_stub.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -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 <mpxmedia.h>
+#include <mpxmediageneraldefs.h>
+#include <mpxmediacontainerdefs.h>
+#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<TVcxMyVideosVideo> 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<TVcxMyVideosVideo> 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<TVcxMyVideosVideo> 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<TVcxMyVideosVideo>& CVcxMyVideosVideoListIndex::VideoArray()
+    {
+    return iVideoArray;
+    }
+#endif
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosVideoListIndex::Sort
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosVideoListIndex::Sort()
+    {
+    const TLinearOrder<TVcxMyVideosVideo> 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<CMPXMediaArray>( KMPXMediaArrayContents );
+    if( videoarray->Count() > 0 )
+        {
+        return videoarray->AtL(0);
+        }
+        
+    return NULL;
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosVideoCache::GetVideosL
+// ----------------------------------------------------------------------------
+//
+CMPXMedia* CVcxMyVideosVideoCache::GetVideosL( RArray<TUint32>& 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<TUint32>& /*aMdsIds*/,
+        TBool& aListFetchingWasCanceled, RArray<TUint32>* /*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<TMPXItemId>( 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<TUint32>& /*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
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideoscollectionutiltest/Bmarm/VcxMyVideosCollectionUtilTestU.DEF	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideoscollectionutiltest/Bwins/VcxMyVideosCollectionUtilTestU.DEF	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideoscollectionutiltest/conf/VcxMyVideosCollectionUtilTest.cfg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,154 @@
+
+[Define]
+EErrArgument -6
+[Enddefine]
+
+[Test]
+title CreateEmptyMediaList
+create VcxMyVideosCollectionUtilTest foobar
+foobar CreateEmptyMediaList
+delete foobar
+[Endtest]
+
+[Test]
+title CreateEmptyMessageList
+create VcxMyVideosCollectionUtilTest foobar
+foobar CreateEmptyMessageList
+delete foobar
+[Endtest]
+
+[Test]
+title CopyFromListToList
+create VcxMyVideosCollectionUtilTest foobar
+foobar CopyFromListToList 5 3
+delete foobar
+[Endtest]
+
+[Test]
+title CopyFromListToList2
+create VcxMyVideosCollectionUtilTest foobar
+foobar CopyFromListToList2 5 3
+delete foobar
+[Endtest]
+
+[Test]
+title DriveLetter2DriveNumber
+create VcxMyVideosCollectionUtilTest foobar
+foobar DriveLetter2DriveNumber a:    0
+foobar DriveLetter2DriveNumber c     2
+foobar DriveLetter2DriveNumber E:    4
+foobar DriveLetter2DriveNumber Z     25
+foobar DriveLetter2DriveNumber z0rRo 25
+foobar DriveLetter2DriveNumber @         EErrArgument
+foobar DriveLetter2DriveNumber [         EErrArgument
+foobar DriveLetter2DriveNumber ?:        EErrArgument
+foobar DriveLetter2DriveNumber ä         EErrArgument
+foobar DriveLetter2DriveNumber " "       EErrArgument
+foobar DriveLetter2DriveNumber KNullDesC EErrArgument
+delete foobar
+[Endtest]
+
+[Test]
+title MakeUniqueFileName
+create VcxMyVideosCollectionUtilTest foobar
+foobar MakeUniqueFileName
+delete foobar
+[Endtest]
+
+[Test]
+title Origin
+create VcxMyVideosCollectionUtilTest foobar
+foobar Origin
+delete foobar
+[Endtest]
+
+[Test]
+title Origin2
+create VcxMyVideosCollectionUtilTest foobar
+foobar Origin2
+delete foobar
+[Endtest]
+
+[Test]
+title Flags
+create VcxMyVideosCollectionUtilTest foobar
+foobar Flags
+delete foobar
+[Endtest]
+
+[Test]
+title DownloadId
+create VcxMyVideosCollectionUtilTest foobar
+foobar DownloadId
+delete foobar
+[Endtest]
+
+[Test]
+title DownloadState
+create VcxMyVideosCollectionUtilTest foobar
+foobar DownloadState
+delete foobar
+[Endtest]
+
+[Test]
+title Id
+create VcxMyVideosCollectionUtilTest foobar
+foobar Id
+delete foobar
+[Endtest]
+
+[Test]
+title Duration
+create VcxMyVideosCollectionUtilTest foobar
+foobar Duration
+delete foobar
+[Endtest]
+
+[Test]
+title Title
+create VcxMyVideosCollectionUtilTest foobar
+foobar Title
+delete foobar
+[Endtest]
+
+[Test]
+title Rating
+create VcxMyVideosCollectionUtilTest foobar
+foobar Rating
+delete foobar
+[Endtest]
+
+[Test]
+title AudioFourCc
+create VcxMyVideosCollectionUtilTest foobar
+foobar AudioFourCc
+delete foobar
+[Endtest]
+
+[Test]
+title AreSupported
+create VcxMyVideosCollectionUtilTest foobar
+foobar AreSupported
+delete foobar
+[Endtest]
+
+[Test]
+title AttrBelongsToFullSet
+create VcxMyVideosCollectionUtilTest foobar
+foobar AttrBelongsToFullSet
+delete foobar
+[Endtest]
+
+[Test]
+title PrintOpenFileHandles
+create VcxMyVideosCollectionUtilTest foobar
+foobar PrintOpenFileHandles
+delete foobar
+[Endtest]
+
+[Test]
+title GetProcessName
+create VcxMyVideosCollectionUtilTest foobar
+foobar GetProcessName testscripter_vcxmyvideoscollectionutiltest
+delete foobar
+[Endtest]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideoscollectionutiltest/data/mmc/file.txt	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,1 @@
+Some file to open.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideoscollectionutiltest/eabi/VcxMyVideosCollectionUtilTestu.def	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideoscollectionutiltest/group/VcxMyVideosCollectionUtilTest.mmp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,86 @@
+/*TYPE TESTCLASS*/
+/*
+* 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: MMP file for STIF Test Framework's TestScripter 
+* testclass test module.
+*
+*/
+
+#include <platform_paths.hrh>
+
+SMPSAFE
+
+TARGET          vcxmyvideoscollectionutiltest.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E3
+
+CAPABILITY      ALL -TCB
+/* Remove comments and replace 0x00000000 with correct vendor id */
+// VENDORID     0x00000000
+/* Remove comments and replace 0x00000000 with correct secure id */
+// SECUREID     0x00000000
+
+//TARGETPATH      ?target_path
+DEFFILE         VcxMyVideosCollectionUtilTest.def
+
+USERINCLUDE     ../inc 
+USERINCLUDE     ../../../inc
+
+APP_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH      ../src
+
+SOURCE          VcxMyVideosCollectionUtilTest.cpp
+SOURCE          VcxMyVideosCollectionUtilTestBlocks.cpp
+
+
+SOURCEPATH      ../../../src
+SOURCE          vcxmyvideoscollectionutil.cpp
+
+
+LIBRARY         euser.lib
+LIBRARY         stiftestinterface.lib
+LIBRARY         stiftestengine.lib
+
+// From original project, should these be stubbed?
+LIBRARY         estor.lib
+LIBRARY         mpxcommon.lib
+LIBRARY         bafl.lib
+LIBRARY         efsrv.lib
+
+LANG            SC
+
+/*
+START WINS      
+?wins_specific_information
+END
+
+START MARM
+?marm_specific_information
+END
+*/
+// Other possible keywords:
+ 
+// DOCUMENT     ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes)
+/*
+START BITMAP ?target
+TARGETPATH   ?emulated_path_on_target_machine
+HEADER
+SOURCE       ?color_depth ?source_bitmap
+END
+*/
+// DEFFILE ?filename
+// AIF ?filename
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideoscollectionutiltest/group/VcxMyVideosCollectionUtilTest.pkg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,66 @@
+;
+; 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:
+;
+; 	Installation file for STIF
+;
+
+; Languages
+&EN
+
+; Provide value for uid
+#{"STIF"},(0x00000000),1,1,0,TYPE=SA
+
+; 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
+"/epoc32/release/armv5/udeb/VcxMyVideosCollectionUtilTest.dll"   -   "!:/Sys/Bin/VcxMyVideosCollectionUtilTest.dll"
+
+"../data/mmc/file.txt"                                           - "c:/data/vcxmyvideoscollectionutiltest_file.txt"
+"../conf/VcxMyVideosCollectionUtilTest.cfg"                      - "c:/testframework/VcxMyVideosCollectionUtilTest.cfg"
+
+; testframework.ini won't install with sis, only for ATS test runs.
+"../init/testframework.ini"                                      - "c:/testframework/testframework.ini"
+  
+; Embedded SIS 
+; None
+
+; End of Package body
+
+; PKG dependencies
+; None
+
+; PKG capabilities
+; None
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideoscollectionutiltest/group/VcxMyVideosCollectionUtilTest_DoxyFile.txt	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,240 @@
+#
+# 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:
+#
+#
+
+# Doxyfile 1.4.1
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+PROJECT_NAME           = VcxMyVideosCollectionUtilTest
+PROJECT_NUMBER         = 
+OUTPUT_DIRECTORY       = \VcxMyVideosCollectionUtilTest\
+CREATE_SUBDIRS         = NO
+OUTPUT_LANGUAGE        = English
+USE_WINDOWS_ENCODING   = YES
+BRIEF_MEMBER_DESC      = YES
+REPEAT_BRIEF           = YES
+ABBREVIATE_BRIEF       = 
+ALWAYS_DETAILED_SEC    = NO
+INLINE_INHERITED_MEMB  = NO
+FULL_PATH_NAMES        = NO
+STRIP_FROM_PATH        = 
+STRIP_FROM_INC_PATH    = 
+SHORT_NAMES            = NO
+JAVADOC_AUTOBRIEF      = NO
+MULTILINE_CPP_IS_BRIEF = NO
+DETAILS_AT_TOP         = NO
+INHERIT_DOCS           = YES
+DISTRIBUTE_GROUP_DOC   = NO
+TAB_SIZE               = 8
+ALIASES                = 
+OPTIMIZE_OUTPUT_FOR_C  = YES
+OPTIMIZE_OUTPUT_JAVA   = NO
+SUBGROUPING            = YES
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+EXTRACT_ALL            = YES
+EXTRACT_PRIVATE        = NO
+EXTRACT_STATIC         = NO
+EXTRACT_LOCAL_CLASSES  = NO
+EXTRACT_LOCAL_METHODS  = NO
+HIDE_UNDOC_MEMBERS     = NO
+HIDE_UNDOC_CLASSES     = NO
+HIDE_FRIEND_COMPOUNDS  = NO
+HIDE_IN_BODY_DOCS      = NO
+INTERNAL_DOCS          = YES
+CASE_SENSE_NAMES       = YES
+HIDE_SCOPE_NAMES       = NO
+SHOW_INCLUDE_FILES     = YES
+INLINE_INFO            = YES
+SORT_MEMBER_DOCS       = YES
+SORT_BRIEF_DOCS        = NO
+SORT_BY_SCOPE_NAME     = NO
+GENERATE_TODOLIST      = NO
+GENERATE_TESTLIST      = NO
+GENERATE_BUGLIST       = NO
+GENERATE_DEPRECATEDLIST= YES
+ENABLED_SECTIONS       = 
+MAX_INITIALIZER_LINES  = 30
+SHOW_USED_FILES        = YES
+SHOW_DIRECTORIES       = YES
+FILE_VERSION_FILTER    = 
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET                  = NO
+WARNINGS               = YES
+WARN_IF_UNDOCUMENTED   = YES
+WARN_IF_DOC_ERROR      = YES
+WARN_NO_PARAMDOC       = NO
+WARN_FORMAT            = "$file:$line: $text"
+WARN_LOGFILE           = 
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+INPUT                  = \VcxMyVideosCollectionUtilTest\
+FILE_PATTERNS          = *.h \
+                         *.rh \
+                         *.hrh
+RECURSIVE              = YES
+EXCLUDE                = 
+EXCLUDE_SYMLINKS       = NO
+EXCLUDE_PATTERNS       = 
+EXAMPLE_PATH           = 
+EXAMPLE_PATTERNS       = 
+EXAMPLE_RECURSIVE      = NO
+IMAGE_PATH             = 
+INPUT_FILTER           = 
+FILTER_PATTERNS        = 
+FILTER_SOURCE_FILES    = NO
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+SOURCE_BROWSER         = NO
+INLINE_SOURCES         = NO
+STRIP_CODE_COMMENTS    = YES
+REFERENCED_BY_RELATION = YES
+REFERENCES_RELATION    = YES
+VERBATIM_HEADERS       = YES
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+ALPHABETICAL_INDEX     = NO
+COLS_IN_ALPHA_INDEX    = 5
+IGNORE_PREFIX          = 
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+GENERATE_HTML          = NO
+HTML_OUTPUT            = html
+HTML_FILE_EXTENSION    = .html
+HTML_HEADER            = 
+HTML_FOOTER            = 
+HTML_STYLESHEET        = 
+HTML_ALIGN_MEMBERS     = YES
+GENERATE_HTMLHELP      = YES
+CHM_FILE               = 
+HHC_LOCATION           = 
+GENERATE_CHI           = NO
+BINARY_TOC             = YES
+TOC_EXPAND             = YES
+DISABLE_INDEX          = YES
+ENUM_VALUES_PER_LINE   = 4
+GENERATE_TREEVIEW      = YES
+TREEVIEW_WIDTH         = 250
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+GENERATE_LATEX         = NO
+LATEX_OUTPUT           = latex
+LATEX_CMD_NAME         = latex
+MAKEINDEX_CMD_NAME     = makeindex
+COMPACT_LATEX          = NO
+PAPER_TYPE             = a4wide
+EXTRA_PACKAGES         = 
+LATEX_HEADER           = 
+PDF_HYPERLINKS         = NO
+USE_PDFLATEX           = NO
+LATEX_BATCHMODE        = NO
+LATEX_HIDE_INDICES     = NO
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+GENERATE_RTF           = YES
+RTF_OUTPUT             = Doc
+COMPACT_RTF            = YES
+RTF_HYPERLINKS         = YES
+RTF_STYLESHEET_FILE    = 
+RTF_EXTENSIONS_FILE    = 
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+GENERATE_MAN           = NO
+MAN_OUTPUT             = man
+MAN_EXTENSION          = .3
+MAN_LINKS              = NO
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+GENERATE_XML           = NO
+XML_OUTPUT             = xml
+XML_SCHEMA             = 
+XML_DTD                = 
+XML_PROGRAMLISTING     = YES
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+GENERATE_AUTOGEN_DEF   = NO
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+GENERATE_PERLMOD       = NO
+PERLMOD_LATEX          = NO
+PERLMOD_PRETTY         = YES
+PERLMOD_MAKEVAR_PREFIX = 
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor   
+#---------------------------------------------------------------------------
+ENABLE_PREPROCESSING   = YES
+MACRO_EXPANSION        = YES
+EXPAND_ONLY_PREDEF     = NO
+SEARCH_INCLUDES        = YES
+INCLUDE_PATH           = 
+INCLUDE_FILE_PATTERNS  = 
+PREDEFINED             = NONSHARABLE_CLASS
+EXPAND_AS_DEFINED      = 
+SKIP_FUNCTION_MACROS   = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references   
+#---------------------------------------------------------------------------
+TAGFILES               = 
+GENERATE_TAGFILE       = 
+ALLEXTERNALS           = NO
+EXTERNAL_GROUPS        = YES
+PERL_PATH              = /usr/bin/perl
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool   
+#---------------------------------------------------------------------------
+CLASS_DIAGRAMS         = YES
+HIDE_UNDOC_RELATIONS   = YES
+HAVE_DOT               = NO
+CLASS_GRAPH            = YES
+COLLABORATION_GRAPH    = YES
+GROUP_GRAPHS           = YES
+UML_LOOK               = NO
+TEMPLATE_RELATIONS     = YES
+INCLUDE_GRAPH          = YES
+INCLUDED_BY_GRAPH      = YES
+CALL_GRAPH             = NO
+GRAPHICAL_HIERARCHY    = YES
+DIRECTORY_GRAPH        = YES
+DOT_IMAGE_FORMAT       = png
+DOT_PATH               = 
+DOTFILE_DIRS           = 
+MAX_DOT_GRAPH_WIDTH    = 1024
+MAX_DOT_GRAPH_HEIGHT   = 1024
+MAX_DOT_GRAPH_DEPTH    = 0
+DOT_TRANSPARENT        = NO
+DOT_MULTI_TARGETS      = NO
+GENERATE_LEGEND        = YES
+DOT_CLEANUP            = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine   
+#---------------------------------------------------------------------------
+SEARCHENGINE           = NO
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideoscollectionutiltest/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,41 @@
+/*
+* 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:
+*
+*/
+
+PRJ_PLATFORMS
+// specify the platforms your component needs to be built for here
+// defaults to WINS MARM so you can ignore this if you just build these
+	
+	DEFAULT
+
+PRJ_TESTEXPORTS
+// NOTE: If using ARS requirements all export operations should be done under this.
+// 'abld test export'
+../conf/vcxmyvideoscollectionutiltest.cfg       /epoc32/winscw/c/testframework/vcxmyvideoscollectionutiltest.cfg
+../init/testframework.ini                       /epoc32/winscw/c/testframework/testframework.ini
+
+../data/mmc/file.txt                            /epoc32/winscw/c/data/vcxmyvideoscollectionutiltest_file.txt
+../data/mmc/file.txt                            /epoc32/winscw/c/data/vcxmyvideoscollectionutiltest_file2
+
+PRJ_EXPORTS
+
+PRJ_TESTMMPFILES
+VcxMyVideosCollectionUtilTest.mmp
+
+PRJ_MMPFILES
+	
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideoscollectionutiltest/group/make_vcxmyvideoscollectionutiltest_sisx.bat	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,22 @@
+@rem
+@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+@rem All rights reserved.
+@rem This component and the accompanying materials are made available
+@rem under the terms of "Eclipse Public License v1.0"
+@rem which accompanies this distribution, and is available
+@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+@rem
+@rem Initial Contributors:
+@rem Nokia Corporation - initial contribution.
+@rem
+@rem Contributors:
+@rem
+@rem Description: 
+@rem
+
+
+call makesis.exe VcxMyVideosCollectionUtilTest.pkg VcxMyVideosCollectionUtilTest.sis
+call signsis.exe VcxMyVideosCollectionUtilTest.sis VcxMyVideosCollectionUtilTest.sisx Nokia_RnDCert_02.der Nokia_RnDCert_02.key
+call del VcxMyVideosCollectionUtilTest.sis
+
+pause
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideoscollectionutiltest/inc/VcxMyVideosCollectionUtilTest.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,215 @@
+/*
+* 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: STIF testclass declaration
+*
+*/
+
+#ifndef VCXMYVIDEOSCOLLECTIONUTILTEST_H
+#define VCXMYVIDEOSCOLLECTIONUTILTEST_H
+
+//  INCLUDES
+#include <StifLogger.h>
+#include <TestScripterInternal.h>
+#include <StifTestModule.h>
+#include <TestclassAssert.h>
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+#define TEST_CLASS_VERSION_MAJOR 0
+#define TEST_CLASS_VERSION_MINOR 0
+#define TEST_CLASS_VERSION_BUILD 0
+
+// Logging path
+_LIT( KVcxMyVideosCollectionUtilTestLogPath, "\\logs\\testframework\\VcxMyVideosCollectionUtilTest\\" ); 
+// Log file
+_LIT( KVcxMyVideosCollectionUtilTestLogFile, "VcxMyVideosCollectionUtilTest.txt" ); 
+_LIT( KVcxMyVideosCollectionUtilTestLogFileWithTitle, "VcxMyVideosCollectionUtilTest_[%S].txt" );
+
+// FUNCTION PROTOTYPES
+//?type ?function_name(?arg_list);
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+class CVcxMyVideosCollectionUtilTest;
+
+// DATA TYPES
+//enum ?declaration
+//typedef ?declaration
+//extern ?data_type;
+
+// CLASS DECLARATION
+
+/**
+*  CVcxMyVideosCollectionUtilTest test class for STIF Test Framework TestScripter.
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+NONSHARABLE_CLASS(CVcxMyVideosCollectionUtilTest) : public CScriptBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CVcxMyVideosCollectionUtilTest* NewL( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CVcxMyVideosCollectionUtilTest();
+
+    public: // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    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 );
+
+    protected:  // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    protected:  // Functions from base classes
+
+        /**
+        * From ?base_class ?member_description
+        */
+        //?type ?member_function();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CVcxMyVideosCollectionUtilTest( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        // Prohibit copy constructor if not deriving from CBase.
+        // ?classname( const ?classname& );
+        // Prohibit assigment operator if not deriving from CBase.
+        // ?classname& operator=( const ?classname& );
+
+        /**
+        * Frees all resources allocated from test methods.
+        * @since ?Series60_version
+        */
+        void Delete();
+
+        /**
+        * Test methods are listed below. 
+        */
+        virtual TInt CreateEmptyMediaListL( CStifItemParser& aItem );
+
+        virtual TInt CreateEmptyMessageListL( CStifItemParser& aItem );        
+
+        virtual TInt CopyFromListToListL( CStifItemParser& aItem );
+        
+        virtual TInt CopyFromListToListL2( CStifItemParser& aItem );
+
+        virtual TInt DriveLetter2DriveNumberL( CStifItemParser& aItem );
+
+        virtual TInt MakeUniqueFileNameL( CStifItemParser& aItem );
+
+        virtual TInt OriginL( CStifItemParser& aItem );
+
+        virtual TInt FlagsL( CStifItemParser& aItem );
+      
+        virtual TInt DownloadIdL( CStifItemParser& aItem );
+     
+        virtual TInt DownloadStateL( CStifItemParser& aItem );
+      
+        virtual TInt IdL( CStifItemParser& aItem );
+      
+        virtual TInt DurationL( CStifItemParser& aItem );
+     
+        virtual TInt TitleL( CStifItemParser& aItem );
+      
+        virtual TInt RatingL( CStifItemParser& aItem );
+       
+        virtual TInt AudioFourCcL( CStifItemParser& aItem );
+       
+        virtual TInt AreSupportedL( CStifItemParser& aItem );
+     
+        virtual TInt AttrBelongsToFullSetL( CStifItemParser& aItem );
+        
+        virtual TInt Origin( CStifItemParser& aItem );
+
+        virtual TInt PrintOpenFileHandlesL( CStifItemParser& aItem );
+     
+        virtual TInt GetProcessNameL( CStifItemParser& aItem );
+
+        /**
+         * Method used to log version of test class
+         */
+        void SendTestClassVersion();
+
+        //ADD NEW METHOD DEC HERE
+        //[TestMethods] - Do not remove
+
+    public:     // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    protected:  // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    private:    // Data
+        
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+        // Reserved pointer for future extension
+        //TAny* iReserved;
+
+    public:     // Friend classes
+        //?friend_class_declaration;
+    protected:  // Friend classes
+        //?friend_class_declaration;
+    private:    // Friend classes
+        //?friend_class_declaration;
+
+    };
+
+#endif      // VCXMYVIDEOSCOLLECTIONUTILTEST_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideoscollectionutiltest/init/testframework.ini	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,169 @@
+#
+# This is STIFTestFramework initialization file 123
+# 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': Sret of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases' 
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.sd
+#
+# 	- 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.
+
+[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_mpxvideoplayertest
+
+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= stifmeasurementplugin04 
+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\vcxmyvideoscollectionutiltest.cfg
+[End_Module]
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework 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.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+#CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+#HardwareBasePath=  C:\
+#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
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideoscollectionutiltest/src/VcxMyVideosCollectionUtilTest.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,199 @@
+/*
+* 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: This file contains testclass implementation.
+*
+*/
+
+// INCLUDE FILES
+#include <StifTestInterface.h>
+#include "VcxMyVideosCollectionUtilTest.h"
+#include <SettingServerClient.h>
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionUtilTest::CVcxMyVideosCollectionUtilTest
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CVcxMyVideosCollectionUtilTest::CVcxMyVideosCollectionUtilTest( 
+    CTestModuleIf& aTestModuleIf ):
+        CScriptBase( aTestModuleIf )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionUtilTest::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CVcxMyVideosCollectionUtilTest::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(KVcxMyVideosCollectionUtilTestLogFileWithTitle, &title);
+        }
+    else
+        {
+        logFileName.Copy(KVcxMyVideosCollectionUtilTestLogFile);
+        }
+
+    iLog = CStifLogger::NewL( KVcxMyVideosCollectionUtilTestLogPath, 
+                          logFileName,
+                          CStifLogger::ETxt,
+                          CStifLogger::EFile,
+                          EFalse );
+    
+    SendTestClassVersion();
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionUtilTest::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CVcxMyVideosCollectionUtilTest* CVcxMyVideosCollectionUtilTest::NewL( 
+    CTestModuleIf& aTestModuleIf )
+    {
+    CVcxMyVideosCollectionUtilTest* self = new (ELeave) CVcxMyVideosCollectionUtilTest( aTestModuleIf );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+
+    }
+
+// Destructor
+CVcxMyVideosCollectionUtilTest::~CVcxMyVideosCollectionUtilTest()
+    { 
+
+    // Delete resources allocated from test methods
+    Delete();
+
+    // Delete logger
+    delete iLog; 
+
+    }
+
+//-----------------------------------------------------------------------------
+// CVcxMyVideosCollectionUtilTest::SendTestClassVersion
+// Method used to send version of test class
+//-----------------------------------------------------------------------------
+//
+void CVcxMyVideosCollectionUtilTest::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("VcxMyVideosCollectionUtilTest.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 ) // Backpointer to STIF Test Framework
+    {
+
+    return ( CScriptBase* ) CVcxMyVideosCollectionUtilTest::NewL( aTestModuleIf );
+
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideoscollectionutiltest/src/VcxMyVideosCollectionUtilTestBlocks.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,797 @@
+/*
+* 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: This file contains testclass implementation.
+*
+*/
+
+// [INCLUDE FILES] - do not remove
+#include <e32svr.h>
+#include <StifParser.h>
+#include <StifTestInterface.h>
+#include <vcxmyvideosdefs.h>
+#include <mpxmedia.h>
+#include <mpxattribute.h>
+#include <mpxmediaarray.h>
+#include <mpxmediacontainerdefs.h>
+#include <mpxmediageneraldefs.h>
+#include <mpxmediavideodefs.h>
+#include "VcxMyVideosCollectionUtilTest.h"
+#include "vcxmyvideoscollectionutil.h"
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+const TMPXAttributeData KMPXMediaFail={0xC0FFEE,0xBADBEEF};
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionUtilTest::Delete
+// Delete here all resources allocated and opened from test methods. 
+// Called from destructor. 
+// -----------------------------------------------------------------------------
+//
+void CVcxMyVideosCollectionUtilTest::Delete() 
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosCollectionUtilTest::RunMethodL
+// Run specified method. Contains also table of test mothods and their names.
+// -----------------------------------------------------------------------------
+//
+TInt CVcxMyVideosCollectionUtilTest::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( "CreateEmptyMediaList", CVcxMyVideosCollectionUtilTest::CreateEmptyMediaListL ),
+        ENTRY( "CreateEmptyMessageList", CVcxMyVideosCollectionUtilTest::CreateEmptyMessageListL ),
+        ENTRY( "CopyFromListToList", CVcxMyVideosCollectionUtilTest::CopyFromListToListL ),
+        ENTRY( "CopyFromListToList2", CVcxMyVideosCollectionUtilTest::CopyFromListToListL2 ),
+        ENTRY( "DriveLetter2DriveNumber", CVcxMyVideosCollectionUtilTest::DriveLetter2DriveNumberL ),
+        ENTRY( "MakeUniqueFileName", CVcxMyVideosCollectionUtilTest::MakeUniqueFileNameL ),
+        ENTRY( "Origin", CVcxMyVideosCollectionUtilTest::OriginL ),
+        ENTRY( "Flags", CVcxMyVideosCollectionUtilTest::FlagsL ),
+        ENTRY( "DownloadId", CVcxMyVideosCollectionUtilTest::DownloadIdL ),
+        ENTRY( "DownloadState", CVcxMyVideosCollectionUtilTest::DownloadStateL ),
+        ENTRY( "Id", CVcxMyVideosCollectionUtilTest::IdL ),
+        ENTRY( "Duration", CVcxMyVideosCollectionUtilTest::DurationL ),
+        ENTRY( "Title", CVcxMyVideosCollectionUtilTest::TitleL ),
+        ENTRY( "Rating", CVcxMyVideosCollectionUtilTest::RatingL ),
+        ENTRY( "AudioFourCc", CVcxMyVideosCollectionUtilTest::AudioFourCcL ),
+        ENTRY( "AreSupported", CVcxMyVideosCollectionUtilTest::AreSupportedL ), 
+        ENTRY( "AttrBelongsToFullSet", CVcxMyVideosCollectionUtilTest::AttrBelongsToFullSetL ),
+        ENTRY( "Origin2", CVcxMyVideosCollectionUtilTest::Origin ),
+        ENTRY( "PrintOpenFileHandles", CVcxMyVideosCollectionUtilTest::PrintOpenFileHandlesL ),
+        ENTRY( "GetProcessName", CVcxMyVideosCollectionUtilTest::GetProcessNameL ),
+        //ADD NEW ENTRY HERE
+        // [test cases entries] - Do not remove
+
+        };
+
+    const TInt count = sizeof( KFunctions ) / 
+                        sizeof( TStifFunctionInfo );
+
+    return RunInternalL( KFunctions, count, aItem );
+
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCollectionUtil::CreateEmptyMediaListL
+// ----------------------------------------------------------------------------
+//
+TInt CVcxMyVideosCollectionUtilTest::CreateEmptyMediaListL( CStifItemParser& /*aItem*/ )
+    {
+    CMPXMedia* media = TVcxMyVideosCollectionUtil::CreateEmptyMediaListL();
+    delete media;
+    
+    // Only thing that can fail here is method call leaves. If we reach the end
+    // everyting has worked fine and we can return ok.
+    return KErrNone;
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCollectionUtilTest::CreateEmptyMessageListL
+// ----------------------------------------------------------------------------
+//
+TInt CVcxMyVideosCollectionUtilTest::CreateEmptyMessageListL( CStifItemParser& /*aItem*/ )
+    {
+    CMPXMedia* media = TVcxMyVideosCollectionUtil::CreateEmptyMessageListL();
+    delete media;
+    
+    // Only thing that can fail here is method call leaves. If we reach the end
+    // everyting has worked fine and we can return ok.    
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosCollectionUtilTest::CopyFromListToListL
+// ---------------------------------------------------------------------------
+//
+TInt CVcxMyVideosCollectionUtilTest::CopyFromListToListL( CStifItemParser& aItem )
+    {
+    CMPXMedia* from = TVcxMyVideosCollectionUtil::CreateEmptyMediaListL();
+    CMPXMedia* to = TVcxMyVideosCollectionUtil::CreateEmptyMediaListL();
+    CMPXMedia* failList = CMPXMedia::NewL();
+    CMPXMedia* media( NULL );
+    TInt itemsToCopy( 0 );
+    TInt itemsCopied( 0 );
+    RArray<TUint32> ids;
+    TMPXItemId idGet;
+    TInt retVal( KErrGeneral );
+    
+    TInt numberOfMedia;
+    TInt wantedId;
+    
+    aItem.GetNextInt( numberOfMedia );
+    aItem.GetNextInt( wantedId );
+    
+    ids.Append( wantedId );
+    
+    // add stuff to be copied to "from" -list
+    CleanupStack::PushL( from );
+    CleanupStack::PushL( to );
+    CMPXMediaArray* fromMessageArray = from->Value<CMPXMediaArray>(
+            KMPXMediaArrayContents );
+    CleanupStack::PushL( fromMessageArray );
+    
+    TVcxMyVideosCollectionUtil::CopyFromListToListL( *from, *to, ids );
+    
+    for(TInt i = 0; i < numberOfMedia; i++ )
+        {
+        media = CMPXMedia::NewL();
+        CleanupStack::PushL( media );
+        media->SetTObjectValueL<TMPXItemId>( KMPXMediaGeneralId,
+                TMPXItemId( i, i) );
+        media->SetTObjectValueL<TInt32>( KVcxMediaMyVideosInt32Value,
+                42 );        
+        fromMessageArray->AppendL( media );
+        if( i == wantedId )
+            {
+            itemsToCopy++;
+            }
+        CleanupStack::Pop( media );
+        }
+    
+    TRAPD( err, TVcxMyVideosCollectionUtil::CopyFromListToListL( *from, *failList, ids ) );    
+    if( err != KErrArgument )    
+        {
+        CleanupStack::Pop( fromMessageArray );
+        CleanupStack::Pop( to );
+        CleanupStack::Pop( from );        
+        fromMessageArray->Reset();
+        delete failList;
+        delete from;
+        delete to; 
+        return retVal;
+        }
+    
+    TVcxMyVideosCollectionUtil::CopyFromListToListL( *from, *to, ids );
+    
+    // check that the "to" -list have the items it should have
+    CMPXMediaArray* toMessageArray = to->Value<CMPXMediaArray>(
+                KMPXMediaArrayContents );
+    CleanupStack::PushL( toMessageArray );
+    
+    for( TInt i = 0; i < toMessageArray->Count(); i++ )
+        {        
+        idGet = TVcxMyVideosCollectionUtil::IdL( *(toMessageArray->operator[](i)) );
+        if( idGet.iId1 == wantedId )
+            {
+            itemsCopied++;
+            }
+        }    
+    
+    if( itemsCopied == itemsToCopy )
+        {
+        retVal = KErrNone;  
+        }
+    
+    CleanupStack::Pop( toMessageArray );
+    CleanupStack::Pop( fromMessageArray );
+    CleanupStack::Pop( to );
+    CleanupStack::Pop( from );
+    
+    toMessageArray->Reset();
+    fromMessageArray->Reset();
+    
+    delete failList;
+    delete from;
+    delete to;    
+    return retVal;
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosCollectionUtilTest::CopyFromListToListL2
+// ---------------------------------------------------------------------------
+//
+TInt CVcxMyVideosCollectionUtilTest::CopyFromListToListL2( CStifItemParser& aItem )
+    {
+    RArray<CMPXMedia*> fromArray;
+    CMPXMedia* to = TVcxMyVideosCollectionUtil::CreateEmptyMediaListL();
+    CMPXMedia* failList = CMPXMedia::NewL();
+    CMPXMedia* media( NULL );        
+    TInt itemsToCopy( 0 );
+    TInt itemsCopied( 0 );
+    RArray<TUint32> ids;
+    TMPXItemId idGet;
+    TInt retVal( KErrGeneral );
+    
+    TInt numberOfMedia;
+    TInt wantedId;
+    
+    aItem.GetNextInt( numberOfMedia );
+    aItem.GetNextInt( wantedId );
+    
+    ids.Append( wantedId );
+    
+    // add stuff to be copied to "from" -list    
+    CleanupStack::PushL( to );    
+    
+    TVcxMyVideosCollectionUtil::CopyFromListToListL( fromArray, *to, ids );
+    
+    for(TInt i = 0; i < numberOfMedia; i++ )
+        {
+        media = CMPXMedia::NewL();
+        CleanupStack::PushL( media );
+        media->SetTObjectValueL<TMPXItemId>( KMPXMediaGeneralId,
+                TMPXItemId( i, i) );
+        media->SetTObjectValueL<TInt32>( KVcxMediaMyVideosInt32Value,
+                42 );        
+        fromArray.AppendL( media );
+        if( i == wantedId )
+            {
+            itemsToCopy++;
+            }
+        CleanupStack::Pop( media );
+        }    
+    
+    TRAPD(err, TVcxMyVideosCollectionUtil::CopyFromListToListL( fromArray, *failList, ids ));
+    if( err != KErrArgument )    
+        {        
+        CleanupStack::Pop( to );
+        fromArray.Reset();
+        delete failList;
+        delete to; 
+        return retVal;
+        }
+    
+    TVcxMyVideosCollectionUtil::CopyFromListToListL( fromArray, *to, ids );
+    
+    // check that the "to" -list have the items it should have
+    CMPXMediaArray* toMessageArray = to->Value<CMPXMediaArray>(
+                KMPXMediaArrayContents );
+    CleanupStack::PushL( toMessageArray );
+    
+    for( TInt i = 0; i < toMessageArray->Count(); i++ )
+        {        
+        idGet = TVcxMyVideosCollectionUtil::IdL( *(toMessageArray->operator[](i)) );
+        if( idGet.iId1 == wantedId )
+            {
+            itemsCopied++;
+            }
+        }    
+    
+    if( itemsCopied == itemsToCopy )
+        {
+        retVal = KErrNone;  
+        }
+    
+    CleanupStack::Pop( toMessageArray );    
+    CleanupStack::Pop( to );
+        
+    toMessageArray->Reset();
+    
+    for( TInt i = 0; i < fromArray.Count(); i++ )
+        {
+        CMPXMedia* arrayMedia = fromArray[i];
+        delete arrayMedia;        
+        }
+    fromArray.Reset();    
+    delete failList;
+    delete to;    
+    return retVal;
+    }
+    
+// ---------------------------------------------------------------------------
+// This helper function converts drive letter to drive number
+// ---------------------------------------------------------------------------
+//
+TInt CVcxMyVideosCollectionUtilTest::DriveLetter2DriveNumberL( CStifItemParser& aItem )
+    {
+    TInt retVal( KErrNone ); 
+    TPtrC string;
+    TInt expectedValue( -1 );
+    
+    aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
+    
+    User::LeaveIfError( aItem.GetNextString( string ) );
+    User::LeaveIfError( aItem.GetNextInt( expectedValue ) );
+    
+    _LIT( KNullDescString, "KNullDesC" );
+    if ( string.Compare( KNullDescString ) == 0 )
+        {
+        string.Set( KNullDesC );
+        }
+  
+    TInt driveNumber = TVcxMyVideosCollectionUtil::DriveLetter2DriveNumber( string );
+    if (  driveNumber != expectedValue )
+        {
+        retVal = KErrGeneral;
+        }
+
+    return retVal;
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosCollectionUtilTest::MakeUniqueFileNameL
+// ---------------------------------------------------------------------------
+//
+TInt CVcxMyVideosCollectionUtilTest::MakeUniqueFileNameL( CStifItemParser& /*aItem*/ )
+    {
+    TInt retVal( KErrNone );
+    RFs fs;
+    fs.Connect();
+    TBuf<KMaxPath> path;
+    _LIT( KFileName1,   "c:\\data\\vcxmyvideoscollectionutiltest_file.txt" );
+    _LIT( KFileName2,   "c:\\data\\vcxmyvideoscollectionutiltest_file2" );
+    _LIT( KInvalidFile, "c:\\data\\vcxmyvideoscollectionutiltest_DoesNotExist" );
+    
+    // File with filename extension 
+    TVcxMyVideosCollectionUtil::MakeUniqueFileNameL( fs, KFileName1, path );
+    if ( path.Length() <= KFileName1().Length() )
+        {
+        retVal = KErrGeneral;
+        }    
+    
+    // File without filename extension
+    TVcxMyVideosCollectionUtil::MakeUniqueFileNameL( fs, KFileName2, path );
+    if ( ( path.Find( KFileName2 ) == KErrNotFound ) ||
+         ( path.Length() <= KFileName2().Length() ) ) 
+        {
+        retVal = KErrGeneral;
+        }  
+    
+    // Non-existent file
+    TVcxMyVideosCollectionUtil::MakeUniqueFileNameL( fs, KInvalidFile, path );
+    if ( path.Compare( KInvalidFile ) != 0 )
+        {
+        retVal = KErrGeneral;
+        }
+
+    // Null descriptor
+    TVcxMyVideosCollectionUtil::MakeUniqueFileNameL( fs, KNullDesC, path );
+    
+    fs.Close();
+    return retVal;
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCollectionUtilTest::OriginL
+// ----------------------------------------------------------------------------
+//
+TInt CVcxMyVideosCollectionUtilTest::OriginL( CStifItemParser& /*aItem*/ )
+    {
+    CMPXMedia* media = CMPXMedia::NewL();
+    TInt retVal( KErrNone );
+    TUint8 valueGet = TVcxMyVideosCollectionUtil::OriginL( *media );
+    valueGet = TVcxMyVideosCollectionUtil::OriginL( *media );
+    if( EVcxMyVideosOriginOther != valueGet )
+        {
+        retVal = KErrGeneral;
+        delete media;
+        return retVal;
+        }
+    TUint8 valueSet = EVcxMyVideosOriginCapturedWithCamera;
+    media->SetTObjectValueL<TUint8>( KVcxMediaMyVideosOrigin, valueSet );
+    valueGet = TVcxMyVideosCollectionUtil::OriginL( *media );
+    if( valueSet != valueGet )
+        {
+        retVal = KErrGeneral;
+        delete media;
+        return retVal;
+        }    
+    valueSet = EVcxMyVideosOriginTvRecording;
+    media->SetTObjectValueL<TUint8>( KVcxMediaMyVideosOrigin, valueSet );
+    valueGet = TVcxMyVideosCollectionUtil::OriginL( *media );
+    if( EVcxMyVideosOriginOther != valueGet )
+        {
+        retVal = KErrGeneral;
+        }
+    delete media;
+    return retVal;
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCollectionUtilTest::FlagsL
+// ----------------------------------------------------------------------------
+//
+TInt CVcxMyVideosCollectionUtilTest::FlagsL( CStifItemParser& /*aItem*/ )
+    {
+    CMPXMedia* media = CMPXMedia::NewL();
+    TInt retVal( KErrNone );    
+    TUint32 flagsSet( 0xBEEF );
+    TUint32 flagsGet( TVcxMyVideosCollectionUtil::FlagsL( *media ) );
+    if( flagsGet != 0 )
+        {
+        delete media;
+        retVal = KErrGeneral;
+        return retVal;
+        }
+    media->SetTObjectValueL<TUint32>( KMPXMediaGeneralFlags, flagsSet );
+    flagsGet= TVcxMyVideosCollectionUtil::FlagsL( *media );
+    if( flagsSet != flagsGet )
+        {
+        retVal = KErrGeneral;
+        }
+    delete media;
+    return retVal;
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCollectionUtilTest::DownloadIdL
+// ----------------------------------------------------------------------------
+//
+TInt CVcxMyVideosCollectionUtilTest::DownloadIdL( CStifItemParser& /*aItem*/ )
+    {
+    CMPXMedia* media = CMPXMedia::NewL();
+    TInt retVal( KErrNone );
+    TUint32 idSet( 0xBEEF );
+    TUint32 idGet( TVcxMyVideosCollectionUtil::DownloadIdL( *media ) );
+    if( 0 != idGet )
+        {
+        delete media;
+        retVal = KErrGeneral;
+        return retVal;
+        }
+    media->SetTObjectValueL<TUint32>( KVcxMediaMyVideosDownloadId, idSet );
+    idGet = TVcxMyVideosCollectionUtil::DownloadIdL( *media );
+    if( idSet != idGet )
+        {
+        retVal = KErrGeneral;
+        }
+    delete media;
+    return retVal;
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCollectionUtilTest::DownloadStateL
+// ----------------------------------------------------------------------------
+//
+TInt CVcxMyVideosCollectionUtilTest::DownloadStateL( CStifItemParser& /*aItem*/ )
+    {
+    CMPXMedia* media = CMPXMedia::NewL();    
+    TInt retVal( KErrNone );
+    TVcxMyVideosDownloadState stateSet = EVcxMyVideosDlStateFailed;
+    TVcxMyVideosDownloadState stateGet = TVcxMyVideosCollectionUtil::DownloadStateL( *media );    
+    if( EVcxMyVideosDlStateNone != stateGet )
+        {
+        delete media;
+        retVal = KErrGeneral;
+        return retVal;
+        }
+    media->SetTObjectValueL<TUint32>( KVcxMediaMyVideosDownloadState, stateSet );
+    stateGet = TVcxMyVideosCollectionUtil::DownloadStateL( *media );    
+    if( stateSet != stateGet )
+        {
+        retVal = KErrGeneral;
+        }
+    delete media;
+    return retVal;
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCollectionUtilTest::IdL
+// ----------------------------------------------------------------------------
+//
+TInt CVcxMyVideosCollectionUtilTest::IdL( CStifItemParser& /*aItem*/ )
+    {
+    CMPXMedia* media = CMPXMedia::NewL();
+    TInt retVal( KErrNone );
+    TMPXItemId idSet( 2, 7 );
+    TMPXItemId idGet = TVcxMyVideosCollectionUtil::IdL( *media );
+    if( (idGet.iId1 != 0) || (idGet.iId2 != 0) )
+        {
+        delete media;
+        retVal = KErrGeneral;
+        return retVal;
+        }
+    media->SetTObjectValueL<TMPXItemId>( KMPXMediaGeneralId, idSet );
+    idGet = TVcxMyVideosCollectionUtil::IdL( *media );
+    if( idSet != idGet )
+        {
+        retVal = KErrGeneral;
+        }
+    delete media;
+    return retVal;
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCollectionUtilTest::DurationL
+// ----------------------------------------------------------------------------
+//
+TInt CVcxMyVideosCollectionUtilTest::DurationL( CStifItemParser& /*aItem*/ )
+    {
+    CMPXMedia* media = CMPXMedia::NewL();
+    TInt retVal( KErrNone );
+    TReal32 durationSet( 150 );
+    TReal32 durationGet = TVcxMyVideosCollectionUtil::DurationL( *media );
+    if( -1 != durationGet )
+        {
+        delete media;
+        retVal = KErrGeneral;
+        return retVal;
+        }
+    media->SetTObjectValueL<TReal32>( KVcxMediaMyVideosDuration, durationSet );
+    durationGet = TVcxMyVideosCollectionUtil::DurationL( *media );
+    if( durationSet != durationGet )
+        {
+        retVal = KErrGeneral;
+        }
+    delete media;
+    return retVal;
+    }
+
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::Title
+// ----------------------------------------------------------------------------
+//
+TInt CVcxMyVideosCollectionUtilTest::TitleL( CStifItemParser& /*aItem*/ )
+    {
+    CMPXMedia* media = CMPXMedia::NewL();
+    TInt retVal( KErrNone );
+    _LIT( valueSet, "TeamNinja" );
+    HBufC* valueGet = TVcxMyVideosCollectionUtil::Title( *media ).AllocL();
+    if( valueGet->Size() != 0  )
+        {
+        delete media;
+        delete valueGet;
+        retVal = KErrGeneral;
+        return retVal;
+        }
+    delete valueGet;
+    media->SetTextValueL( KMPXMediaGeneralTitle, valueSet );
+    valueGet = TVcxMyVideosCollectionUtil::Title( *media ).AllocL();
+    if( valueGet->CompareF( valueSet ) )
+        {
+        retVal = KErrGeneral;
+        }
+    delete media;
+    delete valueGet;
+    return retVal;       
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCollectionUtilTest::RatingL
+// ----------------------------------------------------------------------------
+//
+TInt CVcxMyVideosCollectionUtilTest::RatingL( CStifItemParser& /*aItem*/ )
+    {
+    CMPXMedia* media = CMPXMedia::NewL();
+    TInt retVal( KErrNone );
+    TUint8 valueSet( 21 );
+    TUint8 valueGet = TVcxMyVideosCollectionUtil::RatingL( *media );;
+    if( 0 != valueGet )
+        {
+        delete media;
+        retVal = KErrGeneral;
+        return retVal;
+        }
+    media->SetTObjectValueL<TUint8>( KVcxMediaMyVideosRating, valueSet );
+    valueGet = TVcxMyVideosCollectionUtil::RatingL( *media );;
+    if( valueSet != valueGet )
+        {
+        retVal = KErrGeneral;
+        }
+    delete media;
+    return retVal;
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCollectionUtilTest::AudioFourCcL
+// ----------------------------------------------------------------------------
+//
+TInt CVcxMyVideosCollectionUtilTest::AudioFourCcL( CStifItemParser& /*aItem*/ )
+    {
+    CMPXMedia* media = CMPXMedia::NewL();
+    TInt retVal( KErrNone );
+    TUint32 valueSet( 21 );
+    TUint32 valueGet = TVcxMyVideosCollectionUtil::AudioFourCcL( *media );;
+    if( 0 != valueGet )
+        {
+        delete media;
+        retVal = KErrGeneral;
+        return retVal;
+        }
+    media->SetTObjectValueL<TUint32>( KVcxMediaMyVideosAudioFourCc, valueSet );
+    valueGet = TVcxMyVideosCollectionUtil::AudioFourCcL( *media );;
+    if( valueSet != valueGet )
+        {
+        retVal = KErrGeneral;
+        }
+    delete media;
+    return retVal;
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCollectionUtilTest::AreSupported
+// ----------------------------------------------------------------------------
+//
+TInt CVcxMyVideosCollectionUtilTest::AreSupportedL( CStifItemParser& /*aItem*/ )
+    {
+    TInt retVal( KErrNone );
+    CMPXMedia* media = CMPXMedia::NewL();
+    RArray<TMPXAttribute> attrs;
+    TBool inMds( EFalse );
+    TVcxMyVideosCollectionUtil::AreSupported( *media, attrs.Array(), inMds );        
+    attrs.Append( KMPXMediaFail );
+    TVcxMyVideosCollectionUtil::AreSupported( *media, attrs.Array(), inMds );
+    attrs.Append( KMPXMediaVideoBitRate );
+    inMds = ETrue;    
+    TVcxMyVideosCollectionUtil::AreSupported( *media, attrs.Array(), inMds );
+    media->SetTObjectValueL<TUint16>( KMPXMediaVideoBitRate, 47 );
+    TVcxMyVideosCollectionUtil::AreSupported( *media, attrs.Array(), inMds );
+    delete media;
+    return retVal;
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCollectionUtilTest::AttrBelongsToFullSet
+// ----------------------------------------------------------------------------
+//
+TInt CVcxMyVideosCollectionUtilTest::AttrBelongsToFullSetL( CStifItemParser& /*aItem*/ )
+    {
+    TInt retVal( KErrNone );
+
+    if ( !( TVcxMyVideosCollectionUtil::AttrBelongsToFullSet( KMPXMediaGeneralComment ) &&
+         TVcxMyVideosCollectionUtil::AttrBelongsToFullSet( KMPXMediaGeneralCopyright ) &&
+         TVcxMyVideosCollectionUtil::AttrBelongsToFullSet( KMPXMediaGeneralMimeType ) &&
+         TVcxMyVideosCollectionUtil::AttrBelongsToFullSet( KMPXMediaGeneralLastPlaybackPosition ) &&
+         TVcxMyVideosCollectionUtil::AttrBelongsToFullSet( KVcxMediaMyVideosModifiedDate ) &&
+         TVcxMyVideosCollectionUtil::AttrBelongsToFullSet( KVcxMediaMyVideosAudioLanguage ) &&
+         TVcxMyVideosCollectionUtil::AttrBelongsToFullSet( KVcxMediaMyVideosAuthor ) &&
+         TVcxMyVideosCollectionUtil::AttrBelongsToFullSet( KMPXMediaVideoBitRate ) &&
+         TVcxMyVideosCollectionUtil::AttrBelongsToFullSet( KMPXMediaVideoHeight ) &&
+         TVcxMyVideosCollectionUtil::AttrBelongsToFullSet( KMPXMediaVideoWidth ) &&
+         TVcxMyVideosCollectionUtil::AttrBelongsToFullSet( KMPXMediaVideoArtist ) ) )
+        {
+        retVal = KErrGeneral;
+        return retVal;
+        }
+    
+    if( TVcxMyVideosCollectionUtil::AttrBelongsToFullSet( KMPXMediaFail ) )
+        {
+        retVal = KErrGeneral;
+        }
+        
+    return retVal;
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCollectionUtilTest::Origin
+// ----------------------------------------------------------------------------
+//
+TInt CVcxMyVideosCollectionUtilTest::Origin( CStifItemParser& /*aItem*/ )
+    {
+    TInt retVal( KErrNone );
+    
+    if ( ( TVcxMyVideosCollectionUtil::Origin( KVcxMvcCategoryIdDownloads ) 
+            != EVcxMyVideosOriginDownloaded ) ||
+         ( TVcxMyVideosCollectionUtil::Origin( KVcxMvcCategoryIdTvRecordings ) 
+            != EVcxMyVideosOriginTvRecording ) ||
+         ( TVcxMyVideosCollectionUtil::Origin( KVcxMvcCategoryIdCaptured ) 
+            != EVcxMyVideosOriginCapturedWithCamera ) ||
+         ( TVcxMyVideosCollectionUtil::Origin( KVcxMvcCategoryIdOther ) 
+            != EVcxMyVideosOriginOther ) ||
+         ( TVcxMyVideosCollectionUtil::Origin( KVcxMvcCategoryIdAll ) 
+            != KErrNotFound ) )
+        {
+        retVal = KErrGeneral;
+        return retVal;
+        }
+    
+    if( TVcxMyVideosCollectionUtil::Origin( KCategoryIdExtraItem3 ) != KErrNotFound )
+        {
+        retVal = KErrGeneral;
+        }
+    
+    return retVal;
+    }   
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCollectionUtilTest::PrintOpenFileHandlesL
+// ----------------------------------------------------------------------------
+//
+TInt CVcxMyVideosCollectionUtilTest::PrintOpenFileHandlesL( CStifItemParser& /*aItem*/ )
+    {
+    TInt retVal( KErrNone );
+    
+#ifdef _DEBUG
+    RFs fs;
+    RFile file;
+    _LIT( KFileName,        "c:\\data\\vcxmyvideoscollectionutiltest_file.txt" );
+    _LIT( KInvalidFileName, "c:\\data\\vcxmyvideoscollectionutiltest_fail.txt" );    
+    User::LeaveIfError( fs.Connect() );
+    User::LeaveIfError( file.Open( fs, KFileName, EFileShareAny | EFileRead ) );
+    
+    TVcxMyVideosCollectionUtil::PrintOpenFileHandlesL( KFileName, fs );
+    TVcxMyVideosCollectionUtil::PrintOpenFileHandlesL( KInvalidFileName, fs );
+    
+    file.Close();
+    fs.Close();    
+#endif // _DEBUG
+    
+    return retVal;
+    }   
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCollectionUtilTest::GetProcessName
+// ----------------------------------------------------------------------------
+//
+TInt CVcxMyVideosCollectionUtilTest::GetProcessNameL( CStifItemParser& aItem )
+    {
+    TInt retVal( KErrNone );
+    TPtrC testProcessName;
+    TUint64 threadId = RThread().Id().Id();
+    TFullName processName;
+    //_LIT( KTestProcessName, "testscripter_vcxmyvideoscollectionutiltest" );
+
+    retVal = aItem.GetNextString( testProcessName );
+    
+#ifdef _DEBUG    
+    if ( retVal == KErrNone )
+        {
+        TVcxMyVideosCollectionUtil::GetProcessName( threadId, processName );
+        if ( processName.Find( testProcessName ) == KErrNotFound )
+            {
+            retVal = KErrNotFound;
+            }
+        }
+#endif // _DEBUG    
+    return retVal;
+    }
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+// None
+
+//  [End of File] - Do not remove
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/Bwins/VcxMyVideosMdsDbTestU.DEF	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/conf/VcxMyVideosMdsDbTest.cfg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,256 @@
+#BLOCKS#
+CreateL
+DeleteL
+CancelL
+AddVideoL
+RemoveVideoL
+UpdateVideoL
+CreateVideoListL
+DoCreateVideoListL
+CreateVideoL
+HandleQueryNewResultsL
+HandleQueryCompletedL
+AsyncHandleQueryCompletedL
+HandleSessionErrorL
+HandleObjectNotificationL
+HandleObjectPresentNotificationL
+ShutdownNotificationL
+
+[Test]
+title Create & delete
+create VcxMyVideosMdsDbTest test
+test CreateL
+test DeleteL
+delete test
+[Endtest]
+
+
+
+[Test]
+title Create mds fail
+create VcxMyVideosMdsDbTest test
+allownextresult -2
+test CreateL 1
+test DeleteL
+delete test
+[Endtest]
+
+[Test]
+title Create mds fail async
+create VcxMyVideosMdsDbTest test
+test CreateL 0 1
+test DeleteL
+delete test
+[Endtest]
+
+[Test]
+title Cancel
+create VcxMyVideosMdsDbTest test
+test CreateL
+loop 10
+test CancelL LOOP_COUNTER
+test DoCreateVideoListL 4
+test CancelL LOOP_COUNTER
+endloop
+test DeleteL
+delete test
+[Endtest]
+
+[Test]
+title AddVideoL
+create VcxMyVideosMdsDbTest test
+test CreateL
+test AddVideoL 0 0 0 0 0
+allownextresult -2
+test AddVideoL 0 -2 0 0 
+allownextresult -2
+test AddVideoL 1 0 0 0 0
+
+test AddVideoL 0 0 0 0 0 1 
+test AddVideoL 0 0 0 0 1 0
+test AddVideoL 0 0 0 0 1 1
+test AddVideoL 0 0 0 1 0 0
+test AddVideoL 0 0 0 1 0 1
+test AddVideoL 0 0 0 1 1 0
+test AddVideoL 0 0 0 1 1 1
+test AddVideoL 0 0 1 0 0 1
+test AddVideoL 0 0 1 0 1 0
+test AddVideoL 0 0 1 0 1 1
+test AddVideoL 0 0 1 1 0 0
+test AddVideoL 0 0 1 1 0 1
+test AddVideoL 0 0 1 1 1 0
+test AddVideoL 0 0 1 1 1 1
+test DeleteL
+delete test
+[Endtest]
+
+[Test]
+title RemoveVideoL
+create VcxMyVideosMdsDbTest test
+test CreateL
+test RemoveVideoL 0 0
+allownextresult -1
+test RemoveVideoL 1 0
+allownextresult -2
+test RemoveVideoL 0 -2
+test DeleteL
+delete test
+[Endtest]
+
+[Test]
+title UpdateVideoL
+create VcxMyVideosMdsDbTest test
+test CreateL
+test UpdateVideoL 0 0
+allownextresult -1
+test UpdateVideoL 1 0
+allownextresult -2
+test UpdateVideoL 0 -2
+allownextresult -14
+test UpdateVideoL 0 0 1
+test DeleteL
+delete test
+[Endtest]
+
+[Test]
+title CreateVideoL
+create VcxMyVideosMdsDbTest test
+test CreateL
+test CreateVideoL 0 0 1 2
+test CreateVideoL 1 0 1 3
+allownextresult -2
+test CreateVideoL 0 -2 1 4
+test CreateVideoL 0  0 0 5
+test CreateVideoL 0  0 0 0
+test DeleteL
+delete test
+[Endtest]
+
+[Test]
+title CreateVideoListL
+create VcxMyVideosMdsDbTest test
+test CreateL
+test CreateVideoListL
+test DeleteL
+delete test
+[Endtest]
+
+[Test]
+title DoCreateVideoListL
+create VcxMyVideosMdsDbTest test
+test CreateL
+loop 128
+test DoCreateVideoListL  LOOP_COUNTER
+test CancelL
+endloop
+test DeleteL
+delete test
+[Endtest]
+
+[Test]
+title HandleQueryNewResultsL
+create VcxMyVideosMdsDbTest test
+test CreateL
+test HandleQueryNewResultsL 0 0 0 
+test DoCreateVideoListL 0 1
+test HandleQueryNewResultsL 0 0 0 
+test HandleQueryNewResultsL 0 0 1 
+test HandleQueryNewResultsL 0 1 0
+test HandleQueryNewResultsL 0 1 1
+test HandleQueryNewResultsL 1 0 0 
+test HandleQueryNewResultsL 1 0 1 
+test HandleQueryNewResultsL 1 1 0
+test HandleQueryNewResultsL 1 1 1
+test HandleQueryNewResultsL 0 0 0 1
+test DeleteL
+delete test
+[Endtest]
+
+[Test]
+title HandleQueryCompletedL
+create VcxMyVideosMdsDbTest test
+test CreateL
+test HandleQueryCompletedL 0 0 
+test HandleQueryCompletedL 0 1
+test HandleQueryCompletedL 1 0
+test HandleQueryCompletedL 1 1 
+test DoCreateVideoListL 0 1
+test HandleQueryCompletedL 0 0 
+test HandleQueryCompletedL 0 1
+test HandleQueryCompletedL 1 0
+test HandleQueryCompletedL 1 1 
+test DeleteL
+delete test
+[Endtest]
+
+[Test]
+title AsyncHandleQueryCompletedL
+create VcxMyVideosMdsDbTest test
+test CreateL
+test AsyncHandleQueryCompletedL 0 0 
+test AsyncHandleQueryCompletedL 0 1
+test AsyncHandleQueryCompletedL 1 0
+test AsyncHandleQueryCompletedL 1 1 
+test DoCreateVideoListL 0 1
+test AsyncHandleQueryCompletedL 0 0 
+test AsyncHandleQueryCompletedL 0 1
+test AsyncHandleQueryCompletedL 1 0
+test AsyncHandleQueryCompletedL 1 1 
+test DeleteL
+delete test
+[Endtest]
+
+[Test]
+title HandleSessionErrorL
+create VcxMyVideosMdsDbTest test
+test CreateL
+test HandleSessionErrorL 0
+test HandleSessionErrorL 1
+test DeleteL
+delete test
+[Endtest]
+
+[Test]
+title HandleObjectNotificationL
+create VcxMyVideosMdsDbTest test
+test CreateL
+loop 10
+test HandleObjectNotificationL LOOP_COUNTER
+endloop
+test HandleObjectNotificationL 1 1
+test DeleteL
+delete test
+[Endtest]
+
+[Test]
+title HandleObjectPresentNotification
+create VcxMyVideosMdsDbTest test
+test CreateL
+test HandleObjectPresentNotification 0
+test HandleObjectPresentNotification 1
+test HandleObjectPresentNotification 0 1
+test DeleteL
+delete test
+[Endtest]
+
+[Test]
+title ShutdownNotificationL
+create VcxMyVideosMdsDbTest test
+test CreateL
+test ShutdownNotificationL 0
+test ShutdownNotificationL 1
+test ShutdownNotificationL 2
+test DeleteL
+delete test
+[Endtest]
+
+[Test]
+title MdsServerTerminated
+create VcxMyVideosMdsDbTest test
+test CreateL
+test ShutdownNotificationL 1
+allownextresult -15
+test AddVideoL 4
+test DeleteL
+delete test
+[Endtest]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/eabi/VcxMyVideosMdsDbTestu.def	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/group/VcxMyVideosMdsDbTest.mmp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,90 @@
+/*TYPE TESTCLASS*/
+/*
+* 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: MMP file for STIF Test Framework's TestScripter 
+* testclass test module.
+*
+*/
+
+// %version: 3 %
+
+#include <platform_paths.hrh>
+
+SMPSAFE
+EPOCALLOWDLLDATA
+
+TARGET          vcxmyvideosmdsdbtest.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E3
+
+CAPABILITY      ALL -TCB
+/* Remove comments and replace 0x00000000 with correct vendor id */
+// VENDORID     0x00000000
+/* Remove comments and replace 0x00000000 with correct secure id */
+// SECUREID     0x00000000
+
+//TARGETPATH      ?target_path
+DEFFILE         VcxMyVideosMdsDbTest.def
+
+USERINCLUDE     ../inc 
+USERINCLUDE     ../../../inc
+USERINCLUDE     ../../../../../inc
+
+OS_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH      ../src
+
+SOURCE          VcxMyVideosMdsDbTest.cpp
+SOURCE          VcxMyVideosMdsDbTestBlocks.cpp
+SOURCE          vcxmyvideoscollectionutil.cpp
+SOURCE          mdesession.cpp
+SOURCE          mdesessionimpl.cpp
+SOURCE          mdeobjectdef.cpp
+SOURCE          mdeproperty.cpp
+SOURCE          mdepropertydef.cpp
+SOURCE          mdeobject.cpp
+SOURCE          mdenamespacedef.cpp
+SOURCE          mdequery.cpp
+SOURCE          mdeobjectquery.cpp
+SOURCE          mdeitem.cpp
+SOURCE          mdeinstanceitem.cpp
+SOURCE          mdeorderrule.cpp
+SOURCE          vcxmyvideosmdscmdqueue.cpp
+SOURCE          vcxmyvideosmdsalbums.cpp
+
+SOURCEPATH      ../../../src
+SOURCE          vcxmyvideosmdsdb.cpp
+
+APP_LAYER_SYSTEMINCLUDE
+
+OS_LAYER_LIBC_SYSTEMINCLUDE
+OS_LAYER_STDCPP_SYSTEMINCLUDE
+OS_LAYER_BOOST_SYSTEMINCLUDE
+
+SYSTEMINCLUDE   /epoc32/include/ecom
+LIBRARY         euser.lib
+LIBRARY         ecom.lib
+LIBRARY         estor.lib
+LIBRARY         mpxcommon.lib
+LIBRARY         bafl.lib
+LIBRARY         flogger.lib
+LIBRARY         efsrv.lib
+LIBRARY         charconv.lib
+LIBRARY         stiftestinterface.lib
+LIBRARY         stiftestengine.lib
+
+LANG            SC
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/group/VcxMyVideosMdsDbTest.pkg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,38 @@
+;
+; 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: Package file for mpxvideoplayer STIF test
+;
+; 	Installation file for STIF
+;
+
+; Languages
+&EN
+
+; Provide value for uid
+#{"MPX Video db STIF"}, (0x101FB3E3), 1, 0, 1, TYPE=SA, RU
+
+
+; Series60 product id for S60 3.0
+[0x101F7961], 0, 0, 0, {"Series60ProductID"}
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+; Install files
+"\epoc32\release\armv5\udeb\VcxMyVideosMdsDbTest.dll"   -   "!:\Sys\Bin\VcxMyVideosMdsDbTest.dll"
+"..\conf\VcxMyVideosMdsDbTest.cfg" - "c:\testframework\VcxMyVideosMdsDbTest.cfg"
+"..\init\testframework.ini" - "c:\testframework\testframework.ini"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,35 @@
+/*
+* 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: 4 %
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+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
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/inc/VcxMyVideosMdsDbTest.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,251 @@
+/*
+* 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: STIF testclass declaration
+*
+*/
+
+#ifndef VCXMYVIDEOSMDSDBTEST_H
+#define VCXMYVIDEOSMDSDBTEST_H
+
+//  INCLUDES
+#include <StifLogger.h>
+#include <TestScripterInternal.h>
+#include <StifTestModule.h>
+#include <TestclassAssert.h>
+#include <f32file.h>
+
+
+#include <mpxcollectionplugin.h>
+#include <mpxcollectionpath.h>
+#include <mpxcollectionmessagedefs.h>
+#include <vcxmyvideosdefs.h>
+
+//#include <mpxmedia.h>
+
+
+#include <mdesession.h>
+#include <mdequery.h>
+#include <harvesterclient.h>
+#include <mpxcollectionmessagedefs.h>
+#include <vcxmyvideosdefs.h>
+#include <e32property.h>
+#include "vcxmyvideosalbum.h"
+
+#define protected public
+#define private public
+#include "vcxmyvideosmdsdb.h"
+#undef private
+#undef protected
+
+
+
+// MACROS
+//#define ?macro ?macro_def
+#define TEST_CLASS_VERSION_MAJOR 0
+#define TEST_CLASS_VERSION_MINOR 0
+#define TEST_CLASS_VERSION_BUILD 0
+
+// Logging path
+_LIT( KVcxMyVideosMdsDbTestLogPath, "\\logs\\testframework\\VcxMyVideosMdsDbTest\\" ); 
+// Log file
+_LIT( KVcxMyVideosMdsDbTestLogFile, "VcxMyVideosMdsDbTest.txt" ); 
+_LIT( KVcxMyVideosMdsDbTestLogFileWithTitle, "VcxMyVideosMdsDbTest_[%S].txt" );
+
+// FUNCTION PROTOTYPES
+//?type ?function_name(?arg_list);
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+class CVcxMyVideosMdsDbTest;
+//class CVcxMyVideosMdsDb;
+//class CMPXMedia;
+
+// DATA TYPES
+//enum ?declaration
+//typedef ?declaration
+//extern ?data_type;
+extern CVcxMyVideosMdsDbTest* test;
+
+// CLASS DECLARATION
+
+/**
+*  CVcxMyVideosMdsDbTest test class for STIF Test Framework TestScripter.
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+NONSHARABLE_CLASS(CVcxMyVideosMdsDbTest) : public CScriptBase, public MVcxMyVideosMdsDbObserver
+    {
+    public:  // Constructors and destructor
+
+
+        /**
+        * Two-phased constructor.
+        */
+        static CVcxMyVideosMdsDbTest* NewL( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CVcxMyVideosMdsDbTest();
+        
+    // FROM MVcxMyVideosMdsDbObserver
+        
+        /**
+        * Handler function for database events.
+        *
+        * @param aEvent Event type.
+        * @param aId    Array of IDs in database.
+        */
+        void HandleMyVideosDbEvent( TMPXChangeEventType aEvent, RArray<TUint32>& aId, TInt aEventsLeft  );
+
+        /**
+        * Handler function for 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.
+        */
+        void HandleCreateVideoListResp( CMPXMedia* aVideoList,
+                TInt aNewItemsStartIndex, TBool aComplete );
+
+        /**
+        * Handler function for media remove/insert events. This is called every time
+        * media is removed or inserted (objects become present or non present).
+        */
+        void HandleObjectPresentNotification(){};
+
+    public: // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    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 );
+
+    protected:  // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    protected:  // Functions from base classes
+
+        /**
+        * From ?base_class ?member_description
+        */
+        //?type ?member_function();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CVcxMyVideosMdsDbTest( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        /**
+        * Frees all resources allocated from test methods.
+        * @since ?Series60_version
+        */
+        void Delete();
+
+        /**
+        * Test methods are listed below. 
+        */
+
+        virtual TInt CreateL( CStifItemParser& aItem );
+
+        virtual TInt DeleteL( CStifItemParser& aItem );
+
+        virtual TInt CancelL( CStifItemParser& aItem );
+
+        virtual TInt AddVideoL( CStifItemParser& aItem );
+
+        virtual TInt RemoveVideoL( CStifItemParser& aItem );
+
+        virtual TInt UpdateVideoL( CStifItemParser& aItem );
+
+        virtual TInt CreateVideoListL( CStifItemParser& aItem );
+        
+        virtual TInt DoCreateVideoListL( CStifItemParser& aItem );
+
+        virtual TInt CreateVideoL( CStifItemParser& aItem );
+        
+        virtual TInt HandleQueryNewResultsL( CStifItemParser& aItem );
+
+        virtual TInt HandleQueryCompletedL( CStifItemParser& aItem );
+        
+        virtual TInt AsyncHandleQueryCompletedL( CStifItemParser& aItem );
+        
+        virtual TInt HandleSessionErrorL( CStifItemParser& aItem );
+        
+        virtual TInt HandleObjectNotificationL( CStifItemParser& aItem );
+
+        virtual TInt HandleObjectPresentNotification( CStifItemParser& aItem );
+
+        virtual TInt ShutdownNotificationL( CStifItemParser& aItem );        
+        
+        
+        /**
+         * Method used to log version of test class
+         */
+        void SendTestClassVersion();
+        
+        void PrepareMdsL(  CStifItemParser& aItem  ) ;
+
+    private:    // Data
+        
+        CVcxMyVideosMdsDb* iMdsDb;
+
+        RFs iFs;
+        
+    public:
+    
+        TInt mdssessionerror,  mdssessionasyncerror,
+        mdsoperationleaves, mdsoperationreturns, mdeobjectopenresult,
+        querycountresult, propertynotdefined, propertyisnull, handledbeventleave ;
+        
+        
+        CMPXMedia* iVideoList;
+        
+    };
+
+
+
+#endif      // VCXMYVIDEOSMDSDBTEST_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/inc/mdeinstanceitem.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,67 @@
+/*
+* 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:  ?Description
+*
+*/
+
+
+#ifndef __MDEINSTANCEITEM_H__
+#define __MDEINSTANCEITEM_H__
+
+
+#include <mdeitem.h>
+
+enum TMdEInstanceType
+	{
+	EMdETypeObject = 1,
+	EMdETypeRelation,
+	EMdETypeEvent,
+	EMdETypeProperty
+	};
+
+/**
+ * Abstract base class for all instance items stored in the metadata engine database.
+ */
+NONSHARABLE_CLASS(CMdEInstanceItem) : public CMdEItem
+	{
+public:
+	
+	/* Destructor. */
+
+	/**
+	 * Destructor.
+	 */
+	virtual ~CMdEInstanceItem();
+
+
+	/* Methods. */
+
+	virtual TMdEInstanceType InstanceType() const = 0;
+	
+protected:
+
+	/* Constructors. */
+
+	/**
+	 * Constructor.
+	 */
+	CMdEInstanceItem(CMdESession* aSession, TItemId aId);
+
+	/**
+	 * Second-phase constructor.
+	 */
+	void InstanceItemBaseConstruct();
+	};
+
+#endif  // __MDEINSTANCEITEM_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/inc/mdeitem.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,135 @@
+/*
+* 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:  ?Description
+*
+*/
+
+
+#ifndef __MDEITEM_H__
+#define __MDEITEM_H__
+
+
+#include <e32base.h>
+
+#include <mdccommon.h>
+
+/** 
+ * Internal identifier for metadata engine database items. Must always be
+ * different from 0.
+ */
+class CMdESession;
+
+/**
+ * Abstract base class for all items stored in the metadata engine database.
+ */
+NONSHARABLE_CLASS(CMdEItem) : public CBase
+	{
+public:
+	
+	/**
+	 * Destructor.
+	 */
+	virtual ~CMdEItem();
+
+
+	/* Methods. */
+
+	/**
+	 * Returns whether the item belongs to a session.
+	 *
+	 * @return  <code>ETrue</code>, if the item belongs to a session;
+	 *          <code>EFalse</code>, otherwise
+	 */
+	IMPORT_C TBool BelongsToSession() const;
+
+	/**
+	 * Returns the session the item belongs to. Panics if
+	 * the item does not belong to any session.
+	 *
+	 * @return  session that the item belongs to
+	 */
+	IMPORT_C CMdESession& Session() const;
+
+	/**
+	 * Returns whether the item is stored in the database.
+	 *
+	 * @return  <code>ETrue</code>, if the item is in the database;
+	 *          <code>EFalse</code>, otherwise
+	 */
+	IMPORT_C TBool InDatabase() const;
+
+	/**
+	 * Returns the internal database identifier of the item. 
+	 *
+	 * @return  internal database identifier or <code>KNoId</code> if item is not stored in database.
+	 */
+	IMPORT_C TItemId Id() const;
+
+	/**
+	 * Sets that the internal database identifier of the object.
+	 *
+	 * @param aId  internal database identifier
+	 */
+	void SetId(TItemId aId);
+
+	/**
+	 * Sets the session the item belongs to. 
+	 *
+	 * @param aSession  session
+	 */
+	void SetSession(CMdESession& aSession);
+
+protected:
+
+	/* Constructors and destructor. */
+	
+	/**
+	 * Constructor. Note that if the new item is in the database
+	 * (i.e., it has an internal database identifier), it must also belong 
+	 * to a session.
+	 *
+	 * @param aSession  session that the new item belongs to;
+	 *                  or 0, if the new item does not belong to any session
+	 * @param aId		internal database identifier of the new item,
+	 *                  if the item is in the database (note that then also 
+	 *                  <code>aSession</code> must be different from 0);
+	 *					or 0, if the item is not in the database
+	 */
+	CMdEItem(CMdESession* aSession, TItemId aId);
+	
+	/**
+	 * Second-phase constructor.
+	 */
+	void ItemBaseConstruct();
+	
+	/* Utility methods. */
+
+	/**
+	 * Panics if the item does not belong to any session.
+	 */
+	void CheckSession() const;
+
+
+private:
+
+	/** Session. */
+	CMdESession* iSession;
+
+	/** Internal database identifier. */
+	TItemId iId;
+	
+	friend class CMdESession;
+	};
+
+#endif  // __MDEITEM_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/inc/mdenamespacedef.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,222 @@
+/*
+* 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:  ?Description
+*
+*/
+
+#ifndef __MDENAMESPACEDEF_H__
+#define __MDENAMESPACEDEF_H__
+
+
+#include <mdccommon.h>
+
+class CMdESession;
+class CMdCSerializationBuffer;
+class CMdERelationDef;
+class CMdEEventDef;
+class CMdEObjectDef;
+
+class TMdCNamespaceDef;
+
+
+/**
+ * Namespace definition.
+ */
+NONSHARABLE_CLASS(CMdENamespaceDef) : public CBase
+	{
+public:
+	/**
+	 * Returns whether the namespace is read only.
+	 *
+	 * @return  <code>ETrue</code>, if the namespace is read only;
+	 *          <code>EFalse</code>, otherwise
+	 */
+	IMPORT_C TBool ReadOnly() const;
+
+	/**
+	 * Returns the name of the item.
+	 *
+	 * @return  name
+	 */
+	IMPORT_C const TDesC& Name() const;
+
+	/**
+	 * Compare this namespace definition with other namespace definition.
+	 *
+	 * @param aNamespaceDef other namespace definition
+	 *
+	 * @return  0 if namespaces are same, 1 or more if this is greater than other 
+	 *          and -1 or less if this is less than other.
+	 */
+	IMPORT_C TInt Compare(const CMdENamespaceDef& aNamespaceDef) const;
+	
+	/**
+	 * Returns the number of object definitions.
+	 *
+	 * @return  number of object definitions
+	 */
+	IMPORT_C TInt ObjectDefCount() const;
+
+	/**
+	 * Returns the object definition at the specified index.
+	 *
+	 * @param aIndex  index
+	 *
+	 * @return  object definition or leave, if there is no object definition
+	 *          with the specified name.	
+	 *
+	 * @panics if aIndex is out of bounds	 
+	 */
+	IMPORT_C CMdEObjectDef& ObjectDefL(TInt aIndex);
+
+	/**
+	 * Returns the object definition with the specified name.
+	 *
+	 * @param aName       name
+	 *
+	 * @return  object definition or leave, if there is no object definition
+	 *          with the specified name.	 
+	 */
+	IMPORT_C CMdEObjectDef& GetObjectDefL(const TDesC& aName);
+		
+	/**
+	 * Returns the number of relation definitions.
+	 *
+	 * @return  number of relation definitions
+	 */
+	IMPORT_C TInt RelationDefCount() const;
+
+	/**
+	 * Returns the relation definition at the specified index.
+	 *
+	 * @param aIndex  index
+	 *
+	 * @return  relation definition or leave, if there is no object definition
+	 *          with the specified name.	
+	 */
+	IMPORT_C CMdERelationDef& RelationDefL(TInt aIndex);
+
+	/**
+	 * Returns the relation definition with the specified name.
+	 *
+	 * @param aName       name
+	 *
+	 * @return  relation definition or leave, if there is no object definition
+	 *          with the specified name.	
+	 *
+	 * @panics if aIndex is out of bounds	 
+	 */
+	IMPORT_C CMdERelationDef& GetRelationDefL(const TDesC& aName);
+
+	/**
+	 * Returns the number of event definitions. 
+	 *
+	 * @return  number of event definitions
+	 */
+	IMPORT_C TInt EventDefCount() const;
+
+	/**
+	 * Returns the event definition at the specified index.
+	 *
+	 * @param aIndex  index
+	 *
+	 * @return  event definition or leave, if there is no object definition
+	 *          with the specified name.	
+	 * 
+	 * @panics if aIndex is out of bounds
+	 */
+	IMPORT_C CMdEEventDef& EventDefL(TInt aIndex);
+
+	/**
+	 * Returns the event definition with the specified name.
+	 *
+	 * @param aName       name
+	 *
+	 * @return  event definition or leave, if there is no object definition
+	 *          with the specified name.	
+	 */
+	IMPORT_C CMdEEventDef& GetEventDefL(const TDesC& aName);
+
+public:
+	static CMdENamespaceDef* NewL(const CMdESession& aMdeSession, 
+			const TMdCNamespaceDef& aNamespaceDef, 
+			CMdCSerializationBuffer& aSchemaBuffer);
+
+	static CMdENamespaceDef* NewLC(const CMdESession& aMdeSession, 
+			const TMdCNamespaceDef& aNamespaceDef, 
+			CMdCSerializationBuffer& aSchemaBuffer);
+		
+	/**
+	 * Destructor.
+	 */
+	virtual ~CMdENamespaceDef();
+	
+	TDefId Id() const;		
+	
+	/**
+	 * Returns the object definition with the specified id.
+	 *
+	 * @param aId       id
+	 *
+	 * @return  object definition; or 0, if there is no object definition
+	 *          with the specified id
+	 */
+	CMdEObjectDef* GetObjectDefL(TDefId aId);	
+
+	/**
+	 * Returns the relation definition with the specified id.
+	 *
+	 * @param aId       id
+	 *
+	 * @return  relation definition; or 0, if there is no relation definition
+	 *          with the specified id
+	 */
+	CMdERelationDef* GetRelationDefL(TDefId aId);
+
+	/**
+	 * Returns the event definition with the specified id.
+	 *
+	 * @param aId       id
+	 *
+	 * @return  event definition; or 0, if there is no event definition
+	 *          with the specified id
+	 */
+	CMdEEventDef* GetEventDefL(TDefId aId);
+	
+	/**
+	 * Returns the MdE session where namespace definition belongs.
+	 *
+	 * @return MdE session
+	 */
+	const CMdESession& Session() const;
+
+private:
+	CMdENamespaceDef(const CMdESession& aMdeSession, 
+			const TMdCNamespaceDef& aNamespaceDef);
+
+	void ConstructL(CMdCSerializationBuffer& aSchemaBuffer);
+
+private:
+	const CMdESession& iMdeSession;
+
+	const TMdCNamespaceDef& iNamespaceDef;
+
+	TPtrC16 iName;
+
+	RPointerArray<CMdEObjectDef> iObjectDefs;
+	RPointerArray<CMdERelationDef> iRelationDefs;
+	RPointerArray<CMdEEventDef> iEventDefs;
+	};
+
+#endif  // __MDENAMESPACEDEF_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/inc/mdeobject.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,735 @@
+/*
+* 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:  ?Description
+*
+*/
+
+
+#ifndef __MDEOBJECT_H__
+#define __MDEOBJECT_H__
+
+//#include <uri16.h>
+
+#include <mdeinstanceitem.h>
+
+// CMdEProperty compatibility wrappers
+#include <mdetextproperty.h>
+#include <mdenumberproperty.h>
+
+/* Forward declarations. */
+class CMdEObjectDef;
+class CMdEPropertyDef;
+class CMdEProperty;
+class CMdCSerializationBuffer;
+class CMdENamespaceDef;
+
+NONSHARABLE_CLASS( TMdEObject )
+	{
+public:
+	/* Constructors and destructor. */
+
+	/**
+	 * Constructs a new object.
+	 */
+	IMPORT_C TMdEObject();
+
+	/**
+	 * Returns the ID of the object.
+	 *
+	 * @return  Object ID.
+	 */
+	IMPORT_C TItemId Id() const;
+
+	/**
+	 * Returns the definition of the object. Leaves with error code 
+	 * KErrNotFound if object definition is missing.
+	 *
+	 * @return Object definition.
+	 */
+	IMPORT_C const CMdEObjectDef& DefL() const;
+	
+	/**
+	 * Returns whether object is confidential or not.
+	 *
+	 * @return  <code>ETrue</code>, if the object has been set to confidential.
+	 *          <code>EFalse</code>, otherwise.
+	 */
+	IMPORT_C TBool Confidential() const;
+	
+	/**
+	 * Returns whether object is placeholder or not.
+	 *
+	 * @return  <code>ETrue</code>, if the object has been set to placeholder.
+	 *          <code>EFalse</code>, otherwise.
+	 */
+	IMPORT_C TBool Placeholder() const;
+
+	/**
+	 * Returns whether object is removed or not.
+	 *
+	 * @return  <code>ETrue</code>, if the object has been set to removed.
+	 *          <code>EFalse</code>, otherwise.
+	 */
+	IMPORT_C TBool Removed() const;
+	
+	/**
+	 * Returns whether object is present or not.
+	 *
+	 * @return  <code>ETrue</code>, if the object has been set to not present.
+	 *          <code>EFalse</code>, otherwise.
+	 */
+	IMPORT_C TBool NotPresent() const;
+	
+public:
+	/**
+	 * Calculates required size for buffer to serialize object
+	 *
+	 * @return necessary buffer size
+	 */
+	static TUint32 RequiredBufferSize();
+
+	/**
+	 * Retrieve object from serialized buffer
+	 *
+	 * @param aBuffer buffer where serialized object is
+	 * @param aNamespaceDef namespace definition of namespace where object is 
+	 *                      located
+	 */
+	void DeSerializeL(CMdCSerializationBuffer& aBuffer, 
+			CMdENamespaceDef& aNamespaceDef);
+
+protected:
+	/** object ID */
+	TItemId iId;
+
+	/** Pointer to object definition, this doesn't own it. */
+	CMdEObjectDef* iDef;
+
+	/** various flags */
+	TUint32 iFlags;
+	};
+
+/**
+ * Object.
+ */
+NONSHARABLE_CLASS(CMdEObject) : public CMdEInstanceItem
+	{
+public:
+
+	/* Constructors and destructor. */
+
+	/**
+	 * Constructs a new object from serialized buffer
+	 *
+	 * @param aBuffer  buffer which contains serialized object
+	 * @param aNamespaceDef  reference to namespace where to object is created
+	 */
+	static CMdEObject* NewL( CMdESession* aSession, CMdCSerializationBuffer& aBuffer, CMdENamespaceDef& aNamespaceDef );
+
+	/**
+	 * Constructs a new object from serialized buffer and leave it on stack
+	 *
+	 * @param aBuffer  buffer which contains serialized object
+	 * @param aNamespaceDef  reference to namespace where to object is created
+	 */
+	static CMdEObject* NewLC( CMdESession* aSession, CMdCSerializationBuffer& aBuffer, CMdENamespaceDef& aNamespaceDef );
+
+	/**
+	 * Constructs a new object.
+	 *
+	 * @param aDef  Definition of the new object.
+	 * @param aUri URI of the new object.
+	 * @param aMediaId mediaid of object. Defaults to 0.
+	 */
+
+	static CMdEObject* NewL( CMdEObjectDef& aDef, const TDesC& aUri, TUint32 aMediaId = 0 );
+
+	/**
+	 * Constructs a new object.
+	 *
+	 * @param aDef  Definition of the new object.
+	 * @param aUri URI of the new object.
+	 * @param aMediaId mediaid of object. Defaults to 0.
+	 */
+	static CMdEObject* NewLC( CMdEObjectDef& aDef, const TDesC& aUri, TUint32 aMediaId = 0 );
+
+
+	/**
+	 * Destructor.
+	 */
+	virtual ~CMdEObject();
+
+	/* Methods. */
+
+	/**
+	 * Returns the definition of the object.
+	 *
+	 * @return  Object definition.
+	 */
+	IMPORT_C CMdEObjectDef& Def() const;
+
+	/**
+	 * Sets the definition of the object. Object's old object definition must 
+	 * be "Object" and object must not belong to any session, otherwise method 
+	 * leaves with error code KErrNotSupported.
+	 * 
+	 * @param aDef  New object definition.
+	 */
+	IMPORT_C void SetDefL(CMdEObjectDef& aDef);
+
+	/**
+	 * Returns the URI of the object.
+	 *
+	 * @return  URI.
+	 */
+	IMPORT_C const TDesC& Uri() const;
+
+	/**
+	 * Sets the URI of the object.
+	 *
+	 * @param aUri  New URI.
+	 */
+	IMPORT_C void SetUriL(const TDesC& aUri);
+
+	/**
+	 * Returns whether object is confidential or not.
+	 *
+	 * @return  <code>ETrue</code>, if the object has been set to confidential.
+	 *          <code>EFalse</code>, otherwise.
+	 */
+	IMPORT_C TBool Confidential() const;
+
+	/**
+	 * Returns whether object is confidential or not.
+	 *
+	 * @param aValue  <code>ETrue</code>, if the object is confidential.
+	 *                <code>EFalse</code>, otherwise.
+	 */
+	IMPORT_C void SetConfidential(TBool aValue);
+
+	/**
+	 * Returns whether object is placeholder or not.
+	 *
+	 * @return  <code>ETrue</code>, if the object has been set to placeholder.
+	 *          <code>EFalse</code>, otherwise.
+	 */
+	IMPORT_C TBool Placeholder() const;
+
+	/**
+	 * Returns whether object is placeholder or not.
+	 *
+	 * @param aValue  <code>ETrue</code>, if the object is placeholder.
+	 *                <code>EFalse</code>, otherwise.
+	 */
+	IMPORT_C void SetPlaceholder(TBool aValue);
+
+	
+	/**
+	 * Returns the Media ID of the object.
+	 *
+	 * @return  Media ID.
+	 */
+	IMPORT_C TUint32 MediaId() const;
+	
+	/**
+	 * Sets the Media ID of the object.
+	 *
+	 * @param aMediaId  New Media ID.
+	 */
+	IMPORT_C void SetMediaId(TUint32 aMediaId);
+
+	/**
+	 * Returns the usage count of the object.
+	 *
+	 * @return usage count
+	 */
+	IMPORT_C TUint32 UsageCount() const;
+	
+	/**
+	 * Returns the Guid of the object.
+	 *
+	 * @param aGuidHigh reference where GuidHigh will be stored
+	 * @param aGuidLow reference where GuidLow will be stored
+	 */
+	IMPORT_C void Guid( TInt64& aGuidHigh, TInt64& aGuidLow ) const;
+
+	/**
+	 * Sets the Guid of the object.
+	 *
+	 * @param aGuidHigh new GuidHigh value
+	 * @param aGuidLow new GuidLow value
+	 */
+	IMPORT_C void SetGuid( const TInt64& aGuidHigh, const TInt64& aGuidLow );
+
+	/**
+	 * Returns whether the object is open for modifications or not.
+	 *
+	 * @return  <code>ETrue</code>, if the object is open for modifications.
+	 *          <code>EFalse</code>, otherwise.
+	 */
+	IMPORT_C TBool OpenForModifications() const;
+
+	/* Methods for accessing properties. */
+
+	/**
+	 * Returns the number of properties.
+	 *
+	 * @return  number of properties
+	 */
+	IMPORT_C TInt PropertyCount() const;
+
+	/**
+	 * Returns the property at the specified index.
+	 *
+	 * @param aIndex  index
+	 *
+	 * @return  property
+	 */
+	IMPORT_C CMdEProperty& PropertyL(TInt aIndex) const;
+
+	/**
+	 * Returns the property by given property def
+	 *
+	 * Example:
+	 *  CMdENamespaceDef& defaultNamespace = iMdeSession->GetDefaultNamespaceDefL();
+     *	CMdEObjectDef& imageDef = defaultNamespace.GetObjectDefL( MdeConstants::Image::KImageObject );
+	 *  CMdEObject* image = iMdESession->OpenObjectL( 17, imageDef );
+	 * 
+	 *  CMdEPropertyDef& lastModDatePropDef = imageDef.GetPropertyDefL(
+     *   		Object::KLastModifiedDateProperty );
+     * 
+     *  CMdEProperty* lastModDateProp = NULL;
+     *  image->Property( lastModDatePropDef, lastModDateProp );
+	 * 
+	 * @param aDef      property definition
+	 * @param aProperty ref to pointer that will receive property address, if such is found.
+	 * @param aStartAt  index where to begin search(by default starts from beginning)
+	 *
+	 * @return  Index, or <code>KErrNotFound</code>.
+	 */
+    IMPORT_C TInt Property(const CMdEPropertyDef& aDef, CMdEProperty*& aProperty, TInt aStartAt=0) const;
+
+	/**
+	 * Returns the number of properties of the specified definition.
+	 *
+	 * @param aDef  property definition
+	 *
+	 * @return  number of properties
+	 */
+	IMPORT_C TInt PropertyCount(const CMdEPropertyDef& aDef) const;
+
+	/**
+	 * Adds a new bool property to the object. If property definition doesn't 
+	 * match with value, method leaves with error code KErrArgument.
+	 * 
+	 * Example:
+	 *   CMdEPropertyDef& receivedDef = objectDef.GetPropertyDefL( MdeConstants::Message::KReceivedProperty );
+	 *   metadataObject.AddBoolPropertyL( receivedDef, ETrue );
+	 *
+	 * @param aDef         Definition of the new property.
+	 * @param aValue       Value of the new property.
+	 *
+	 * @return  New property.
+	 */
+	IMPORT_C CMdEProperty& AddBoolPropertyL(CMdEPropertyDef& aDef, TBool aValue);
+
+	/**
+	 * Adds a new signed 8-bit integer property to the object. If property 
+	 * definition doesn't match with value, method leaves with error code 
+	 * KErrArgument.
+	 * 
+	 * Example:
+	 *   CMdEPropertyDef& eightBitDef = objectDef.GetPropertyDefL( MdeConstants::Object::KProperty );
+	 *   metadataObject.AddInt8PropertyL( eightBitDef, value );
+	 *
+	 * @param aDef         Definition of the new property.
+	 * @param aValue       Value of the new property.
+	 *
+	 * @return  New property.
+	 */
+	IMPORT_C CMdEProperty& AddInt8PropertyL(CMdEPropertyDef& aDef, TInt8 aValue);
+
+	/**
+	 * Adds a new unsigned 8-bit integer property to the object. If property 
+	 * definition doesn't match with value, method leaves with error code 
+	 * KErrArgument.
+	 *
+	 * Example:
+	 *   CMdEPropertyDef& eightBitDef = objectDef.GetPropertyDefL( MdeConstants::Object::KProperty );
+	 *   metadataObject.AddUint8PropertyL( eightBitDef, value );
+	 * 
+	 * @param aDef         Definition of the new property.
+	 * @param aValue       Value of the new property.
+	 *
+	 * @return  New property.
+	 */
+	IMPORT_C CMdEProperty& AddUint8PropertyL(CMdEPropertyDef& aDef, TUint8 aValue);
+
+	/**
+	 * Adds a new signed 16-bit integer property to the object. If property 
+	 * definition doesn't match with value, method leaves with error code 
+	 * KErrArgument.
+	 *
+	 * Example:
+	 *   CMdEPropertyDef& propertyDef = objectDef.GetPropertyDefL( MdeConstants::Object::KProperty );
+	 *   metadataObject.AddInt16PropertyL( propertyDef, value ); 
+	 *
+	 * @param aDef         Definition of the new property.
+	 * @param aValue       Value of the new property.
+	 *
+	 * @return  New property.
+	 */
+	IMPORT_C CMdEProperty& AddInt16PropertyL(CMdEPropertyDef& aDef, TInt16 aValue);
+
+	/**
+	 * Adds a new unsigned 16-bit integer property to the object. If property 
+	 * definition doesn't match with value, method leaves with error code 
+	 * KErrArgument.
+	 *
+	 * Example:
+	 *   CMdEPropertyDef& propertyDef = objectDef.GetPropertyDefL( MdeConstants::Object::KProperty );
+	 *   metadataObject.AddUint16PropertyL( propertyDef, value );
+	 * 
+	 * @param aDef         Definition of the new property.
+	 * @param aValue       Value of the new property.
+	 *
+	 * @return  New property.
+	 */	 
+	IMPORT_C CMdEProperty& AddUint16PropertyL(CMdEPropertyDef& aDef, TUint16 aValue);
+
+	/**
+	 * Adds a new signed 32-bit integer property to the object. If property 
+	 * definition doesn't match with value, method leaves with error code 
+	 * KErrArgument.
+	 * 
+	 * Example:
+	 *   CMdEPropertyDef& propertyDef = objectDef.GetPropertyDefL( MdeConstants::Object::KProperty );
+	 *   metadataObject.AddInt32PropertyL( propertyDef, value );
+	 *
+	 * @param aDef         Definition of the new property.
+	 * @param aValue       Value of the new property.
+	 *
+	 * @return  New property.
+	 */
+	IMPORT_C CMdEProperty& AddInt32PropertyL(CMdEPropertyDef& aDef, TInt32 aValue);
+
+	/**
+	 * Adds a new unsigned 32-bit integer property to the object. If property 
+	 * definition doesn't match with value, method leaves with error code 
+	 * KErrArgument.
+	 * 
+	 * Example:
+	 *   CMdEPropertyDef& propertyDef = objectDef.GetPropertyDefL( MdeConstants::Object::KProperty );
+	 *   metadataObject.AddUint32PropertyL( propertyDef, value );
+	 *
+	 * @param aDef         Definition of the new property. If property definition doesn't 
+	 * match with value, method leaves with error code KErrArgument.
+	 * @param aValue       Value of the new property.
+	 *
+	 * @return  New property.
+	 */
+	IMPORT_C CMdEProperty& AddUint32PropertyL(CMdEPropertyDef& aDef, TUint32 aValue);
+
+	/**
+	 * Adds a new 64-bit integer property to the object. If property definition 
+	 * doesn't match with value, method leaves with error code KErrArgument.
+	 *
+	 * Example:
+	 *   CMdEPropertyDef& propertyDef = objectDef.GetPropertyDefL( MdeConstants::Object::KProperty );
+	 *   metadataObject.AddInt64PropertyL( propertyDef, value );
+	 * 
+	 * @param aDef         Definition of the new property.
+	 * @param aValue       Value of the new property.
+	 *
+	 * @return  New property.
+	 */
+	IMPORT_C CMdEProperty& AddInt64PropertyL(CMdEPropertyDef& aDef, TInt64 aValue);
+
+	/**
+	 * Adds a new 32-bit real property to the object. If property definition 
+	 * doesn't match with value, method leaves with error code KErrArgument.
+	 *
+	 * Example:
+	 *   CMdEPropertyDef& propertyDef = objectDef.GetPropertyDefL( MdeConstants::Object::KProperty );
+	 *   metadataObject.AddReal32PropertyL( propertyDef, realValue );
+	 * 
+	 * @param aDef         Definition of the new property.
+	 * @param aValue       Value of the new property.
+	 *
+	 * @return  New property.
+	 */
+	IMPORT_C CMdEProperty& AddReal32PropertyL(CMdEPropertyDef& aDef, TReal32 aValue);
+
+	/**
+	 * Adds a new 64-bit real property to the object. If property definition 
+	 * doesn't match with value, method leaves with error code KErrArgument.
+	 *
+	 * Example:
+	 *   CMdEPropertyDef& propertyDef = objectDef.GetPropertyDefL( MdeConstants::Object::KProperty );
+	 *   metadataObject.AddReal64PropertyL( propertyDef, realValue );
+	 * 
+	 * @param aDef         Definition of the new property.
+	 * @param aValue       Value of the new property.
+	 *
+	 * @return  New property.
+	 */
+	IMPORT_C CMdEProperty& AddReal64PropertyL(CMdEPropertyDef& aDef, TReal64 aValue);
+
+	/**
+	 * Adds a new text property to the object. If property definition doesn't 
+	 * match with value, method leaves with error code KErrArgument.
+	 *
+	 * Example:
+	 *   CMdEPropertyDef& propertyDef = objectDef.GetPropertyDefL( MdeConstants::Object::KProperty );
+	 *   metadataObject.AddTextPropertyL( propertyDef, text );
+	 * 
+	 * @param aDef         Definition of the new property.
+	 * @param aValue       Value of the new property.
+	 *
+	 * @return  New property.
+	 */
+	IMPORT_C CMdEProperty& AddTextPropertyL(CMdEPropertyDef& aDef, const TDesC& aValue);
+
+	/**
+	 * Adds a new time property to the object. If property definition doesn't 
+	 * match with value, method leaves with error code KErrArgument.
+	 *
+	 * Example:
+	 *   CMdEPropertyDef& propertyDef = objectDef.GetPropertyDefL( MdeConstants::Object::KProperty );
+	 *   metadataObject.AddTimePropertyL( propertyDef, time );
+	 * 
+	 * @param aDef         Definition of the new property.
+	 * @param aValue       Value of the new property.
+	 *
+	 * @return  New property.
+	 */
+	IMPORT_C CMdEProperty& AddTimePropertyL(CMdEPropertyDef& aDef, TTime aValue);
+
+	/**
+	 * Removes the property at the specified index.
+	 *
+	 * @param aIndex  index
+	 */
+	IMPORT_C void RemoveProperty(TInt aIndex);
+
+
+	/* Methods for accessing free text keywords. */
+
+	/**
+	 * Returns the number of free text keywords.
+	 *
+	 * @return  number of free text keywords
+	 */
+	IMPORT_C TInt FreeTextCount() const;
+
+	/**
+	 * Returns the free text keyword at the specified index
+	 *
+	 * @param aIndex  index
+	 *
+	 * @return  free text keyword
+	 */
+	IMPORT_C TPtrC FreeText(TInt aIndex) const;
+    
+    /**
+     * Returns the index of the specified free text.
+     *
+     * @param aFreeText  Free text.
+     *
+     * @return  Index, or <code>KErrNotFound</code>.
+     */
+    IMPORT_C TInt FreeTextIndex(const TDesC& aFreeText) const;
+
+	/**
+	 * Adds a new free text keyword.
+	 *
+	 * @param aFreeText  free text keyword
+	 */
+	IMPORT_C void AddFreeTextL(const TDesC& aFreeText);
+
+	/**
+	 * Removes the free text keyword at the specified index.
+	 *
+	 * @param aIndex  index
+	 */
+	IMPORT_C void RemoveFreeText(TInt aIndex);
+
+	/**
+	 * Move all properties from object which is given as a paremeter to this object
+	 *
+	 * @param aObject object from where move properties
+	 */
+	IMPORT_C void MovePropertiesL(CMdEObject& aObject);
+
+	/**
+	 * Returns whether the object has been modified or not.
+	 *
+	 * @return  <code>ETrue</code>, if the URI, MediaId or Guids  has been modified.
+	 *          <code>EFalse</code>, otherwise.
+	 */
+	TBool ObjectModified() const;
+
+	/**
+	 * Returns whether the free text array has been modified or not.
+	 *
+	 * @return  <code>ETrue</code>, if FreeTexts has been modified.
+	 *          <code>EFalse</code>, otherwise.
+	 */
+	TBool FreeTextModified() const;
+
+	/**
+	 * Returns whether one of the properties has been modified or not.
+	 *
+	 * @return  Are properties modified.
+	 */
+	TBool PropertyModified() const;
+
+	/*
+	 * clear all modification flags and removes removed properties
+	 */
+	void ClearObject( TBool aClearFlags = ETrue );
+
+	/**
+	 * Sets that the object is not open for modifications.
+	 */
+	void SetNotOpenForModifications();
+
+	/**
+	 * Left locked automatically after it's added to DB.
+	 */
+	void AutoLockL() const;
+	
+	/**
+	 * Calculates required size for buffer to serialize object
+	 *
+	 * @return necessary buffer size
+	 */
+	TUint32 RequiredBufferSize() const;
+
+	/**
+	 * Serialize object
+	 * RequiredBufferSize() MUST be always called before this function!
+	 *
+	 * @param aBuffer buffer where serialized object should go
+	 */
+	TMdCOffset SerializeL(CMdCSerializationBuffer& aBuffer, TMdCOffset aFreespaceOffset) const;
+
+protected:
+
+	virtual TMdEInstanceType InstanceType() const;
+
+private:
+
+	/**
+	 * Constructs a new object.
+	 *
+	 * @param aSession session owner
+	 * @param aId object id
+	 * @param aDef  Definition of the new object.
+	 */
+	CMdEObject( CMdESession* aSession, TItemId aId, CMdEObjectDef& aDef );
+	
+	/**
+	 * Second-phase constructor.
+	 * @param aUri URI of the new object.
+	 * @param aMediaId mediaid of object. Defaults to 0.
+	 */
+	void ConstructL( const TDesC& aUri, TUint32 aMediaId = 0 );
+	
+	/**
+	 * Sets the URI of the object.
+	 *
+	 * @param aUri  New URI.
+	 */
+	void DoSetUriL(const TDesC& aUri);
+
+	/**
+	 * Adds a new property to the object.
+	 *
+	 * @param aProperty  New property.
+	 * @param aState     Modification state of the new property.
+	 */
+	void DoAddPropertyL(CMdEProperty& aProperty);
+	
+	/**
+	 * Compares two properties.
+	 *
+	 * @param aFirst   First property.
+	 * @param aSecond  Second property.
+	 *
+	 * @return  0, if the properties are equal;
+	 *		    a negative value, if the first property is less than the second;
+	 *			a positive value, if the first property is greater than the second.
+	 */
+	static TInt CompareProperties(const CMdEProperty& aFirst, 
+						          const CMdEProperty& aSecond);
+
+	/**
+	 * Adds a new free text to the object.
+	 *
+	 * @param aFreeText  New free text.
+	 */
+	TInt DoAddFreeTextL(const HBufC& aFreeText);
+
+	/**
+	 * Compares two free texts.
+	 *
+	 * @param aFirst   First free text.
+	 * @param aSecond  Second free text.
+	 *
+	 * @return  0, if the texts are equal;
+	 *		    a negative value, if the first text is less than the second;
+	 *			a positive value, if the first text is greater than the second.
+	 */
+	static TInt CompareFreeTexts(const HBufC& aFirst, const HBufC& aSecond);
+
+	/**
+	 * Returns how many properties is modified and should be send to server
+	 */
+	TUint32 ModifiedPropertiesCount() const;
+
+private:
+
+	/** Object definition.
+	 * This pointer must be initialized in constructor and 
+	 * not must be NULL in any point. */
+	CMdEObjectDef* iDef;
+
+	/** Array for properties. */
+	RPointerArray<CMdEProperty> iPropertyArray;	
+
+	/** Array for free text. */
+	RPointerArray<HBufC> iFreeTextArray;	
+
+	/** various flags */
+	mutable TUint32 iFlags;
+	
+	/** memory card Id */
+	TUint32 iMediaId;
+
+	/** usage count (read-only) */
+	TUint32 iUsageCount;
+	
+	/** Guid Low and High */
+	TInt64 iGuidHigh;
+	TInt64 iGuidLow;
+
+	/** URI descriptor. */
+	HBufC* iUri;
+
+	mutable CMdEProperty* iProperty;
+	};
+
+
+#endif  // __MDEOBJECT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/inc/mdeobjectdef.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,131 @@
+/*
+* 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:  ?Description
+*
+*/
+
+
+#ifndef __MDEOBJECTDEF_H__
+#define __MDEOBJECTDEF_H__
+
+
+#include <e32base.h>
+//#include <uri16.h>
+
+#include <mdccommon.h>
+
+// Forward declaration
+class CMdEPropertyDef;
+class CMdCSerializationBuffer;
+class CMdENamespaceDef;
+class TMdCObjectDef;
+
+/**
+ * Object definition.
+ */
+NONSHARABLE_CLASS(CMdEObjectDef) : public CBase
+	{
+public:	
+	IMPORT_C CMdEObjectDef* ParentL();
+	
+	/**
+	 * Returns the name of the item.
+	 *
+	 * @return  name
+	 */
+	IMPORT_C const TDesC& Name() const;
+
+	/**
+	 * Returns the number of property definitions.
+	 *
+	 * @return  number of property definitions
+	 */
+	IMPORT_C TInt PropertyDefCount() const;
+
+	/**
+	 * Returns the property definition at the specified index.
+	 *
+	 * @return  property definition
+	 */
+	IMPORT_C CMdEPropertyDef& PropertyDefL(TInt aIndex);
+
+	/**
+	 * Returns the property definition with the specified name.
+	 *
+	 * @param aName         name
+	 *
+	 * @return  property definition; 
+	 *          or 0 if there is no property definition with the specified name
+	 */
+	IMPORT_C CMdEPropertyDef& GetPropertyDefL(const TDesC& aName);
+
+	/**
+	 * Compare this object definition with other object definition.
+	 *
+	 * @param aObjectDef other object definition
+	 *
+	 * @return  0 if objects are same, 1 or more if this is greater than other 
+	 *          and -1 or less if this is less than other.
+	 */
+	IMPORT_C TInt Compare(const CMdEObjectDef& aObjectDef) const;
+	
+	/**
+	* Returns namespacedef where this objectdef belongs to.
+	* @Return namespacedef where this objectdef belongs to.
+	*/
+	IMPORT_C CMdENamespaceDef& NamespaceDef() const;
+	
+public:
+	static CMdEObjectDef* NewL(const TMdCObjectDef& aObjectDef, CMdCSerializationBuffer& aSchemaBuffer, CMdENamespaceDef& aNamespaceDef );
+
+	static CMdEObjectDef* NewLC(const TMdCObjectDef& aObjectDef, CMdCSerializationBuffer& aSchemaBuffer, CMdENamespaceDef& aNamespaceDef );
+
+	/**
+	 * Destructor.
+	 */
+	virtual ~CMdEObjectDef();
+
+	IMPORT_C TDefId Id() const;	
+	
+	/**
+	 * Returns the property definition with the specified id
+	 *
+	 * @param aId         id
+	 *
+	 * @return  property definition; 
+	 *          or <code>NULL</code> if there is no property definition with the specified id
+	 */
+	CMdEPropertyDef* GetPropertyDefL(TDefId aId, CMdEObjectDef* aChild = NULL);
+
+private:
+	CMdEObjectDef(const TMdCObjectDef& aObjectDef, CMdENamespaceDef& aNamespaceDef);
+
+	CMdEPropertyDef* PropertyDefL(TInt aIndex, CMdEObjectDef* aChild);
+
+	CMdEPropertyDef* GetPropertyDefL(const TDesC& aName, CMdEObjectDef* aChild);
+
+	void ConstructL(CMdCSerializationBuffer& aSchemaBuffer);
+
+    static TInt CompareProperties(const CMdEPropertyDef& aFirst, const CMdEPropertyDef& aSecond);
+	
+private:
+	const TMdCObjectDef& iObjectDef;
+	CMdENamespaceDef& iNamespaceDef;
+
+	TPtrC16 iName;
+		
+	RPointerArray<CMdEPropertyDef> iPropertyDefs;
+	};
+
+#endif  // __MDEOBJECTDEF_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/inc/mdeobjectquery.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,139 @@
+/*
+* 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:  Interface for object query
+*
+*/
+
+
+#ifndef __MDEOBJECTQUERY_H__
+#define __MDEOBJECTQUERY_H__
+
+
+#include <mdequery.h>
+
+/* Forward declarations. */
+class CMdEObject;
+class CMdEObjectDef;
+class CMdEPropertyDef;
+class CMdEObjectDef;
+class CMdESession;
+
+/**
+ * A query that fetches a set of objects from the metadata engine database.
+ */
+NONSHARABLE_CLASS(CMdEObjectQuery) : public CMdEQuery
+	{
+public:
+	
+	/* Constructors and destructor. */
+
+	/**
+	 * Destructor.
+	 */
+	virtual ~CMdEObjectQuery();
+
+
+	/* Methods. */
+
+    
+    /**
+    * Adds new propertyfilter. Propertyfilters determines which properties
+    * are included in result.
+    
+    * @param aPropertyDef property definition of property which is wanted to
+      be part of result.
+    */
+    IMPORT_C void AddPropertyFilterL( const CMdEPropertyDef* aPropertyDef );
+    
+    /**
+    Clears propertyfilters. After call to this function all properties are 
+    returned unless call to <code>AddPropertyFilterL</code> is done.
+    */
+    
+    IMPORT_C void ResetPropertyFilter();
+
+    /**
+	 * Returns one of the result objects.
+	 *
+	 * @return  The result object that was requested. The query retains 
+     *          ownership of the returned object.
+	 */
+	IMPORT_C CMdEObject& Result(TInt aIndex) const;
+
+    /**
+	 * Returns query's object definition.
+	 *
+	 * @return  object definition.
+	 */
+	IMPORT_C CMdEObjectDef& ObjectDef() const;
+	
+	CMdEObjectQuery();
+
+public:
+	RPointerArray<CMdEPropertyDef>& PropertyFilter();	
+
+	RPointerArray<CMdEObjectDef>* ObjectDefs() const;
+	
+    CMdEObjectQuery(CMdESession& aSession, CMdENamespaceDef& aNamespaceDef, 
+    		CMdEObjectDef& aObjectDef, RPointerArray<CMdEObjectDef>* aObjectDefs);
+
+protected:
+
+	/* Constructors. */
+
+    /**
+     * Constuctor.
+     *
+     * @param aSession  Session.
+     */
+
+	/**
+	 * Second-phase constructor.
+	 */
+	void ObjectQueryConstructL();
+
+    virtual void DoCancel();
+
+private:
+
+    /* Private methods. */
+
+
+private:
+
+    /** 
+     * Properties to include when fetching results. Empty, if
+     * all available properties should be fetched. 
+     */
+    RPointerArray<CMdEPropertyDef> iPropertyFilters;
+
+	/**
+	 * Query's object definition.
+	 */
+	CMdEObjectDef& iObjectDef;
+
+	/**
+	 * Query's object definition.
+	 */
+	RPointerArray<CMdEObjectDef>* iObjectDefs;
+	
+	/**
+	 * Speed optimization to drop freetexts from results.
+	 */
+	TBool iFreetextsInResult;
+	
+	mutable CMdEObject* iCMdEObject;
+    };
+
+#endif  // __MDEOBJECTQUERY_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/inc/mdeorderrule.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,156 @@
+/*
+* 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:  ?Description
+*
+*/
+
+
+#ifndef __MDEORDERRULE_H__
+#define __MDEORDERRULE_H__
+
+
+#include <e32base.h>
+
+#include <mdccommon.h>
+
+/* Forward declarations. */
+class CMdEPropertyDef;
+class CMdCSerializationBuffer;
+
+/**
+ * TMdEOrderRule defines a rule that is used for sorting the results of a
+ * query. A query may use multiple order rules.
+ */
+class TMdEOrderRule
+    {
+public:
+
+    /* Constructors. */
+
+    /**
+     * Constructor.
+     *
+     * @param aType       Type of the order rule.
+     * @param aAscending  <code>ETrue</code>, if the rule order is 
+     *                    ascending.
+     */        
+    IMPORT_C TMdEOrderRule(TOrderRuleType aType, TBool aAscending = ETrue);   
+
+    /**
+     * Constructor.
+     *
+     * @param aPropertyDef  Property definition.
+     * @param aAscending    <code>ETrue</code>, if the rule order is 
+     *                      ascending.
+     */        
+    IMPORT_C TMdEOrderRule(const CMdEPropertyDef& aPropertyDef, 
+                           TBool aAscending = ETrue);
+
+
+    /* Methods. */
+
+    /**
+     * Returns the type of the order rule.
+     *
+     * @return  Order rule type constant.
+     */
+    IMPORT_C TOrderRuleType Type() const;
+
+    /**
+     * Sets the type of the order rule.
+     *
+     * @param aType  Order rule type constant.
+     */
+    IMPORT_C void SetType(TOrderRuleType aType);
+
+    /**
+     * Determines whether the ordering is ascending.
+     *
+     * @return  <code>ETrue</code> ascending order,
+     *          <code>EFalse</code> descending order.
+     */
+    IMPORT_C TBool Ascending() const;
+
+    /**
+     * Sets the order rule to ascending or descending order.
+     *
+     * @param aAscending  <code>ETrue</code> ascending order,
+     *                    <code>EFalse</code> descending order.
+     */
+    IMPORT_C void SetAscending(TBool aAscending = ETrue);
+
+    /**
+     * Returns the property definition associated with the order rule.
+     *
+     * @return  Property definition.  <code>NULL</code>, if no property
+     *          definition has been associated with the rule.
+     */
+    IMPORT_C const CMdEPropertyDef* PropertyDef() const;
+
+    /**
+     * Associates a property definition with the order rule.
+     *
+     * @param aPropertyDef  Property definition.
+     */
+    IMPORT_C void SetPropertyDef(const CMdEPropertyDef& aPropertyDef);
+
+    /**
+     * Sets text sorting case sensitive or case insensitive.
+     *
+     * @param aCaseSensitive <code>ETrue</code> case sensitive sort.
+                             <code>EFalse</code> case insensitive sort.
+     */
+    IMPORT_C void SetCaseSensitive(TBool aCaseSensitive);
+
+    /**
+     * Returns type of text comparison, whether case sensitive
+     * or case insensitive.
+     *
+     * @return <code>ETrue</code> case sensitive sort.
+     *         <code>EFalse</code> case insensitive sort.
+     */
+    IMPORT_C TBool CaseSensitive();
+
+	/**
+     * Get required size of serialized buffer when this is serialized.
+     *
+     * @return required size of serialized buffer
+     */
+	TUint32 RequiredBufferSize() const;
+
+    /**
+     * Serialize own data to serialized buffer (correct position must be set 
+     * before calling) and return new position of serialized buffer.
+	 *
+     * @param aBuffer  serialized buffer.
+     */
+    void SerializeL(CMdCSerializationBuffer& aBuffer, 
+    		TMdCOffset& aFreespaceOffset) const;
+
+private:
+
+    /** Type of the order rule. */
+    TOrderRuleType iType;
+    
+    /** Optional. */
+    const CMdEPropertyDef* iPropertyDef;
+    
+    /** Flag for ascending order. */
+    TBool iAscending;
+
+    /** Flag for text sorting. Default value is EFalse */
+    TBool iCaseSensitive;
+   };        
+
+#endif  // __MDEORDERRULE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/inc/mdeproperty.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,332 @@
+/*
+* 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:  ?Description
+*
+*/
+
+
+#ifndef __MDEPROPERTY_H__
+#define __MDEPROPERTY_H__
+
+#include <e32base.h>
+
+#include <mdeinstanceitem.h>
+
+
+/* Forward declarations. */
+class CMdEObject;
+class CMdEPropertyDef;
+class CMdCSerializationBuffer;
+
+/**
+ * Abstract base class for properties.
+ */
+NONSHARABLE_CLASS(CMdEProperty) : public CMdEInstanceItem
+	{
+	friend class CMdEObject;
+public:
+	/**
+	 * Destructor.
+	 */
+	virtual ~CMdEProperty();
+
+
+	/* Methods. */
+
+	/**
+	 * Constructs a new property.
+	 *
+	 * @param aObject owner object of property
+	 * @param aBuffer buffer where property was serialized
+	 * @return new numeric property
+	 */
+	static CMdEProperty* NewL( const CMdEObject& aObject, CMdCSerializationBuffer& aBuffer );
+
+	/**
+	 * Constructs a new property and leave it on the cleanup stack.
+	 *
+	 * @param aObject owner object of property
+	 * @param aBuffer buffer where property was serialized
+	 * @return new numeric property
+	 */
+	static CMdEProperty* NewLC( const CMdEObject& aObject, CMdCSerializationBuffer& aBuffer );
+
+	/**
+	 * Constructs a new property.
+	 *
+	 * @param aDef property definition
+	 * @param aObject owner object of property
+	 * @return new numeric property
+	 */
+    static CMdEProperty* NewL(const CMdEPropertyDef& aDef, const CMdEObject& aObject);
+    
+    CMdEProperty();
+
+	/**
+	 * Constructs a new property.
+	 *
+	 * @param aDef property definition
+	 * @param aObject owner object of property
+	 * @return new numeric property
+	 */
+	static CMdEProperty* NewLC(const CMdEPropertyDef& aDef, const CMdEObject& aObject);
+
+
+	/**
+	 * Returns the definition of the integer property.
+	 *
+	 * @return  property definition
+	 */
+	IMPORT_C const CMdEPropertyDef& Def() const;
+
+	/**
+	 * Returns the object which the property belongs to.
+	 *
+	 * @return  Object.
+	 */
+	IMPORT_C const CMdEObject& Object() const;
+
+	/**
+	 * @return ETrue if property was modified,
+	 *         EFalse otherwise
+	 */
+	IMPORT_C TBool Modified() const;
+
+	
+	/** value getters */
+
+	/**
+	 * Returns the TBool value of the property.
+	 * @return  value
+	 */
+	IMPORT_C TBool BoolValueL() const;
+
+	/**
+	 * Returns the TInt8 value of the property.
+	 * @return  value
+	 */
+	IMPORT_C TInt8 Int8ValueL() const;
+
+	/**
+	 * Returns the TUint8 value of the property.
+	 * @return  value
+	 */
+
+	IMPORT_C TUint8 Uint8ValueL() const;
+	
+	/**
+	 * Returns the TInt16 value of the property.
+	 * @return  value
+	 */
+	IMPORT_C TInt16 Int16ValueL() const;
+	
+	/**
+	 * Returns the TUint16 value of the property.
+	 * @return  value
+	 */
+	IMPORT_C TUint16 Uint16ValueL() const;
+	
+	/**
+	 * Returns the TInt32 value of the property.
+	 * @return  value
+	 */
+	IMPORT_C TInt32 Int32ValueL() const;
+	
+	/**
+	 * Returns the TUint32 value of the property.
+	 * @return  value
+	 */
+	IMPORT_C TUint32 Uint32ValueL() const;
+	
+	/**
+	 * Returns the TInt64 value of the property.
+	 * @return  value
+	 */
+	IMPORT_C TInt64 Int64ValueL() const;
+	
+	/**
+	 * Returns the TReal32 value of the property.
+	 * @return  value
+	 */
+	IMPORT_C TReal32 Real32ValueL() const;
+	
+	/**
+	 * Returns the TReal64 value of the property.
+	 * @return  value
+	 */
+	IMPORT_C TReal64 Real64ValueL() const;
+	
+	/**
+	 * Returns the TTime value of the property.
+	 * @return  value
+	 */
+	IMPORT_C TTime TimeValueL() const;
+
+	/**
+	 * Returns the text value of the property.
+	 *
+	 * @return  value
+	 */
+	IMPORT_C const TDesC& TextValueL() const;
+	
+
+	/** setter methods */
+	/**
+	 * Sets the TBool value of the property.
+	 * @param aValue       New value.
+	 */
+	IMPORT_C void SetBoolValueL(TBool aValue);
+
+	/**
+	 * Sets the TInt8 value of the property.
+	 * @param aValue       New value.
+	 */
+	IMPORT_C void SetInt8ValueL(TInt8 aValue);
+
+	/**
+	 * Sets the TUint8 value of the property.
+	 * @param aValue       New value.
+	 */
+	IMPORT_C void SetUint8ValueL(TUint8 aValue);
+
+	/**
+	 * Sets the TInt16 value of the property.
+	 * @param aValue       New value.
+	 */
+	IMPORT_C void SetInt16ValueL(TInt16 aValue);
+
+	/**
+	 * Sets the TUint16 value of the property.
+	 * @param aValue       New value.
+	 */
+	IMPORT_C void SetUint16ValueL(TUint16 aValue);
+
+	/**
+	 * Sets the TInt32 value of the property.
+	 * @param aValue       New value.
+	 */
+	IMPORT_C void SetInt32ValueL(TInt32 aValue);
+
+	/**
+	 * Sets the TUint32 value of the property.
+	 * @param aValue       New value.
+	 */
+	IMPORT_C void SetUint32ValueL(TUint32 aValue);
+
+	/**
+	 * Sets the TInt64 value of the property.
+	 * @param aValue       New value.
+	 */
+	IMPORT_C void SetInt64ValueL(TInt64 aValue);
+
+	/**
+	 * Sets the TReal32 value of the property.
+	 * @param aValue       New value.
+	 */
+	IMPORT_C void SetReal32ValueL(TReal32 aValue);
+
+	/**
+	 * Sets the TReal64 value of the property.
+	 * @param aValue       New value.
+	 */
+	IMPORT_C void SetReal64ValueL(TReal64 aValue);
+
+	/**
+	 * Sets the TTime value of the property.
+	 * @param aValue       New value.
+	 */
+	IMPORT_C void SetTimeValueL(const TTime& aValue);
+
+	/**
+	 * Sets the text value of the property.
+	 *
+	 * @param aValue       New value.
+	 */
+	IMPORT_C void SetTextValueL(const TDesC& aValue);
+
+	
+	/**
+	 * Return required size for property serialization
+	 *
+	 * @return size of serialized property
+	 */
+	TUint32 RequiredBufferSize() const;
+
+	/**
+	 * Serialize object
+	 *
+	 * @param aBuffer buffer where serialized object should go
+	 */
+	TMdCOffset SerializeL(CMdCSerializationBuffer& aBuffer, TMdCOffset aFreespaceOffset) const;
+	
+private:
+
+	TUint8 ModFlags() const;
+
+	void SetRemoved();
+	TBool Removed();
+
+	void ClearFlags();
+
+	void SetModified();
+
+
+	/* Constructors. */
+
+	/**
+	 * Constructor.
+	 *
+	 * @param aDef         Definition of the new property.	 
+	 * @param aObject object where this property belongs to.
+	 */
+	CMdEProperty(const CMdEPropertyDef& aDef, const CMdEObject& aObject);
+
+	/**
+	 * Second-phase constructor.
+	 *
+	 * @param aSource  Source of the new property.
+	 */
+	void BaseConstructL();
+
+
+	/* Methods. */
+
+	/**
+	 * Check if property has value is between min and max
+	 * and leave if not!
+	 */
+#ifdef _DEBUG
+	void CheckValueMinMaxL( const TMdCValueUnion& aValue ) const;
+#endif
+	
+	void DoSetTextValueL(const TDesC& aValue);
+
+	TMdEInstanceType InstanceType() const;
+
+protected:
+	/** property modifications flags */
+	TUint8 iModFlags;
+
+private:
+	/** Property definition. */
+	const CMdEPropertyDef& iDef;
+
+	/** Object this property belongs to. */
+	const CMdEObject& iObject;
+
+	/** Value. */
+	TMdCValueUnion iValue;
+	};
+
+#endif  // __MDEPROPERTY_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/inc/mdepropertydef.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,135 @@
+/*
+* 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:  ?Description
+*
+*/
+
+
+#ifndef __MDEPROPERTYDEF_H__
+#define __MDEPROPERTYDEF_H__
+
+#include <mdccommon.h>
+
+// Forward declaration
+class CMdCSerializationBuffer;
+class CMdEObjectDef;
+class CMdENamespaceDef;
+class TMdCPropertyDef;
+
+/**
+ * Class for property definitions.
+ */
+NONSHARABLE_CLASS(CMdEPropertyDef) : public CBase
+	{
+public:	
+	/**
+	 * Returns the name of the item.
+	 *
+	 * @return  name
+	 */
+	IMPORT_C const TDesC& Name() const;
+	
+	/**
+	 * Returns the type of the property.
+	 *
+	 * @return  property type
+	 */
+	IMPORT_C TPropertyType PropertyType() const;
+
+	/**
+	 * Returns whether the property is read only.
+	 *
+	 * @return  <code>ETrue</code>, if the property is read only;
+	 *          <code>EFalse</code>, otherwise
+	 */
+	IMPORT_C TBool ReadOnly() const;
+
+	/**
+	 * Returns whether the property is mandatory.
+	 *
+	 * @return  <code>ETrue</code>, if the property is mandatory;
+	 *          <code>EFalse</code>, otherwise
+	 */
+	IMPORT_C TBool Mandatory() const;
+
+	/**
+	 * Compare this property definition with other property definition.
+	 *
+	 * @param aPropertyDef other property definition
+	 *
+	 * @return  0 if properties are same, 1 or more if this is greater than other 
+	 *          and -1 or less if this is less than other.
+	 */
+	IMPORT_C TInt Compare(const CMdEPropertyDef& aPropertyDef) const;
+	
+
+	IMPORT_C CMdEObjectDef& ObjectDef() const;
+
+	IMPORT_C TInt32 MinInt32ValueL() const;
+
+	IMPORT_C TInt32 MaxInt32ValueL() const;
+
+	IMPORT_C TUint32 MinUint32ValueL() const;
+
+	IMPORT_C TUint32 MaxUint32ValueL() const;
+
+	IMPORT_C TInt64 MinInt64ValueL() const;
+
+	IMPORT_C TInt64 MaxInt64ValueL() const;
+
+	IMPORT_C TReal MinRealValueL() const;
+
+	IMPORT_C TReal MaxRealValueL() const;
+
+	IMPORT_C TTime MinTimeValueL() const;
+
+	IMPORT_C TTime MaxTimeValueL() const;	
+
+	IMPORT_C TInt MinTextLengthL() const;
+
+	IMPORT_C TInt MaxTextLengthL() const;
+	
+	IMPORT_C CMdENamespaceDef& NamespaceDef() const;
+
+public:
+	static CMdEPropertyDef* NewL(const TMdCPropertyDef& aPropertyDef, CMdCSerializationBuffer& aSchemaBuffer, CMdEObjectDef& aObjectDef);
+
+	static CMdEPropertyDef* NewLC(const TMdCPropertyDef& aPropertyDef, CMdCSerializationBuffer& aSchemaBuffer, CMdEObjectDef& aObjectDef);
+	
+	void SerializeL(CMdCSerializationBuffer& aBuffer) const;
+
+	/**
+	 * Destructor.
+	 */
+	virtual ~CMdEPropertyDef();
+
+	TDefId Id() const;
+	void SetId(TDefId aId);
+		
+	TDefId ObjectDefId() const;
+	
+private:
+	CMdEPropertyDef(const TMdCPropertyDef& aPropertyDef, CMdEObjectDef& aObjectDef);
+
+	void ConstructL(CMdCSerializationBuffer& aSchemaBuffer );
+
+private:	
+
+	const TMdCPropertyDef& iPropertyDef;
+	CMdEObjectDef& iObjectDef;
+
+	TPtrC16 iName;
+    };
+
+#endif  // __MDEPROPERTYDEF_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/inc/mdequery.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,676 @@
+/*
+* 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:  Query base class
+*
+*/
+
+
+#ifndef __MDEQUERY_H__
+#define __MDEQUERY_H__
+
+
+#include <e32base.h>
+#include <badesca.h>
+
+#include <mdccommon.h>
+
+
+/* Forward declarations. */
+class CMdESession;
+class CMdEQuery;
+class CMdELogicCondition;
+class TMdEOrderRule;
+class CMdENamespaceDef;
+class CMdEItem;
+class CMdEInstanceItem;
+
+
+/**
+ * Observer interface for MdE database queries.
+ * 
+ * Example of doing a query to metadata database:
+ * 
+ * A class needs to implement MMdEQueryObserver interface if it is going to do a query to MdE database.
+ * 
+ * class CMdEQueryExample : public MMdEQueryObserver
+ * {
+ *		void HandleQueryNewResults(CMdEQuery& aQuery, TInt aFirstNewItemIndex, TInt aNewItemCount);
+ *		void HandleQueryCompleted(CMdEQuery& aQuery, TInt aError);
+ * 		...
+ * 		CMdESession* iMdeSession; // session to MdE, created before trying to do the query
+ * 		CMdEQuery* iQuery;
+ * };
+ * 
+ * void CMdEQueryExample::DoQuery()
+ * {
+ * 		CMdENamespaceDef& defNS = iMdeSession->GetDefaultNamespaceDefL();
+ *	    
+ *	    // In this function we create a query with following conditions:
+ *	    // 		Right object in relation must be a location object.
+ *	    // 		Left object in relation must have id 6.
+ * 
+ * 		// First create an object query. We want to find location objects so let's give that
+ * 		// as a condition to the query. 
+ *	    CMdEObjectDef& rightObjDef = defNS.GetObjectDefL(
+ *	        MdeConstants::Location::KLocationObject );
+ *	    iQuery = iMdeSession->NewObjectQueryL( defNS, rightObjDef, this );
+ *			    
+ * 		// Result mode EQueryResultModeItem means we want the query to return items.
+ * 		// Other options are: EQueryResultModeId, EQueryResultModeCount, 
+ * 		// EQueryResultModeDistinctValues and EQueryResultModeObjectWithFreetexts.
+ *	    iQuery->SetResultMode( EQueryResultModeItem );
+ * 
+ * 		// ELogicConditionOperatorAnd means we want all conditions to be true.
+ *	    iQuery->Conditions().SetOperator( ELogicConditionOperatorAnd );
+ *	
+ * 		// Add a relation condition to the query. The location object is the right side object of
+ * 		// the relation.
+ *	    CMdERelationCondition& filterCond = iQuery->Conditions().
+ *	        AddRelationConditionL( ERelationConditionSideRight );
+ *			        
+ *		// The object on the left side of the relation must have ID 6.
+ *	    filterCond.LeftL().AddObjectConditionL( 6 );
+ *			    
+ *	    iQuery->FindL( 10, 1 ); // Start the query! The first parameter is maximum number of result items. 
+ * 								// The second parameter is number of results per observer
+ *								// notification. This query returns maximum of 10 location items
+ * 								// and gives a notification (HandleQueryNewResults) for each.
+ * }
+ * 
+ * void CMdEQueryExample::HandleQueryCompleted( CMdEQuery& aQuery, TInt aError )
+ * {
+ * 		// query is completed
+ * 		if( aQuery.Count() > 0 && aError == KErrNone )
+ *		{
+ *		// some items were found!
+ *		}
+ * }
+ * 
+ * void CMdEQueryExample::HandleQueryNewResults(CMdEQuery& aQuery, TInt aFirstNewItemIndex,
+ *                                       TInt aNewItemCount)
+ * {
+ * 		// query is not yet completed but new results were found
+ * }
+ * 
+ * @see CMdEQuery::FindL
+ */
+class MMdEQueryObserver 
+    {
+public:
+
+    /**
+     * 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.
+     */
+    virtual void HandleQueryNewResults(CMdEQuery& aQuery,
+                                       TInt aFirstNewItemIndex,
+                                       TInt aNewItemCount) = 0;
+
+
+            
+    /**
+     * Called to notify the observer that the query has been completed,
+     * or that an error has occured.
+     *
+     * @param aQuery  Query instance.
+     * @param aError  <code>KErrNone</code>, if the query was completed
+     *                successfully. Otherwise one of the system-wide error 
+     *                codes.
+     */
+    virtual void HandleQueryCompleted(CMdEQuery& aQuery, TInt aError) = 0;
+    
+    };
+
+
+/** Default count for finding items. */
+static const TUint KMdEQueryDefaultMaxCount = KMaxTUint;
+
+
+/**
+ * MdE database query. This is the abstract base class for all metadata engine
+ * database queries. Instances of a query class own all the result items 
+ * fetched from the database; when the query instance is destroyed, the 
+ * results will be destroyed as well.
+ *
+ * If a query is restarted by calling FindL() after a previous query operation 
+ * has been completed, any new results are appended to the end of the result 
+ * item list. The previous results are not affected by subsequent calls to 
+ * FindL().
+ *
+ * The query parameters (order rules, search conditions, property filters) 
+ * must be configured before FindL() is called. FindL() may be called several
+ * times, but the query parameters that were in effect for the first Find()
+ * are used for all FindL()s.
+ */
+
+NONSHARABLE_CLASS(CMdEQuery) : public CBase
+	{
+public: 
+
+    /** 
+     * Query states.
+     */
+    enum TState
+        {
+        EStateFirst = 0x0000,
+        
+        /** The query has been created. The query parameters are specified
+            during this state. */
+        EStateNew,
+        
+        /** The query has been started with Find(). All the results received
+            so far are available to the user. */
+        EStateSearching,
+        
+        /** All the results have been found and they are available to 
+            the user. */
+        EStateCompleted,
+        
+        /** An error has occured. */
+        EStateError,
+        
+        EStateLast
+        };
+
+    /* Constants. */
+	
+	/* Constructors and destructor. */
+
+	/**
+	 * Destructor.
+	 */
+	virtual ~CMdEQuery();
+
+
+    /* Methods. */
+
+    /**
+	 * Returns the type of the query.
+	 *
+	 * @return  Query type.
+	 */
+	IMPORT_C TQueryType Type() const;
+
+    /**
+	 * Returns the namespace definition of the query.
+	 *
+	 * @return  Namespace definition.
+	 */
+	IMPORT_C CMdENamespaceDef& NamespaceDef() const;
+
+    /**
+	 * Returns the session of the query.
+	 *
+	 * @return  Session.
+	 */
+    IMPORT_C CMdESession& Session() const;
+
+    /**
+     * Returns the root of the condition tree.
+     *
+     * @return  Logic condition that acts as the root of the search conditions
+     *          tree.
+     */
+    IMPORT_C CMdELogicCondition& Conditions() const;
+    
+    /**
+     * Appends a new result ordering rule into the end of list of order rules.
+     *
+     * Example:
+     *   CMdEObjectDef& objdef = iDefaultNamespaceDef->GetObjectDefL( MdeConstants::Object::KBaseObject );
+     *   CMdEPropertyDef& propDef = objdef.GetPropertyDefL( MdeConstants::Object::KCreationDateProperty );
+     *   TMdEOrderRule rule( *propDef, ETrue );
+	 *   iQuery->AppendOrderRuleL( rule ); // iQuery is CMdEQuery*
+     * 
+     * @param aRule  Order rule.
+     */
+    IMPORT_C void AppendOrderRuleL(const TMdEOrderRule& aRule);
+
+    /**
+     * Insert a new result ordering rule into the list of order rules. 
+     * The first rule is at position zero.
+     * 
+     * Example:
+     *   CMdEObjectDef& objdef = iDefaultNamespaceDef->GetObjectDefL( MdeConstants::Object::KBaseObject );
+     *   CMdEPropertyDef& propDef = objdef.GetPropertyDefL( MdeConstants::Object::KCreationDateProperty );
+     *   TMdEOrderRule rule( *propDef, ETrue );
+	 *   iQuery->InsertOrderRuleL( rule, 0 ); // iQuery is CMdEQuery*
+     *
+     * @param aRule  Order rule.
+     * @param aPos   Position in the list of rules to insert into.
+     */
+    IMPORT_C void InsertOrderRuleL(const TMdEOrderRule& aRule, TInt aPos);
+    
+    /**
+     * Returns the number of order rules currently defined.
+     *
+     * @return  Number of order rules.
+     */
+    IMPORT_C TInt OrderRuleCount() const;
+    
+    /**
+     * Removes an order rule.
+     *
+     * @param aIndex  Index of the rule to remove.
+     */
+    IMPORT_C void RemoveOrderRule(TInt aIndex);
+
+    /**
+     * Gets an order rule.
+     *
+     * @param aIndex  Index of the rule to return.
+     * @param aRule   Reference to the TMdEOrderRule where the rule is stored.
+     */
+    IMPORT_C TMdEOrderRule OrderRule(TInt aIndex) const;
+
+    /**
+	 * Starts a query operation and returns immediately. The observers of 
+     * the query instance will be notified when the query is completed, or 
+     * if it fails. The query parameters (order rules, search conditions, 
+     * property filters) must be configured before FindL() is called. 
+     *
+     * The caller can perform a find operation in several steps by using a
+     * sufficiently small maximum number of result items. Notifications 
+     * about progress of query is returned is steps, continuing the previously 
+     * started find operation.
+     *
+     * @param aMaxCount     Maximum number of result items. Defaults to 
+     *                      unlimited. 
+     * @param aNotifyCount  Maximum number of results per observer
+     *                      notification. Defaults to unlimited.
+     *
+     * @leave  KErrNotReady  The query is in the Searching state.
+     *
+     * @panic  TMdEPanic::EQueryStateIllegalOperation  
+     *         Query is in a state that prohibits calling this method.
+	 */
+    IMPORT_C void FindL(TUint aMaxCount = KMdEQueryDefaultMaxCount,
+                        TUint aNotifyCount = KMdEQueryDefaultMaxCount);
+
+    /**
+	 * Cancels the currently running query operation. Does nothing if the 
+     * query is not currently running. 
+	 */
+    IMPORT_C void Cancel();
+
+    /**
+     * Returns whether the query has been completed.
+     *
+     * @return  <code>ETrue</code>, if the query is not currently running.
+     *          Otherwise <code>EFalse</code>.
+     */
+    IMPORT_C TBool IsComplete() const;
+
+    /**
+     * Returns the error code of the latest completed query. The same error
+     * code has been passed to the query observer.
+     *
+     * @return  Error code.
+     */
+    IMPORT_C TInt Error() const;
+
+	/**
+	 * Returns the current state of the query.
+	 *
+	 * @return  Query state.
+	 */
+	IMPORT_C TState State() const;
+
+    /**
+	 * Returns the number of received result items. This can be called at any
+     * time during the query instance's lifetime.
+	 *
+	 * @return  The number of results.
+	 */
+	IMPORT_C TInt Count() const;
+	
+    
+    /**
+	 * Returns one of the result items. 
+	 * 
+	 * Example:
+	 *   void CExampleClass::HandleQueryCompleted( CMdEQuery& aQuery, TInt aError )
+	 *   {
+	 *     CMdEItem& mdeItem = aQuery.ResultItem( 0 );
+	 *     ...
+	 *   }
+	 * 
+	 * @param aIndex index of the returned item. 
+	 * @panics if aIndex is out of bounds
+	 * @return  Result item. 
+	 */
+    IMPORT_C CMdEItem& ResultItem(TInt aIndex) const;
+
+    /**
+	 * Returns one of the result ids. 
+	 * 
+	 * Example:
+	 *   void CExampleClass::HandleQueryCompleted( CMdEQuery& aQuery, TInt aError )
+	 *   {
+	 *     TItemId mdeItemId = aQuery.ResultId( 0 );
+	 *     ...
+	 *   }
+	 * 
+	 * @param aIndex index of the returned id.
+	 * @panics if aIndex is out of bounds
+	 * @return  Result id.
+	 */
+    IMPORT_C TItemId ResultId(TInt aIndex) const;
+
+    /**
+	 * Returns all of the result ids.
+	 *
+	 * @return  Result ids.
+	 */
+    IMPORT_C const RArray<TItemId>& ResultIds() const;
+
+    /**
+     * Returns one of the result items. Ownership of the item is transferred 
+     * to the caller. The results array element at the specified index will 
+     * still point to the result item.
+     *
+     * @param aIndex  Result index.
+     *
+     * @return  Pointer to result item.
+     */
+    IMPORT_C CMdEItem* TakeOwnershipOfResult(TInt aIndex);
+
+    /**
+     * Determines whether the query owns a result item.
+     * @param aIndex index of the result item which ownership is checked.
+     * @panics if aIndex is out of bounds
+     * @return  <code>ETrue</code>, if the query owns the item. Otherwise
+     *          <code>EFalse</code>.
+     */        
+    IMPORT_C TBool OwnsResult(TInt aIndex);
+	
+	
+    /**
+     * Adds a new observer.
+     *
+     * @param  aObserver to add.
+     */
+    IMPORT_C void AddObserverL(MMdEQueryObserver& aObserver);
+
+    /**
+     * Removes an observer.
+     *
+     * @param  aObserver to remove.
+     */
+    IMPORT_C void RemoveObserver(MMdEQueryObserver& aObserver);
+
+    /**
+     * Sets type of query results. Whether whole items or only IDs.
+     * Default value is EModeItem.
+     *
+     * @param  aMode Determines type of query results. Can be set of
+     *         instance items or set of item IDs
+     */
+    IMPORT_C void SetResultMode( TQueryResultMode aMode );
+    
+    /**
+     * Returns type of query results, whether whole items or only IDs.
+     *
+     * @return Type of query results.
+     */
+    IMPORT_C TQueryResultMode ResultMode() const;
+    
+    /**
+	 * Returns result object item
+	 *
+	 * @return  Result object item.
+	 */
+    IMPORT_C CMdEItem& ResultObjectItem() const;
+
+    /**
+	 * Returns one of the result distinct values
+	 *
+	 * @return  Result distinct value
+	 */
+    IMPORT_C TPtrC16 ResultDistinctValue(TInt aIndex) const;
+
+	/**
+	 * Returns order rules
+	 *
+	 * @return  Order rules
+	 */
+	RArray<TMdEOrderRule>& OrderRules();
+
+	void SetQueryId( TUint32 aQueryId ) const
+		{
+		iQueryId = aQueryId;
+		}
+
+	TUint32 GetQueryId() const
+		{
+		return iQueryId;
+		}
+
+protected:
+
+	/* Constructors. */
+
+	/**
+	 * Constructor. Note that new queries should be created using the factory
+	 * methods in CMdESession.
+	 *
+	 * @param aType     Type of the query.
+     * @param aSession
+	 */
+	CMdEQuery(TQueryType aType, CMdESession& aSession, CMdENamespaceDef& aNamespaceDef);
+	
+	CMdEQuery();
+
+	/**
+	 * Second-phase constructor. Creates the root node of the conditions tree.
+	 */
+	void QueryConstructL();
+
+
+    /* Implementation methods. */
+
+    /**
+     * As Find().
+     */
+    virtual void DoFindL(TUint aMaxCount, TUint aNotifyCount){};
+
+    /**
+     * As Cancel().
+     */
+    virtual void DoCancel();
+
+
+    /* Notification methods. */
+
+    /**
+     * Appends new item results to the results array. This query instance takes 
+     * ownership of the items. 
+	 *
+	 * If a leave occurs, the query won't take ownership of any of the new 
+     * result items. The caller is responsible for destroying the result
+     * items in this case.
+     *
+     * This operation is atomic: either all of the new results are added to
+     * the results array and the query takes ownership of them, or none of
+     * results are added to the results array.
+     *
+     * @param aNewResults contains result items
+     */
+    virtual void NotifyNewResultsL(const RPointerArray<CMdEInstanceItem>& aNewResults);
+
+    /**
+     * Appends new ID results to the results array.
+     * 
+     * @param aNewResults contains results from ID query
+     */
+    virtual void NotifyNewResultsL(const RArray<TItemId>& aNewResults);
+
+    /**
+     * Appends distinct value results to the results array.
+     * 
+     * @param aResults contains results from distinct value query
+     */
+    virtual void NotifyNewResultsL( const CDesCArray& aNewResults );
+
+
+    /**
+     * Gets result from count query.
+     * 
+     * @param aResults contains result from count query
+     */
+    virtual void NotifyNewResults(TUint32 aResult);
+        
+    /**
+     * Notifies observers that the query was completed.
+     */
+    virtual void NotifyCompleted(TInt aError);
+
+
+	/* Utility methods. */
+	
+	/**
+	 * Sets the state of the query.
+	 *
+	 * @param aState  Query state.
+	 */
+    void SetState(TState aState);
+    
+    /** 
+     * Panics if the state of the query is the specified state.
+     *
+     * @param aState  Query state.
+     *
+     * @panic TMdEPanic::EQueryStateIllegalOperation  The query was not 
+     *        in the given state.
+     */
+    void AssertInState(TState aState);
+    
+    /** 
+     * Panics if the state of the query is not the specified state.
+     *
+     * @param aState  Query state.
+     *
+     * @panic TMdEPanic::EQueryStateIllegalOperation  The query was in the 
+     *        given state.
+     */
+    void AssertNotInState(TState aState);
+
+    
+private:
+
+    /* Private data structures. */
+
+    //  Result item for instances
+    struct TResult
+        {
+        /** Result item. */
+        CMdEItem* iItem;
+
+        /** Query has the ownership of the result item. */
+        TBool iOwned;
+
+        /** Constructor for initializing the struct. */
+        TResult(CMdEItem* aItem) : iItem(aItem), iOwned(EFalse) {}
+        };
+
+
+private:
+
+    /* Private methods. */
+
+    /**
+     * Appends new result items into the results array. Does not transfer
+     * ownership of the new results to the query.
+     *
+     * @param aNewResults  Array of result items.
+     */
+    void AppendResultsL(const RPointerArray<CMdEInstanceItem>& aNewResults);
+
+    void AppendResultsL(const RArray<TItemId>& aNewResults);
+
+	/*void AppendResultsL(CMdEInstanceItem* aObjectResult,
+    	const RPointerArray<CMdEInstanceItem>& aRelationResults, 
+    	const RPointerArray<CMdEInstanceItem>& aEventResults);*/
+    	
+    void AppendResultsL(const CDesCArray& aNewResults);
+    	
+private:
+
+	mutable TUint32 iQueryId;
+
+    /** The session of the query. */
+    CMdESession& iSession;
+
+	/** The namespace definition of the query */
+	CMdENamespaceDef& iNamespaceDef;
+    
+    /** Type of the query. */
+    TQueryType iType;
+
+    /** Type of results. */
+    TQueryResultMode iResultMode;
+
+    /** State of the query. */    
+    TState iState;
+
+    /** Latest error code. */
+    TInt iError;
+
+    /** Root node of the conditions tree.  Always present. */
+    CMdELogicCondition* iConditions;
+    
+    /** Array of result ordering rules. */
+    RArray<TMdEOrderRule> iOrderRules;
+
+    /** Instance result items. */
+    RArray<TResult> iResults;
+    
+    /** ID result items. */
+    RArray<TItemId> iIdResults;
+
+    /** Instance result object item */
+    TResult iObjectResult;
+	
+    /** Results of count query */
+    TInt iCountResult;
+
+    /** Observers. */
+    RPointerArray<MMdEQueryObserver> iObservers;
+    
+    CDesCArray* iDistinctResults;
+    
+    TBool iDestroyed;
+    };
+
+    
+// includes only for client more convinient usage
+	#include <mdeobjectquery.h>
+	#include <mderelationquery.h>
+	#include <mdeeventquery.h>
+	#include <mdelogiccondition.h>
+	#include <mdeobjectcondition.h>
+	#include <mderelationcondition.h>
+	#include <mdeeventcondition.h>
+	#include <mdepropertycondition.h>
+	#include <mderange.h>
+	#include <mdeorderrule.h>
+// end
+
+#endif  // __MDEQUERY_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/inc/mdesession.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,1797 @@
+/*
+* Copyright (c) 2005-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:  Metadata engine client session
+*
+*/
+
+
+#ifndef __MDESESSION_H__
+#define __MDESESSION_H__
+
+
+#include <e32base.h>
+#include <badesca.h>
+
+#include <mdccommon.h>
+
+
+/* Forward declarations. */
+class CMdESession;
+class CMdEObjectDef;
+class CMdERelationDef;
+class CMdEEventDef;
+class CMdEObject;
+class TMdEObject;
+class CMdERelation;
+class TMdERelation;
+class CMdEEvent;
+class CMdEObjectQuery;
+class CMdERelationQuery;
+class CMdEEventQuery;
+class CMdELogicCondition;
+class CMdEInstanceItem;
+class MMdEQueryObserver;
+class CMdENamespaceDef;
+class RMdEDataBuffer;
+class CMdECondition;
+
+
+
+/**
+ * Observer interface for a metadata engine session.
+ * 
+ * 
+ * 
+ * Examples of MdE session usage:
+ * 
+ * The class that needs a MdE session needs to implement MMdESessionObserver interface to get
+ * a notification of completed session opening or an error that has occurred.
+ * 
+ * class CMdESessionExample : public MMdESessionObserver
+ * {
+ * 		void HandleSessionOpened(CMdESession& aSession, TInt aError);
+ *   	void HandleSessionError(CMdESession& aSession, TInt aError);
+ * 		...
+ * 
+ * 		CMdESession* iMdeSession;
+ * };
+ * 
+ * The session is opened simply by creating an instance of CMdESession.
+ * 
+ * void CMdESessionExample::OpenSession()
+ * {
+ * 		iMdeSession = CMdESession::NewL( *this );
+ * }
+ * 
+ * void CMdESessionExample::HandleSessionOpened(CMdESession& aSession, TInt aError)
+ *	{
+ *		if ( KErrNone != aError ) {
+ * 			// Error occurred when opening session. iMdeSession must be deleted and new
+ * 			// session opened if we wish to use MdE.
+ * 
+ * 			delete iMdeSession; iMdeSession = NULL;
+ * 			return;
+ * 		}
+ * 		
+ * 		// The session was opened successfully.
+ * 		...
+ *	}
+ * 
+ * void CMdESessionError::HandleSessionError(CMdESession& aSession, TInt aError)
+ * {
+ * 		// This function is called when an error has occurred in the session by some
+ * 		// external source (e.g. other clients). It’s important to notice, that 
+ * 		// this method is called when the session has already been opened, not when 
+ * 		// error happens during opening. Session can't be used anymore and it must be deleted.
+ * 
+ * 		delete iMdeSession; iMdeSession = NULL;
+ * }
+ */
+class MMdESessionObserver
+	{
+public:
+
+	/**
+	 * 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   <code>KErrNone</code>, if opening the session succeeded;
+	 *                 or one of the system-wide error codes, if opening the 
+	 *                 session failed
+	 */
+	virtual void HandleSessionOpened(CMdESession& aSession, TInt aError) = 0;
+
+	/**
+	 * 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
+	 */
+	virtual void HandleSessionError(CMdESession& aSession, TInt aError) = 0;
+    };
+
+
+/**
+ * Observer interface for modifications of the metadata engine schema.
+ */
+class MMdESchemaObserver
+	{
+public:
+
+	/**
+	 * Called to notify the observer that the schema has been modified.
+	 *
+	 * @param none
+	 */
+	virtual void HandleSchemaModified() = 0;
+    };
+    
+/**
+ * Observer interface for modifications of the objects in the metadata engine 
+ * database.
+ * 
+ * Examples of observers.
+ * A class that is interested in observing events in the DB must implement observer interfaces
+ * and register as observer. Following examples show how this is done for objects but observing
+ * relations and events works the same way.
+ * 
+ * class CMdeObserverExample : public MMdEObjectObserver, public MMdEObjectPresentObserver
+ * {
+ *		void HandleObjectNotification(CMdESession& aSession, TObserverNotificationType aType,
+ *						const RArray<TItemId>& aObjectIdArray);
+ *		void HandleObjectPresentNotification(CMdESession& aSession, TBool aPresent,
+ *		 				const RArray<TItemId>& aObjectIdArray);
+ * 		...
+ * 		CMdESession* iMdeSession;
+ * };
+ * 
+ * void CMdeObserverExample::ConstructL()
+ * {
+ * 		// Register this class as observer and start listening to object remove events.
+ * 		// The logic condition can be as complicated as is necessary. In this example
+ * 		// the condition as simple as possible.
+ *		CMdELogicCondition* condition = CMdELogicCondition::NewL( ELogicConditionOperatorAnd );
+ *		iMdeSession->AddObjectObserverL( *this, condition, ENotifyRemove, 
+ *   		&iMdeSession->GetDefaultNamespaceDefL() );
+ * 
+ * 		// Start listening to changes in object present status.
+ * 		iMdeSession->AddObjectPresentObserverL( *this );
+ * }
+ * 
+ * @see MMdEObjectObserver::HandleObjectNotification
+ * void CMdeObserverExample::HandleObjectNotification(CMdESession& aSession, TObserverNotificationType aType,
+ *						const RArray<TItemId>& aObjectIdArray)
+ * {
+ *	 	if ( aType == ENotifyAdd )
+ * 		{	
+ * 		// object was added to DB
+ * 		} else if ( aType == ENotifyModify )
+ * 		{
+ * 		// object was modified
+ * 		} else if ( aType == ENotifyRemove )
+ * 		{
+ * 		// object was removed from DB
+ * 		}
+ * 
+ * 		// aObjectIdArray contains ids for all objects that were added/modified/removed
+ * }
+ * 
+ * void CMdeObserverExample::HandleObjectPresentNotification(CMdESession& aSession, 
+ *			TBool aPresent, const RArray<TItemId>& aObjectIdArray)
+ *	{
+ * 		if ( aPresent )
+ * 		{
+ * 			// objects in aObjectIdArray were set as present
+ * 		}
+ *  }
+ */
+class MMdEObjectObserver
+	{
+public:
+
+	/**
+	 * Called to notify the observer that new objects has been
+	 * added/modified/removed in the metadata engine database.
+	 * 
+	 * @param aSession session
+	 * @param aType defines if object was added/modified/remove
+	 * @param aObjectIdArray IDs of added object
+	 * @see CMdESession::AddObjectObserverL
+	 * @see CMdELogicCondition
+	 */
+	virtual void HandleObjectNotification(CMdESession& aSession, 
+						TObserverNotificationType aType,
+						const RArray<TItemId>& aObjectIdArray) = 0;
+    };
+
+class MMdEObjectObserverWithUri
+    {
+public:
+
+    /**
+     * Called to notify the observer that new objects has been
+     * added/modified/removed in the metadata engine database.
+     * 
+     * @param aSession session
+     * @param aType defines if object was added/modified/remove
+     * @param aObjectIdArray IDs of added object
+     * @param aUriArray Uris of added object
+     * @see CMdESession::AddObjectObserverL
+     * @see CMdELogicCondition
+     */
+    virtual void HandleUriObjectNotification(CMdESession& aSession, 
+                        TObserverNotificationType aType,
+                        const RArray<TItemId>& aObjectIdArray,
+                        const RPointerArray<HBufC>& aObjectUriArray) = 0;
+    };
+    
+/**
+ * Observer interface for modifications of the objects in the metadata engine 
+ * database.
+ */
+class MMdEObjectPresentObserver
+	{
+public:
+
+	/**
+	 * Called to notify the observer that objects has been set
+	 * to present or not present state in the metadata engine database.
+	 *
+	 * @param aSession session
+	 * @param aPresent state: ETrue - present or  EFales - not present
+	 * @param aObjectIdArray object IDs which are set to present state
+	 */
+	virtual void HandleObjectPresentNotification(CMdESession& aSession, 
+			TBool aPresent, const RArray<TItemId>& aObjectIdArray) = 0;
+    };
+
+/**
+ * Observer interface for modifications of the relations in the metadata 
+ * engine database.
+ */
+class MMdERelationPresentObserver
+	{
+public:
+
+	/**
+	 * Called to notify the observer that objects has been set
+	 * to present or not present state in the metadata engine database.
+	 *
+	 * @param aSession session
+	 * @param aPresent state: ETrue - present or  EFales - not present
+	 * @param aObjectIdArray object IDs which are set to present state
+	 */
+	virtual void HandleRelationPresentNotification(CMdESession& aSession,
+			TBool aPresent, const RArray<TItemId>& aRelationIdArray) = 0;
+    };
+
+
+/**
+ * Observer interface for modifications of relations in the metadata engine 
+ * database. This observer returns only relations IDs.
+ */
+class MMdERelationObserver
+	{
+public:
+
+	/**
+	 * Called to notify the observer that new relations has been
+	 * added/modified/removed in the metadata engine database.
+	 *
+	 * @param aSession session
+	 * @param aType defines if relation was added/modified/remove
+	 * @param aRelationIdArray IDs of relations
+	 */
+	virtual void HandleRelationNotification(CMdESession& aSession, 
+			TObserverNotificationType aType,
+			const RArray<TItemId>& aRelationIdArray) = 0;
+    };
+
+/**
+ * Observer interface for modifications of relations in the metadata engine 
+ * database. This observer returns relations (not only IDs).
+ */
+class MMdERelationItemObserver
+	{
+public:
+
+	/**
+	 * Called to notify the observer that new relations has been
+	 * added/modified/removed in the metadata engine database.
+	 *
+	 * @param aSession session
+	 * @param aType if relation was added/modified/remove
+	 * @param aRelationArray relations
+	 */
+	virtual void HandleRelationItemNotification(CMdESession& aSession, 
+			TObserverNotificationType aType,
+			const RArray<TMdERelation>& aRelationArray) = 0;
+    };
+
+/**
+ * Observer interface for additions or removes of new events to the metadata 
+ * engine database.
+ */
+class MMdEEventObserver
+	{
+public:
+
+	/**
+	 * Called to notify the observer that new events has been
+	 * added or removed in the metadata engine database.
+	 *
+	 * @param aSession session
+	 * @param aType if event was added or removed
+	 * @param aEventIdArray IDs of added events
+	 */
+	virtual void HandleEventNotification(CMdESession& aSession, 
+			TObserverNotificationType aType,
+			const RArray<TItemId>& aEventIdArray) = 0;
+
+    };
+
+/**
+ * Metadata engine session.
+ */
+NONSHARABLE_CLASS(CMdESession) : public CBase
+	{
+public:
+
+	/* Constructors and destructor. */
+
+	/**
+	 * Opens a new metadata engine session.
+	 *
+	 * @param aObserver observer to notify when opening the session has been 
+	 *                  completed
+	 *
+	 * @return metadata engine session
+	 */
+	IMPORT_C static CMdESession* NewL(MMdESessionObserver& aObserver);
+
+	/**
+	 * Opens a new metadata engine session and leaves the session in the 
+	 * cleanup stack.
+	 *
+	 * @param aObserver observer to notify when opening the session has been 
+	 *                  completed
+     *
+	 * @return  metadata engine session
+	 */
+	IMPORT_C static CMdESession* NewLC(MMdESessionObserver& aObserver);
+
+	/**
+	 * Destructor.
+	 */
+	virtual ~CMdESession();
+
+	/* Methods for managing namespace definitions. */
+
+	/**
+	 * Returns the number of namespace definitions.
+	 *
+	 * @return number of namespace definitions
+	 */
+	virtual TInt NamespaceDefCount() const = 0;
+
+	/**
+	 * Returns the namespace definition at the specified index.
+	 *
+	 * @param aIndex index
+	 *
+	 * @return namespace definition
+	 */
+	virtual CMdENamespaceDef& NamespaceDefL(TInt aIndex) = 0;
+
+	/**
+	 * Returns the namespace definition with the specified name.
+	 *
+	 * @param aName name
+	 *
+	 * @return namespace definition; or 0, if there is no object definition
+	 *         with the specified name
+	 */
+	virtual CMdENamespaceDef& GetNamespaceDefL(const TDesC& aName) = 0;
+
+	 /* Returns the default namespace definition.
+	 *
+	 * @return  the default namespace definition.
+	 */
+	virtual CMdENamespaceDef& GetDefaultNamespaceDefL() = 0;
+
+	/**
+	 * Adds a new relation definition to namespace,
+	 *
+	 * Example:
+	 *  void AddRelationL()
+	 *  {
+	 *    _LIT( TestRelation, "TestRelation" );
+	 *    TBuf <15> relname( TestRelation );
+	 * 	  iMdeSession->AddRelationDefL( *iDefaultNamespaceDef, relname );
+	 *  }
+	 * 
+	 * @param aNamespaceDef namespace definition to which relation belongs
+	 * @param aName         relation definitions name
+	 */
+	virtual void AddRelationDefL(const CMdENamespaceDef &aNamespaceDef, 
+			const TDesC &aName) = 0;
+
+	/**
+	 * Adds a new event definition to namespace.
+	 * 
+	 * Example:
+	 *  void AddEventDefL()
+	 *  {
+	 *    _LIT( TestEvent, "TestEvent" );
+	 *    TBuf <10> eventName( TestEvent );
+	 * 	  iMdeSession->AddRelationDefL( *iDefaultNamespaceDef, eventName );
+	 *  }
+	 *
+	 * @param aNamespaceDef namespace definition to which event belongs
+	 * @param aName         event definitions name
+	 */
+	virtual void AddEventDefL(const CMdENamespaceDef &aNamespaceDef, 
+			const TDesC &aName) = 0;
+
+	/* Methods for managing objects. */
+
+    /**
+     * Adds multiple instance items to metadata database.
+     * The array contains the items, any other type than object, relation or 
+     * event causes a leave.
+	 *
+     * @param aItems list of items to add
+     * @return first item error
+     */
+	virtual TInt AddItemsL( RPointerArray<CMdEInstanceItem>& aItems ) = 0;
+
+    /**
+     * Commits multiple instance items to metadata database.
+     * The array contains the items, any other type than object, relation or 
+     * event causes a leave.
+     * 
+     * @param aItems list of items to add
+     * @return first item error
+     */
+	virtual TInt UpdateItemsL( RPointerArray<CMdEInstanceItem>& aItems ) = 0;
+
+   /**
+     * Adds multiple instance items asynchronously to metadata database.
+     * The array contains the items, any other type than object, relation or 
+     * event causes a leave. Returned serialized list of item IDs must be 
+     * deserialized with DeserializeItemsL method.
+     * 
+     * Example:
+     *  class CExampleActiveObject : public CActive
+     *  {
+     *    void CActiveObject::AddItemsL();
+     *    ...
+     *    RPointerArray<CMdEInstanceItem> iItems;
+     *    RMdEDataBuffer iResultBuffer;
+     *  };
+     * 
+     *  void CExampleActiveObject::AddItemsL()
+     *  {
+     *    iMdeSession->AddItemsAsyncL( iItems, iStatus, iResultBuffer );
+     *    SetActive();
+     *  }
+     * 
+     * When adding items is finished, RunL() will be called.
+     * 
+     * @param aItems List of item to add.
+     * @param aStatus Returns the result code after the asynchronous call 
+     *                completes.
+     * @param aSerializedItemIds Returned serialized list of item IDs.
+     */
+	virtual void AddItemsAsyncL( 
+			RPointerArray<CMdEInstanceItem>& aItems, 
+			TRequestStatus& aStatus,
+			RMdEDataBuffer& aSerializedItemIds) = 0;
+
+   /**
+     * Commits multiple instance items asynchronously to metadata database.
+     * The array contains the items, any other type than object, relation or 
+     * event causes a leave. Returned serialized list of item IDs must be 
+     * deserialized with DeserializeItemsL method.
+     * 
+     * Example:
+     *  class CExampleActiveObject : public CActive
+     *   {
+     *     void CActiveObject::UpdateItemsL();
+     *     ...
+     *     RPointerArray<CMdEInstanceItem> iItems;
+     *     RMdEDataBuffer iResultBuffer;
+     *   };
+     * 
+     *   void CExampleActiveObject::UpdateItemsL()
+     *   {
+     *     iMdeSession->UpdateItemsAsyncL( iItems, iStatus, iResultBuffer );
+     *     SetActive();
+     *   }
+     * 
+     * @param aItems List of item to add.
+     * @param aStatus Returns the result code after the asynchronous call 
+     *                completes.
+     * @param aSerializedItemIds Returned serialized list of item IDs.
+     */
+	virtual void UpdateItemsAsyncL( 
+			RPointerArray<CMdEInstanceItem>& aItems, 
+			TRequestStatus& aStatus,
+			RMdEDataBuffer& aSerializedItemIds ) = 0;
+
+	/**
+	 * Constructs a new empty object. Note that the object is not inserted in 
+	 * the database. The ownership of the new object is passed to the caller 
+	 * (that is, the caller is responsible for deleting the object).
+	 *
+	 * Example:
+	 *  _LIT( KObjectDef, "ObjectDefName" );
+	 *  TBuf<13> objDefStr( KObjectDef );
+	 *  CMdENamespaceDef& defNS = iMdESession->GetDefaultNamespaceDefL();
+	 *	CMdEObjectDef& mdeObjectDef = defNS.GetObjectDefL( objDefStr );
+	 *  CMdEObject* mdeObject = iMdESession->NewObjectL( mdeObjectDef, aUri );
+	 * 
+	 * @param aDef definition of the new object
+	 * @param aUri URI of the new object
+	 * @param aMediaId media ID of the new object (default 0)
+	 *
+	 * @return new object
+	 */
+	virtual CMdEObject* NewObjectL( CMdEObjectDef& aDef, const TDesC& aUri, 
+                                    TUint32 aMediaId = 0 ) = 0;
+
+	/**
+	 * Constructs a new empty object and leaves it in the cleanup stack. 
+	 * Note that the object is not inserted in the database. The ownership of 
+	 * the new object is passed to the caller (that is, the caller is 
+	 * responsible for deleting the object).
+	 * 
+ 	 * Example:
+	 *  _LIT( KObjectDef, "ObjectDefName" );
+	 *  TBuf<13> objDefStr( KObjectDef );
+	 *  CMdENamespaceDef& defNS = iMdESession->GetDefaultNamespaceDefL();
+	 *	CMdEObjectDef& mdeObjectDef = defNS.GetObjectDefL( objDefStr );
+	 *  CMdEObject* mdeObject = iMdESession->NewObjectLC( mdeObjectDef, aUri );
+	 *
+	 * @param aDef definition of the new object
+	 * @param aUri URI of the new object
+	 * @param aMediaId media ID of the new object (default 0)
+	 *
+	 * @return new object
+	 */
+	virtual CMdEObject* NewObjectLC( CMdEObjectDef& aDef, const TDesC& aUri, 
+                                     TUint32 aMediaId = 0 ) = 0;
+
+    /**
+     * Adds the specified new object to metadata database.
+     * aObject is modified so that it has the new item ID.
+     * If object adding fails object's ID is KNoId, 
+     * otherwise object adding is successful.
+     *
+     * @param aObject object to be added
+     *
+     * @return item ID of the added object
+     */
+    virtual TItemId AddObjectL(CMdEObject& aObject) = 0;
+
+    /**
+     * Adds multiple object items to the metadata engine database.
+     * The array contains the object items. aObjects are modified 
+     * so that those has the new item IDs. If object adding fails
+     * object's ID is KNoId, otherwise object adding is successful.
+     *
+     * @param aObjects  list of objects to be added
+     * @return first object error
+     */
+    virtual TInt AddObjectsL(RPointerArray<CMdEObject>& aObjects) = 0;
+
+	/**
+	 * Deserialize serialized list of item IDs
+	 *
+	 * @param aSerializedItemIds serialized list of item IDs
+	 * @param aResultObjects     if not NULL object IDs are deserialized from 
+	 *                           buffer to this ID array
+	 * @param aResultEvents      if not NULL event IDs are deserialized from 
+	 *                           buffer to this ID array
+	 * @param aResultRelations   if not NULL relation IDs are deserialized 
+	 *                           from buffer to this ID array
+	 *
+	 * @return error code of first failed item, if no errors KErrNone
+	 */
+	virtual TInt DeserializeIdsL( RMdEDataBuffer& aSerializedItemIds, 
+			RArray<TItemId>* aResultObjects = NULL, 
+			RArray<TItemId>* aResultEvents = NULL, 
+			RArray<TItemId>* aResultRelations = NULL ) = 0;
+						   
+	/**
+	 * Deserialize serialized list of items
+	 *
+	 * @param aSerializedItems serialized list of items
+	 * @param aItems items are deserialized from buffer to this item array
+	 *
+	 * @return first item error
+	 */
+	virtual TInt DeserializeItemsL( RMdEDataBuffer& aSerializedItems, 
+			RPointerArray<CMdEInstanceItem>& aItems ) = 0;
+
+	/**
+	 * Removes the object with the specified identifier from metadata database.
+	 *
+	 * @param aId identifier
+	 * @param aNamespaceDef namespace where object is removed, if NULL default 
+	 *                      namespace is used
+	 * @return KNoId if removing has failed, otherwise removed object's ID
+	 */
+	virtual TItemId RemoveObjectL( TItemId aId, 
+			CMdENamespaceDef* aNamespaceDef = NULL ) = 0;
+
+	/**
+	 * Removes the object with the specified URI from metadata database.
+	 *
+	 * @param aUri URI
+	 * @param aNamespaceDef namespace from remove object, if NULL default 
+	 *                      namespace is used
+	 * @return KNoId if removing has failed, otherwise removed object's ID
+	 */
+	virtual TItemId RemoveObjectL( const TDesC& aUri, 
+			CMdENamespaceDef* aNamespaceDef = NULL ) = 0;
+
+	/**
+	 * Removes the array of objects with the specified identifier from 
+	 * metadata database.
+	 *
+	 * @param aId object IDs to be removed
+	 * @param aResult result array where succefully removed object IDs are 
+	 *                added (KNoId is added from those objects which removing 
+	 *                has failed)
+	 * @param aNamespaceDef namespace where object is removed, if NULL default 
+	 *                      namespace is used
+	 * @return first item error
+	 */
+	virtual TInt RemoveObjectsL( 
+			const RArray<TItemId>& aId, RArray<TItemId>& aResult, 
+			CMdENamespaceDef* aNamespaceDef = NULL ) = 0;
+
+	/**
+	 * Removes the array of objects with the specified URI from metadata 
+	 * database.
+	 *
+	 * @param aUri object URIs to be removed
+	 * @param aResult result array where succefully removed object IDs are 
+	 *                added (KNoId is added from those objects which removing 
+	 *                has failed)
+	 * @param aNamespaceDef namespace where object is removed, if NULL default 
+	 *                      namespace is used
+	 * @return first item error
+	 */
+	virtual TInt RemoveObjectsL( 
+			const RPointerArray<TDesC>& aUri, RArray<TItemId>& aResult, 
+			CMdENamespaceDef* aNamespaceDef = NULL ) = 0;
+
+	/**
+	 * Asynchronously removes the array of objects with the specified 
+	 * object IDs from metadata database. Returned serialized list of item IDs 
+	 * must be deserialized with DeserializeIdsL method.
+	 *
+	 * @param aId object IDs to be removed
+     * @param aStatus returns the result code after the asynchronous call 
+     *                completes.
+     * @param aSerializedObjectIds returned serialized list of object IDs
+	 * @param aNamespaceDef namespace where object is removed, if NULL default 
+	 *                      namespace is used
+	 */
+	virtual void RemoveObjectsAsyncL( 
+			const RArray<TItemId>& aId, TRequestStatus& aStatus, 
+			RMdEDataBuffer& aSerializedObjectIds, 
+			CMdENamespaceDef* aNamespaceDef = NULL ) = 0;
+
+	/**
+	 * Asynchronously removes the array of objects with the specified URI from 
+	 * metadata database. Returned serialized list of item IDs must be 
+	 * deserialized with DeserializeIdsL method.
+	 *
+	 * @param aUri object URIs to be removed
+     * @param aStatus returns the result code after the asynchronous call 
+     *                completes.
+     * @param aSerializedObjectIds returned serialized list of object IDs
+	 * @param aNamespaceDef namespace where object is removed, if NULL default 
+	 *                      namespace is used
+	 */
+	virtual void RemoveObjectsAsyncL( 
+			const RPointerArray<TDesC>& aUri, TRequestStatus& aStatus, 
+			RMdEDataBuffer& aSerializedObjectIds, 
+			CMdENamespaceDef* aNamespaceDef = NULL ) = 0;
+	
+	/**
+	 * Returns the object with the specified ID and specified object 
+	 * definition.
+	 *
+	 * Example:
+	 *   CMdENamespaceDef& defaultNamespace = iSession->GetDefaultNamespaceDefL();
+     * 	 CMdEObjectDef& imageObjDef = defaultNamespace.GetObjectDefL( MdeConstants::Image::KImageObject );
+	 * 	 CMdEObject* object = iSession->GetObjectL( aObjectId, imageObjDef );
+	 * 
+	 * @param aId object ID
+	 * @param aObjectDef object definition
+	 *
+	 * @return object or NULL, if there is no object with the specified 
+	 *         identifier in the metadata engine database
+	 */
+	virtual CMdEObject* GetObjectL( const TItemId aId, 
+			CMdEObjectDef& aObjectDef ) = 0;
+
+	/**
+	 * Returns the object (object may contain only properties defined in 
+	 * "Object") with the specified ID and specified namespace (if namespace 
+	 * is NULL, the default namespace is used).
+	 *
+	 * @param aId object ID
+	 * @param aNamespaceDef namespace
+	 *
+	 * @return  object or NULL, if there is no object with the specified 
+	 *          identifier in the metadata engine database
+	 */
+	virtual CMdEObject* GetObjectL( const TItemId aId, 
+			CMdENamespaceDef* aNamespaceDef = NULL ) = 0;
+
+	/**
+	 * Returns the object (object will contain all it's properties) 
+	 * with the specified ID and specified namespace 
+	 * (if namespace is NULL, the default namespace is used).
+	 *
+	 * @param aId object ID
+	 * @param aNamespaceDef namespace
+	 *
+	 * @return  object or NULL, if there is no object with the specified 
+	 *          identifier in the metadata engine database
+	 */
+	virtual CMdEObject* GetFullObjectL( const TItemId aId, 
+			CMdENamespaceDef* aNamespaceDef = NULL ) = 0;
+
+	/**
+	 * Returns the object with the specified GUID and specified object 
+	 * definition.
+	 * 
+	 * Example:
+	 *   CMdENamespaceDef& defaultNamespace = iSession->GetDefaultNamespaceDefL();
+     * 	 CMdEObjectDef& imageObjDef = defaultNamespace.GetObjectDefL( MdeConstants::Image::KImageObject );
+     *   CMdEObject* object = iMdeSession->GetObjectL( 12345, 67890, imageObjDef );
+	 *
+	 * @param aGuidHigh GUID high
+	 * @param aGuidLow GUID low
+	 * @param aObjectDef object definition
+	 *
+	 * @return  object or NULL, if there is no object with the specified 
+	 *          identifier in the metadata engine database
+	 */
+	virtual CMdEObject* GetObjectL( 
+			const TInt64 aGuidHigh, const TInt64 aGuidLow, 
+			CMdEObjectDef& aObjectDef ) = 0;
+
+	/**
+	 * Returns the object (object may contain only properties definied in 
+	 * "Object") with the specified GUID and specified namespace (if namespace 
+	 * is NULL, the default namespace is used).
+	 *
+	 * Example:
+     *   CMdEObject* object = iMdeSession->GetObjectL( 12345, 67890 );
+	 * 
+	 * @param aGuidHigh  GUID high
+	 * @param aGuidLow  GUID low
+	 * @param aNamespaceDef namespace
+	 *
+	 * @return  object or NULL, if there is no object with the specified 
+	 *          identifier in the metadata engine database
+	 */
+	virtual CMdEObject* GetObjectL( 
+			const TInt64 aGuidHigh, const TInt64 aGuidLow, 
+			CMdENamespaceDef* aNamespaceDef = NULL ) = 0;
+
+	/**
+	 * Returns the object (object will contain all it's properties) 
+	 * with the specified GUID and specified namespace 
+	 * (if namespace is NULL, the default namespace is used).
+	 * 
+	 * Example:
+     *   CMdEObject* object = iMdeSession->GetFullObjectL( 12345, 67890 );
+	 *
+	 * @param aGuidHigh GUID high
+	 * @param aGuidLow GUID low
+	 * @param aNamespaceDef namespace
+	 *
+	 * @return  object or NULL, if there is no object with the specified 
+	 *          identifier in the metadata engine database
+	 */
+	virtual CMdEObject* GetFullObjectL( 
+			const TInt64 aGuidHigh, const TInt64 aGuidLow, 
+			CMdENamespaceDef* aNamespaceDef = NULL ) = 0;
+
+	/**
+	 * Returns the object with the specified URI and specified object 
+	 * definition.
+	 *
+	 * Example:
+	 *   CMdENamespaceDef& defaultNamespace = iSession->GetDefaultNamespaceDefL();
+     * 	 CMdEObjectDef& imageObjDef = defaultNamespace.GetObjectDefL( MdeConstants::Image::KImageObject );
+     *   CMdEObject* object = iMdeSession->GetObjectL( aUri, imageObjDef );
+	 *
+	 * @param aUri object URI
+	 * @param aObjectDef object definition
+	 *
+	 * @return  object or NULL, if there is no object with the specified 
+	 *          identifier in the metadata engine database
+	 */
+	virtual CMdEObject* GetObjectL( const TDesC& aUri, 
+			CMdEObjectDef& aObjectDef ) = 0;
+
+	/**
+	 * Returns the object (object may contain only properties definied in 
+	 * "Object") with the specified URI specified namespace (if namespace is 
+	 * NULL, the default namespace is used).
+	 *
+	 * @param aUri object URI
+	 * @param aNamespaceDef namespace
+	 *
+	 * @return  object or NULL, if there is no object with the specified 
+	 *          identifier in the metadata engine database
+	 */
+	virtual CMdEObject* GetObjectL( const TDesC& aUri, 
+			CMdENamespaceDef* aNamespaceDef = NULL) = 0;
+
+	/**
+	 * Returns the object (object will contain all it's properties) with the 
+	 * specified URI specified namespace (if namespace is NULL, the default 
+	 * namespace is used).
+	 *
+	 * @param aUri object URI
+	 * @param aNamespaceDef namespace
+	 *
+	 * @return  object or NULL, if there is no object with the specified 
+	 *          identifier in the metadata engine database
+	 */
+	virtual CMdEObject* GetFullObjectL( const TDesC& aUri, 
+			CMdENamespaceDef* aNamespaceDef = NULL) = 0;
+
+	/**
+	 * Opens the object with the specified ID and specified object 
+	 * definition for modifications. The object is locked so that nobody else 
+	 * can open it for modifications. The modifications are committed by 
+	 * calling the <code>CommitObject()</code> method, which releases the lock.
+	 * The modifications can be canceled by calling the 
+	 * <code>CancelObject()</code> method, which also releases the lock.
+	 *
+	 * Example:
+	 *  CMdENamespaceDef& defaultNamespace = iMdeSession->GetDefaultNamespaceDefL();
+     *	CMdEObjectDef& imageDef = defaultNamespace.GetObjectDefL( MdeConstants::Image::KImageObject );
+	 *  CMdEObject* image = iMdESession->OpenObjectL( 17, imageDef );
+	 * 
+	 *  CMdEPropertyDef& lastModDatePropDef = imageDef.GetPropertyDefL(
+     *   		Object::KLastModifiedDateProperty );
+     * 
+     *  CMdEProperty* lastModDateProp = NULL;
+     *  image->Property( lastModDatePropDef, lastModDateProp, 0 );
+     * 
+     *  TTime currenttime( 0 );
+     *	currenttime.UniversalTime();
+     * 
+     *  if ( lastModDateProp )
+     *      {
+     *      lastModDateProp->SetTimeValueL( currenttime );
+     *      }
+     *  else
+     *      {
+     *      image->AddTimePropertyL( lastModDatePropDef, currenttime );
+     *      }
+     *  }
+     *  iMdeSession->CommitObjectL( *image );
+	 *  
+	 * 
+	 * @param aId  object ID
+	 * @param aObjectDef object definition
+	 *
+	 * @return  Object or NULL, if there is no object with the specified 
+     *          identifier in the metadata engine database.
+	 */
+	virtual CMdEObject* OpenObjectL( const TItemId aId, 
+			CMdEObjectDef& aObjectDef ) = 0;
+
+	/**
+	 * Opens the object (object may contain only properties definied in "Object") 
+	 * with the specified ID and specified namespace 
+	 * (if namespace is NULL, the default namespace is used) for modifications.
+	 * The object is locked so that nobody else can open it for modifications.
+	 * The modifications are committed by calling the <code>CommitObject()</code>
+	 * method, which releases the lock. The modifications can be canceled by
+	 * calling the <code>CancelObject()</code> method, which also releases the
+	 * lock.
+	 *
+	 * @param aId  object ID.
+	 * @param aNamespaceDef namespace
+	 *
+	 * @return  Object or NULL, if there is no object with the specified 
+     *          identifier in the metadata engine database.
+	 */
+	virtual CMdEObject* OpenObjectL( const TItemId aId, 
+			CMdENamespaceDef* aNamespaceDef = NULL ) = 0;
+
+	/**
+	 * Opens the object (object will contain all it's properties) 
+	 * with the specified ID and specified namespace 
+	 * (if namespace is NULL, the default namespace is used) for modifications.
+	 * The object is locked so that nobody else can open it for modifications.
+	 * The modifications are committed by calling the <code>CommitObject()</code>
+	 * method, which releases the lock. The modifications can be canceled by
+	 * calling the <code>CancelObject()</code> method, which also releases the
+	 * lock.
+	 *
+	 * @param aId  object ID.
+	 * @param aNamespaceDef namespace
+	 *
+	 * @return  Object or NULL, if there is no object with the specified 
+     *          identifier in the metadata engine database.
+	 */
+	virtual CMdEObject* OpenFullObjectL( const TItemId aId, 
+			CMdENamespaceDef* aNamespaceDef = NULL ) = 0;
+
+
+	/**
+	 * Opens the object with the specified GUID and specified object 
+	 * definition for modifications. The object is locked so that nobody else 
+	 * can open it for modifications. The modifications are committed by 
+	 * calling the <code>CommitObject()</code> method, which releases the lock.
+	 * The modifications can be canceled by calling the 
+	 * <code>CancelObject()</code> method, which also releases the lock.
+	 *
+	 * @param aGuidHigh  GUID high
+	 * @param aGuidLow  GUID low
+	 * @param aObjectDef object definition
+	 *
+	 * @return  Object or NULL, if there is no object with the specified 
+     *          identifier in the metadata engine database.
+	 */
+	virtual CMdEObject* OpenObjectL( 
+			const TInt64 aGuidHigh, const TInt64 aGuidLow, 
+			CMdEObjectDef& aObjectDef ) = 0;
+
+	/**
+	 * Opens the object (object may contain only properties definied in "Object") 
+	 * with the specified GUID and specified namespace 
+	 * (if namespace is NULL, the default namespace is used) for modifications.
+	 * The object is locked so that nobody else can open it for modifications.
+	 * The modifications are committed by calling the <code>CommitObject()</code>
+	 * method, which releases the lock. The modifications can be canceled by
+	 * calling the <code>CancelObject()</code> method, which also releases the
+	 * lock.
+	 *
+	 * @param aGuidHigh  GUID high
+	 * @param aGuidLow  GUID low
+	 * @param aNamespaceDef namespace
+	 *
+	 * @return  Object or NULL, if there is no object with the specified 
+     *          identifier in the metadata engine database.
+	 */
+	virtual CMdEObject* OpenObjectL( 
+			const TInt64 aGuidHigh, const TInt64 aGuidLow, 
+			CMdENamespaceDef* aNamespaceDef = NULL ) = 0;
+
+	/**
+	 * Opens the object (object will contain all it's properties) 
+	 * with the specified GUID and specified namespace 
+	 * (if namespace is NULL, the default namespace is used) for modifications.
+	 * The object is locked so that nobody else can open it for modifications.
+	 * The modifications are committed by calling the <code>CommitObject()</code>
+	 * method, which releases the lock. The modifications can be canceled by
+	 * calling the <code>CancelObject()</code> method, which also releases the
+	 * lock.
+	 *
+	 * @param aGuidHigh  GUID high
+	 * @param aGuidLow  GUID low
+	 * @param aNamespaceDef namespace
+	 *
+	 * @return  Object or NULL, if there is no object with the specified 
+     *          identifier in the metadata engine database.
+	 */
+	virtual CMdEObject* OpenFullObjectL( 
+			const TInt64 aGuidHigh, const TInt64 aGuidLow, 
+			CMdENamespaceDef* aNamespaceDef = NULL ) = 0;
+
+
+	/**
+	 * Opens the object with the specified URI for modifications and specified 
+	 * object definition. The object is locked so that nobody else can open it 
+	 * for modifications. The modifications are committed by calling the 
+	 * <code>CommitObject()</code> method, which releases the lock. The 
+	 * modifications can be canceled by calling the <code>CancelObject()</code> 
+	 * method, which also releases the lock.
+	 *
+	 * @param aUri  object URI
+	 * @param aObjectDef object definition
+	 *
+	 * @return  Object or NULL, if there is no object with the specified 
+     *          identifier in the metadata engine database.
+	 */
+	virtual CMdEObject* OpenObjectL( const TDesC& aUri, 
+			CMdEObjectDef& aObjectDef ) = 0;
+
+	/**
+	 * Opens the object (object may contain only properties definied in "Object") 
+	 * with the specified ID and specified namespace 
+	 * (if namespace is NULL, the default namespace is used) for modifications.
+	 * The object is locked so that nobody else can open it for modifications.
+	 * The modifications are committed by calling the <code>CommitObject()</code>
+	 * method, which releases the lock. The modifications can be canceled by
+	 * calling the <code>CancelObject()</code> method, which also releases the
+	 * lock.
+	 *
+	 * @param aUri  Object URI.
+	 * @param aNamespaceDef namespace
+	 *
+	 * @return  Object or NULL, if there is no object with the specified 
+     *          identifier in the metadata engine database.
+	 */
+	virtual CMdEObject* OpenObjectL( const TDesC& aUri, 
+			CMdENamespaceDef* aNamespaceDef = NULL ) = 0;
+
+	/**
+	 * Opens the object (object will contain all it's properties) 
+	 * with the specified ID and specified namespace 
+	 * (if namespace is NULL, the default namespace is used) for modifications.
+	 * The object is locked so that nobody else can open it for modifications.
+	 * The modifications are committed by calling the <code>CommitObject()</code>
+	 * method, which releases the lock. The modifications can be canceled by
+	 * calling the <code>CancelObject()</code> method, which also releases the
+	 * lock.
+	 *
+	 * @param aUri  Object URI.
+	 * @param aNamespaceDef namespace
+	 *
+	 * @return  Object or NULL, if there is no object with the specified 
+     *          identifier in the metadata engine database.
+	 */
+	virtual CMdEObject* OpenFullObjectL( const TDesC& aUri, 
+			CMdENamespaceDef* aNamespaceDef = NULL ) = 0;
+
+	/**
+	 * Gets metadata object id, definition and some flags by URI. Does not return the whole object.
+	 * 
+	 * @param aObject on return contains information about the metadata object
+	 * @param aUri metadata object URI
+	 * @param aNamespaceDef namespace definition. If namespace is NULL then the default namespace is used.
+	 */
+	virtual void CheckObjectL( TMdEObject& aObject, const TDesC& aUri, 
+			CMdENamespaceDef* aNamespaceDef = NULL ) = 0;
+
+	/**
+	 * Gets metadata object id, definition and some flags by id. Does not return the whole object.
+	 * 
+	 * @param aObject on return contains information about the metadata object
+	 * @param aId metadata object id
+	 * @param aNamespaceDef namespace definition. If namespace is NULL then the default namespace is used.
+	 */
+	virtual void CheckObjectL( TMdEObject& aObject, TItemId aId, 
+			CMdENamespaceDef* aNamespaceDef = NULL ) = 0;
+
+	/**
+	 * Gets an array of TMdEObject objects that contain metadata object ids, definitions and 
+	 * some flags by object ids. Does not return whole objects.
+	 * 
+	 * @param aObjects on return contains an array of objects containing information about metadata objects
+	 * @param aIds array of metadata object ids
+	 * @param aNamespaceDef namespace definition. If namespace is NULL then the default namespace is used.
+	 */
+	virtual void CheckObjectL( RArray<TMdEObject>& aObjects, 
+			const RArray<TItemId>& aIds, 
+			CMdENamespaceDef* aNamespaceDef = NULL ) = 0;
+	
+	/**
+     * Commits the modifications made to the object to the database
+	 * and releases the modification lock.
+     * 
+	 * @param aObject  Object.
+     */
+    virtual void CommitObjectL(CMdEObject& aObject) = 0;
+
+	/**
+     * Commits the modifications made to objects to the database
+	 * and releases the modification locks.
+     * 
+	 * @param aObject  Object.
+     */
+    virtual void CommitObjectsL(RPointerArray<CMdEObject>& aObjects) = 0;
+
+    /**
+     * Cancels the modifications made to the object and releases the
+	 * modification lock.
+     * 
+	 * @param aObject  Object.
+     */
+    virtual TItemId CancelObjectL(CMdEObject& aObject) = 0;
+
+
+	/* Methods for managing relations. */
+
+	/**
+	 * Returns the relation with the specified ID and specified namespace 
+	 * (if namespace is NULL, the default namespace is used).
+	 * 
+	 * Note that the ownership of the returned relation is passed to the 
+	 * caller of the method (that is, the caller is responsible for deleting 
+	 * the relation).
+	 *
+	 * @param aId  relation ID
+	 * @param aNamespaceDef namespace
+	 *
+	 * @return  relation or NULL, if there is no relation with the specified ID
+	 *          in the metadata engine database
+	 */
+	virtual CMdERelation* GetRelationL(TItemId aId, 
+			CMdENamespaceDef* aNamespacedef = NULL) = 0;
+
+	/**
+	 * Constructs a new empty relation. Note that the relation is not inserted 
+	 * in the database. The ownership of the new relation is passed to the 
+	 * caller (that is, the caller is responsible for deleting the relation).
+	 * 
+	 * Example:
+     *	 CMdERelationDef& relationDef = namespaceDef.GetRelationDefL( MdeConstants::Relations::KContains );
+     *
+     *	 CMdERelation* relation = iMdeSession->NewRelationLC( relationDef, albumObject->Id(), audioObject->Id() );
+     *	 iMdeSession->AddRelationL( *relation );
+	 *
+	 * @param aDef  definition of the new relation
+	 * @param aLeftObjectId id of the left side of the relation
+	 * @param aRightObjectId id of the right side of the relation
+	 * @param aParameter the relation parameter
+	 *
+	 * @return  new relation
+	 */
+	virtual CMdERelation* NewRelationLC(CMdERelationDef& aDef, 
+			TItemId aLeftObjectId, TItemId aRightObjectId, 
+			TInt32 aParameter = 0) = 0;
+
+	/**
+	 * Constructs a new empty relation. Note that the relation is not inserted 
+	 * in the database. The ownership of the new relation is passed to the 
+	 * caller (that is, the caller is responsible for deleting the relation).
+	 *
+	 * Example:
+     *	 CMdERelationDef& relationDef = namespaceDef.GetRelationDefL( MdeConstants::Relations::KContains );
+     *
+     *	 CMdERelation* relation = iMdeSession->NewRelationL( relationDef, albumObject->Id(), audioObject->Id() );
+     *	 iMdeSession->AddRelationL( *relation );
+	 * 
+	 * @param aDef  definition of the new relation
+	 * @param aLeftObjectId id of the left side of the relation
+	 * @param aRightObjectId id of the right side of the relation
+	 * @param aParameter the relation parameter
+	 *
+	 * @return  new relation
+	 */
+	virtual CMdERelation* NewRelationL(CMdERelationDef& aDef, 
+			TItemId aLeftObjectId, TItemId aRightObjectId, 
+			TInt32 aParameter = 0) = 0;
+
+	/**
+	 * Adds a new relation to the metadata engine database.
+	 *
+	 * @param relation
+	 *
+	 * @return  identifier of the new relation
+	 */
+	virtual TItemId AddRelationL( CMdERelation& aRelation ) = 0;
+
+	/**
+	 * Commits changes made to the relation to the metadata engine database.
+     *
+     * @param relation
+	 *
+	 * @return  identifier of the new relation
+	 */
+	virtual TItemId UpdateRelationL( CMdERelation& aRelation ) = 0;
+
+	/**
+	 * Removes the relation with the specified identifier and specified 
+	 * namespace (if namespace is NULL, the default namespace is used)
+	 * from the metadata engine database.
+	 *
+	 * @param aId   ID of the relation to remove.
+	 * @param aNamespaceDef namespace
+	 *
+	 * @return  relation ID or KNoId, if there is no relation with the 
+	 *          specified ID in the metadata engine database
+	 */
+	virtual TItemId RemoveRelationL( TItemId aId, 
+			CMdENamespaceDef* aNamespaceDef = NULL ) = 0;
+	
+	/**
+	 * Removes multiple relations with the specified IDs and specified 
+	 * namespace (if namespace is NULL, the default namespace is used)
+	 * from the metadata engine database.
+	 *
+	 * @param aId IDs of relations to remove.
+	 * @param aSuccessful Successfully removed IDs of relations (if removing 
+	 *                    has failed KNoId is added).
+	 * @param aNamespaceDef namespace
+	 */
+	virtual TInt RemoveRelationsL( 
+			const RArray<TItemId>& aId, RArray<TItemId>& aSuccessful, 
+			CMdENamespaceDef* aNamespaceDef = NULL ) = 0;
+
+	/**
+	 * Removes multiple relations asynchronous with the specified IDs and 
+	 * specified namespace (if namespace is NULL, the default namespace is 
+	 * used) from the metadata engine database. Returned serialized list of 
+	 * item IDs must be deserialized with DeserializeIdsL method.
+	 *
+	 * @param aId IDs of relations to remove.
+     * @param aStatus returns the result code after the asynchronous call 
+     *                completes.
+     * @param aSerializedRelationIds returned serialized list of relation IDs
+	 * @param aNamespaceDef namespace
+	 */
+	virtual void RemoveRelationsAsyncL( 
+			const RArray<TItemId>& aId, TRequestStatus& aStatus, 
+			RMdEDataBuffer& aSerializedRelationIds, 
+			CMdENamespaceDef* aNamespaceDef = NULL ) = 0;
+
+	/* Methods for managing events. */
+
+	/**
+	 * Constructs a new empty event. Note that the event is not inserted in the
+	 * database. The ownership of the new event is passed to the caller (that 
+	 * is, the caller is responsible for deleting the event).
+	 *
+	 * Example:
+	 *   CMdEEventDef* eventDef = &iDefaultNamespace->GetEventDefL( Events::KCreated );
+	 *   CMdEEvent* event = iMdeSession->NewEventLC( *eventDef, objectId, time );
+	 * 
+	 * @param aDef  definition of the new event
+	 * @param aObjectId the target object id
+	 * @param aTime time of the event
+	 * @param aSource source of the event
+	 * @param aParticipant participant of the event
+	 *
+	 * @return  new event
+	 */
+	virtual CMdEEvent* NewEventLC(CMdEEventDef& aDef, 
+			TItemId aObjectId, TTime aTime, 
+			const TDesC* aSource = NULL, const TDesC* aParticipant = NULL) = 0;
+
+	/**
+	 * Constructs a new empty event. Note that the event is not inserted in the
+	 * database. The ownership of the new event is passed to the caller (that 
+	 * is, the caller is responsible for deleting the event).
+	 *
+	 * Example:
+	 *   CMdEEventDef* eventDef = &iDefaultNamespace->GetEventDefL( Events::KCreated );
+	 *   CMdEEvent* event = iMdeSession->NewEventL( *eventDef, objectId, time );
+	 * 
+	 * @param aDef  definition of the new event
+	 * @param aObjectId the target object id
+	 * @param aTime time of the event
+	 * @param aSource source of the event
+	 * @param aParticipant participant of the event
+	 *
+	 * @return  new event
+	 */
+	virtual CMdEEvent* NewEventL(CMdEEventDef& aDef, 
+			TItemId aObjectId, TTime aTime, 
+			const TDesC* aSource = NULL, const TDesC* aParticipant = NULL) = 0;
+
+	/**
+	 * Returns the event with the specified identifier and specified namespace 
+	 * (if namespace is NULL, the default namespace is used).
+	 * Note that the ownership of the returned event is passed to the caller of
+	 * the method (that is, the caller is responsible for deleting the event).
+	 *
+	 * @param aId  Identifier.
+	 * @param aNamespaceDef namespace
+	 *
+	 * @return  Event or NULL, if there is no event with the specified 
+	 *          identifier in the metadata engine database.
+	 */
+	virtual CMdEEvent* GetEventL(TItemId aId, 
+			CMdENamespaceDef* aNamespaceDef = NULL) = 0;
+
+	/**
+	 * Adds a new event to the metadata engine database.
+	 *
+	 * @param event
+	 *
+	 * @return  Identifier of the new event.
+	 */
+	virtual TItemId AddEventL( CMdEEvent& aEvent ) = 0;
+
+	/**
+	 * Removes the event with the specified identifier and specified namespace 
+	 * (if namespace is NULL, the default namespace is used) from the metadata 
+	 * engine database.
+	 *
+	 * @param aId   ID of the event to remove.
+	 * @param aNamespaceDef namespace
+	 *
+	 * @return  event ID or KNoId, if there is no event with the specified ID
+	 *          in the metadata engine database
+	 */
+	virtual TItemId RemoveEventL( TItemId aId, 
+			CMdENamespaceDef* aNamespaceDef = NULL ) = 0;
+	
+	/**
+	 * Removes multiple events with the specified IDs and specified 
+	 * namespace (if namespace is NULL, the default namespace is used)
+	 * from the metadata engine database.
+	 *
+	 * @param aId IDs of events to remove.
+	 * @param aSuccessful Successfully removed IDs of events (if removing has 
+	 *                    failed KNoId is added).
+	 * @param aNamespaceDef namespace
+	 */
+	virtual TInt RemoveEventsL(
+			const RArray<TItemId>& aId, RArray<TItemId>& aSuccessful, 
+			CMdENamespaceDef* aNamespaceDef = NULL ) = 0;
+	
+	/**
+	 * Removes multiple events asynchronous with the specified IDs and 
+	 * specified namespace (if namespace is NULL, the default namespace is 
+	 * used) from the metadata engine database. Returned serialized list of 
+	 * item IDs must be deserialized with DeserializeIdsL method.
+	 *
+	 * @param aId IDs of events to remove.
+     * @param aStatus returns the result code after the asynchronous call 
+     *                completes.
+     * @param aSerializedEventIds returned serialized list of event IDs
+	 * @param aNamespaceDef namespace
+	 */
+	virtual void RemoveEventsAsyncL(
+			const RArray<TItemId>& aId, TRequestStatus& aStatus, 
+			RMdEDataBuffer& aSerializedEventIds, 
+			CMdENamespaceDef* aNamespaceDef = NULL ) = 0;
+
+
+	/* Methods for searching objects, relations, and events. */
+
+    /**
+	 * Creates a new object query.
+	 * 
+	 * Note that the ownership of the returned query is passed to the caller of
+	 * the method (that is, the caller is responsible for deleting the query).
+	 *
+	 * @param aNamespaceDef namespace where query will be run
+	 * @param aObjectDef object definition which defines objects which will be 
+	 *                   queried
+	 * @param aObserver observer which callback methods will be called
+	 *
+	 * @return  New object query.
+     */
+    virtual CMdEObjectQuery* NewObjectQueryL(CMdENamespaceDef& aNamespaceDef, 
+    		CMdEObjectDef& aObjectDef, MMdEQueryObserver* aObserver = 0) = 0;
+
+    /**
+	 * Creates a new object query.
+	 * 
+	 * Note that the ownership of the returned query is passed to the caller of
+	 * the method (that is, the caller is responsible for deleting the query).
+	 *
+	 * @param aObjectDef Object definition which defines the parent object.
+	 * @param aObjectDefs Object definitions which defines objects which will 
+	 *                    be queried. Ownership of aObjectDefs will change to 
+	 *                    query.
+	 * @param aObserver Observer which callback methods will be called.
+	 *
+	 * @return  New object query.
+     */
+    virtual CMdEObjectQuery* NewObjectQueryL(
+    		CMdEObjectDef& aObjectDef, 
+    		RPointerArray<CMdEObjectDef>* aObjectDefs, 
+    		MMdEQueryObserver* aObserver = 0) = 0;
+
+    /**
+	 * Creates a new relation query.
+	 * 
+	 * Note that the ownership of the returned query is passed to the caller of
+	 * the method (that is, the caller is responsible for deleting the query).
+	 *
+	 * @param aNamespaceDef namespace where query will be run
+	 * @param aObserver observer which callback methods will be called
+	 *
+     * @return  New relation query.
+     */
+    virtual CMdERelationQuery* NewRelationQueryL(
+    		CMdENamespaceDef& aNamespaceDef, 
+    		MMdEQueryObserver* aObserver = 0) = 0;
+
+    /**
+	 * Creates a new event query.
+	 * 
+	 * Note that the ownership of the returned query is passed to the caller of
+	 * the method (that is, the caller is responsible for deleting the query).
+	 *
+	 * @param aNamespaceDef namespace where query will be run
+	 * @param aObserver observer which callback methods will be called
+	 *
+     * @return  New event query.
+     */
+    virtual CMdEEventQuery* NewEventQueryL(CMdENamespaceDef& aNamespaceDef, 
+    		MMdEQueryObserver* aObserver = 0) = 0;
+
+
+	/* Methods for managing observers. */
+
+	/**
+	 * Adds a new schema observer to the session. No duplicate
+	 * observers are allowed.
+	 *
+	 * @param aObserver  observer
+	 */
+	virtual void AddSchemaObserverL(MMdESchemaObserver& aObserver) = 0;
+
+	/**
+	 * Removes the specified schema observer from the session.
+	 *
+	 * @param aObserver  observer
+	 */
+	virtual void RemoveSchemaObserverL(MMdESchemaObserver& aObserver) = 0;
+
+	/**
+	 * Adds a new object observer to the session. No duplicate observers are 
+     * allowed.
+     *
+     * The following restrictions are placed on the condition nodes:
+     * - Only CMdEObjectCondition and CMdEPropertyCondition nodes can be
+     *   used. CMdERangePropertyConditions are not allowed.
+     * - No nested logic conditions are allowed.
+	 *
+	 * @param aObserver   Observer.
+	 * @param aCondition  Condition that the objects, about which the observer
+	 *                    wants to receive notifications, must fulfill or NULL,
+	 *                    to receive notifications of all objects.
+     *                    Ownership of the condition is transferred to the
+     *                    session.
+     * @param aNotificationType what event type (add, modify, remove) should
+     *                          be notified to client
+     * @param aNamespaceDef specified namespace (if namespace is NULL, the 
+     *                      default namespace is used)
+     * 
+     * @leave KErrAlreadyExists if the same observer has already been added
+	 */
+	virtual void AddObjectObserverL(MMdEObjectObserver& aObserver,
+			CMdELogicCondition* aCondition = NULL, 
+			TUint32 aNotificationType = ENotifyAdd | ENotifyModify | ENotifyRemove,
+			CMdENamespaceDef* aNamespaceDef = NULL) = 0;
+
+	/**
+	 * Removes the specified object observer from the session.
+	 *
+	 * @param aObserver  observer
+     * @param aNamespaceDef specified namespace (if namespace is NULL, the 
+     *                      default namespace is used)
+	 */
+	virtual void RemoveObjectObserverL(MMdEObjectObserver& aObserver, 
+			CMdENamespaceDef* aNamespaceDef = NULL) = 0;
+
+	/**
+	 * Adds a new object present observer to the session. No duplicate 
+	 * observers are allowed.
+     *
+	 * @param aObserver   Observer
+	 * 
+     * @leave KErrAlreadyExists if the same observer has already been added
+	 */
+	virtual void AddObjectPresentObserverL(
+			MMdEObjectPresentObserver& aObserver) = 0;
+
+	/**
+	 * Removes the specified object present observer from the session.
+	 *
+	 * @param aObserver  observer
+	 */
+	virtual void RemoveObjectPresentObserverL(
+			MMdEObjectPresentObserver& aObserver)= 0;
+
+	/**
+	 * Adds a new relation observer to the session. No duplicate observers 
+     * are allowed.
+	 *
+     * The following restrictions are placed on the condition nodes:
+     * - Only CMdERelationCondition nodes are allowed.
+     * - No nested logic conditions are allowed.
+     *
+	 * @param aObserver   Observer.
+	 * @param aCondition  Condition that the relations, about which the observer
+	 *                    wants to receive notifications, must fulfill
+	 *                    or NULL, to receive notifications of all relations.
+     *                    Ownership of the condition is transferred to the
+     *                    session.
+     * @param aNotificationType what event type (add, modify, remove) should
+     *                          be notified to client
+     * @param aNamespaceDef specified namespace (if namespace is NULL, the 
+     *                      default namespace is used)
+     * 
+     * @leave KErrAlreadyExists if the same observer has already been added
+	 */
+	virtual void AddRelationObserverL(MMdERelationObserver& aObserver,
+			CMdECondition* aCondition = NULL, 
+			TUint32 aNotificationType = ENotifyAdd | ENotifyModify | ENotifyRemove,
+			CMdENamespaceDef* aNamespaceDef = NULL)= 0;
+	/**
+	 * Removes the specified relation observer from the session.
+	 *
+	 * @param aObserver  Observer.
+     * @param aNamespaceDef specified namespace (if namespace is NULL, the 
+     *                      default namespace is used)
+	 */
+	virtual void RemoveRelationObserverL(MMdERelationObserver& aObserver, 
+			CMdENamespaceDef* aNamespaceDef = NULL) = 0;
+
+	/**
+	 * Adds a new relation item observer to the session.
+	 * No duplicate observers are allowed.
+	 *
+     * The following restrictions are placed on the condition nodes:
+     * - Only CMdERelationCondition nodes are allowed.
+     * - No nested logic conditions are allowed.
+     *
+	 * @param aObserver   Observer.
+	 * @param aCondition  Condition that the relations, about which the observer
+	 *                    wants to receive notifications, must fulfill
+	 *                    or NULL, to receive notifications of all relations.
+     *                    Ownership of the condition is transferred to the
+     *                    session.
+     * @param aNotificationType what event type (add, modify, remove) should
+     *                          be notified to client
+     * @param aNamespaceDef specified namespace (if namespace is NULL, the 
+     *                      default namespace is used)
+     * 
+     * @leave KErrAlreadyExists if the same observer has already been added
+	 */
+	virtual void AddRelationItemObserverL(MMdERelationItemObserver& aObserver,
+			CMdECondition* aCondition = NULL, 
+			TUint32 aNotificationType = /*ENotifyAdd | ENotifyModify |*/ ENotifyRemove,
+			CMdENamespaceDef* aNamespaceDef = NULL)= 0;
+	/**
+	 * Removes the specified relation observer from the session.
+	 *
+	 * @param aObserver  Observer.
+     * @param aNamespaceDef specified namespace (if namespace is NULL, the 
+     *                      default namespace is used)
+	 */
+	virtual void RemoveRelationItemObserverL(MMdERelationItemObserver& aObserver, 
+			CMdENamespaceDef* aNamespaceDef = NULL) = 0;
+	
+	/**
+	 * Adds a new realation present observer to the session. No duplicate observers are 
+     * allowed.
+     *
+	 * @param aObserver   Observer.
+	 * 
+     * @leave KErrAlreadyExists if the same observer has already been added
+	 */
+	virtual void AddRelationPresentObserverL(
+			MMdERelationPresentObserver& aObserver) = 0;
+
+	/**
+	 * Removes the specified relation present observer from the session.
+	 *
+	 * @param aObserver  observer
+	 */
+	virtual void RemoveRelationPresentObserverL(
+			MMdERelationPresentObserver& aObserver)= 0;
+
+	/**
+	 * Adds a new event observer to the session. No duplicate observers 
+     * are allowed.
+     *
+     * The following restrictions are placed on the condition nodes:
+     * - Only CMdEEventCondition nodes are allowed.
+     * - No nested logic conditions are allowed.
+	 *
+	 * @param aObserver   Observer.
+	 * @param aCondition  Condition that the events, about which the observer
+	 *                    wants to receive notifications, must fulfill
+	 *                    or NULL, to receive notifications of all events.
+     * @param aNotificationType what event type (add or remove) should
+     *                          be notified to client
+     * @param aNamespaceDef specified namespace (if namespace is NULL, the 
+     *                      default namespace is used)
+     * 
+     * @leave KErrAlreadyExists if the same observer has already been added
+	 */
+	virtual void AddEventObserverL(MMdEEventObserver& aObserver,
+			CMdECondition* aCondition = NULL, 
+			TUint32 aNotificationType = ENotifyAdd | ENotifyRemove,
+			CMdENamespaceDef* aNamespaceDef = NULL) = 0;
+
+	/**
+	 * Removes the specified event observer from the session.
+	 *
+	 * @param aObserver  Observer.
+     * @param aNamespaceDef specified namespace (if namespace is NULL, the 
+     *                      default namespace is used)
+	 */
+	virtual void RemoveEventObserverL(MMdEEventObserver& aObserver, 
+			CMdENamespaceDef* aNamespaceDef = NULL) = 0;
+
+
+    /* Methods for import/export */
+
+	/**
+	 * Imports schemadata from file to default database.
+	 *
+	 * @param aFileName  filename where the schemadata to import is.
+	 */
+	virtual void ImportSchemaL( const TDesC& aFileName ) = 0;
+
+	/**
+	 * Imports metadata from file to default database.
+	 *
+	 * @param aFileName  filename where the metadata to import is.
+	 * @return The number of failed imports
+	 */
+	virtual TInt ImportMetadataL( const TDesC& aFileName ) = 0;
+
+	/**
+	 * Imports metadata asynchronously from file to default database.
+	 *
+	 * @param aFileName Filename where the metadata to import is.
+	 * @param aResult The number of failed imports and possible error code.
+	 * @param aStatus Returned status of method call.
+	 */
+	virtual void ImportMetadata( const TDesC& aFileName, 
+			TPckgBuf<TInt>& aResult, TRequestStatus& aStatus ) = 0;
+
+	/**
+	 * Exports metadata to file.
+	 *
+	 * @param aFileName  filename where the metadata is to be exported.
+     * @param aNamespaceDef specified namespace (if namespace is NULL, the 
+     *                      default namespace is used), ownership doesn't 
+     *                      change
+     * @param aObjectDefs object types to export (if NULL all objects are 
+     *                    exported), ownership doesn't change
+     * @param aRelationDefs relation types to export (if NULL all relations 
+     *                      are exported), ownership doesn't change
+     * @param aEventDefs event types to export (if NULL all events are 
+     *                   exported), ownership doesn't change
+	 */
+	virtual void ExportMetadataL( const TDesC& aFileName, 
+			const CMdENamespaceDef* aNamespaceDef = NULL, 
+	        const RPointerArray<CMdEObjectDef>* aObjectDefs = NULL, 
+	        const RPointerArray<CMdERelationDef>* aRelationDefs = NULL, 
+            const RPointerArray<CMdEEventDef>* aEventDefs = NULL ) = 0;
+
+	/**
+	 * Exports metadata asynchronously to file.
+	 *
+	 * @param aFileName Filename where the metadata is to be exported.
+	 * @param aStatus Returns the result code after the asynchronous call 
+     *                completes.
+	 * @param aBuffer Serialized buffer of export types, must be valid until 
+	 *                aStatus is completed and can be closed after that.
+     * @param aNamespaceDef Specified namespace (if namespace is NULL, the 
+     *                      default namespace is used), ownership doesn't 
+     *                      change.
+     * @param aObjectDefs Object types to export (if NULL all objects are 
+     *                    exported), ownership doesn't change.
+     * @param aRelationDefs Relation types to export (if NULL all relations 
+     *                      are exported), ownership doesn't change.
+     * @param aEventDefs Event types to export (if NULL all events are 
+     *                   exported), ownership doesn't change.
+	 */
+	virtual void ExportMetadataL( const TDesC& aFileName, 
+			TRequestStatus& aStatus, RMdEDataBuffer& aBuffer, 
+        	const CMdENamespaceDef* aNamespaceDef = NULL, 
+	        const RPointerArray<CMdEObjectDef>* aObjectDefs = NULL, 
+            const RPointerArray<CMdERelationDef>* aRelationDefs = NULL, 
+            const RPointerArray<CMdEEventDef>* aEventDefs = NULL ) = 0;
+	/**
+	 * Load whole schema from server side.
+	 */
+	virtual void LoadSchemaL() = 0;
+
+	/**
+	 * Get schema version's major and minor version.
+	 *
+	 * @param aMajorVersion returned major version
+	 * @param aMinorVersion returned minor version
+	 */
+	virtual void GetSchemaVersionL(
+			TInt& aMajorVersion, TInt& aMinorVersion) = 0;
+
+	/**
+	 * Set object to "present" state by GUID.
+	 *
+	 * @param aGuidHigh Guid's high part
+	 * @param aGuidLow Guid's low part
+	 *
+	 * @leave KErrNotFound MdE can't find object in "not present" state 
+	 *                     with matching GUID
+	 */
+	virtual void SetObjectToPresentByGuidL( 
+			const TInt64& aGuidHigh, const TInt64& aGuidLow ) = 0;
+	
+    /**
+      * Adds a new object observer to the session. No duplicate observers are 
+      * allowed.
+      *
+      * The following restrictions are placed on the condition nodes:
+      * - Only CMdEObjectCondition and CMdEPropertyCondition nodes can be
+      *   used. CMdERangePropertyConditions are not allowed.
+      * - No nested logic conditions are allowed.
+      * 
+      * Be adviced, this version with the URI in the callback is much less
+      * efficient than using version without the URI
+      *
+      * @param aObserver   Observer.
+      * @param aCondition  Condition that the objects, about which the observer
+      *                    wants to receive notifications, must fulfill or NULL,
+      *                    to receive notifications of all objects.
+      *                    Ownership of the condition is transferred to the
+      *                    session.
+      * @param aNotificationType what event type (add, modify, remove) should
+      *                          be notified to client
+      * @param aNamespaceDef specified namespace (if namespace is NULL, the 
+      *                      default namespace is used)
+      * @param aUriRequired determines if uri is required in the callback
+      * 
+      * @leave KErrAlreadyExists if the same observer has already been added
+      */
+     virtual void AddObjectObserverWithUriL( MMdEObjectObserverWithUri& aObserver,
+             CMdELogicCondition* aCondition = NULL, 
+             TUint32 aNotificationType = ENotifyAdd | ENotifyModify | ENotifyRemove,
+             CMdENamespaceDef* aNamespaceDef = NULL ) = 0;
+
+     /**
+      * Removes the specified object observer from the session.
+      *
+      * @param aObserver  observer
+      */
+     virtual void RemoveObjectObserverWithUriL( MMdEObjectObserverWithUri& aObserver, 
+                             CMdENamespaceDef* aNamespaceDef = NULL ) = 0;
+     
+protected:
+
+	/* Constructors. */
+
+	/**
+	 * Constructor.
+	 */
+	CMdESession();
+
+	/**
+	 * Second-phase constructor.
+	 */
+	void SessionConstruct();
+	};
+
+// includes only for client more convinient usage
+#include <mdeitem.h>
+#include <mdenamespacedef.h>
+#include <mdepropertydef.h>
+#include <mdeobjectdef.h>
+#include <mderelationdef.h>
+#include <mdeeventdef.h>
+#include <mdeproperty.h>
+#include <mdeobject.h>
+#include <mderelation.h>
+#include <mdeevent.h>
+#include <mdedatabuffer.h>
+
+#endif  // __MDESESSION_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/inc/mdesessionimpl.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,650 @@
+/*
+* Copyright (c) 2005-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:  Metadata engine client session implementation*
+*/
+
+
+#ifndef __MDESESSIONIMPL_H__
+#define __MDESESSIONIMPL_H__
+
+#include "mdesession.h"
+
+
+// forward declarations
+class CMdENotifierAO;
+class CMdEDataBuffer;
+class CMdCSerializationBuffer;
+class CMdESessionStartupAO;
+class CMdeSessionStartTimer;
+
+class RMdESessionAsyncRequest
+	{
+		friend class CMdeSessionStartTimer;
+	private:
+		enum TRequestType
+		{
+			EAddRequest,
+			EUpdateRequest,
+			ERemoveRequest
+		};
+	
+		RMdESessionAsyncRequest(TRequestType aRequestType, 
+			CMdCSerializationBuffer* aBuffer, 
+			CMdCSerializationBuffer& aResultBuffer,
+			TRequestStatus& aRequestStatus);
+		
+		void Close();
+
+	private:
+		TRequestType iRequestType;
+		CMdCSerializationBuffer* iBuffer;
+		CMdCSerializationBuffer* iResultBuffer;
+		TRequestStatus* iRequestStatus;
+	};
+
+NONSHARABLE_CLASS(CMdeSessionStartTimer) : public CTimer
+{
+public:
+	
+	static CMdeSessionStartTimer* NewL(MMdESessionObserver& aObserver);
+	
+	~CMdeSessionStartTimer();
+		
+private:
+	
+	void RunL();
+
+	void ConstructL();
+	
+	CMdeSessionStartTimer(MMdESessionObserver& aObserver);
+
+private:
+	RArray<RMdESessionAsyncRequest> iRequests;
+	MMdESessionObserver& iObserver;
+};
+
+/**
+ * Metadata engine session implementation.
+ */
+NONSHARABLE_CLASS(CMdESessionImpl) : public CMdESession
+	{
+	friend class CMdESessionStartupAO;
+
+    public: // Constructors and destructor.
+
+    	/**
+    	 * Constructor.
+    	 *
+    	 * @param aObserver observer to notify when opening the session has 
+    	 *                  been completed
+    	 */
+    	CMdESessionImpl( MMdESessionObserver& aObserver );
+
+    	/**
+    	 * Second-phase constructor.
+    	 */
+    	void ConstructL();
+
+    	/**
+    	 * Destructor.
+    	 */
+    	virtual ~CMdESessionImpl();
+
+		/** From MdESession */
+		TInt NamespaceDefCount() const;
+
+		/** From MdESession */
+		CMdENamespaceDef& NamespaceDefL(TInt aIndex);
+
+		/** From MdESession */
+		CMdENamespaceDef& GetNamespaceDefL(const TDesC& aName);
+
+		CMdENamespaceDef& GetNamespaceDefL(TDefId aId);
+
+		/** From MdESession */
+		CMdENamespaceDef& GetDefaultNamespaceDefL();
+
+		/** From MdESession */
+		CMdEObject* NewObjectL( CMdEObjectDef& aDef, const TDesC& aUri, 
+                TUint32 aMediaId = 0 );
+
+		/** From MdESession */
+		CMdEObject* NewObjectLC( CMdEObjectDef& aDef, const TDesC& aUri, 
+				TUint32 aMediaId = 0 );
+
+		/** From MdESession */
+	    TInt AddObjectsL(RPointerArray<CMdEObject>& aObjects);
+
+		/** From MdESession */
+	    void CommitObjectL(CMdEObject& aObject);
+
+		/** From MdESession */
+	    void CommitObjectsL(RPointerArray<CMdEObject>& aObjects);
+
+		/** From MdESession */
+	    TItemId CancelObjectL(CMdEObject& aObject);
+
+		/** From MdESession */
+		CMdERelation* NewRelationLC(CMdERelationDef& aDef, 
+				TItemId aLeftObjectId, TItemId aRightObjectId, 
+				TInt32 aParameter);
+
+		/** From MdESession */
+		CMdERelation* NewRelationL(CMdERelationDef& aDef, 
+				TItemId aLeftObjectId, TItemId aRightObjectId, 
+				TInt32 aParameter);
+
+		/** From MdESession */
+		CMdEEvent* NewEventLC(CMdEEventDef& aDef, TItemId aObjectId, 
+				TTime aTime, const TDesC* aSource, const TDesC* aParticipant);
+
+		/** From MdESession */
+		CMdEEvent* NewEventL(CMdEEventDef& aDef, TItemId aObjectId, 
+				TTime aTime, const TDesC* aSource, const TDesC* aParticipant);
+
+		/** From MdESession */
+		void AddSchemaObserverL(MMdESchemaObserver& aObserver);
+
+		/** From MdESession */
+		void RemoveSchemaObserverL(MMdESchemaObserver& aObserver);
+
+		/** From MdESession */
+		void AddRelationDefL(const CMdENamespaceDef &aNamespaceDef, 
+				const TDesC &aName);
+
+		/** From MdESession */
+		void AddEventDefL(const CMdENamespaceDef &aNamespaceDef, 
+				const TDesC &aName);
+
+		/* From MdESession */
+    	TItemId AddObjectL(CMdEObject& aObject);
+    	
+    	/* From MdESession */
+		TInt DeserializeIdsL( RMdEDataBuffer& aSerializedItemIds, 
+				RArray<TItemId>* aResultObjects = NULL,
+				RArray<TItemId>* aResultEvents = NULL, 
+				RArray<TItemId>* aResultRelations = NULL );
+
+    	/* From MdESession */
+   		TInt DeserializeItemsL( RMdEDataBuffer& aSerializedItems, 
+   				RPointerArray<CMdEInstanceItem>& aItems );
+
+    	/* From MdESession */
+    	TItemId RemoveObjectL( TItemId aId, CMdENamespaceDef* aNamespaceDef );
+    	
+    	/* From MdESession */
+    	TItemId RemoveObjectL( const TDesC& aUri, 
+    			CMdENamespaceDef* aNamespaceDef );
+
+    	/* From MdESession */
+		TInt RemoveObjectsL( const RArray<TItemId>& aId, 
+				RArray<TItemId>& aResult, CMdENamespaceDef* aNamespaceDef );
+	
+    	/* From MdESession */
+		TInt RemoveObjectsL( const RPointerArray<TDesC>& aUri, 
+				RArray<TItemId>& aResult, CMdENamespaceDef* aNamespaceDef );
+
+    	/* From MdESession */
+		void RemoveObjectsAsyncL( 
+				const RArray<TItemId>& aId, TRequestStatus& aStatus, 
+				RMdEDataBuffer& aSerializedObjectIds, 
+				CMdENamespaceDef* aNamespaceDef );
+
+    	/* From MdESession */
+		void RemoveObjectsAsyncL( 
+				const RPointerArray<TDesC>& aUri, TRequestStatus& aStatus, 
+				RMdEDataBuffer& aSerializedObjectIds, 
+				CMdENamespaceDef* aNamespaceDef );
+
+    	/* From MdESession */
+    	CMdEObject* GetObjectL( const TItemId aId, 
+    			CMdEObjectDef& aObjectDef );
+
+    	/* From MdESession */
+    	CMdEObject* OpenObjectL( const TItemId aId, 
+    			CMdEObjectDef& aObjectDef );
+
+    	/* From MdESession */
+    	CMdEObject* GetObjectL( 
+    			const TInt64 aGuidHigh, const TInt64 aGuidLow, 
+    			CMdEObjectDef& aObjectDef );
+
+    	/* From MdESession */
+    	CMdEObject* OpenObjectL( 
+    			const TInt64 aGuidHigh, const TInt64 aGuidLow, 
+    			CMdEObjectDef& aObjectDef );
+    	
+    	/* From MdESession. */
+    	CMdEObject* GetObjectL( const TDesC& aUri, 
+    			CMdEObjectDef& aObjectDef );
+
+    	/* From MdESession. */
+    	CMdEObject* OpenObjectL( const TDesC& aUri, 
+    			CMdEObjectDef& aObjectDef );
+
+    	/* From MdESession */
+    	CMdEObject* GetObjectL( const TItemId aId, 
+    			CMdENamespaceDef* aNamespaceDef );
+
+    	/* From MdESession */
+    	CMdEObject* OpenObjectL( const TItemId aId, 
+    			CMdENamespaceDef* aNamespaceDef );
+
+    	/* From MdESession */
+    	CMdEObject* GetObjectL(
+    			const TInt64 aGuidHigh, const TInt64 aGuidLow, 
+    			CMdENamespaceDef* aNamespaceDef );
+
+    	/* From MdESession */
+    	CMdEObject* OpenObjectL( 
+    			const TInt64 aGuidHigh, const TInt64 aGuidLow, 
+    			CMdENamespaceDef* aNamespaceDef );
+    	
+    	/* From MdESession. */
+    	CMdEObject* GetObjectL( const TDesC& aUri, 
+    			CMdENamespaceDef* aNamespaceDef );
+
+    	/* From MdESession. */
+    	CMdEObject* OpenObjectL( const TDesC& aUri, 
+    			CMdENamespaceDef* aNamespaceDef );
+
+    	/* From MdESession */
+    	CMdEObject* GetFullObjectL( const TItemId aId, 
+    			CMdENamespaceDef* aNamespaceDef );
+
+    	/* From MdESession */
+    	CMdEObject* OpenFullObjectL( const TItemId aId, 
+    			CMdENamespaceDef* aNamespaceDef );
+
+    	/* From MdESession */
+    	CMdEObject* GetFullObjectL( 
+    			const TInt64 aGuidHigh, const TInt64 aGuidLow, 
+    			CMdENamespaceDef* aNamespaceDef );
+
+    	/* From MdESession */
+    	CMdEObject* OpenFullObjectL( 
+    			const TInt64 aGuidHigh, const TInt64 aGuidLow, 
+    			CMdENamespaceDef* aNamespaceDef );
+    	
+    	/* From MdESession. */
+    	CMdEObject* GetFullObjectL( const TDesC& aUri, 
+    			CMdENamespaceDef* aNamespaceDef );
+
+    	/* From MdESession. */
+    	CMdEObject* OpenFullObjectL( const TDesC& aUri, 
+    			CMdENamespaceDef* aNamespaceDef );
+
+    	void CheckObjectL( 	TMdEObject& aObject, const TDesC& aUri, 
+    			CMdENamespaceDef* aNamespaceDef );
+
+    	void CheckObjectL( TMdEObject& aObject, TItemId aId, 
+    			CMdENamespaceDef* aNamespaceDef );
+
+    	void CheckObjectL( RArray<TMdEObject>& aObjects, 
+    			const RArray<TItemId>& aIds, 
+    			CMdENamespaceDef* aNamespaceDef );
+
+    	/* From MdESession. */
+     	TItemId AddRelationL( CMdERelation& aRelation );
+
+    	/* From MdESession. */
+     	TItemId UpdateRelationL( CMdERelation& aRelation );
+
+    	/* From MdESession. */
+        TInt AddItemsL( RPointerArray<CMdEInstanceItem>& aItems );
+
+    	/* From MdESession. */
+        TInt UpdateItemsL( RPointerArray<CMdEInstanceItem>& aItems );
+
+		/* From MdESession. */
+        void AddItemsAsyncL( 
+        		RPointerArray<CMdEInstanceItem>& aItems, 
+        		TRequestStatus& aStatus,
+        		RMdEDataBuffer& aSerializedItemIds );
+
+		/* From MdESession. */
+        void UpdateItemsAsyncL( 
+        		RPointerArray<CMdEInstanceItem>& aItems, 
+        		TRequestStatus& aStatus,
+        		RMdEDataBuffer& aSerializedItemIds );
+
+    	/* From MdESession. */
+        CMdERelation* GetRelationL(TItemId aId, 
+        		CMdENamespaceDef* aNamespaceDef);
+
+    	/* From MdESession. */
+    	TItemId RemoveRelationL(TItemId aId, 
+    			CMdENamespaceDef* aNamespaceDef);
+    	
+    	/* From MdESession. */
+    	TInt RemoveRelationsL(const RArray<TItemId>& aId, 
+    			RArray<TItemId>& aSuccessful, CMdENamespaceDef* aNamespaceDef);
+
+    	/* From MdESession. */
+    	void RemoveRelationsAsyncL(
+    			const RArray<TItemId>& aId, TRequestStatus& aStatus, 
+    			RMdEDataBuffer& aSerializedRelationIds, 
+    			CMdENamespaceDef* aNamespaceDef );
+
+    	/* From MdESession. */
+        CMdEObjectQuery* NewObjectQueryL(CMdENamespaceDef& aNamespaceDef, 
+        		CMdEObjectDef& aObjectDef, MMdEQueryObserver* aObserver);
+
+        /* From MdESession. */
+        CMdEObjectQuery* NewObjectQueryL(CMdEObjectDef& aObjectDef, 
+        		RPointerArray<CMdEObjectDef>* aObjectDefs, 
+        		MMdEQueryObserver* aObserver);
+        
+    	/* From MdESession. */
+        CMdEEvent* GetEventL(TItemId aId, CMdENamespaceDef* aNamespaceDef);
+
+    	/* From MdESession. */
+        TItemId AddEventL( CMdEEvent& aEvent );   
+    						
+    	/* From MdESession. */		   
+		TItemId RemoveEventL( TItemId aId, CMdENamespaceDef* aNamespaceDef );
+		
+		/* From MdESession. */
+		TInt RemoveEventsL( const RArray<TItemId>& aId, 
+				RArray<TItemId>& aSuccessful, 
+				CMdENamespaceDef* aNamespaceDef );
+		
+		/* From MdESession. */
+		void RemoveEventsAsyncL( 
+				const RArray<TItemId>& aId, TRequestStatus& aStatus, 
+				RMdEDataBuffer& aSerializedEventIds, 
+				CMdENamespaceDef* aNamespaceDef );
+	
+    	/* From MdESession. */
+        CMdERelationQuery* NewRelationQueryL(CMdENamespaceDef& aNamespaceDef, 
+        		MMdEQueryObserver* aObserver);
+
+    	/* From MdESession. */
+        CMdEEventQuery* NewEventQueryL(CMdENamespaceDef& aNamespaceDef, 
+        		MMdEQueryObserver* aObserver);
+
+        /* From MdESession. */
+    	void AddObjectObserverL(MMdEObjectObserver& aObserver,
+    							CMdELogicCondition* aCondition,
+    							TUint32 aNotificationType,
+    							CMdENamespaceDef* aNamespaceDef);
+
+        /* From MdESession. */
+    	void RemoveObjectObserverL(MMdEObjectObserver& aObserver, 
+    							  CMdENamespaceDef* aNamespaceDef);
+
+		/* From MdESession. */
+		void AddObjectPresentObserverL(
+				MMdEObjectPresentObserver& aObserver);
+
+		/* From MdESession. */
+		void RemoveObjectPresentObserverL(
+				MMdEObjectPresentObserver& aObserver);
+	
+        /* From MdESession. */
+    	void AddRelationObserverL(MMdERelationObserver& aObserver,
+    							  CMdECondition* aCondition,
+    							  TUint32 aNotificationType,
+    							  CMdENamespaceDef* aNamespaceDef);
+
+        /* From MdESession. */
+    	void RemoveRelationObserverL(MMdERelationObserver& aObserver,
+    								CMdENamespaceDef* aNamespaceDef);
+
+    	/* From MdESession. */
+    	void AddRelationItemObserverL(MMdERelationItemObserver& aObserver,
+    								  CMdECondition* aCondition,
+    								  TUint32 aNotificationType,
+    								  CMdENamespaceDef* aNamespaceDef);
+
+    	/* From MdESession. */
+    	void RemoveRelationItemObserverL(MMdERelationItemObserver& aObserver, 
+    									CMdENamespaceDef* aNamespaceDef);
+
+    	/* From MdESession. */
+		void AddRelationPresentObserverL(
+				MMdERelationPresentObserver& aObserver);
+
+        /* From MdESession. */
+		void RemoveRelationPresentObserverL(
+				MMdERelationPresentObserver& aObserver);
+
+        /* From MdESession. */
+    	void AddEventObserverL(MMdEEventObserver& aObserver,
+    						   CMdECondition* aCondition, 
+ 							   TUint32 aNotificationType,
+    						   CMdENamespaceDef* aNamespaceDef);
+
+        /* From MdESession. */
+    	void RemoveEventObserverL(MMdEEventObserver& aObserver, 
+    							 CMdENamespaceDef* aNamespaceDef);
+
+        /** Finds an existing observer notifier */
+        TInt FindNotifier( TUint32 aNotifyType, TAny* aObserver, 
+        		CMdENamespaceDef& aNamespaceDef );
+
+        /** With this call Notifier announces it is in error state */
+        void NotifierInError( CMdENotifierAO* aNotifier );
+
+        /* From MdESession. */
+        void ImportSchemaL( const TDesC& aFileName );
+
+        /* From MdESession. */
+        TInt ImportMetadataL(const TDesC& aFileName );
+
+        /* From MdESession. */
+        void ImportMetadata( const TDesC& aFileName, TPckgBuf<TInt>& aResult, 
+        		TRequestStatus& aStatus );
+
+        /* From MdESession. */
+        void ExportMetadataL( const TDesC& aFileName, 
+        					  const CMdENamespaceDef* aNamespaceDef = NULL, 
+	                		  const RPointerArray<CMdEObjectDef>* aObjectDefs = NULL, 
+                    		  const RPointerArray<CMdERelationDef>* aRelationDefs = NULL, 
+                        	  const RPointerArray<CMdEEventDef>* aEventDefs = NULL );
+
+        /* From MdESession. */
+        void ExportMetadataL( const TDesC& aFileName, TRequestStatus& aStatus, 
+        					  RMdEDataBuffer& aBuffer, 
+        					  const CMdENamespaceDef* aNamespaceDef = NULL, 
+	                		  const RPointerArray<CMdEObjectDef>* aObjectDefs = NULL, 
+                    		  const RPointerArray<CMdERelationDef>* aRelationDefs = NULL, 
+                        	  const RPointerArray<CMdEEventDef>* aEventDefs = NULL );
+
+		void LoadSchemaL();
+
+		/* From MdESession. */
+    	void GetSchemaVersionL(TInt& aMajorVersion, TInt& aMinorVersion);
+
+    	/* From MdESession. */
+    	void SetObjectToPresentByGuidL( 
+    			const TInt64& aGuidHigh, const TInt64& aGuidLow );
+    	
+        void GetCountL( CMdCSerializationBuffer* aBuffer, TUint32& aResult );
+
+        void GetItemIdL( CMdCSerializationBuffer* aBuffer, 
+        		RArray<TItemId>& aIdArray );
+
+        void GetDistinctValuesL( CMdCSerializationBuffer& aBuffer, 
+        		CDesCArray& aResults );
+
+		/**
+		 * Should be called to notify the base class 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). Attempts 
+		 * to recover from the error have failed. All on-going operations 
+		 * initiated by the client should be aborted before calling this 
+		 * method. After calling this method any attempts to use the session 
+		 * will cause a panic.
+		 *
+		 * @param aError  one of the system-wide error codes
+		 */
+		void NotifyError(TInt aError);
+
+        /* From MdESession. */
+        void AddObjectObserverWithUriL( MMdEObjectObserverWithUri& aObserver,
+                                CMdELogicCondition* aCondition,
+                                TUint32 aNotificationType,
+                                CMdENamespaceDef* aNamespaceDef );
+        
+        /* From MdESession. */
+        void RemoveObjectObserverWithUriL( MMdEObjectObserverWithUri& aObserver, 
+                                CMdENamespaceDef* aNamespaceDef );
+    protected:
+
+        /*
+        * Loads the schema
+        */
+        void DoLoadSchemaL();
+
+       	void Close();
+
+		/* Methods to notify the base class about different events. */
+
+		/**
+		 * Should be called to notify the base class that opening the session 
+		 * has been completed and, if the opening succeeded, the session is 
+		 * ready for use.
+		 *
+		 * @param aError <code>KErrNone</code>, if opening the session 
+		 *               succeeded; or one of the system-wide error codes, 
+		 *               if opening the session failed
+		 */
+		void NotifySessionOpened(TInt aError);
+
+		/* Utility methods for concrete session implementations. */	
+
+		/**
+		 * Panics if the session has not been succesfully opened.
+		 */
+		void CheckOpened() const;
+
+	public:
+
+		void DeserializeQueryResultL( CMdCSerializationBuffer& aBuffer, 
+				RPointerArray<CMdEInstanceItem>& aItems );
+
+	protected:						   		       
+		CMdCSerializationBuffer* SerializeItemsL( 
+				RPointerArray<CMdEInstanceItem>& aItems );					   		       
+		
+		TItemId AddItemL( CMdEInstanceItem& aItem );
+		
+		void DeserializeAddingResultsL( 
+				RPointerArray<CMdEInstanceItem>& aItems, 
+				CMdCSerializationBuffer& aResultBuffer );
+		
+		/**
+		 * Creates a serialized buffer with id marked to be removed
+		 *
+		 * @param aNamespaceDef namespace where items should be removed
+		 * @param aObjects objects id to remove (could be NULL)
+		 * @param aEvents events id to remove (could be NULL)
+		 * @param aRelations relation id to remove (could be NULL)
+		 * @return serialized buffer
+		 */
+		CMdCSerializationBuffer* RemoveCommonL( 
+				CMdENamespaceDef& aNamespaceDef, 
+				const RPointerArray<TDesC16>* aObjects,
+				const RArray<TItemId>* aEvents, 
+				const RArray<TItemId>* aRelations );
+		
+	 	/**
+		 * Creates a serialized buffer with id marked to be removed
+		 *
+		 * @param aNamespaceDef namespace where items should be removed
+		 * @param aObjects objects uri to remove (could be NULL)
+		 * @param aEvents events id to remove (could be NULL)
+		 * @param aRelations relation id to remove (could be NULL)
+		 * @return serialized buffer
+		 */
+		CMdCSerializationBuffer* RemoveCommonL( 
+				CMdENamespaceDef& aNamespaceDef, 
+				const RArray<TItemId>* aObjects, 
+				const RArray<TItemId>* aEvents, 
+				const RArray<TItemId>* aRelations );
+
+		/**
+		 * Creates a serialized buffer with defs id items to be exported
+		 *
+		 * @param aNamespaceDef namespace from where items should be removed 
+		 *                      (NULL means from every)
+		 * @param aObjectDefs objectDefs to export
+		 * @param aRelationDefs
+		 * @param aEventDefs
+		 * @return serialized items ids
+		 */
+		CMdCSerializationBuffer* ExportCommonL( 
+				const CMdENamespaceDef* aNamespaceDef,
+				const RPointerArray<CMdEObjectDef>* aObjectDefs,
+                const RPointerArray<CMdERelationDef>* aRelationDefs,
+                const RPointerArray<CMdEEventDef>* aEventDefs );
+
+	private:
+		/**
+		 * If aId is KNoId it isn't used. If aUri is KNullDesC, it isn't used.
+		 */
+//		CMdEObject* GetObjectL( CMdEObjectDef& aObjectDef, const TItemId aId, 
+//				                const TInt64 aGuidHigh, const TInt64 aGuidLow, 
+//				                const TDesC& aUri, TMdCQueryLockType aLocktype,
+//				                TBool aIncludeFreetexts );
+
+		/**
+		 * Return namespace definition or default namespace definition
+		 * 
+		 * @param aNamespaceDef namespace definition or NULL
+		 * @return default namespace definition if parameter was NULL, 
+		 *         othrewise namespace definition which was given as parameter
+		 */
+		CMdENamespaceDef* GetNamespaceDefL( CMdENamespaceDef* aNamespaceDef );
+		
+    private: // data members
+
+		/**
+		*
+		*/
+		CMdESessionStartupAO* iSessionStartupAO;
+
+        /**
+        * array of observer notifier active objects
+        */
+        RPointerArray<CMdENotifierAO> iNotifiers;
+                
+		/** Open observer. */
+		MMdESessionObserver* iSessionObserver;
+		
+		RChunk iSchemaChunk;
+		
+		CMdCSerializationBuffer* iSchemaBuffer;
+		
+		RPointerArray<CMdENamespaceDef> iNamespaceDefs;
+		
+//		CMdeSessionStartTimer* iAsyncHandler;
+
+		TUint32 iNextQueryId;
+		
+	protected:
+	
+		enum TSessionState
+			{
+				EMdESessionClosed = 0,
+				EMdESessionOpen,
+				EMdESessionError,
+			};
+		TSessionState iSessionState;
+		
+		CMdeSessionStartTimer* iTimer;
+	};
+
+#endif  // __MDESESSIONIMPL_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/inc/mpxmedia.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,33 @@
+/*
+* 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*
+*/
+
+
+
+#include <platform/mw/mpxmedia.h>
+
+#include <mdesession.h>
+#include <mdequery.h>
+#include <harvesterclient.h>
+#include <mpxcollectionmessagedefs.h>
+#include <vcxmyvideosdefs.h>
+#include <e32property.h>
+#include "vcxmyvideosalbum.h"
+
+#define protected public
+#define private public
+#include "vcxmyvideosmdsdb.h"
+#undef private
+#undef protected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/inc/myvideostesttrap.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,74 @@
+/*
+* 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 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 MYVIDEOSTESTTRAP_H_
+
+#include <e32cmn.h>
+#undef TRAPD
+#undef TRAP_IGNORE
+
+#define TRAPD(_r, _s)                                       \
+    TInt _r;                                                \
+    {                                                       \
+    _r = 0;                                                 \
+    { TRAP_INSTRUMENTATION_START; }                         \
+    try {                                                   \
+        __WIN32SEHTRAP                                      \
+        TTrapHandler* ____t = User::MarkCleanupStack();     \
+        _s;                                                 \
+        User::UnMarkCleanupStack(____t);                    \
+        { TRAP_INSTRUMENTATION_NOLEAVE; }                   \
+        __WIN32SEHUNTRAP                                    \
+        }                                                   \
+    catch (XLeaveException& l)                              \
+        {                                                   \
+        _r = l.GetReason();                                 \
+        { TRAP_INSTRUMENTATION_LEAVE(_r); }                 \
+        }                                                   \
+                                                            \
+    __CALL_EMPTY_FUNCTION                                   \
+    { TRAP_INSTRUMENTATION_END; }                           \
+    }
+
+#define TRAP_IGNORE(_s)                                     \
+    {                                                       \
+    { TRAP_INSTRUMENTATION_START; }                         \
+    try {                                                   \
+        __WIN32SEHTRAP                                      \
+        TTrapHandler* ____t = User::MarkCleanupStack();     \
+        _s;                                                 \
+        User::UnMarkCleanupStack(____t);                    \
+        { TRAP_INSTRUMENTATION_NOLEAVE; }                   \
+        __WIN32SEHUNTRAP                                    \
+        }                                                   \
+    catch (XLeaveException& l)                              \
+        {                                                   \
+        l.GetReason();                                      \
+        { TRAP_INSTRUMENTATION_LEAVE(l.Reason()); }         \
+        }                                                   \
+                                                            \
+    __CALL_EMPTY_FUNCTION                                   \
+    { TRAP_INSTRUMENTATION_END; }                           \
+    }
+
+
+
+
+#define MYVIDEOSTESTTRAP_H_
+
+
+#endif /* MYVIDEOSTESTTRAP_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/inc/vcxmyvideosalbum.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,230 @@
+/*
+* 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 <e32std.h>
+#include <e32base.h>
+#include <mdesession.h>
+#include <mdequery.h>
+#include <harvesterclient.h>
+#include <mpxcollectionmessagedefs.h>
+#include <vcxmyvideosdefs.h>
+#include <e32property.h>
+
+typedef TInt TVcxMyVideosAlbumVideo;
+
+#define protected public
+#define private public
+#include "vcxmyvideosmdsdb.h"
+#undef private
+#undef protected
+
+
+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 );
+//
+//        /**
+//        * Set values.
+//        */
+//        void Set( TUint32 aMdsId, TUint32 aRelationMdsId, CMPXMedia* aVideo );
+//
+//        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<TUint32>& 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<TVcxMyVideosAlbumVideo> 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.
+     * 
+     * @param aStartIndex  Start position of the calculations in iVideoList.
+     *                     Can be used to update values when items are appended
+     *                     to old list, without calculating everything from scratch.
+     */
+    void CalculateAttributesL( TInt aStartIndex = 0 );
+    
+    /**
+     * Constructor for performing 1st stage construction
+     */
+    CVcxMyVideosAlbum( CVcxMyVideosCollectionPlugin& aCollectionPlugin );
+
+    /**
+     * EPOC default constructor for performing 2nd stage construction
+     */
+    void ConstructL();
+
+    CVcxMyVideosCollectionPlugin& iCollection;
+    
+    /**
+     * 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<TVcxMyVideosAlbumVideo> iVideoList;
+            
+    };
+
+#endif // CVCXMYVIDEOSALBUM_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/inc/vcxmyvideoscollectionutil.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,290 @@
+/*
+* 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 <vcxmyvideosdefs.h>
+
+// FORWARD DECLARATIONS
+class CMPXMedia;
+class RFs;
+
+#include "myvideostesttrap.h"
+
+// 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<TUint32>& 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<CMPXMedia*>& aFromArray,
+                CMPXMedia& aToList,
+                RArray<TUint32>& 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<TMPXAttribute>& 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 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<TUint32>& 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
+    };
+#endif   // VCXMYVIDEOSCOLLECTIONUTIL_H
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/inc/vcxmyvideosmdsalbums.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,541 @@
+/*
+* 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 <mdequery.h>
+#include <mpxmedia.h>
+
+#include <mdesession.h>
+#include <mdequery.h>
+#include <harvesterclient.h>
+#include <mpxcollectionmessagedefs.h>
+#include <vcxmyvideosdefs.h>
+#include <e32property.h>
+#include "vcxmyvideosalbum.h"
+
+#define protected public
+#define private public
+#include "vcxmyvideosmdsdb.h"
+#undef private
+#undef protected
+
+// FORWARD DECLARATIONS
+class CMPXMedia;
+class MVcxMyVideosMdsAlbumsObserver;
+
+// 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<TVcxMyVideosAlbumVideo>& 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<TUint32>& aRelationIds,
+                RArray<TUint32>& 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<TVcxMyVideosAlbumVideo>& 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<TUint32>& aRelationIds,
+                RArray<TUint32>& 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  <code>KErrNone</code>, 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  <code>KErrNone</code>, 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  <code>KErrNone</code>, 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  <code>KErrNone</code>, 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<TMdERelation>& aRelationArray);
+
+        /**
+         * From MMdERelationObserver
+         */
+        void HandleRelationNotification(CMdESession& aSession, 
+                TObserverNotificationType aType,
+                const RArray<TItemId>& 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<TVcxMyVideosAlbumVideo>* iAlbumContent;
+
+        /**
+         * The pending async operation ID is stored here.
+         */
+        TVcxAsyncOperation iAsyncOperation;
+
+        /**
+         * Used for storing items during async mds operations.
+         */
+        RPointerArray<CMdEInstanceItem> 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<TInt>* iResultArray;
+
+        /**
+         * Used in async operations to store
+         * pointer to result array (which is owned by the user). 
+         */
+        RArray<TUint32>* iResultArrayUint32;
+        
+        /**
+         * Used in async oprations (EVcxAddVideosToAlbum and EVcxRemoveVideosFromAlbum) to store
+         * pointer to item ID array (which is owned by the user). 
+         */
+        RArray<TUint32>* 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
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/inc/vcxmyvideosmdscmdqueue.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,343 @@
+/*
+* 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:   Queues commands to MDS.
+*/
+
+
+
+#ifndef VCXMYVIDEOSMDSCMDQUEUE_H
+#define VCXMYVIDEOSMDSCMDQUEUE_H
+
+// INCLUDES
+#include <vcxmyvideosdefs.h>
+
+#include <mdesession.h>
+#include <mdequery.h>
+#include <harvesterclient.h>
+#include <mpxcollectionmessagedefs.h>
+#include <vcxmyvideosdefs.h>
+#include <e32property.h>
+#include "vcxmyvideosalbum.h"
+
+#define protected public
+#define private public
+#include "vcxmyvideosmdsdb.h"
+#undef private
+#undef protected
+
+// FORWARD DECLARATIONS
+class CMPXMedia;
+class MVcxMyVideosMdsAlbumsObserver;
+
+// CONSTANTS
+
+// CLASS DECLARATION
+
+/**
+* All MDS commands inherit this.
+*
+* @lib mpxmyvideoscollectionplugin.lib
+*/
+NONSHARABLE_CLASS(CVcxMyVideosMdsCmd) : public CBase
+    {    
+    public:
+
+        /**
+        * Destructor
+        */
+        virtual ~CVcxMyVideosMdsCmd() {}
+        
+        /**
+        * Command type. Used for casting the pointer to correct type.
+        */
+        CVcxMyVideosMdsDb::TRequestType iCmdType;
+        
+        /**
+         * Pointer to client is stored here, used for performing response call.
+         */
+        MVcxMyVideosMdsAlbumsObserver* iClient;    
+    };
+
+/**
+* Class which encapsulates GetVideoListL function parameters.
+*
+* @lib mpxmyvideoscollectionplugin.lib
+*/
+NONSHARABLE_CLASS(CVcxMyVideosMdsCmdGetVideoList) : public CVcxMyVideosMdsCmd
+    {    
+    public:
+
+        /**
+        * Constructor
+        */
+        CVcxMyVideosMdsCmdGetVideoList() {}
+
+        /**
+        * Destructor
+        */
+        virtual ~CVcxMyVideosMdsCmdGetVideoList() {}
+
+    public:
+        /**
+        * Stored CreateVideoListL function parameters, see meanings from vcxmyvideosmdsdb.h file.
+        */
+        TVcxMyVideosSortingOrder iSortingOrder;
+        TBool                    iAscending;
+        TBool                    iFullDetails;
+        CMPXMedia**              iVideoList;
+    };
+
+/**
+* Class which stores GetAlbumsL function arguments.
+*
+* @lib mpxmyvideoscollectionplugin.lib
+*/
+NONSHARABLE_CLASS(CVcxMyVideosMdsCmdGetAlbums) : public CVcxMyVideosMdsCmd
+    {    
+    public: // Constructors and destructor
+
+        /**
+        * Constructor
+        */
+        CVcxMyVideosMdsCmdGetAlbums() {}
+
+        /**
+        * Destructor
+        */
+        virtual ~CVcxMyVideosMdsCmdGetAlbums() {}
+
+    public:
+        /**
+        * Stored GetAlbumsL function parameters, see meanings from vcxmyvideosmdsalbums.h file.
+        */
+        CMPXMedia* iAlbumList;
+    };
+
+/**
+* Class which stores GetAlbumContentIdsL function arguments.
+*
+* @lib mpxmyvideoscollectionplugin.lib
+*/
+NONSHARABLE_CLASS(CVcxMyVideosMdsCmdGetAlbumContentIds) : public CVcxMyVideosMdsCmd
+    {    
+    public: // Constructors and destructor
+
+        /**
+        * Constructor
+        */
+        CVcxMyVideosMdsCmdGetAlbumContentIds() {}
+
+        /**
+        * Destructor
+        */
+        virtual ~CVcxMyVideosMdsCmdGetAlbumContentIds() {}
+
+    public:
+        /**
+        * Stored GetAlbumContentL function parameters, see meanings from vcxmyvideosmdsalbums.h file.
+        */
+        TUint32                         iAlbumId;        
+        RArray<TVcxMyVideosAlbumVideo>* iAlbumContent; //not own
+    };
+
+/**
+* Class which stores GetAlbumContentVideosL function arguments.
+*
+* @lib mpxmyvideoscollectionplugin.lib
+*/
+NONSHARABLE_CLASS(CVcxMyVideosMdsCmdGetAlbumContentVideos) : public CVcxMyVideosMdsCmd
+    {    
+    public: // Constructors and destructor
+
+        /**
+        * Constructor
+        */
+        CVcxMyVideosMdsCmdGetAlbumContentVideos() {}
+
+        /**
+        * Destructor
+        */
+        virtual ~CVcxMyVideosMdsCmdGetAlbumContentVideos() {}
+
+    public:
+        /**
+        * Stored GetAlbumContentL function parameters, see meanings from vcxmyvideosmdsalbums.h file.
+        */
+        TUint32    iAlbumId;        
+        CMPXMedia* iAlbumContentVideos; //not own
+    };
+
+/**
+* Class which stores AddVideosToAlbumL function arguments.
+*
+* @lib mpxmyvideoscollectionplugin.lib
+*/
+NONSHARABLE_CLASS(CVcxMyVideosMdsCmdAddVideosToAlbum) : public CVcxMyVideosMdsCmd
+    {    
+    public: // Constructors and destructor
+
+        /**
+        * Constructor
+        */
+        CVcxMyVideosMdsCmdAddVideosToAlbum() {}
+
+        /**
+        * Destructor
+        */
+        virtual ~CVcxMyVideosMdsCmdAddVideosToAlbum() {}
+
+    public:
+        /**
+        * Stored AddVideosToAlbumL function parameters, see meanings from vcxmyvideosdefs.h
+        * KVcxCommandMyVideosAddToAlbum command descriptions.
+        */
+        CMPXMedia* iMpxCmd;
+    };
+
+/**
+* Class which stores RemoveRelationsL function arguments.
+*
+* @lib mpxmyvideoscollectionplugin.lib
+*/
+NONSHARABLE_CLASS(CVcxMyVideosMdsCmdRemoveRelations) : public CVcxMyVideosMdsCmd
+    {    
+    public: // Constructors and destructor
+
+        /**
+        * Constructor
+        */
+        CVcxMyVideosMdsCmdRemoveRelations() {}
+
+        /**
+        * Destructor
+        */
+        virtual ~CVcxMyVideosMdsCmdRemoveRelations() {}
+
+    public:
+        /**
+        * Stored RemoveRelationsL function parameters, see meanings from vcxmyvideosmdsalbums.h file.
+        */
+        RArray<TUint32>* iRelationIds; //not own
+        RArray<TUint32>* iResults;  //not own
+    };
+
+/**
+* Class which stores RemoveAlbumsL function arguments.
+*
+* @lib mpxmyvideoscollectionplugin.lib
+*/
+NONSHARABLE_CLASS(CVcxMyVideosMdsCmdRemoveAlbums) : public CVcxMyVideosMdsCmd
+    {    
+    public: // Constructors and destructor
+
+        /**
+        * Constructor
+        */
+        CVcxMyVideosMdsCmdRemoveAlbums() {}
+
+        /**
+        * Destructor
+        */
+        virtual ~CVcxMyVideosMdsCmdRemoveAlbums() {}
+
+    public:
+        /**
+        * Stored RemoveAlbumsL function parameters, see meanings from vcxmyvideosmdsalbums.h file.
+        */
+        CMPXMedia* iMpxCmd; //not own
+    };
+
+/**
+* Queues MDS commands.
+*
+* @lib mpxmyvideoscollectionplugin.lib
+*/
+NONSHARABLE_CLASS(CVcxMyVideosMdsCmdQueue) : public CBase
+    {    
+    public: // Constructors and destructor
+
+        /**
+        * Two-phased constructor
+        * @return object constructed
+        */
+        static CVcxMyVideosMdsCmdQueue* NewL( CVcxMyVideosMdsDb& aMdsDb );
+
+        /**
+        * Destructor
+        */
+        virtual ~CVcxMyVideosMdsCmdQueue();
+
+    public: // new methods
+        
+        /**
+        * Executes command if queue is empty, otherwise adds it to queue.
+        * Ownership of aCmd moves to this object.
+        *
+        * @param aCmd  Command to execute.
+        */
+        void ExecuteCmdL( CVcxMyVideosMdsCmd* aCmd );
+        
+        /**
+        * Called when command finishes. Executes next command from the queue.
+        */
+        void CmdFinished();
+        
+        /**
+         * Removes commands from command queue.
+         * 
+         * @param aType Defines what kind of commands are removed from the command queue.
+         */
+        void Cancel( CVcxMyVideosMdsDb::TRequestType aType = CVcxMyVideosMdsDb::EAll );
+                        
+    private:
+
+        /**
+        * Constructor
+        */
+        CVcxMyVideosMdsCmdQueue( CVcxMyVideosMdsDb& aMdsDb );
+
+        /**
+        * Symbian 2nd phase constructor.
+        */
+        void ConstructL();
+        
+        /**
+        * Executes the command.
+        *
+        * @param aCmd  Command to execute, ownership does not move.
+        */
+        void DoExecuteCmdL( CVcxMyVideosMdsCmd* aCmd );
+                    
+    private:
+        
+        /**
+        * Owner of this object.
+        */
+        CVcxMyVideosMdsDb& iMdsDb;
+        
+        /**
+        * Command queue. Own.
+        */
+        RArray<CVcxMyVideosMdsCmd*> iQueue;
+        
+        /**
+        * Set to ETrue when command is started and to EFalse
+        * when command finishes.
+        */
+        TBool iCmdInProgress;
+    };
+
+#endif   // VCXMYVIDEOSMDSCMDQUEUE_H
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/init/testframework.ini	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,169 @@
+#
+# This is STIFTestFramework initialization file 123
+# 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': Sret of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases' 
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.sd
+#
+# 	- 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.
+
+[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_mpxvideoplayertest
+
+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= stifmeasurementplugin04 
+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\VcxMyVideosMdsDbTest.cfg
+[End_Module]
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework 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.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+#CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+#HardwareBasePath=  C:\
+#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
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/src/VcxMyVideosMdsDbTest.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,211 @@
+/*
+* 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: This file contains testclass implementation.
+*
+*/
+
+// Version : %version: 1 %
+
+
+// INCLUDE FILES
+#include <StifTestInterface.h>
+#include "VcxMyVideosMdsDbTest.h"
+#include <SettingServerClient.h>
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// GLOBAL
+CVcxMyVideosMdsDbTest* test;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosMdsDbTest::CVcxMyVideosMdsDbTest
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CVcxMyVideosMdsDbTest::CVcxMyVideosMdsDbTest( 
+    CTestModuleIf& aTestModuleIf ):
+        CScriptBase( aTestModuleIf )
+    {
+    test = this;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosMdsDbTest::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsDbTest::ConstructL()
+    {
+    User::LeaveIfError ( iFs.Connect() );
+    
+    //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(KVcxMyVideosMdsDbTestLogFileWithTitle, &title);
+        }
+    else
+        {
+        logFileName.Copy(KVcxMyVideosMdsDbTestLogFile);
+        }
+
+    iLog = CStifLogger::NewL( KVcxMyVideosMdsDbTestLogPath, 
+                          logFileName,
+                          CStifLogger::ETxt,
+                          CStifLogger::EFile,
+                          EFalse );
+    
+    SendTestClassVersion();
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosMdsDbTest::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CVcxMyVideosMdsDbTest* CVcxMyVideosMdsDbTest::NewL( 
+    CTestModuleIf& aTestModuleIf )
+    {
+    CVcxMyVideosMdsDbTest* self = new (ELeave) CVcxMyVideosMdsDbTest( aTestModuleIf );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+
+    }
+
+// Destructor
+CVcxMyVideosMdsDbTest::~CVcxMyVideosMdsDbTest()
+    { 
+
+    // Delete resources allocated from test methods
+    Delete();
+
+    // Delete logger
+    delete iLog; 
+
+    iFs.Close();
+    }
+
+//-----------------------------------------------------------------------------
+// CVcxMyVideosMdsDbTest::SendTestClassVersion
+// Method used to send version of test class
+//-----------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsDbTest::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("VcxMyVideosMdsDbTest.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 ) // Backpointer to STIF Test Framework
+    {
+
+    return ( CScriptBase* ) CVcxMyVideosMdsDbTest::NewL( aTestModuleIf );
+
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/src/VcxMyVideosMdsDbTestBlocks.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,489 @@
+/*
+* 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: This file contains testclass implementation.
+*
+*/
+
+// Version : %version: 7 %
+
+// [INCLUDE FILES] - do not remove
+#include <e32svr.h>
+#include <StifParser.h>
+#include <StifTestInterface.h>
+
+#include <mpxlog.h>
+#include <mdeconstants.h>
+#include <mdequery.h>
+#include <bautils.h>
+#include <mpxmedia.h>
+#include <vcxmyvideosdefs.h>
+#include <mpxmediacontainerdefs.h>
+#include <mpxmediageneraldefs.h>
+#include <mpxmediageneralextdefs.h>
+#include <mpxmediaarray.h>
+#include <mpxmediavideodefs.h>
+#include <centralrepository.h>
+
+#include <mdesession.h>
+#include <mdequery.h>
+#include <harvesterclient.h>
+#include <mpxcollectionmessagedefs.h>
+#include <vcxmyvideosdefs.h>
+#include <e32property.h>
+#include "vcxmyvideosalbum.h"
+
+#define protected public
+#define private public
+#include "vcxmyvideosmdsdb.h"
+#undef private
+#undef protected
+
+#include "vcxmyvideoscollectionutil.h"
+
+
+#include "VcxMyVideosMdsDbTest.h"
+
+
+        
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+
+TInt NextIntOrZero( CStifItemParser& aItem ) 
+    {
+    TInt a ( 0 );
+    if ( !aItem.GetNextInt( a ) )
+        {
+        return a;
+        }
+    else
+        {
+        return 0;
+        }
+    }
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosMdsDbTest::Delete
+// Delete here all resources allocated and opened from test methods. 
+// Called from destructor. 
+// -----------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsDbTest::Delete() 
+    {
+    delete iVideoList;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxMyVideosMdsDbTest::RunMethodL
+// Run specified method. Contains also table of test mothods and their names.
+// -----------------------------------------------------------------------------
+//
+TInt CVcxMyVideosMdsDbTest::RunMethodL( 
+    CStifItemParser& aItem ) 
+    {
+
+    static TStifFunctionInfo const KFunctions[] =
+        {  
+        ENTRY( "CreateL", CVcxMyVideosMdsDbTest::CreateL ),
+        ENTRY( "DeleteL", CVcxMyVideosMdsDbTest::DeleteL ),
+        ENTRY( "CancelL", CVcxMyVideosMdsDbTest::CancelL ),
+        ENTRY( "AddVideoL", CVcxMyVideosMdsDbTest::AddVideoL ),
+        ENTRY( "RemoveVideoL", CVcxMyVideosMdsDbTest::RemoveVideoL ),
+        ENTRY( "UpdateVideoL", CVcxMyVideosMdsDbTest::UpdateVideoL ),
+        ENTRY( "CreateVideoListL", CVcxMyVideosMdsDbTest::CreateVideoListL ),
+        ENTRY( "DoCreateVideoListL", CVcxMyVideosMdsDbTest::DoCreateVideoListL ),
+        ENTRY( "CreateVideoL", CVcxMyVideosMdsDbTest::CreateVideoL ),
+        ENTRY( "HandleQueryNewResultsL", CVcxMyVideosMdsDbTest::HandleQueryNewResultsL ),
+        ENTRY( "HandleQueryCompletedL", CVcxMyVideosMdsDbTest::HandleQueryCompletedL ),
+        ENTRY( "AsyncHandleQueryCompletedL", CVcxMyVideosMdsDbTest::AsyncHandleQueryCompletedL ),
+        ENTRY( "HandleSessionErrorL", CVcxMyVideosMdsDbTest::HandleSessionErrorL ),
+        ENTRY( "HandleObjectNotificationL", CVcxMyVideosMdsDbTest::HandleObjectNotificationL ),
+        ENTRY( "HandleObjectPresentNotification", CVcxMyVideosMdsDbTest::HandleObjectPresentNotification ),
+        ENTRY( "ShutdownNotificationL", CVcxMyVideosMdsDbTest::ShutdownNotificationL ),
+
+        };
+
+    const TInt count = sizeof( KFunctions ) / 
+                        sizeof( TStifFunctionInfo );
+
+    return RunInternalL( KFunctions, count, aItem );
+
+    }
+
+TInt CVcxMyVideosMdsDbTest::CreateL( CStifItemParser& aItem )
+    {
+    int a ( 0 );
+    
+    if ( !aItem.GetNextInt( a ) )
+        {
+        mdssessionerror = a;
+        }
+    
+    if ( !aItem.GetNextInt( a ) )
+        {
+        mdssessionasyncerror = a;
+        }
+    
+    iMdsDb = CVcxMyVideosMdsDb::NewL( this, iFs );
+    
+    return KErrNone;
+    }
+
+TInt CVcxMyVideosMdsDbTest::DeleteL( CStifItemParser& )
+    {
+    delete iMdsDb;
+    return KErrNone;
+    }
+
+TInt CVcxMyVideosMdsDbTest::CancelL( CStifItemParser& aItem )
+    {
+    TInt type = NextIntOrZero( aItem );
+    iMdsDb->Cancel( ( CVcxMyVideosMdsDb::TRequestType ) type );
+    return KErrNone;
+    }
+
+TInt CVcxMyVideosMdsDbTest::AddVideoL( CStifItemParser& aItem )
+    {
+    mdsoperationreturns = NextIntOrZero( aItem );
+    mdsoperationleaves  = NextIntOrZero( aItem );
+    TBool setMimeType   = NextIntOrZero( aItem ) ;
+    propertynotdefined  = NextIntOrZero( aItem );
+    propertyisnull      = NextIntOrZero( aItem );
+    TBool setAttrs      = NextIntOrZero( aItem ) ;
+    
+    CMPXMedia* media  = CMPXMedia::NewL();
+    CleanupStack::PushL( media );
+    TUint32 mdsId;
+    
+    media->SetTextValueL( KMPXMediaGeneralUri, _L("c:\\data\\videos\\addtest1.mp4") );
+    
+    if ( setAttrs )
+        {
+        media->SetTextValueL( KMPXMediaGeneralTitle, _L("KMPXMediaGeneralTitle") );
+        media->SetTextValueL( KMPXMediaGeneralComment, _L("KMPXMediaGeneralComment") );
+        media->SetTObjectValueL<TInt>( KMPXMediaGeneralSize, 100 );
+        media->SetTObjectValueL<TInt64>( KMPXMediaGeneralDate, 1465324313154 );
+        media->SetTObjectValueL<TUint32>( KMPXMediaGeneralFlags, 10 );
+        media->SetTextValueL( KMPXMediaGeneralCopyright, _L("Copyright info") );    
+        media->SetTObjectValueL<TInt>( KMPXMediaGeneralLastPlaybackPosition, 13232 );
+        media->SetTObjectValueL<TInt64>( KVcxMediaMyVideosModifiedDate, 1465324313154 );
+        media->SetTObjectValueL<TInt64>( KVcxMediaMyVideosAgeProfile, 18 );
+        media->SetTextValueL( KVcxMediaMyVideosAudioLanguage, _L("Audio language") );
+        media->SetTextValueL( KVcxMediaMyVideosAuthor, _L("Author") );
+        media->SetTObjectValueL<TUint8>( KVcxMediaMyVideosOrigin, 1 );
+        media->SetTObjectValueL<TReal32>( KVcxMediaMyVideosDuration, 1212 );
+        media->SetTObjectValueL<TUint32>( KVcxMediaMyVideosDownloadId, 0 );
+        media->SetTObjectValueL<TUint8>( KVcxMediaMyVideosRating, 1 );
+        media->SetTObjectValueL<TInt>( KVcxMediaMyVideosDownloadError, -1 );
+        media->SetTObjectValueL<TInt>( KVcxMediaMyVideosDownloadGlobalError, -2 );
+        media->SetTObjectValueL<TUint16>( KMPXMediaVideoBitRate, 1235 );
+        media->SetTObjectValueL<TUint16>( KMPXMediaVideoWidth, 15 );
+        media->SetTObjectValueL<TUint16>( KMPXMediaVideoHeight, 12 );
+        media->SetTObjectValueL<TUint32>( KVcxMediaMyVideosAudioFourCc, 0 );
+        media->SetTObjectValueL<TUint32>( KVcxMediaMyVideosAudioFourCc, 0 );
+        media->SetTextValueL( KMPXMediaVideoArtist, _L("artist") );
+        media->SetTObjectValueL<TInt64>( KMPXMediaGeneralExtSizeInt64, 123456 );
+        }
+
+    if ( setMimeType )
+        {
+        media->SetTextValueL( KMPXMediaGeneralMimeType, _L("Mime type") );    
+        }
+    
+    iMdsDb->AddVideoL( *media, mdsId );
+    
+    CleanupStack::PopAndDestroy( media );
+    
+    return KErrNone;
+    }
+
+TInt CVcxMyVideosMdsDbTest::RemoveVideoL( CStifItemParser& aItem )
+    {
+    mdsoperationreturns = NextIntOrZero( aItem );
+    mdsoperationleaves  = NextIntOrZero( aItem );
+    TInt id             = NextIntOrZero( aItem );
+
+    return iMdsDb->RemoveVideo( id );
+    }
+
+TInt CVcxMyVideosMdsDbTest::UpdateVideoL( CStifItemParser& aItem )
+    {
+    mdsoperationreturns = NextIntOrZero( aItem );
+    mdsoperationleaves  = NextIntOrZero( aItem );
+    mdeobjectopenresult = NextIntOrZero( aItem );
+    
+    CMPXMedia* media  = CMPXMedia::NewL();
+    CleanupStack::PushL(media);
+    //1. MPX ID, set by collection
+    //2
+    media->SetTextValueL( KMPXMediaGeneralTitle, _L("Titteli") );
+    //3
+    media->SetTextValueL( KMPXMediaGeneralComment, _L("Desciä") );
+    //4
+    media->SetTextValueL( KMPXMediaGeneralUri, _L("c:\\data\\videos\\addtest1.mp4") );
+    //5
+    media->SetTObjectValueL<TInt>( KMPXMediaGeneralSize, 100 );
+    //6 Creation date
+    TTime time;
+    time.HomeTime();
+    media->SetTObjectValueL<TInt64>( KMPXMediaGeneralDate, time.Int64() );
+    //7
+    TUint32 flags = EVcxMyVideosVideoDrmProtected || EVcxMyVideosVideoNew;
+    media->SetTObjectValueL<TUint32>( KMPXMediaGeneralFlags, flags );
+    //8
+    media->SetTextValueL( KMPXMediaGeneralCopyright, _L("Copyright info") );    
+    //9
+    media->SetTextValueL( KMPXMediaGeneralMimeType, _L("Mime type") );    
+    //10
+    TInt lastPlaybackPos( 13232 );
+    media->SetTObjectValueL<TInt>( KMPXMediaGeneralLastPlaybackPosition, lastPlaybackPos );
+    //11
+    media->SetTObjectValueL<TInt64>( KVcxMediaMyVideosModifiedDate, time.Int64() );    
+    //12
+    media->SetTObjectValueL<TInt64>( KVcxMediaMyVideosAgeProfile, 18 );
+    //13
+    media->SetTextValueL( KVcxMediaMyVideosAudioLanguage, _L("Audio language") );
+    //14
+    media->SetTextValueL( KVcxMediaMyVideosAuthor, _L("Author") );
+    //15
+    media->SetTObjectValueL<TUint8>( KVcxMediaMyVideosOrigin, 1 );
+    //16
+    TReal32 duration( 1212 );
+    media->SetTObjectValueL<TReal32>( KVcxMediaMyVideosDuration, duration );
+    //17
+    media->SetTObjectValueL<TUint32>( KVcxMediaMyVideosDownloadId, 0 );
+    //18
+    media->SetTObjectValueL<TUint8>( KVcxMediaMyVideosRating, 1 );
+
+    media->SetTObjectValueL<TInt>( KVcxMediaMyVideosDownloadError, -1 );
+    
+    media->SetTObjectValueL<TInt>( KVcxMediaMyVideosDownloadGlobalError, -2 );
+    
+    iMdsDb->UpdateVideoL( *media );
+    
+    CleanupStack::PopAndDestroy( media );
+    
+    return KErrNone;
+    }
+
+TInt CVcxMyVideosMdsDbTest::CreateVideoListL( CStifItemParser& )
+    {    
+    TVcxMyVideosSortingOrder sortingorder = ( TVcxMyVideosSortingOrder ) 0;
+
+    CMPXMedia* videoList( NULL );
+    CMPXMedia* localvideoList( NULL );
+    CMPXMediaArray* mediaArray( NULL );
+                        
+   
+    iMdsDb->CreateVideoListL( sortingorder, 0, 0, videoList );
+    
+    return KErrNone;
+    }
+
+TInt CVcxMyVideosMdsDbTest::DoCreateVideoListL( CStifItemParser& aItem )
+    {
+    TBool bitmask = NextIntOrZero( aItem );
+    TBool storelist = NextIntOrZero( aItem );
+    
+    TBool ascending                       = bitmask & 0x01;
+    TBool fullDetails                     = bitmask & 0x02;
+    TBool docreate                        = bitmask & 0x04;
+    TBool fetchongoing                    = bitmask & 0x08;
+    
+    TVcxMyVideosSortingOrder sortingorder = ( TVcxMyVideosSortingOrder ) ( bitmask >> 4 );
+
+    CMPXMedia* videoList( NULL );
+    CMPXMedia* localvideoList( NULL );
+    CMPXMediaArray* mediaArray( NULL );
+                        
+    if ( docreate )
+        {
+        localvideoList = CMPXMedia::NewL();
+        CleanupStack::PushL( localvideoList );
+        mediaArray = CMPXMediaArray::NewL();
+        CleanupStack::PushL( mediaArray );
+        localvideoList->SetCObjectValueL<CMPXMediaArray>( KMPXMediaArrayContents, mediaArray );
+        CleanupStack::PopAndDestroy( mediaArray );
+        
+        videoList = localvideoList;
+        }
+    
+    if ( fetchongoing )
+        {
+        iMdsDb->DoCreateVideoListL( sortingorder, ascending, fullDetails, videoList );
+        iMdsDb->iVideoListFetchingIsOngoing = fetchongoing;
+        }
+    
+    iMdsDb->DoCreateVideoListL( sortingorder, ascending, fullDetails, videoList );
+    
+    if ( docreate )
+        {
+        CleanupStack::PopAndDestroy( localvideoList );
+        }
+    else if ( storelist )
+        {
+        iVideoList = videoList;
+        }
+    else
+        {
+        delete videoList;
+        }
+    
+    return KErrNone;
+    }
+
+TInt CVcxMyVideosMdsDbTest::CreateVideoL( CStifItemParser& aItem )
+    {
+    mdsoperationreturns = NextIntOrZero( aItem );
+    mdsoperationleaves  = NextIntOrZero( aItem );
+    TBool fulldetails   = NextIntOrZero( aItem );
+    TUint32 id          = NextIntOrZero( aItem );
+    
+    CMPXMedia* media ( NULL );
+    media = iMdsDb->CreateVideoL( id, fulldetails );
+    delete media;
+    return KErrNone;
+    }
+
+TInt CVcxMyVideosMdsDbTest::HandleQueryNewResultsL( CStifItemParser& aItem )
+    {
+    querycountresult        = NextIntOrZero( aItem );
+    propertyisnull          = NextIntOrZero( aItem );
+    propertynotdefined      = NextIntOrZero( aItem );
+    handledbeventleave      = NextIntOrZero( aItem );
+    
+    TInt firstnewitemindex  = NextIntOrZero( aItem );
+    TInt newitemcount       = NextIntOrZero( aItem );
+
+    
+    iMdsDb->HandleQueryNewResults( *(CMdEQuery*) NULL, firstnewitemindex, newitemcount );
+
+    return KErrNone;
+    }
+
+TInt CVcxMyVideosMdsDbTest::HandleQueryCompletedL( CStifItemParser&  )
+    {
+    CMdEQuery* query ( NULL );
+    iMdsDb->HandleQueryCompleted( *query, 0 );
+    return KErrNone;
+    }
+
+TInt CVcxMyVideosMdsDbTest::AsyncHandleQueryCompletedL( CStifItemParser&  aItem )
+    {
+    TInt a = NextIntOrZero( aItem );
+    TInt b = NextIntOrZero( aItem );
+    TInt ret = CVcxMyVideosMdsDb::AsyncHandleQueryCompleted( iMdsDb );
+    return KErrNone;
+    }
+
+TInt CVcxMyVideosMdsDbTest::HandleSessionErrorL( CStifItemParser& aItem )
+    {
+    iMdsDb->iVideoListFetchingIsOngoing = NextIntOrZero( aItem );
+    TUint32 err = NextIntOrZero( aItem );
+    
+    CMdESession* cmdesession ( NULL );
+    iMdsDb->HandleSessionError( *cmdesession, err );
+    return KErrNone;
+    }
+
+TInt CVcxMyVideosMdsDbTest::HandleObjectNotificationL( CStifItemParser& aItem )
+    {
+    TInt notificationtype = NextIntOrZero( aItem );
+    handledbeventleave    = NextIntOrZero( aItem );
+    
+    RArray<TItemId> ids;
+    ids.Append( 0 );
+    ids.Append( 1 );
+    ids.Append( 2 );
+    
+    iMdsDb->HandleObjectNotification( *(CMdESession*)0, ( TObserverNotificationType )notificationtype, ids );
+    return KErrNone;
+    }
+
+TInt CVcxMyVideosMdsDbTest::HandleObjectPresentNotification( CStifItemParser& aItem )
+    {
+    TInt a = NextIntOrZero( aItem );
+    CMdESession* cmdesession ( NULL );
+    RArray<TItemId> ids;
+    ids.Append( 0 );
+    ids.Append( 1 );
+    ids.Append( 2 );
+    handledbeventleave = NextIntOrZero(aItem);
+    iMdsDb->HandleObjectPresentNotification( *cmdesession, a, ids );
+    return KErrNone;
+    }
+
+TInt CVcxMyVideosMdsDbTest::ShutdownNotificationL( CStifItemParser& aItem )
+    {
+    TInt a = NextIntOrZero( aItem );
+    iMdsDb->ShutdownNotification( a );
+    return KErrNone;
+    }
+
+void CVcxMyVideosMdsDbTest::PrepareMdsL(  CStifItemParser& aItem  ) 
+    {
+    mdsoperationreturns = NextIntOrZero( aItem );
+    mdsoperationleaves  = NextIntOrZero( aItem );
+    }
+
+void CVcxMyVideosMdsDbTest::HandleMyVideosDbEvent( TMPXChangeEventType , RArray<TUint32>&, TInt )
+    {
+    if ( handledbeventleave )
+        {
+        User::Leave( handledbeventleave );
+        }
+    }
+
+void CVcxMyVideosMdsDbTest::HandleCreateVideoListResp( CMPXMedia* aVideoList, TInt aNewItemsStartIndex, TBool aComplete )
+    {
+    if ( handledbeventleave )
+        {
+        User::Leave( handledbeventleave );
+        }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/src/mdeinstanceitem.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,37 @@
+/*
+* 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:  ?Description
+*
+*/
+
+
+#include "mdeinstanceitem.h"
+
+
+CMdEInstanceItem::CMdEInstanceItem(CMdESession* aSession, TItemId aId)
+		: CMdEItem(aSession, aId)
+	{
+	}
+
+
+void CMdEInstanceItem::InstanceItemBaseConstruct()
+	{
+	ItemBaseConstruct();
+	}
+
+
+CMdEInstanceItem::~CMdEInstanceItem()
+	{
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/src/mdeitem.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,71 @@
+/*
+* 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:  ?Description
+*
+*/
+
+
+#include "mdeitem.h"
+
+
+CMdEItem::CMdEItem(CMdESession* aSession, TItemId aId)
+		: iSession(aSession), iId(aId)
+	{
+	}
+
+
+void CMdEItem::ItemBaseConstruct()
+	{
+	}
+
+
+CMdEItem::~CMdEItem()
+	{
+	}
+
+
+EXPORT_C TBool CMdEItem::BelongsToSession() const
+	{
+	}
+
+
+EXPORT_C CMdESession& CMdEItem::Session() const
+	{
+	}
+
+
+void CMdEItem::CheckSession() const
+	{
+	}
+
+
+void CMdEItem::SetSession(CMdESession& aSession)
+	{
+	}
+
+
+EXPORT_C TBool CMdEItem::InDatabase() const
+	{
+	}
+
+
+EXPORT_C TItemId CMdEItem::Id() const
+	{
+	}
+
+
+void CMdEItem::SetId(TItemId aId)
+	{
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/src/mdenamespacedef.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,117 @@
+/*
+* 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:  ?Description
+*
+*/
+
+
+#include "mdenamespacedef.h"
+
+#include "mdeobjectdef.h"
+#include "mderelationdef.h"
+#include "mdeeventdef.h"
+
+CMdENamespaceDef::CMdENamespaceDef( const CMdESession& aMdeSession, 
+		const TMdCNamespaceDef& aNamespaceDef )
+	: iMdeSession( aMdeSession ), iNamespaceDef( aNamespaceDef )
+	{
+	}
+
+CMdENamespaceDef* CMdENamespaceDef::NewL( const CMdESession& aMdeSession, 
+		const TMdCNamespaceDef& aNamespaceDef, 
+		CMdCSerializationBuffer& aSchemaBuffer )
+	{
+    }
+
+CMdENamespaceDef* CMdENamespaceDef::NewLC( const CMdESession& aMdeSession, 
+		const TMdCNamespaceDef& aNamespaceDef, 
+		CMdCSerializationBuffer& aSchemaBuffer )
+	{
+	}
+
+void CMdENamespaceDef::ConstructL(CMdCSerializationBuffer& aSchemaBuffer)
+	{
+	}
+
+CMdENamespaceDef::~CMdENamespaceDef()
+	{
+	}
+
+TDefId CMdENamespaceDef::Id() const
+	{
+	}
+
+EXPORT_C TBool CMdENamespaceDef::ReadOnly() const
+	{
+	}
+
+EXPORT_C const TDesC& CMdENamespaceDef::Name() const
+	{
+	}
+
+EXPORT_C TInt CMdENamespaceDef::Compare( const CMdENamespaceDef& aNamespaceDef ) const
+	{
+	}
+
+EXPORT_C TInt CMdENamespaceDef::ObjectDefCount() const
+	{
+	}
+
+EXPORT_C CMdEObjectDef& CMdENamespaceDef::ObjectDefL(TInt aIndex)
+	{
+	}
+
+EXPORT_C CMdEObjectDef& CMdENamespaceDef::GetObjectDefL(const TDesC& aName)
+	{
+	}
+
+CMdEObjectDef* CMdENamespaceDef::GetObjectDefL(TDefId aId)
+	{
+	}
+
+EXPORT_C TInt CMdENamespaceDef::RelationDefCount() const
+	{
+	}
+
+EXPORT_C CMdERelationDef& CMdENamespaceDef::RelationDefL(TInt aIndex)
+	{
+	}
+
+EXPORT_C CMdERelationDef& CMdENamespaceDef::GetRelationDefL(const TDesC& aName)
+	{
+	}
+
+CMdERelationDef* CMdENamespaceDef::GetRelationDefL(TDefId aId)
+	{
+	}
+
+EXPORT_C TInt CMdENamespaceDef::EventDefCount() const
+	{
+	}
+
+EXPORT_C CMdEEventDef& CMdENamespaceDef::EventDefL(TInt aIndex)
+	{
+	}
+
+EXPORT_C CMdEEventDef& CMdENamespaceDef::GetEventDefL(const TDesC& aName)
+	{
+	}
+
+CMdEEventDef* CMdENamespaceDef::GetEventDefL(TDefId aId)
+	{
+	}
+
+const CMdESession& CMdENamespaceDef::Session() const
+	{
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/src/mdeobject.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,350 @@
+/*
+* 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:  ?Description
+*
+*/
+
+
+#include <mdeobject.h>
+
+#include <mdeproperty.h>
+#include <mdeobjectdef.h>
+#include <mdenamespacedef.h>
+#include <mdesession.h>
+
+#include "VcxMyVideosMdsDbTest.h"
+
+//////////////////////////////
+//                          //
+//        TMdEObject        //
+//                          //
+//////////////////////////////
+
+EXPORT_C TMdEObject::TMdEObject() : 
+	iDef( NULL )
+	{
+	}
+
+EXPORT_C TItemId TMdEObject::Id() const
+	{
+	}
+
+EXPORT_C const CMdEObjectDef& TMdEObject::DefL() const
+	{
+	}
+
+EXPORT_C TBool TMdEObject::Confidential() const
+	{
+	}
+
+EXPORT_C TBool TMdEObject::Placeholder() const
+	{
+	}
+
+EXPORT_C TBool TMdEObject::Removed() const
+	{
+	}
+
+EXPORT_C TBool TMdEObject::NotPresent() const
+	{
+	}
+
+TUint32 TMdEObject::RequiredBufferSize()
+	{
+	}
+
+void TMdEObject::DeSerializeL(CMdCSerializationBuffer& aBuffer, 
+		CMdENamespaceDef& aNamespaceDef)
+	{
+	}
+
+//////////////////////////////
+//                          //
+//        CMdEObject        //
+//                          //
+//////////////////////////////
+
+CMdEObject* CMdEObject::NewL( CMdEObjectDef& aDef, const TDesC& aUri, TUint32 aMediaId )
+	{
+    CMdEObject* nev = new CMdEObject(NULL,aMediaId,aDef);
+    return nev;
+	}
+
+CMdEObject* CMdEObject::NewLC( CMdEObjectDef& aDef, const TDesC& aUri, TUint32 aMediaId )
+	{
+    CMdEObject* nev = new CMdEObject(NULL,aMediaId,aDef);
+    CleanupStack::PushL( nev );
+    return nev;
+	}
+
+CMdEObject::CMdEObject(CMdESession* aSession, TItemId aId, CMdEObjectDef& aDef)
+		: CMdEInstanceItem( aSession, aId), iDef( &aDef )
+	{
+	}
+
+void CMdEObject::ConstructL( const TDesC& aUri, TUint32 aMediaId )
+	{
+   	}
+
+CMdEObject::~CMdEObject()
+	{
+    delete iProperty;
+	}
+
+EXPORT_C CMdEObjectDef& CMdEObject::Def() const
+	{
+	}
+
+EXPORT_C void CMdEObject::SetDefL(CMdEObjectDef& aDef)
+	{
+	}
+
+EXPORT_C const TDesC& CMdEObject::Uri() const
+	{
+    return KNullDesC();
+	}
+
+EXPORT_C void CMdEObject::SetUriL(const TDesC& aUri)
+	{
+	}
+
+EXPORT_C TUint32 CMdEObject::MediaId() const
+	{
+	}
+
+EXPORT_C void CMdEObject::SetMediaId(TUint32 aMediaId)
+	{
+	}
+
+EXPORT_C TUint32 CMdEObject::UsageCount() const
+	{
+	}
+
+EXPORT_C void CMdEObject::Guid( TInt64& aGuidHigh, TInt64& aGuidLow ) const
+	{
+	}
+	
+EXPORT_C void CMdEObject::SetGuid( const TInt64& aGuidHigh, const TInt64& aGuidLow )
+	{
+	}
+
+
+EXPORT_C TBool CMdEObject::Confidential() const
+	{
+	}
+
+EXPORT_C void CMdEObject::SetConfidential( TBool aValue )
+	{
+    
+	}
+
+EXPORT_C TBool CMdEObject::Placeholder() const
+	{
+	}
+
+EXPORT_C void CMdEObject::SetPlaceholder( TBool aValue )
+	{
+	}
+
+void CMdEObject::DoSetUriL(const TDesC& aUri)
+	{
+	}
+
+EXPORT_C TInt CMdEObject::PropertyCount() const
+	{
+	}
+
+EXPORT_C CMdEProperty& CMdEObject::PropertyL(TInt aIndex) const
+	{
+	}
+
+EXPORT_C TInt CMdEObject::PropertyCount(const CMdEPropertyDef& aDef) const
+	{
+	}
+
+EXPORT_C TInt CMdEObject::Property(const CMdEPropertyDef& aDef, CMdEProperty*& aProperty, TInt aStartAt) const
+    {
+    if ( test->propertynotdefined )
+        {
+        return KErrNotFound;
+        }
+    if( !iProperty )
+        {
+        iProperty = new CMdEProperty();
+        }
+    
+    if ( test->propertyisnull )
+        {
+        aProperty = NULL;
+        }
+    }
+    
+EXPORT_C CMdEProperty& CMdEObject::AddBoolPropertyL(CMdEPropertyDef& aDef, TBool aValue)
+	{
+
+	}
+
+EXPORT_C CMdEProperty& CMdEObject::AddInt8PropertyL(CMdEPropertyDef& aDef, TInt8 aValue)
+	{
+	}
+
+EXPORT_C CMdEProperty& CMdEObject::AddUint8PropertyL(CMdEPropertyDef& aDef, TUint8 aValue)
+	{
+	}
+
+EXPORT_C CMdEProperty& CMdEObject::AddInt16PropertyL(CMdEPropertyDef& aDef, TInt16 aValue)
+	{
+	}
+
+EXPORT_C CMdEProperty& CMdEObject::AddUint16PropertyL(CMdEPropertyDef& aDef, TUint16 aValue)
+	{
+	}
+
+EXPORT_C CMdEProperty& CMdEObject::AddInt32PropertyL(CMdEPropertyDef& aDef, TInt32 aValue)
+	{
+	}
+
+EXPORT_C CMdEProperty& CMdEObject::AddUint32PropertyL(CMdEPropertyDef& aDef, TUint32 aValue)
+	{
+	}
+
+EXPORT_C CMdEProperty& CMdEObject::AddInt64PropertyL(CMdEPropertyDef& aDef, TInt64 aValue)
+	{
+	}
+
+EXPORT_C CMdEProperty& CMdEObject::AddReal32PropertyL(CMdEPropertyDef& aDef, TReal32 aValue)
+	{
+	}
+
+EXPORT_C CMdEProperty& CMdEObject::AddReal64PropertyL(CMdEPropertyDef& aDef, TReal64 aValue)
+	{
+	}
+
+EXPORT_C CMdEProperty& CMdEObject::AddTextPropertyL(CMdEPropertyDef& aDef, const TDesC& aValue)
+	{
+	}
+
+EXPORT_C CMdEProperty& CMdEObject::AddTimePropertyL(CMdEPropertyDef& aDef, TTime aValue)
+	{
+
+	}
+
+void CMdEObject::DoAddPropertyL(CMdEProperty& aProperty)
+	{
+	}
+
+EXPORT_C void CMdEObject::RemoveProperty(TInt aIndex)
+	{
+	}
+
+TInt CMdEObject::CompareProperties(const CMdEProperty& aFirst, const CMdEProperty& aSecond)
+	{
+	}
+
+EXPORT_C TInt CMdEObject::FreeTextCount() const
+	{
+	return iFreeTextArray.Count();
+	}
+
+EXPORT_C TPtrC CMdEObject::FreeText(TInt aIndex) const
+	{
+	return *iFreeTextArray[aIndex];
+	}
+
+EXPORT_C TInt CMdEObject::FreeTextIndex(const TDesC& aFreeText) const
+	{
+	}
+
+EXPORT_C void CMdEObject::AddFreeTextL(const TDesC& aFreeText)
+	{
+	}
+
+TInt CMdEObject::DoAddFreeTextL(const HBufC& aFreeText)
+	{
+	}
+
+EXPORT_C void CMdEObject::RemoveFreeText(TInt aIndex)
+	{
+	}
+
+TInt CMdEObject::CompareFreeTexts(const HBufC& aFirst, const HBufC& aSecond)
+	{
+	}
+
+EXPORT_C void CMdEObject::MovePropertiesL(CMdEObject& aObject)
+	{
+	}
+
+
+TBool CMdEObject::ObjectModified() const
+    {
+    }
+
+TBool CMdEObject::FreeTextModified() const
+    {
+    }
+
+TBool CMdEObject::PropertyModified() const
+    {
+    }
+
+void CMdEObject::AutoLockL() const
+	{
+	}
+
+EXPORT_C TBool CMdEObject::OpenForModifications() const
+	{
+    if ( test->mdeobjectopenresult )
+        {
+        return EFalse;
+        }
+    else
+        {
+        return ETrue;
+        }
+	}
+
+void CMdEObject::ClearObject( TBool aClearFlags )
+	{
+	}
+
+void CMdEObject::SetNotOpenForModifications()
+	{
+	}
+
+TUint32 CMdEObject::ModifiedPropertiesCount() const
+	{
+	}
+
+TUint32 CMdEObject::RequiredBufferSize() const
+	{
+	}
+
+TMdCOffset CMdEObject::SerializeL(CMdCSerializationBuffer& aBuffer, TMdCOffset aFreespaceOffset) const
+	{
+	}
+
+CMdEObject* CMdEObject::NewL( CMdESession* aSession, CMdCSerializationBuffer& aBuffer, CMdENamespaceDef& aNamespaceDef )
+	{
+	}
+
+
+CMdEObject* CMdEObject::NewLC( CMdESession* aSession, CMdCSerializationBuffer& aBuffer, CMdENamespaceDef& aNamespaceDef )
+	{
+	}
+
+TMdEInstanceType CMdEObject::InstanceType() const
+	{
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/src/mdeobjectdef.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,94 @@
+/*
+* Copyright (c) 2005-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:  
+*
+*/
+
+#include "mdeobjectdef.h"
+#include "mdenamespacedef.h"
+#include "mdepropertydef.h"
+
+
+
+CMdEObjectDef::CMdEObjectDef( const TMdCObjectDef& aObjectDef, CMdENamespaceDef& aNamespaceDef )
+    : iObjectDef( aObjectDef ), iNamespaceDef(aNamespaceDef)
+    {
+    }
+
+CMdEObjectDef* CMdEObjectDef::NewL( const TMdCObjectDef& aObjectDef,
+		CMdCSerializationBuffer& aSchemaBuffer, CMdENamespaceDef& aNamespaceDef )
+    {
+    }
+
+CMdEObjectDef* CMdEObjectDef::NewLC( const TMdCObjectDef& aObjectDef,
+		CMdCSerializationBuffer& aSchemaBuffer, CMdENamespaceDef& aNamespaceDef )
+    {
+    }
+
+void CMdEObjectDef::ConstructL(CMdCSerializationBuffer& aSchemaBuffer)
+    {
+    }
+
+CMdEObjectDef::~CMdEObjectDef()
+    {
+    }
+
+EXPORT_C TDefId CMdEObjectDef::Id() const
+    {
+    }
+
+EXPORT_C CMdENamespaceDef& CMdEObjectDef::NamespaceDef() const
+    {
+    }
+
+EXPORT_C CMdEObjectDef* CMdEObjectDef::ParentL()
+    {
+    }
+
+EXPORT_C const TDesC& CMdEObjectDef::Name() const
+    {
+    }
+
+EXPORT_C TInt CMdEObjectDef::Compare( const CMdEObjectDef& aObjectDef ) const
+    {
+    }
+
+EXPORT_C TInt CMdEObjectDef::PropertyDefCount() const
+    {
+    }
+
+EXPORT_C CMdEPropertyDef& CMdEObjectDef::PropertyDefL(TInt aIndex)
+	{
+	}
+
+EXPORT_C CMdEPropertyDef& CMdEObjectDef::GetPropertyDefL( const TDesC& aName )
+	{
+	}
+
+CMdEPropertyDef* CMdEObjectDef::GetPropertyDefL( const TDesC& aName, CMdEObjectDef* aChild )
+    {    
+    }
+
+CMdEPropertyDef* CMdEObjectDef::GetPropertyDefL(TDefId aId, CMdEObjectDef* aChild)
+    {
+    }
+
+CMdEPropertyDef* CMdEObjectDef::PropertyDefL(TInt aIndex, CMdEObjectDef* /*aChild*/)
+	{
+	}
+
+TInt CMdEObjectDef::CompareProperties(const CMdEPropertyDef& aFirst, const CMdEPropertyDef& aSecond)
+    {
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/src/mdeobjectquery.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,78 @@
+/*
+* 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:  Interface for object query
+*
+*/
+
+
+#include "mdeobjectquery.h"
+#include "mdeobject.h"
+
+
+CMdEObjectQuery::CMdEObjectQuery(CMdESession& aSession, CMdENamespaceDef& aNamespaceDef, 
+		CMdEObjectDef& aObjectDef, RPointerArray<CMdEObjectDef>* aObjectDefs)
+        : CMdEQuery(EQueryTypeObject, aSession, aNamespaceDef), 
+          iObjectDef(aObjectDef), iObjectDefs(aObjectDefs),
+          iFreetextsInResult( ETrue )
+    {
+    }
+CMdEObjectQuery::CMdEObjectQuery()
+        : iObjectDef(*(CMdEObjectDef*)NULL), iObjectDefs((RPointerArray<CMdEObjectDef>*)NULL),
+          iFreetextsInResult( ETrue )
+    {
+    }
+
+void CMdEObjectQuery::ObjectQueryConstructL()
+    {
+    }
+
+CMdEObjectQuery::~CMdEObjectQuery()
+	{
+    delete iCMdEObject;
+	}
+
+EXPORT_C CMdEObject& CMdEObjectQuery::Result(TInt aIndex) const
+    {
+    if ( !iCMdEObject ) 
+        {
+        const TPtrC ptr = KNullDesC();
+        iCMdEObject = CMdEObject::NewL( * ( CMdEObjectDef*  )NULL,ptr, 0 );
+        }
+    
+    return *iCMdEObject;
+    }
+
+EXPORT_C CMdEObjectDef& CMdEObjectQuery::ObjectDef() const
+	{
+	}
+
+EXPORT_C void CMdEObjectQuery::AddPropertyFilterL(const CMdEPropertyDef* aProperty)
+    {
+    }
+
+EXPORT_C void CMdEObjectQuery::ResetPropertyFilter()
+    {
+    }
+    
+RPointerArray<CMdEPropertyDef>& CMdEObjectQuery::PropertyFilter()
+	{
+	}
+
+RPointerArray<CMdEObjectDef>* CMdEObjectQuery::ObjectDefs() const
+	{
+	}
+
+void CMdEObjectQuery::DoCancel() 
+    {
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/src/mdeorderrule.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,82 @@
+/*
+* 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:  ?Description
+*
+*/
+
+
+#include "mdeorderrule.h"
+#include "mdepropertydef.h"
+
+
+EXPORT_C TMdEOrderRule::TMdEOrderRule(TOrderRuleType aType, TBool aAscending)
+        : iType(aType), 
+          iAscending(aAscending),
+          iCaseSensitive(ETrue)
+    {
+    }
+        
+
+EXPORT_C TMdEOrderRule::TMdEOrderRule(const CMdEPropertyDef& aPropertyDef, TBool aAscending)
+        : iType(EOrderRuleTypeProperty), iPropertyDef(&aPropertyDef), 
+          iAscending(aAscending), iCaseSensitive(ETrue)
+    {
+    }
+
+
+EXPORT_C TOrderRuleType TMdEOrderRule::Type() const
+    {
+    }
+
+
+EXPORT_C void TMdEOrderRule::SetType(TOrderRuleType aType)
+    {
+    }
+
+
+EXPORT_C TBool TMdEOrderRule::Ascending() const
+    {
+    }
+    
+
+EXPORT_C void TMdEOrderRule::SetAscending(TBool aAscending)
+    {
+    }
+
+
+EXPORT_C const CMdEPropertyDef* TMdEOrderRule::PropertyDef() const
+    {
+    }
+
+
+EXPORT_C void TMdEOrderRule::SetPropertyDef(const CMdEPropertyDef& aPropertyDef)
+    {
+    }
+
+EXPORT_C void TMdEOrderRule::SetCaseSensitive(TBool aCaseSensitive)
+    {
+    }
+
+EXPORT_C TBool TMdEOrderRule::CaseSensitive()
+    {
+    }
+
+TUint32 TMdEOrderRule::RequiredBufferSize() const
+	{
+	}
+
+void TMdEOrderRule::SerializeL(CMdCSerializationBuffer& aBuffer, 
+		TMdCOffset& aFreespaceOffset) const
+	{
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/src/mdeproperty.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,206 @@
+/*
+* 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:  ?Description
+*
+*/
+
+
+#include "mdeproperty.h"
+#include "mdepropertydef.h"
+#include "mdeobject.h"
+#include "mdeobjectdef.h"
+#include "mdeerror.h"
+#include "mdesession.h"
+
+CMdEProperty::CMdEProperty(const CMdEPropertyDef& aDef, const CMdEObject& aObject)
+		: CMdEInstanceItem( CONST_CAST( CMdESession*, &aDef.NamespaceDef().Session() ), KNoId), 
+		iModFlags(0), iDef(aDef), iObject(aObject)
+	{
+	}
+
+CMdEProperty* CMdEProperty::NewL(const CMdEPropertyDef& aDef, const CMdEObject& aObject)
+    {
+    }
+
+CMdEProperty::CMdEProperty() :  
+        CMdEInstanceItem(  NULL, 0  ), 
+        iDef(const_cast<const CMdEPropertyDef&>( *(CMdEPropertyDef*)0) ), 
+        iObject(*(CMdEObject*)0)
+    {
+    }
+
+CMdEProperty* CMdEProperty::NewLC(const CMdEPropertyDef& aDef, const CMdEObject& aObject)
+    {
+    }
+
+
+CMdEProperty* CMdEProperty::NewL( const CMdEObject& aObject, CMdCSerializationBuffer& aBuffer )
+	{
+	}
+
+CMdEProperty* CMdEProperty::NewLC( const CMdEObject& aObject, CMdCSerializationBuffer& aBuffer )
+	{
+	}
+
+void CMdEProperty::BaseConstructL()
+	{
+	}
+
+CMdEProperty::~CMdEProperty()
+	{
+	}
+
+EXPORT_C const CMdEPropertyDef& CMdEProperty::Def() const
+	{
+	}
+
+EXPORT_C const CMdEObject& CMdEProperty::Object() const
+	{
+	}
+
+EXPORT_C TBool CMdEProperty::Modified() const
+	{
+	}
+
+TUint8 CMdEProperty::ModFlags() const
+	{
+	}
+
+void CMdEProperty::SetRemoved()
+	{
+	}
+
+TBool CMdEProperty::Removed()
+	{
+	}
+
+void CMdEProperty::ClearFlags()
+	{
+	}
+
+void CMdEProperty::SetModified()
+	{
+	}
+
+TMdEInstanceType CMdEProperty::InstanceType() const
+	{
+	}
+
+EXPORT_C TBool CMdEProperty::BoolValueL() const
+	{
+	}
+
+EXPORT_C TInt8 CMdEProperty::Int8ValueL() const
+	{
+	}
+
+EXPORT_C TUint8 CMdEProperty::Uint8ValueL() const
+	{
+	}
+
+EXPORT_C TInt16 CMdEProperty::Int16ValueL() const
+	{
+	}
+
+EXPORT_C TUint16 CMdEProperty::Uint16ValueL() const
+	{
+	}
+
+EXPORT_C TInt32 CMdEProperty::Int32ValueL() const
+	{
+	}
+
+EXPORT_C TUint32 CMdEProperty::Uint32ValueL() const
+	{
+	}
+
+EXPORT_C TInt64 CMdEProperty::Int64ValueL() const
+	{
+	}
+
+EXPORT_C TReal32 CMdEProperty::Real32ValueL() const
+	{
+	}
+
+EXPORT_C TReal64 CMdEProperty::Real64ValueL() const
+	{
+	}
+
+EXPORT_C TTime CMdEProperty::TimeValueL() const
+	{
+	}
+
+EXPORT_C const TDesC& CMdEProperty::TextValueL() const
+	{
+    return KNullDesC();
+	}
+
+
+EXPORT_C void CMdEProperty::SetBoolValueL(TBool aValue)
+	{
+	}
+
+EXPORT_C void CMdEProperty::SetInt8ValueL(TInt8 aValue)
+	{
+	}
+
+EXPORT_C void CMdEProperty::SetUint8ValueL(TUint8 aValue)
+	{
+	}
+
+
+EXPORT_C void CMdEProperty::SetInt16ValueL(TInt16 aValue)
+	{
+	}
+
+EXPORT_C void CMdEProperty::SetUint16ValueL(TUint16 aValue)
+	{
+	}
+
+EXPORT_C void CMdEProperty::SetInt32ValueL(TInt32 aValue)
+	{
+	}
+
+EXPORT_C void CMdEProperty::SetUint32ValueL(TUint32 aValue)
+	{
+	}
+
+EXPORT_C void CMdEProperty::SetInt64ValueL(TInt64 aValue)
+	{
+	}
+
+EXPORT_C void CMdEProperty::SetReal32ValueL(TReal32 aValue)
+	{
+	}
+
+EXPORT_C void CMdEProperty::SetReal64ValueL(TReal64 aValue)
+	{
+	}
+
+EXPORT_C void CMdEProperty::SetTimeValueL(const TTime& aValue)
+	{
+	}
+
+EXPORT_C void CMdEProperty::SetTextValueL(const TDesC& aValue)
+    {
+    }
+
+void CMdEProperty::DoSetTextValueL(const TDesC& aValue)
+    {
+	}
+
+TMdCOffset CMdEProperty::SerializeL(CMdCSerializationBuffer& aBuffer, TMdCOffset aFreespaceOffset) const
+	{
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/src/mdepropertydef.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,130 @@
+/*
+* Copyright (c) 2005-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:  
+*
+*/
+
+#include "mdepropertydef.h"
+
+#include "mdeobjectdef.h"
+#include "mdenamespacedef.h"
+
+
+CMdEPropertyDef::CMdEPropertyDef( const TMdCPropertyDef& aPropertyDef, CMdEObjectDef& aObjectDef )
+    : iPropertyDef(aPropertyDef), iObjectDef(aObjectDef)
+    {
+    }
+
+CMdEPropertyDef* CMdEPropertyDef::NewL( const TMdCPropertyDef& aPropertyDef,
+    CMdCSerializationBuffer& aSchemaBuffer, CMdEObjectDef& aObjectDef )
+    {
+    }
+
+CMdEPropertyDef* CMdEPropertyDef::NewLC( const TMdCPropertyDef& aPropertyDef,
+    CMdCSerializationBuffer& aSchemaBuffer, CMdEObjectDef& aObjectDef )
+    {
+    }
+
+void CMdEPropertyDef::ConstructL( CMdCSerializationBuffer& aSchemaBuffer )
+    {
+    }
+
+CMdEPropertyDef::~CMdEPropertyDef()
+    {
+    }
+
+TDefId CMdEPropertyDef::Id() const
+    {
+    }
+
+TDefId CMdEPropertyDef::ObjectDefId() const
+	{
+	}
+
+EXPORT_C CMdEObjectDef& CMdEPropertyDef::ObjectDef() const
+    {
+    }
+    
+EXPORT_C const TDesC& CMdEPropertyDef::Name() const
+    {
+    }
+
+EXPORT_C TInt CMdEPropertyDef::Compare( const CMdEPropertyDef& aPropertyDef ) const
+    {
+    }
+
+EXPORT_C TPropertyType CMdEPropertyDef::PropertyType() const
+    {
+    }
+
+EXPORT_C TBool CMdEPropertyDef::ReadOnly() const
+    {
+    }
+
+EXPORT_C TBool CMdEPropertyDef::Mandatory() const
+	{
+	}
+
+EXPORT_C TInt32 CMdEPropertyDef::MinInt32ValueL() const
+    {
+    }
+
+EXPORT_C TInt32 CMdEPropertyDef::MaxInt32ValueL() const
+    {
+    }
+
+EXPORT_C TUint32 CMdEPropertyDef::MinUint32ValueL() const
+    {
+    }
+
+EXPORT_C TUint32 CMdEPropertyDef::MaxUint32ValueL() const
+    {
+    }
+
+EXPORT_C TInt64 CMdEPropertyDef::MinInt64ValueL() const
+    {
+    }
+
+EXPORT_C TInt64 CMdEPropertyDef::MaxInt64ValueL() const
+    {
+    }
+
+EXPORT_C TReal CMdEPropertyDef::MinRealValueL() const
+    {
+    }
+
+EXPORT_C TReal CMdEPropertyDef::MaxRealValueL() const
+    {
+    }
+
+EXPORT_C TTime CMdEPropertyDef::MinTimeValueL() const
+    {
+    }
+
+EXPORT_C TTime CMdEPropertyDef::MaxTimeValueL() const
+    {
+    }
+
+EXPORT_C TInt CMdEPropertyDef::MinTextLengthL() const
+    {
+    }
+
+EXPORT_C TInt CMdEPropertyDef::MaxTextLengthL() const
+    {
+    
+    }
+
+EXPORT_C CMdENamespaceDef& CMdEPropertyDef::NamespaceDef() const
+    {
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/src/mdequery.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,226 @@
+/*
+* 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:  Query base class
+*
+*/
+
+
+#include "mdequery.h"
+#include "mdeorderrule.h"
+#include "mdeinstanceitem.h"
+#include "mdelogiccondition.h"
+#include "mdenamespacedef.h"
+
+#include "VcxMyVideosMdsDbTest.h"
+
+
+CMdEQuery::CMdEQuery(TQueryType aType, CMdESession& aSession, CMdENamespaceDef& aNamespaceDef)
+        : iQueryId( 0 ), iSession(aSession), iNamespaceDef(aNamespaceDef), iType(aType), 
+          iResultMode(EQueryResultModeItem), iState(EStateNew), iError(KErrNone), 
+          iObjectResult(NULL), iCountResult(0), iDistinctResults(NULL), iDestroyed(EFalse)
+    {
+    }
+
+
+CMdEQuery::CMdEQuery()
+        : iQueryId( 0 ), iSession(*(CMdESession*)0), iNamespaceDef(*(CMdENamespaceDef*)0), iType((TQueryType)0), 
+          iResultMode(EQueryResultModeItem), iState(EStateNew), iError(KErrNone), 
+          iObjectResult(NULL), iCountResult(0), iDistinctResults(NULL), iDestroyed(EFalse)
+    {
+    }
+
+void CMdEQuery::QueryConstructL()
+    {
+    }
+
+
+CMdEQuery::~CMdEQuery()
+	{
+	}
+
+
+EXPORT_C TQueryType CMdEQuery::Type() const
+    {
+    }
+
+EXPORT_C CMdENamespaceDef& CMdEQuery::NamespaceDef() const
+	{
+	}
+    
+EXPORT_C CMdESession& CMdEQuery::Session() const
+    {
+    }
+
+
+EXPORT_C CMdELogicCondition& CMdEQuery::Conditions() const
+    {
+    }
+    
+    
+EXPORT_C void CMdEQuery::AppendOrderRuleL(const TMdEOrderRule& aRule)
+    {
+    }
+
+
+EXPORT_C void CMdEQuery::InsertOrderRuleL(const TMdEOrderRule& aRule, TInt aPos)
+    {
+    }
+
+
+EXPORT_C TInt CMdEQuery::OrderRuleCount() const
+    {
+    }
+
+
+EXPORT_C void CMdEQuery::RemoveOrderRule(TInt aIndex)
+    {
+    }
+
+
+EXPORT_C TMdEOrderRule CMdEQuery::OrderRule(TInt aIndex) const
+    {   
+    }
+    
+
+EXPORT_C void CMdEQuery::FindL(TUint aMaxCount, TUint aNotifyCount)
+    {
+    }
+
+
+EXPORT_C void CMdEQuery::Cancel()
+    {
+    }
+
+
+EXPORT_C TBool CMdEQuery::IsComplete() const
+    {
+    }
+
+
+EXPORT_C TInt CMdEQuery::Error() const
+    {
+    }
+
+
+EXPORT_C TInt CMdEQuery::Count() const
+    {
+    return test->querycountresult;
+    }
+
+EXPORT_C CMdEItem& CMdEQuery::ResultItem(TInt aIndex) const
+    {
+    }
+
+
+EXPORT_C TItemId CMdEQuery::ResultId(TInt aIndex) const
+    {
+    }
+
+EXPORT_C const RArray<TItemId>& CMdEQuery::ResultIds() const
+	{
+	}
+
+EXPORT_C CMdEItem* CMdEQuery::TakeOwnershipOfResult(TInt aIndex)
+    {
+    }
+
+
+EXPORT_C TBool CMdEQuery::OwnsResult(TInt aIndex)
+    {
+    }
+
+
+EXPORT_C CMdEQuery::TState CMdEQuery::State() const
+    {
+    }
+
+void CMdEQuery::DoCancel()
+    {
+    }
+
+void CMdEQuery::SetState(TState aState)
+    {
+    }
+
+
+void CMdEQuery::AssertInState(TState aState)
+    {
+    }
+    
+
+void CMdEQuery::AssertNotInState(TState aState)
+    {
+    }
+    
+
+void CMdEQuery::NotifyNewResultsL(const RPointerArray<CMdEInstanceItem>& aNewResults)
+    {
+    }
+
+
+void CMdEQuery::NotifyNewResultsL(const RArray<TItemId>& aNewResults)
+    {
+    }
+
+void CMdEQuery::NotifyNewResultsL( const CDesCArray& aNewResults )
+    {
+    }
+
+void CMdEQuery::NotifyNewResults(TUint32 aResult)
+	{
+
+    }
+
+void CMdEQuery::AppendResultsL(const RPointerArray<CMdEInstanceItem>& aNewResults)
+    {
+    }
+
+void CMdEQuery::AppendResultsL(const RArray<TItemId>& aNewResults)
+    {
+    }
+
+void CMdEQuery::AppendResultsL( const CDesCArray& aNewResults )
+    {
+    }
+    
+void CMdEQuery::NotifyCompleted(TInt aError)
+    {
+    }
+
+EXPORT_C void CMdEQuery::AddObserverL(MMdEQueryObserver& aObserver)
+	{
+	}
+
+EXPORT_C void CMdEQuery::RemoveObserver(MMdEQueryObserver& aObserver)
+	{
+	}
+
+EXPORT_C void CMdEQuery::SetResultMode( TQueryResultMode aMode )
+    {    
+    }
+
+EXPORT_C TQueryResultMode CMdEQuery::ResultMode() const
+    {
+    }
+EXPORT_C CMdEItem& CMdEQuery::ResultObjectItem() const
+    {
+    }
+
+EXPORT_C TPtrC16 CMdEQuery::ResultDistinctValue(TInt aIndex) const
+	{
+	}
+
+RArray<TMdEOrderRule>& CMdEQuery::OrderRules()
+	{
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/src/mdesession.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,47 @@
+/*
+* 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:  Metadata engine client session
+*
+*/
+
+
+#include "VcxMyVideosMdsDbTest.h"
+#include "mdesession.h"
+#include "mdesessionimpl.h"
+
+EXPORT_C CMdESession* CMdESession::NewL(MMdESessionObserver& aObserver)
+	{
+    if ( test->mdssessionerror )
+        {
+        return NULL;
+        }
+    return new CMdESessionImpl( aObserver );
+	}
+
+EXPORT_C CMdESession* CMdESession::NewLC(MMdESessionObserver& aObserver)
+	{
+	}
+
+CMdESession::CMdESession()
+	{
+	}
+
+void CMdESession::SessionConstruct()
+	{
+	}
+
+CMdESession::~CMdESession()
+	{
+	}
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/src/mdesessionimpl.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,628 @@
+/*
+* Copyright (c) 2007-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:  Metadata engine client session implementation*
+*/
+
+#include <etel3rdparty.h>
+#include <e32property.h> 
+
+#include "mdesession.h"
+#include "mdesessionimpl.h"
+
+
+#include "mdeobjectdef.h"
+#include "mdeobjectquery.h"
+#include "mderelationdef.h"
+#include "mdeeventdef.h"
+#include "mdeobject.h"
+#include "mderelation.h"
+#include "mdeevent.h"
+
+#include "mdeobjectdef.h"
+#include "mdenamespacedef.h"
+#include "mdedatabuffer.h"
+#include "mdelogiccondition.h"
+#include "mdeobjectcondition.h"
+
+#include "VcxMyVideosMdsDbTest.h"
+
+
+// for CleanupResetAndDestroyPushL
+#include <mmf/common/mmfcontrollerpluginresolver.h>
+
+CMdeSessionStartTimer* CMdeSessionStartTimer::NewL(MMdESessionObserver& aObserver)
+    {
+    CMdeSessionStartTimer* self = new CMdeSessionStartTimer( aObserver );
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+void CMdeSessionStartTimer::ConstructL()
+    {
+    CTimer::ConstructL();
+    }   
+
+CMdeSessionStartTimer::~CMdeSessionStartTimer()
+	{
+	Cancel();
+	}		
+
+void CMdeSessionStartTimer::RunL()
+	{
+	iObserver.HandleSessionOpened(*(CMdESession*) 0  ,test->mdssessionasyncerror);
+	}
+
+CMdeSessionStartTimer::CMdeSessionStartTimer(MMdESessionObserver& aObserver)
+	: CTimer( CActive::EPriorityStandard ), iObserver( aObserver )
+	{
+	CActiveScheduler::Add(this);
+	}
+
+CMdESessionImpl::CMdESessionImpl(MMdESessionObserver& aObserver)
+	: iSessionStartupAO( NULL ), iSessionObserver(&aObserver), 
+	  iSchemaBuffer( NULL ), iNextQueryId( 0 )
+	{
+    iTimer = CMdeSessionStartTimer::NewL( aObserver );
+    
+    iTimer->After( 1000 );
+	}
+
+CMdESessionImpl::~CMdESessionImpl()
+	{
+    delete iTimer;
+    // No session errors should be sent during deconstruction to avoid possible double deletion
+    iSessionObserver = NULL;
+
+	delete iSchemaBuffer;
+
+	iNotifiers.ResetAndDestroy();
+	iNotifiers.Close();
+
+	
+	iSchemaChunk.Close();
+	
+	iNamespaceDefs.ResetAndDestroy();
+	iNamespaceDefs.Close();
+	
+	delete iSessionStartupAO;
+	}
+
+void CMdESessionImpl::ConstructL()
+	{
+    }
+
+void CMdESessionImpl::Close()
+	{
+	}
+
+TInt CMdESessionImpl::NamespaceDefCount() const
+	{
+	return iNamespaceDefs.Count();
+	}
+
+CMdENamespaceDef& CMdESessionImpl::NamespaceDefL( TInt aIndex )
+	{
+	return *iNamespaceDefs[aIndex];
+	}
+
+CMdENamespaceDef& CMdESessionImpl::GetNamespaceDefL( const TDesC& aName )
+	{
+	const TInt KNamespaceCount = iNamespaceDefs.Count();
+	for ( TInt i = 0; i < KNamespaceCount; ++i )
+		{
+		if ( !aName.Compare( iNamespaceDefs[i]->Name() ) )
+			{
+			return NamespaceDefL( i );
+			}
+		}
+
+	User::Leave( KErrNotFound );
+	return NamespaceDefL( -1 ); // never reached
+	}
+
+CMdENamespaceDef& CMdESessionImpl::GetNamespaceDefL(TDefId aId)
+	{
+	const TInt KNamespaceCount = iNamespaceDefs.Count();
+	for ( TInt i = 0; i < KNamespaceCount; ++i )
+		{
+		if ( iNamespaceDefs[i]->Id() == aId )
+			{
+			return NamespaceDefL( i );
+			}
+		}
+
+	User::Leave( KErrNotFound );
+	return NamespaceDefL( -1 ); // never reached
+	}
+
+CMdENamespaceDef& CMdESessionImpl::GetDefaultNamespaceDefL()
+	{
+	}
+
+CMdEObject* CMdESessionImpl::NewObjectL( CMdEObjectDef& aDef, const TDesC& aUri, TUint32 aMediaId )
+	{
+	CMdEObject* object = NewObjectLC( aDef, aUri, aMediaId );
+	CleanupStack::Pop(object);
+	return object;
+	}
+
+CMdEObject* CMdESessionImpl::NewObjectLC( CMdEObjectDef& aDef, const TDesC& aUri, TUint32 aMediaId )
+	{
+	CMdEObject* object = CMdEObject::NewLC( aDef, aUri, aMediaId );
+	return object;
+	}
+
+void CMdESessionImpl::CommitObjectL(CMdEObject& aObject)
+    {
+    }
+
+void CMdESessionImpl::CommitObjectsL(RPointerArray<CMdEObject>& aObjects)
+    {
+    }
+
+TItemId CMdESessionImpl::CancelObjectL(CMdEObject& aObject)
+    {
+    }
+
+CMdERelation* CMdESessionImpl::NewRelationLC( CMdERelationDef& aDef, TItemId aLeftObjectId, 
+										      TItemId aRightObjectId, TInt32 aParameter )
+	{
+	}
+
+CMdERelation* CMdESessionImpl::NewRelationL( CMdERelationDef& aDef, TItemId aLeftObjectId, 
+										     TItemId aRightObjectId, TInt32 aParameter )
+	{
+	}
+
+
+CMdEEvent* CMdESessionImpl::NewEventLC(CMdEEventDef& aDef, TItemId aObjectId, TTime aTime, const TDesC* aSource, const TDesC* aParticipant)
+	{
+	}
+
+CMdEEvent* CMdESessionImpl::NewEventL(CMdEEventDef& aDef, TItemId aObjectId, TTime aTime, const TDesC* aSource, const TDesC* aParticipant)
+	{
+	}
+	
+void CMdESessionImpl::AddSchemaObserverL(MMdESchemaObserver& aObserver)
+	{
+	}
+
+
+void CMdESessionImpl::RemoveSchemaObserverL(MMdESchemaObserver& aObserver)
+	{
+	}
+
+void CMdESessionImpl::NotifySessionOpened(TInt aError)
+	{
+	}
+
+
+void CMdESessionImpl::NotifyError(TInt aError)
+	{
+	if(iSessionObserver)
+		{
+		iSessionObserver->HandleSessionError(*this, aError);
+		}
+	iSessionState = EMdESessionClosed;
+	}
+
+void CMdESessionImpl::LoadSchemaL()
+	{
+	DoLoadSchemaL();
+	}
+
+void CMdESessionImpl::DoLoadSchemaL()
+    {    }
+
+void CMdESessionImpl::AddRelationDefL( const CMdENamespaceDef &aNamespaceDef, const TDesC &aName )
+	{
+	}
+
+void CMdESessionImpl::AddEventDefL( const CMdENamespaceDef &aNamespaceDef, const TDesC &aName )
+	{
+	}
+
+
+CMdEObject* CMdESessionImpl::GetObjectL( const TItemId aId, CMdENamespaceDef* aNamespaceDef )
+	{}
+	
+CMdEObject* CMdESessionImpl::GetFullObjectL( const TItemId aId, CMdENamespaceDef* aNamespaceDef )
+	{
+	}
+
+CMdEObject* CMdESessionImpl::GetObjectL( const TItemId aId, CMdEObjectDef& aObjectDef )
+	{
+    if( test->mdsoperationleaves )
+        {
+        User::Leave( test->mdsoperationleaves );
+        }
+    if ( test->mdsoperationreturns )
+        {
+        return NULL;
+        }
+    else
+        {
+        CMdEObject* object = CMdEObject::NewL( aObjectDef, KNullDesC(), aId );
+        return object;
+        }
+	}
+
+CMdEObject* CMdESessionImpl::GetObjectL( const TInt64 aGuidHigh, const TInt64 aGuidLow, CMdENamespaceDef* aNamespaceDef )
+	{}
+
+CMdEObject* CMdESessionImpl::GetFullObjectL( const TInt64 aGuidHigh, const TInt64 aGuidLow, CMdENamespaceDef* aNamespaceDef )
+	{}
+
+CMdEObject* CMdESessionImpl::GetObjectL( const TInt64 aGuidHigh, const TInt64 aGuidLow, CMdEObjectDef& aObjectDef )
+	{}
+
+CMdEObject* CMdESessionImpl::OpenObjectL( const TItemId aId, CMdENamespaceDef* aNamespaceDef )
+	{}
+
+CMdEObject* CMdESessionImpl::OpenFullObjectL( const TItemId aId, CMdENamespaceDef* aNamespaceDef )
+	{}
+
+CMdEObject* CMdESessionImpl::OpenObjectL( const TItemId aId, CMdEObjectDef& aObjectDef )
+    {
+    if( test->mdsoperationleaves )
+        {
+        User::Leave( test->mdsoperationleaves );
+        }
+    if ( test->mdsoperationreturns )
+        {
+        return NULL;
+        }
+    else
+        {
+        CMdEObject* object = CMdEObject::NewL( aObjectDef, KNullDesC(), aId );
+        return object;
+        }
+    }
+
+CMdEObject* CMdESessionImpl::OpenObjectL( const TInt64 aGuidHigh, const TInt64 aGuidLow, CMdENamespaceDef* aNamespaceDef )
+	{}
+
+CMdEObject* CMdESessionImpl::OpenFullObjectL( const TInt64 aGuidHigh, const TInt64 aGuidLow, CMdENamespaceDef* aNamespaceDef )
+	{}
+
+CMdEObject* CMdESessionImpl::OpenObjectL( const TInt64 aGuidHigh, const TInt64 aGuidLow, CMdEObjectDef& aObjectDef )
+    { }
+
+EXPORT_C CMdEObject* CMdESessionImpl::GetObjectL( const TDesC& aUri, CMdENamespaceDef* aNamespaceDef )
+	{}
+    
+CMdEObject* CMdESessionImpl::GetFullObjectL( const TDesC& aUri, CMdENamespaceDef* aNamespaceDef )
+	{}
+    
+CMdEObject* CMdESessionImpl::GetObjectL( const TDesC& aUri, CMdEObjectDef& aObjectDef )
+    { }
+
+    
+CMdEObject* CMdESessionImpl::OpenObjectL( const TDesC& aUri, CMdENamespaceDef* aNamespaceDef )
+	{}
+
+CMdEObject* CMdESessionImpl::OpenFullObjectL( const TDesC& aUri, CMdENamespaceDef* aNamespaceDef )
+	{}
+
+CMdEObject* CMdESessionImpl::OpenObjectL( const TDesC& aUri, CMdEObjectDef& aObjectDef )
+    { 
+    CMdEObject* object = CMdEObject::NewLC( aObjectDef, aUri, 0 );
+    return object;
+    }
+
+void CMdESessionImpl::CheckObjectL( TMdEObject& aObject, const TDesC& aUri, 
+		CMdENamespaceDef* aNamespaceDef )
+	{}
+
+void CMdESessionImpl::CheckObjectL( TMdEObject& aObject, TItemId aId, 
+		CMdENamespaceDef* aNamespaceDef )
+	{}
+
+void CMdESessionImpl::CheckObjectL( RArray<TMdEObject>& aObjects, 
+		const RArray<TItemId>& aIds, CMdENamespaceDef* aNamespaceDef )
+	{}
+
+CMdERelation* CMdESessionImpl::GetRelationL(TItemId aId, CMdENamespaceDef* aNamespaceDef)
+    { }
+
+
+CMdEEvent* CMdESessionImpl::GetEventL(TItemId aId, 
+		CMdENamespaceDef* aNamespaceDef)
+    {}
+CMdCSerializationBuffer* CMdESessionImpl::RemoveCommonL( 
+		CMdENamespaceDef& aNamespaceDef, const RArray<TItemId>* aObjects,
+		const RArray<TItemId>* aEvents, const RArray<TItemId>* aRelations )
+	{}
+
+CMdCSerializationBuffer* CMdESessionImpl::RemoveCommonL( 
+		CMdENamespaceDef& aNamespaceDef, 
+		const RPointerArray<TDesC16>* aObjects,
+		const RArray<TItemId>* aEvents, const RArray<TItemId>* aRelations )
+	{
+	}
+
+TInt CMdESessionImpl::DeserializeIdsL( RMdEDataBuffer& aSerializedItemIds, 
+		RArray<TItemId>* aResultObjects, RArray<TItemId>* aResultEvents, 
+		RArray<TItemId>* aResultRelations )
+	{}
+
+TItemId CMdESessionImpl::RemoveObjectL( TItemId aId, 
+		CMdENamespaceDef* aNamespaceDef )
+    {
+    if ( test->mdsoperationleaves )
+        {
+        User::Leave( test->mdsoperationleaves );
+        }
+    else if ( test->mdsoperationreturns )
+        {
+        return 0;
+        }
+    else
+        {
+        return 1;
+        }
+    }
+
+TItemId CMdESessionImpl::RemoveObjectL( const TDesC& aUri, 
+		CMdENamespaceDef* aNamespaceDef )
+    { }
+
+TInt CMdESessionImpl::RemoveObjectsL( const RArray<TItemId>& aId, 
+		RArray<TItemId>& aResult, CMdENamespaceDef* aNamespaceDef )
+	{}
+
+TInt CMdESessionImpl::RemoveObjectsL( const RPointerArray<TDesC>& aUri, 
+		RArray<TItemId>& aResult, CMdENamespaceDef* aNamespaceDef )
+	{}
+
+void CMdESessionImpl::RemoveObjectsAsyncL( 
+		const RArray<TItemId>& aId, TRequestStatus& aStatus, 
+		RMdEDataBuffer& aSerializedObjectIds, 
+		CMdENamespaceDef* aNamespaceDef )
+	{}
+	
+void CMdESessionImpl::RemoveObjectsAsyncL( 
+		const RPointerArray<TDesC>& aUri, TRequestStatus& aStatus, 
+		RMdEDataBuffer& aSerializedObjectIds, 
+		CMdENamespaceDef* aNamespaceDef )
+	{}
+
+TItemId CMdESessionImpl::RemoveRelationL(TItemId aId, 
+		CMdENamespaceDef* aNamespaceDef)
+    {}
+
+TInt CMdESessionImpl::RemoveRelationsL(const RArray<TItemId>& aId, 
+		RArray<TItemId>& aSuccessful, CMdENamespaceDef* aNamespaceDef)
+	{}
+
+void CMdESessionImpl::RemoveRelationsAsyncL(
+		const RArray<TItemId>& aId, TRequestStatus& aStatus, 
+		RMdEDataBuffer& aSerializedRelationIds, 
+		CMdENamespaceDef* aNamespaceDef)
+	{}
+
+/**
+* Add methods
+*/
+TItemId CMdESessionImpl::AddItemL( CMdEInstanceItem& aItem )
+	{}
+
+CMdCSerializationBuffer* CMdESessionImpl::SerializeItemsL( 
+		RPointerArray<CMdEInstanceItem>& aItems )
+    { }
+
+void CMdESessionImpl::DeserializeQueryResultL( 
+		CMdCSerializationBuffer& aBuffer, 
+		RPointerArray<CMdEInstanceItem>& aItems )
+	{}
+
+TItemId CMdESessionImpl::AddObjectL( CMdEObject& aObject )
+    {
+    if( test->mdsoperationleaves )
+        {
+        User::Leave( test->mdsoperationleaves );
+        }
+    if ( test->mdsoperationreturns )
+        {
+        return 0;
+        }
+    else
+        {
+        return 1;
+        }
+    }
+
+TInt CMdESessionImpl::AddObjectsL( RPointerArray<CMdEObject>& aObjects )
+    {
+    }
+
+TItemId CMdESessionImpl::AddRelationL( CMdERelation& aRelation ) 
+    {
+    }
+
+TItemId CMdESessionImpl::UpdateRelationL( CMdERelation& aRelation ) 
+    {
+    }
+
+TInt CMdESessionImpl::AddItemsL( RPointerArray<CMdEInstanceItem>& aItems )
+    {    
+    }
+
+void CMdESessionImpl::AddItemsAsyncL( 
+		RPointerArray<CMdEInstanceItem>& aItems, TRequestStatus& aStatus, 
+		RMdEDataBuffer& aSerializedItemIds )
+    {    
+    }
+
+TInt CMdESessionImpl::UpdateItemsL( RPointerArray<CMdEInstanceItem>& aItems )
+    {    }
+void CMdESessionImpl::UpdateItemsAsyncL( 
+		RPointerArray<CMdEInstanceItem>& aItems, TRequestStatus& aStatus,
+		RMdEDataBuffer& aSerializedItemIds )
+    {
+
+    }
+
+TInt CMdESessionImpl::DeserializeItemsL( RMdEDataBuffer& aSerializedItems, 
+		RPointerArray<CMdEInstanceItem>& aItems )
+	{
+	}
+
+TItemId CMdESessionImpl::AddEventL( CMdEEvent& aEvent )
+    {
+    }
+
+TItemId CMdESessionImpl::RemoveEventL( TItemId aId, 
+		CMdENamespaceDef* aNamespaceDef )
+    {
+    }
+
+TInt CMdESessionImpl::RemoveEventsL( const RArray<TItemId>& aId, 
+		RArray<TItemId>& aSuccessful, CMdENamespaceDef* aNamespaceDef )
+	{
+	}    
+	
+void CMdESessionImpl::RemoveEventsAsyncL( 
+		const RArray<TItemId>& aId, TRequestStatus& aStatus, 
+		RMdEDataBuffer& aSerializedEventIds, 
+		CMdENamespaceDef* aNamespaceDef )
+	{
+	}
+	
+
+// Query 
+
+CMdEObjectQuery* CMdESessionImpl::NewObjectQueryL(
+		CMdENamespaceDef& aNamespaceDef, CMdEObjectDef& aObjectDef, 
+		MMdEQueryObserver* aObserver)
+    {    
+    return new CMdEObjectQuery();
+    }
+
+CMdEObjectQuery* CMdESessionImpl::NewObjectQueryL(
+		CMdEObjectDef& aObjectDef, RPointerArray<CMdEObjectDef>* aObjectDefs, 
+		MMdEQueryObserver* aObserver)
+	{
+	}
+
+CMdERelationQuery* CMdESessionImpl::NewRelationQueryL(
+		CMdENamespaceDef& aNamespaceDef, MMdEQueryObserver* aObserver)
+    {}
+CMdEEventQuery* CMdESessionImpl::NewEventQueryL(
+		CMdENamespaceDef& aNamespaceDef, MMdEQueryObserver* aObserver)
+    {}
+void CMdESessionImpl::AddObjectObserverL( MMdEObjectObserver& aObserver,
+    									  CMdELogicCondition* aCondition, 
+     									  TUint32 aNotificationType,
+    									  CMdENamespaceDef* aNamespaceDef )
+    {}
+void CMdESessionImpl::AddObjectObserverWithUriL( MMdEObjectObserverWithUri& aObserver,
+                                          CMdELogicCondition* aCondition, 
+                                          TUint32 aNotificationType,
+                                          CMdENamespaceDef* aNamespaceDef )
+    {}
+void CMdESessionImpl::AddObjectPresentObserverL(
+		MMdEObjectPresentObserver& aObserver)
+	{}
+void CMdESessionImpl::RemoveObjectObserverWithUriL( 
+        MMdEObjectObserverWithUri& aObserver, CMdENamespaceDef* aNamespaceDef )
+    {}
+void CMdESessionImpl::AddRelationObserverL( MMdERelationObserver& aObserver,
+    										CMdECondition* aCondition, 
+    										TUint32 aNotificationType,
+    										CMdENamespaceDef* aNamespaceDef )
+    {}
+void CMdESessionImpl::AddRelationItemObserverL( 
+		MMdERelationItemObserver& aObserver, CMdECondition* aCondition, 
+		TUint32 aNotificationType, CMdENamespaceDef* aNamespaceDef )
+	{}
+void CMdESessionImpl::AddRelationPresentObserverL(
+		MMdERelationPresentObserver& aObserver)
+	{}
+void CMdESessionImpl::AddEventObserverL( MMdEEventObserver& aObserver,
+    									 CMdECondition* aCondition, 
+    									 TUint32 aNotificationType,
+    									 CMdENamespaceDef* aNamespaceDef )
+    {}
+void CMdESessionImpl::RemoveObjectObserverL( 
+		MMdEObjectObserver& aObserver, CMdENamespaceDef* aNamespaceDef )
+    {}
+void CMdESessionImpl::RemoveObjectPresentObserverL(
+		MMdEObjectPresentObserver& aObserver)
+	{}
+void CMdESessionImpl::RemoveRelationObserverL( 
+		MMdERelationObserver& aObserver, CMdENamespaceDef* aNamespaceDef )
+    {}
+void CMdESessionImpl::RemoveRelationItemObserverL( 
+		MMdERelationItemObserver& aObserver, CMdENamespaceDef* aNamespaceDef )
+    {}
+void CMdESessionImpl::RemoveRelationPresentObserverL(
+		MMdERelationPresentObserver& aObserver)
+	{}
+void CMdESessionImpl::RemoveEventObserverL( 
+		MMdEEventObserver& aObserver, CMdENamespaceDef* aNamespaceDef )
+    {}
+TInt CMdESessionImpl::FindNotifier( TUint32 aNotifyType, TAny* aObserver, 
+									CMdENamespaceDef& aNamespaceDef )
+    {}
+void CMdESessionImpl::NotifierInError( CMdENotifierAO* aNotifier )
+    {}
+void CMdESessionImpl::ImportSchemaL( const TDesC& aFileName )
+    {}
+TInt CMdESessionImpl::ImportMetadataL( const TDesC& aFileName )
+    {}
+void CMdESessionImpl::ImportMetadata( const TDesC& aFileName, 
+		TPckgBuf<TInt>& aResult, TRequestStatus& aStatus )
+	{}
+CMdCSerializationBuffer* CMdESessionImpl::ExportCommonL( 
+		const CMdENamespaceDef* aNamespaceDef,
+		const RPointerArray<CMdEObjectDef>* aObjectDefs,
+        const RPointerArray<CMdERelationDef>* aRelationDefs,
+        const RPointerArray<CMdEEventDef>* aEventDefs )
+	{}
+void CMdESessionImpl::ExportMetadataL( const TDesC& aFileName,
+    	const CMdENamespaceDef* aNamespaceDef,
+	    const RPointerArray<CMdEObjectDef>* aObjectDefs,
+        const RPointerArray<CMdERelationDef>* aRelationDefs,
+        const RPointerArray<CMdEEventDef>* aEventDefs )
+    {}
+
+void CMdESessionImpl::ExportMetadataL( const TDesC& aFileName, 
+		TRequestStatus& aStatus, RMdEDataBuffer& aBuffer, 
+        const CMdENamespaceDef* aNamespaceDef, 
+	    const RPointerArray<CMdEObjectDef>* aObjectDefs, 
+        const RPointerArray<CMdERelationDef>* aRelationDefs, 
+        const RPointerArray<CMdEEventDef>* aEventDefs )
+    {}
+void CMdESessionImpl::GetSchemaVersionL(
+		TInt& aMajorVersion, TInt& aMinorVersion)
+	{}
+void CMdESessionImpl::SetObjectToPresentByGuidL( 
+		const TInt64& aGuidHigh, const TInt64& aGuidLow )
+	{}
+void CMdESessionImpl::CheckOpened() const {}
+void CMdESessionImpl::GetCountL( CMdCSerializationBuffer* aBuffer, 
+		TUint32& aResult )
+	{}
+void CMdESessionImpl::GetItemIdL( CMdCSerializationBuffer* aBuffer, 
+		RArray<TItemId>& aIdArray )
+	{}
+void CMdESessionImpl::GetDistinctValuesL( CMdCSerializationBuffer& aBuffer, 
+		CDesCArray& aResults )
+	{}
+CMdENamespaceDef* CMdESessionImpl::GetNamespaceDefL( 
+		CMdENamespaceDef* aNamespaceDef )
+	{}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/src/vcxmyvideoscollectionutil.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,268 @@
+/*
+* 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 <mpxmedia.h>
+#include <mpxmediaarray.h>
+#include <mpxlog.h>
+#include <mpxmediacontainerdefs.h>
+#include <mpxmediageneraldefs.h>
+#include <vcxmyvideosdefs.h>
+#include <mpxmessagecontainerdefs.h>
+#include <bautils.h>
+#include <mpxmediavideodefs.h>
+#ifdef _DEBUG
+#include <flogger.h>
+#include <f32file.h> 
+#endif
+#include "vcxmyvideoscollectionutil.h"
+
+// ============================ MEMBER FUNCTIONS ==============================
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosCollectionUtil::CreateEmptyMediaListL
+// ----------------------------------------------------------------------------
+//
+CMPXMedia* TVcxMyVideosCollectionUtil::CreateEmptyMediaListL()
+    {
+    RArray<TInt> 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()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::CopyFromListToListL
+// ---------------------------------------------------------------------------
+//
+void TVcxMyVideosCollectionUtil::CopyFromListToListL(
+        CMPXMedia& aFromList,
+        CMPXMedia& aToList,
+        RArray<TUint32>& aMdsIds )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::CopyFromListToListL
+// ---------------------------------------------------------------------------
+//
+void TVcxMyVideosCollectionUtil::CopyFromListToListL(
+        RArray<CMPXMedia*>& aFromArray,
+        CMPXMedia& aToList,
+        RArray<TUint32>& aMdsIds )
+    {
+    }
+    
+// ---------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::AppendToListL
+// New items in aToList will point to same shared memory as items in aFromList.
+// ---------------------------------------------------------------------------
+//
+void TVcxMyVideosCollectionUtil::AppendToListL( CMPXMedia& aToList, CMPXMedia& aFromList )
+    {}
+// This helper function converts drive letter to drive number
+// ---------------------------------------------------------------------------
+//
+TInt TVcxMyVideosCollectionUtil::DriveLetter2DriveNumber( const TDesC &aDrive )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::MakeUniqueFileNameL
+// ---------------------------------------------------------------------------
+//
+void TVcxMyVideosCollectionUtil::MakeUniqueFileNameL( RFs& aFs, const TDesC& aPath,
+        TDes& aUniquePath )
+    {
+    }
+
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::OriginL
+// ----------------------------------------------------------------------------
+//
+TUint8 TVcxMyVideosCollectionUtil::OriginL( CMPXMedia& aVideo )
+    {
+    }
+
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::FlagsL
+// ----------------------------------------------------------------------------
+//
+TUint32 TVcxMyVideosCollectionUtil::FlagsL( CMPXMedia& aVideo )
+    {
+    }
+
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::CreationDateL
+// ----------------------------------------------------------------------------
+//
+TInt64 TVcxMyVideosCollectionUtil::CreationDateL( CMPXMedia& aVideo )
+    {}
+// TVcxMyVideosCollectionUtil::DownloadIdL
+// ----------------------------------------------------------------------------
+//
+TUint32 TVcxMyVideosCollectionUtil::DownloadIdL( CMPXMedia& aVideo )
+    {
+    }
+
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::DownloadStateL
+// ----------------------------------------------------------------------------
+//
+TVcxMyVideosDownloadState TVcxMyVideosCollectionUtil::DownloadStateL( CMPXMedia& aVideo )
+    {
+    }
+
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::IdL
+// ----------------------------------------------------------------------------
+//
+TMPXItemId TVcxMyVideosCollectionUtil::IdL( const CMPXMedia& aVideo )
+    {
+    }
+
+
+
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::DurationL
+// ----------------------------------------------------------------------------
+//
+TReal32 TVcxMyVideosCollectionUtil::DurationL( CMPXMedia& aVideo )
+    {
+    }
+
+
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::Title
+// ----------------------------------------------------------------------------
+//
+const TDesC& TVcxMyVideosCollectionUtil::Title( const CMPXMedia& aVideo )
+    {                            
+    }
+
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::RatingL
+// ----------------------------------------------------------------------------
+//
+TUint8 TVcxMyVideosCollectionUtil::RatingL( CMPXMedia& aVideo )
+    {
+    }
+
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::AudioFourCcL
+// ----------------------------------------------------------------------------
+//
+TUint32 TVcxMyVideosCollectionUtil::AudioFourCcL( CMPXMedia& aVideo )
+    {
+    }
+
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::AreSupported
+// ----------------------------------------------------------------------------
+//
+TBool TVcxMyVideosCollectionUtil::AreSupported( CMPXMedia& aVideo,
+        const TArray<TMPXAttribute>& aAttrs,
+        TBool& aNonSupportedAttrCanBeFoundFromMds )
+    {
+    }
+
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::AttrBelongsToFullSet
+// ----------------------------------------------------------------------------
+//
+TBool TVcxMyVideosCollectionUtil::AttrBelongsToFullSet( const TMPXAttribute& aAttr )
+    {
+    }
+
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::Origin
+// ----------------------------------------------------------------------------
+//
+TInt TVcxMyVideosCollectionUtil::Origin( TInt aCategoryId )
+    {
+    }
+    
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::MediaArrayL
+// ----------------------------------------------------------------------------
+//
+CMPXMediaArray* TVcxMyVideosCollectionUtil::MediaArrayL( const CMPXMedia& aMedia )
+    {}
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::Int32ValueL
+// ----------------------------------------------------------------------------
+//
+TInt32 TVcxMyVideosCollectionUtil::Int32ValueL( CMPXMedia& aMedia )
+    {}
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::Uint32ValueL
+// ----------------------------------------------------------------------------
+//
+TUint32 TVcxMyVideosCollectionUtil::Uint32ValueL( CMPXMedia& aMedia )
+    {}
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::GetIdsFromMediaArrayL
+// ----------------------------------------------------------------------------
+//
+void TVcxMyVideosCollectionUtil::GetIdsFromMediaArrayL( CMPXMediaArray& aMediaArray,
+        RArray<TUint32>& 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/src/vcxmyvideosmdsalbums.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,366 @@
+/*
+* 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 <e32base.h>
+#include <mpxlog.h>
+#include <mdesession.h>
+#include <mdeconstants.h>
+#include <mdequery.h>
+#include <mpxmedia.h>
+#include <mpxmediaarray.h>
+#include <mpxmediacontainerdefs.h>
+#include <mpxmediageneraldefs.h>
+#include "vcxmyvideosmdsalbums.h"
+
+#include <mdesession.h>
+#include <mdequery.h>
+#include <harvesterclient.h>
+#include <mpxcollectionmessagedefs.h>
+#include <vcxmyvideosdefs.h>
+#include <e32property.h>
+#include "vcxmyvideosalbum.h"
+
+#define protected public
+#define private public
+#include "vcxmyvideosmdsdb.h"
+#undef private
+#undef protected
+
+#include "vcxmyvideoscollectionutil.h"
+#include "vcxmyvideosmdscmdqueue.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();
+    }
+
+// ---------------------------------------------------------------------------
+// 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 )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::DoGetAlbumsL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::DoGetAlbumsL( CMPXMedia* aAlbumList,
+        MVcxMyVideosMdsAlbumsObserver& aClient )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::GetAlbumContentIdsL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::GetAlbumContentIdsL( TUint32 aAlbumId,
+        RArray<TVcxMyVideosAlbumVideo>& aContentArray,
+        MVcxMyVideosMdsAlbumsObserver& aClient )
+    {
+    }
+    
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::DoGetAlbumContentIdsL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::DoGetAlbumContentIdsL( TUint32 aAlbumId,
+        RArray<TVcxMyVideosAlbumVideo>& 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<TUint32>& aRelationIds,
+        RArray<TUint32>& aResults, MVcxMyVideosMdsAlbumsObserver& aClient )
+    {  
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::DoRemoveRelationsL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::DoRemoveRelationsL( RArray<TUint32>& aRelationIds,
+        RArray<TUint32>& 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<TMdERelation>& aRelationArray)
+    {}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/src/vcxmyvideosmdscmdqueue.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,103 @@
+/*
+* 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:  Queues commands to MDS.
+*
+*/
+
+
+// INCLUDE FILES
+#include <e32base.h>
+#include <mpxlog.h>
+#include "vcxmyvideosmdscmdqueue.h"
+
+#include <mdesession.h>
+#include <mdequery.h>
+#include <harvesterclient.h>
+#include <mpxcollectionmessagedefs.h>
+#include <vcxmyvideosdefs.h>
+#include <e32property.h>
+#include "vcxmyvideosalbum.h"
+
+#define protected public
+#define private public
+#include "vcxmyvideosmdsdb.h"
+#undef private
+#undef protected
+
+// ============================ MEMBER FUNCTIONS =============================
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CVcxMyVideosMdsCmdQueue::CVcxMyVideosMdsCmdQueue( CVcxMyVideosMdsDb& aMdsDb )
+: iMdsDb( aMdsDb )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// 2nd-phase constructor
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsCmdQueue::ConstructL()
+    {}
+
+// ---------------------------------------------------------------------------
+// Two-Phase Constructor
+// ---------------------------------------------------------------------------
+//
+CVcxMyVideosMdsCmdQueue* CVcxMyVideosMdsCmdQueue::NewL( CVcxMyVideosMdsDb& aMdsDb )
+    {
+    CVcxMyVideosMdsCmdQueue* self = new(ELeave) CVcxMyVideosMdsCmdQueue( aMdsDb );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CVcxMyVideosMdsCmdQueue::~CVcxMyVideosMdsCmdQueue()
+    {}
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsCmdQueue::Cancel
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsCmdQueue::Cancel( CVcxMyVideosMdsDb::TRequestType aType )
+    {}
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsCmdQueue::ExecuteCmdL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsCmdQueue::ExecuteCmdL( CVcxMyVideosMdsCmd* aCmd )
+    {}
+    
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsCmdQueue::CmdFinished
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsCmdQueue::CmdFinished()
+    {}
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsCmdQueue::DoExecuteCmdL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsCmdQueue::DoExecuteCmdL( CVcxMyVideosMdsCmd* aCmd )
+    {}    
+// END OF FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/myvideosindicatorplugin/data/myvideosindicatorplugin.rss	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,45 @@
+/*
+* 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 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:  My Videos indicator ECom plug-in registration resource.*
+*/
+
+
+
+#include <ecom/registryinfo.rh>
+#include <uikon.hrh>
+#include <myvideosindicator.hrh>
+#include "myvideosindicatorplugin.hrh"
+
+RESOURCE REGISTRY_INFO theInfo
+{
+   dll_uid = KMyVideosIndicatorPluginDllUid;
+   interfaces =
+   {
+       INTERFACE_INFO
+       {
+           interface_uid = KMyVideosIndicatorInterfaceUid;
+           implementations =
+           {
+               IMPLEMENTATION_INFO
+               {
+                   implementation_uid = KMyVideosIndicatorPluginImplementationUid;
+                   version_no = 1;
+                   display_name = "";
+                   default_data = "";
+                   opaque_data = "";
+               }
+           };
+       }
+   };
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/myvideosindicatorplugin/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,28 @@
+/*
+* 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 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:  My Videos indicator plug-in.*
+*/
+
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/myvideosindicatorplugin.iby    CORE_APP_LAYER_IBY_EXPORT_PATH( myvideosindicatorplugin.iby )
+
+PRJ_MMPFILES
+myvideosindicatorplugin.mmp
+
+PRJ_TESTMMPFILES
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/myvideosindicatorplugin/group/myvideosindicatorplugin.mmp	Thu Nov 04 11:16:56 2010 +0200
@@ -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 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:  My Videos indicator.*
+*/
+
+
+
+
+#include <platform_paths.hrh>
+#include <bldvariant.hrh>
+#include "../inc/myvideosindicatorplugin.hrh"
+
+TARGET          myvideosindicatorplugin.dll
+TARGETTYPE      PLUGIN
+UID             0x10009D8D  KMyVideosIndicatorPluginDllUid
+CAPABILITY      CAP_ECOM_PLUGIN
+
+USERINCLUDE     ../inc
+
+APP_LAYER_SYSTEMINCLUDE 
+
+SOURCEPATH      ../src
+SOURCE          myvideosindicatorplugin.cpp
+SOURCE          myvideosindicatorpluginproxy.cpp
+
+SOURCEPATH      ../data
+START RESOURCE  myvideosindicatorplugin.rss
+END
+
+LIBRARY         ecom.lib
+LIBRARY         euser.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/myvideosindicatorplugin/inc/myvideosindicatorplugin.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,66 @@
+/*
+* 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 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:  My Videos indicator plug-in.*
+*/
+
+
+#ifndef MYVIDEOSINDICATORPLUGIN_H
+#define MYVIDEOSINDICATORPLUGIN_H
+
+#include <myvideosindicator.h>
+
+/**
+ *  My Videos indicator plug-in implementation.
+ */
+class CMyVideosIndicatorPlugin : public CMyVideosIndicator
+    {
+public:
+
+    /**
+     * Two-phased constructor.
+     *
+     * @return Pointer to newly created object.
+     */
+    static CMyVideosIndicatorPlugin* NewL();
+
+    /**
+     * Destructor.
+     */
+    virtual ~CMyVideosIndicatorPlugin();
+
+    /**
+     * Returns overlay indicator. Ownership is transferred.
+     *
+     * @return Pointer to an icon.
+     */
+    CGulIcon* VideoOverlayIndicatorL();
+
+    /**
+     * Tells whether to show the overlay indicator for a given media object.
+     * 
+     * @param aMedia The media object.
+     * @return Whether to show the indicator (true/false).
+     */
+    TBool IsIndicatorShown( const CMPXMedia& aMedia );
+
+private:
+
+    /**
+     * C++ constructor.
+     */
+    CMyVideosIndicatorPlugin();
+
+    };
+
+#endif // MYVIDEOSINDICATORPLUGIN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/myvideosindicatorplugin/inc/myvideosindicatorplugin.hrh	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* 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 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:  My Videos indicator plug-in constants.*
+*/
+
+
+#ifndef MYVIDEOSINDICATORPLUGIN_HRH
+#define MYVIDEOSINDICATORPLUGIN_HRH
+
+/**
+ * Plugin implementation UID
+ */
+#define KMyVideosIndicatorPluginImplementationUid 0x20029FC6
+
+/**
+ * Plugin DLL UID
+ */
+#define KMyVideosIndicatorPluginDllUid 0x20029FC8
+
+#endif // MYVIDEOSINDICATORPLUGIN_HRH
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/myvideosindicatorplugin/rom/myvideosindicatorplugin.iby	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,23 @@
+/*
+* 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 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:  Rom components.*
+*/
+
+
+#ifndef MYVIDEOSINDICATORPLUGIN_IBY
+#define MYVIDEOSINDICATORPLUGIN_IBY
+
+ECOM_PLUGIN( myvideosindicatorplugin.dll, myvideosindicatorplugin.rsc )
+
+#endif // MYVIDEOSINDICATORPLUGIN_IBY
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/myvideosindicatorplugin/src/myvideosindicatorplugin.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,59 @@
+/*
+* 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 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:  My Videos indicator plug-in proxy.*
+*/
+
+
+
+#include "myvideosindicatorplugin.h"
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+CMyVideosIndicatorPlugin* CMyVideosIndicatorPlugin::NewL()
+    {
+    CMyVideosIndicatorPlugin* self = new( ELeave ) CMyVideosIndicatorPlugin;
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+CMyVideosIndicatorPlugin::~CMyVideosIndicatorPlugin()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+CMyVideosIndicatorPlugin::CMyVideosIndicatorPlugin()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+CGulIcon* CMyVideosIndicatorPlugin::VideoOverlayIndicatorL()
+    {
+    return NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+TBool CMyVideosIndicatorPlugin::IsIndicatorShown( const CMPXMedia& /*aMedia*/ )
+    {
+    return EFalse;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/myvideosindicatorplugin/src/myvideosindicatorpluginproxy.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,46 @@
+/*
+* 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 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:  My Videos indicator plug-in proxy.*
+*/
+
+
+
+#include <ecom/implementationproxy.h>
+
+#include "myvideosindicatorplugin.h"
+#include "myvideosindicatorplugin.hrh"
+
+
+// -----------------------------------------------------------------------------
+// Map the interface UIDs to implementation factory functions
+// -----------------------------------------------------------------------------
+//
+const TImplementationProxy ImplementationTable[] = 
+    { 
+    IMPLEMENTATION_PROXY_ENTRY( 
+	    KMyVideosIndicatorPluginImplementationUid, CMyVideosIndicatorPlugin::NewL )
+    };
+
+// -----------------------------------------------------------------------------
+// Exported proxy for instantiation method resolution
+// -----------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(
+        TInt& aTableCount )
+    {
+    aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy );
+
+    return ImplementationTable;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videofeeds/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* 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:    Build information file for project video feeds*
+*/
+
+
+#include <bldvariant.hrh>
+#include <platform_paths.hrh> // for conf file export macros
+
+
+/**
+ * vccommon
+ */
+#include "../vccommon/group/bld.inf"
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videofeeds/vccommon/conf/System_Definition.xml	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,41 @@
+<SystemDefinition name="IpVideo" schema="1.48">
+
+ <systemModel>
+   <layer name="IpVideo layer">
+     <module name="IpVideo module">
+       <unit unitID="IpVideo" name="IpVideo" bldFile="IpVideo\group" mrp=""/>
+     </module>
+   </layer>
+ </systemModel>
+
+ <build>
+   <option name="KEEPGOING" abldOption="-keepgoing" description="Causes make to keepgoing on errors" enable="Y"/>
+   <option name="SAVESPACE" abldOption="-savespace" description="Causes the removal of intermediate files" enable="Y"/>
+   <target name="ARMV5" abldTarget="armv5" description="RVCT Compiler"/>
+
+   <targetList name="default" description="Main Targets" target="ARMV5"/>
+
+   <unitList name="IpVideo_list" description="">
+     <unitRef unit="IpVideo"/>
+   </unitList>
+
+   <configuration name="IpVideo_config" description="Build IpVideo" filter="">
+       
+     <unitListRef unitList="IpVideo_list"/>
+
+     <task><buildLayer command="bldmake bldfiles" unitParallel="Y"/></task>
+     <task><buildLayer command="abld export" unitParallel="Y"/></task>
+     <task><buildLayer command="abld makefile" targetList="default" unitParallel="Y" targetParallel="N"/></task>
+     <task><buildLayer command="abld resource" targetList="default" unitParallel="N" targetParallel="N"/></task>
+     <task><buildLayer command="abld library" targetList="default" unitParallel="N" targetParallel="N"/></task>
+     <task><buildLayer command="abld target" targetList="default" unitParallel="Y" targetParallel="Y"/></task>
+     <task><buildLayer command="abld final" targetList="default" unitParallel="N" targetParallel="N"/></task>
+     <task><buildLayer command="abld -what export" unitParallel="Y"/></task>
+     <task><buildLayer command="abld -what target" targetList="default" unitParallel="Y" targetParallel="Y"/></task>
+     <task><buildLayer command="abld help" unitParallel="Y"/></task>
+     <task><buildLayer command="abld -check build" targetList="default" unitParallel="Y" targetParallel="Y"/></task>
+   </configuration>
+
+ </build>
+</SystemDefinition>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videofeeds/vccommon/conf/copy_loc_files.cmd	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,68 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of the License "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:  
+rem
+
+cd ..
+cd loc
+echo Copy loc files to product file structure.
+copy 01\ipvideo_01.loc \s60\s60locfiles\01
+copy 02\ipvideo_02.loc \s60\s60locfiles\02
+copy 03\ipvideo_03.loc \s60\s60locfiles\03
+copy 04\ipvideo_04.loc \s60\s60locfiles\04
+copy 05\ipvideo_05.loc \s60\s60locfiles\05
+copy 06\ipvideo_06.loc \s60\s60locfiles\06
+copy 07\ipvideo_07.loc \s60\s60locfiles\07
+copy 08\ipvideo_08.loc \s60\s60locfiles\08
+copy 09\ipvideo_09.loc \s60\s60locfiles\09
+copy 10\ipvideo_10.loc \s60\s60locfiles\10
+copy 13\ipvideo_13.loc \s60\s60locfiles\13
+copy 14\ipvideo_14.loc \s60\s60locfiles\14
+copy 15\ipvideo_15.loc \s60\s60locfiles\15
+copy 16\ipvideo_16.loc \s60\s60locfiles\16
+copy 17\ipvideo_17.loc \s60\s60locfiles\17
+copy 18\ipvideo_18.loc \s60\s60locfiles\18
+copy 25\ipvideo_25.loc \s60\s60locfiles\25
+copy 26\ipvideo_26.loc \s60\s60locfiles\26
+copy 27\ipvideo_27.loc \s60\s60locfiles\27
+copy 28\ipvideo_28.loc \s60\s60locfiles\28
+copy 29\ipvideo_29.loc \s60\s60locfiles\29
+copy 30\ipvideo_30.loc \s60\s60locfiles\30
+copy 31\ipvideo_31.loc \s60\s60locfiles\31
+copy 32\ipvideo_32.loc \s60\s60locfiles\32
+copy 33\ipvideo_33.loc \s60\s60locfiles\33
+copy 37\ipvideo_37.loc \s60\s60locfiles\37
+copy 39\ipvideo_39.loc \s60\s60locfiles\39
+copy 42\ipvideo_42.loc \s60\s60locfiles\42
+copy 45\ipvideo_45.loc \s60\s60locfiles\45
+copy 49\ipvideo_49.loc \s60\s60locfiles\49
+copy 50\ipvideo_50.loc \s60\s60locfiles\50
+copy 51\ipvideo_51.loc \s60\s60locfiles\51
+copy 54\ipvideo_54.loc \s60\s60locfiles\54
+copy 57\ipvideo_57.loc \s60\s60locfiles\57
+copy 58\ipvideo_58.loc \s60\s60locfiles\58
+copy 59\ipvideo_59.loc \s60\s60locfiles\59
+copy 67\ipvideo_67.loc \s60\s60locfiles\67
+copy 68\ipvideo_68.loc \s60\s60locfiles\68
+copy 70\ipvideo_70.loc \s60\s60locfiles\70
+copy 76\ipvideo_76.loc \s60\s60locfiles\76
+copy 78\ipvideo_78.loc \s60\s60locfiles\78
+copy 79\ipvideo_79.loc \s60\s60locfiles\79
+copy 83\ipvideo_83.loc \s60\s60locfiles\83
+copy 93\ipvideo_93.loc \s60\s60locfiles\93
+copy 94\ipvideo_94.loc \s60\s60locfiles\94
+copy 96\ipvideo_96.loc \s60\s60locfiles\96
+
+cd..
+cd conf
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videofeeds/vccommon/conf/system_definition_full.xml	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,201 @@
+<?xml version="1.0"?>
+<!DOCTYPE SystemDefinition [
+<!ELEMENT SystemDefinition (systemModel?, build?)>
+<!ATTLIST SystemDefinition
+  name CDATA #REQUIRED
+  schema CDATA #REQUIRED
+>
+<!-- all paths are relative to the root of the source -->
+
+<!-- System Model Section of DTD -->
+<!ELEMENT systemModel (layer+)>
+
+<!ELEMENT layer (logicalset* | module*)*>
+<!-- Kernel Services, Base Services, OS Services, Etc -->
+<!ATTLIST layer
+  name CDATA #REQUIRED
+  levels CDATA #IMPLIED
+  span CDATA #IMPLIED
+>
+
+<!ELEMENT logicalset (logicalsubset* | module* | unit* | package* | prebuilt*)*>
+ <!-- Generic OS services, Comms Services, etc -->
+<!ATTLIST logicalset 
+  name CDATA #REQUIRED
+>
+
+<!ELEMENT logicalsubset (module* | unit* | package* | prebuilt*)*>
+<!-- Telephony services, Networking Services, etc -->
+<!ATTLIST logicalsubset 
+  name CDATA #REQUIRED
+>
+
+<!ELEMENT module (component* | unit* | package* | prebuilt*)*>
+<!-- Screen Driver, Content Handling, etc -->
+<!ATTLIST module
+  name CDATA #REQUIRED
+  level CDATA #IMPLIED  
+>
+
+<!ELEMENT component (unit* | package* | prebuilt*)*>
+<!-- units or packages -->
+<!ATTLIST component
+  name CDATA #REQUIRED
+>
+
+<!ELEMENT unit EMPTY >
+<!-- must be buildable (bld.inf) -->
+<!-- bldFile will soon be removed in favour of mrp -->
+<!ATTLIST unit
+  unitID ID #REQUIRED
+  name CDATA #REQUIRED
+  mrp CDATA #REQUIRED
+  filter CDATA #IMPLIED
+  bldFile CDATA #REQUIRED
+  priority CDATA #IMPLIED
+  contract CDATA #IMPLIED
+>
+
+<!ELEMENT package EMPTY >
+<!-- like a unit, but not buildable -->
+<!ATTLIST package
+  name CDATA #REQUIRED
+  mrp CDATA #REQUIRED
+  filter CDATA #IMPLIED
+  contract CDATA #IMPLIED
+>
+
+<!ELEMENT prebuilt EMPTY>
+<!-- pre-built CBR component -->
+<!ATTLIST prebuilt
+  name CDATA #REQUIRED
+  version CDATA #REQUIRED
+  late (Y|N) #IMPLIED
+  filter CDATA #IMPLIED
+  contract CDATA #IMPLIED
+>
+
+
+
+<!-- Build Section of DTD -->
+<!ELEMENT build (option* | target+ | targetList+ | unitList+ | configuration+)*>
+
+<!ELEMENT unitList (unitRef+)>
+<!-- e.g. common, beech, cedar, etc -->
+<!ATTLIST unitList
+  name ID #REQUIRED
+  description CDATA #REQUIRED
+>
+
+<!ELEMENT unitRef EMPTY>
+<!-- Reference to unit in System Model -->
+<!ATTLIST unitRef
+  unit IDREF #REQUIRED
+>
+
+<!ELEMENT targetList EMPTY>
+<!-- e.g. DEFAULT_7.0S, TOOLS_7.0S, etc -->
+<!ATTLIST targetList
+  name ID #REQUIRED
+  description CDATA #REQUIRED
+  target IDREFS #REQUIRED
+>
+
+<!ELEMENT target EMPTY>
+<!-- e.g. WINS, WINSCW, ARM4, etc -->
+<!ATTLIST target
+  name ID #REQUIRED
+  abldTarget CDATA #REQUIRED
+  description CDATA #REQUIRED
+>
+
+<!ELEMENT option EMPTY>
+<!-- e.g. Keepgoing, SaveSpace, etc -->
+<!ATTLIST option
+  name ID #REQUIRED
+  abldOption CDATA #REQUIRED
+  description CDATA #REQUIRED
+  enable (Y | N | y | n) #REQUIRED
+>
+
+<!ELEMENT configuration (unitListRef+ | layerRef+ | task+)*>
+<!-- 7.0s, 8.0a, 8.0b, cuskit, etc -->
+<!ATTLIST configuration
+  name ID #REQUIRED
+  description CDATA #REQUIRED
+  filter CDATA #REQUIRED
+>
+<!ELEMENT task ( unitListRef* , (buildLayer | specialInstructions))>
+
+<!ELEMENT unitListRef EMPTY>
+<!-- Reference to unitList -->
+<!ATTLIST unitListRef
+  unitList IDREF #REQUIRED
+>
+
+<!ELEMENT layerRef EMPTY>
+<!-- Reference to named entity in the model, usually a layer -->
+<!ATTLIST layerRef
+  layerName CDATA #REQUIRED
+>
+
+<!ELEMENT buildLayer EMPTY>
+<!-- bldmake, abld export, etc -->
+<!ATTLIST buildLayer
+  command CDATA #REQUIRED
+  targetList IDREFS #IMPLIED
+  unitParallel (Y | N | y | n) #REQUIRED
+  targetParallel (Y | N | y | n) #IMPLIED
+>
+
+<!ELEMENT specialInstructions EMPTY>
+<!-- BootStrap -->
+<!ATTLIST specialInstructions
+  name CDATA #REQUIRED
+  cwd CDATA #REQUIRED
+  command CDATA #REQUIRED
+>
+
+]>
+
+<SystemDefinition name="IpVideo" schema="1.48">
+
+ <systemModel>
+   <layer name="IpVideo layer">
+     <module name="IpVideo module">
+       <unit unitID="IpVideo" name="IpVideo" bldFile="IpVideo\group" mrp=""/>
+     </module>
+   </layer>
+ </systemModel>
+
+ <build>
+   <option name="KEEPGOING" abldOption="-keepgoing" description="Causes make to keepgoing on errors" enable="Y"/>
+   <option name="SAVESPACE" abldOption="-savespace" description="Causes the removal of intermediate files" enable="Y"/>
+   <target name="ARMV5" abldTarget="armv5" description="RVCT Compiler"/>
+
+   <targetList name="default" description="Main Targets" target="ARMV5"/>
+
+   <unitList name="IpVideo_list" description="">
+     <unitRef unit="IpVideo"/>
+   </unitList>
+
+   <configuration name="IpVideo_config" description="Build IpVideo" filter="">
+       
+     <unitListRef unitList="IpVideo_list"/>
+
+     <task><buildLayer command="bldmake bldfiles" unitParallel="Y"/></task>
+     <task><buildLayer command="abld export" unitParallel="Y"/></task>
+     <task><buildLayer command="abld makefile" targetList="default" unitParallel="Y" targetParallel="N"/></task>
+     <task><buildLayer command="abld resource" targetList="default" unitParallel="N" targetParallel="N"/></task>
+     <task><buildLayer command="abld library" targetList="default" unitParallel="N" targetParallel="N"/></task>
+     <task><buildLayer command="abld target" targetList="default" unitParallel="Y" targetParallel="Y"/></task>
+     <task><buildLayer command="abld final" targetList="default" unitParallel="N" targetParallel="N"/></task>
+     <task><buildLayer command="abld -what export" unitParallel="Y"/></task>
+     <task><buildLayer command="abld -what target" targetList="default" unitParallel="Y" targetParallel="Y"/></task>
+     <task><buildLayer command="abld help" unitParallel="Y"/></task>
+     <task><buildLayer command="abld -check build" targetList="default" unitParallel="Y" targetParallel="Y"/></task>
+   </configuration>
+
+ </build>
+</SystemDefinition>
+
Binary file videofeeds/vccommon/conf/videocenter.confml has changed
Binary file videofeeds/vccommon/conf/videocenter_102750E2.crml has changed
Binary file videofeeds/vccommon/conf/videocenteralr.confml has changed
Binary file videofeeds/vccommon/conf/videocenteralr_2000B438.crml has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videofeeds/vccommon/data/backup_registration_eng.xml	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,12 @@
+<?xml version="1.0" standalone="yes"?>
+<backup_registration version="1.0">
+    <passive_backup>
+      <include_directory name = "\" />
+      <include_file name = "services.dat" />
+      <include_file name = "SmDbVersion.dat" />
+    </passive_backup>
+    <public_backup>
+      <include_directory name = "C:\system\data\nokia\videocenter" />
+      <include_directory name = "E:\system\data\nokia\videocenter" />
+    </public_backup>
+</backup_registration>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videofeeds/vccommon/data/backup_registration_scheduler.xml	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,8 @@
+<?xml version="1.0" standalone="yes"?>
+<backup_registration>
+    <passive_backup>
+      <include_directory name = "\" />
+    </passive_backup>
+    <system_backup/>
+    <restore requires_reboot = "no"/>
+</backup_registration>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videofeeds/vccommon/data/cenrep/backup_registration_eng.xml	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,5 @@
+<?xml version="1.0" standalone="yes"?>
+<backup_registration version="1.0">
+      <proxy_data_manager sid = "0x10202BE9" />
+      <restore requires_reboot = "no"/>   
+</backup_registration>
Binary file videofeeds/vccommon/data/cenrep/keys_videocenter.xls has changed
Binary file videofeeds/vccommon/data/cenrep/keys_videocenter4.xls has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videofeeds/vccommon/data/iptvvodui.ini	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,1 @@
+[lastview]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videofeeds/vccommon/data/livetv_provisioningfile.vcfg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nv:ServiceProvider xmlns:nv="www.nokia.com/multimedia/video-service" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" nv:schemaLocation="www.forum.nokia.com/multimedia/video-service/IPTVProvSchema" Version="1.0">
+	<nv:Service Type="LiveTV" Protocol="DVB-IPI" ID="test-1" Timestamp="2004-14-13T09:30:47.0Z">
+		<nv:ServiceDetails>
+			<nv:Text xml:lang="en">
+				<nv:Title>IPTV Demo</nv:Title>
+				<nv:Description>Live TV</nv:Description>
+			</nv:Text>
+		</nv:ServiceDetails>
+		<nv:ServiceURI>http://193.65.64.241/dvb/sdns/service_discovery</nv:ServiceURI>
+		<nv:IconURI></nv:IconURI>
+		<nv:serviceAccountURI></nv:serviceAccountURI>
+		<nv:Auth>
+			<nv:UserName></nv:UserName>
+			<nv:Password></nv:Password>
+		</nv:Auth>
+		<nv:IAP></nv:IAP>
+	</nv:Service>
+</nv:ServiceProvider>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videofeeds/vccommon/data/services_rom.xml	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--Sample XML file generated by XMLSpy v2006 sp2 U (http://www.altova.com)-->
+
+<nv:ServiceProvider xmlns:nv="www.nokia.com/multimedia/video-service" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" nv:schemaLocation="www.forum.nokia.com/multimedia/video-service/IPTVProvSchema" Version="1.0">
+	
+	<nv:Service Type="Browser" Protocol="HTTP" ProviderID="http://servicecatalogue.nokia.com/nokia/test" Timestamp="2004-12-13T09:30:47.0Z">
+		<nv:ServiceDetails>
+			<nv:Text xml:lang="en">
+				<nv:Title>qtn_iptv_video_directory_list</nv:Title>
+				<nv:Description>Nokia Service Catalogue</nv:Description>
+			</nv:Text>
+		</nv:ServiceDetails>
+		<nv:ServiceURI>http://servicecatalogue.nokia.com/area/van/dir</nv:ServiceURI>
+		<nv:IconURI>z:\resource\apps\qgn_prop_iptv_add_services.mif</nv:IconURI>
+		<nv:serviceAccountURI></nv:serviceAccountURI>
+		<nv:Auth>
+			<nv:UserName></nv:UserName>
+			<nv:Password></nv:Password>
+		</nv:Auth>
+		<nv:IAP></nv:IAP>
+	</nv:Service>
+			
+					
+</nv:ServiceProvider>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videofeeds/vccommon/data/services_rom_dvbh.xml	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--Sample XML file generated by XMLSpy v2006 sp2 U (http://www.altova.com)-->
+
+<nv:ServiceProvider xmlns:nv="www.nokia.com/multimedia/video-service" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" nv:schemaLocation="www.forum.nokia.com/multimedia/video-service/IPTVProvSchema" Version="1.0">
+	
+	<nv:Service Type="Browser" Protocol="HTTP" ProviderID="http://servicecatalogue.nokia.com/nokia/test" Timestamp="2004-12-13T09:30:47.0Z">
+		<nv:ServiceDetails>
+			<nv:Text xml:lang="en">
+				<nv:Title>qtn_iptv_video_directory_list</nv:Title>
+				<nv:Description>Nokia Service Catalogue</nv:Description>
+			</nv:Text>
+		</nv:ServiceDetails>
+		<nv:ServiceURI>http://servicecatalogue.nokia.com/area/van/dir</nv:ServiceURI>
+		<nv:IconURI>z:\resource\apps\qgn_prop_iptv_add_services.mif</nv:IconURI>
+		<nv:serviceAccountURI></nv:serviceAccountURI>
+		<nv:Auth>
+			<nv:UserName></nv:UserName>
+			<nv:Password></nv:Password>
+		</nv:Auth>
+		<nv:IAP></nv:IAP>
+	</nv:Service>
+			
+					
+</nv:ServiceProvider>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videofeeds/vccommon/data/services_sis.xml	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--Sample XML file generated by XMLSpy v2006 sp2 U (http://www.altova.com)-->
+
+<nv:ServiceProvider xmlns:nv="www.nokia.com/multimedia/video-service" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" nv:schemaLocation="www.forum.nokia.com/multimedia/video-service/IPTVProvSchema" Version="1.0">
+	
+  <nv:Service Type="Browser" Protocol="HTTP" ProviderID="http://servicecatalogue.nokia.com/nokia/test" Timestamp="2004-12-13T09:30:47.0Z">
+    <nv:ServiceDetails>
+      <nv:Text xml:lang="en">
+        <nv:Title>qtn_iptv_video_directory_list</nv:Title>
+        <nv:Description>Nokia Service Catalogue</nv:Description>
+      </nv:Text>
+    </nv:ServiceDetails>
+    <nv:ServiceURI>http://servicecatalogue.nokia.com/area/van/dir</nv:ServiceURI>
+    <nv:IconURI>c:\resource\apps\qgn_prop_iptv_add_services.mif</nv:IconURI>
+    <nv:serviceAccountURI></nv:serviceAccountURI>
+    <nv:Auth>
+      <nv:UserName></nv:UserName>
+      <nv:Password></nv:Password>
+    </nv:Auth>
+    <nv:IAP></nv:IAP>
+  </nv:Service>
+
+</nv:ServiceProvider>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videofeeds/vccommon/data/services_sis_dvbh.xml	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--Sample XML file generated by XMLSpy v2006 sp2 U (http://www.altova.com)-->
+
+<nv:ServiceProvider xmlns:nv="www.nokia.com/multimedia/video-service" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" nv:schemaLocation="www.forum.nokia.com/multimedia/video-service/IPTVProvSchema" Version="1.0">
+	
+  <nv:Service Type="Browser" Protocol="HTTP" ProviderID="http://servicecatalogue.nokia.com/nokia/test" Timestamp="2004-12-13T09:30:47.0Z">
+    <nv:ServiceDetails>
+      <nv:Text xml:lang="en">
+        <nv:Title>qtn_iptv_video_directory_list</nv:Title>
+        <nv:Description>Nokia Service Catalogue</nv:Description>
+      </nv:Text>
+    </nv:ServiceDetails>
+    <nv:ServiceURI>http://servicecatalogue.nokia.com/area/van/dir</nv:ServiceURI>
+    <nv:IconURI>c:\resource\apps\qgn_prop_iptv_add_services.mif</nv:IconURI>
+    <nv:serviceAccountURI></nv:serviceAccountURI>
+    <nv:Auth>
+      <nv:UserName></nv:UserName>
+      <nv:Password></nv:Password>
+    </nv:Auth>
+    <nv:IAP></nv:IAP>
+  </nv:Service>
+
+</nv:ServiceProvider>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videofeeds/vccommon/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,37 @@
+/*
+* 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:    Build information file for Ipvideo*
+*/
+
+
+#include <platform_paths.hrh> // for conf file export macros
+
+/**
+ * Automatic helps
+ */
+#include "../help/group/bld.inf"
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../conf/videocenter.confml              APP_LAYER_CONFML(videocenter.confml)
+../conf/videocenter_102750E2.crml       APP_LAYER_CRML(videocenter_102750E2.crml)
+../conf/videocenteralr.confml           APP_LAYER_CONFML(videocenteralr.confml)
+../conf/videocenteralr_2000B438.crml    APP_LAYER_CRML(videocenteralr_2000B438.crml)
+
+../loc/ipvideo.loc            APP_LAYER_LOC_EXPORT_PATH( ipvideo.loc )
+
+PRJ_MMPFILES
Binary file videofeeds/vccommon/help/data/xhtml.zip has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videofeeds/vccommon/help/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,26 @@
+/*
+* 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 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 <platform_paths.hrh>				
+PRJ_EXPORTS
+:zip ../data/xhtml.zip   /epoc32/data/z/resource/ overwrite
+:zip ../data/xhtml.zip   /epoc32/winscw/c/resource/ overwrite
+
+../inc/iptv.hlp.hrh	MW_LAYER_PLATFORM_EXPORT_PATH(csxhelp/iptv.hlp.hrh)
+../rom/videocenterhelps_variant.iby		CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(videocenterhelps_variant.iby)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videofeeds/vccommon/help/inc/iptv.hlp.hrh	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,40 @@
+/*
+* 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 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: 
+*
+*/
+
+	
+//
+// iptv.hlp.hrh generated by CSXHelp Utilities.
+//           
+
+#ifndef __IPTV_HLP_HRH__
+#define __IPTV_HLP_HRH__
+
+_LIT(KIPTV_HLP_VOD_GROUPING, "IPTV_HLP_VOD_GROUPING"); // 
+_LIT(KIPTV_HLP_MAIN_STATE, "IPTV_HLP_MAIN_STATE"); // 
+_LIT(KIPTV_HLP_VODCAST_MAIN, "IPTV_HLP_VODCAST_MAIN"); // 
+_LIT(KIPTV_HLP_SERVICE_SELECTION_VOD, "IPTV_HLP_SERVICE_SELECTION_VOD"); // 
+_LIT(KIPTV_HLP_SERVICE_SELECTION_WEB, "IPTV_HLP_SERVICE_SELECTION_WEB"); // 
+_LIT(KIPTV_HLP_VOD_CATEGORIES, "IPTV_HLP_VOD_CATEGORIES"); // 
+_LIT(KIPTV_HLP_VOD, "IPTV_HLP_VOD"); // 
+_LIT(KIPTV_HLP_SCHEDULE_DOWNLOAD, "IPTV_HLP_SCHEDULE_DOWNLOAD"); // 
+_LIT(KIPTV_HLP_STORAGE, "IPTV_HLP_STORAGE"); // 
+_LIT(KIPTV_HLP_SETTINGS, "IPTV_HLP_SETTINGS"); // 
+_LIT(KIPTV_HLP_SERVICE_SEL_VODCAST, "IPTV_HLP_SERVICE_SEL_VODCAST"); // 
+_LIT(KIPTV_HLP_ADD_SERVICE, "IPTV_HLP_ADD_SERVICE"); // 
+_LIT(KLCAM_HLP_VIEWFINDER_VIDEO_EM, "LCAM_HLP_VIEWFINDER_VIDEO_EM"); // 
+
+#endif 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videofeeds/vccommon/help/rom/videocenterhelps_variant.iby	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,29 @@
+/*
+* 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 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 __VIDEOCENTERHELPS_VARIANT_IBY__
+#define __VIDEOCENTERHELPS_VARIANT_IBY__
+
+#if defined(FF_S60_HELPS_IN_USE)
+    data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x102750E2\contents.zip, RESOURCE_FILES_DIR\xhtml\%02d\0x102750E2\contents.zip)
+    data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x102750E2\index.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x102750E2\index.xml)
+    data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x102750E2\keywords.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x102750E2\keywords.xml)
+    data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x102750E2\meta.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x102750E2\meta.xml)
+#endif
+
+#endif
\ No newline at end of file
Binary file videofeeds/vccommon/icons/break_logo.mif has changed
Binary file videofeeds/vccommon/icons/google_logo.mif has changed
Binary file videofeeds/vccommon/icons/logo_karpat.mif has changed
Binary file videofeeds/vccommon/icons/logo_media_charger.mif has changed
Binary file videofeeds/vccommon/icons/logo_mobiletv.mif has changed
Binary file videofeeds/vccommon/icons/logo_nokrock_1.mif has changed
Binary file videofeeds/vccommon/icons/logo_nseries.jpg has changed
Binary file videofeeds/vccommon/icons/logo_nseries_studio.mif has changed
Binary file videofeeds/vccommon/icons/logo_nseries_studio_1.mif has changed
Binary file videofeeds/vccommon/icons/logo_promo_videos.mif has changed
Binary file videofeeds/vccommon/icons/logo_promo_videos_1.mif has changed
Binary file videofeeds/vccommon/icons/logo_summer_party_2006_1.mif has changed
Binary file videofeeds/vccommon/icons/logo_yle_24.mif has changed
Binary file videofeeds/vccommon/icons/oululogo.mif has changed
Binary file videofeeds/vccommon/icons/oululogo_1.mif has changed
Binary file videofeeds/vccommon/icons/qgn_iptv_video_store_list.jpg has changed
Binary file videofeeds/vccommon/icons/qgn_prop_iptv_add_services.mif has changed
Binary file videofeeds/vccommon/icons/reuters_logo.mif has changed
Binary file videofeeds/vccommon/icons/rocketboom_logo.mif has changed
Binary file videofeeds/vccommon/icons/siemens.gif has changed
Binary file videofeeds/vccommon/icons/thomson_logo.mif has changed
Binary file videofeeds/vccommon/icons/videocenter_prog_clip.jpg has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videofeeds/vccommon/loc/ipvideo.loc	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,2165 @@
+/*
+* Copyright (c) 2005-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:    IPTV / Video Center application localisation strings*
+*/
+
+
+
+
+
+// Do not include other localisation files here, does not work with generated files.
+
+
+// LOCALISATION STRINGS
+
+
+//d:Displayed on Main UI ring (as label for icon) when "Add new services"
+//d:browser link is focused.
+//d:Operator customizable item
+//l:iptv_main_pane_menu_portrait
+//r:5.0
+//
+#define qtn_iptv_new_service_main               "Add new services"
+
+//d:Title of the Videos application in the main screen
+//d: Used also in general settings plugin title.
+//d: Ui Spec sec 1.4 Corrections April 2009 (p9)
+//l:title_pane_t2/opt9
+//r:5.2
+
+#define qtn_vcx_title_suite          "Videos"
+
+//d:last is an addejective meaning the most recently watched
+//d: UI Spec sec 5 Main View(p19)
+//l: list_logical_template_6a_title
+//r:5.0
+#define qtn_vcx_ns_list_last_watched          "Last watched"
+
+//d:%U is the name of the last watched video clip if last watched item was
+//d:a video clip, or the name of the last viewed TV channel if a TV channel
+//d:was last watched item, or empty, if the user has not watched video or TV
+//d:at all, or if last watched video is not available
+//d: UI Spec sec 5 Main View(p19)
+//l: list_logical_template_6a_detail
+//r:5.0
+
+#define qtn_vcx_ns_list_last_watched_name          "%U"
+
+//d:The videos the user has in his terminal
+//d: UI Spec sec 5 Main View(p20) 
+//l:list_logical_template_6a_title
+//r:5.0
+
+#define qtn_vcx_ns_list_my_videos          "My videos"
+
+
+//d:Detail for my videos item in matrix
+//d:to be shown, in case there is no videos in the device
+//d: UI Spec sec 5 Main View(p21) 
+//l:list_logical_template_6a_detail
+//r:5.0
+
+#define qtn_vcx_ns_list_no_videos         "No videos"
+
+//d:%N is total amount of videos in My videos, to be used in matrix
+//d: UI Spec sec 5 Main View(p20)
+//l:list_logical_template_6a_detail
+//r:5.0
+
+#define qtn_vcx_ns_list_my_videos_amount          "%N videos"
+
+//d:When there is only ONE video, to be used in matrix
+//d: UI Spec sec 5 Main View(p20)
+//l:list_logical_template_6a_detail
+//r:5.0
+
+#define qtn_vcx_ns_list_my_videos_amount_one          "1 video"
+
+//d:A video feed is a group of channels that have videos that 
+//d:can be downloaded by the user.
+//d: UI Spec sec 5 Main View(p21)
+//l:list_logical_template_6a_title
+//r:5.0
+
+#define qtn_vcx_ns_list_video_feeds          "Video feeds"
+
+//d:video_feeds_amount
+//d:%N is the amount of available video feeds in the Video feeds view
+//d: UI Spec sec 5 Main View(p21)
+//l:list_logical_template_6a_detail
+//r:5.0
+
+#define qtn_vcx_ns_list_video_feeds_amount          "%N video feeds"
+
+//d:options settings opens the application configuration.
+//d: UI Spec sec 5 Main View(p22)
+//l:list_single_pane_t1_cp2
+//r:5.0
+//
+#define qtn_vcx_options_settings          "Settings"
+
+//d:in ptions menu, it starts a selected item from the matrix menu 
+//d: UI Spec sec 5 Main View(p22)
+//l:list_single_pane_t1_cp2
+//r:5.0
+//
+#define qtn_vcx_options_open          "Open"
+
+// d:Main list's "Video directory" item's first text line.
+// d: Not in UI spec.
+// l:list_double_large_graphic_pane_t1
+// r:5.0
+//
+#define qtn_iptv_video_directory_list "Video directory"
+
+// d:Main list's "Nokia video store" item's first text line
+// l:list_double_large_graphic_pane_t1
+// r:5.0
+//
+#define qtn_iptv_video_store_list	"Nokia video store"
+
+//d:Second line for main list view's video storage item, there is one new video.
+//d: used in matrix menu
+//d: UI Spec sect 5 page 14
+//d:%U is the name of the new video.
+//l:list_logical_template_6a_detail
+//r:5.0
+//
+#define qtn_vcx_ns_one_new_video "1 new video: %U"
+
+//d:Second line for main list view's video storage item, there is
+//d:more than 1 new videos. %N is the count of new videos, %u is the name of
+//d:the last added video.
+//d:used in matrix menu
+//d:UI Spec sect 5 page 14
+//l:list_logical_template_6a_detail
+//r:5.0
+//
+#define qtn_vcx_ns_n_new_videos "%0N new videos: %1U"
+
+//d:Second line for main list view's vodcast item, there is no video feeds.
+//d: UI spec sec 5 Video Tile - Main View (p23)
+//l:list_logical_template_6a_detail
+//r:5.0
+//
+#define qtn_vcx_ns_no_feeds  "No feeds"
+
+//d:Second line for main list view's vodcast item, there is one video feed.
+//l:list_logical_template_6a_detail
+//d: UI spec sec 5 Video Tile - Main View (p21)
+//r:5.0
+//
+#define qtn_vcx_ns_one_feed  "1 feed"
+
+
+/*
+* ==============================================================================
+*  Main UI: application settings state
+* ==============================================================================
+*/
+
+
+//d:Title pane text in application settings state
+//d: Ui Spec sec 14.5 Add Service (p95)
+//l:title_pane_t2/opt9
+//r:5.0
+//
+#define qtn_iptv_settings_title                 "Settings"
+
+//d:Command in options menu in application settings state. 
+//d:Opens the focused setting item.
+//l:list_single_pane_t1_cp2
+//r:5.0
+//
+#define qtn_iptv_open_service_selection_setting "Open"
+
+//d:Command in options menu in application settings state. 
+//d:Opens editor for the focused setting item.
+//d: Ui Spec sec 14.5 Add Service (p95)
+//l:list_single_pane_t1_cp2
+//r:5.0
+//
+#define qtn_iptv_change_setting                 "Change"
+
+//d:Name of setting item in application settings state.
+//d:Opens the service selection state.
+//l:list_setting_pane_t1
+//r:5.0
+//
+#define qtn_iptv_service_selection_setting      "Video service selection"
+
+//d:Name of setting item in application settings state.
+//d:Defines which memory is used for downloaded videos.
+//d: Ui spec sec 14 Application Settings (p85)
+//l:list_setting_pane_t1
+//r:5.0
+//
+#define qtn_iptv_memory_setting                 "Preferred memory"
+
+//d:Possible value for "Preferred memory" setting item.
+//d: Ui spec sec 14 Application Settings (p88)
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_iptv_setting_phone_memory          "Phone memory"
+
+//d:Possible value for "Preferred memory" setting item.
+//d: Ui spec sec 14 Application Settings (p88)
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_iptv_setting_memory_card           "Memory card"
+
+//d:Possible value for "Preferred memory" setting item.
+//d: Ui spec sec 14 Application Settings (p88)
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_iptv_locked_memory_card            "Locked memory card"
+
+//d:Possible value for "Preferred memory" setting item.
+//d: Ui spec sec 14 Application Settings (p88)
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_iptv_setting_mass_memory           "Mass memory"
+
+//d:Name of setting item in application settings state.
+//d:Defines if thumbnail pictures are shown in the VoD service state.
+//d: Ui spec sec 14 Application Settings (p88)
+//l:list_setting_pane_t1
+//r:5.0
+//
+#define qtn_iptv_setting_thumbnails             "Thumbnails"
+
+//d:Possible value for "Thumbnails" setting item.
+//d:Indicates that thumbnail setting is on.
+//d: Ui spec sec 14 Application Settings (p88)
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_iptv_setting_on                    "On"
+
+//d:Possible value for "Thumbnails" setting item.
+//d:Indicates that thumbnail setting is off.
+//d: Ui spec sec 14 Application Settings (p88)
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_iptv_setting_off                   "Off"
+
+//d:Title of "Service type" view of application settings state.
+//d: Ui spec sec 14.3 Video Sevice Selection Settings (p93)
+//l:title_pane_t2/opt9
+//r:5.0
+//
+#define qtn_iptv_service_selection_title    "Video service selection"
+
+//d:Command in options menu in "Service selection" view of application settings state
+//d: Ui spec sec 14.3 Video Sevice Selection Settings (p94)
+//l:list_single_pane_t1_cp2
+//r:5.0
+//
+#define qtn_iptv_mark_service                    "Mark"
+
+//d:Command in options menu in "Service selection" view of application settings state.
+//d: Ui spec sec 14.3 Video Sevice Selection Settings (p94)
+//l:list_single_pane_t1_cp2
+//r:5.0
+//
+#define qtn_iptv_unmark_service                  "Unmark"
+
+//d:Displayed in confirmation query when user removes a video service
+//d:in "Service selection" view of application settings state. The service type is
+//d:either VoD or LiveTv (these services are called video services).
+//d:%U is the name of the service
+//d: Ui spec sec 14.3 Video Sevice Selection Settings (p94) (remove feed)
+//l:popup_note_window
+//r:5.0
+//
+#define qtn_iptv_remove_service_confirmation     "Remove video service %U?"
+
+//d:Displayed in confirmation query when user removes a video service
+//d:in "Service selection" view of application settings state. The service type is
+//d:Vodcast (these services are called feeds).
+//d:%U is the name of the feed
+//d: Ui Spec sec 7.1 Video Feeds Main View(p26)
+//l:popup_note_window
+//r:5.0
+//
+#define qtn_iptv_remove_feed_confirmation        "Remove feed %U?"
+
+//d:Empty list text in "Service selection" view of application settings state when
+//d:there is no services. The service type is either VoD or LiveTv.
+//d:Ui spec chapt 14.3 p 83
+//l:main_list_empty_pane
+//r:5.0
+//
+#define qtn_iptv_no_video_services               "No services"
+
+//d:Command in options menu in "Service selection" view of application settings state
+//d:and in Vodcast feed view.
+//d:Opens the vodcast feed details dialog.
+//d: Ui Spec sec 7.1 Video Feeds Main View(p26)
+//l:list_single_pane_t1_cp2
+//r:5.0
+//
+#define qtn_iptv_feed_details                    "Feed details"
+
+//d:Menu item in "Service selection" view of application settings state.
+//d: Ui Spec sec 14.3 Video service selection setting (p94)
+//l:list_single_pane_t1_cp2
+//r:5.0
+//
+#define qtn_iptv_edit_feed                       "Edit feed"
+
+//d:Menu item in "Service selection" view of application settings state.
+//d: Ui Spec sec 14.3 Video service selection setting (p94)
+//l:list_single_pane_t1_cp2
+//r:5.0
+//
+#define qtn_iptv_remove_feed                     "Remove feed"
+
+//d:Menu item in "Service selection" view of application settings state.
+//d: Ui Spec sec 14.3 Video service selection setting (p94)
+//l:list_single_pane_t1_cp2
+//r:5.0
+//
+#define qtn_iptv_add_feed                        "Add feed"
+
+//d:Second line for "Default access points" setting item.
+//d:Describes that there is several access points selected as default.
+//d:%N is the number of the selected access points
+//d: Ui Spec sec 8.7 Scheduled downloads (p45)
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_iptv_multiple_ap_selected         "%N selected"
+
+//d:Name of the setting item that has service's name when adding or
+//d:editing a service.
+//d: Ui Spec sec 14.3 Video service selection setting (p95)
+//l:list_setting_pane_t1
+//r:5.0
+//
+#define qtn_iptv_service_name        "Name"
+
+//d:Default value for the "Name" setting item when adding a new service.
+//d: Ui Spec sec 14.3 Video service selection setting (p95)
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_iptv_new_service_default "Default"
+
+//d:Name of the setting item that has service's address when adding or
+//d:editing a service.
+//d: Ui Spec sec 14.3 Video service selection setting (p95)
+//l:list_setting_pane_t1
+//r:5.0
+//
+#define qtn_iptv_service_address     "Address"
+
+//d:Description of service that user has added from Settings.
+//d:Will be shown in service details dialog.
+//d: Ui Spec sec 14.4 Video service details (p95)
+//l:popup_info_list_pane_t1
+//r:5.0
+//
+#define qtn_iptv_user_defined_service  "User defined service"
+
+//d:Displays the current SW version number of Video Center
+//d: Ui Spec sec 14.4 Video service details (p95)
+//l:list_setting_pane_t1
+//r:5.0
+//
+#define qtn_vcx_setting_version_number          "Version "
+
+/*
+* ==============================================================================
+*  IAP Selection
+* ==============================================================================
+*/
+
+//d:If there is an usable connection available, a wait note is displayed while
+//d:the connection is being established. The text for the wait note is for e.g.
+//d:'Connecting via MyHomeWlan'
+//d: Not in UI spec. probably not needed after OCC?
+//l:popup_note_wait_window
+//r:5.0
+//
+#define qtn_iptv_connecting_wait_note           "Connecting via %U"
+
+
+/*
+* ==============================================================================
+*  My Videos UI
+* ==============================================================================
+*/
+
+
+//d:General command in options menu and context sensitive menu 
+//d:Plays selected video clip 
+//d: Ui Spec sec 8.4 Video list (p36)
+//l:list_single_pane_t1_cp2
+//r:5.0
+//
+#define qtn_iptv_play  "Play"
+
+//d:Command in options menu .
+//d:Opens selected folder.
+//d: Ui Spec sec 13 My Videos (p75)
+//l:list_single_pane_t1_cp2
+//r:5.0
+//
+#define qtn_iptv_open_folder  "Open"
+
+//d:Command in options menu.
+//d:Deletes selected video clip (used only for completed files).
+//d: Ui Spec sec 13.1 My Videos sub levels (p79)
+//l:list_single_pane_t1_cp2
+//r:5.0
+//
+#define qtn_iptv_delete_video_clip  "Delete"
+
+//d:General command in options menu
+//d:Cancels ongoing download or download of that video has failed.
+//d: Ui Spec sec 13.1 My Videos sub levels (p80)
+//l:list_single_pane_t1_cp2
+//r:5.0
+//
+#define qtn_iptv_cancel_download  "Cancel download"
+
+//d:General command in options menu
+//d:Shows details of video clip.
+//d: Ui Spec sec 13.1 My Videos sub levels (p81)
+//l:list_single_pane_t1_cp2
+//r:5.0
+//
+#define qtn_iptv_video_details  "Video details"
+
+//d:Title pane text in My videos view
+//d: Ui Spec sec 13 My Videos (p73)
+//l:title_pane_t2/opt9
+//r:5.0
+//
+#define qtn_iptv_my_videos_title    "My Videos"
+
+//d:Displayed in progress note when My Videos UI is copying a file
+//d:to new location.
+//d:%U is the name of the file
+//d: Ui Spec sec 13.1 My Videos sub levels (p82)
+//l:popup_note_wait_window
+//r:5.0
+//
+#define qtn_iptv_copying_one  "Copying %U"
+
+//d:Displayed in progress note when My Videos UI is copying several
+//d:files to new location.
+//d: Ui Spec sec 13.1 My Videos sub levels (p82)
+//l:popup_note_wait_window
+//r:5.0
+//
+#define qtn_iptv_copying_many  "Copying files"
+
+//d:Displayed in progress note when My Videos UI is moving file
+//d:to new location.
+//d:%U is the name of the file
+//d: Ui Spec sec 13.1 My Videos sub levels (p82)
+//l:popup_note_wait_window
+//r:5.0
+//
+#define qtn_iptv_moving_one  "Moving %U"
+
+//d:Displayed in progress note when My Videos UI is moving several
+//d:files to new location.
+//d: Ui Spec sec 13.1 My Videos sub levels (p82)
+//l:popup_note_wait_window
+//r:5.0
+//
+#define qtn_iptv_moving_many  "Moving files"
+
+//d:Title pane text in application settings state service details view, 
+//d:VoD video details view and My Videos details view
+//d: Ui Spec sec 14.4 Service details (p95)
+//l:heading_pane_t1
+//r:5.0
+//
+#define qtn_iptv_details_header  "Details:"
+
+//d:Name of the video in Video Details dialog.
+//d:%U is the name of the video under the text "Title"
+//d: Not in UI spec
+//l:popup_info_list_pane_t1
+//r:5.0
+//
+#define qtn_iptv_video_name "Name: %U"
+
+//d:Language of the video in VOD Video Details dialog.
+//d:%U is the language of the video
+//l:popup_info_list_pane_t1
+//r:5.0
+//
+#define qtn_iptv_video_language "Language: %U"
+
+//d:Length of the video (hours and minutes) in Video Details dialog.
+//d:%0N is the length of the video in full hours
+//d:%1N is the minutes exceeding the last full hours
+//l:popup_info_list_pane_t1
+//r:5.0
+//
+#define qtn_iptv_video_length "Length: %0N h %1N min"
+
+//d:Size of the video in Video Details dialog.
+//d:%N is the video size in kilobytes
+//d: Ui Spec sec 13.3 Memory status (p84)
+//l:popup_info_list_pane_t1
+//r:5.0
+//
+#define qtn_iptv_size_kb  "Size: %N kB"
+
+//d:Size of the video in Video Details dialog.
+//d:%N is the video size in megabytes
+//d: Ui spec sec 13.3 Memory status (p84)
+//l:popup_info_list_pane_t1
+//r:5.0
+//
+#define qtn_iptv_size_mb  "Size: %N MB"
+
+//d:Size of the video in Video Details dialog.
+//d:%N is the video size in gigabytes
+//d: Ui spec sec 13.3 Memory status (p84)
+//l:popup_info_list_pane_t1
+//r:5.0
+//
+#define qtn_iptv_size_gb  "Size: %N GB"
+
+//d:Description of the video in Video Details dialog.
+//d:%U is the description of the video clip taken from the ECG
+//d:Ui spec chapt 8.6 Figure 8
+//l:popup_info_list_pane_t1
+//r:5.0
+//
+#define qtn_iptv_video_description "Description: %U"
+
+//d:Menu item for Memory Status dialog.
+//d: Ui Spec sec 13 My Videos (p75)
+//l:list_single_pane_t1_cp2
+//r:5.0
+//
+#define qtn_iptv_memory_status "Memory status"
+
+//d:Title of Memory Status dialog.
+//d: Ui spec sec 13.3 Memory status (p84)
+//l:heading_pane_t1
+//r:5.0
+//
+#define qtn_iptv_memory_status_header "Memory status:"
+
+//d:Title of free memory part of Memory Status dialog.
+//d: Ui spec sec 13.3 Memory status (p84)
+//l:popup_info_list_pane_t1
+//r:5.0
+//
+#define qtn_iptv_free_memory  "Free memory:"
+
+//d:Percentage display for free/used memory in Memory Status dialog.
+//d:
+//d:Same string is also used in r6 to display download progress information
+//d:in percentages on Vod UI and My Videos UI item's second row.
+//d: Ui spec sec 13.3 Memory status (p84)
+//l:popup_info_list_pane_t1
+//r:5.0
+//
+#define qtn_iptv_memory_percentage  "%N %"
+
+//d:Title of used memory part of Memory Status dialog.
+//d: Ui spec sec 13.3 Memory status (p84)
+//l:popup_info_list_pane_t1
+//r:5.0
+// 
+#define qtn_iptv_used_memory  "Used memory:"
+
+//d:Size of the video (kilobytes) in Memory Status dialog.
+//d: Ui spec sec 13.3 Memory status (p84)
+//l:popup_info_list_pane_t1
+//r:5.0
+//
+#define qtn_iptv_size_kb_short  "%N kB"
+
+//d:Size of the video (megabytes) in Memory Status dialog.
+//d: Ui spec sec 13.3 Memory status (p84)
+//l:popup_info_list_pane_t1
+//r:5.0
+//
+#define qtn_iptv_size_mb_short  "%N MB"
+
+//d:Size of the video (gigabytes) in Memory Status dialog.
+//d: Ui spec sec 13.3 Memory status (p84)
+//l:popup_info_list_pane_t1
+//r:5.0
+//
+#define qtn_iptv_size_gb_short  "%N GB"
+
+//d:This confirmation note is displayed when 
+//d:a download of video has been cancelled by user.
+//d: Ui spec sec 8.4 Video list (p39)
+//l:popup_note_window/opt2
+//r:5.0
+//
+#define qtn_iptv_download_canceled  "Download canceled"
+
+//d:This error note is displayed when ongoing download fails.
+//d:%U is the name of video clip.
+//d: Ui spec sec 17 Error cases (p108)
+//l:popup_note_window/opt2
+//r:5.0
+//
+#define qtn_iptv_download_failed_note  "Download failed: %U"
+
+//d:Info pop-up note shown to user when video service added.
+//d: Ui Spec sec 7.1.2	Video feeds view content and service installation promotion (p27)
+//l:popup_note_window/opt2
+//r:5.0
+//
+#define qtn_iptv_added_service_open  "Video service added successfully. Open?"
+
+//d:page 69 qtn_iptv_downloads_title Videos downloaded by the user.
+//d: Ui Spec sec 13.1	My Videos sub-levels(p75)
+//l:title_pane_t2/opt9
+//r:5.0
+
+#define qtn_vcx_downloads_title          "Downloads"
+
+//d:Video list title pane text for videos captured by the user.
+//l:title_pane_t2/opt9
+//r:5.2
+//
+#define qtn_vcx_captured_title          "Captured videos"
+
+/*
+* ==============================================================================
+*  My Videos UI : DRM
+* ==============================================================================
+*/
+
+
+//d:This is displayed in view info popup.
+//d:Count label. In parentheses there will be either play, display, execute or print word.
+//d:When checking the length of this string, replace %U with the longest translation of 
+//d:the following strings: qtn_iptv_drm_mgr_det2_display, qtn_iptv_drm_mgr_det2_play, 
+//d:qtn_iptv_drm_mgr_det2_execute, and qtn_iptv_drm_mgr_det2_print.
+//d: Ui spec sec 16.11 OMA DRM in video details (p100)
+//l:list_double_pane_t1_cp2
+//r:5.0
+//
+#define qtn_iptv_drm_mgr_det_utl_x "Times left (%U)"
+
+//d:This is displayed in view info popup
+//d:Count data. 1 count
+//d: Ui spec sec 16.11 OMA DRM in video details (p100)
+//l:list_double_pane_t2_cp2
+//r:5.0
+//
+#define qtn_iptv_drm_mgr_det_1_count "1 count"
+
+//d:This is displayed in view info popup
+//d:Count data. more than 1 count
+//d: Ui spec sec 16.11 OMA DRM in video details (p100)
+//l:list_double_pane_t2_cp2
+//r:5.0
+//
+#define qtn_iptv_drm_mgr_det_n_counts "%N counts"
+
+//d:Possible second line for fourth entry of Details View listbox
+//d:It reports that the time constraint for this type of object is 1 year. 
+//d:Other quantities of time may follow.
+//d: Ui spec sec 16.11 OMA DRM in video details (p102)
+//l:list_double_pane_t2_cp2
+//r:5.0
+//
+#define qtn_iptv_drm_nbr_of_years_one "1 year"
+
+//d:Possible second line for fourth entry of Details View listbox
+//d:%N number of years of an interval
+//d:It is used for period of years ending with 1 from 21 (21, 31, 41,etc.)
+//d:It reports that the time constraint for this type of object is %N years.
+//d:Other quantities of time may follow.
+//d: Ui spec sec 16.11 OMA DRM in video details (p102)
+//l:list_double_pane_t2_cp2
+//r:5.0
+//
+#define qtn_iptv_drm_nbr_of_years_one_final "%N years"
+
+//d:Possible second line for fourth entry of Details View listbox
+//d:%N number of years of an interval
+//d:It is used for period of years ending from 2 to 4, excluded 12-14 (2-4, 
+//d:22-24, 32-34, etc.)
+//d:It reports that the time constraint for this type of object is %N years.
+//d:Other quantities of time may follow.
+//d: Ui spec sec 16.11 OMA DRM in video details (p102)
+//l:list_double_pane_t2_cp2
+//r:5.0
+//
+#define qtn_iptv_drm_nbr_of_years_two_four "%N years"
+
+//d:Possible second line for fourth entry of Details View listbox
+//d:%N number of years of an interval
+//d:It is used for period of years ending from 5 to 0 plus range between 11 and 
+//d:14 (5-20, 25-30, 35-40, etc.)
+//d:It reports that the time constraint for this type of object is %N years.
+//d:Other quantities of time may follow.
+//d: Ui spec sec 16.11 OMA DRM in video details (p102)
+//l:list_double_pane_t2_cp2
+//r:5.0
+//
+#define qtn_iptv_drm_nbr_of_years_five_zero "%N years"
+
+//d:Possible second line for fourth entry of Details View listbox
+//d:It reports that the time constraint for this type of object is 1 month. 
+//d:Other quantities of time may precede or follow.
+//d: Ui spec sec 16.11 OMA DRM in video details (p102)
+//l:list_double_pane_t2_cp2
+//r:5.0
+//
+#define qtn_iptv_drm_nbr_of_months_one "1 month"
+
+//d:Possible second line for fourth entry of Details View listbox
+//d:%N number of months of an interval
+//d:It is used for period from two to four months
+//d:It reports that the time constraint for this type of object is %N months. 
+//d:Other quantities of time may precede or follow.
+//d: Ui spec sec 16.11 OMA DRM in video details (p102)
+//l:list_double_pane_t2_cp2
+//r:5.0
+//
+#define qtn_iptv_drm_nbr_of_months_two_four "%N months"
+
+//d:Possible second line for fourth entry of Details View listbox
+//d:%N number of months of an interval
+//d:It is used for period greater than four months
+//d:It reports that the time constraint for this type of object is %N months. 
+//d:Other quantities of time may precede or follow.
+//d: Ui spec sec 16.11 OMA DRM in video details (p102)
+//l:list_double_pane_t2_cp2
+//r:5.0
+//
+#define qtn_iptv_drm_nbr_of_months_five_zero "%N months"
+
+//d:Possible second line for fourth entry of Details View listbox
+//d:It reports that the time constraint for this type of object is 1 day. 
+//d:Other quantities of time may precede or follow.
+//d: Ui spec sec 16.11 OMA DRM in video details (p102)
+//l:list_double_pane_t2_cp2
+//r:5.0
+//
+#define qtn_iptv_drm_nbr_of_days_one "1 day"
+
+//d:Possible second line for fourth entry of Details View listbox
+//d:%N number of days of an interval
+//d:It is used for a period of 21 days
+//d:It reports that the time constraint for this type of object is %N days. 
+//d:Other quantities of time may precede or follow.
+//d: Ui spec sec 16.11 OMA DRM in video details (p102)
+//l:list_double_pane_t2_cp2
+//r:5.0
+//
+#define qtn_iptv_drm_nbr_of_days_one_final "%N days"
+
+//d:Possible second line for fourth entry of Details View listbox
+//d:%N number of days of an interval
+//d:It is used for period of days ending from 2 to 4, excluded 12-14 (2-4, 
+//d:22-24)
+//d:It reports that the time constraint for this type of object is %N days. 
+//d:Other quantities of time may precede or follow.
+//d: Ui spec sec 16.11 OMA DRM in video details (p102)
+//l:list_double_pane_t2_cp2
+//r:5.0
+//
+#define qtn_iptv_drm_nbr_of_days_two_four "%N days"
+
+//d:Possible second line for fourth entry of Details View listbox
+//d:%N number of days of an interval
+//d:It is used for period of days ending from 5 to 0 plus range between 11 and 
+//d:14 (5-20, 25-30)
+//d:It reports that the time constraint for this type of object is %N days. 
+//d:Other quantities of time may precede or follow.
+//d: Ui spec sec 16.11 OMA DRM in video details (p102)
+//l:list_double_pane_t2_cp2
+//r:5.0
+//
+#define qtn_iptv_drm_nbr_of_days_five_zero "%N days"
+
+//d:Possible second line for fourth entry of Details View listbox
+//d:It reports that the time constraint for this type of object is 1 hour. 
+//d:Other quantities of time may precede or follow.
+//d: Ui spec sec 16.11 OMA DRM in video details (p102)
+//l:list_double_pane_t2_cp2
+//r:5.0
+//
+#define qtn_iptv_drm_nbr_of_hours_one "1 hour"
+
+//d:Possible second line for fourth entry of Details View listbox
+//d:%N number of hours of an interval
+//d:It is used for a period of 21 hours
+//d:It reports that the time constraint for this type of object is %N hours.
+//d:Other quantities of time may precede or follow.
+//d: Ui spec sec 16.11 OMA DRM in video details (p103)
+//l:list_double_pane_t2_cp2
+//r:5.0
+//
+#define qtn_iptv_drm_nbr_of_hours_one_final "%N hours"
+
+//d:Possible second line for fourth entry of Details View listbox
+//d:%N number of hours of an interval
+//d:It is used for period of hours ending from 2 to 4, excluded 12-14 (2-4, 
+//d:22-23)
+//d:It reports that the time constraint for this type of object is %N hours.
+//d:Other quantities of time may precede or follow.
+//d: Ui spec sec 16.11 OMA DRM in video details (p103)
+//l:list_double_pane_t2_cp2
+//r:5.0
+//
+#define qtn_iptv_drm_nbr_of_hours_two_four "%N hours"
+
+//d:Possible second line for fourth entry of Details View listbox
+//d:%N number of hours of an interval
+//d:It is used for a period included from 5 to 20 hours
+//d:It reports that the time constraint for this type of object is %N hours.
+//d:Other quantities of time may precede or follow.
+//d: Ui spec sec 16.11 OMA DRM in video details (p103)
+//l:list_double_pane_t2_cp2
+//r:5.0
+//
+#define qtn_iptv_drm_nbr_of_hours_five_zero "%N hours"
+
+//d:Possible second line for fourth entry of Details View listbox
+//d:It reports that the time constraint for this type of object is 1 minute. 
+//d:Other quantities of time may precede or follow.
+//d: Ui spec sec 16.11 OMA DRM in video details (p103)
+//l:list_double_pane_t2_cp2
+//r:5.0
+//
+#define qtn_iptv_drm_nbr_of_mins_one "1 minute"
+
+//d:Possible second line for fourth entry of Details View listbox
+//d:%N number of minutes of an interval
+//d:It is used for period of minutes ending with 1 from 21 (21, 31, 41, 51)
+//d:It reports that the time constraint for this type of object is %N minutes.
+//d:Other quantities of time may precede or follow.
+//d: Ui spec sec 16.11 OMA DRM in video details (p103)
+//l:list_double_pane_t2_cp2
+//r:5.0
+//
+#define qtn_iptv_drm_nbr_of_mins_one_final "%N minutes"
+
+//d:Possible second line for fourth entry of Details View listbox
+//d:%N number of minutes of an interval
+//d:It is used for period of minutes ending from 2 to 4, excluded 12-14 (2-4,
+//d:22-24, 32-34, 42-44, 52-54)
+//d:It reports that the time constraint for this type of object is %N minutes.
+//d:Other quantities of time may precede or follow.
+//d: Ui spec sec 16.11 OMA DRM in video details (p103)
+//l:list_double_pane_t2_cp2
+//r:5.0
+//
+#define qtn_iptv_drm_nbr_of_mins_two_four "%N minutes"
+
+//d:Possible second line for fourth entry of Details View listbox
+//d:%N number of minutes of an interval
+//d:It is used for period of minutes ending from 5 to 0 plus range between 11 
+//d:and 14 (5-20, 25-30, 35-40, 45-50, 53-59)
+//d:It reports that the time constraint for this type of object is %N minutes.
+//d:Other quantities of time may precede or follow.
+//d: Ui spec sec 16.11 OMA DRM in video details (p103)
+//l:list_double_pane_t2_cp2
+//r:5.0
+//
+#define qtn_iptv_drm_nbr_of_mins_five_zero "%N minutes"
+
+//d:Possible second line for fourth entry of Details View listbox
+//d:It reports that the time constraint for this type of object is 1 second. 
+//d:Other quantities of time may precede.
+//d: Ui spec sec 16.11 OMA DRM in video details (p103)
+//l:list_double_pane_t2_cp2
+//r:5.0
+//
+#define qtn_iptv_drm_nbr_of_secs_one "1 second"
+
+//d:Possible second line for fourth entry of Details View listbox
+//d:%N number of seconds of an interval
+//d:It is used for period of seconds ending with 1 from 21 (21, 31, 41, 51)
+//d:It reports that the time constraint for this type of object is %N seconds.
+//d:Other quantities of time may precede.
+//d: Ui spec sec 16.11 OMA DRM in video details (p103)
+//l:list_double_pane_t2_cp2
+//r:5.0
+//
+#define qtn_iptv_drm_nbr_of_secs_one_final "%N seconds"
+
+//d:Possible second line for fourth entry of Details View listbox
+//d:%N number of seconds of an interval
+//d:It is used for period of seconds ending from 2 to 4, excluded 12-14 (2-4,
+//d:22-24, 32-34, 42-44, 52-54)
+//d:It reports that the time constraint for this type of object is %N seconds.
+//d:Other quantities of time may precede.
+//d: Ui spec sec 16.11 OMA DRM in video details (p103)
+//l:list_double_pane_t2_cp2
+//r:5.0
+//
+#define qtn_iptv_drm_nbr_of_secs_two_four "%N seconds"
+
+//d:Possible second line for fourth entry of Details View listbox
+//d:%N number of seconds of an interval
+//d:It is used for period of minutes ending from 5 to 0 plus range between 11 
+//d:and 14 (5-20, 25-30, 35-40, 45-50, 53-59)
+//d:It reports that the time constraint for this type of object is %N seconds.
+//d:Other quantities of time may precede.
+//d:Ui spec chapt 12.1
+//l:list_double_pane_t2_cp2
+//r:5.0
+//
+#define qtn_iptv_drm_nbr_of_secs_five_zero "%N seconds"
+
+//d:This is displayed in view info popup
+//d:Interval data. One measurement
+//d: Ui spec sec 16.11 OMA DRM in video details (p101)
+//l:list_double_pane_t2_cp2
+//r:5.0
+//
+#define qtn_iptv_drm_mgr_det_inter "%U"
+
+//d:This is displayed in view info popup
+//d:Interval data. Two measurement
+//d: Ui spec sec 16.11 OMA DRM in video details (p101)
+//l:list_double_pane_t2_cp2
+//r:5.0
+//
+#define qtn_iptv_drm_mgr_det_inter_two "%0U, %1U"
+
+//d:Possible first line for fourth entry of Details View listbox
+//d:Second line is qtn_iptv_drm_mgr_det_inter or 
+//d:qtn_iptv_drm_mgr_det_inter_two, meaning a quantity of time that
+//d:specifies how long this object can be used.
+//d: Ui spec sec 16.11 OMA DRM in video details (p101)
+//l:list_double_pane_t1_cp2
+//r:5.0
+//
+#define qtn_iptv_drm_mgr_det_accum_time_left "Usage time left"
+
+//d:This is displayed in view info popup.
+//d:Interval time left label. In parentheses there will be either play, 
+//d:display, execute or print word.
+//d:When checking the length of this string, replace %U with the longest translation of 
+//d:the following strings: qtn_iptv_drm_mgr_det2_display, qtn_iptv_drm_mgr_det2_play, 
+//d:qtn_iptv_drm_mgr_det2_execute, and qtn_iptv_drm_mgr_det2_print.
+//d: Ui spec sec 16.11 OMA DRM in video details (p101)
+//l:list_double_pane_t1_cp2
+//r:5.0
+//
+#define qtn_iptv_drm_mgr_det_udl_x "Time left (%U)"
+
+//d:This is displayed in view info popup.
+//d:Interval label, which is not activated. In parentheses there will be either play, 
+//d:display, execute or print word.
+//d:When checking the length of this string, replace %U with the longest translation of 
+//d:the following strings: qtn_iptv_drm_mgr_det2_display, qtn_iptv_drm_mgr_det2_play, 
+//d:qtn_iptv_drm_mgr_det2_execute, and qtn_iptv_drm_mgr_det2_print.
+//d: Ui spec sec 16.11 OMA DRM in video details (p101)
+//l:list_double_pane_t1_cp2
+//r:5.0
+//
+#define qtn_iptv_drm_mgr_det_uts_x "Times status (%U)"
+
+//d:This is displayed in view info popup
+//d:Interval data. Not activated
+//d: Ui spec sec 16.11 OMA DRM in video details (p101) 
+//l:list_double_pane_t2_cp2
+//r:5.0
+//
+#define qtn_iptv_drm_mgr_det_not_act "Not activated"
+
+//d:This is displayed in view info popup.
+//d:Date and time label. Beginning time. In parentheses there will be either play, 
+//d:display, execute or print word.
+//d:When checking the length of this string, replace %U with the longest translation of 
+//d:the following strings: qtn_iptv_drm_mgr_det2_display, qtn_iptv_drm_mgr_det2_play, 
+//d:qtn_iptv_drm_mgr_det2_execute, and qtn_iptv_drm_mgr_det2_print.
+//d: Ui spec sec 16.11 OMA DRM in video details (p101)
+//l:list_double_pane_t1_cp2
+//r:5.0
+//
+#define qtn_iptv_drm_mgr_det_rvf_x	"Valid from (%U)"
+
+//d:This is displayed in view info popup.
+//d:Date and time label. Ending time. In parentheses there will be either play, 
+//d:display, execute or print word.
+//d:When checking the length of this string, replace %U with the longest translation of 
+//d:the following strings: qtn_iptv_drm_mgr_det2_display, qtn_iptv_drm_mgr_det2_play, 
+//d:qtn_iptv_drm_mgr_det2_execute, and qtn_iptv_drm_mgr_det2_print.
+//d: Ui spec sec 16.11 OMA DRM in video details (p101)
+//l:list_double_pane_t1_cp2
+//r:5.0
+//
+#define qtn_iptv_drm_mgr_det_rvt_x "Valid until (%U)"
+
+//d:This is displayed in view info popup
+//d:Full Rights label. In parentheses there will be either play, display, execute or print word.
+//d:When checking the length of this string, replace %U with the longest translation of 
+//d:the following strings: qtn_iptv_drm_mgr_det2_display, qtn_iptv_drm_mgr_det2_play, 
+//d:qtn_iptv_drm_mgr_det2_execute, and qtn_iptv_drm_mgr_det2_print.
+//d: Ui spec sec 16.11 OMA DRM in video details (p100)
+//l:list_double_pane_t1_cp2
+//r:5.0
+//
+#define qtn_iptv_drm_mgr_det_full_x "Rights (%U)"
+
+//d:This is displayed in view info popup
+//d:Full Rights data, unlimited usage
+//d: Ui spec sec 16.11 OMA DRM in video details (p100)
+//l:list_double_pane_t2_cp2
+//r:5.0
+//
+#define qtn_iptv_drm_mgr_det_unlimited "Unlimited"
+
+//d:First line of first entry of Details View listbox
+//d:It indicates the current status of the selected Right Object
+//d:Second line is qtn_drm_mgr_det_valid or qtn_drm_mgr_det_exp
+//d: Ui spec sec 16.12 Windows Media DRM (p104)
+//l:list_double_pane_t1_cp2
+//r:5.0
+//
+#define qtn_iptv_drm_mgr_det_stat "Status"
+
+//d:Text in information note
+//d: Ui spec sec 16.11 OMA DRM in video details (p100)
+//l:popup_note_window/opt2
+//r:5.0
+//
+#define qtn_iptv_drm_mgr_det_exp "Usage rights have expired"
+
+//d:Possible second line for first entry of Details View listbox
+//d: Ui spec sec 16.11 OMA DRM in video details (p100)
+//l:list_double_pane_t2_cp2
+//r:5.0
+//
+#define qtn_iptv_drm_mgr_det_valid "Activation key is valid"
+
+//d:This is displayed in view info popup
+//d:Type of rights, play
+//d: Ui spec sec 16.11 OMA DRM in video details (p100)
+//l:navi_navi_text_pane_srt_t1
+//r:5.0
+//
+#define qtn_iptv_drm_mgr_det2_play "play"
+
+//d:This is displayed in view info popup
+//d:Type of rights, display
+//d: Ui spec sec 16.11 OMA DRM in video details (p100)
+//l:navi_navi_text_pane_srt_t1
+//r:5.0
+//
+#define qtn_iptv_drm_mgr_det2_display "view"
+
+//d:This is displayed in view info popup
+//d:Type of rights, execute
+//d: Ui spec sec 16.11 OMA DRM in video details (p100)
+//l:navi_navi_text_pane_srt_t1
+//r:5.0
+//
+#define qtn_iptv_drm_mgr_det2_execute "use"
+
+//d:This is displayed in view info popup
+//d:Type of rights, print
+//d: Ui spec sec 16.11 OMA DRM in video details (p100)
+//l:navi_navi_text_pane_srt_t1
+//r:5.0
+//
+#define qtn_iptv_drm_mgr_det2_print "print"
+
+//d:This is displayed in view info popup
+//d:Sending label.
+//d: Ui spec sec 16.11 OMA DRM in video details (p100) 
+//l:list_double_pane_t1_cp2
+//r:5.0
+//
+#define qtn_iptv_drm_mgr_det_cs "Content sending"
+
+//d:This is displayed in view info popup
+//d:Sending data. Item sending is allowed
+//d: Ui spec sec 16.11 OMA DRM in video details (p101)
+//l:list_double_pane_t2_cp2
+//r:5.0
+//
+#define qtn_iptv_drm_mgr_det_allowed "Allowed"
+
+//d:This is displayed in view info popup
+//d:Sending data. Item sending is forbidden
+//d: Ui spec sec 16.11 OMA DRM in video details (p102)
+//l:list_double_pane_t2_cp2
+//r:5.0
+//
+#define qtn_iptv_drm_mgr_det_forbid "Forbidden"
+
+/*
+* ==============================================================================
+*  VOD UI
+* ==============================================================================
+*/
+
+//d:Command in video list options menu and context sensitive menu
+//d:Starts video download.
+//d: Ui Spec sec 8.4 Video List (p36)
+//l:list_single_pane_t1_cp2
+//r:5.0
+//
+#define qtn_iptv_download			    		"Download"
+
+//d:Command in video list options menu and context sensitive menu
+//d:Resumes the download if possible, visible for video which 
+//d:download has failed.
+//d: Ui Spec sec 8.4 Video List (p36)
+//l:list_single_pane_t1_cp2
+//r:5.0
+//
+#define qtn_iptv_resume_download        		"Resume download"
+
+//d:Command in video list options menu.
+//d:Opens the web link in embedded browser ( if it its provided 
+//d:within the video clip data ).
+//d: Ui Spec sec 8.4 Video List (p40)
+//l:list_single_pane_t1_cp2
+//r:5.0
+//
+#define qtn_iptv_open_link            		    "Open link in browser"
+
+//d:When there is no data in ECG data stored from previous usage, 
+//d:video list is initially empty. This text is displayed in 
+//d:the empty view.
+//d: Ui Spec modification on Nov 2008 (p10)
+//l:list_view_text_empty
+//r:5.0
+//
+#define qtn_vcx_ns_updating_items					"Updating items"
+
+//d:page17 qtn_iptv_wait_general_connecting
+//d:displayed while the terminal connects to internet
+//d:Not needed after OCC
+//l:popup_note_wait_window
+//r:5.0
+
+#define qtn_vcx_wait_general_connecting            "Connecting"	
+
+//d:If the video list is empty, this text is shown in the empty list.
+//d: Ui Spec sec 8.4 Video List (p35)
+//l:main_list_empty_pane
+//r:5.0
+//
+#define qtn_iptv_no_videos						"(No videos)"
+
+//d:If the video list is empty, this text is shown in the empty list.
+//d: Ui Spec sec 8.5 Video search (p42)
+//l:list_view_text_empty
+//r:5.0
+//
+#define qtn_vcx_ns_no_videos						"(No videos)"
+
+//d:Command in vodcast feed view options menu.
+//d:Opens the feed and displays the Vodcast video list.
+//d: Ui Spec sec 7.1 Video feeds main view (p26)
+//l:list_single_pane_t1_cp2
+//r:5.0
+//
+#define qtn_iptv_open_feed               		"Open"
+
+//d:Command in vodcast feed view options menu and in context sensitive menu. 
+//d:Opens the Vodcast service list in the service selection settings.
+//d: Ui Spec sec 7.1 Video feeds main view (p26)
+//l:list_single_pane_t1_cp2
+//r:5.0
+//
+#define qtn_iptv_feed_subscriptions      		"Feed subscriptions"
+
+//d:Command in vodcast feed view.
+//d:Connects to the server and updates the contents of all subscribed feeds.
+//d: Ui Spec sec 7.1 Video feeds main view (p26)
+//l:list_single_pane_t1_cp2
+//r:5.0
+//
+#define qtn_iptv_feed_refresh            		"Refresh feeds"
+
+//d:Additional text for the vodcast feed list item indicating that
+//d:feed is being updated
+//d: Ui Spec sec 7.1 Video feeds main view (p27)
+//l:list_double_large_graphic_pane_t2_cp2
+//r:5.0
+//
+#define qtn_iptv_updating_feed           		"Updating"
+
+//d:Additional text for the vodcast feed list item indicating that
+//d:update of the feed was failed
+//l:list_double_large_graphic_pane_t2_cp2
+//r:5.0
+//
+#define qtn_iptv_feed_update_failed           	"Update failed"
+
+//d:In case there are not any feeds subscribed this text is displayed
+//d:in empty feed list.
+//l:main_list_empty_pane
+//r:5.0
+//
+#define qtn_iptv_no_feeds_selected       		"(No feeds)"  
+
+//d:If downloading of content catalog fails for some reason 
+//d:this error note is displayed
+//d: Ui spec sec 17 Error cases (p108)
+//l:popup_note_window/opt2
+//r:5.0
+//
+#define qtn_iptv_content_update_failed			"Content catalog update failed" 
+
+//d:Additional text for the video list item indicating that video is being
+//d:downloaded. 
+//d:%N is the percentage showing how much of the file is already downloaded.
+//l:list_double_large_graphic_pane_t2_cp2
+//r:5.0
+//
+#define qtn_iptv_video_downloading				"Downloading %N%"
+
+//d:Additional text for the list item indicating that downloading of the video
+//d:is paused. 
+//d:%N is the percentage showing how much of the file got downloaded before pausing.
+//d: Ui spec sec 7.1 Indicating progress in list items (p27)
+//l:list_double_large_graphic_pane_t2_cp2
+//r:5.0
+//
+#define qtn_iptv_download_paused                "Download paused %N%"
+
+//d:Additional text for the list item indicating that downloading of the video
+//d:has been failed. 
+//d:%N is the percentage showing how much of the file got downloaded before failing.
+//d: Ui spec sec 13.1 My videos- sub levels (p78)
+//l:list_double_large_graphic_pane_t2_cp2
+//r:5.0
+//
+#define qtn_iptv_download_failed				"Download failed %N%"
+
+//d:Additional text for the video list item indicating that video 
+//d:has already been downloaded.
+//d: Ui spec sec 8.4 Video list (p35)
+//l:list_double_large_graphic_pane_t2_cp2
+//r:5.0
+//
+#define qtn_iptv_video_downloaded				"Downloaded"
+
+//d:When resuming the download has been failed this information note 
+//d:is displayed to user.
+//d: Ui spec sec 8.4 Video list (p39) 
+//l:popup_note_window
+//r:5.0
+//
+#define qtn_iptv_resume_not_possible            "Resuming download not possible, downloading complete video"
+
+//d:When the user selects to play or download a video which cannot be found 
+//d:from the server, this information note is displayed.
+//d: Ui spec sec 17 Error cases (p108)
+//l:popup_note_window/opt2
+//r:5.0
+//
+#define qtn_iptv_video_missing_from_server		"Video missing from the server"
+
+//d:During the ECG update this info pop-up note is shown to user.
+//d:Ui Spec changed to qtn_vcx_ns_updating_feed on Nov 2003
+//l:popup_preview_text_window_t1
+//r:5.0
+//
+#define qtn_iptv_updating						"Updating"
+
+//d:When device memory is full and user tries to download video or update 
+//d:service contents (ECG), this confirmation query is shown.
+//d:Ui spec sec 16.5 memory full (p98)
+//l:popup_note_window/opt2
+//r:5.0
+//
+#define qtn_iptv_memory_full_delete_data		"Memory full. Free some memory by deleting videos or some other data in the phone"
+
+//d:If the user tries to install a service through provisioning and service type
+//d:is not supported, this information note is displayed.
+//d:Ui spec sec 17.4 invalid service type (p110)
+//l:popup_note_window/opt2
+//r:5.0
+//
+#define qtn_iptv_invalid_service_type           "Invalid service"
+
+//d:This error note is displayed when invalid data is received 
+//d:eg. some metadata related error occurs.
+//d:Ui spec sec 17.4 invalid service type (p109)
+//l:popup_note_window/opt2
+//r:5.0
+//
+#define qtn_iptv_invalid_data					"Invalid data received"
+
+//d:Title pane text for Vodcast feed view where subscribed. Used in VC Rel4.
+//d:feeds are listed.
+//d:Ui spec sec 7.1 Video feeds - Main view (p24)
+//l:title_pane_t2/opt9
+//r:5.0
+//
+#define qtn_iptv_video_feeds_title              "Video feeds"
+
+//d:Title of the window that shows the list of
+//d:videos in the resulsts view
+//d: Ui Spec sec 8.5 Video Search (p12)
+//l:title_pane_t2/opt9
+//r:5.0
+//
+#define qtn_vcx_title_video_search          "Video search"
+
+//d:When Video feeds view is opened and before list has been
+//d:created, this text is shown in the empty list.
+//d: Ui spec sec 7.1 Video feeds - main view(p24) 
+//l:list_view_text_empty
+//r:5.0
+//
+#define qtn_vcx_ns_opening_feeds                  "Opening" 
+
+//d:page 25 qtn_iptv_list_video_directory
+//d:opens the browser and goes to the Nokia video directory
+//d: Ui spec sec 7.1 Video feeds - main view(p25)
+//l:list_logical_template_7_title
+//r:5.0
+//
+#define qtn_vcx_ns_list_video_directory          "Video directory"
+
+/*
+* ==============================================================================
+*  Soft Notification
+* ==============================================================================
+*/
+
+
+//d:Service settings can be received over the air. After the settings have been received, 
+//d:the phone asks the user if the service should be installed.
+//d:%U is the name of the service 
+//d: Ui Spec sec 16.3 Receiving OTA settings (p98)
+//l:popup_note_window/opt2
+//r:5.0
+//
+#define qtn_iptv_install_service "Install video service: %U"
+
+
+/*
+* ==============================================================================
+*  Rel2 new strings
+* ==============================================================================
+*/
+
+
+//d:Menu item in "Service selection" view of application settings state.
+//l:list_single_pane_t1_cp2
+//r:5.0
+//
+#define qtn_iptv_web_link_details               "Web link details"
+
+//d:Menu item in "Service selection" view of application settings state.
+//l:list_single_pane_t1_cp2
+//r:5.0
+//
+#define qtn_iptv_remove_web_link                "Remove web link"
+
+//d:Displayed in confirmation query when user removes a web link service
+//d:in "Web link service selection" view of application settings state. 
+//d:The service type is Web link.
+//d:%U is the name of the web link
+//l:popup_note_window/opt2
+//r:5.0
+//
+#define qtn_iptv_remove_web_link_confirmation   "Remove web link %U?"
+
+//d:In case there are not any web links subscribed this text is displayed
+//d:in empty web links list.
+//l:main_list_empty_pane
+//r:5.0
+//
+#define qtn_iptv_no_web_links                   "(No links)"  
+
+//d:Author of the video in Video Details dialog.
+//d:%U is the author of the video
+//d:see UI spec chapt 8.6 figure 8
+//l:popup_info_list_pane_t1
+//r:5.0
+//
+#define qtn_iptv_author                         "Author: %U"
+
+//d:Copyright of the video in Video Details dialog.
+//d:%U is the copyright of the video
+//d:see UI spec chapt 8.6 figure 8
+//l:popup_info_list_pane_t1
+//r:5.0
+//
+#define qtn_iptv_copyright                      "Copyright: %U"
+
+//d:In case there is an account management URI available for the service this 
+//d:option item is displayed in options menu
+//d: Ui spec sec 7.1 Video feeds main view (p26)
+//l:list_single_pane_t1_cp2
+//r:5.0
+//
+#define qtn_iptv_manage_account                 "Manage account"
+
+//d:Prompt text for the remove service message query
+//d:If there is URI available for the service, a message query is displayed with a
+//d:prompt text, message text and a link.
+//l:heading_pane_t1
+//r:5.0
+//
+#define qtn_iptv_remove_service_header          "Remove service:"
+
+//d:If there is URI available for the service, a message query is displayed with a
+//d:prompt text, message text and a link.
+//d:Message text for the remove service message query
+//l:popup_info_list_pane_t1
+//r:5.0
+//
+#define qtn_iptv_remove_service_with_account    "Do you want to remove the service? You may need to unsubscribe the service before removing."
+
+//d:If there is URI available for the service, a message query is displayed with a
+//d:prompt text, message text and a link.
+//d:Text for the link in remove service message query
+//d:UI spec chapt 7.1 p 20
+//l:popup_info_list_pane_t1
+//r:5.0
+//
+#define qtn_iptv_link_account                   "Manage account"
+
+//d:If there is URI available for the service, a message query is displayed with a
+//d:prompt text, message text and a link.
+//d:Left softkey text for the remove service message query
+//d:when the link is not highlighted in the query
+//d:UI spec chapt 7.1 p 20
+//l:control_pane_t2/opt7
+//r:5.0
+//
+#define qtn_iptv_remove_softkey                 "Remove"
+
+//d:Text shown in information banner when thumbnail download is ongoing
+//d:%0N is the amount of fetched thumbnails
+//d.%1N is the total amount of thumbnails to be fetched
+//d: Ui spec 8.1 openning a video service (p28)
+//l:popup_preview_text_window/opt5
+//r:5.0
+//
+#define qtn_iptv_updated_thumbnails             "Thumbnails %0N / %1N"
+
+//d:Additional text for the video list item informing user about the video length 
+//d:This text is shown if length information is available for video
+//d:and if the video is less than an hour long
+//d:%N is the length in minutes
+//l:list_double_large_graphic_pane_t2_cp2
+//r:5.0
+//
+#define qtn_iptv_video_list_length_min          "%N min"
+
+
+//d:Additional text for the video list item informing user about the video length 
+//d:This text is shown if length information is available for video
+//d:and if the video is more than an hour long. 
+//d:%0N is the length of the video in full hours
+//d:%1N is the minutes exceeding the last full hour. 
+//d: Ui spec 8.4 Video list (p34)
+//l:list_double_large_graphic_pane_t2_cp2
+//r:5.0
+//
+#define qtn_iptv_video_list_length_full         "%0N h %1N min"
+
+//d:Indicates Windows Media DRM status in video details dialog.
+//d:This value is shown when usage rights are ok.
+//d: Ui Spec sec 16.12 Windows Media DRM (p103)
+//l:list_double_pane_t1_cp2
+//r:5.0
+//
+#define qtn_iptv_wmdrm_valid                    "Rights are valid"
+
+//d:Indicates Windows Media DRM status in video details dialog.
+//d:This value is shown when usage rights are not ok.
+//d: Ui Spec sec 16.12 Windows Media DRM (p104)
+//l:list_double_pane_t1_cp2
+//r:5.0
+//
+#define qtn_iptv_wmdrm_invalid                  "Rights are invalid"
+
+//d:Command in My Videos video list options menu
+//d:This option opens UPnP renderer UI from where user can starts showing the selected
+//d:video on remote device. Homenet refers to UPnP home network, not to any brand.
+//d: Ui spec sec 13.1 My Videos sub-level (p81)
+//l:list_single_pane_t1_cp2
+//r:5.0
+//
+#define qtn_iptv_show_via_homenet               "Show via Homenet"
+
+//d:Command in My Videos video list options menu
+//d:This command stops the showing via remote UPnP device. This option is displayed only if 
+//d:showing via homenet is currently on
+//d: Ui spec sec 13.1 My Videos sub-level (p81)
+//l:list_single_pane_t1_cp2
+//r:5.0
+//
+#define qtn_iptv_stop_showing                   "Stop showing"
+
+//d:Additional text for the video list item informing user about the video size
+//d:This text is shown if size information is available for video
+//d:and if size of the video is less than one megabyte
+//d: Ui spec sec 8.4 My Videos list (p34)
+//l:list_double_large_graphic_pane_t2_cp2
+//r:5.0
+//
+#define qtn_iptv_list_size_kb                   "%N kB"
+
+//d:Additional text for the video list item informing user about the video size
+//d:This text is shown if size information is available for video
+//d:and if size of the video is less than one gigabyte
+//d: Ui spec sec 8.4 My Videos list (p34)
+//l:list_double_large_graphic_pane_t2_cp2
+//r:5.0
+//
+#define qtn_iptv_size_list_mb                   "%N MB"
+
+//d:Additional text for the video list item informing user about the video size
+//d:This text is shown if size information is available for video
+//d:and if size of the video is over one gigabyte
+//d: Ui spec sec 8.4 My Videos list (p35)
+//l:list_double_large_graphic_pane_t2_cp2
+//r:5.0
+//
+#define qtn_iptv_size_list_gb                   "%N GB"
+
+//d:Name of setting item in application settings state.
+//d:Opens data query item for selecting the parental rating value which is used 
+//d:to rate the video content.
+//d: Ui spec sec 14.1 Video Settings (p87)
+//l:list_setting_pane_t1
+//r:5.0
+//
+#define qtn_iptv_setting_parental_control       "Parental control"
+
+//d:An item that is presented as e.g. '18 years', on the setting list .
+//d: Ui spec sec 14.1 Video Settings (p87)
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_iptv_parental_control_n_years       "%N years"
+
+//d:When OMA client provisioning message is received, message contains title text
+//d:as spesified below
+//d: Ui spec sec 16.13 OMA Client provisioning(p104)
+//l:msg_body_pane_t2
+//r:5.0
+//
+#define qtn_vcx_ns_service_settings_title       "Videos & TV service settings"
+
+//d:This is a text that is shown in error note in My Videos when deleting of some files or folders
+//d:has failed. 
+//d: Ui spec sec 13.1 My Videos sub-level (p81)
+//l:popup_note_window/opt2
+//r:5.0
+//
+#define qtn_iptv_cant_delete_items              "Unable to delete some items which are currently open."
+
+//d:Menu item that when selected brings user to scheduling dialog/view.
+//d: Ui spec sec 8.3 categories (p33)
+//l:list_single_pane_t1_cp2
+//r:5.0
+//
+#define qtn_iptv_schedule_downloads "Schedule downloads"
+
+//d:Title for a view where user may schedule downloads to be performed later
+//d:Note: in the actual product this header string's layout can adapt to
+//d:long texts and provide more space than is currently available in this
+//d:1-line localisation layout (by providing smaller font automatically).
+//d:If your translation needs more space than the currently allocated pixels,
+//d:you can ignore the macro error about text not fitting in the layout:
+//d:just make sure your translation is correct, but try to keep it as short
+//d:as possible while avoiding abbreviations.
+//d: Ui spec sec 8.7 scheduled downloads (p44)
+//l:title_pane_t2/opt9
+//r:5.0
+//
+#define qtn_iptv_schedule_title "Schedule downloads"
+
+//d:Settings dialog item title letting user to choose from number of download
+//d:methods
+//d: Ui spec sec 8.7 scheduled downloads (p44)
+//l:list_setting_pane_t1
+//r:5.0
+//
+#define qtn_iptv_download_setting "Download"
+
+//d:Item in a list that forces user to pick one of download methods for a scheduled download.
+//d:Selecting this item causes the download not to be automatic in any case. 
+//l:list_set_graphic_pane_t1
+//d: Ui spec sec 8.7 scheduled downloads (p45)
+//r:5.0
+//
+#define qtn_iptv_manual_download "Manual download"
+
+//d:Item in a list that forces user to pick one of download methods for a scheduled download.
+//d:Selecting this item causes the download to happen automatically if wireless lan
+//d:connection is available at the scheduled time.
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_iptv_automatic_in_wlan "Automatic in WLAN"
+
+//d:Item in a list that forces user to pick one of download methods for a scheduled download.
+//d:Selecting this item causes the download to happen automatically if multimedia computer
+//d:is not roaming in other operators gsm/3g network at the scheduled time.
+//d: Ui spec sec 8.7 scheduled downloads (p45)
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_iptv_automatic_in_home_cel "Automatic in home cellular"
+
+//d:Item in a list that forces user to pick one of download methods for a scheduled download
+//d:Selecting this item causes the download to be started regardless of network conditions. 
+//d: Ui spec sec 8.7 scheduled downloads (p45)
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_iptv_automatic_always "Automatic always"
+
+//d:Setting dialog item title for letting user to choose preferred download time
+//d: Ui spec sec 8.7 scheduled downloads (p45)
+//l:list_setting_pane_t1
+//r:5.0
+//
+#define qtn_iptv_download_time_setting "Download time"
+
+//d:Item in a list that forces user to pick one of preferred download times
+//d: Ui spec sec 8.7 scheduled downloads (p45)
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_iptv_scheduled_night "Night"
+
+//d:Item in a list that forces user to pick one of preferred download times
+//d: Ui spec sec 8.7 scheduled downloads (p45)
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_iptv_scheduled_morning "Morning"
+
+//d:Item in a list that forces user to pick one of preferred download times
+//d: Ui spec sec 8.7 scheduled downloads (p45)
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_iptv_scheduled_noon "Noon"
+
+//d:Item in a list that forces user to pick one of preferred download times
+//d: Ui spec sec 8.7 scheduled downloads (p45)
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_iptv_scheduled_afternoon "Afternoon"
+
+//d:Item in a list that forces user to pick one of preferred download times
+//d: Ui spec sec 8.7 scheduled downloads (p46)
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_iptv_scheduled_evening "Evening"
+
+//d:Text that appears in a dialog warning user about multimedia computer battery limitations
+//d: Ui spec sec 8.7 scheduled downloads (p45)
+//l:popup_note_window
+//r:5.0
+//
+#define qtn_iptv_battery_note "Note that automatic download is done only when there is enough power in the battery."
+
+//d:Softkey text for softkey that lets user to download a video clip
+//d: Ui spec sec 8.4 Video List (p36)
+//l:control_pane_t3/opt7
+//r:5.0
+//
+#define qtn_iptv_softkey_download "Download"
+
+//d:Dialog text field prompt for a text field where user is supposed to write a word to search for
+//d: Ui spec sec 8.5 Video search (p41)
+//l:heading_pane_t1
+//r:5.0
+//
+#define qtn_iptv_search_query "Search:"
+
+//d:Text in wait note dialog displayed during search
+//d: Ui spec sec 8.5 Video search (p41)
+//l:popup_note_wait_window
+//r:5.0
+//
+#define qtn_iptv_searching_wait_note "Searching"
+
+//d:Menu item for letting user to select a new search
+//l:list_single_pane_t1_cp2
+//r:5.0
+//
+#define qtn_iptv_new_search "New search"
+
+//d:If video search fails for some reason this error note is displayed
+//d: Ui spec sec 8.5 Video search (p42)
+//l:popup_note_window/opt2
+//r:5.0
+//
+#define qtn_iptv_search_failed "Search failed"
+
+//d:Second line for "Download time" setting item.
+//d:Describes that there is no selected selected time for scheduled downloads.
+//d: Ui spec sec 8.5 Video search (p45)
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_iptv_none_selected_time "None selected"
+
+//d:In case there aren't suitable destination when schedule settings view is
+//d:closed, a note is displayed to inform user that destination has to be selected by
+//d:using destination selection dialog offered by platform.
+//d: Ui spec sec 8.5 Video search (p44)
+//l:popup_note_window
+//r:5.0
+//
+#define qtn_iptv_scheduled_define_destination "Scheduled download requires destination to be used. Select the destination now."
+
+
+/*
+* ==============================================================================
+*  VIDEO STORAGE UI STRINGS
+* ==============================================================================
+*/
+
+
+//d:Command in options menu.
+//d:Opens Sort submenu.
+//d: Ui spec sec 13.1 My Videos sub-level (p81)
+//l:list_single_pane_t1_cp2/opt3
+//r:5.0
+//
+#define qtn_iptv_sort_by "Sort by"
+
+//d:Command in option "Sort by" submenu.
+//d:When selected, videos are listed in chronological order.
+//d: Ui spec sec 13.1 My Videos sub-level (p81)
+//l:list_single_popup_submenu_pane_t1
+//r:5.0
+//
+#define qtn_iptv_sort_by_date "Date"
+
+//d:Command in option "Sort by" submenu.
+//d:When selected, videos are listed in alphabetical order.
+//d: Ui spec sec 13.1 My Videos sub-level (p81)
+//l:list_single_popup_submenu_pane_t1
+//r:5.0
+//
+#define qtn_iptv_sort_by_name "Name"
+
+//d:Command in option "Sort by" submenu.
+//d:When selected, videos are sorted by size, smallest items on top.
+//d: Ui spec sec 13.1 My Videos sub-level (p82)
+//l:list_single_popup_submenu_pane_t1
+//r:5.0
+//
+#define qtn_iptv_sort_by_size "Size"
+
+//d:Command in option "Move and copy" submenu.
+//d:Opens memory selection dialog for copying files.
+//d: Ui spec sec 13.1 My Videos sub-level (p82)
+//l:list_single_popup_submenu_pane_t1
+//r:5.0
+//
+#define qtn_iptv_copy_submenu "Copy"
+
+//d:Command in option "Move and copy" submenu.
+//d:Opens memory selection dialog for moving files.
+//d: Ui spec sec 13.1 My Videos sub-level (p82)
+//l:list_single_popup_submenu_pane_t1
+//r:5.0
+//
+#define qtn_iptv_move_submenu "Move"
+
+//d:List item text on Video Storage UI main level.
+//l:list_double_pane_t1
+//d: Ui Spec sec 13 My videos (p73)
+//r:5.0
+//
+#define qtn_iptv_storage_all_list "All videos"
+
+//d:List item text on Video Storage UI main level.
+//d: Ui Spec sec 13 My videos (p73) (no longer needed)
+//l:list_double_pane_t1
+//r:5.0
+//
+#define qtn_iptv_storage_tv_recordings_list "TV recordings"
+
+//d:List item text on Video Storage UI main level.
+//d: Ui Spec sec 13 My videos (p73)
+//l:list_double_pane_t1
+//r:5.0
+//
+#define qtn_iptv_storage_other_list "Other"
+
+//d:Title pane text on Video Storage UI for All videos view.
+//d: Ui Spec sec 13 My videos (p75)
+//l:title_pane_t2/opt9
+//r:5.0
+//
+#define qtn_iptv_all_videos_title "All videos"
+
+//d:Title pane text on Video Storage UI for TV recordings view.
+//l:title_pane_t2/opt9
+//r:5.0
+//
+#define qtn_iptv_tv_recordings_title "TV recordings"
+
+//d:Video list title pane text for other videos.
+//l:title_pane_t2/opt9
+//r:5.2
+//
+#define qtn_iptv_other_title "Other videos"
+
+//d:Command in option "Mark/Unmark" submenu.
+//d:When selected, starts marking mode (user can mark items from
+//d:video list by clicking them).
+//d:This string is required by single click implementation and
+//d:doesn't appear in UI specification.
+//l:list_single_popup_submenu_pane_t1
+//r:5.2
+//
+#define qtn_iptv_menuitem_markmultiple          "Mark Multiple"
+
+
+/*
+* ==============================================================================
+*  OHTER R4 SPECIFIC STRINGS
+* ==============================================================================
+*/
+
+
+//d:Text for note that is displayed after user has installed a new service to
+//d:Video Center for example through messages, over the air, etc.
+//l:popup_note_window
+//r:5.0
+//
+#define qtn_iptv_service_installed_to_vodcast_note "Service installed to Video feeds"
+
+//d:If user tries to install service that has already been installed, a
+//d:confirmation query with this text is displayed to confirm if an existing service should be overwritten.
+//d:%U is the name of the service
+//d: Ui spec sec 16.3 Receiving OTA settings (p98)
+//l:popup_note_window
+//r:5.0
+//
+#define qtn_iptv_service_exists "Service already installed, installing again will reset the service: %U"
+
+//d:Right softkey text in confirmation query that is displayed when user tries to  
+//d:install service that already exists. Selecting this softkey resets service.
+//d: Ui spec sec 16.3 Receiving OTA settings (p98)
+//l:control_pane_t2/opt7
+//r:5.0
+//
+#define qtn_iptv_softkey_install "Install"
+
+//d:Text for "Add feed" submenu item. Opens the embedded browser 
+//d:with service catalog web page.
+//d:Ui spec sec 7.1 Video feeds - Main view(p26)
+//l:list_single_popup_submenu_pane_t1
+//r:5.0
+//
+#define qtn_iptv_service_catalog_submenu "Via Video directory"
+
+//d:Text for "Add feed" submenu item. 
+//d:Opens Add service state for adding manually a video feed address.
+//d:Ui spec sec 7.1 Video feeds - Main view(p26)
+//l:list_single_popup_submenu_pane_t1
+//r:5.0
+//
+#define qtn_iptv_insert_address_submenu "Insert manually"
+
+//d:Text for "Add feed" option menu item in internet videos view.
+//d:Opens Add feed submenu.
+//d:Ui spec sec 7.1 Video feeds - Main view(p26)
+//l:list_single_pane_t1_cp2/opt3
+//r:5.0
+//
+#define qtn_iptv_add_feed_submenu "Add feed"
+
+//d:Text shown in information banner when thumbnail download is ongoing.
+//d:Special text for case when there is only one thumbnail to download.
+//d:Ui spec sec 8.1 Opening a video service(p28)
+//l:popup_preview_text_window/opt5
+//r:5.0
+//
+#define qtn_iptv_updated_thumbnails_one "Thumbnail 1 / 1"
+
+/*
+* ==============================================================================
+*  ALR (Rel5) STRINGS
+* ==============================================================================
+*/
+
+//d:Text in empty view when no videos were found in search
+//d: Ui spec 8.5 video search (p42)
+//l:list_view_text_empty
+//r:5.0
+//
+#define qtn_vcx_ns_no_videos_found "No videos found"  
+
+/*
+* ==============================================================================
+*  HG UI strings
+* ==============================================================================
+*/
+//d:Ui spec sec 7.1 Video feeds - Main view (p25)
+//d:Followed by the date and time of the last update of the feed. 
+//d:Replace %U with the following strings:
+//d:qtn_date_usual and qtn_time_usual
+//d: 
+//l:list_double_large_graphic_pane_t2_cp2
+//r:5.0
+//
+#define qtn_vcx_hg_last_update          "Last update: %U"
+
+//d:List item in list that, when selected, brings user to video search dialog
+//d:Ui spec sec 8.3 Categories (p31)
+//l:list_double_large_graphic_pane_t1
+//r:5.0
+//
+#define qtn_vcx_hg_video_search "Video search"
+
+//d:String used to indicate that one video was found in a search ; string appears
+//d:in a list together with a heading text telling search category name,
+//d:for example "Search / 1 video found" where / is actually a line break
+//d:Ui spec sec 8.3 Categories (p32)
+//l:list_double_large_graphic_pane_t2
+//r:5.0
+//
+#define qtn_vcx_hg_search_videos_found_one "1 video found"
+
+//d:String that is used to indicate how many videos were found in a search
+//d:%N is the amount of videos found
+//d:Ui spec sec 8.3 Categories (p31)
+//l:list_double_large_graphic_pane_t2
+//r:5.0
+//
+#define qtn_vcx_hg_search_videos_found "%N videos found"
+
+//d:List item in list that user may select to get into video list.
+//d:Ui spec sec 8.3 Categories (p32)
+//l:list_double_pane_t1
+//r:5.0
+//
+#define qtn_vcx_hg_categories_video_list "Videos"
+
+//d:String used to indicate the amount of videos in category.
+//d:%N is the amount of videos.
+//d:Ui spec sec 8.3 Categories (p32)
+//l:list_double_pane_t2
+//r:5.0
+//
+#define qtn_vcx_hg_videos_in_category "%N videos"
+
+//d:Same as qtn_vcx_ns_videos_in_category but used in case where only one video is
+//d:in category.
+//d:Ui spec sec 8.3 Categories (p32)
+//l:list_double_pane_t2
+//r:5.0
+//
+#define qtn_vcx_hg_one_video_in_category "1 video"
+
+//d:Second line for My videos category list item, there is one new video.
+//d:%U is the name of the new video.
+//d:Ui spec sec 13 My videos (p73)
+//l:list_double_pane_t2
+//r:5.0
+//
+#define qtn_vcx_hg_one_new_video          "1 new video: %U"
+
+//d:Second line for My videos category list item, there is 
+//d:more than 1 new videos. %N is the count of new videos, %U is the name of 
+//d:last added video.
+//d:Ui spec sec 13 My videos (p74)
+//l:list_double_pane_t2
+//r:5.0
+//
+#define qtn_vcx_hg_n_new_videos          "%0N new videos: %1U"
+
+//d:Second line for My videos category list item, there is no videos.
+//d:Ui spec sec 13 My videos (p74)
+//l:list_double_pane_t2
+//r:5.0
+//
+#define qtn_vcx_hg_no_videos_in_category "No videos"
+
+//d:List item text on My videos UI main level.
+//d:Ui spec sec 13 My videos (p73)
+//l:list_double_pane_t1
+//r:5.0
+//
+#define qtn_vcx_hg_storage_downloads_list          "Downloads"
+
+//d:List item text on My videos UI main level.
+//d:Ui spec sec 13 My videos (p73)
+//l:list_double_pane_t1
+//r:5.0
+//
+#define qtn_vcx_hg_storage_captured_list          "Captured videos"
+
+//d:Additional text for the video list item informing user about the video length 
+//d:This text is shown if length information is available for video 
+//d:and if the video is more than one minute but less than an hour long.
+//d:%0N is the length of the video in full minutes 
+//d:%1N is the seconds exceeding the last full minute.
+//d: Ui spec  sec 8.4 Video list (p34)
+//l:list_double_large_graphic_pane_t2_cp2
+//r:5.0
+//
+#define qtn_vcx_hg_video_list_length_min_sec         "%0N min %1N sec"
+
+//d:Additional text for the video list item informing user about the video length 
+//d:This text is shown if length information is available for video 
+//d:and if the video is less than one minute long 
+//d:%N is the length in seconds
+//d: Ui spec sec 8.4 Video list (p34)
+//l:list_double_large_graphic_pane_t2_cp2
+//r:5.0
+//
+#define qtn_vcx_hg_video_list_length_sec          "%N sec"
+
+//d:Command in options list
+//d:Opens use video as cascade menu
+//d: Ui spec sec 13.1 My videos - sub levels (p81)
+//l:list_single_pane_t1_cp2/opt3
+//r:5.0
+#define qtn_vcx_hg_options_use_video_as "Use video as"
+
+//d:Main view item text for last watched
+//l:list_double_large_graphic_pane_t1
+//r:5.2
+//
+#define qtn_vcx_hg_list_last_watched           "Last watched"
+
+//d:Main view item text for videos other than captured
+//l:list_double_large_graphic_pane_t1
+//r:5.2
+//
+#define qtn_vcx_hg_list_storage_other          "Other videos"
+
+//d:Main view item text for captured videos
+//l:list_double_large_graphic_pane_t1
+//r:5.2
+//
+#define qtn_vcx_hg_list_storage_captured       "Captured"
+
+//d:Main view item text for Ovi Store link
+//l:list_double_large_graphic_pane_t1
+//r:5.2
+//
+#define qtn_vcx_hg_list_ovi_store              "Ovi Store"
+
+//d:Second line for main view item, amount of videos in category.
+//d:%N is the amount of videos.
+//l:list_double_large_graphic_pane_t2
+//r:5.2
+//
+#define qtn_vcx_hg_list_videos_in_category     "%N videos"
+
+//d:Same as qtn_vcx_hg_list_videos_in_category but used when only one video in category.
+//l:list_double_large_graphic_pane_t2
+//r:5.2
+//
+#define qtn_vcx_hg_list_one_video_in_category  "1 video"	
+
+//d:Second line for main view item, there is one new video.
+//l:list_double_large_graphic_pane_t2
+//r:5.2
+//
+#define qtn_vcx_hg_list_one_new_video          "1 new video"
+
+//d:Second line for main view item, there are more than 1 new videos. 
+//d:%N is the count of new videos.
+//l:list_double_large_graphic_pane_t2
+//r:5.2
+//
+#define qtn_vcx_hg_list_n_new_videos           "%N new videos"
+
+//d:Second line for main view item, there are no videos.
+//l:list_double_large_graphic_pane_t2
+//r:5.2
+//
+#define qtn_vcx_hg_list_no_videos_in_category  "No videos"
+
+//d:Second line for main view item, Ovi Store link.
+//l:list_double_large_graphic_pane_t2
+//r:5.2
+//
+#define qtn_vcx_hg_list_ovi_store_videos       "Videos"
+
+
+/*
+* ==============================================================================
+*  Fusion strings from VIA Player localization file
+* ==============================================================================
+*/
+
+//d:When user tries to connect to service ( for example for downloading a video )
+//d:and service url ( or video url ) is not valid, this error note is displayed.
+//d: Ui spec sec 17.1 Error cases (p108)
+//l:popup_note_window/opt2
+//r:5.0
+//
+#define qtn_iptv_invalid_address                "Invalid address"
+
+//d:In case the username and password are invalid or missing when the terminal
+//d:connects to the service, this error note is displayed.
+//d: Ui spec sec 17.3 Invalid user name or password (p109)
+//l:popup_note_window/opt2
+//r:5.0
+//
+#define qtn_iptv_authentication_failed          "Authentication failed"
+
+//d:This error note is displayed when application does not have
+//d:valid access point for connection
+//d: Ui spec sec 17.1 Error cases (p108)
+//l:popup_note_window/opt2
+//r:5.0
+//
+#define qtn_iptv_invalid_access_point           "Invalid access point"
+
+//d:Prompt for the password text field in authentication dialog.
+//d: Ui spec sec 17.3 Invalid user name or password (p109)
+//l:popup_query_data_window
+//r:5.0
+//
+#define qtn_iptv_query_password                 "Password:"
+
+//d:Prompt for the username text field in authentication dialog.
+//d: Ui spec sec 17.3 Invalid user name or password (p109)
+//l:popup_query_data_window
+//r:5.0
+//
+#define qtn_iptv_query_username                 "Username:"
+
+//d:Video is paused, ready to be played. Pressing soft key with this text resumes paused playback.
+//d:This is a text for softkey.
+//d: Ui spec sec 8.4 Video list (p36)
+//l:control_pane_t2/opt7
+//r:5.0
+//
+#define qtn_iptv_softkey_resume                 "Resume" 
+
Binary file videofeeds/vccommon/loc/locfiles.zip has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videofeeds/vccommon/rom/IpVideoCustom.iby	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,27 @@
+/*
+* 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 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 __IpVideo_Custom_IBY__
+#define __IpVideo_Custom_IBY__
+
+
+
+
+data=\epoc32\data\z\private\102750D5\services.xml                   private\102750D5\services.xml
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videofeeds/vccommon/sis/Videocenter_Rel6.pkg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,229 @@
+;
+; 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 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: 
+;
+
+;Languages
+&EN
+
+;Header
+#{"Video Center"},(0x102750D5),6,50,0, TYPE=SA, RU
+; Supports Series 60 v5.0
+[0x1028315F], 0, 0, 0, {"Series60ProductID"}
+
+;Localised Vendor name
+%{"Nokia"}
+
+; Non-localised vendor name
+:"Nokia"
+
+@"cenrep.sisx",(0x10202be9)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;IpVideo.iby
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+"\epoc32\release\armv5\urel\IptvClientApi.dll" - "!:\sys\bin\IptvClientApi.dll"
+"\epoc32\release\armv5\urel\IptvServer.exe" - "!:\sys\bin\IptvServer.exe"
+
+"\epoc32\release\armv5\urel\IptvRssPlugin.DLL" - "!:\sys\bin\IptvRssPlugin.DLL"
+"\epoc32\data\z\resource\plugins\IptvRssPlugin.rsc" - "!:\resource\plugins\IptvRssPlugin.rsc"
+
+"\epoc32\release\armv5\urel\IptvUtil.dll" - "!:\sys\bin\IptvUtil.dll"
+
+"\epoc32\release\armv5\urel\IptvXmlTvEpgPlugin.DLL" - "!:\sys\bin\IptvXmlTvEpgPlugin.DLL"
+"\epoc32\data\z\resource\plugins\IptvXmlTvEpgPlugin.rsc" - "!:\resource\plugins\IptvXmlTvEpgPlugin.rsc"
+
+"\epoc32\release\armv5\urel\vcxmyvideoscollectionplugin.DLL" - "!:\sys\bin\vcxmyvideoscollectionplugin.DLL" 
+"\epoc32\data\z\resource\plugins\vcxmyvideoscollectionplugin.RSC" - "!:\resource\plugins\vcxmyvideoscollectionplugin.RSC"
+
+"\epoc32\release\armv5\urel\vcxhgmyvideosplugin.DLL" - "!:\sys\bin\vcxhgmyvideosplugin.DLL"
+"\epoc32\data\z\resource\plugins\vcxhgmyvideosplugin.RSC" - "!:\resource\plugins\vcxhgmyvideosplugin.RSC"
+
+
+"\epoc32\release\armv5\urel\vcxhgvodplugin.dll" - "!:\sys\bin\vcxhgvodplugin.dll" 
+"\epoc32\data\z\resource\plugins\vcxhgvodplugin.RSC" - "!:\resource\plugins\vcxhgvodplugin.RSC"
+
+ 
+
+"\epoc32\release\armv5\urel\vcxnssettingsplugin.dll" - "!:\sys\bin\vcxnssettingsplugin.dll" 
+"\epoc32\data\z\resource\plugins\vcxnssettingsplugin.RSC" - "!:\resource\plugins\vcxnssettingsplugin.RSC"
+
+"\epoc32\release\armv5\urel\vcxnsscheduleplugin.dll" - "!:\sys\bin\vcxnsscheduleplugin.dll"
+"\epoc32\data\z\resource\plugins\vcxnsscheduleplugin.RSC" - "!:\resource\plugins\vcxnsscheduleplugin.RSC"
+
+"\epoc32\release\armv5\urel\vcxnsahplugin.dll" - "!:\sys\bin\vcxnsahplugin.dll"
+"\epoc32\data\z\resource\plugins\vcxnsahplugin.rsc" - "!:\resource\plugins\vcxnsahplugin.rsc"
+
+"\epoc32\release\armv5\urel\LiveTvUtils.dll" - "!:\sys\bin\LiveTvUtils.dll"
+
+"\epoc32\release\armv5\urel\IptvNetworkEngine.dll" - "!:\sys\bin\IptvNetworkEngine.dll"
+
+"\epoc32\release\armv5\urel\IptvTunerEngine.dll" - "!:\sys\bin\IptvTunerEngine.dll"
+
+"\epoc32\release\armv5\urel\IptvLiveUIEpgEngine.dll" - "!:\sys\bin\IptvLiveUIEpgEngine.dll"
+
+"\epoc32\release\armv5\urel\vcxnsuiengine.dll" - "!:\sys\bin\vcxnsuiengine.dll"
+
+"\epoc32\release\armv5\urel\vcxnsbsutility.dll" - "!:\sys\bin\vcxnsbsutility.dll"
+
+"\epoc32\release\armv5\urel\vcxhgmyvideos.dll" - "!:\sys\bin\vcxhgmyvideos.dll"
+"\epoc32\data\Z\resource\apps\vcxhgmyvideos.mif" - "!:\resource\apps\vcxhgmyvideos.mif"
+"\epoc32\data\Z\resource\apps\vcxhgmyvideosicons.mif" - "!:\resource\apps\vcxhgmyvideosicons.mif"
+"\epoc32\release\armv5\urel\vcxnsappui.exe" - "!:\sys\bin\vcxnsappui.exe"
+"\epoc32\data\Z\private\10003a3f\apps\vcxnsappui_reg.RSC" - "!:\private\10003a3f\import\apps\vcxnsappui_reg.RSC"
+"\epoc32\data\Z\resource\apps\vcxnsappui_aif.mif" - "!:\resource\apps\vcxnsappui_aif.mif"
+;;"\epoc32\release\armv5\urel\vcxnsappui_test.exe" - "!:\sys\bin\vcxnsappui_test.exe"
+;;"\epoc32\data\Z\private\10003a3f\apps\vcxnsappui_test_reg.RSC" - "!:\private\10003a3f\import\apps\vcxnsappui_test_reg.RSC"
+;;"\epoc32\data\Z\resource\apps\vcxnsappui_test_icon.mif" - "!:\resource\apps\vcxnsappui_test_icon.mif"
+
+"\epoc32\release\armv5\urel\vcxhgvodui.dll" - "!:\sys\bin\vcxhgvodui.dll"
+"\epoc32\data\Z\resource\apps\vcxhgvod.mif" - "!:\resource\apps\vcxhgvod.mif"
+"\epoc32\data\Z\resource\apps\vcxhgvoddefaulticons.mif" - "!:\resource\apps\vcxhgvoddefaulticons.mif"
+
+"\epoc32\release\armv5\urel\CommonRecordingEngineClient.dll" - "!:\sys\bin\CommonRecordingEngineClient.dll"
+"\epoc32\release\armv5\urel\CommonRecordingEngine.exe" - "!:\sys\bin\CommonRecordingEngine.exe"
+"\epoc32\release\armv5\urel\DvrSdpParser.dll" - "!:\sys\bin\DvrSdpParser.dll"
+
+"\epoc32\release\armv5\urel\IptvProvisioningProcessor.dll" - "!:\sys\bin\IptvProvisioningProcessor.dll"
+
+"\epoc32\release\armv5\urel\IptvProvRec.DLL" - "!:\sys\bin\IptvProvRec.DLL"
+"\epoc32\data\Z\resource\plugins\IptvProvRec.rsc" - "!:\resource\plugins\IptvProvRec.rsc"
+
+"\epoc32\release\armv5\urel\IptvProvisioningApp.exe" - "!:\sys\bin\IptvProvisioningApp.exe"
+"\epoc32\data\Z\private\10003a3f\apps\IptvProvisioningApp_reg.rsc" - "!:\private\10003a3f\import\apps\IptvProvisioningApp_reg.rsc"
+
+"\epoc32\release\armv5\urel\IptvVodNotifierPlugin.DLL" - "!:\sys\bin\IptvVodNotifierPlugin.DLL"
+"\epoc32\data\Z\resource\plugins\IptvVodNotifierPlugin.rsc" - "!:\resource\plugins\IptvVodNotifierPlugin.rsc"
+"\epoc32\data\Z\resource\apps\IptvNotification.mif" - "!:\resource\apps\IptvNotification.mif"
+
+"\epoc32\release\armv5\urel\IptvReminderNotifierPlugin.DLL" - "!:\sys\bin\IptvReminderNotifierPlugin.DLL"
+"\epoc32\data\Z\resource\plugins\IptvReminderNotifierPlugin.rsc" - "!:\resource\plugins\IptvReminderNotifierPlugin.rsc" 
+"\epoc32\data\Z\resource\apps\IptvReminderNotification.mif" - "!:\resource\apps\IptvReminderNotification.mif"
+
+"\epoc32\release\armv5\urel\IptvSchedulerPlugin.DLL" - "!:\sys\bin\IptvSchedulerPlugin.DLL"
+"\epoc32\data\Z\resource\plugins\IptvSchedulerPlugin.rsc" - "!:\resource\plugins\IptvSchedulerPlugin.rsc" 
+
+"\epoc32\release\armv5\urel\CseSchedulerServer.exe" - "!:\sys\bin\CseSchedulerServer.exe"
+"\epoc32\release\armv5\urel\CseSchedulerClient.dll" - "!:\sys\bin\CseSchedulerClient.dll"
+
+"\epoc32\release\armv5\urel\ViaPlayerCore.dll" - "!:\sys\bin\ViaPlayerCore.dll"
+"\epoc32\release\armv5\urel\ViaPlayerControllerBase.dll" - "!:\sys\bin\ViaPlayerControllerBase.dll"
+"\epoc32\data\z\resource\apps\ViaPlayer.mif" - "!:\resource\apps\ViaPlayer.mif"
+
+"\epoc32\release\armv5\urel\ViaPlayerUtilities.dll" - "!:\sys\bin\ViaPlayerUtilities.dll"
+"\epoc32\data\z\resource\apps\ViaPlayerUtilities.mif" - "!:\resource\apps\ViaPlayerUtilities.mif"
+"\epoc32\data\z\resource\apps\ViaPlayerUtilities.mbm" - "!:\resource\apps\ViaPlayerUtilities.mbm"
+"\epoc32\release\armv5\urel\ViaPlayerDefaultView.dll" - "!:\sys\bin\ViaPlayerDefaultView.dll"
+
+"\epoc32\data\z\resource\apps\ViaPlayerOverlayStatusPane.Rsc" - "!:\resource\apps\ViaPlayerOverlayStatusPane.Rsc"
+"\epoc32\data\z\resource\apps\ViaPlayerNSeriesStatusPane.Rsc" - "!:\resource\apps\ViaPlayerNSeriesStatusPane.Rsc"
+"\epoc32\data\z\resource\apps\ViaPlayerOverlaySoftkeys.Rsc" - "!:\resource\apps\ViaPlayerOverlaySoftkeys.Rsc"
+"\epoc32\data\z\resource\apps\ViaPlayerOverlayVolumeControl.Rsc"-"!:\resource\apps\ViaPlayerOverlayVolumeControl.Rsc"
+
+"\epoc32\release\armv5\urel\ViaDlProgressController.dll" - "!:\sys\bin\ViaDlProgressController.dll"
+"\epoc32\data\z\resource\plugins\ViaDlProgressController.rsc" - "!:\resource\plugins\ViaDlProgressController.rsc"
+
+"\epoc32\release\armv5\urel\ViaUnicastStreamPlayerController.dll" - "!:\sys\bin\ViaUnicastStreamPlayerController.dll"
+"\epoc32\data\z\resource\plugins\ViaUnicastStreamPlayerController.rsc" - "!:\resource\plugins\ViaUnicastStreamPlayerController.rsc" 
+
+; #ifdef RD_IPTV_FEA_RTP_CLIP_SUPPORT
+; "\epoc32\release\armv5\urel\ViaRTPFilePlayController.dll" - "!:\sys\bin\ViaRTPFilePlayController.dll"
+; "\epoc32\data\z\resource\plugins\ViaRTPFilePlayController.rsc" - "!:\resource\plugins\ViaRTPFilePlayController.rsc"
+
+; #ifdef RD_IPTV_FEA_RTP_CLIP_SUPPORT
+; "\epoc32\release\armv5\urel\DvrRtpClipHandler.dll" - "!:\sys\bin\DvrRtpClipHandler.dll"
+; "\epoc32\release\armv5\urel\DvrRtpUtils.dll" - "!:\sys\bin\DvrRtpUtils.dll"
+
+; #ifdef RD_IPTV_FEA_RTP_CLIP_SUPPORT
+; "\epoc32\release\armv5\urel\RtpClipRecognizer.dll" - "!:\sys\bin\RtpClipRecognizer.dll"
+; "\epoc32\data\z\resource\plugins\RtpClipRecognizer.rsc" - "!:\resource\plugins\RtpClipRecognizer.rsc"
+
+"\epoc32\release\armv5\urel\IptvOmaProvisioningAdapter.dll" - "!:\sys\bin\IptvOmaProvisioningAdapter.dll" 
+"\epoc32\data\z\resource\plugins\IptvOmaProvisioningAdapter.rsc" - "!:\resource\plugins\IptvOmaProvisioningAdapter.rsc"
+
+"\epoc32\data\z\resource\apps\iptvmimesupport.RSC" - "!:\resource\apps\iptvmimesupport.RSC"
+
+"\epoc32\release\armv5\urel\iptvscheduleddownloadplugin.dll" - "!:\sys\bin\iptvscheduleddownloadplugin.dll" 
+"\epoc32\data\z\resource\plugins\iptvscheduleddownloadplugin.RSC" - "!:\resource\plugins\iptvscheduleddownloadplugin.RSC"
+
+"\epoc32\data\z\private\102750D5\backup_registration.xml" - "c:\private\102750D5\backup_registration.xml"
+"\epoc32\data\z\private\102750E2\backup_registration.xml" - "c:\private\102750E2\backup_registration.xml"
+
+"\epoc32\release\armv5\urel\vcxnssettingsengine.dll" - "!:\sys\bin\vcxnssettingsengine.dll"
+"\epoc32\release\armv5\urel\vcxnssettingsview.dll" - "!:\sys\bin\vcxnssettingsview.dll"
+"\epoc32\release\armv5\urel\vcxnsscheduleview.dll" - "!:\sys\bin\vcxnsscheduleview.dll"
+"\epoc32\release\armv5\urel\vcxnsgeneralsettingsplugin.dll" - "!:\sys\bin\vcxnsgeneralsettingsplugin.dll"
+"\epoc32\data\z\resource\plugins\vcxnsgeneralsettingsplugin.rsc" - "!:\resource\plugins\vcxnsgeneralsettingsplugin.rsc" 
+"\epoc32\data\Z\resource\apps\vcxnsgeneralsettingsplugin.mif" - "!:\resource\apps\vcxnsgeneralsettingsplugin.mif"
+
+;; Vc ns content harvester plugin
+"\epoc32\release\armv5\urel\vcxnscontentharvesterplugin.dll" - "!:\sys\bin\vcxnscontentharvesterplugin.dll"
+"\epoc32\data\z\resource\plugins\vcxnscontentharvesterplugin.rsc" - "!:\resource\plugins\vcxnscontentharvesterplugin.rsc"
+"\epoc32\data\z\resource\apps\vcxnstvvideosuiteres.rsc" - "!:\resource\apps\vcxnstvvideosuiteres.rsc"
+"\epoc32\include\vcxnstvvideosuiteres.rsg" - "!:\resource\apps\vcxnstvvideosuiteres.rsg"
+
+;; TV&Video suite configs
+"..\data\vcns_suite.xml" - "C:\private\101F4CD2\import\suites\tvvideosuite\suite.xml"
+"..\data\vcns_matrix_items.xml" - "C:\private\101F4CD2\import\suites\tvvideosuite\vcns_matrix_items.xml"
+"\epoc32\data\Z\resource\apps\videosuite.mif" - "!:\resource\apps\videosuite.mif"
+
+"\epoc32\release\armv5\urel\vcxconnectionutility.dll" - "!:\sys\bin\vcxconnectionutility.dll"
+"\epoc32\release\armv5\urel\vcxconnutilpsworker.exe" - "!:\sys\bin\vcxconnutilpsworker.exe"
+
+"\epoc32\release\armv5\urel\vcxviewmessageutility.dll" - "!:\sys\bin\vcxviewmessageutility.dll"
+
+
+"\epoc32\release\armv5\urel\VcXNotifierPlugin.DLL" - "!:\sys\bin\VcXNotifierPlugin.DLL"
+"\epoc32\data\Z\resource\plugins\VcXNotifier.rsc" - "!:\resource\plugins\VcXNotifier.rsc"
+"\epoc32\data\Z\resource\plugins\VcXNotifierPlugin.rsc" - "!:\resource\plugins\VcXNotifierPlugin.rsc"
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; IpVideoCustom
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+"\epoc32\data\z\resource\apps\google_logo.mif" - "c:\resource\apps\google_logo.mif"
+"\epoc32\data\z\resource\apps\rocketboom_logo.mif" - "c:\resource\apps\rocketboom_logo.mif"
+"\epoc32\data\z\resource\apps\reuters_logo.mif" - "c:\resource\apps\reuters_logo.mif"
+"\epoc32\data\z\resource\apps\break_logo.mif" - "c:\resource\apps\break_logo.mif"
+"\epoc32\data\z\resource\apps\oululogo.mif" - "c:\resource\apps\oululogo.mif"
+"\epoc32\data\z\resource\apps\logo_promo_videos.mif" - "c:\resource\apps\logo_promo_videos.mif"
+"\epoc32\data\z\resource\apps\logo_yle_24.mif" - "c:\resource\apps\logo_yle_24.mif"
+"\epoc32\data\z\resource\apps\qgn_iptv_video_store_list.jpg" - "c:\resource\apps\qgn_iptv_video_store_list.jpg"
+"\epoc32\data\z\resource\apps\videocenter_prog_clip.jpg" - "c:\resource\apps\videocenter_prog_clip.jpg"
+"\epoc32\data\z\resource\apps\logo_nseries_studio.mif" - "c:\resource\apps\logo_nseries_studio.mif"
+"\epoc32\data\z\private\102750D5\services.xml" - "c:\private\102750D5\services.xml"
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; IpVideoResources
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+"\epoc32\data\z\resource\apps\ViaPlayerDefaultView.Rsc" - "!:\resource\apps\ViaPlayerDefaultView.Rsc"
+"\epoc32\data\z\resource\apps\ViaPlayerUtilities.Rsc" - "!:\resource\apps\ViaPlayerUtilities.Rsc"
+"\epoc32\data\z\resource\Plugins\IptvReminderNotifier.RSC" - "!:\resource\Plugins\IptvReminderNotifier.RSC"
+"\epoc32\data\z\resource\apps\vcxnsappui.rsc" - "!:\resource\apps\vcxnsappui.rsc"
+;;"\epoc32\data\z\resource\apps\vcxnsappui_test.RSC" - "!:\resource\apps\vcxnsappui_test.RSC"
+"\epoc32\data\z\resource\apps\vcxhgmyvideos.RSC" - "!:\resource\apps\vcxhgmyvideos.RSC"
+"\epoc32\data\z\resource\apps\vcxhgvodui.RSC" - "!:\resource\apps\vcxhgvodui.RSC"
+"\epoc32\data\z\resource\apps\IptvProvisioningApp.RSC" - "!:\resource\apps\IptvProvisioningApp.RSC"
+"\epoc32\data\z\resource\Plugins\IptvVodNotifier.RSC" - "!:\resource\Plugins\IptvVodNotifier.RSC"
+"\epoc32\data\z\resource\apps\vcxnssettingsview.RSC" - "!:\resource\apps\vcxnssettingsview.RSC"
+"\epoc32\data\z\resource\apps\vcxnsscheduleview.RSC" - "!:\resource\apps\vcxnsscheduleview.RSC"
+
+;Help
+"\epoc32\winscw\c\resource\xhtml\01\0x102750E2\contents.zip" - "!:\resource\xhtml\01\0x102750E2\contents.zip"
+"\epoc32\winscw\c\resource\xhtml\01\0x102750E2\keywords.xml" - "!:\resource\xhtml\01\0x102750E2\keywords.xml"
+"\epoc32\winscw\c\resource\xhtml\01\0x102750E2\index.xml" - "!:\resource\xhtml\01\0x102750E2\index.xml"
+"\epoc32\winscw\c\resource\xhtml\01\0x102750E2\meta.xml" - "!:\resource\xhtml\01\0x102750E2\meta.xml"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videofeeds/vccommon/sis/Videocenter_Rel6_for_5_1.pkg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,224 @@
+;
+; 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 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: 
+;
+
+;Languages
+&EN
+
+;Header
+#{"Video Center"},(0x102750D5),6,50,0, TYPE=SA, RU
+; Supports Series 60 v5.1
+[0x10283160], 0, 0, 0, {"Series60ProductID"}
+
+;Localised Vendor name
+%{"Nokia"}
+
+; Non-localised vendor name
+:"Nokia"
+
+@"cenrep.sisx",(0x10202be9)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;IpVideo.iby
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+"\epoc32\release\armv5\urel\IptvClientApi.dll" - "!:\sys\bin\IptvClientApi.dll"
+"\epoc32\release\armv5\urel\IptvServer.exe" - "!:\sys\bin\IptvServer.exe"
+
+"\epoc32\release\armv5\urel\IptvRssPlugin.DLL" - "!:\sys\bin\IptvRssPlugin.DLL"
+"\epoc32\data\z\resource\plugins\IptvRssPlugin.rsc" - "!:\resource\plugins\IptvRssPlugin.rsc"
+
+"\epoc32\release\armv5\urel\IptvUtil.dll" - "!:\sys\bin\IptvUtil.dll"
+
+"\epoc32\release\armv5\urel\IptvXmlTvEpgPlugin.DLL" - "!:\sys\bin\IptvXmlTvEpgPlugin.DLL"
+"\epoc32\data\z\resource\plugins\IptvXmlTvEpgPlugin.rsc" - "!:\resource\plugins\IptvXmlTvEpgPlugin.rsc"
+
+"\epoc32\release\armv5\urel\vcxmyvideoscollectionplugin.DLL" - "!:\sys\bin\vcxmyvideoscollectionplugin.DLL" 
+"\epoc32\data\z\resource\plugins\vcxmyvideoscollectionplugin.RSC" - "!:\resource\plugins\vcxmyvideoscollectionplugin.RSC"
+
+"\epoc32\release\armv5\urel\vcxhgmyvideosplugin.DLL" - "!:\sys\bin\vcxhgmyvideosplugin.DLL"
+"\epoc32\data\z\resource\plugins\vcxhgmyvideosplugin.RSC" - "!:\resource\plugins\vcxhgmyvideosplugin.RSC"
+
+
+"\epoc32\release\armv5\urel\vcxhgvodplugin.dll" - "!:\sys\bin\vcxhgvodplugin.dll" 
+"\epoc32\data\z\resource\plugins\vcxhgvodplugin.RSC" - "!:\resource\plugins\vcxhgvodplugin.RSC"
+
+ 
+
+"\epoc32\release\armv5\urel\vcxnssettingsplugin.dll" - "!:\sys\bin\vcxnssettingsplugin.dll" 
+"\epoc32\data\z\resource\plugins\vcxnssettingsplugin.RSC" - "!:\resource\plugins\vcxnssettingsplugin.RSC"
+
+"\epoc32\release\armv5\urel\vcxnsscheduleplugin.dll" - "!:\sys\bin\vcxnsscheduleplugin.dll"
+"\epoc32\data\z\resource\plugins\vcxnsscheduleplugin.RSC" - "!:\resource\plugins\vcxnsscheduleplugin.RSC"
+
+"\epoc32\release\armv5\urel\vcxnsahplugin.dll" - "!:\sys\bin\vcxnsahplugin.dll"
+"\epoc32\data\z\resource\plugins\vcxnsahplugin.rsc" - "!:\resource\plugins\vcxnsahplugin.rsc"
+
+"\epoc32\release\armv5\urel\LiveTvUtils.dll" - "!:\sys\bin\LiveTvUtils.dll"
+
+"\epoc32\release\armv5\urel\IptvNetworkEngine.dll" - "!:\sys\bin\IptvNetworkEngine.dll"
+
+"\epoc32\release\armv5\urel\IptvTunerEngine.dll" - "!:\sys\bin\IptvTunerEngine.dll"
+
+"\epoc32\release\armv5\urel\IptvLiveUIEpgEngine.dll" - "!:\sys\bin\IptvLiveUIEpgEngine.dll"
+
+"\epoc32\release\armv5\urel\vcxnsuiengine.dll" - "!:\sys\bin\vcxnsuiengine.dll"
+
+"\epoc32\release\armv5\urel\vcxnsbsutility.dll" - "!:\sys\bin\vcxnsbsutility.dll"
+
+"\epoc32\release\armv5\urel\vcxhgmyvideos.dll" - "!:\sys\bin\vcxhgmyvideos.dll"
+"\epoc32\data\Z\resource\apps\vcxhgmyvideos.mif" - "!:\resource\apps\vcxhgmyvideos.mif"
+"\epoc32\data\Z\resource\apps\vcxhgmyvideosicons.mif" - "!:\resource\apps\vcxhgmyvideosicons.mif"
+"\epoc32\release\armv5\urel\vcxnsappui.exe" - "!:\sys\bin\vcxnsappui.exe"
+"\epoc32\data\Z\private\10003a3f\apps\vcxnsappui_reg.RSC" - "!:\private\10003a3f\import\apps\vcxnsappui_reg.RSC"
+"\epoc32\data\Z\resource\apps\vcxnsappui_aif.mif" - "!:\resource\apps\vcxnsappui_aif.mif"
+;;"\epoc32\release\armv5\urel\vcxnsappui_test.exe" - "!:\sys\bin\vcxnsappui_test.exe"
+;;"\epoc32\data\Z\private\10003a3f\apps\vcxnsappui_test_reg.RSC" - "!:\private\10003a3f\import\apps\vcxnsappui_test_reg.RSC"
+;;"\epoc32\data\Z\resource\apps\vcxnsappui_test_icon.mif" - "!:\resource\apps\vcxnsappui_test_icon.mif"
+
+"\epoc32\release\armv5\urel\vcxhgvodui.dll" - "!:\sys\bin\vcxhgvodui.dll"
+"\epoc32\data\Z\resource\apps\vcxhgvod.mif" - "!:\resource\apps\vcxhgvod.mif"
+"\epoc32\data\Z\resource\apps\vcxhgvoddefaulticons.mif" - "!:\resource\apps\vcxhgvoddefaulticons.mif"
+
+
+"\epoc32\release\armv5\urel\CommonRecordingEngineClient.dll" - "!:\sys\bin\CommonRecordingEngineClient.dll"
+"\epoc32\release\armv5\urel\CommonRecordingEngine.exe" - "!:\sys\bin\CommonRecordingEngine.exe"
+"\epoc32\release\armv5\urel\DvrSdpParser.dll" - "!:\sys\bin\DvrSdpParser.dll"
+
+"\epoc32\release\armv5\urel\IptvProvisioningProcessor.dll" - "!:\sys\bin\IptvProvisioningProcessor.dll"
+
+"\epoc32\release\armv5\urel\IptvProvRec.DLL" - "!:\sys\bin\IptvProvRec.DLL"
+"\epoc32\data\Z\resource\plugins\IptvProvRec.rsc" - "!:\resource\plugins\IptvProvRec.rsc"
+
+"\epoc32\release\armv5\urel\IptvProvisioningApp.exe" - "!:\sys\bin\IptvProvisioningApp.exe"
+"\epoc32\data\Z\private\10003a3f\apps\IptvProvisioningApp_reg.rsc" - "!:\private\10003a3f\import\apps\IptvProvisioningApp_reg.rsc"
+
+"\epoc32\release\armv5\urel\IptvVodNotifierPlugin.DLL" - "!:\sys\bin\IptvVodNotifierPlugin.DLL"
+"\epoc32\data\Z\resource\plugins\IptvVodNotifierPlugin.rsc" - "!:\resource\plugins\IptvVodNotifierPlugin.rsc"
+"\epoc32\data\Z\resource\apps\IptvNotification.mif" - "!:\resource\apps\IptvNotification.mif"
+
+"\epoc32\release\armv5\urel\IptvReminderNotifierPlugin.DLL" - "!:\sys\bin\IptvReminderNotifierPlugin.DLL"
+"\epoc32\data\Z\resource\plugins\IptvReminderNotifierPlugin.rsc" - "!:\resource\plugins\IptvReminderNotifierPlugin.rsc" 
+"\epoc32\data\Z\resource\apps\IptvReminderNotification.mif" - "!:\resource\apps\IptvReminderNotification.mif"
+
+"\epoc32\release\armv5\urel\IptvSchedulerPlugin.DLL" - "!:\sys\bin\IptvSchedulerPlugin.DLL"
+"\epoc32\data\Z\resource\plugins\IptvSchedulerPlugin.rsc" - "!:\resource\plugins\IptvSchedulerPlugin.rsc" 
+
+"\epoc32\release\armv5\urel\CseSchedulerServer.exe" - "!:\sys\bin\CseSchedulerServer.exe"
+"\epoc32\release\armv5\urel\CseSchedulerClient.dll" - "!:\sys\bin\CseSchedulerClient.dll"
+
+"\epoc32\release\armv5\urel\ViaPlayerCore.dll" - "!:\sys\bin\ViaPlayerCore.dll"
+"\epoc32\release\armv5\urel\ViaPlayerControllerBase.dll" - "!:\sys\bin\ViaPlayerControllerBase.dll"
+"\epoc32\data\z\resource\apps\ViaPlayer.mif" - "!:\resource\apps\ViaPlayer.mif"
+
+"\epoc32\release\armv5\urel\ViaPlayerUtilities.dll" - "!:\sys\bin\ViaPlayerUtilities.dll"
+"\epoc32\data\z\resource\apps\ViaPlayerUtilities.mif" - "!:\resource\apps\ViaPlayerUtilities.mif"
+"\epoc32\data\z\resource\apps\ViaPlayerUtilities.mbm" - "!:\resource\apps\ViaPlayerUtilities.mbm"
+"\epoc32\release\armv5\urel\ViaPlayerDefaultView.dll" - "!:\sys\bin\ViaPlayerDefaultView.dll"
+
+"\epoc32\data\z\resource\apps\ViaPlayerOverlayStatusPane.Rsc" - "!:\resource\apps\ViaPlayerOverlayStatusPane.Rsc"
+"\epoc32\data\z\resource\apps\ViaPlayerNSeriesStatusPane.Rsc" - "!:\resource\apps\ViaPlayerNSeriesStatusPane.Rsc"
+"\epoc32\data\z\resource\apps\ViaPlayerOverlaySoftkeys.Rsc" - "!:\resource\apps\ViaPlayerOverlaySoftkeys.Rsc"
+"\epoc32\data\z\resource\apps\ViaPlayerOverlayVolumeControl.Rsc"-"!:\resource\apps\ViaPlayerOverlayVolumeControl.Rsc"
+
+"\epoc32\release\armv5\urel\ViaDlProgressController.dll" - "!:\sys\bin\ViaDlProgressController.dll"
+"\epoc32\data\z\resource\plugins\ViaDlProgressController.rsc" - "!:\resource\plugins\ViaDlProgressController.rsc"
+
+"\epoc32\release\armv5\urel\ViaUnicastStreamPlayerController.dll" - "!:\sys\bin\ViaUnicastStreamPlayerController.dll"
+"\epoc32\data\z\resource\plugins\ViaUnicastStreamPlayerController.rsc" - "!:\resource\plugins\ViaUnicastStreamPlayerController.rsc" 
+
+; #ifdef RD_IPTV_FEA_RTP_CLIP_SUPPORT
+; "\epoc32\release\armv5\urel\ViaRTPFilePlayController.dll" - "!:\sys\bin\ViaRTPFilePlayController.dll"
+; "\epoc32\data\z\resource\plugins\ViaRTPFilePlayController.rsc" - "!:\resource\plugins\ViaRTPFilePlayController.rsc"
+
+; #ifdef RD_IPTV_FEA_RTP_CLIP_SUPPORT
+; "\epoc32\release\armv5\urel\DvrRtpClipHandler.dll" - "!:\sys\bin\DvrRtpClipHandler.dll"
+; "\epoc32\release\armv5\urel\DvrRtpUtils.dll" - "!:\sys\bin\DvrRtpUtils.dll"
+
+; #ifdef RD_IPTV_FEA_RTP_CLIP_SUPPORT
+; "\epoc32\release\armv5\urel\RtpClipRecognizer.dll" - "!:\sys\bin\RtpClipRecognizer.dll"
+; "\epoc32\data\z\resource\plugins\RtpClipRecognizer.rsc" - "!:\resource\plugins\RtpClipRecognizer.rsc"
+
+"\epoc32\release\armv5\urel\IptvOmaProvisioningAdapter.dll" - "!:\sys\bin\IptvOmaProvisioningAdapter.dll" 
+"\epoc32\data\z\resource\plugins\IptvOmaProvisioningAdapter.rsc" - "!:\resource\plugins\IptvOmaProvisioningAdapter.rsc"
+
+"\epoc32\data\z\resource\apps\iptvmimesupport.RSC" - "!:\resource\apps\iptvmimesupport.RSC"
+
+"\epoc32\release\armv5\urel\iptvscheduleddownloadplugin.dll" - "!:\sys\bin\iptvscheduleddownloadplugin.dll" 
+"\epoc32\data\z\resource\plugins\iptvscheduleddownloadplugin.RSC" - "!:\resource\plugins\iptvscheduleddownloadplugin.RSC"
+
+"\epoc32\data\z\private\102750D5\backup_registration.xml" - "c:\private\102750D5\backup_registration.xml"
+"\epoc32\data\z\private\102750E2\backup_registration.xml" - "c:\private\102750E2\backup_registration.xml"
+
+"\epoc32\release\armv5\urel\vcxnssettingsengine.dll" - "!:\sys\bin\vcxnssettingsengine.dll"
+"\epoc32\release\armv5\urel\vcxnssettingsview.dll" - "!:\sys\bin\vcxnssettingsview.dll"
+"\epoc32\release\armv5\urel\vcxnsscheduleview.dll" - "!:\sys\bin\vcxnsscheduleview.dll"
+"\epoc32\release\armv5\urel\vcxnsgeneralsettingsplugin.dll" - "!:\sys\bin\vcxnsgeneralsettingsplugin.dll"
+"\epoc32\data\z\resource\plugins\vcxnsgeneralsettingsplugin.rsc" - "!:\resource\plugins\vcxnsgeneralsettingsplugin.rsc" 
+"\epoc32\data\Z\resource\apps\vcxnsgeneralsettingsplugin.mif" - "!:\resource\apps\vcxnsgeneralsettingsplugin.mif"
+
+;; Vc ns content harvester plugin
+"\epoc32\release\armv5\urel\vcxnscontentharvesterplugin.dll" - "!:\sys\bin\vcxnscontentharvesterplugin.dll"
+"\epoc32\data\z\resource\plugins\vcxnscontentharvesterplugin.rsc" - "!:\resource\plugins\vcxnscontentharvesterplugin.rsc"
+"\epoc32\data\z\resource\apps\vcxnstvvideosuiteres.rsc" - "!:\resource\apps\vcxnstvvideosuiteres.rsc"
+"\epoc32\include\vcxnstvvideosuiteres.rsg" - "!:\resource\apps\vcxnstvvideosuiteres.rsg"
+
+;; TV&Video suite configs
+"..\data\vcns_suite.xml" - "C:\private\101F4CD2\import\suites\tvvideosuite\suite.xml"
+"..\data\vcns_matrix_items.xml" - "C:\private\101F4CD2\import\suites\tvvideosuite\vcns_matrix_items.xml"
+"\epoc32\data\Z\resource\apps\videosuite.mif" - "!:\resource\apps\videosuite.mif"
+
+"\epoc32\release\armv5\urel\vcxconnectionutility.dll" - "!:\sys\bin\vcxconnectionutility.dll"
+"\epoc32\release\armv5\urel\vcxconnutilpsworker.exe" - "!:\sys\bin\vcxconnutilpsworker.exe"
+
+"\epoc32\release\armv5\urel\vcxviewmessageutility.dll" - "!:\sys\bin\vcxviewmessageutility.dll"
+
+
+"\epoc32\release\armv5\urel\VcXNotifierPlugin.DLL" - "!:\sys\bin\VcXNotifierPlugin.DLL"
+"\epoc32\data\Z\resource\plugins\VcXNotifier.rsc" - "!:\resource\plugins\VcXNotifier.rsc"
+"\epoc32\data\Z\resource\plugins\VcXNotifierPlugin.rsc" - "!:\resource\plugins\VcXNotifierPlugin.rsc"
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; IpVideoCustom
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+"\epoc32\data\z\resource\apps\google_logo.mif" - "c:\resource\apps\google_logo.mif"
+"\epoc32\data\z\resource\apps\rocketboom_logo.mif" - "c:\resource\apps\rocketboom_logo.mif"
+"\epoc32\data\z\resource\apps\reuters_logo.mif" - "c:\resource\apps\reuters_logo.mif"
+"\epoc32\data\z\resource\apps\break_logo.mif" - "c:\resource\apps\break_logo.mif"
+"\epoc32\data\z\resource\apps\oululogo.mif" - "c:\resource\apps\oululogo.mif"
+"\epoc32\data\z\resource\apps\logo_promo_videos.mif" - "c:\resource\apps\logo_promo_videos.mif"
+"\epoc32\data\z\resource\apps\logo_yle_24.mif" - "c:\resource\apps\logo_yle_24.mif"
+"\epoc32\data\z\resource\apps\qgn_iptv_video_store_list.jpg" - "c:\resource\apps\qgn_iptv_video_store_list.jpg"
+"\epoc32\data\z\resource\apps\videocenter_prog_clip.jpg" - "c:\resource\apps\videocenter_prog_clip.jpg"
+"\epoc32\data\z\resource\apps\logo_nseries_studio.mif" - "c:\resource\apps\logo_nseries_studio.mif"
+"\epoc32\data\z\private\102750D5\services.xml" - "c:\private\102750D5\services.xml"
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; IpVideoResources
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+"\epoc32\data\z\resource\apps\ViaPlayerDefaultView.Rsc" - "!:\resource\apps\ViaPlayerDefaultView.Rsc"
+"\epoc32\data\z\resource\apps\ViaPlayerUtilities.Rsc" - "!:\resource\apps\ViaPlayerUtilities.Rsc"
+"\epoc32\data\z\resource\Plugins\IptvReminderNotifier.RSC" - "!:\resource\Plugins\IptvReminderNotifier.RSC"
+"\epoc32\data\z\resource\apps\vcxnsappui.rsc" - "!:\resource\apps\vcxnsappui.rsc"
+;; "\epoc32\data\z\resource\apps\vcxnsappui_test.RSC" - "!:\resource\apps\vcxnsappui_test.RSC"
+"\epoc32\data\z\resource\apps\vcxhgmyvideos.RSC" - "!:\resource\apps\vcxhgmyvideos.RSC"
+"\epoc32\data\z\resource\apps\vcxhgvodui.RSC" - "!:\resource\apps\vcxhgvodui.RSC"
+"\epoc32\data\z\resource\apps\IptvProvisioningApp.RSC" - "!:\resource\apps\IptvProvisioningApp.RSC"
+"\epoc32\data\z\resource\Plugins\IptvVodNotifier.RSC" - "!:\resource\Plugins\IptvVodNotifier.RSC"
+"\epoc32\data\z\resource\apps\vcxnssettingsview.RSC" - "!:\resource\apps\vcxnssettingsview.RSC"
+"\epoc32\data\z\resource\apps\vcxnsscheduleview.RSC" - "!:\resource\apps\vcxnsscheduleview.RSC"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videofeeds/vccommon/sis/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,25 @@
+/*
+* 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:    Build information file for vccommon/sis*
+*/
+
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_MMPFILES
+gnumakefile sis.mk
+
+// End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videofeeds/vccommon/sis/cenrep.pkg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,28 @@
+;
+; Copyright (c) 2002-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:    Package file for Video Center Cenrep files;
+
+; Languages
+&EN 
+%{"Nokia"}
+:"Nokia"
+
+
+#{"Video Center settings"}, (0x10202be9), 6,38,0, TYPE=PU 
+
+; Supports Series 60 v3.0
+[0x101F7961], 0, 0, 0, {"Series60ProductID"}
+
+; Install in Central Repository's private data cage 
+"\epoc32\data\z\private\10202be9\102750E2.txt"-"c:\private\10202be9\102750E2.txt" 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videofeeds/vccommon/sis/cenrep_alr.pkg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,29 @@
+;
+; 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:    Package file for Video Center ALR Cenrep files;
+
+; Languages
+&EN 
+%{"Nokia"}
+:"Nokia"
+
+
+#{"Video Center settings"}, (0x10202be9), 6,38,0, TYPE=PU 
+
+; Supports Series 60 v3.0
+[0x101F7961], 0, 0, 0, {"Series60ProductID"}
+
+; Install in Central Repository's private data cage 
+"\epoc32\data\z\private\10202be9\102750E2.txt"-"c:\private\10202be9\102750E2.txt" 
+"\epoc32\data\z\private\10202be9\2000B438.txt"-"c:\private\10202be9\2000B438.txt" 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videofeeds/vccommon/sis/cenrep_rel6.pkg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,30 @@
+;
+; 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:    Package file for Video Center ALR Cenrep files;
+
+; Languages
+&EN 
+%{"Nokia"}
+:"Nokia"
+
+
+#{"Video Center settings"}, (0x10202be9), 6,50,0, TYPE=PU 
+
+; Supports Series 60 v5.0
+[0x1028315F], 0, 0, 0, {"Series60ProductID"}
+
+; Install in Central Repository's private data cage 
+"\epoc32\data\z\private\10202be9\102750E2.txt"-"c:\private\10202be9\102750E2.txt" 
+"\epoc32\data\z\private\10202be9\2000B438.txt"-"c:\private\10202be9\2000B438.txt" 
+"\epoc32\data\z\private\10202be9\2001B2A9.txt"-"c:\private\10202be9\2001B2A9.txt"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videofeeds/vccommon/sis/cenrep_rel6_for_5_1.pkg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,30 @@
+;
+; 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:    Package file for Video Center ALR Cenrep files;
+
+; Languages
+&EN 
+%{"Nokia"}
+:"Nokia"
+
+
+#{"Video Center settings"}, (0x10202be9), 6,50,0, TYPE=PU 
+
+; Supports Series 60 v5.1
+[0x10283160], 0, 0, 0, {"Series60ProductID"}
+
+; Install in Central Repository's private data cage 
+"\epoc32\data\z\private\10202be9\102750E2.txt"-"c:\private\10202be9\102750E2.txt" 
+"\epoc32\data\z\private\10202be9\2000B438.txt"-"c:\private\10202be9\2000B438.txt" 
+"\epoc32\data\z\private\10202be9\2001B2A9.txt"-"c:\private\10202be9\2001B2A9.txt"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videofeeds/vccommon/sis/dll_versio_nro.pl	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,39 @@
+#
+# 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 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: 
+#
+
+$pkgfile = $ARGV[0];
+
+
+#presumable comment mark
+
+print "file:$filu\n";
+
+# Read file template
+open(IN, "$pkgfile") or die "Cannot open file $pkgfile $_";
+@template = <IN>;
+close (IN);
+
+foreach $line (@template) {
+	#print $line;
+	if ($line =~ /\"(\S+?dll)\"/gi) {
+			$dll = $1;
+			print "Elftrania: $dll\n";
+			system("Elftran -version 10.1 $dll");
+	}
+	else{
+		
+	}
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videofeeds/vccommon/sis/make_Rel6_sisx.bat	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,27 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of the License "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:  
+rem
+
+dll_versio_nro.pl Videocenter_Rel6.pkg
+
+makesis cenrep_rel6.pkg cenrep.sis
+
+signsis cenrep.sis cenrep.sisx Nokia_RnDCert_02.der Nokia_RnDCert_02.key
+call del cenrep.sis
+
+call makesis Videocenter_Rel6.pkg
+call signsis Videocenter_Rel6.sis Video_Center.sisx Nokia_RnDCert_02.der Nokia_RnDCert_02.key
+call del Videocenter_Rel6.sis
+call del cenrep.sisx
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videofeeds/vccommon/sis/make_Rel6_sisx_for_5_1.bat	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,27 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of the License "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:  
+rem
+
+dll_versio_nro.pl Videocenter_Rel6_for_5_1.pkg
+
+makesis cenrep_rel6_for_5_1.pkg cenrep.sis
+
+signsis cenrep.sis cenrep.sisx Nokia_RnDCert_02.der Nokia_RnDCert_02.key
+call del cenrep.sis
+
+call makesis Videocenter_Rel6_for_5_1.pkg
+call signsis Videocenter_Rel6_for_5_1.sis Video_Center.sisx Nokia_RnDCert_02.der Nokia_RnDCert_02.key
+call del Videocenter_Rel6_for_5_1.sis
+call del cenrep.sisx
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videofeeds/vccommon/sis/make_nfp1_sisx.bat	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,27 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of the License "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:  
+rem
+
+dll_versio_nro.pl Videocenter_NFP1.pkg
+
+makesis cenrep_alr.pkg cenrep.sis
+
+signsis cenrep.sis cenrep.sisx Nokia_RnDCert_02.der Nokia_RnDCert_02.key
+call del cenrep.sis
+
+call makesis Videocenter_NFP1.pkg
+call signsis Videocenter_NFP1.sis Video_Center.sisx Nokia_RnDCert_02.der Nokia_RnDCert_02.key
+call del Videocenter_NFP1.sis
+call del cenrep.sisx
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videofeeds/vccommon/sis/sis.mk	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,61 @@
+#
+# 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 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: 
+#
+
+
+do_nothing :
+	@echo ---
+	@echo Do nothing
+	@echo ---
+
+ifeq (WINSCW,$(findstring WINSCW, $(PLATFORM)))
+MAKMAKE : do_nothing
+
+else
+MAKMAKE :
+	@echo ---
+	@echo ARMV5
+	@echo ---
+endif
+
+ifeq (WINSCW,$(findstring WINSCW, $(PLATFORM)))
+BLD : do_nothing
+else
+ifeq (UREL,$(findstring UREL, $(CFG)))
+BLD :
+	@echo ---
+	$(EPOCROOT)epoc32\tools\makesis -v cenrep_rel6.pkg cenrep.sis
+	$(EPOCROOT)epoc32\tools\signsis cenrep.sis cenrep.sisx Nokia_RnDCert_02.der Nokia_RnDCert_02.key	
+	
+	$(EPOCROOT)epoc32\tools\makesis -v Videocenter_Rel6.pkg Videocenter_Rel6.sis
+	$(EPOCROOT)epoc32\tools\signsis Videocenter_Rel6.sis videocenter.sisx Nokia_RnDCert_02.der Nokia_RnDCert_02.key	
+	
+	if exist Videocenter_Rel6.sis erase Videocenter_Rel6.sis
+	if exist cenrep.sis erase cenrep.sis
+	
+	@echo ---
+else
+BLD :
+	@echo ---
+	@echo armv5 udeb
+	@echo ---
+endif
+endif
+
+CLEAN :
+	if exist Videocenter_Rel6.sis erase Videocenter_Rel6.sis
+	if exist videocenter.sisx erase videocenter.sisx
+
+FINAL FREEZE LIB CLEANLIB RESOURCE RELEASABLES SAVESPACE : do_nothing
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,30 @@
+/*
+* 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 mpx video playback plugins collection.
+*
+*/
+
+// Version : %version: da1mmcf#7 %
+
+
+
+#include <platform_paths.hrh>
+
+#include "../videohelix/group/bld.inf"
+#include "../videopdlplaybackviewplugin/group/bld.inf"
+#include "../videoplaybackcontrols/group/bld.inf"
+#include "../videoplaybackviewplugin/group/bld.inf"
+#include "../videoplaybackviews/group/bld.inf"
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/inc/mpxcommonvideoplaybackview.hrh	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2006 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:  Resource headers for project mpxcommonplaybackview
+*
+*/
+
+// Version : %version: 10 %
+
+
+#ifndef MPXCOMMONVIDEOPLAYBACKVIEW_HRH
+#define MPXCOMMONVIDEOPLAYBACKVIEW_HRH
+
+// ENUMS
+
+/** Command ID's. */
+enum TMPXVideoPlaybackViewCommandIds
+{
+    EMPXPbvCmdPlay = 0x2000,
+    EMPXPbvCmdPause,
+    EMPXPbvCmdPlayPause,
+    EMPXPbvCmdStop,
+    EMPXPbvCmdClose,
+    EMPXPbvCmdSetVolume,
+    EMPXPbvCmdMute,
+    EMPXPbvCmdUnMute,
+    EMPXPbvCmdSetPosition,
+    EMPXPbvCmdChangeAspectRatio,
+    EMPXPbvCmdNaturalAspectRatio,
+    EMPXPbvCmdZoomAspectRatio,
+    EMPXPbvCmdStretchAspectRatio,
+    EMPXPbvCmdSeekForward,
+    EMPXPbvCmdSeekBackward,
+    EMPXPbvCmdEndSeek,
+    EMPXPbvCmdNextListItem,
+    EMPXPbvCmdPreviousListItem,
+    EMPXPbvCmdDecreaseVolume,
+    EMPXPbvCmdIncreaseVolume,
+    EMPXPbvCmdPosition,
+    EMPXPbvCmdSave,
+    EMPXPbvCmdResetControls,
+    EMPXPbvCmdShortPressForward,
+    EMPXPbvCmdShortPressBackward,
+    EMPXPbvCmdShowFileDetails,
+    EMPXPbvCmdEndOfClip,
+    EMPXPbvCmdCustomPause,
+    EMPXPbvCmdCustomPlay,
+    EMPXPbvCmdExit,
+    EMPXPbvLaunchDRMDetails,
+    EMPXPbvSurfaceCreated,
+    EMPXPbvSurfaceRemoved,
+    EMPXPbvCmdRealOneBitmapTimeout
+};
+
+#endif  // MPXCOMMONVIDEOPLAYBACKVIEW_HRH
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/inc/mpxhelixplaybackplugindefs.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,50 @@
+/*
+* 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:  Externalizable container for DSA region
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+#ifndef MPXHELIXPLAYBACKPLUGINDEFS_H_
+#define MPXHELIXPLAYBACKPLUGINDEFS_H_
+
+enum TMPXVideoPlaybackState
+{
+    EMPXVideoNotInitialized,
+    EMPXVideoInitializing,
+    EMPXVideoInitialized,
+    EMPXVideoBuffering,
+    EMPXVideoPlaying,
+    EMPXVideoPaused,
+    EMPXVideoStopped,
+    EMPXVideoSeeking,
+    EMPXNumberOfStates
+};
+
+
+enum TMPXVideoMode
+{
+    EMPXVideoLocal,
+    EMPXVideoStreaming,
+    EMPXVideoLiveStreaming,
+    EMPXVideoProgressiveDownload,
+    EMPXNumberOfModes
+};
+
+
+
+#endif /*MPXHELIXPLAYBACKPLUGINDEFS_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/inc/mpxvideobaseplaybackview.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,407 @@
+/*
+* 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:  MPX Video base playback view
+*
+*/
+
+
+// Version : %version: ou1cpsw#28 %
+
+
+// This file defines the API for VideoBasePlaybackView.dll
+
+#ifndef __VIDEOBASEPLAYBACKVIEW_H__
+#define __VIDEOBASEPLAYBACKVIEW_H__
+
+//  Include Files
+#include <e32base.h>    // CBase
+#include <e32std.h>     // TBuf
+#include <aknview.h>
+#include <mpxplaybackobserver.h>
+#include <mpxviewactivationobserver.h>
+#include <mpxcollectionobserver.h>
+
+#include "mpxvideoplaybackcontrol.hrh"
+#include "mpxvideoplaybackdisplayhandler.h"
+#include <mpxvideoplaybackdefs.h>
+#include <AknWsEventObserver.h>
+
+//  Constants
+
+//  Forward Declarations
+class CMPXVideoPlaybackContainer;
+class MMPXPlaybackUtility;
+class MMPXViewUtility;
+class MMPXCollectionUtility;
+class CMPFileDetailsDialog;
+class CMPFileDetails;
+
+class CMPXVideoPlaybackViewFileDetails;
+
+//  Class Definitions
+
+class CMPXVideoBasePlaybackView : public CAknView,
+                                  public MMPXPlaybackObserver,
+                                  public MMPXViewActivationObserver,
+                                  public MMPXPlaybackCallback,
+                                  public MMPXCollectionObserver,
+                                  public MAknWsEventObserver
+{
+    public:
+        ~CMPXVideoBasePlaybackView();
+
+        /**
+        * From CAknView
+        * Command handling function.
+        *
+        * @param aCommand Command which is handled
+        */
+        virtual void HandleCommandL( TInt aCommand );
+
+        void RetrieveFileNameAndModeL( CMPXCommand* aCmd );
+
+        void HandleWsEventL( const TWsEvent& aEvent, CCoeControl* aDestination );
+
+    protected:
+
+        /**
+        * From CAknView
+        * Processes user commands.
+        *
+        * @param aCommand ID of the command to respond to.
+        */
+        virtual void ProcessCommandL( TInt aCommand );
+
+        /**
+        * From CAknView
+        * Event handler for status pane size changes.
+        *
+        */
+        virtual void HandleStatusPaneSizeChange();
+
+        /**
+        * From CAknView
+        * Handles a view activation.
+        *
+        * @param aPrevViewId Specifies the view previously active.
+        * @param aCustomMessageId Specifies the message type.
+        * @param aCustomMessage The activation message.
+        */
+        virtual void DoActivateL( const TVwsViewId& aPrevViewId,
+                                  TUid aCustomMessageId,
+                                  const TDesC8& aCustomMessage );
+
+        /**
+        * From CAknView
+        * View deactivation function.
+        */
+        virtual void DoDeactivate();
+
+        /**
+        * From CAknView
+        * Foreground event handling function.
+        *
+        * @param aForeground Indicates the required focus state of the control.
+        */
+        virtual void HandleForegroundEventL( TBool aForeground );
+
+        /**
+        * From MEikMenuObserver
+        */
+        virtual void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
+
+        /**
+        * From MMPXPlaybackObserver
+        * Handle playback message
+        *
+        * @param aMessage Playback Message
+        * @param aErr system error code.
+        */
+        virtual void HandlePlaybackMessage( CMPXMessage* aMessage, TInt aError );
+
+        /*
+         *  From MMPXViewActivationObserver
+         *  Handle view activation.
+         *
+         *  @param aCurrentViewType Current view type Uid.
+         *  @param aPreviousViewType Previous view type Uid.
+         */
+        void HandleViewActivation( const TUid& aCurrentViewType, const TUid& aPreviousViewType );
+
+        /**
+        *  From MMPXPlaybackCallback
+        *  Handle playback property
+        *
+        *  @param aProperty the property
+        *  @param aValue the value of the property
+        *  @param aError error code
+        */
+        void HandlePropertyL( TMPXPlaybackProperty aProperty,
+                              TInt aValue,
+                              TInt aError );
+
+        /**
+        *  Method is called continously until aComplete=ETrue, signifying that
+        *  it is done and there will be no more callbacks
+        *  Only new items are passed each time
+        *
+        *  @param aPlayer UID of the subplayer
+        *  @param aSubPlayers a list of sub players
+        *  @param aComplete ETrue no more sub players. EFalse more subplayer
+        *                   expected
+        *  @param aError error code
+        */
+        inline void HandleSubPlayerNamesL( TUid /*aPlayer*/,
+                                           const MDesCArray* /*aSubPlayers*/,
+                                           TBool /*aComplete*/,
+                                           TInt /*aError*/ )
+        {}
+
+        /**
+        *  Call back of media request
+        *
+        *  @param aMedia media
+        *  @param aError error code
+        */
+        void HandleMediaL( const CMPXMedia& aProperties, TInt aError );
+
+        void UpdatePbPluginMediaL( TBool aSeek);
+
+
+        /**
+        *  Handle completion of a asynchronous command
+        *  @param aCommandResult result of the command, NULL if error
+        *  @param aError error code
+        */
+        void HandlePlaybackCommandComplete( CMPXCommand* /*aCommandResult*/,
+                                            TInt /*aError*/);
+        /*
+         *  From base class MMPXCollectionMediaObserver
+         *  (via MMPXCollectionObserver)
+         *  Handle extended media properties
+         *
+         *  @param aMedia media
+         *  @param aError error code
+         */
+        inline void HandleCollectionMediaL( const CMPXMedia& /*aMedia*/, TInt /*aError*/ ) {}
+
+        /*
+         *  From base class MMPXCollectionObserver
+         */
+        inline void HandleCollectionMessage( CMPXMessage* /*aMsg*/, TInt /*aErr*/ ) {}
+
+        inline void HandleOpenL( const CMPXMedia& /*aEntries*/,
+                                 TInt /*aIndex*/,
+                                 TBool /*aComplete*/,
+                                 TInt /*aError*/ ) {}
+
+        inline void HandleOpenL( const CMPXCollectionPlaylist& /*aPlaylist*/, TInt /*aError*/ ) {}
+
+    public:
+        /**
+        * Set property
+        */
+        void SetPropertyL( TMPXPlaybackProperty aProperty, TInt aValue );
+        virtual void RetrievePdlInformationL();
+
+    protected:
+
+        virtual void CloseEmbeddedPlaybackViewL() = 0;
+
+        /*
+         *  Handle Download State Change
+         *  @param  aState  new state of the download
+         */
+        virtual void HandlePdlStateChangeL( TInt aState ) = 0;
+
+        /*
+         *  Handle transition to the stopped state
+         */
+        virtual void HandleStoppedStateL() = 0;
+
+        virtual void HandleInitializingStateL( TMPXPlaybackState aLastState ) = 0;
+
+        virtual void HandlePluginErrorL( TInt aError );
+
+        virtual void ClosePlaybackViewL();
+
+        virtual void HandleBufferingStateL();
+
+        virtual void IssuePlayCommandL();
+
+        void InitializeVideoPlaybackViewL();
+        void DisplayInfoMessageL( TInt aResourceId, TBool aWaitingDialog = EFalse );
+        void DisplayErrorMessageL( TInt aResourceId );
+
+        CMPXVideoBasePlaybackView();
+
+        /*
+         *  Activates an active object to close the player
+         *  @since 5.0
+         */
+        void ActivateClosePlayerActiveObject();
+
+        /*
+         *  Provides the static function for the callback to close the player
+         *  Called by CIdle iIdle
+         *  @since 3.2
+         *  @param aPtr Pointer to callback class
+         *  @return KErrNone
+         */
+        static TInt ClosePlayerL( TAny* aPtr );
+
+        /*
+         *  Called to stop and exit the player
+         *  @since 3.2
+         *  @return void
+         */
+        virtual void DoClosePlayerL();
+
+
+        virtual void HandleVideoPlaybackMessage( CMPXMessage* aMessage );
+
+        /**
+         * Returns views Implementation id.
+         * @return id for this view.
+         */
+        virtual TUid ViewImplementationId() const = 0;
+
+        virtual void HandleClosePlaybackViewL();
+
+        TBool IsAppInFrontL();
+
+        TInt RetrieveBufferingPercentageL();
+
+        void DoHandleInitializingStateL( TMPXPlaybackState aLastState );
+
+        TBool IsMultiItemPlaylist();
+
+        virtual void SendWindowCommandL( TMPXVideoPlaybackCommand aCmd );
+
+        virtual void HandlePdlReloadComplete();
+
+        virtual void ResetPdlUserInputs();
+                
+        virtual MMPXPlaybackUtility& PlaybackUtilityL();
+                
+        void SendCustomMpxPlaybackUtilityCmdL( CMPXCommand& aCmd, MMPXPlaybackCallback* aCallback=NULL );
+                
+        void SendPlaybackCmdL( TMPXPlaybackCommand aCmd );
+        
+        virtual void ClearPlaybackUtility();
+
+    private:
+
+        /**
+        *  Handle playback message
+        *
+        *  @param aMsg playback message
+        */
+        virtual void DoHandlePlaybackMessageL( CMPXMessage* aMessage );
+
+        /**
+        *  Handle playback error message
+        *
+        *  @param aErr system error code.
+        */
+        void DoHandleErrorPlaybackMessageL( TInt aError );
+
+        void SetDisplayWindowL();
+
+        void CreateGeneralPlaybackCommandL( TMPXPlaybackCommand aCmd, TBool aDoSync = ETrue );
+
+        void SetVideoRectL();
+
+        void DisplayFileDetailsDialogL();
+
+        /**
+        *  Handle media properties.
+        *
+        *  @param aMedia media properties
+        *  @param aError error code
+        */
+        virtual void DoHandleMediaL( const CMPXMedia& aMedia, TInt aError );
+
+        void CreateAbortDsaCmdL();
+
+        void CreateVideoSpecificCmdL( TMPXVideoPlaybackCommand aCmd );
+
+        void RestartDsaL();
+
+        void RequestMediaL();
+        void RequestCollectionMediaL();
+        void RequestPlaybackMediaL();
+
+        void ParseMetaDataL( const CMPXMedia& aMedia );
+
+        void DoHandleStateChangeL( TInt aNewState );
+
+        void HandleGeneralPlaybackMessageL( CMPXMessage* aMessage );
+
+        void SetAspectRatioL( TMPXVideoPlaybackCommand aCmd );
+
+        void HandleVolumeCmdL( TMPXPlaybackCommand aCmd );
+
+        void HandleShortPressBackwardL();
+
+        TInt AddDllPath( TDes& aFileName );
+
+        void ShowFileDetailsDialogL();
+
+        void HandleDrmErrorsL( TInt aError );
+
+        TInt OpenDrmFileHandleL( RFile& aFile );
+        void LaunchDRMDetailsL();
+
+        void HandleRealOneBitmapTimeoutL();
+
+        TBool IsInMemoryPlugin();
+
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+        TInt OpenDrmFileHandle64L( RFile64& aFile );
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+    protected: // data
+        MMPXPlaybackUtility*                iPlaybackUtility;
+        MMPXViewUtility*                    iViewUtility;
+        MMPXCollectionUtility*              iCollectionUtility;
+        CMPXVideoPlaybackDisplayHandler*    iDisplayHandler;
+        CAknWsEventMonitor*                 iAknEventMonitor;
+
+        TMPXPlaybackState                   iPlaybackState;
+
+        CMPXVideoPlaybackContainer*         iContainer;
+
+        TInt                                iVideoResourceOffset;
+
+        CMPFileDetailsDialog*               iFileDetailsDialog;
+        CMPXVideoPlaybackViewFileDetails*   iFileDetails;
+        CIdle*                              iCloseAO;
+
+        TBool                               iMediaRequested;
+        TBool                               iPlaylistView;
+        TBool                               iCollectionMediaRequested;
+        TBool                               iPdlReloading;
+        TBool                               iRealOneDelayedPlay;
+        TBool                               iKeyboardInFocus;
+        TBool                               iExitPlayer;
+
+        HBufC*                              iClipName;
+
+        TBool                               iSyncClose;
+};
+
+#endif  // __VIDEOBASEPLAYBACKVIEW_H__
+
+// EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/inc/mpxvideopdlplaybackview.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,113 @@
+/*
+* 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:  MPX Video PDL playback view
+*
+*/
+
+
+// Version : %version: 10 %
+
+
+// This file defines the API for VideoPlaybackView.dll
+
+#ifndef __VIDEOPDLPLAYBACKVIEW_H__
+#define __VIDEOPDLPLAYBACKVIEW_H__
+
+//  Include Files
+#include <mpxplaybackcommanddefs.h>
+
+#include "mpxvideobaseplaybackview.h"
+
+//  Constants
+
+//  Forward Declarations
+
+//
+//  Class Definitions
+//
+class CMPXVideoPdlPlaybackView : public CMPXVideoBasePlaybackView
+{
+    public:
+        IMPORT_C static CMPXVideoPdlPlaybackView* NewL();
+        IMPORT_C static CMPXVideoPdlPlaybackView* NewLC();
+
+        ~CMPXVideoPdlPlaybackView();
+
+        void RetrievePdlInformationL();
+
+    protected:
+
+        /*
+         * From CAknView
+         * @return Views Uid
+         */
+        virtual TUid Id() const;
+
+        TUid ViewImplementationId() const;
+
+        void CloseEmbeddedPlaybackViewL();
+
+        void HandlePluginErrorL( TInt aError );
+
+        /*
+         *  Handle Download State Change
+         *  @param  aState  new state of the download
+         */
+        void HandlePdlStateChangeL( TInt aState );
+
+        /*
+         *  Handle transition to the stopped state
+         */
+        void HandleStoppedStateL();
+
+        void HandleBufferingStateL();
+
+        void HandleInitializingStateL( TMPXPlaybackState aLastState );
+
+        void SendWindowCommandL( TMPXVideoPlaybackCommand aCmd );
+
+        void HandlePdlReloadComplete();
+
+        void ResetPdlUserInputs();
+
+    private:
+
+        CMPXVideoPdlPlaybackView();
+
+        void ConstructL();
+
+        void SendPdlCustomCommandL( TMPXPlaybackPdCommand aCustomCmd );
+
+        TBool BringUpBrowserL();
+
+        void ClosePlaybackViewWithErrorL();
+
+        //
+        //  Functions to unblock user inputs after a timeout
+        //
+        static TInt HandleBlockInputsTimeOut( TAny* aPtr );
+        void DoHandleBlockInputsTimeOut();
+
+    private: // data
+
+        TMPXPlaybackPdDownloadState         iPdlState;
+        TInt                                iDownloadSize;
+        TBool                               iUserInputsBlocked;
+
+        CPeriodic*                          iBlockInputsTimer;
+};
+
+#endif  // __VIDEOPDLPLAYBACKVIEW_H__
+
+// EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/inc/mpxvideoplaybackcontainer.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,249 @@
+/*
+* 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:  MPX Video playback view's container implementation.
+*
+*/
+
+
+// Version : %version: 9 %
+
+
+#ifndef __CMPXVIDEOPLAYBACKCONTAINER_H__
+#define __CMPXVIDEOPLAYBACKCONTAINER_H__
+
+
+// INCLUDES
+#include <coecntrl.h>
+#include <eikimage.h> // CEikImage
+#include <remconcoreapitargetobserver.h> // Side volume key
+
+#include <mpxplaybackframeworkdefs.h>
+#include "mpxvideoplaybackcontrol.hrh"
+
+// FORWARD DECLARATIONS
+class CMPXVideoBasePlaybackView;
+class CMPXVideoPlaybackControlsController;
+class CMPXVideoPlaybackViewFileDetails;
+class CMPXVideoPlaybackUserInputHandler;
+
+// CLASS DECLARATION
+
+/**
+ *  Container class for video view.
+ *
+ */
+class CMPXVideoPlaybackContainer : public CCoeControl
+{
+    public:
+
+        /**
+        * Two-phased constructor.
+        */
+        static CMPXVideoPlaybackContainer* NewL( CMPXVideoBasePlaybackView* aView );
+
+        /**
+        * Destructor.
+        */
+        ~CMPXVideoPlaybackContainer();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CMPXVideoPlaybackContainer( CMPXVideoBasePlaybackView* aView );
+
+        /**
+        * Symbian 2nd phase constructor.
+        *
+        * @param aRect Frame rectangle for container.
+        */
+        void ConstructL();
+
+    protected:
+        // from base class CoeControl
+        /**
+        * From CoeControl.
+        * Handles key events.
+        *
+        * @param aKeyEvent The key event.
+        * @param aType The type of key event.
+        */
+        TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
+
+        /**
+        * From CoeControl.
+        * Handles a change to the control's resources.
+        *
+        * @param aType A message UID value.
+        */
+        void HandleResourceChange( TInt aType );
+
+        /**
+        * From CoeControl.
+        * Gets the control's help context.
+        *
+        * @param aContext The control's help context.
+        */
+        void GetHelpContext( TCoeHelpContext& aContext ) const;
+
+        /**
+        * From CCoeControl.
+        * Gets the number of controls contained in a compound control.
+        *
+        * @return The number of component controls contained by this control.
+        */
+        TInt CountComponentControls() const;
+
+        /**
+        * From CCoeControl.
+        * Gets an indexed component of a compound control.
+        *
+        * @param aIndex The index of the control.
+        * @return The component control with an index of aIndex.
+        */
+        CCoeControl* ComponentControl( TInt aIndex ) const;
+
+        /**
+        * From CCoeControl.
+        * Draws the control.
+        *
+        * @param aRect The rectangular region of the control to be drawn.
+        */
+        void Draw( const TRect& aRect ) const;
+
+        /**
+        * From CCoeControl.
+        * Handle events from the touch screen
+        */
+        void HandlePointerEventL( const TPointerEvent& aPointerEvent);
+
+    public:
+        /**
+        * Return a handle to the window
+        */
+        RWindow& GetWindow() const;
+
+        /**
+        * Handle commands from control controller
+        * @return void
+        */
+        IMPORT_C void HandleCommandL( TInt aCommand, TInt aValue = 0 );
+
+        IMPORT_C void DoHandlePointerEventL( const TPointerEvent& aPointerEvent );
+        IMPORT_C void DoHandleKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
+
+        /**
+        * Getter method for User INput Handler
+        *
+        */
+        IMPORT_C CMPXVideoPlaybackUserInputHandler* UserInputHandler();
+
+        /**
+        * Handle event from container
+        */
+        void HandleEventL( TMPXVideoPlaybackControlCommandIds aEvent, TInt aValue = 0 );
+
+        void AddFileDetailsL( CMPXVideoPlaybackViewFileDetails* aDetails );
+
+        TBool IsRealOneBitmapTimerActive();
+
+    private:
+
+        /**
+        * Creates new skins for the view.
+        * @return void
+        */
+        void SkinChangeL();
+
+        /**
+        * Create CEikImage
+        * @param aIconsPath icon path
+        * @param aBitmapIndex bitmap index
+        * @param aBitmapMaskIndex bitmap index
+        * @return CEikImage
+        */
+        CEikImage* CreateImageL( TFileName& aIconsPath,
+                                 TInt aBitmapIndex,
+                                 TInt aBitmapMaskIndex );
+
+        /**
+        * Handles volume repeat timer timout
+        * @return TInt
+        */
+        static TInt HandleVolumeRepeatTimeoutL( TAny* aPtr );
+
+        /**
+        * Adjust volume(+1/-1) for media key
+        * @return void
+        */
+        void HandleVolumeRepeatL();
+
+        void CreateControlsL();
+
+        /**
+        * Handles rocker's middle key
+        *
+        * @param aKeyEvent The key event.
+        * @param aType The type of key event.
+        */
+        void HandleRockerMiddleKeyL(const TKeyEvent& aKeyEvent,
+                                   TEventCode aType);
+
+        /**
+        * Handles rocker's up key
+        *
+        * @param aType The type of key event.
+        */
+        void HandleSeekFwdL(TEventCode aType);
+
+        /**
+        * Handles rocker's down key
+        *
+        * @param aType The type of key event.
+        */
+        void HandleSeekBackL(TEventCode aType);
+
+        /*
+        *  Handles the Controls Timer Timout
+        */
+        static TInt HandleRealOneBitmapTimeout( TAny* aPtr );
+
+        void DoHandleRealOneBitmapTimeout();
+
+    protected:   // data
+        CMPXVideoBasePlaybackView*              iView;
+        CMPXVideoPlaybackControlsController*    iControlsController;
+
+        //
+        //  Bitmaps are owned by the Controls Controller
+        //
+        CEikImage*                              iRealOneBitmap;
+
+        CMPXVideoPlaybackViewFileDetails*       iFileDetails;
+        TKeyResponse                            iKeyResponse;
+
+        CMPXVideoPlaybackUserInputHandler*      iUserInputHandler;  // owned
+
+        //
+        //  Members to control Real One Bitmap
+        //  iDelayedFileDetails is not owned
+        //
+        CPeriodic*                              iRealOneBitmapTimer;
+        CMPXVideoPlaybackViewFileDetails*       iDelayedFileDetails;
+};
+
+#endif  // __CMPXVIDEOPLAYBACKCONTAINER_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/inc/mpxvideoplaybackcontrol.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,197 @@
+/*
+* 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:  Implementation of CMPXVideoPlaybackControl
+*
+*/
+
+// Version : %version: 4 %
+
+
+#ifndef MPXPLAYBACKCONTROL_H_
+#define MPXPLAYBACKCONTROL_H_
+
+// INCLUDES
+#include <coecntrl.h>
+#include <mpxplaybackframeworkdefs.h>
+
+#include "mpxhelixplaybackplugindefs.h"
+#include "mpxvideoplaybackcontrol.hrh"
+
+// FORWARD DECLARATIONS
+class CMPXVideoPlaybackControlsController;
+class CMPXVideoPlaybackViewFileDetails;
+
+#ifdef RD_TACTILE_FEEDBACK
+class MTouchFeedback;
+#endif //RD_TACTILE_FEEDBACK
+
+// DATA TYPES
+
+// CLASS DECLARATION
+
+class CMPXVideoPlaybackControl : public CCoeControl
+{
+
+    public: // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CMPXVideoPlaybackControl* NewL( CMPXVideoPlaybackControlsController* aController,
+                                               CCoeControl* aControl,
+                                               TRect aRect,
+                                               TMPXVideoPlaybackControls aControlIndex,
+                                               TUint aProperties );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CMPXVideoPlaybackControl();
+
+    protected:
+
+        /**
+        * C++ default constructor.
+        */
+        CMPXVideoPlaybackControl( CMPXVideoPlaybackControlsController* aController,
+                                  CCoeControl* aControl,
+                                  TMPXVideoPlaybackControls aControlIndex,
+                                  TUint aProperties );
+
+        /**
+        * Symbian 2nd phase constructor.
+        */
+        void ConstructL( TRect aRect );
+
+    protected:
+
+        /**
+        * From CCoeControl.
+        * Gets the number of controls contained in a compound control.
+        *
+        * @return The number of component controls contained by this control.
+        */
+        TInt CountComponentControls() const;
+
+        /**
+        * From CCoeControl.
+        * Gets an indexed component of a compound control.
+        *
+        * @param aIndex The index of the control.
+        * @return The component control with an index of aIndex.
+        */
+        CCoeControl* ComponentControl( TInt aIndex ) const;
+
+        /**
+        * From CCoeControl,Draw.
+        * @param aRect drawable area.
+        */
+        void Draw(const TRect& aRect) const;
+
+        /**
+        * From CCoeControl.
+        * Handle events from the touch screen
+        */
+        void HandlePointerEventL( const TPointerEvent& aPointerEvent);
+
+    public:
+
+        /**
+        * Set visibility of each control
+        */
+        void SetVisibility( TMPXPlaybackState aState );
+
+        /**
+        * return control index
+        */
+        TMPXVideoPlaybackControls ControlIndex();
+
+        /**
+        * set changed volume
+        */
+        TBool VolumeChanged( TInt aVolume );
+
+        /**
+        * set changed duration
+        */
+        TBool DurationChangedL( TInt aDuration );
+
+        /**
+        * set changed volume
+        */
+        TBool PositionChangedL( TInt aPosition );
+
+        /**
+        * Set changed position
+        */
+        TBool AspectRatioChanged( TInt aAspectRatio );
+
+        /**
+        * set changed volume
+        */
+        TBool SetDownloadSize( TInt aSize );
+
+        /**
+        * set changed state
+        */
+        TBool UpdateStateOnButtonBar( TMPXPlaybackState aState );
+
+        /*
+         *  UpdateDownloadPosition
+         *  updates the download ratio on the progress bar
+         */
+        TBool UpdateDownloadPosition( TInt aSize );
+
+        /*
+         *  Update the controls with the file details
+         */
+        void UpdateControlsWithFileDetailsL( CMPXVideoPlaybackViewFileDetails* aDetails );
+
+        /**
+        *  Set the visibility of the control to false unless it is a PDL control
+        */
+        void HideControl();
+
+        /*
+         *  Stop Animation Branding Timer
+         */
+        TBool StopBrandingAnimationTimer();
+        
+        /*
+         *  Update the controls with TV Out Connected information
+         */
+        TBool UpdateTVOutStatusL( TBool aTvOutConnected );
+
+
+        IMPORT_C void DoHandlePointerEventL( const TPointerEvent& aPointerEvent );
+
+        void ResetControl();
+
+    protected:
+
+        CMPXVideoPlaybackControlsController* iController;
+        CCoeControl*                         iControl;
+        TMPXVideoPlaybackControls            iControlIndex;
+        TUint                                iProperties;
+        TMPXVideoMode                        iPlaybackMode;
+
+#ifdef RD_TACTILE_FEEDBACK
+        MTouchFeedback*                      iFeedback;
+#endif //RD_TACTILE_FEEDBACK
+
+};
+
+#endif /*MPXPLAYBACKCONTROL_H_*/
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/inc/mpxvideoplaybackcontrol.hrh	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,132 @@
+/*
+* 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:  header file of CMPXVideoPlaybackControl
+*
+*/
+
+
+// Version : %version: 11 %
+
+
+#ifndef MPXVIDEOPLAYBACKCONTROL_HRH_
+#define MPXVIDEOPLAYBACKCONTROL_HRH_
+
+// DATA TYPES
+const TInt KThousandNotKilobyte = 1000;
+
+enum TMPFXVideoPlaybackControlProperties
+{
+    EMPXSoftkeyControl = 0x1,
+    EMPXBufferingControl = 0x2,
+    EMPXShownWhenInitializing = 0x4,
+    EMPXShownWhenPlaying =  0x8,
+    EMPXShownWhenPaused = 0x10,
+    EMPXShownWhenStopped = 0x20,
+    EMPXShownWhenSeeking = 0x40,
+    EMPXAllProperties = 0xffffffff
+};
+
+enum TMPXVideoPlaybackControls
+{
+    EMPXSoftkeyDetails,
+    EMPXSoftkeyBack,
+    EMPXButtonBar,
+    EMPXProgressBar,
+    EMPXVolumeBar,
+
+    // Only for streaming case
+    // Can handle from NotInitilized state
+    //
+    EMPXBufferingLabel,
+
+    // Only for audio only or tv out case
+    // Upto user or prepared state
+    EMPXTitleLabel,
+    EMPXArtistLabel,
+
+    //
+    //  Bitmaps
+    //
+    EMPXRealAudioBitmap,
+    EMPXSoundBitmap,
+    EMPXRealLogoBitmap,
+    EMPXNoVideoBitmap,
+
+    EMPXDownloadPausedIcon,
+
+    EMPXAspectRatioIcon,
+    EMPXBrandingAnimation,
+
+    EMPXVideoPausedIcon,
+    EMPXMediaDetailsViewer,
+
+    EMPXControlsCount  // has to be last
+};
+
+/** Command ID's. */
+enum TMPXVideoPlaybackControlCommandIds
+{
+    EMPXControlCmdPluginInitialized,
+    EMPXControlCmdToggleVisibility, // Whenever user taps on the screen
+    EMPXControlCmdTvOutConnected,
+    EMPXControlCmdTvOutDisconnected,
+    EMPXControlCmdSetAspectRatio,
+    EMPXControlCmdSetVolume,
+    EMPXControlCmdSetDuration,
+    EMPXControlCmdSetPosition,
+    EMPXControlCmdStateChanged,
+    EMPXControlCmdDownloadUpdated,
+    EMPXControlCmdSetDownloadSize,
+    EMPXControlCmdDownloadComplete,
+    EMPXControlCmdSetDownloadPaused,
+    EMPXControlCmdClearDownloadPaused,
+    EMPXControlCmdHandleBackgroundEvent,
+    EMPXControlCmdHandleForegroundEvent,
+    EMPXControlCmdHandleErrors,
+    EMPXControlCmdShowControls,
+    EMPXControlCmdSoftKeyPressed,
+    EMPXControlCmdShowFileDetailsViewer,
+    EMPXControlCmdCloseFileDetailsViewer,
+    EMPXControlCmdHideControls,
+    EMPXControlCmdSurfaceCreated,
+    EMPXControlCmdSurfaceRemoved,
+    EMPXControlCmdLoadingStarted,
+    EMPXControlCmdCreateAspectRatioIcon,
+    EMPXControlCmdDeleteAspectRatioIcon
+};
+
+enum TMPXVideoSeekingType
+{
+    EMpxVideoSeekingForward,
+    EMpxVideoSeekingBackward,
+    EMpxVideoSeekingStop
+};
+
+enum TMPXVideoControlType
+{
+    EMpxVideoPlaybackContainer,
+    EMpxVideoPlaybackControl
+};
+
+enum TMPXVideoUserInputType
+{
+    EMpxVideoKeyboard,
+    EMpxVideoTouch,
+    EMpxVideoMediaKeys,
+    EMpxVideoSpecialHWKeys,
+    EMpxVideoNone
+};
+
+
+#endif /*MPXVIDEOPLAYBACKCONTROL_HRH_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/inc/mpxvideoplaybackcontrolscontroller.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,426 @@
+/*
+* 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:  Implementation of MPXVideoPlaybackControlsController
+*
+*/
+
+
+// Version : %version: 21 %
+
+
+#ifndef MPXVIDEOPLAYBACKCONTROLSCONTROLLER_H_
+#define MPXVIDEOPLAYBACKCONTROLSCONTROLLER_H_
+
+// INCLUDES
+#include <mpxplaybackframeworkdefs.h>
+#include <aknlayoutscalable_avkon.cdl.h>
+#include <f32file.h>
+#include <MMFScalingCustomCommandConstants.h>
+
+#include "mpxvideo_debug.h"
+#include "mpxvideoplaybackviewfiledetails.h"
+#include "mpxvideoplaybackcontrol.hrh"
+
+// FORWARD DECLARATIONS
+class CEikLabel;
+class CEikImage;
+class MTouchFeedback;
+class CMPXVideoPlaybackControl;
+class CMPXVideoPlaybackContainer;
+class CMPXVideoPlaybackControlPolicy;
+class CAknsBasicBackgroundControlContext;
+class CMPXVideoPlaybackControlConfiguration;
+
+// DATA TYPES
+
+enum TMPXTimerAction
+{
+    EMPXTimerCancel,
+    EMPXTimerReset
+};
+
+
+// CLASS DECLARATION
+
+class CMPXVideoPlaybackControlsController : public CBase
+{
+
+    public: // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CMPXVideoPlaybackControlsController* NewL(
+                CMPXVideoPlaybackContainer* aContainer,
+                TRect aRect,
+                CMPXVideoPlaybackViewFileDetails* aDetails );
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CMPXVideoPlaybackControlsController();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CMPXVideoPlaybackControlsController( CMPXVideoPlaybackContainer* aContainer, TRect aRect );
+
+        /**
+        * Symbian 2nd phase constructor.
+        */
+        void ConstructL( CMPXVideoPlaybackViewFileDetails* aDetails );
+
+    public:
+
+        /**
+        * Handle event from container
+        */
+        IMPORT_C void HandleEventL( TMPXVideoPlaybackControlCommandIds aEvent, TInt aValue = 0 );
+
+        IMPORT_C CEikImage* GetBitmap( TMPXVideoPlaybackControls aBitmap );
+
+        //
+        //  Add the file details to the controls controller when available
+        //
+        IMPORT_C void AddFileDetailsL( CMPXVideoPlaybackViewFileDetails* aDetails );
+
+        /**
+        * Command handling function.
+        * Call HandleCommandL() of container
+        */
+        void HandleCommandL( TInt aCommand, TInt aValue = 0 );
+
+        /**
+        * Return ETrue if TV-out cable gets connected
+        */
+        inline TBool IsTvOutConnected();
+
+        /**
+        * Reset or cancel timers for the controls
+        */
+        void ResetDisappearingTimers( TMPXTimerAction aTimerAction );
+
+        /**
+        * Return state
+        */
+        inline TMPXPlaybackState State();
+
+        /*
+         *   Return the Aspect Ratio for the clip
+         */
+        inline TMMFScalingType AspectRatio();
+
+        /**
+        * Return file details
+        */
+        inline CMPXVideoPlaybackViewFileDetails* FileDetails();
+
+        //
+        //  Locates the bitmap file searching from y: down and then z: last
+        //
+        void LocateBitmapFileL( TFileName& aFileName );
+
+        void SetRealOneBitmapVisibility( TBool aVisible );
+
+        inline TBool IsRealMediaFormat();
+
+        /**
+        * Stop branding animation
+        */
+        void StopBrandingAnimation();
+
+    private:
+        /**
+        * Create controls
+        */
+        void CreateControlsL();
+
+        /**
+        * Update controls
+        */
+        void HandleStateChange( TMPXPlaybackState aNewState );
+
+        /**
+        * Update Control's visibility
+        */
+        void UpdateControlsVisibility();
+
+        /**
+        * Toggle visibility
+        */
+        void ToggleVisibility();
+
+        CEikImage* CreateImageL( TFileName& aIconsPath, TInt aBitmapIndex, TInt aBitmapMaskIndex );
+
+        CEikImage* CreateBitmapL( TFileName& aIconsPath,
+                                  TInt aBitmapIndex,
+                                  const TAknWindowLineLayout& aLayout );
+
+        /**
+        * Create/delete controls based on updated control list
+        */
+        void ControlsListUpdatedL( TBool aUpdateVisibility = ETrue );
+
+        /**
+        * Create fake softkeyL
+        */
+        void CreateFakeSoftKeyL( TInt aResource,
+                                 TBool aTop,
+                                 TMPXVideoPlaybackControls aControlIndex,
+                                 TUint aProperties );
+
+        /**
+        * Crate text label with speccific layout
+        */
+        void CreateTextLabelWithSpecificLayoutL(
+                TInt aResource,
+                TMPXVideoPlaybackControls aControlIndex,
+                TUint aProperties,
+                TAknTextComponentLayout aLayout );
+
+        //
+        //  Create the bitmaps for Audio Only Clips
+        //
+        void CreateAudioOnlyBitmapL( TFileName& aIconsPath,
+                                     TInt aBitmapIndex,
+                                     TInt aBitmapMaskIndex,
+                                     TMPXVideoPlaybackControls aControlIndex,
+                                     const TAknWindowLineLayout& aLayout,
+                                     TUint aProperties );
+
+        //
+        //  Create the title control for Audio Only Clips
+        //
+        void CreateTitleControlL( TMPXVideoPlaybackControls aControlIndex,
+                                  TUint aProperties );
+
+        /**
+        * Create CEikLabelL
+        */
+        CEikLabel* CreateTextLabelL( const TDesC& aText );
+
+        /*
+        *  Handles the Controls Timer Timout
+        */
+        static TInt HandleControlsTimeout( TAny* aPtr );
+
+        /**
+        * Cancels all disappearing timers and hides all controls
+        */
+        void HideAllControls();
+
+        /**
+        * Show Controls and reset the timers
+        */
+        void ShowControls();
+
+        /**
+        * Return ETrue if any control is visible
+        */
+        TBool IsVisible();
+
+        /**
+        * Return ETrue if real one bitmap is visible
+        */
+        TBool IsRealOneBitmapVisible();
+
+        /**
+        * Append a control based on control index
+        */
+        void AppendControlL( TMPXVideoPlaybackControls aControlIndex );
+
+        /**
+        * Set changed volume
+        */
+        void VolumeChanged( TInt aVolume );
+
+        /**
+        * Set changed duration
+        */
+        void DurationChangedL( TInt aDuration);
+
+        /**
+        * Set changed position
+        */
+        void PositionChangedL( TInt aPosition );
+
+        /**
+        * Set changed position
+        */
+        void AspectRatioChanged( TInt aAspectRatio );
+        /*
+         *  Sets the download size on the progress bar
+         */
+        void SetDownloadSize( TInt aSize );
+
+        /*
+         *  Updates the download ratio on the progress bar
+         */
+        void UpdateDownloadPosition( TInt aNewSize );
+
+        /**
+        * Set changed state on button bar
+        */
+        void UpdateStateOnButtonBar();
+
+        /**
+        * Check whether this clip is real format or not
+        */
+        TBool IsRealFormatL( const TDesC& aDes );
+
+        /**
+        * Check whether this clip is real format or not for streaming/live streaming
+        */
+        TBool RealFormatForStreamingL( const TDesC& aDes );
+
+        /**
+        * Check whether this clip is real format or not for local/progressive donwload
+        */
+        TBool RealFormatForLocalL();
+
+        /*
+         *  Create the Real One bitmap
+         */
+        void CreateRealOneBitmapL();
+
+        /**
+        * Handle errors
+        */
+        void HandleErrors();
+
+        /**
+        * Return ETrue if control is visible
+        */
+        TBool IsSoftKeyVisible( TInt aValue );
+
+        /**
+        * Handle tvout connected/disconnected event
+        */
+        void HandleTvOutEventL( TBool aConnected,
+                                TMPXVideoPlaybackControlCommandIds aEvent,
+                                TBool aShowArIcon );
+        /**
+        * Handle softkey pressed event
+        */
+        void HandleSoftKeyPressedL( TInt aValue );
+
+        /*
+         *  Locate the path of the dll
+         */
+        TInt AddDllPath( TDes& aFileName );
+
+        /*
+         *  Shows the Meida File Details Viewer control
+         */
+        void ShowMediaDetailsViewerL();
+
+        /*
+         *  Checks if Media Details Viewer control is open/visible
+         */
+        TBool IsMediaDetailsViewerVisible();
+
+        /*
+         *  Closes Media Details Viewer
+         */
+        void CloseMediaDetailsViewer();
+
+        /*
+         *   Handles the Loading Started command that was received after Buffering state was
+         *   blocked by the playback view
+         */
+        void HandleLoadingStarted();
+
+        /*
+         *   This will cause the controls to be updated when the surface changes and the
+         *   controls are visible.
+         */
+        void RedrawControlsForSurfaceChanges();
+
+    private:
+
+        CMPXVideoPlaybackControlPolicy*         iControlsPolicy;
+        CArrayPtrFlat<CMPXVideoPlaybackControl> iControls;
+        CMPXVideoPlaybackControl*               iMediaDetailsViewerControl;
+
+        CMPXVideoPlaybackControlConfiguration*  iControlsConfig;
+
+        CEikImage*                              iRealOneBitmap;
+
+        CPeriodic*                              iControlsTimer;
+
+        TRect                                   iRect;
+        TInt                                    iVideoResourceOffset;
+
+        TMPXPlaybackState                       iState;
+        TMMFScalingType                         iAspectRatio;
+
+        CMPXVideoPlaybackViewFileDetails*       iFileDetails;     //  not owned
+
+        RFs                                     iFs;
+        TFileName                               iBitmapFileName;
+
+        TBool                                   iTvOutConnected;
+        TBool                                   iShowControls;
+        TBool                                   iRNFormat;
+
+#ifdef RD_TACTILE_FEEDBACK
+        MTouchFeedback*                         iFeedback;
+#endif //RD_TACTILE_FEEDBACK
+
+    public:
+        CMPXVideoPlaybackContainer*             iContainer;
+};
+
+// INLINE METHODS
+
+inline
+TMPXPlaybackState CMPXVideoPlaybackControlsController::State()
+{
+    return iState;
+}
+
+inline
+CMPXVideoPlaybackViewFileDetails* CMPXVideoPlaybackControlsController::FileDetails()
+{
+    return iFileDetails;
+}
+
+inline
+TBool CMPXVideoPlaybackControlsController::IsTvOutConnected()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::IsTvOutConnected(%d)"),
+        iFileDetails->iTvOutConnected);
+
+    return iFileDetails->iTvOutConnected;
+}
+
+inline
+TBool CMPXVideoPlaybackControlsController::IsRealMediaFormat()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::IsRealFormat() [%d]"), iRNFormat);
+    return iRNFormat;
+}
+
+inline
+TMMFScalingType CMPXVideoPlaybackControlsController::AspectRatio()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::AspectRatio(%d)"), iAspectRatio);
+    return iAspectRatio;
+}
+
+#endif /*MPXVIDEOPLAYBACKCONTROLSCONTROLLER_H_*/
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/inc/mpxvideoplaybackdisplayhandler.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,132 @@
+/*
+* 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:   Implementation of video playback display handler
+*
+*/
+
+
+// Version : %version: 12 %
+
+
+#ifndef __CMPXVIDEOPLAYBACKDISPLAYHANDLER_H__
+#define __CMPXVIDEOPLAYBACKDISPLAYHANDLER_H__
+
+// INCLUDES
+
+#include <mpxmessage2.h>
+#include <MMFScalingCustomCommandConstants.h>
+#include <mediaclientvideodisplay.h>
+#include <mpxvideoplaybackdefs.h>
+
+//
+//  CLASS DECLARATION
+//
+class MMPXPlaybackUtility;
+class CMPXVideoPlaybackContainer;
+class CMPXVideoPlaybackViewFileDetails;
+
+/*
+ *  CMPXVideoPlaybackDisplayHandler
+ *
+ */
+class CMPXVideoPlaybackDisplayHandler : public CBase
+{
+    //
+    //  To save user's preference for scaling type in video ratio + screen ratio
+    //
+    typedef struct
+    {
+        TReal32         videoRatio;
+        TReal32         screenRatio;
+        TMMFScalingType scalingType;
+    } TMPXAspectRatio ;
+
+    public:
+
+        ~CMPXVideoPlaybackDisplayHandler();
+
+        static CMPXVideoPlaybackDisplayHandler* NewL( MMPXPlaybackUtility* aPlayUtil,
+                                                      CMPXVideoPlaybackContainer* aContainer );
+
+        void CreateDisplayWindowL( CWsScreenDevice& aScreenDevice,
+                                   RWindow& aWin,
+                                   CMPXVideoPlaybackViewFileDetails* aFileDetails );
+
+        void RemoveDisplayWindow();
+
+        void HandleVideoDisplayMessageL( CMPXMessage* aMessage );
+
+        void SetAspectRatioL( TMPXVideoPlaybackCommand aCmd );
+
+        void DoHandleRealOneBitmapTimeoutL();
+
+        TBool ShowAspectRatioIcon();
+
+    private:
+
+        CMPXVideoPlaybackDisplayHandler( MMPXPlaybackUtility* aPlayUtil,
+                                         CMPXVideoPlaybackContainer* aContainer );
+
+        void ConstructL();
+
+        void LoadAspectRatioL();
+
+        void SaveAspectRatioL();
+
+        void AddDisplayWindowL( CWsScreenDevice& aScreenDevice,
+                                RWindowBase& aWindowBase,
+                                RWindow* aWin );
+
+        void SurfaceCreatedL( CMPXMessage* aMessage );
+        void SurfaceChangedL( CMPXMessage* aMessage );
+        void SurfaceRemoved();
+
+        void SignalSurfaceRemovedL();
+
+        void AttachNewSurfaceToWindowL();
+
+        void CalculateAspectRatioL();
+
+        TBool IsAspectRatioEqual( TReal aRatio1, TReal aRatio2 );
+
+        TReal CalculateVideoAspectRatio();
+
+        void RemoveSurfaceFromPlaybackPluginL();
+
+    private:
+        MMPXPlaybackUtility*                iPlaybackUtility;
+        CMPXVideoPlaybackContainer*         iContainer;
+
+        RArray<TMPXAspectRatio>             iAspectRatioArray;
+        TInt                                iCurrentIndexForAspectRatio;
+
+        CMediaClientVideoDisplay*           iVideoDisplay;
+
+        TBool                               iSurfaceCached;
+        TSurfaceId                          iSurfaceId;
+        TRect                               iCropRect;
+        TVideoAspectRatio                   iAspectRatio;
+        TReal32                             iScaleWidth;
+        TReal32                             iScaleHeight;
+        TInt                                iHorizontalPosition;
+        TInt                                iVerticalPosition;
+        TVideoRotation                      iRotation;
+        TAutoScaleType                      iAutoScale;
+
+        TReal                               iDisplayAspectRatio;
+        TInt                                iVideoHeight;
+        TInt                                iVideoWidth;
+};
+
+#endif // __CMPXVIDEOPLAYBACKDISPLAYHANDLER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/inc/mpxvideoplaybackmediadetailsviewer.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,235 @@
+/*
+* 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:  Media Details Viewer
+*
+*/
+
+
+// Version : %version:  7 %
+
+
+#ifndef MPXVIDEOPLAYBACKMEDIADETAILSVIEWER_H_
+#define MPXVIDEOPLAYBACKMEDIADETAILSVIEWER_H_
+
+//  INCLUDES
+#include <coecntrl.h>
+
+#include "mpxvideo_debug.h"
+
+// FORWARD DECLARATIONS
+class CEikLabel;
+class CMPXVideoPlaybackViewFileDetails;
+class CMPXVideoPlaybackControlsController;
+
+#ifdef RD_TACTILE_FEEDBACK
+class MTouchFeedback;
+#endif //RD_TACTILE_FEEDBACK
+
+class CMPXVideoPlaybackMediaDetailsViewer : public CCoeControl
+{
+    public:
+        /**
+        * Two-phased constructor.
+        */
+        static CMPXVideoPlaybackMediaDetailsViewer* NewL( CMPXVideoPlaybackControlsController* aController);
+
+        /**
+        * Destructor.
+        */
+        virtual ~CMPXVideoPlaybackMediaDetailsViewer();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CMPXVideoPlaybackMediaDetailsViewer( CMPXVideoPlaybackControlsController* aController );
+
+        /**
+         * By default Symbian 2nd phase constructor is private.
+         */
+        void ConstructL();
+
+    private:
+
+        /**
+        * From CoeControl,CountComponentControls.
+        * @return Number of contained component controls.
+        */
+        TInt CountComponentControls() const;
+
+        /**
+        * From CCoeControl,ComponentControl.
+        * @param aIndex index of a contained component control.
+        */
+        CCoeControl* ComponentControl( TInt aIndex ) const;
+
+        /**
+        * From CCoeControl,Draw.
+        * @param aRect drawable area.
+        */
+        void Draw( const TRect& aRect ) const;
+
+        /**
+        * Creates new skins for the control
+        * @return void
+        */
+        void SkinChangeL();
+
+
+    public: // from CoeControl
+
+        /**
+        * From CoeControl,OfferKeyEventL
+        */
+        void HandlePointerEventL( const TPointerEvent& aPointerEvent );
+
+    public:
+
+        /*
+         *  Bring the button bar to its original state
+         *  @since 5.0
+         */
+        void Reset();
+
+        /**
+        * Accessor for the dynamically calculated viewer rect
+        * @since 9.2
+        * @return the viewer rect
+        */
+        TRect ViewerRect();
+
+
+    private:
+
+        void CreateLabelsL();
+
+        void LaunchDRMDetailsL();
+
+        /**
+        * Sets label rects and text
+        */
+        void FormatLabelsL() const;
+
+        void UpdateBackgroundBitmapL() const;
+
+        /**
+        * Timer callback for scroll timer
+        * @since 9.2
+        * @param aPtr Pointer to timers callback
+        * @return KErrNone
+        */
+        static TInt ScrollTimer( TAny* aPtr );
+
+        /**
+        * Handle Scroll Timer
+        * @since 9.2
+        * @return void
+        */
+        void HandleScrollTimerL();
+
+        /**
+        * Determine the number of items to be shown in the viewer
+        * @since 9.2
+        * @return the number of rows to be created
+        */
+        TInt NumOfItemsShownInViewerL();
+
+        /**
+        * Dynamically calculate determine the viewer rectangle dyanmically
+        * @since 9.2
+        * @return the viewer rect
+        */
+        TRect CalculateViewerRectL();
+
+        /**
+         * Update the text of filename label
+         */
+        void UpdateFilenameL();
+
+        /**
+         * Update the text of title label
+         */
+        void UpdateTitleL();
+
+    private:
+
+        /**
+         * Scroll the too long text for some label
+         */
+        class TTextScroller
+        {
+            public:
+
+                /**
+                 * Constructor
+                 */
+                TTextScroller();
+
+                /**
+                 * Check if the source text needs scrolling.
+                 */
+                TBool IsScrollNeeded();
+
+                /**
+                 * Check if the text of a label needs to be updated
+                 */
+                TBool IsUpdateNeeded();
+
+                /**
+                 * Scroll the source text, and append it to the destination text
+                 *
+                 * @param aSrcText the source text to be scrolled.
+                 * @param aDesText to which the scrolled text to be appended
+                 */
+                void ScrollText( const TDesC& aSrcText, TDes& aDesText );
+
+            private:
+
+                TUint32        iDelayBeginningTick;
+                TInt           iTextScrollPos;
+                TBool          iDelay;
+                TBool          iScroll;
+                TInt           iSrcTextLen;
+        };
+
+    private:    // Data
+
+        CMPXVideoPlaybackControlsController* iController;
+
+        CEikLabel*                           iClipnameLabel;
+        CEikLabel*                           iTitleLabel;
+        CEikLabel*                           iArtistLabel;
+        CEikLabel*                           iFormatLabel;
+        CEikLabel*                           iResolutionLabel;
+        CEikLabel*                           iDurationLabel;
+        CEikLabel*                           iBitrateLabel;
+        CEikLabel*                           iLicenseLabel;
+        CEikLabel*                           iAdditionalLabel;
+
+
+        CFbsBitmap*                          iBackgroundBitmap;
+        CPeriodic*                           iScrollingTextTimer;
+        TRect                                iViewerRect;
+        HBufC*                               iAdditionalString;
+        TTextScroller                        iFilenameScroller;
+        TTextScroller                        iTitleScroller;
+        // after every scrolling label has updated, draw them
+        TBool                                iScrolledTextUpdated;
+        TBool                                iDrmDetailsLaunched;
+};
+
+
+
+#endif /* MPXVIDEOPLAYBACKMEDIADETAILSVIEWER_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/inc/mpxvideoplaybackuids.hrh	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,41 @@
+/*
+* 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:  Resource headers for video UIDs
+ *
+*/
+
+// Version : %version: 3 %
+
+
+
+
+#ifndef __MPXPLAYBACKUIDS_HRH__
+#define __MPXPLAYBACKUIDS_HRH__
+
+// CONSTANTS
+
+#define KMPXVIDEOPLAYBACKVIEWPLUGINUID 0x200159AC
+#define KMPXVIDEOPLAYBACKVIEWPLUGINIMPLEMENTATIONUID 0x200159AD
+
+#define KMPXVIDEOPDLPLAYBACKVIEWPLUGINUID 0x2001E5A7
+#define KMPXVIDEOPDLPLAYBACKVIEWPLUGINIMPLEMENTATIONUID 0x2001E5A8
+
+#define KMPXVIDEOPLAYBACKPLUGINIMPLEMENTATIONUID 0x10282551
+
+#define KMPXVIDEOPLAYBACKVIEWUID 0x200159B4
+#define KMPXVIDEOPDLPLAYBACKVIEWUID 0x2001E5A9
+
+#define KBROWSERUID 0x10008D39
+
+#endif  // __MPXPLAYBACKUIDS_HRH__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/inc/mpxvideoplaybackuserinputhandler.h	Thu Nov 04 11:16:56 2010 +0200
@@ -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 "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 of MPXVideoPlaybackUserInputHandler
+*
+*/
+
+
+// Version : %version:  10 %
+
+
+#ifndef MPXVIDEOPLAYBACKUSERINPUTHANDLER_H_
+#define MPXVIDEOPLAYBACKUSERINPUTHANDLER_H_
+
+// INCLUDES
+#include <f32file.h>
+#include <coecntrl.h>
+#include <remconcoreapitargetobserver.h> // Side volume key
+
+#include "mpxvideoplaybackcontrol.hrh"
+#include "mpxvideoplaybackcontrolscontroller.h"
+#include "mpxvideo_debug.h"
+
+// FORWARD DECLARATIONS
+class CMPXVideoPlaybackControl;
+class CMPXVideoPlaybackControlsController;
+class CRemConInterfaceSelector; // Side volume key
+class CRemConCoreApiTarget;
+class CMPXVideoPlaybackContainer;
+
+
+// CLASS DECLARATION
+
+class CMPXVideoPlaybackUserInputHandler : public CBase,
+                                          public MRemConCoreApiTargetObserver
+{
+    public: // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CMPXVideoPlaybackUserInputHandler* NewL( CMPXVideoPlaybackContainer* iContainer );
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CMPXVideoPlaybackUserInputHandler();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CMPXVideoPlaybackUserInputHandler( CMPXVideoPlaybackContainer* iContainer );
+
+        /**
+        * Symbian 2nd phase constructor.
+        */
+        void ConstructL( );
+
+    public:
+
+        IMPORT_C void ProcessPointerEventL( CCoeControl* aControl,
+                                            const TPointerEvent& aPointerEvent,
+                                            TMPXVideoControlType aMPXControl );
+
+        void ProcessKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
+
+        void ProcessMediaKey( TRemConCoreApiOperationId aOperationId,
+                              TRemConCoreApiButtonAction aButtonAct );
+
+        void DoHandleMediaKey( TRemConCoreApiOperationId aOperationId,
+                               TRemConCoreApiButtonAction aButtonAct );
+
+        // From MRemConCoreApiTargetObserver
+        /**
+        * Side volume key API from MRemConCoreApiTargetObserver
+        * @since 3.2
+        * @see MRemConCoreApiTargetObserver
+        */
+        virtual void MrccatoPlay(
+                TRemConCoreApiPlaybackSpeed aSpeed,
+                TRemConCoreApiButtonAction aButtonAct );
+
+        virtual void MrccatoCommand(
+                TRemConCoreApiOperationId aOperationId,
+                TRemConCoreApiButtonAction aButtonAct );
+
+        /**
+        * Setter method for iForeground
+        * @param aForeground - the value to be set
+        * @return void
+        */
+        void SetForeground( TBool aForeground );
+
+        /*
+         *  Function will block all user inputs until the new PDL command is received
+         *  @param aBlockInputs - the value to be set
+         */
+        void BlockPdlUserInputs( TBool aBlockInputs );
+
+    private:
+        /**
+        * Handles volume repeat timer timout
+        * @return TInt
+        */
+        static TInt HandleVolumeRepeatTimeoutL( TAny* aPtr );
+
+        /**
+        * Adjust volume(+1/-1) for media key
+        * @return void
+        */
+        void HandleVolumeRepeatL();
+
+        void HandleFastForward( TRemConCoreApiButtonAction aButtonAct );
+
+        void HandleRewind( TRemConCoreApiButtonAction aButtonAct );
+
+        void HandleVolumeUp( TRemConCoreApiButtonAction aButtonAct );
+
+        void HandleVolumeDown( TRemConCoreApiButtonAction aButtonAct );
+
+        void ReRoutePointerEventL( CCoeControl* aControl,
+                                   const TPointerEvent& aPointerEvent,
+                                   TMPXVideoControlType aMPXControl );
+
+        TBool IsUserInputAllowed();
+
+    private:
+
+        TMPXVideoUserInputType                  iProcessingInputType;     // the type of input being processed
+        TInt                                    iLastPressedKeyScanCode; // scancode of last key that sent EEventKeyDown
+        TRemConCoreApiOperationId               iLastMediaKeyPressed;    // Id of last mediakey thats sent a button-press
+
+        CRemConInterfaceSelector*               iInterfaceSelector;         // Side volume key, owned
+        CRemConCoreApiTarget*                   iCoreTarget;            // Owned by CRemConInterfaceSelector
+
+        CPeriodic*                              iVolumeRepeatTimer;     // owned
+        TBool                                   iVolumeRepeatUp;
+        TBool                                   iForeground;
+        TBool                                   iBlockPdlInputs;
+
+        CMPXVideoPlaybackContainer*             iContainer;            // not owned
+        CCoeControl*                            iActiveControlPtr;  // not owned
+        TMPXVideoControlType                    iActiveControlType;
+};
+
+
+#endif /*MPXVIDEOPLAYBACKUSERINPUTHANDLER_H_*/
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/inc/mpxvideoplaybackview.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,90 @@
+/*
+* 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:  MPX Video playback view
+*
+*/
+
+// Version : %version: 5 %
+
+
+// This file defines the API for VideoPlaybackView.dll
+
+#ifndef __VIDEOPLAYBACKVIEW_H__
+#define __VIDEOPLAYBACKVIEW_H__
+
+//  Include Files
+#include "mpxvideobaseplaybackview.h"
+
+//  Constants
+
+//  Forward Declarations
+
+//  Class Definitions
+
+class CMPXVideoPlaybackView : public CMPXVideoBasePlaybackView
+{
+    public:
+
+        /*
+         *  Two phase constructor
+         *
+         *  @since 9.2
+         *  @return  pointer to the new object
+         */
+        IMPORT_C static CMPXVideoPlaybackView* NewL();
+        IMPORT_C static CMPXVideoPlaybackView* NewLC();
+
+        /*
+         *  Destuctor
+         */
+        ~CMPXVideoPlaybackView();
+
+    protected:
+
+        /*
+         *  From CAknView
+         *  Returns views id.
+         *
+         *  @return Views Uid
+         */
+        TUid Id() const;
+
+        TUid ViewImplementationId() const;
+
+        void CloseEmbeddedPlaybackViewL();
+
+        virtual void HandlePluginErrorL( TInt aError );
+
+        /*
+         *  Handle Download State Change
+         *  @param  aState  new state of the download
+         */
+        void HandlePdlStateChangeL( TInt aState );
+
+        /*
+         *  Handle transition to the stopped state
+         */
+        void HandleStoppedStateL();
+
+        void HandleInitializingStateL( TMPXPlaybackState aLastState );
+
+    private:
+
+        CMPXVideoPlaybackView();
+        void ConstructL();
+};
+
+#endif  // __VIDEOPLAYBACKVIEW_H__
+
+// EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/inc/mpxvideoplaybackviewfiledetails.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,100 @@
+/*
+* 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:  Container for MPX Video File Details
+*
+*/
+
+
+// Version : %version: 14 %
+
+
+#ifndef __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
+#define __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
+
+#include "mpxhelixplaybackplugindefs.h"
+
+//
+//  CLASS DECLARATION
+//
+NONSHARABLE_CLASS( CMPXVideoPlaybackViewFileDetails ) : public CBase
+{
+    public:
+        //
+        //  Constructors and destructor
+        //
+        static CMPXVideoPlaybackViewFileDetails* NewL();
+
+        //
+        //  Destructor.
+        //
+        virtual ~CMPXVideoPlaybackViewFileDetails();
+
+        //
+        //  Clear all file details
+        //
+        void ClearFileDetails();
+
+        /**
+        * Generate file name, remove all file path
+        *
+        * @return generated file name, ownership is transferred
+        */
+        IMPORT_C HBufC* GenerateFileNameL();
+
+        /**
+         * Parse file title
+         * if title exists, then use it as title content directly.
+         * if title is null, then for streaming/live streaming clip,
+         * parse its file name as title content.
+         *
+         * @return  generated file title, ownership is transferred
+         */
+        IMPORT_C HBufC* GenerateFileTitleL();
+
+    private:
+        //
+        //  By default Symbian 2nd phase constructor is private.
+        //
+        void ConstructL();
+
+    public:
+        //
+        // Data
+        //
+        HBufC*   iClipName;
+        HBufC*   iTitle;
+        HBufC*   iArtist;
+        HBufC*   iMimeType;
+
+        TMPXVideoMode  iPlaybackMode;
+        TBool          iSeekable;
+        TBool          iPausableStream;
+        TBool          iAudioEnabled;
+        TBool          iVideoEnabled;
+        TBool          iPartialPlayback;
+        TBool          iTvOutConnected;
+        TBool          iDrmProtected;
+
+        TInt           iVideoHeight;
+        TInt           iVideoWidth;
+        TInt           iBitRate;
+        TUint32        iFourCCCode;
+
+        TInt           iDuration;
+};
+
+#endif      // __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
+
+
+// EOF
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/inc/mpxvideoregion.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,54 @@
+/*
+* 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:  Externalizable container for DSA region
+*
+*/
+
+// Version : %version: 4 %
+
+
+ 
+
+#ifndef CMPXVIDEOREGION_H
+#define CMPXVIDEOREGION_H
+
+
+#include <e32base.h>
+#include <s32strm.h>
+
+class CMPXVideoRegion: public CBase 
+{  
+public:    
+    static CMPXVideoRegion* NewL();
+    static CMPXVideoRegion* NewLC();
+    ~CMPXVideoRegion();
+
+    void Print();
+    void SetRegion( RRegion& aRegion );
+    TRegion& GetRegion();
+   
+    void ExternalizeL( RWriteStream& aStream ) const;
+    void InternalizeL( RReadStream& aStream );
+    
+private:
+    CMPXVideoRegion(); 
+    void ConstructL();
+    
+private:
+    RRegion* iRegion;
+};
+
+#include "mpxvideoregion.inl"
+
+#endif // CMPXVIDEOREGION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/inc/mpxvideoregion.inl	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,139 @@
+/*
+* 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:  Inline implementation of MPXVideoRegion
+*
+*/
+
+// Version : %version: 5 %
+
+
+#include <e32std.h>
+#include <s32strm.h>
+#include "mpxvideo_debug.h"
+
+inline
+CMPXVideoRegion*
+CMPXVideoRegion::NewL()
+{
+    CMPXVideoRegion* self = CMPXVideoRegion::NewLC();
+    CleanupStack::Pop( self );
+    return self;
+}
+
+inline
+CMPXVideoRegion*
+CMPXVideoRegion::NewLC()
+{
+    CMPXVideoRegion* self = new (ELeave) CMPXVideoRegion();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+}
+
+inline
+void
+CMPXVideoRegion::ConstructL()
+{
+    iRegion = new RRegion( 10 );
+}
+
+inline
+CMPXVideoRegion::CMPXVideoRegion()
+{
+}
+
+inline
+CMPXVideoRegion::~CMPXVideoRegion()
+{
+    iRegion->Destroy();
+}
+
+inline
+void
+CMPXVideoRegion::Print()
+{
+    if ( iRegion->CheckError() )
+    {
+        MPX_DEBUG(_L("CMPXVideoRegion::Print() Error in DSA Region"));
+        return;
+    }
+
+    MPX_DEBUG(_L("CMPXVideoRegion::Print() Rect Count = %d"),
+        iRegion->Count() );
+
+    const TRect* rectList = iRegion->RectangleList();
+
+    for ( TInt i = 0 ; i < iRegion->Count() ; ++i )
+    {
+        MPX_DEBUG(_L("CMPXVideoRegion::Print() Rect %d"), i);
+
+        MPX_DEBUG(_L( "CMPXVideoRegion::Print() (%d, %d), (%d, %d)"),
+            rectList[i].iTl.iX, rectList[i].iTl.iY,
+            rectList[i].iBr.iX, rectList[i].iBr.iY );
+    }
+}
+
+inline
+void
+CMPXVideoRegion::SetRegion( RRegion& aRegion )
+{
+    iRegion->Copy( aRegion );
+}
+
+inline
+TRegion&
+CMPXVideoRegion::GetRegion()
+{
+    return *iRegion;
+}
+
+inline
+void
+CMPXVideoRegion::ExternalizeL( RWriteStream& aStream ) const
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoRegion::ExternalizeL()"));
+
+    aStream.WriteInt32L( iRegion->Count() );
+
+    const TRect* rectList = iRegion->RectangleList();
+
+    for ( TInt i = 0 ; i < iRegion->Count() ; ++i )
+    {
+        aStream.WriteInt32L( rectList[i].iTl.iX );
+        aStream.WriteInt32L( rectList[i].iTl.iY );
+        aStream.WriteInt32L( rectList[i].iBr.iX );
+        aStream.WriteInt32L( rectList[i].iBr.iY );
+    }
+}
+
+//inline
+void
+CMPXVideoRegion::InternalizeL( RReadStream& aStream )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoRegion::InternalizeL()"));
+
+    TInt32 count = aStream.ReadInt32L();
+
+    for ( TInt i = 0 ; i < count; ++i )
+    {
+        TInt32 a = aStream.ReadInt32L();
+        TInt32 b = aStream.ReadInt32L();
+        TInt32 c = aStream.ReadInt32L();
+        TInt32 d = aStream.ReadInt32L();
+
+        TRect* rect = new (ELeave) TRect( a, b, c, d );
+        iRegion->AddRect( *rect );
+        delete rect;
+    }
+}
Binary file videoplayback/videohelix/conf/mpxvideopbplugins.confml has changed
Binary file videoplayback/videohelix/conf/mpxvideopbplugins_101f880a.crml has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/data/10282550.rss	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,77 @@
+/*
+* Copyright (c) 1028 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:   Ecom resource file for MPX Video Helix Playback Plug-in
+ *
+*/
+
+// Version : %version: e003sa33#11 %
+
+
+
+/*
+ *  The opaque_data syntax is made up of three parts:
+ *  a list of Uids for resolving the view plugin, feature flags, priority.
+ *
+ *  <p>uid1;uid2;uid3</p>
+ *    uid*: Supported plugin types.
+ *    E.g. if podcast plugin may support music plugin as well,
+ *         KMPXColPluginMusic
+ *
+ *  <t>uid</t>
+ *    uid: plugin type uid.
+ *    E.g. for music plugin will be: 0x101FFCDA
+ *
+ *  <f>flags</f> [optional]
+ *    flags: sum of the required feature flags, not used now
+ *
+ *  <i>priority</i> [optional]
+ *    priority: a value of type TMPXCollectionPluginPriorities. This value
+ *              determines the returning order when several plugins can
+ *              support the same set of Uids.
+ *    Default value of this field is EMPXCollectionPluginPriorityNormal.
+ */
+
+#include <registryinfo.rh>
+#include <mpxplaybackplugin.hrh>
+
+RESOURCE REGISTRY_INFO theInfo
+{
+    dll_uid = 0x10282550;
+
+    interfaces =
+    {
+        INTERFACE_INFO
+        {
+            interface_uid = KMPXPlaybackPluginInterfaceUid;
+            implementations =
+            {
+                IMPLEMENTATION_INFO
+                {
+                    implementation_uid = 0x10282551;
+                    version_no = 1;
+                    display_name = "VideoHelix";
+                    default_data = "";
+                    opaque_data = 
+                        "<s><e>"
+                        "<t>"EPbLocal"</t>"
+                        "<i>"EMPXPlaybackPluginPriorityHighest"</i>"
+                        "<z>"MPXPlaybackPluginVersion2"</z>";
+                        
+                }
+            };
+        }
+    };
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,37 @@
+/*
+* 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:  Build information file for project mpxvideohelixplayback.
+ *
+*/
+
+// Version : %version: 7 %
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/mpxvideohelixplugin.iby   CORE_APP_LAYER_IBY_EXPORT_PATH(mpxvideohelixplugin.iby)
+
+//
+//  Generic configuration interface for component cenrep settings  
+//  fusionmpx_101F880A implementation specifics for cenrep data
+//
+../conf/mpxvideopbplugins.confml            APP_LAYER_CONFML(mpxvideopbplugins.confml)
+../conf/mpxvideopbplugins_101f880a.crml     APP_LAYER_CRML(mpxvideopbplugins_101f880a.crml)
+
+PRJ_MMPFILES
+mpxvideohelixplayback.mmp
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/group/mpxvideohelixplayback.mmp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,97 @@
+/*
+* 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:  Helix Video Playback Plug-in specification
+ *
+*/
+
+// Version : %version: 22 %
+
+
+
+
+#include <bldvariant.hrh>
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+TARGET          mpxvideohelixplayback.dll
+TARGETTYPE      PLUGIN
+UID             0x10009D8D 0x10282550
+
+VENDORID        VID_DEFAULT
+CAPABILITY      CAP_ECOM_PLUGIN
+
+SOURCEPATH      ../src
+SOURCE          mpxvideohelixplayback.cpp
+SOURCE          mpxvideohelixplaybackproxy.cpp
+SOURCE          mpxvideoplaybackcontroller.cpp
+SOURCE          mpxvideoplaybackstate.cpp
+SOURCE          mpxvideoplaybackmode.cpp
+SOURCE          mpxvideofiledetails.cpp
+SOURCE          mpxvideoseeker.cpp
+SOURCE          mpxvideodlmgrif.cpp
+SOURCE          mpxvideoaccessoryobserver.cpp
+SOURCE          mpxvideoplayerutility.cpp
+SOURCE          mpxvideodrmhelper.cpp
+SOURCE          mpxvideoposterframesetter.cpp
+SOURCE          mpxcalldetector.cpp
+SOURCE          mpxvideoconnectionutility.cpp
+
+START RESOURCE  ../data/10282550.rss
+TARGET          mpxvideohelixplayback.rsc
+END
+
+USERINCLUDE     ../inc
+USERINCLUDE     ../../inc
+USERINCLUDE     ../../../inc
+
+APP_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   /epoc32/include/ecom
+
+LIBRARY  apgrfx.lib
+LIBRARY  apmime.lib
+LIBRARY  ecom.lib
+LIBRARY  efsrv.lib
+LIBRARY  euser.lib
+LIBRARY  mmfcontrollerframework.lib
+LIBRARY  mmfstandardcustomcommands.lib
+LIBRARY  mpxcommon.lib
+LIBRARY  estor.lib
+LIBRARY  flogger.lib
+LIBRARY  playbackhelper.lib
+LIBRARY  downloadmgr.lib
+LIBRARY  platformenv.lib
+LIBRARY  etel.lib
+LIBRARY  etelmm.lib
+LIBRARY  hal.lib
+LIBRARY  drmutility.lib
+LIBRARY  caf.lib
+LIBRARY  mmcommon.lib 
+LIBRARY  hwrmlightclient.lib   // Lights control
+LIBRARY  centralrepository.lib // For display backlight timeout value
+LIBRARY  fbscli.lib
+LIBRARY  thumbnailmanager.lib
+
+LIBRARY  esock.lib    // rconnection
+LIBRARY  connmon.lib  // Connection monitor
+LIBRARY  commdb.lib   // for commdb and preferences
+
+
+#ifdef __ACCESSORY_FW
+LIBRARY accclient.lib
+LIBRARY accpolicy.lib
+#endif
+
+MACRO    USE_S60_DOWNLOAD_MANAGER
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/inc/mpxcalldetector.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,88 @@
+/*
+* 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 <e32base.h>
+#include <e32property.h>
+
+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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/inc/mpxvideoaccessoryobserver.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,138 @@
+/*
+* 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:   This class observes the accessory framework.
+ *
+*/
+
+// Version : %version: 7 %
+
+
+
+#ifndef MPXVIDEOACCESSORYOBSERVER_H
+#define MPXVIDEOACCESSORYOBSERVER_H
+
+//
+//  INCLUDES
+//
+#include <e32std.h>
+#include <e32base.h>
+#include <AccessoryServer.h>
+#include <AccessoryConnection.h>
+
+#include "mpxvideo_debug.h"
+
+//
+//  FORWARD DECLARATIONS
+//
+class CMPXVideoPlaybackController;
+
+//
+//  CLASS DECLARATION
+//
+
+NONSHARABLE_CLASS( CMPXVideoAccessoryObserver ) : public CActive
+{
+    public:
+        /*
+         *  Two phase constructor
+         *  @param aObs  Reference to an event observer
+         */
+        static CMPXVideoAccessoryObserver* NewL( CMPXVideoPlaybackController* aController );
+
+        /*
+         *  Destructor
+         */
+        virtual ~CMPXVideoAccessoryObserver();
+
+    public:
+
+        /*
+         *  Returns the status of the TV-Out cable connection
+         *  @return the cable connection status
+         *     ETrue    cable is connected.
+         *     EFalse   cable is not connected.
+         */
+        TBool IsTvOutConnected();
+
+    private:
+
+        /*
+         *  From CActive
+         *
+         *  DoCancel() must not wait for event completion;
+         *  this is handled by Cancel().
+         */
+        void DoCancel();
+
+        /*
+         *  From CActive
+         *
+         *  Handles an active object's request completion event.
+         */
+        void RunL();
+
+        /*
+         *  From CActive
+         *
+         *  If RunL leaves, then the active scheduler calls RunError()
+         *  to handle the leave.
+         */
+        TInt RunError( TInt aError );
+
+    private:
+
+        /*
+         *  C++ default constructor.
+         *  @param aObs  Reference to an event observer
+         */
+        CMPXVideoAccessoryObserver( CMPXVideoPlaybackController* aController );
+
+        /*
+         *  By default Symbian 2nd phase constructor is private.
+         *  Create and connect to the driver and Central Repository.
+         */
+        void ConstructL();
+
+        /*
+         *  Checks if the TV-Out status has changed by parsing
+         *  the Generic ID Array searching for changes with accessories
+         *  that support TV-Out
+         *  @return   Status Changed
+         *      ETrue   TV-Out Status has changed
+         *      EFalse  TV-Out Status has not changed
+         */
+        TBool UpdateTvOutStatusL();
+
+        /*
+         *  Starts listening for Accessory events.
+         *  @param None
+         *  @return None
+         */
+        void StartMonitoringL();
+
+    private:
+
+        CMPXVideoPlaybackController*        iController;
+        TBool                               iTvOutConnected;
+
+#ifdef __ACCESSORY_FW
+        RAccessoryServer                    iServer;
+        RAccessoryConnection                iConnection;
+        TAccPolGenericIDArray               iGenericIdArray;
+#endif //__ACCESSORY_FW
+};
+
+#endif  //  MPXVIDEOACCESSORYOBSERVER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/inc/mpxvideoconnectionutility.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,52 @@
+/*
+* 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: Access Point handling logic for streaming use cases.
+*
+*/
+
+
+#ifndef _MPXVIDEOCONNECTIONUTILITY_H
+#define _MPXVIDEOCONNECTIONUTILITY_H
+
+//  INCLUDES
+#include <e32base.h>
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+NONSHARABLE_CLASS( MpxVideoConnectionUtility )
+{  
+    public: // New functions
+        
+        /**
+         * Check if accesspoint given is packet data (gprs, egprs) type
+         * 
+         * @return Access point id to be used for streaming or KUseDefaultIap if 
+         * access point from MediaSettings should be used. Returns given access point id
+         * if no change is needed.
+         */
+        static TInt CheckAccessPointL(TInt aApId);
+        
+        /**
+        * Try to start default connection.
+        * Does not report error if connection start fails
+        * @return void
+        */
+        static void StartDefaultConnectionL();
+         
+};
+
+#endif      _MPXVIDEOCONNECTIONUTILITY_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/inc/mpxvideodlmgrif.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,265 @@
+/*
+* 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:  Header of CMPXVideoDownloadMgrInterface class.
+*
+*/
+
+
+// Version : %version: 12 %
+
+#ifdef USE_S60_DOWNLOAD_MANAGER 
+
+#ifndef __MPXVIDEODLMGRIF_H__
+#define __MPXVIDEODLMGRIF_H__
+
+#include <downloadmgrclientapiext.h>
+#include <mpxplaybackcommanddefs.h>
+
+//
+//  Forward Declaration
+//
+class CMPXVideoPlaybackController;
+
+/*
+ *  CMPXVideoDlMgrIf
+ *
+ *  This class is the interface between the Media Player engine and
+ *  the Download Manager
+ *
+ *  @lib mpengine.lib
+ *  @since S60 3.2
+ */
+class CMPXVideoDlMgrIf : public CBase,
+                         public MHttpDownloadMgrObserver
+{
+    public:
+
+        /*
+         *  NewL
+         *
+         *  Symbian 2 phase constructor
+         *
+         *  @since S60 3.2
+         *  @param aEngine   reference to the Video Playback Controller
+         *  @return reference to the class
+         */
+        static CMPXVideoDlMgrIf* NewL( CMPXVideoPlaybackController* aController );
+
+        /*
+         *  ~CMPDownloadMgrInterface
+         *
+         *  destructor
+         *
+         *  @since S60 3.2
+         */
+        virtual ~CMPXVideoDlMgrIf();
+
+        /*
+         *  ConnectToDownloadL
+         *
+         *  Connect to the Download Manager and attach to the download
+         *
+         *  @since S60 3.2
+         *  @param aCmd        command with download information
+         *  @return            error code
+         */
+        void ConnectToDownloadL( CMPXCommand& aCmd );
+
+        /*
+         *  ~CMPDownloadMgrInterface
+         *
+         *  MHttpDownloadMgrObserver Callback method
+         *
+         *  @since S60 3.2
+         *  @param aDownload   reference to download
+         *  @param aEvent      current state and event
+         */
+        void HandleDMgrEventL( RHttpDownload& aDownload,
+                               THttpDownloadEvent aEvent );
+
+        /*
+         *  DoHandleOpenComplete
+         *
+         *  Performs the commands associated with the player being opened.
+         *  It sets the current download id on the playback engine.
+         *  Updates the current download size also.
+         *
+         *  @since S60 3.2
+         */
+        void DoHandleOpenComplete();
+
+        /*
+         *  GetPdlStatusL
+         *
+         *  Retrieves the status of the download.
+         *
+         *  @param   aCmd   Commands where the status will be written
+         *
+         *  @since 9.2 Timebox
+         */
+        void GetPdlStatusL( CMPXCommand& aCmd );
+
+        /*
+         *  HandleClose
+         *
+         *  Handles closing the Download Manager Interface
+         *
+         *  @since S60 3.2
+         */
+        void HandleClose();
+
+        /*
+         *  GetDownloadRatio
+         *
+         *  Retrieves the download ratio
+         *
+         *  @since S60 3.2
+         */
+        TReal GetDownloadRatio();
+
+        /*
+         *  IsDownloadPaused
+         *
+         *  Determines if the download is paused
+         *
+         *  @since S60 3.2
+         */
+        TBool IsDownloadPaused();
+
+        /*
+         *  UpdateDownloadSizeL
+         *
+         *  For DRM protected clips, the download size will be updated using the file handle
+         *
+         *  @since S60 9.2
+         */
+        void UpdateDownloadSizeL();
+
+    private:
+        /*
+         *  CMPDownloadMgrInterface
+         *  Constructor
+         *  @since S60 3.2
+         *
+         */
+        CMPXVideoDlMgrIf();
+
+        /*
+         *  ConstructL
+         *  Symbian 2nd phase Constructor
+         *  @since S60 3.2
+         *
+         */
+        void ConstructL( CMPXVideoPlaybackController* aController );
+
+        /*
+         *  DoUpdateDownloadProgress
+         *
+         *  Updates the prog. download listener and playback engine with
+         *  the current download size
+         *
+         *  @since S60 3.2
+         */
+        void DoUpdateDownloadProgress();
+
+        /*
+         *  HandleCustomCommand
+         *
+         *  Sends custom commands to the playback engine
+         *
+         *  @since S60 3.2
+         *  @param   aCommand   custom command to send
+         *  @param   aCmdValue  parameter for custom command
+         *  @return  error code
+         */
+        TInt HandleCustomCommand( TUint32 aCommand, TUint32 aCmdValue );
+
+        /*
+         *  UpdateListenerWithState
+         *
+         *  Gets the current state of the download and updates the
+         *  listener and member variables
+         *
+         *  @since S60 3.2
+         *
+         */
+        void UpdateListenerWithState();
+
+        /*
+         *  CheckForMoveError
+         *
+         *  Gets the error status from the Download Manager after the
+         *  move is complete
+         *
+         *  @since S60 3.2
+         *
+         */
+        void CheckForMoveError();
+
+        /*
+         *  HandleDownloadComplete
+         *
+         *  Performs the logic for a completed download
+         *
+         *  @since S60 3.2
+         *
+         */
+         void HandleDownloadComplete();
+
+        /*
+         *  UpdateDownloadProgress
+         *
+         *  Called by CIdle iUpdateDownload to update the download size
+         *  @since 3.2
+         *  @param aPtr Pointer to callback class
+         *  @return KErrNone
+         */
+        static TInt UpdateDownloadProgress( TAny* aPtr );
+
+        void CalculateDestinationFileNameL();
+
+        void ConvertDMgrStatetoMpxState( TInt32 dmgrState );
+
+        //
+        //  Private Members
+        //  Not Owned Data
+        //
+        RHttpDownloadMgrApiExt        iDlMgr;
+        RHttpDownload*                iCurrentDl;
+        CMPXVideoPlaybackController*  iController;
+
+        HBufC*                        iClipName;
+        TFileName                     iDestinationFileName;
+        TInt                          iDlId;
+        TInt32                        iDownloadProgress;
+        TMPXPlaybackPdDownloadState   iDownloadState;
+        TInt32                        iDlTotalSize;
+        TBool                         iDlMgrConnected;
+        TBool                         iMoveNeeded;
+        TBool                         iMovePdlFile;
+        TBool                         iPlayerOpened;
+        TBool                         iCodDownload;
+
+        //
+        //  Private Members
+        //  Owned Data
+        //
+        CIdle*                        iUpdateDownload;
+};
+
+#endif __MPXVIDEODLMGRIF_H__
+
+#endif // USE_S60_DOWNLOAD_MANAGER 
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/inc/mpxvideodrmhelper.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,75 @@
+/*
+* 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:   This class handles the DRM functions for the playback plugin
+*
+*/
+
+
+// Version : %version: 6 %
+
+
+#ifndef __MPXVIDEODRMHELPER_H__
+#define __MPXVIDEODRMHELPER_H__
+
+
+// INCLUDES
+#include <e32std.h>
+#include <e32base.h>
+#include <drmutility.h>
+#include <drmutilitytypes.h>
+
+// CLASS DECLARATION
+
+/*
+ *  CMpxVideoDrmHelper
+ *
+ */
+class CMpxVideoDrmHelper : public CBase
+{
+    public:
+        // Constructors and destructor
+
+        /*
+         *  Destructor.
+         */
+        ~CMpxVideoDrmHelper();
+
+        /*
+         *  Two-phased constructor.
+         */
+        static CMpxVideoDrmHelper* NewL();
+
+        TBool IsProtectedL( RFile& aFile );
+
+        TInt GetDrmRightsStatus( RFile& aFile );
+
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+        TBool IsProtected64L( RFile64& aFile );
+        TInt GetDrmRightsStatus64( RFile64& aFile );
+
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+    private:
+
+        CMpxVideoDrmHelper();
+
+        void ConstructL();
+
+    private:
+
+        DRM::CDrmUtility* iDrmUtility;
+};
+
+#endif // __MPXVIDEODRMHELPER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/inc/mpxvideofiledetails.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,89 @@
+/*
+* 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:  Container for MPX Video File Details
+*
+*/
+
+// Version : %version: 9 %
+
+
+
+
+#ifndef __MPXVIDEOFILEDETAILS__
+#define __MPXVIDEOFILEDETAILS__
+
+// 
+//  CLASS DECLARATION
+//
+NONSHARABLE_CLASS( CMPXVideoFileDetails ) : public CBase
+{
+    public:  
+        //
+        //  Constructors and destructor
+        //
+        static CMPXVideoFileDetails* NewL();
+        
+        //
+        //  Destructor.
+        //
+        virtual ~CMPXVideoFileDetails();
+        
+        //
+        //  Clear all file details
+        //
+        void ClearFileDetails();
+
+    private:
+        //
+        //  By default Symbian 2nd phase constructor is private.
+        //
+        void ConstructL();
+
+    public:    
+        //
+        // Data
+        //
+        HBufC*   iClipName;
+        HBufC*   iTitle;
+        HBufC*   iArtist;
+        HBufC*   iMimeType;
+        HBufC*   iDescription;
+        HBufC*   iLocation;
+        HBufC*   iCopyright;
+        HBufC*   iLanguage;
+        HBufC*   iKeywords;                
+
+
+        TInt     iResolutionWidth;
+        TInt     iResolutionHeight;
+        TInt     iMaxVolume;
+        TInt     iBitRate;
+        TInt     iCreationTime;
+        TInt     iModificationTime;
+        
+        TBool    iSeekable;
+        TBool    iPausableStream;
+        TBool    iLiveStream;
+        TBool    iAudioEnabled;
+        TBool    iVideoEnabled;
+        TBool    iPartialPlayback;
+        TBool    iDrmProtected;
+        TUint32  iFourCCCode;
+
+        TTimeIntervalMicroSeconds iDuration;
+};
+
+#endif      // __MPXVIDEOFILEDETAILS__  
+            
+// EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/inc/mpxvideohelixplayback.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,306 @@
+/*
+* 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:   This class plays files with the Helix Engine
+ *
+*/
+
+// Version : %version: 10 %
+
+
+
+#ifndef _CMPXVIDEOHELIXPLAYBACK_H_
+#define _CMPXVIDEOHELIXPLAYBACK_H_
+
+//
+//  INCLUDES
+//
+#include <mpxplaybackplugin.h>
+#include <mmf/common/mmfcontroller.h>
+#include <mpxplaybackpluginversion2.h>
+#include <mpxplaybackpluginobserver.h>
+
+#include "mpxvideo_debug.h"
+#include "mpxhelixplaybackplugindefs.h"
+#include "mpxvideoplaybackcontroller.h"
+
+//
+//  FORWARD DECLARATIONS
+//
+class CMPXVideoPlaybackController;
+
+//
+//  CLASS DECLARATION
+//
+
+/*
+ *  CMpxVideoHelixPlayback class
+ *
+ *  Plug-in basically handles Video Playback with the Helix Engine
+ *  @lib mpxvideohelixplayback.lib
+ *
+ */
+
+NONSHARABLE_CLASS( CMPXVideoHelixPlayback ) : public CMPXPlaybackPluginVersion2
+{
+    public:
+        //
+        //  Constructors and destructor
+        //
+
+        /*
+         *  Two-phased constructor.
+         *  @param aInitParams, initialization parameter
+         *  @return a pointer to the created instance
+         */
+        static CMPXVideoHelixPlayback* NewL( TAny* aInitParams );
+
+        /*
+         *  Destructor
+         *  Destroy the object and release all memory objects
+         */
+        ~CMPXVideoHelixPlayback();
+
+    private:
+        //
+        //  CMPXPlaybackPlugin Implementation
+        //
+
+        /*
+         *  Set observer
+         *
+         *  @param aObs observer
+         */
+        inline void SetObserver( MMPXPlaybackPluginObserver& aObs );
+
+        /*
+         *  Initializes a clip for playback
+         *  @param aSong the song path
+         */
+        void InitialiseL( const TDesC& aSong );
+
+        /*
+         *  Initializes a song for playback
+         *  @param aFile file handle of a song
+         */
+        void InitialiseL( RFile& aFile );
+
+        /*
+         *  Executes a command on the selected song
+         * @param aCmd a command
+         * @param aData, data
+         */
+        void CommandL( CMPXCommand& aCmd );
+
+        // Supposedly being deprecated
+        // We're forced to implement this as its declared as a
+        // pure virtual function by the MPX framework
+        void CommandL(TMPXPlaybackCommand aCmd, TInt aData=0);
+
+        /*
+         *  Sets a property of the plugin
+         *  @param aProperty a property
+         *  @param aValue the value of the setting
+         */
+        void SetL( TMPXPlaybackProperty aProperty , TInt aValue );
+
+        /*
+         *  Gets a property of the plugin (async)
+         *  @param aProperty a property
+         */
+        void PropertyL( TMPXPlaybackProperty aProperty ) const;
+
+        /*
+         *  Gets a list of sub players
+         *  @return a list of names of sub players
+         */
+        inline void SubPlayerNamesL();
+
+        /*
+         *  Select a sub player
+         *  @param aIndex index to the sub player
+         */
+        void SelectSubPlayerL( TInt aIndex );
+
+        /*
+         *  Returns current sub player name
+         *  @return friendly name of the current the sub player
+         */
+        const TDesC& SubPlayerName();
+
+        /*
+         *  Current sub player index
+         *  @return index to the sub player
+         */
+        inline TInt SubPlayerIndex() const;
+
+        /*
+         *  Media properties of the current file (async)
+         *  @param aAttrs attributes requested
+         */
+        void MediaL( const TArray<TMPXAttribute>& aAttrs );
+
+        /*
+         * Cancel async request
+         */
+        void CancelRequest();
+
+        /**
+        * Initializes a file for playback.
+        *
+        * @since S60 9.2
+        * @param aUri URI of the item
+        * @param aType the mime type of the item
+        * @param aAccessPoint the access point
+        * @param aPosition the starting position
+        */
+        void InitStreamingL(const TDesC& aUri, const TDesC8& aType, TInt aAccessPoint, TInt aPosition); 
+
+        /**
+        * Initializes a file handle for playback.
+        *
+        * @since S60 9.2
+        * @param aFile file handle of a file
+        * @param aAccessPoint the access point
+        * @param aPosition the starting position
+        */
+        void InitStreamingL(RFile& aFile, TInt aAccessPoint, TInt aPosition);  
+
+        /**
+        * Initializes filename and handle
+        *
+        * @since S60 9.2
+        * @param aUri URI of the item
+        */
+        RFile& OpenFileHandleL( const TDesC& aUri );
+
+        /**
+        * Open file handle
+        *
+        * @since S60 9.2
+        * @param aUri URI of the item
+        * @param aFile a 32-bit file handle
+        */
+        void OpenFileHandleL( const TDesC& aUri, RFile& aFile );
+
+        /**
+        *  Checks if the Uri is a streaming link
+        *
+        * @since S60 9.2
+        * @param aUri URL or file name
+        */
+        void CheckForStreamingUrlL( const TDesC& aUri );
+
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+        /*
+         *  Initializes a song for playback
+         *  @param aFile RFile64 of a song
+         *  @param aPosition the starting position
+         */
+        void Initialise64L( RFile64& aFile, TInt aPosition ); 
+
+        /**
+        * Initializes a file handle for playback.
+        *
+        * @since S60 9.2
+        * @param aFile RFile64 of a file
+        * @param aAccessPoint the access point
+        * @param aPosition the starting position
+        */
+        void InitStreaming64L( RFile64& aFile, TInt aAccessPoint, TInt aPosition ); 
+
+        /**
+        * Initializes filename and handle
+        *
+        * @since S60 9.2
+        * @param aUri URI of the item
+        */
+        RFile64& OpenFileHandle64L( const TDesC& aUri );
+
+        /**
+        * Open file handle
+        *
+        * @since S60 9.2
+        * @param aUri URI of the item
+        * @param aFile a 64-bit file handle
+        */
+        void OpenFileHandle64L( const TDesC& aUri, RFile64& aFile );
+
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+
+        /*
+        *  Initializes a clip for playback
+        *  @since S60 9.2
+        *  
+        *  @param aSong the song path, 
+        *  @param aPosition the starting position 
+        */
+        void InitialiseWithPositionL( const TDesC& aSong, TInt aPosition = 0 );     
+                
+        /**
+        * Initializes a song for playback.
+        *
+        * @since S60 9.2
+        * @param aFile file handle of a song
+        * @param aPosition the starting position
+        */
+        void InitialiseWithPositionL(RFile& aSong, TInt aPosition = 0 );        
+
+
+    private:
+        /*
+         *  C++ default constructor
+         */
+        CMPXVideoHelixPlayback();
+
+        /*
+         *  the second phase constructor ConstructL to safely construct things
+         *  that can leave
+         */
+        void ConstructL();
+
+    private:
+        //
+        //  Data
+        //
+    	CMPXVideoPlaybackController*  iVideoPlaybackCtlr;
+        RFs                           iFs;
+};
+
+// INLINE METHODS
+
+inline
+void CMPXVideoHelixPlayback::SetObserver( MMPXPlaybackPluginObserver& aObs )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoHelixPlayback::SetObserver()"));
+    iObs = &aObs;
+    iVideoPlaybackCtlr->SetMPXObserver(aObs);
+}
+
+inline
+TInt CMPXVideoHelixPlayback::SubPlayerIndex() const
+{
+   MPX_ENTER_EXIT(_L("CMPXVideoHelixPlayback::SubPlayerIndex()"));
+   return KErrNotFound;
+}
+
+inline
+const TDesC& CMPXVideoHelixPlayback::SubPlayerName()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoHelixPlayback::SubPlayerName()"));
+    return KNullDesC;
+}
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/inc/mpxvideoplaybackcontroller.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,323 @@
+/*
+* 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:   This class plays files with the Helix Engine
+*
+*/
+
+
+// Version : %version: 30 %
+
+
+#ifndef _CMPXVIDEOPLAYBACKCONTROLLER_H_
+#define _CMPXVIDEOPLAYBACKCONTROLLER_H_
+
+//
+//  INCLUDES
+//
+#include <mpxplaybackplugin.h>
+#include <mpxcenrepobserver.h>
+#include <mediarecognizer.h>
+#include <mpxplaybackpluginobserver.h>
+#include <mpxcenrepwatcher.h>
+#include <MMFScalingCustomCommandConstants.h>
+
+#include "mpxvideoprivatecrkeys.h"
+#include "mpxvideoplaybackstate.h"
+#include "mpxvideoplaybackmode.h"
+#include "mpxvideofiledetails.h"
+#include "mpxhelixplaybackplugindefs.h"
+#include "mpxvideoaccessoryobserver.h"
+#include "mpxvideoplayerutility.h"
+#include "mpxvideo_debug.h"
+
+#include "mpxcalldetector.h"
+// DATA TYPES
+
+// FORWARD DECLARATIONS
+
+class MMPXPlaybackPluginObserver;
+class CMPXCenRepWatcher;
+class CMPXPlaybackPlugin;
+class CMPXVideoPlaybackState;
+class CMediaRecognizer;
+class CMPXVideoSeeker;
+class CMpxVideoDrmHelper;
+class CHWRMLight;
+
+//
+//  CLASS DECLARATION
+//
+
+/*
+ *  CMPXVideoPlaybackController class
+ *
+ *  Plug-in basically handles Video Playback with the Helix Engine
+ *  @lib mpxvideohelixplayback.lib
+ *
+ */
+NONSHARABLE_CLASS( CMPXVideoPlaybackController )
+    : public CBase
+    , public MMPXCenRepObserver
+    , public MMPXCallDetectorObserver
+{
+    public:
+        //
+        //  Constructors and destructor
+        //
+        static CMPXVideoPlaybackController* NewL( MMPXPlaybackPluginObserver& aObs );
+        /*
+         *  Destructor
+         *  Destroy the object and release all memory objects
+         */
+        ~CMPXVideoPlaybackController();
+
+        // Maybe we can replace this with a SendMedia CustomCommand
+        // at a later stage
+        void SendMediaL( const TArray<TMPXAttribute>& aAttrs );
+        void HandleCommandL( CMPXCommand& aCmd );
+        void HandleCommandL( TMPXPlaybackCommand aCmd, TInt aData );
+        void DoHandleCommandL( TInt aCmd );
+        void HandleMMFEvent( const TMMFEvent& aEvent );
+        void SetPropertyL( TMPXPlaybackProperty aProperty , TInt aValue );
+        void GetPropertyL( TMPXPlaybackProperty aProperty ) const;
+
+        //
+        //  MMPXCenRepObserver Implementation
+        //
+        void HandleSettingChange( const TUid& aRepositoryUid,
+                                  TUint32 aSettingId );
+
+        void OpenFileL( const TDesC& aMediaFile, RFile& aFile, TInt aPosition, TInt aAccessPointId = KUseDefaultIap );
+
+        void HandleGeneralPlaybackCommandL( CMPXCommand& aCmd );
+
+        void HandleCustomPlaybackCommandL( CMPXCommand& aCmd );
+
+        void HandlePdlCommandL( CMPXCommand& aCmd );
+
+        /* closes the playback controller */
+        void CloseController();
+
+        /* Creates state instances needed before initialization & sets default state */
+        void CreatePreInitStatesL();
+
+        /* Creates state instances needed after initialization */
+        void CreatePostInitStatesL();
+
+        inline void SetMPXObserver(MMPXPlaybackPluginObserver& aObs);
+
+        void ReadFileDetailsL();
+
+        void SetPlaybackModeL();
+
+        TBool IsKeyLocked();
+        TBool IsAlarm();
+        TBool IsPhoneCall();
+        TBool IsActivePhoneCall();
+        TBool IsVideoCall();
+        TBool IsVoiceCall();
+
+        TBool IsViewActivated();
+
+        void HandleTvOutEventL( TBool aConnected );
+
+        void HandleError(TInt error);
+        void SetVolumeSteps( TInt aVolumeSteps );
+        void HandleVolumeL( TBool aIncrease );
+
+        void SendHideControlsEventL();
+        
+        void HandleFrameReady(TInt aError);
+
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+        void OpenFile64L( const TDesC& aMediaFile, RFile64& aFile, TInt aPosition, TInt aAccessPointId = KUseDefaultIap );
+
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+
+    private:
+        void CallDetectedL();
+
+        void SetDisplayWindowL( CMPXCommand& aCmd );
+        void RestartDSA( CMPXCommand& aCmd );
+        inline void AbortDSA();
+
+        void InitVolumeWatchersL();
+
+        void ChangeState(TMPXVideoPlaybackState aChangeToState);
+
+        void SetVolumeMMFL();
+        void SetVolumeCenRepL( TInt aVolume );
+        void SetMuteCenRepL( TBool aMute );
+
+        TMPXVideoMode GetModeToSet();
+        void DetermineMediaTypeL();
+
+        void ResetMemberVariables();
+
+        void StartLightsControl();
+        void CancelLightsControl();
+
+        void EnableDisplayBacklight();
+        void DisableDisplayBacklight();
+
+        static TInt HandleBackLightTimeout( TAny* aPtr );
+        void DoHandleBackLightTimeout();
+        void StartBackLightTimer();
+        void CancelBackLightTimer();
+
+        void InitUserActivityTimerL();
+        void RestartUserActivityTimer();
+        void CancelUserActivityTimer();
+        static TInt HandleUserActivityTimeout( TAny* aPtr );
+        void DoHandleUserActivityTimeout();
+
+        TTimeIntervalMicroSeconds32 InitDisplayTimerL();
+        void RestartDisplayTimer();
+        void CancelDisplayTimer();
+        static TInt HandleDisplayTimeout( TAny* aPtr );
+        void DoHandleDisplayTimeout();
+
+        CHWRMLight* GetLightsL();
+        void ReleaseLights();
+
+        void SendTvOutEventL( TBool aConnected );
+
+    protected:
+
+        /*
+         *  C++ default constructor
+         */
+        CMPXVideoPlaybackController();
+
+        /*
+         *  the second phase constructor ConstructL to safely construct things
+         *  that can leave
+         */
+        void ConstructL( MMPXPlaybackPluginObserver& aObs );
+
+    protected:
+        //
+        //  Data
+        //
+        CMpxVideoPlayerUtility*                iPlayer;
+
+        CMPXVideoAccessoryObserver*            iAccessoryMonitor;
+
+        MMPXPlaybackPluginObserver*            iMPXPluginObs; // Not owned
+        CMPXCenRepWatcher*                     iVolumeWatcher;
+        CMPXCenRepWatcher*                     iMuteWatcher;
+
+        HBufC*                                 iClipName;
+        HBufC*                                 iRecognizedMimeType;  // mime type returned by the recognizer
+        RFile                                  iFileHandle;
+        CMPXVideoFileDetails*                  iFileDetails;
+        TBool                                  iAppInForeground;
+        CMediaRecognizer::TMediaType           iMediaType;
+        TInt                                   iAccessPointId;
+        TBool                                  iAllowAutoPlay;
+        TBool                                  iHelixLoadingStarted;
+        TInt                                   iPBPluginError;
+        TInt                                   iVolumeNormalizer;
+
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+        RFile64                                iFileHandle64;
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+
+        // State
+        CMPXVideoPlaybackState*                 iState;
+        CMPXVideoPlaybackState*                 iNotIntialisedState;
+        CMPXVideoPlaybackState*                 iInitialisingState;
+        CMPXVideoPlaybackState*                 iInitialisedState;
+        CMPXVideoPlaybackState*                 iPlayingState;
+        CMPXVideoPlaybackState*                 iBufferingState;
+        CMPXVideoPlaybackState*                 iPausedState;
+        CMPXVideoPlaybackState*                 iSeekingState;
+        CMPXVideoPlaybackState*                 iStoppedState;
+
+        // Mode
+        CMPXVideoPlaybackMode*                  iPlaybackMode;
+
+        // Video seeker
+        CMPXVideoSeeker*                        iVideoSeeker;
+
+        // Timer for calling User::ResetInactivityTime() periodicallly while playing.
+        // This keeps backligth on and screensaver off.
+        CPeriodic*                              iBackLightTimer;
+
+        // Timer to turn display lights off when playing to TV-out
+        CPeriodic*                              iDisplayTimer;
+        TTimeIntervalMicroSeconds32             iDisplayTimerTimeout;
+        // Timer monitoring user activity when TV-out is connected
+        CPeriodic*                              iUserActivityTimer;
+
+        // Call detector
+        CMPXCallDetector*                       iCallDetector; 
+
+        TBool                                   iSeekable;
+
+        CMpxVideoDrmHelper*                     iDrmHelper;
+        CHWRMLight*                             iLight;
+        TInt                                    iLightStatus;
+        TInt                                    iSavedPosition;
+        TBool                                   iViewActivated;
+
+    public:     // Friend classes
+
+        // states are friends of the controller
+        friend class CMPXVideoPlaybackState;
+        friend class CMPXNotInitialisedState;
+        friend class CMPXInitialisingState;
+        friend class CMPXInitialisedState;
+        friend class CMPXPlayingState;
+        friend class CMPXBufferingState;
+        friend class CMPXPausedState;
+        friend class CMPXSeekingState;
+        friend class CMPXStoppedState;
+
+        // modes are friends of the controller
+        friend class CMPXVideoPlaybackMode;
+        friend class CMPXLocalPlaybackMode;
+        friend class CMPXStreamingPlaybackMode;
+        friend class CMPXLiveStreamingPlaybackMode;
+        friend class CMPXProgressiveDLPlaybackMode;
+
+        friend class CMPXVideoSeeker;
+#ifdef USE_S60_DOWNLOAD_MANAGER 
+        friend class CMPXVideoDlMgrIf;
+#endif // USE_S60_DOWNLOAD_MANAGER 
+        friend class CMPXVideoAccessoryObserver;
+        friend class CMpxVideoPlayerUtility;
+        friend class CMPXVideoPosterFrameSetter;
+};
+
+// INLINE METHODS
+
+inline
+void CMPXVideoPlaybackController::SetMPXObserver(MMPXPlaybackPluginObserver& aObs)
+{
+    iMPXPluginObs = &aObs;
+}
+
+inline
+void CMPXVideoPlaybackController::AbortDSA()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::AbortDSA()"));
+
+    iPlayer->AbortDsa();
+}
+
+#endif //_CMPXVIDEOPLAYBACKCONTROLLER_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/inc/mpxvideoplaybackmode.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,255 @@
+/*
+* 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:   This class plays files with the Helix Engine
+*
+*/
+
+
+// Version : %version: 21 %
+
+
+#ifndef _CMPXVIDEOPLAYBACKMODE_H_
+#define _CMPXVIDEOPLAYBACKMODE_H_
+
+//
+//  INCLUDES
+//
+#include <e32def.h>
+#include <e32base.h>
+
+#include "mpxhelixplaybackplugindefs.h"
+#ifdef USE_S60_DOWNLOAD_MANAGER
+#include "mpxvideodlmgrif.h"
+#endif
+#include "mpxvideo_debug.h"
+
+//
+//  FORWARD DECLARATIONS
+//
+class CMPXVideoPlaybackController;
+class CMPXVideoDlMgrIf;
+class CMPXVideoPosterFrameSetter;
+
+
+//
+//  CLASS DECLARATION
+//
+
+/*
+ *  CMpxVideoPlaybackMode class
+ */
+NONSHARABLE_CLASS( CMPXVideoPlaybackMode ) : public CBase
+{
+    public:
+        //
+        //  Constructors and destructor
+        //
+
+        /*
+         *  Destructor
+         *  Destroy the object and release all memory objects
+         */
+        ~CMPXVideoPlaybackMode();
+
+        inline virtual TInt GetMode();
+        virtual void ConnectToDownloadL( CMPXCommand& aCmd );
+        virtual void HandleOpenComplete();
+        virtual void GetPdlStatusL( CMPXCommand& aCmd );
+        virtual void UpdateSeekPosition( TInt64& aPosition );
+        inline virtual TBool IsDownloadPaused();
+        virtual TInt HandlePause();
+        virtual void HandleBackground();
+        virtual TBool IsNetworkMode2GL();
+        virtual TBool CanPlayNow();
+        virtual void OpenFileL( const TDesC& aMediaFile );
+        virtual void OpenFileL( const RFile& aMediaFile );
+        virtual void HandleSetPosterFrame();
+        virtual void HandleFrameReady(TInt aError);
+        virtual TBool SendErrorToView( TInt aError );
+        virtual void HandlePauseToPlayTransitionL();
+
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+        virtual void OpenFile64L( const RFile64& aMediaFile );
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+    protected:
+        /*
+         *  C++ default constructor
+         */
+        CMPXVideoPlaybackMode();
+
+        /*
+         *  the second phase constructor ConstructL to safely construct things
+         *  that can leave
+         */
+        virtual void ConstructL( CMPXVideoPlaybackController* aVideoPlaybackCtlr );
+
+    protected:
+        //
+        //  Data
+        //
+        CMPXVideoPlaybackController*        iVideoPlaybackCtlr;   // not owned
+        CMPXVideoPosterFrameSetter*         iPosterFrameSetter;
+};
+
+/*******************************************************/
+/*         SUB CLASS DECLARATIONS                      */
+/*******************************************************/
+
+////////////////////////////////////////////////////////
+///     Declaration of CMPXLocalPlaybackMode
+////////////////////////////////////////////////////////
+class CMPXLocalPlaybackMode : public CMPXVideoPlaybackMode
+{
+    public:
+        static CMPXVideoPlaybackMode* NewL(CMPXVideoPlaybackController* aVideoPlaybackCtlr);
+        virtual ~CMPXLocalPlaybackMode();
+
+        // Methods where video plabkack behavior varies for local media
+        inline virtual TInt GetMode();
+        virtual void HandleSetPosterFrame();
+        virtual void HandleFrameReady(TInt aError);
+};
+
+
+////////////////////////////////////////////////////////
+///     Declaration of CMPXStreamingPlaybackMode
+////////////////////////////////////////////////////////
+class CMPXStreamingPlaybackMode : public CMPXVideoPlaybackMode
+{
+    public:
+        static CMPXVideoPlaybackMode* NewL(CMPXVideoPlaybackController* aVideoPlaybackCtlr);
+        virtual ~CMPXStreamingPlaybackMode();
+
+        // Methods where video plabkack behavior varies for streaming media
+        inline virtual TInt GetMode();
+        virtual TBool CanPlayNow();
+        virtual void HandleOpenComplete();
+        void OpenFileL( const TDesC& aMediaFile );
+        virtual TInt HandlePause();
+};
+
+////////////////////////////////////////////////////////////
+///     Declaration of CMPXLiveStreamingPlaybackMode
+///
+///     live streaming is a specialized streaming case
+////////////////////////////////////////////////////////////
+class CMPXLiveStreamingPlaybackMode : public CMPXStreamingPlaybackMode
+{
+    public:
+        static CMPXVideoPlaybackMode* NewL(CMPXVideoPlaybackController* aVideoPlaybackCtlr);
+        virtual ~CMPXLiveStreamingPlaybackMode();
+
+        // Methods where video plabkack behavior varies for live streaming media
+        inline virtual TInt GetMode();
+        virtual TInt HandlePause();
+        virtual TBool SendErrorToView( TInt aError );
+        virtual void HandlePauseToPlayTransitionL();
+};
+
+////////////////////////////////////////////////////////////////////////////////
+//
+//     Declaration of CMPXProgressiveDLPlaybackMode
+//
+//     Progressive Download is a specialized local playback case
+//
+////////////////////////////////////////////////////////////////////////////////
+class CMPXProgressiveDLPlaybackMode : public CMPXLocalPlaybackMode
+{
+    public:
+        static CMPXVideoPlaybackMode* NewL( CMPXVideoPlaybackController* aVideoPlaybackCtlr );
+        virtual ~CMPXProgressiveDLPlaybackMode();
+
+#ifdef USE_S60_DOWNLOAD_MANAGER
+
+        inline virtual TInt GetMode();
+        void ConnectToDownloadL( CMPXCommand& aCmd );
+        void HandleOpenComplete();
+        void GetPdlStatusL( CMPXCommand& aCmd );
+        void UpdateSeekPosition( TInt64& aPosition );
+        inline TBool IsDownloadPaused();
+        void OpenFileL( const RFile& aMediaFile );
+
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+        void OpenFile64L( const RFile64& aMediaFile );
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+#endif // USE_S60_DOWNLOAD_MANAGER
+
+    private:
+        void ConstructL( CMPXVideoPlaybackController* aVideoPlaybackCtlr );
+
+#ifdef USE_S60_DOWNLOAD_MANAGER
+    private:
+        CMPXVideoDlMgrIf*  iDlMgrIf;   // owned
+#endif // USE_S60_DOWNLOAD_MANAGER
+
+};
+
+#ifdef USE_S60_DOWNLOAD_MANAGER
+
+inline
+TInt CMPXProgressiveDLPlaybackMode::GetMode()
+{
+    MPX_DEBUG(_L("CMPXProgressiveDLPlaybackMode::GetMode()"));
+    return EMPXVideoProgressiveDownload;
+}
+
+inline
+TBool CMPXProgressiveDLPlaybackMode::IsDownloadPaused()
+{
+    return iDlMgrIf->IsDownloadPaused();
+}
+
+#endif // USE_S60_DOWNLOAD_MANAGER
+
+// INLINE METHODS
+
+inline
+TInt CMPXVideoPlaybackMode::GetMode()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackMode::GetMode()"));
+    // sub-classes to return their respective value
+    return EMPXNumberOfModes;
+}
+
+inline
+TInt CMPXLocalPlaybackMode::GetMode()
+{
+    MPX_DEBUG(_L("CMPXLocalPlaybackMode::GetMode()"));
+    return EMPXVideoLocal;
+}
+
+inline
+TInt CMPXStreamingPlaybackMode::GetMode()
+{
+    MPX_DEBUG(_L("CMPXStreamingPlaybackMode::GetMode()"));
+    return EMPXVideoStreaming;
+}
+
+inline
+TInt CMPXLiveStreamingPlaybackMode::GetMode()
+{
+    MPX_DEBUG(_L("CMPXLiveStreamingPlaybackMode::GetMode()"));
+    return EMPXVideoLiveStreaming;
+}
+
+inline
+TBool CMPXVideoPlaybackMode::IsDownloadPaused()
+{
+    return EFalse;
+}
+
+
+#endif  //_CMPXVIDEOPLAYBACKMODE_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/inc/mpxvideoplaybackstate.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,470 @@
+/*
+* 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:   This class plays files with the Helix Engine
+ *
+*/
+
+
+// Version : %version: 22 %
+
+
+#ifndef _CMPXVIDEOPLAYBACKSTATE_H_
+#define _CMPXVIDEOPLAYBACKSTATE_H_
+
+//
+//  INCLUDES
+//
+#include <e32def.h>
+#include <e32base.h>
+
+#include "mpxhelixplaybackplugindefs.h"
+#include "mpxvideo_debug.h"
+
+//
+//  FORWARD DECLARATIONS
+//
+class CMPXVideoPlaybackController;
+
+//
+//  CLASS DECLARATION
+//
+
+/*
+ *  CMpxVideoPlaybackState class
+ *
+ *  State Machine keeptrack of the state of the playback controller
+ *  @lib mpxvideohelixplayback.lib
+ *
+ */
+NONSHARABLE_CLASS( CMPXVideoPlaybackState ) : public CBase
+{
+    public:
+        //
+        //  Constructors and destructor
+        //
+
+        /*
+         *  Destructor
+         *  Destroy the object and release all memory objects
+         */
+        ~CMPXVideoPlaybackState();
+
+        //
+        //  CMPXVideoPlaybackState Implementation
+        //
+
+        // Commands received from the Framework
+        virtual void  HandlePlay();
+        virtual void  HandlePause();
+        virtual void  DoHandlePause();
+        virtual void  HandlePlayPause();
+        virtual void  HandleStop();
+        virtual void  HandleStartSeekL( TBool aForward );
+        virtual void  HandleStopSeekL();
+        virtual void  HandleClose();
+        virtual void  HandleSetPosterFrame();
+        virtual void  HandleForeground();
+        virtual void  HandleBackground();
+
+        virtual void  HandleCustomPause();
+        virtual void  HandleCustomPlay();
+
+
+        virtual void  CommandHandleBackground();
+        virtual void  CommandHandleForeground();
+
+        // Events received from the MMF
+        virtual void HandleOpenComplete(TInt aError);
+        virtual void HandlePrepareComplete(TInt aError);
+        virtual void HandleLoadingStarted();
+        virtual void HandleLoadingComplete(TInt aError);
+        virtual void HandlePlaybackComplete(TInt aError);
+        virtual void HandleUnexpectedError( TInt aError );
+
+        // general method
+        virtual void OpenFileL( const TDesC& aMediaFile );
+        virtual void OpenFileL( const RFile& aMediaFile );
+        virtual void HandleVolumeChange();
+        virtual void HandleSetPositionL(TInt aPosition);
+        virtual TInt RetrieveFileDetailsL(const TArray<TMPXAttribute>& aAttrs, CMPXMedia* aMedia);
+        void RetrieveGeneralAttributesL( CMPXMedia* aMedia, TUint attrG );
+        void RetrieveVideoAttributesL( CMPXMedia* aMedia, TUint attrV );
+        inline virtual TBool IsInitialized();
+        virtual void HandleEndOfClip();
+        virtual TInt RetrieveBufferingPercentage();
+
+        virtual void ResolveTimeoutError( TInt aError );
+
+        virtual void UpdateSeekableL( CMPXCommand& aCmd );
+
+        //
+        // Set aspect ratio to mmf controller
+        //
+        virtual void SetAspectRatioL( CMPXCommand& aCmd, TMMFScalingType aType );
+
+        virtual void SendErrorToViewL( TInt aError );
+
+        inline virtual TMPXVideoPlaybackState  GetState();
+
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+        virtual void OpenFile64L( const RFile64& aMediaFile );
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+        void IssuePlayCommand( TMPXVideoPlaybackState aState,
+                               MMPXPlaybackPluginObserver::TEvent aEvent,
+                               TBool aSendEvent = ETrue );
+
+    protected:
+        /*
+         *  C++ default constructor
+         */
+        CMPXVideoPlaybackState();
+
+        /*
+         *  the second phase constructor ConstructL to safely construct things
+         *  that can leave
+         */
+        void ConstructL(CMPXVideoPlaybackController* aVideoPlaybackCtlr);
+
+    protected:
+        //
+        //  Data
+        //
+        CMPXVideoPlaybackController*        iVideoPlaybackCtlr;   // not owned
+        RFs                                 iFs;
+};
+
+
+/*******************************************************/
+/*         SUB CLASS DECLARATIONS                         */
+/*******************************************************/
+
+////////////////////////////////////////////////////////
+///     Declaration of CMPXNotIntialisedState
+////////////////////////////////////////////////////////
+class CMPXNotInitialisedState : public CMPXVideoPlaybackState
+{
+    public:
+        static CMPXVideoPlaybackState* NewL(CMPXVideoPlaybackController* aVideoPlaybackCtlr);
+        virtual ~CMPXNotInitialisedState();
+
+        // general method
+        virtual void HandleVolumeChange();
+        virtual TInt RetrieveFileDetailsL(const TArray<TMPXAttribute>& aAttrs, CMPXMedia* aMedia);
+        virtual void HandleClose();
+        virtual void SetAspectRatioL( CMPXCommand& aCmd, TMMFScalingType aType );
+        inline virtual TBool IsInitialized();
+        virtual void HandleUnexpectedError( TInt aError );
+        virtual void HandleBackground();
+        virtual void HandleForeground();
+        virtual void HandlePlay();
+        virtual void UpdateSeekableL( CMPXCommand& aCmd );
+
+        inline virtual TMPXVideoPlaybackState GetState();
+};
+
+
+////////////////////////////////////////////////////////
+///     Declaration of CMPXIntialisingState
+////////////////////////////////////////////////////////
+class CMPXInitialisingState : public CMPXVideoPlaybackState
+{
+    public:
+        static CMPXVideoPlaybackState* NewL(CMPXVideoPlaybackController* aVideoPlaybackCtlr);
+        virtual ~CMPXInitialisingState();
+
+        virtual void OpenFileL( const TDesC& aMediaFile );
+        virtual void OpenFileL( const RFile& aMediaFile );
+
+        // Methods where video plabkack behavior varies for this state
+        virtual void HandleForeground();
+        virtual void HandleBackground();
+
+        // Events received from the MMF
+        virtual void HandleOpenComplete(TInt aError);
+        virtual void HandlePrepareComplete(TInt aError);
+
+        // general method
+        virtual void HandleVolumeChange();
+        virtual TInt RetrieveFileDetailsL(const TArray<TMPXAttribute>& aAttrs, CMPXMedia* aMedia);
+        virtual void SetAspectRatioL( CMPXCommand& aCmd, TMMFScalingType aType );
+        inline virtual TBool IsInitialized();
+        virtual void HandleUnexpectedError( TInt aError );
+
+        inline virtual TMPXVideoPlaybackState GetState();
+
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+        virtual void OpenFile64L( const RFile64& aMediaFile );
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+};
+
+////////////////////////////////////////////////////////
+///     Declaration of CMPXIntialisedState
+////////////////////////////////////////////////////////
+class CMPXInitialisedState : public CMPXVideoPlaybackState
+{
+    public:
+        static CMPXVideoPlaybackState* NewL(CMPXVideoPlaybackController* aVideoPlaybackCtlr);
+        virtual ~CMPXInitialisedState();
+
+        // Methods where video plabkack behavior varies for this state
+
+        // Commands received from the Framework
+        virtual void HandlePlay();
+        virtual void HandleStop();
+        virtual void HandleForeground();
+        virtual void HandleBackground();
+        virtual void HandlePause();
+
+        // general method
+        virtual void HandleSetPositionL(TInt aPosition);
+
+        inline virtual TMPXVideoPlaybackState GetState();
+};
+
+////////////////////////////////////////////////////////
+///     Declaration of CMPXPlayingState
+////////////////////////////////////////////////////////
+class CMPXPlayingState : public CMPXVideoPlaybackState
+{
+    public:
+        static CMPXVideoPlaybackState* NewL(CMPXVideoPlaybackController* aVideoPlaybackCtlr);
+        virtual ~CMPXPlayingState();
+
+        // Methods where video plabkack behavior varies for this state
+
+        // Commands received from the Framework
+        virtual void HandlePause();
+        virtual void HandleStop();
+        virtual void HandleStartSeekL( TBool aForward );
+        virtual void HandleSetPosterFrame();
+        virtual void HandlePlayPause();
+        virtual void HandleBackground();
+
+        virtual void HandleCustomPause();
+
+        // Events received from the MMF
+        virtual void HandleLoadingStarted();
+
+        // general method
+        virtual void HandleSetPositionL(TInt aPosition);
+        virtual void ResolveTimeoutError( TInt aError );
+
+        inline virtual TMPXVideoPlaybackState GetState();
+};
+
+
+////////////////////////////////////////////////////////
+///     Declaration of CMPXBufferingState
+////////////////////////////////////////////////////////
+class CMPXBufferingState : public CMPXVideoPlaybackState
+{
+    public:
+        static CMPXVideoPlaybackState* NewL(CMPXVideoPlaybackController* aVideoPlaybackCtlr);
+        virtual ~CMPXBufferingState();
+
+        // Methods where video plabkack behavior varies for this state
+
+        // Commands received from the Framework
+        //virtual void  HandleStop();
+
+        virtual void HandleForeground();
+        virtual void HandleBackground();
+        virtual void HandleStop();
+        virtual void HandlePause();
+        virtual TInt RetrieveBufferingPercentage();
+
+        // Events received from the MMF
+        virtual void HandleLoadingStarted();
+        virtual void HandleLoadingComplete(TInt aError);
+
+        // Handle end of the clip situation, where we might get
+        // playbackcomplete before loadingcomplete
+
+        // general method
+        virtual void ResolveTimeoutError( TInt aError );
+
+        inline virtual TMPXVideoPlaybackState GetState();
+};
+
+////////////////////////////////////////////////////////
+///     Declaration of CMPXPausedState
+////////////////////////////////////////////////////////
+class CMPXPausedState : public CMPXVideoPlaybackState
+{
+    public:
+        static CMPXVideoPlaybackState* NewL( CMPXVideoPlaybackController* aVideoPlaybackCtlr );
+        virtual ~CMPXPausedState();
+
+        // Methods where video plabkack behavior varies for this state
+
+        // Commands received from the Framework
+        virtual void HandlePlay();
+        virtual void HandleStop();
+        virtual void HandleStartSeekL( TBool aForward );
+        virtual void HandlePlayPause();
+        virtual void HandleSetPosterFrame();
+        virtual void HandleForeground();
+        virtual void HandleCustomPlay();
+        virtual void HandleUnexpectedError( TInt aError );
+
+        // general method
+        virtual void HandleSetPositionL( TInt aPosition );
+
+        inline virtual TMPXVideoPlaybackState GetState();
+};
+
+////////////////////////////////////////////////////////
+///     Declaration of CMPXSeekingState
+////////////////////////////////////////////////////////
+class CMPXSeekingState : public CMPXVideoPlaybackState
+{
+    public:
+        static CMPXVideoPlaybackState* NewL(CMPXVideoPlaybackController* aVideoPlaybackCtlr);
+        virtual ~CMPXSeekingState();
+
+        // Methods where video plabkack behavior varies for this state
+
+        // Commands received from the Framework
+        virtual void HandleStopSeekL();
+        virtual void HandleBackground();
+        virtual void HandlePause();
+        virtual void HandlePlay();
+        virtual void HandleSetPositionL( TInt aPosition );
+
+        virtual void HandleStop();
+
+        inline virtual TMPXVideoPlaybackState GetState();
+};
+
+
+////////////////////////////////////////////////////////
+///     Declaration of CMPXStoppedState
+////////////////////////////////////////////////////////
+class CMPXStoppedState : public CMPXVideoPlaybackState
+{
+    public:
+        static CMPXVideoPlaybackState* NewL(CMPXVideoPlaybackController* aVideoPlaybackCtlr);
+        virtual ~CMPXStoppedState();
+
+        // Methods where video plabkack behavior varies for this state
+
+        // Commands received from the Framework
+        virtual void HandlePlay();
+        virtual void HandleClose();
+
+        // general method
+        virtual void HandleSetPositionL(TInt aPosition);
+        virtual void ResolveTimeoutError( TInt aError );
+        virtual void HandleUnexpectedError( TInt aError );
+
+        inline virtual TMPXVideoPlaybackState GetState();
+};
+
+// INLINE METHODS
+
+inline
+TMPXVideoPlaybackState CMPXVideoPlaybackState::GetState()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackState::GetState()"));
+
+    // sub-classes to return their respective value
+    return EMPXNumberOfStates;
+}
+
+inline
+TMPXVideoPlaybackState CMPXNotInitialisedState::GetState()
+{
+    MPX_DEBUG(_L("CMPXNotInitialisedState::GetState()"));
+
+    return EMPXVideoNotInitialized;
+}
+
+inline
+TMPXVideoPlaybackState CMPXInitialisingState::GetState()
+{
+    MPX_DEBUG(_L("CMPXInitialisingState::GetState()"));
+
+    return EMPXVideoInitializing;
+}
+
+inline
+TMPXVideoPlaybackState CMPXInitialisedState::GetState()
+{
+    MPX_DEBUG(_L("CMPXInitialisedState::GetState()"));
+
+    return EMPXVideoInitialized;
+}
+
+inline
+TMPXVideoPlaybackState CMPXPlayingState::GetState()
+{
+    MPX_DEBUG(_L("CMPXPlayingState::GetState()"));
+
+    return EMPXVideoPlaying;
+}
+
+inline
+TMPXVideoPlaybackState CMPXPausedState::GetState()
+{
+    MPX_DEBUG(_L("CMPXPausedState::GetState()"));
+
+    return EMPXVideoPaused;
+}
+
+inline
+TMPXVideoPlaybackState CMPXStoppedState::GetState()
+{
+    MPX_DEBUG(_L("CMPXStoppedState::GetState()"));
+    return EMPXVideoStopped;
+}
+
+inline
+TMPXVideoPlaybackState CMPXBufferingState::GetState()
+{
+    MPX_DEBUG(_L("CMPXBufferingState::GetState()"));
+
+    return EMPXVideoBuffering;
+}
+
+inline
+TMPXVideoPlaybackState CMPXSeekingState::GetState()
+{
+    MPX_DEBUG(_L("CMPXSeekingState::GetState()"));
+
+    return EMPXVideoSeeking;
+}
+
+inline
+TBool CMPXVideoPlaybackState::IsInitialized()
+{
+    return ETrue;
+}
+
+inline
+TBool CMPXNotInitialisedState::IsInitialized()
+{
+    return EFalse;
+}
+
+inline
+TBool CMPXInitialisingState::IsInitialized()
+{
+    return EFalse;
+}
+
+
+
+#endif  //_CMPXVIDEOPLAYBACKSTATE_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/inc/mpxvideoplayerutility.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,177 @@
+/*
+* 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:  This class is the interface between the playback plugin and RMMFController
+*
+*/
+
+
+// Version : %version: 14 %
+
+
+#ifndef __MPXVIDEOPLAYERUTILITY__
+#define __MPXVIDEOPLAYERUTILITY__
+
+//
+//  INCLUDES
+//
+#include <mmf/common/mmfcontroller.h>
+#include <e32base.h>
+
+#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
+#include <mmf/common/mmfstandardcustomcommandsimpl.h>
+#else
+#include <mmf/common/mmfstandardcustomcommands.h>
+#endif
+
+#include <mmf/common/mmfdrmcustomcommands.h>
+
+#ifdef SYMBIAN_BUILD_GCE
+#include <mmf/common/mmfvideosurfacecustomcommands.h>
+#endif
+
+//
+//  FORWARD DECLARATIONS
+//
+class CMPXVideoPlaybackController;
+class CFbsBitmap;
+
+//
+//  CLASS DECLARATION
+//
+
+NONSHARABLE_CLASS( CMpxVideoPlayerUtility ) : public CActive,
+                                              public MMMFControllerEventMonitorObserver
+{
+    public:
+
+        static CMpxVideoPlayerUtility* NewL( CMPXVideoPlaybackController* aVideoPlaybackCtrl );
+        ~CMpxVideoPlayerUtility();
+
+        void Reset();
+
+        void OpenFileL( const TDesC& aFileName );
+        void OpenFileL( const RFile& aFile );
+        void OpenUrlL( const TDesC& aUrl, TInt aApId );
+
+        TTimeIntervalMicroSeconds PositionL() const;
+        TTimeIntervalMicroSeconds DurationL() const;
+
+        TInt NumberOfMetaDataEntriesL() const;
+        CMMFMetaDataEntry* MetaDataEntryL( TInt aIndex ) const;
+
+        TBool AudioEnabledL() const;
+        void SetVolumeL( TInt aVolume );
+        TInt Volume() const;
+        TInt MaxVolume() const;
+
+        void VideoFrameSizeL( TSize& aSize ) const;
+        TInt VideoBitRateL() const;
+        TInt AudioBitRateL() const;
+        TInt VideoFormatMimeType( TDes8& aMimeType ) const;
+        TUint32 FourCCCode() const;
+        void RefreshFrameL();
+
+        void RestartDsa( const TRegion& aRegion );
+        void AbortDsa();
+        void SetDisplayWindowL( const TRect& aScreenRect,
+                                const TRect& aClipRect,
+                                const TRegion& aDrawingRegion );
+
+        TInt CustomCommandSync( const TMMFMessageDestinationPckg& aDestination,
+                                TInt aFunction,
+                                const TDesC8& aDataTo1,
+                                const TDesC8& aDataTo2 );
+
+        void Prepare();
+        void PlayL();
+        void PauseL();
+        void Close();
+        TInt Stop();
+
+        void SetPositionL( const TTimeIntervalMicroSeconds& aPosition );
+
+        void SetPlayVelocityL( TInt aVelocity );
+
+        void GetVideoLoadingProgressL( TInt& aPercentageProgress );
+
+        void GetFrameL();
+
+        //
+        //  MMMFControllerEventMonitorObserver Implementation
+        //
+        void HandleEvent( const TMMFEvent& aEvent );
+
+        CFbsBitmap& GetBitmap();
+
+        void RunL();
+        void DoCancel();
+
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+        void OpenFile64L( const RFile64& aFile );
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+#ifdef SYMBIAN_BUILD_GCE
+
+        TInt VideoSurfaceCreated();
+        TInt SurfaceParametersChanged();
+        void RemoveSurface();
+        TInt RemoveSurfaceFromHelix( TSurfaceId aSurfaceId );
+
+        void SendSurfaceCommandL( TInt aCmd );
+
+        void SendSurfaceCommandL( TInt aCmd,
+                                  const TSurfaceId& aSurfaceId,
+                                  const TRect& aCropRect,
+                                  TVideoAspectRatio aAspectRatio );
+
+        void SendSurfaceCreatedCommand();
+
+#endif
+
+    private:
+
+        void ConstructL();
+        CMpxVideoPlayerUtility( CMPXVideoPlaybackController* aVideoPlaybackCtrl );
+        void OpenControllerL();
+
+    private:
+
+        //
+        //  Data
+        //
+        CMPXVideoPlaybackController*              iVideoPlaybackController;
+
+        RMMFController                            iController;
+        RMMFVideoControllerCustomCommands         iVideoControllerCustomCommands;
+        RMMFVideoPlayControllerCustomCommands     iVideoPlayControllerCustomCommands;
+        RMMFAudioPlayDeviceCustomCommands         iAudioPlayDeviceCustomCommands;
+        RMMFDRMCustomCommands                     iDrmCustomCommands;
+        RMMFVideoPlayControllerExtCustomCommands  iVideoPlayControllerExtCustomCommands;
+
+#ifdef SYMBIAN_BUILD_GCE
+        RMMFVideoPlaySurfaceSupportCustomCommands iVideoPlaySurfaceSupportCustomCommands;
+
+        TSurfaceId                                iSurfaceId;
+        TRect                                     iCropRect;
+        TVideoAspectRatio                         iAspectRatio;
+#endif
+
+        CMMFControllerEventMonitor*               iControllerEventMonitor;
+
+        TBool                                     iDirectScreenAccessAbort;
+
+        CFbsBitmap*                               iPosterFrameBitmap;
+};
+
+#endif /* __MPXVIDEOPLAYERUTILITY__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/inc/mpxvideoposterframesetter.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,89 @@
+/*
+* 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:   Poster Frame Setter
+ *
+*/
+
+// Version : %version:  ou1cpsw#2 %
+
+
+
+#ifndef _MPXVIDEOPOSTERFRAMESETTER_H
+#define _MPXVIDEOPOSTERFRAMESETTER_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <thumbnailmanager.h>
+#include <thumbnailobjectsource.h>
+#include <thumbnailmanagerobserver.h>
+
+
+// FORWARD DECLARATIONS
+class CMPXVideoPlaybackController;
+class CThumbnailManager;
+
+// CLASS DECLARATION
+NONSHARABLE_CLASS(CMPXVideoPosterFrameSetter) : public CBase,
+                                                public MThumbnailManagerObserver
+{
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        */
+        static CMPXVideoPosterFrameSetter* NewL( CMPXVideoPlaybackController* aVideoPlaybackCtlr );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CMPXVideoPosterFrameSetter();
+
+    public: 
+        
+        void RequestPosterFrame();
+        
+        void HandlePosterFrameReady(TInt aError);
+        
+        // from MThumbnailManagerObserver
+        void ThumbnailPreviewReady( MThumbnailData& aThumbnail,
+                                    TThumbnailRequestId aId );
+        
+        // from MThumbnailManagerObserver
+        void ThumbnailReady( TInt aError, 
+                             MThumbnailData& aThumbnail,
+                             TThumbnailRequestId aId );
+
+        
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CMPXVideoPosterFrameSetter( CMPXVideoPlaybackController* aVideoPlaybackCtlr );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();        
+
+    private:    // Data        
+
+        CMPXVideoPlaybackController*    iVideoPlaybackCtlr;
+        TThumbnailRequestId             iRequestId;
+        CThumbnailManager*              iTNManager;
+};
+
+#endif      // _MPXVIDEOPOSTERFRAMESETTER_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/inc/mpxvideoprivatecrkeys.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,36 @@
+/*
+* Copyright (c) 2004 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:  MPX videoplayback private CenRep keys.
+*
+*/
+
+// Version : %version: 4 %
+
+
+
+
+#ifndef MPXVIDEOPRIVATECRKEYS_H
+#define MPXVIDEOPRIVATECRKEYS_H
+
+#include <e32cmn.h>
+
+
+const TUid KCRUidMPXVideoSettings = {0x101F880A};
+
+const TUint32 KMPXVideoPlaybackMute = 0x1;
+const TUint32 KMPXVideoPlaybackVolume = 0x2;
+
+#endif      // MPXVIDEOPRIVATECRKEYS_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/inc/mpxvideoseeker.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,128 @@
+/*
+* 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:   Seek or trickplay
+ *
+*/
+
+// Version : %version: 3 %
+
+
+
+#ifndef _MPXVIDEOSEEKER_H
+#define _MPXVIDEOSEEKER_H
+
+//  INCLUDES
+#include <e32base.h>
+
+#include "mpxhelixplaybackplugindefs.h"
+
+// FORWARD DECLARATIONS
+class CMPXVideoPlaybackController;
+
+// CLASS DECLARATION
+NONSHARABLE_CLASS(CMPXVideoSeeker) : public CBase
+{
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        */
+        static CMPXVideoSeeker* NewL( CMPXVideoPlaybackController* aVideoPlaybackCtlr );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CMPXVideoSeeker();
+
+    public: // New functions
+        
+        /**
+        * Start seeking
+        * @param aForward Seeking direction
+        * @param aClipLength Clips length
+        * @return void
+        */
+        void StartSeekingL( TBool aForward,
+                            TMPXVideoPlaybackState aState,
+                            TInt64 aPosition,
+                            TInt64 aDuration );
+
+        /**
+        * Stops seeking
+        * @return void
+        */
+        void StopSeekingL();
+        
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CMPXVideoSeeker( CMPXVideoPlaybackController* aVideoPlaybackCtlr );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+    private:
+
+        /**
+        * Timer callback for stopping trick play
+        * @return KErrNone
+        */        
+        static TInt StopTrickPlay( TAny* aPtr );
+
+        /**
+        * stop trick play after 5 sec
+        * @return void
+        */        
+        void DoStopTrickPlay();        
+
+        /**
+        * convert to seeking from trick play
+        * @return void
+        */  
+        void ConvertToSeeking();
+
+        /**
+        * Timer callback for updating position info
+        * @return KErrNone
+        */        
+        static TInt UpdatePosition( TAny* aPtr );
+
+        /**
+        * Update position info
+        * @return void
+        */        
+        void DoUpdatePosition();
+
+    private:    // Data
+        
+        TBool                        iForward;
+        TMPXVideoPlaybackState       iPreviousState;
+
+        TInt                         iIncrements;
+        TInt64                       iPosition;
+        TInt64                       iDuration;
+
+        CPeriodic*                   iSeekTimer;
+        CPeriodic*                   iTrickPlayTimer;
+
+        CMPXVideoPlaybackController* iVideoPlaybackCtlr;
+};
+
+#endif      // _MPXVIDEOSEEKER_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/rom/mpxvideohelixplugin.iby	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,29 @@
+/*
+* 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: IBY for mpxvideohelixplugin.dll
+*
+*/
+
+// Version : %version: 2 %
+
+#ifndef MPXVIDEOHELIXPLUGIN_IBY
+#define MPXVIDEOHELIXPLUGIN_IBY
+
+#include <bldvariant.hrh>
+
+ECOM_PLUGIN(mpxvideohelixplayback.dll,mpxvideohelixplayback.rsc)
+
+#endif // MPXVIDEOHELIXPLUGIN_IBY
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/src/mpxcalldetector.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,124 @@
+/*
+* 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: 2 %
+
+// INCLUDE FILES
+#include <ctsydomainpskeys.h>
+
+#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 callStatus;
+        iTsyProperty.Get( callStatus );
+        
+        if ( callStatus != EPSCTsyCallStateNone && callStatus != EPSCTsyCallStateDisconnecting )
+        {
+            iObserver->CallDetectedL();
+        }
+    }
+}
+
+// ---------------------------------------------------------------------------
+// CCallDetector::DoCancel
+//
+// ---------------------------------------------------------------------------
+//
+void CMPXCallDetector::DoCancel()
+{
+    iTsyProperty.Cancel();
+}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/src/mpxvideoaccessoryobserver.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,264 @@
+/*
+* 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:  This class observes the accessory framework.
+ *
+*/
+
+// Version : %version: 9 %
+
+//
+//  INCLUDE FILES
+//
+#include <e32svr.h>
+#include <AccPolSubblockNameArray.h>
+
+#include "mpxvideoaccessoryobserver.h"
+#include "mpxvideoplaybackcontroller.h"
+#include "mpxvideo_debug.h"
+
+//
+// ============================ MEMBER FUNCTIONS ===================================================
+//
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoAccessoryObserver::NewL
+//   Two-phased constructor.
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoAccessoryObserver*
+CMPXVideoAccessoryObserver::NewL( CMPXVideoPlaybackController* aController )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoAccessoryObserver::NewL()"));
+
+    CMPXVideoAccessoryObserver* self = new (ELeave) CMPXVideoAccessoryObserver( aController );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoAccessoryObserver::ConstructL
+//   Symbian 2nd phase constructor can leave
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoAccessoryObserver::ConstructL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoAccessoryObserver::ConstructL()"));
+
+#ifdef __ACCESSORY_FW
+    User::LeaveIfError( iServer.Connect() );
+    User::LeaveIfError( iConnection.CreateSubSession( iServer ) );
+
+    //
+    //  Get initial accessory status synchronously
+    //
+    iConnection.GetAccessoryConnectionStatus( iGenericIdArray );
+#endif
+
+    //
+    //  This will set check if a TV-Out accessory has been connected
+    //  and initialize the member variable
+    //
+    UpdateTvOutStatusL();
+
+    StartMonitoringL();
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoAccessoryObserver::CMPXVideoAccessoryObserver
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoAccessoryObserver::CMPXVideoAccessoryObserver( CMPXVideoPlaybackController* aController )
+    : CActive( CActive::EPriorityStandard )
+    , iController( aController )
+    , iTvOutConnected( EFalse )
+{
+    CActiveScheduler::Add( this );
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoAccessoryObserver::~CMPXVideoAccessoryObserver
+// Destructor, close and release the handles.
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoAccessoryObserver::~CMPXVideoAccessoryObserver()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoAccessoryObserver::~CMPXVideoAccessoryObserver()"));
+
+    Cancel();
+
+#ifdef __ACCESSORY_FW
+    iConnection.CloseSubSession();
+    iServer.Disconnect();
+#endif
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoAccessoryObserver::StartMonitoringL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoAccessoryObserver::StartMonitoringL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoAccessoryObserver::StartMonitoringL()"));
+
+    if ( ! IsActive() )
+    {
+#ifdef __ACCESSORY_FW
+        iConnection.NotifyAccessoryConnectionStatusChanged( iStatus, iGenericIdArray );
+#endif
+
+        SetActive();
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoAccessoryObserver::UpdateTvOutStatusL
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoAccessoryObserver::UpdateTvOutStatusL()
+{
+    MPX_DEBUG(_L("CMPXVideoAccessoryObserver::UpdateTvOutStatusL()"));
+
+    TBool statusChanged = EFalse;
+
+    //
+    //  Initialize TV-Out value to EFalse before checking if
+    //  accessories support TV-Out
+    //
+    TBool tvOutConnected = EFalse;
+
+#ifdef __ACCESSORY_FW
+    CAccPolSubblockNameArray* nameArray = CAccPolSubblockNameArray::NewL();
+    CleanupStack::PushL( nameArray );
+
+    //
+    //  Get the number of currently connected accessories
+    //  Loop through each connected accessory looking for
+    //  the desired capabilities
+    //
+    const TInt count = iGenericIdArray.Count();
+
+    for ( TInt index = 0 ; index < count ; index++ )
+    {
+        TAccPolGenericID genId = iGenericIdArray.GetGenericIDL( index );
+        
+        //
+        //  Get all supported capabilities for this connected accessory.
+        //
+        iConnection.GetSubblockNameArrayL( genId, *nameArray );
+
+        //
+        //  Check if this connected accessory supports TV-Out
+        //
+        if ( nameArray->HasName( KAccVideoOut ) )
+        {
+            MPX_DEBUG(_L("    TV-Out Capabilities Exist"));
+
+            tvOutConnected = ETrue;                         
+        }
+    }
+
+    CleanupStack::PopAndDestroy( nameArray );
+#endif
+
+    //
+    //  Check if the TV-Out status has changed
+    //
+    if ( iTvOutConnected != tvOutConnected )
+    {
+        iTvOutConnected = tvOutConnected;
+        statusChanged   = ETrue;
+    }
+
+    MPX_DEBUG(_L("CMPXVideoAccessoryObserver::UpdateTvOutStatusL  iTvOutConnected = %d"), iTvOutConnected);
+
+    MPX_DEBUG(_L("CMPXVideoAccessoryObserver::UpdateTvOutStatusL() ret = %d"), statusChanged);
+
+    return statusChanged;
+}
+
+// -----------------------------------------------------------------------------
+//   CMPXVideoAccessoryObserver::RunL
+// -----------------------------------------------------------------------------
+//
+void CMPXVideoAccessoryObserver::RunL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoAccessoryObserver::RunL()"),
+                   _L("iStatus = %d"), iStatus.Int());
+
+#ifdef __ACCESSORY_FW
+    if ( KErrNone == iStatus.Int() )
+    {
+        //
+        //  Check for TV-Out status change
+        //  If a changed, issue notice to the observer
+        //
+        if ( UpdateTvOutStatusL() )
+        {
+            iController->HandleTvOutEventL( iTvOutConnected );
+        }
+    }
+#endif
+
+    //
+    //  Renew request for accessory events
+    //
+    StartMonitoringL();
+}
+
+// -----------------------------------------------------------------------------
+//   CMPXVideoAccessoryObserver::DoCancel
+// -----------------------------------------------------------------------------
+//
+void CMPXVideoAccessoryObserver::DoCancel()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoAccessoryObserver::DoCancel()"));
+
+#ifdef __ACCESSORY_FW
+    iConnection.CancelNotifyAccessoryConnectionStatusChanged();
+#endif
+}
+
+// -----------------------------------------------------------------------------
+//   CMPXVideoAccessoryObserver::RunError
+// -----------------------------------------------------------------------------
+//
+TInt CMPXVideoAccessoryObserver::RunError( TInt aError )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoAccessoryObserver::RunError()"),
+                   _L("aError = %d"), aError);
+
+#ifdef __ACCESSORY_FW
+    //
+    //  Error occurred, issue new request for accessory status
+    //
+    iConnection.NotifyAccessoryConnectionStatusChanged( iStatus, iGenericIdArray );
+#endif
+
+    return KErrNone;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoAccessoryObserver::IsTvOutConnected
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoAccessoryObserver::IsTvOutConnected()
+{
+    MPX_DEBUG(_L("CMPXVideoAccessoryObserver::IsTvOutConnected(%d)"), iTvOutConnected);
+
+    return iTvOutConnected;
+}
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/src/mpxvideoconnectionutility.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,160 @@
+/*
+* 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 streaming connection management implementation
+*
+*/
+
+#include <es_sock.h>
+#include <commdbconnpref.h>
+#include <rconnmon.h>  // RConnectionMonitor
+#include <mmf/common/mmfcontrollerframeworkbase.h>
+
+#include "mpxvideoconnectionutility.h"
+#include "mpxvideo_debug.h"
+
+
+TInt MpxVideoConnectionUtility::CheckAccessPointL(TInt aApId) 
+{ 
+    MPX_ENTER_EXIT(_L("MpxVideoConnectionUtility::checkAccessPointL()"));
+    MPX_DEBUG( _L("MpxVideoConnectionUtility::checkAccessPointL() aApId=%d") , aApId );
+    
+    // If access point is GPRS access point then instruct playback middleware to use 
+    // access point from media settings. Streaming access point may be different than AP
+    // used for browsing
+    
+    TBool isGprs( EFalse );  // or packet data in general
+    TBool isWLANOpen( EFalse );
+    TInt  wlanApId( KUseDefaultIap );  // if WLAN is open
+    
+    // Try to start default connection in case when 
+    // valid ap was not given by client
+    if (aApId < 0)
+    {
+        MPX_DEBUG( _L("MpxVideoConnectionUtility::checkAccessPointL() client didn't give valid ApId")  );
+        StartDefaultConnectionL();
+    }
+    
+    MPX_DEBUG( _L("MpxVideoConnectionUtility::checkAccessPointL() getting connections")  );
+    
+    // Resolve connections type, only open connections matter here 
+    RConnectionMonitor conMon; 
+    User::LeaveIfError( conMon.ConnectL() );
+    CleanupClosePushL(conMon);
+    
+    TRequestStatus status;
+    TUint connectionCount(0);    
+    conMon.GetConnectionCount(connectionCount, status);
+    User::WaitForRequest( status );   // Answer is needed now
+    User::LeaveIfError(status.Int());
+    
+    MPX_DEBUG( _L("MpxVideoConnectionUtility::checkAccessPointL() connectionCount=%d"), connectionCount  );
+    // loop connectionsconnectionCount
+    TUint connectionId(0);
+    TUint subConnCount(0);
+    // Start looping from 1
+    for (TUint i=1; i <= connectionCount; ++i)
+    {
+        MPX_DEBUG( _L("MpxVideoConnectionUtility::checkAccessPointL() getting connection=%d"), i  );
+        conMon.GetConnectionInfo(i, connectionId, subConnCount );
+        MPX_DEBUG( _L("MpxVideoConnectionUtility::checkAccessPointL() got connection=%d, connId=%d"), i, connectionId  );
+        
+        TUint iapIdToCheck;                                              
+        conMon.GetUintAttribute( connectionId, 0, KIAPId, iapIdToCheck, status );
+        // Note: Codescanner generates here pointless warning. Data is needed now
+        User::WaitForRequest ( status ); 
+        MPX_DEBUG( _L("MpxVideoConnectionUtility::checkAccessPointL() got IapId status=%d"), status.Int()  );
+        User::LeaveIfError( status.Int() );
+     
+        // Connection given by client matches to connection that is open
+        TInt bearer;  // TConnMonBearerType                                            
+        conMon.GetIntAttribute( connectionId, 0, KBearer, bearer, status );    
+        User::WaitForRequest ( status ); 
+        MPX_DEBUG( _L("MpxVideoConnectionUtility::checkAccessPointL() got bearer status=%d"), status.Int()  );
+        User::LeaveIfError( status.Int() );
+        
+        MPX_DEBUG( _L("MpxVideoConnectionUtility::checkAccessPointL()iapIdToCheck=%d, bearer=%d"), iapIdToCheck, bearer );
+        
+        if (EBearerWLAN == bearer) 
+        {
+            isWLANOpen = ETrue;
+            wlanApId = iapIdToCheck;
+        }
+                
+        if (iapIdToCheck == aApId)
+        {    
+            // This is connection given by client, check type 
+            if (EBearerGPRS == bearer || EBearerWCDMA == bearer || 
+                    EBearerEdgeGPRS == bearer || EBearerCDMA2000 == bearer ) 
+            {
+                MPX_DEBUG( _L("MpxVideoConnectionUtility::checkAccessPointL() given connection is packet data connection")  );
+                isGprs = ETrue;
+            }
+            // Exact match, either GPRS or WLAN. No need to check further.
+            break; 
+        }      
+    } // for 
+    
+    // Close connection monitor
+    CleanupStack::PopAndDestroy(); 
+    
+    // If type is GPRS/packed data, return KUseDefaultIap. 
+    // AP from Media Settings will be used for streaming
+    if (isGprs) 
+    {
+        // Let playback middleware use connection from media settings
+        MPX_DEBUG( _L("MpxVideoConnectionUtility::checkAccessPointL() packet data connection is open: KUseDefaultIap") );
+        aApId = KUseDefaultIap;
+    }
+    else if (isWLANOpen)
+    {
+        // WLAN was started or given AP was WLAN
+        MPX_DEBUG( _L("MpxVideoConnectionUtility::checkAccessPointL() wlan connection is open ") );
+        aApId = wlanApId;
+    }
+    // If neither of above matched then aApId stays invalid and 
+    // playback middleware will select access point or use Media Settings access point
+ 
+    MPX_DEBUG( _L("MpxVideoConnectionUtility::checkAccessPointL() return=%d") , aApId );
+    return aApId; 
+}
+
+
+void MpxVideoConnectionUtility::StartDefaultConnectionL()
+{
+    MPX_ENTER_EXIT(_L("MpxVideoConnectionUtility::StartDefaultConnectionL()"));
+    
+    // There is no connection open. User may have clicked RTSP url from offline browser page
+    // Start connection using RConnection
+    RSocketServ sockServHandle;
+    User::LeaveIfError(sockServHandle.Connect() );   // can't survive if it leaves now
+    CleanupClosePushL(sockServHandle);
+    
+    RConnection connection;
+    User::LeaveIfError(connection.Open(sockServHandle) );
+    CleanupClosePushL(connection);
+
+    TCommDbConnPref connPref;
+    // No parameters should be needed
+    // to get default connection open, fails if no iaps are configured
+    connPref.SetDialogPreference( ECommDbDialogPrefDoNotPrompt );
+    
+    // Ignore error. Can't do anything if default connection doesn't start
+    // Playback middleware may start access point from media settings
+    TInt err = connection.Start(connPref);
+    
+    MPX_DEBUG( _L("MpxVideoConnectionUtility::StartDefaultConnectionL() start err=%d"), err  );
+    
+    // Socket server and Rconnection close
+    CleanupStack::PopAndDestroy( 2 );
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/src/mpxvideodlmgrif.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,767 @@
+/*
+* 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:  Implementation of CMPXVideoDownloadMgrInterface class.
+*
+*/
+
+
+// Version : %version: 25 %
+
+
+#include <MMFROPCustomCommandConstants.h>
+#include <mmf/common/mmfcontrollerframework.h>
+#include <mpxplaybackpluginobserver.h>
+#include <mpxmessagegeneraldefs.h>
+#include <mpxcommandgeneraldefs.h>
+#include <pathinfo.h>
+#include <f32file.h>
+
+#ifdef RD_MULTIPLE_DRIVE
+#include <driveinfo.h>
+#endif  //RD_MULTIPLE_DRIVE
+
+#include "mpxvideoplaybackcontroller.h"
+#include "mpxvideodlmgrif.h"
+#include "mpxvideodrmhelper.h"
+#include <mpxvideoplaybackdefs.h>
+#include "mpxvideo_debug.h"
+
+
+CMPXVideoDlMgrIf*
+CMPXVideoDlMgrIf::NewL( CMPXVideoPlaybackController* aController )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoDlMgrIf::NewL()"));
+
+    CMPXVideoDlMgrIf* self = new (ELeave) CMPXVideoDlMgrIf();
+    CleanupStack::PushL( self );
+    self->ConstructL( aController );
+    CleanupStack::Pop();
+    return self;
+}
+
+
+void CMPXVideoDlMgrIf::ConstructL( CMPXVideoPlaybackController* aController )
+{
+    iController = aController;
+    iUpdateDownload = CIdle::NewL( CActive::EPriorityLow );
+}
+
+CMPXVideoDlMgrIf::CMPXVideoDlMgrIf()
+    : iDlId(KErrNotFound)
+{
+}
+
+CMPXVideoDlMgrIf::~CMPXVideoDlMgrIf()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoDlMgrIf::~CMPXVideoDlMgrIf()"));
+
+    //
+    //  Check if we need to move the clip or remove PDL flag from download
+    //
+    HandleClose();
+
+    //
+    //  Close the connection to the Download Manager
+    //  if one has been established
+    //
+    if ( iDlMgrConnected )
+    {
+        iDlMgr.Close();
+        iDlMgrConnected = EFalse;
+    }
+
+    if ( iUpdateDownload->IsActive() )
+    {
+        iUpdateDownload->Cancel();
+    }
+
+    delete iUpdateDownload;
+
+    if ( iClipName )
+    {
+        delete iClipName;
+        iClipName = NULL;
+    }
+}
+
+void CMPXVideoDlMgrIf::ConnectToDownloadL( CMPXCommand& aCmd )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoDlMgrIf::ConnectToDownloadL()"));
+
+    //
+    //  Retrieve the download id from the message
+    //
+    TInt downloadId = *aCmd.Value<TInt>( KMPXCommandPlaybackPDTransactionID );
+    TPtrC fileName( aCmd.ValueText( KMPXMediaVideoPlaybackFileName ) );
+    iMovePdlFile = *aCmd.Value<TInt>( KMPXMediaVideoMovePdlFile );
+
+    MPX_DEBUG(_L("CMPXVideoDlMgrIf::ConnectToDownloadL(%S, %d)"), &fileName, downloadId );
+
+    if ( iClipName )
+    {
+        delete iClipName;
+        iClipName = NULL;
+    }
+
+    iClipName = fileName.AllocL();
+
+    //
+    //  A new download id has been sent.  Reset member variables
+    //
+    iMoveNeeded       = EFalse;
+    iCurrentDl        = NULL;
+    iDownloadState    = EPbDlStateDownloadCompleted;
+    iDlId             = downloadId;
+    iPlayerOpened     = EFalse;
+    iDlTotalSize      = 0;
+    iDownloadProgress = 0;
+    iCodDownload      = EFalse;
+
+    if ( iDlMgrConnected )
+    {
+        iDlMgr.Close();
+        iDlMgrConnected = EFalse;
+    }
+
+    if ( iDlId != KErrNotFound )
+    {
+        const TUid KUidLWPlayer = { 0x102824CD };
+
+        //
+        //  Connect to the Download Manager
+        //
+        iDlMgr.ConnectL( KUidLWPlayer, *this, EFalse );
+        iDlMgrConnected = ETrue;
+
+        //
+        //  Attach to the download id
+        //
+        RHttpDownload& newDownload = iDlMgr.AttachToDownloadL( iDlId );
+
+        //
+        //  Update the members with the current download info
+        //
+        iCurrentDl = &newDownload;
+
+        //
+        //  Set the progressive download attribute on the download
+        //
+        iCurrentDl->SetBoolAttribute( EDlAttrProgressive, ETrue );
+
+        iCurrentDl->SetBoolAttribute( EDlAttrSilent, EFalse );
+
+        TInt32 activeDownload( 0 );
+        iCurrentDl->GetIntAttribute( EDlAttrActiveDownload, activeDownload );
+        iCurrentDl->SetIntAttribute( EDlAttrActivePlayedDownload, activeDownload );
+
+        //
+        //  Set the Local File attribute
+        //
+        iCurrentDl->SetStringAttribute( EDlAttrLocalFileName, iClipName->Des() );
+
+        TInt32 dlState;
+
+        //
+        //  Get the state, downloaded and total size of the download and save it
+        //
+        iCurrentDl->GetIntAttribute( EDlAttrLength, iDlTotalSize );
+        iCurrentDl->GetIntAttribute( EDlAttrDownloadedSize, iDownloadProgress );
+        iCurrentDl->GetIntAttribute( EDlAttrState, dlState );
+
+        MPX_DEBUG(_L("   dlSize = %d, currentSize = %d, state = %d"),
+            iDlTotalSize, iDownloadProgress, dlState );
+
+        ConvertDMgrStatetoMpxState( dlState );
+
+        if ( iDownloadState == EPbDlStateDownloadCompleted )
+        {
+            HandleDownloadComplete();
+        }
+
+        MPX_DEBUG(_L("CMPXVideoDlMgrIf::ConnectToDownloadL() Download State = %d Total Size=%d"),
+            iDownloadState, iDlTotalSize);
+    }
+}
+
+void
+CMPXVideoDlMgrIf::HandleDMgrEventL( RHttpDownload& aDownload, THttpDownloadEvent aEvent )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoDlMgrIf::HandleDMgrEventL()"),
+                   _L("iDownloadState = %d iProgressState = %d"),
+                    aEvent.iDownloadState, aEvent.iProgressState );
+
+    TMPXPlaybackPdDownloadState prevDownloadState = iDownloadState;
+
+    if ( &aDownload == iCurrentDl )
+    {
+        switch ( aEvent.iDownloadState )
+        {
+            case EHttpDlInprogress:
+            {
+                iDownloadState = EPbDlStateDownloading;
+
+                switch ( aEvent.iProgressState )
+                {
+                    case EHttpProgResponseBodyReceived:
+                    {
+                        if ( ! iUpdateDownload->IsActive() )
+                        {
+                            iUpdateDownload->Start(
+                                    TCallBack( CMPXVideoDlMgrIf::UpdateDownloadProgress, this ) );
+                        }
+                        break;
+                    }
+                    case EHttpProgCodLoadEnd:
+                    {
+                        //
+                        //  Set the member variable identifying this
+                        //  as a COD download and handle the completion
+                        //  of the download
+                        //
+                        iCodDownload = ETrue;
+
+                        HandleDownloadComplete();
+
+                        break;
+                    }
+                    case EHttpProgMovingContentFile:
+                    {
+                        //
+                        //   Moving Started
+                        //
+                        MPX_DEBUG( _L("    Moving of file started"));
+                        break;
+                    }
+                    case EHttpProgContentFileMoved:
+                    case EHttpProgContentFileMovedAndDestFNChanged:
+                    {
+                        //
+                        //  Move has completed, check error status
+                        //
+                        CheckForMoveError();
+
+                        break;
+                    }
+                }
+
+                break;
+            }
+            case EHttpDlPaused:
+            {
+                iDownloadState = EPbDlStateDownloadPaused;
+                break;
+            }
+            case EHttpDlCompleted:
+            {
+                iDownloadState = EPbDlStateDownloadCompleted;
+
+                switch ( aEvent.iProgressState )
+                {
+                    case EHttpProgNone:
+                    {
+                        //
+                        //  Ignore this event since COD downloads send this
+                        //  event after we have already moved the file.
+                        //
+                        if ( ! iCodDownload )
+                        {
+                            HandleDownloadComplete();
+                        }
+
+                        break;
+                    }
+                    case EHttpProgMovingContentFile:
+                    {
+                        //
+                        //   Moving Started
+                        //
+                        MPX_DEBUG( _L("    Moving of file started"));
+                        break;
+                    }
+                    case EHttpProgContentFileMoved:
+                    case EHttpProgContentFileMovedAndDestFNChanged:
+                    {
+                        //
+                        //  Move has completed, check error status
+                        //
+                        CheckForMoveError();
+
+                        break;
+                    }
+                }
+
+                break;
+            }
+            case EHttpDlFailed:
+            case EHttpDlMediaRemoved:
+            case EHttpDlDeleted:
+            case EHttpDlDeleting:
+            {
+                iDownloadState = EPbDlStateDownloadCanceled;
+
+                //
+                //  Disconnect from the current download and Download Manager
+                //
+                iCurrentDl = NULL;
+                iDlId = 0;
+
+                break;
+            }
+            case EHttpDlMoved:
+            case EHttpDlCreated:
+            case EHttpContentTypeReceived:
+            case EHttpDlMediaInserted:
+            case EHttpDlPausable:
+            case EHttpDlNonPausable:
+            case EHttpDlAlreadyRunning:
+            default:
+                break;
+        };
+
+        if ( prevDownloadState != iDownloadState )
+        {
+            //
+            //  Signal the view that the download state has changed
+            //
+            iController->iMPXPluginObs->HandlePluginEvent(
+                MMPXPlaybackPluginObserver::EPDownloadStateChanged,
+                iDownloadState,
+                KErrNone );
+        }
+    }
+    else
+    {
+        MPX_DEBUG(_L("CMPXVideoDlMgrIf::HandleDMgrEventL() Message for different Download"));
+    }
+}
+
+void
+CMPXVideoDlMgrIf::DoUpdateDownloadProgress()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoDlMgrIf::DoUpdateDownloadProgress()"));
+
+    //
+    //  Check if the current download is valid before updating
+    //
+    if ( iCurrentDl )
+    {
+        iCurrentDl->GetIntAttribute( EDlAttrDownloadedSize, iDownloadProgress );
+
+        MPX_DEBUG(_L("   dlSize = %d, currentSize = %d"), iDlTotalSize, iDownloadProgress );
+
+        //
+        //  Update the size once the controller is initialized
+        //
+        if ( iController->iState->IsInitialized() )
+        {
+            iController->iMPXPluginObs->HandlePluginEvent(
+                MMPXPlaybackPluginObserver::EPDownloadPositionChanged,
+                iDownloadProgress,
+                KErrNone );
+
+            //
+            //  Update the playback engine with the current downloaded size
+            //  Helix needs this to handle reading past current file size
+            //
+            HandleCustomCommand( EMMFROPControllerSetDownloadSize, iDownloadProgress );
+        }
+    }
+}
+
+void
+CMPXVideoDlMgrIf::DoHandleOpenComplete()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoDlMgrIf::DoHandleOpenComplete()"));
+
+    if ( iCurrentDl )
+    {
+        //
+        //  Set the player opened flag so messages can be sent to the
+        //  video playback engine
+        //
+        iPlayerOpened = ETrue;
+
+        //
+        //  Do not enable progressive download on the playback engine
+        //  if the download isn't active
+        //
+        if ( iDownloadState == EPbDlStateDownloading || iDownloadState == EPbDlStateDownloadPaused )
+        {
+            //
+            //  Send the download id to Helix to trigger progressive
+            //  download mode for the Helix engine
+            //
+            TInt error = HandleCustomCommand( EMMFROPControllerSetDownloadID, iDlId );
+
+            if ( error == KErrNone )
+            {
+                iCurrentDl->GetIntAttribute( EDlAttrDownloadedSize, iDownloadProgress );
+
+                //
+                //  Update Helix with the current downloaded size
+                //  Helix needs this to handle reading past current file size
+                //
+                error = HandleCustomCommand( EMMFROPControllerSetDownloadSize, iDownloadProgress );
+            }
+        }
+    }
+}
+
+void
+CMPXVideoDlMgrIf::CheckForMoveError()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoDlMgrIf::CheckForMoveError()"));
+
+    TInt32 errorId = KErrNone;
+    TInt32 globalErrorId = KErrNone;
+
+    iCurrentDl->GetIntAttribute( EDlAttrErrorId, errorId );
+    iCurrentDl->GetIntAttribute( EDlAttrGlobalErrorId, globalErrorId );
+
+    MPX_DEBUG(_L("    Moving complete - error = %d global error = %d"), errorId, globalErrorId );
+
+    //
+    //  Move Complete
+    //
+    iMoveNeeded = EFalse;
+    iDownloadState = EPbDlStateNotDownloading;
+}
+
+TInt CMPXVideoDlMgrIf::HandleCustomCommand( TUint32 aCommand, TUint32 aCmdValue )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoDlMgrIf::HandleCustomCommand()"),
+                   _L(" aCommand = %d, aCmdValue = %d)"), aCommand, aCmdValue );
+
+    TUint result = KErrNone;
+
+    //
+    //  Block custom commands for progressive download if the player has not been opened
+    //
+    if ( iPlayerOpened )
+    {
+        TPckgBuf<TUint> cmdValue( aCmdValue );
+
+        const TMMFMessageDestinationPckg dest( KUidInterfaceMMFROPController );
+        TPckgBuf<TMMFMessageDestination> message( dest );
+
+        result = iController->iPlayer->CustomCommandSync( dest, aCommand, cmdValue, KNullDesC8 );
+
+        MPX_DEBUG(_L("    Engine CustomCommand retCode = %d"), result);
+    }
+
+    return result;
+}
+
+void CMPXVideoDlMgrIf::HandleDownloadComplete()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoDlMgrIf::HandleDownloadComplete()"));
+
+    iDownloadState = EPbDlStateDownloadCompleted;
+
+    //
+    //  Since the download is complete, download should be moved
+    //
+    if ( iMovePdlFile )
+    {
+        iMoveNeeded = ETrue;
+    }
+    else
+    {
+        //
+        //  Disconnect from the current download since move is not required
+        //
+        iCurrentDl = NULL;
+        iDlId = 0;
+    }
+
+    //
+    //  If the update CIdle object is active, cancel it since the download
+    //  is complete and we are updating the values.
+    //
+    if ( iUpdateDownload->IsActive() )
+    {
+        iUpdateDownload->Cancel();
+    }
+
+    //
+    //  Notify the player and the UI view that the download is complete
+    //
+    HandleCustomCommand( EMMFROPControllerSetDownloadSize, iDlTotalSize );
+    HandleCustomCommand( EMMFROPControllerSetDownloadComplete, ETrue );
+}
+
+// -------------------------------------------------------------------------------------------------
+//  CMPXVideoDlMgrIf::UpdateDownloadProgress
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMPXVideoDlMgrIf::UpdateDownloadProgress( TAny* aPtr )
+{
+    MPX_DEBUG(_L("CMPXVideoDlMgrIf::UpdateDownloadProgress()"));
+
+    static_cast<CMPXVideoDlMgrIf*>(aPtr)->DoUpdateDownloadProgress();
+
+    return KErrNone;
+}
+
+// -------------------------------------------------------------------------------------------------
+//  CMPXVideoDlMgrIf::GetPdlStatusL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoDlMgrIf::GetPdlStatusL( CMPXCommand& aCmd )
+{
+    MPX_DEBUG(_L("CMPXVideoDlMgrIf::GetPdlStatusL()"));
+
+    if ( iCurrentDl )
+    {
+        iCurrentDl->GetIntAttribute( EDlAttrDownloadedSize, iDownloadProgress );
+    }
+
+    aCmd.SetTObjectValueL<TMPXPlaybackPdDownloadState>( KMPXCommandPlaybackPDState,
+                                                        iDownloadState );
+
+    //
+    //  If download is complete, ensure that the size is 100%
+    //
+    if ( iDownloadState == EPbDlStateDownloadCompleted )
+    {
+        aCmd.SetTObjectValueL<TInt>( KMPXCommandPlaybackPDDownloadedBytes, iDlTotalSize );
+    }
+    else
+    {
+        aCmd.SetTObjectValueL<TInt>( KMPXCommandPlaybackPDDownloadedBytes, iDownloadProgress );
+    }
+
+    aCmd.SetTObjectValueL<TInt>( KMPXCommandPlaybackPDTotalBytes, iDlTotalSize );
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoDlMgrIf::CalculateDestinationFileNameL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoDlMgrIf::CalculateDestinationFileNameL()
+{
+    MPX_DEBUG(_L("CMPXVideoDlMgrIf::CalculateDestinationFileNameL()"));
+
+    //
+    //  We will try to move the file to the video path of the same
+    //  drive where the download manager has saved it
+    //
+    TParsePtrC origFilePath( iClipName->Des() );
+
+#ifdef RD_MULTIPLE_DRIVE
+    DriveInfo::TDriveArray driveArray;
+    TInt drive = 0;
+
+    RFs::CharToDrive( origFilePath.Drive()[0], drive );
+
+    User::LeaveIfError( PathInfo::GetFullPath( iDestinationFileName, drive, PathInfo::EVideosPath ) );
+#else  //RD_MULTIPLE_DRIVE
+    TParsePtrC phoneRoot( PathInfo::PhoneMemoryRootPath() );
+    TParsePtrC mmcRoot( PathInfo::MemoryCardRootPath() );
+
+    if ( origFilePath.Drive() == phoneRoot.Drive() )
+    {
+        iDestinationFileName = phoneRoot.DriveAndPath();
+    }
+    else
+    {
+        iDestinationFileName = mmcRoot.DriveAndPath();
+    }
+
+    iDestinationFileName += PathInfo::VideosPath();
+#endif  //RD_MULTIPLE_DRIVE
+
+    iDestinationFileName += origFilePath.NameAndExt();
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoDlMgrIf::HandleClose
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoDlMgrIf::HandleClose()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoDlMgrIf::HandleClose()"));
+
+    //
+    //  Before we move any files, the controller in uninitialized.
+    //  Set the player opened to false
+    //
+    iPlayerOpened  = EFalse;
+
+    TInt errorCode = KErrNone;
+
+    //
+    //  Download may have already been moved.  Check for a current download.
+    //
+    if ( iCurrentDl )
+    {
+        //
+        //  Check if the plugin should move the file and a move is needed
+        //
+        if ( iMoveNeeded )
+        {
+            MPX_TRAPD(err, CalculateDestinationFileNameL());
+
+            if (err == KErrNone)
+            {
+                errorCode =
+                    iCurrentDl->SetStringAttribute( EDlAttrDestFilename, iDestinationFileName );
+
+                MPX_DEBUG(_L(
+                    "CMPXVideoDlMgrIf::MoveDownloadedFile() SetStringAtt err = %d"), errorCode );
+
+                if ( errorCode == KErrNone )
+                {
+                    errorCode = iCurrentDl->Move();
+                }
+
+                MPX_DEBUG(_L("CMPXVideoDlMgrIf::MoveDownloadedFile() Move err = %d"), errorCode );
+            }
+
+            MPX_DEBUG(_L("CMPXVideoDlMgrIf::MoveDownloadedFile() Calc Dest Filename err = %d"), err );
+        }
+        else
+        {
+            //
+            //  Move has been called but we have not completed downloading
+            //  the file.  We are going to clear the progressive download
+            //  flag and the current download variable
+            //
+            errorCode = iCurrentDl->SetBoolAttribute( EDlAttrProgressive, EFalse );
+            iCurrentDl = NULL;
+
+            MPX_DEBUG(_L(
+                "CMPXVideoDlMgrIf::MoveDownloadedFile() Removing PD attr retCode=%d"), errorCode);
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoDlMgrIf::GetDownloadRatio
+// -------------------------------------------------------------------------------------------------
+//
+TReal CMPXVideoDlMgrIf::GetDownloadRatio()
+{
+    TReal downloadRatio = 0.0;
+    
+    if ( iDownloadState == EPbDlStateDownloadCompleted )
+    {
+        downloadRatio = 100.0;
+    }
+    else
+    {
+        downloadRatio = (TReal)iDownloadProgress / (TReal)iDlTotalSize;
+    }
+    
+    MPX_DEBUG(_L("CMPXVideoDlMgrIf::GetDownloadRatio(%f)"), downloadRatio);
+    
+    return downloadRatio;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoDlMgrIf::IsDownloadPaused
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoDlMgrIf::IsDownloadPaused()
+{
+    TBool paused = ( iDownloadState == EPbDlStateDownloadPaused );
+    MPX_DEBUG(_L("CMPXVideoDlMgrIf::IsDownloadPaused(%d)"), paused);
+    return paused;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoDlMgrIf::ConvertDMgrStatetoMpxState
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoDlMgrIf::ConvertDMgrStatetoMpxState( TInt32 aDMgrState )
+{
+    MPX_DEBUG(_L("CMPXVideoDlMgrIf::ConvertDMgrStatetoMpxState(%d)"), aDMgrState);
+
+    switch ( aDMgrState )
+    {
+        case EHttpDlInprogress:
+        case EHttpDlCreated:
+        {
+            iDownloadState = EPbDlStateDownloading;
+            break;
+        }
+        case EHttpDlPaused:
+        case EHttpDlNonPausableNetworkLoss:
+        {
+            iDownloadState = EPbDlStateDownloadPaused;
+            break;
+        }
+        case EHttpDlCompleted:
+        {
+            iDownloadState = EPbDlStateDownloadCompleted;
+            break;
+        }
+        case EHttpDlFailed:
+        {
+            iDownloadState = EPbDlStateDownloadError;
+            break;
+        }
+        case EHttpDlDeleted:
+        case EHttpDlDeleting:
+        {
+            iDownloadState = EPbDlStateDownloadCanceled;
+            break;
+        }
+        case EHttpDlMoved:
+        case EHttpDlMediaRemoved:
+        case EHttpDlMediaInserted:
+        case EHttpDlPausable:
+        case EHttpDlNonPausable:
+        case EHttpDlAlreadyRunning:
+        case EHttpDlCancelTransaction:
+        default:
+        {
+            iDownloadState = EPbDlStateNotDownloading;
+            break;
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoDlMgrIf::UpdateDownloadSizeL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoDlMgrIf::UpdateDownloadSizeL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoDlMgrIf::UpdateDownloadSizeL()"));
+
+    if ( iController->iDrmHelper->IsProtectedL( iController->iFileHandle ) )
+    {
+        MPX_DEBUG(_L("CMPXVideoDlMgrIf::UpdateDownloadSizeL() download is DRM protected"));
+
+        ContentAccess::CContent* content =
+            ContentAccess::CContent::NewLC( iController->iFileHandle );
+
+        ContentAccess::CData* data = content->OpenContentL( ContentAccess::EPeek );
+
+        CleanupStack::PushL( data );
+
+        TInt drmSize;
+        data->DataSizeL( drmSize );
+
+        MPX_DEBUG(_L("CMPXVideoDlMgrIf::UpdateDownloadSizeL()    DlMgr Size = %d, DRM Size = %d"),
+            iDlTotalSize, drmSize );
+
+        iDlTotalSize = drmSize;
+
+        CleanupStack::PopAndDestroy( 2 );  // data & content
+    }
+}
+
+//  EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/src/mpxvideodrmhelper.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,174 @@
+/*
+* 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:   This class handles the DRM functions for the playback plugin
+*
+*/
+
+
+// Version : %version: 9 %
+
+
+#include <caf/data.h>
+#include <caf/caftypes.h>
+#include <caf/content.h>
+#include <Oma2Agent.h>
+
+#include "mpxvideodrmhelper.h"
+#include "mpxvideo_debug.h"
+
+CMpxVideoDrmHelper::CMpxVideoDrmHelper()
+{
+}
+
+CMpxVideoDrmHelper::~CMpxVideoDrmHelper()
+{
+    if ( iDrmUtility )
+    {
+        delete iDrmUtility;
+        iDrmUtility = NULL;
+    }
+}
+
+
+CMpxVideoDrmHelper* CMpxVideoDrmHelper::NewL()
+{
+    CMpxVideoDrmHelper* self = new( ELeave ) CMpxVideoDrmHelper();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+}
+
+void CMpxVideoDrmHelper::ConstructL()
+{
+    iDrmUtility = DRM::CDrmUtility::NewL();
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMpxVideoDrmHelper::IsProtectedL()
+//  ------------------------------------------------------------------------------------------------
+//
+TBool CMpxVideoDrmHelper::IsProtectedL( RFile& aFile )
+{
+    TBool drmProtected = EFalse;
+
+    if ( aFile.SubSessionHandle() )
+    {
+        drmProtected = iDrmUtility->IsProtectedL( aFile );
+    }
+
+    MPX_DEBUG(_L("CMpxVideoDrmHelper::IsProtectedL(%d)"), drmProtected);
+
+    return drmProtected;
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMpxVideoDrmHelper::GetDrmRightsStatus()
+//  ------------------------------------------------------------------------------------------------
+//
+TInt CMpxVideoDrmHelper::GetDrmRightsStatus( RFile& aFile )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoDrmHelper::GetDrmRightsStatus()"));
+
+    TInt drmError = KErrNone;
+    TBool drmProtected = EFalse;
+
+    MPX_TRAP( drmError, drmProtected = IsProtectedL(aFile ) );
+
+    if ( drmProtected && (drmError == KErrNone) )
+    {
+        ContentAccess::CData* data = NULL;
+
+        //
+        //  Check if rights exist for clip
+        //
+        MPX_TRAP( drmError,
+                  data = ContentAccess::CData::NewL( aFile,
+                                                     ContentAccess::KDefaultContentObject,
+                                                     ContentAccess::EPlay ) );
+
+        if ( drmError == KErrNone )
+        {
+            drmError = data->EvaluateIntent( ContentAccess::EPlay );
+
+            delete data;
+        }
+    }
+
+    MPX_DEBUG(_L("CMpxVideoDrmHelper::GetDrmRightsStatus() drmError = %d"), drmError);
+
+    return drmError;
+}
+
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+//  ------------------------------------------------------------------------------------------------
+//    CMpxVideoDrmHelper::IsProtected64L()
+//  ------------------------------------------------------------------------------------------------
+//
+TBool CMpxVideoDrmHelper::IsProtected64L( RFile64& aFile )
+{
+    TBool drmProtected = EFalse;
+
+    if ( aFile.SubSessionHandle() )
+    {
+       drmProtected = iDrmUtility->IsProtectedL( aFile );
+    }
+
+    MPX_DEBUG(_L("CMpxVideoDrmHelper::IsProtected64L(%d)"), drmProtected);
+
+    return drmProtected;
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMpxVideoDrmHelper::GetDrmRightsStatus64()
+//  ------------------------------------------------------------------------------------------------
+//
+TInt CMpxVideoDrmHelper::GetDrmRightsStatus64( RFile64& aFile )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoDrmHelper::GetDrmRightsStatus64()"));
+
+    TInt drmError = KErrNone;
+    TBool drmProtected = EFalse;
+
+    MPX_TRAP( drmError, drmProtected = IsProtected64L( aFile ) );
+
+    if ( drmProtected && (drmError == KErrNone) )
+    {
+        ContentAccess::CData* data = NULL;
+
+        //
+        //  Check if rights exist for clip
+        //
+        MPX_TRAP( drmError,
+                  data = ContentAccess::CData::NewL( aFile,
+                                                     ContentAccess::KDefaultContentObject,
+                                                     ContentAccess::EPlay ) );
+
+        if ( drmError == KErrNone )
+        {
+            drmError = data->EvaluateIntent( ContentAccess::EPlay );
+
+            delete data;
+        }
+    }
+
+    MPX_DEBUG(_L("CMpxVideoDrmHelper::GetDrmRightsStatus64() drmError = %d"), drmError);
+
+    return drmError;
+}
+
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+//  EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/src/mpxvideofiledetails.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,133 @@
+/*
+* 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:  class for MPX Video File Details
+*
+*/
+
+// Version : %version: 11 %
+
+
+
+//
+//  INCLUDE FILES
+//
+#include "mpxvideo_debug.h"
+#include "mpxvideofiledetails.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+CMPXVideoFileDetails*
+CMPXVideoFileDetails::NewL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoFileDetails::NewL()"));
+
+    CMPXVideoFileDetails* p = new (ELeave) CMPXVideoFileDetails();
+    CleanupStack::PushL(p);
+    p->ConstructL();
+    CleanupStack::Pop(p);
+    return p;
+}
+
+CMPXVideoFileDetails::~CMPXVideoFileDetails()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoFileDetails::~CMPXVideoFileDetails()"));
+
+    ClearFileDetails();
+}
+
+void
+CMPXVideoFileDetails::ConstructL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoFileDetails::ConstructL()"));
+    iSeekable = ETrue;
+    iPausableStream = ETrue;
+}
+
+void
+CMPXVideoFileDetails::ClearFileDetails()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoFileDetails::ClearFileDetails()"));
+
+    if ( iMimeType )
+    {
+        delete iMimeType;
+        iMimeType = NULL;
+    }
+
+    if ( iTitle )
+    {
+        delete iTitle;
+        iTitle = NULL;
+    }
+
+    if ( iArtist )
+    {
+        delete iArtist;
+        iArtist = NULL;
+    }
+
+    if ( iClipName )
+    {
+        delete iClipName;
+        iClipName = NULL;
+    }
+
+    if ( iDescription )
+    {
+        delete iDescription;
+        iDescription = NULL;
+    }
+
+    if ( iLocation )
+    {
+        delete iLocation;
+        iLocation = NULL;
+    }
+
+    if ( iCopyright )
+    {
+        delete iCopyright;
+        iCopyright = NULL;
+    }
+
+    if ( iLanguage )
+    {
+        delete iLanguage;
+        iLanguage = NULL;
+    }
+    
+    if ( iKeywords )
+    {
+        delete iKeywords;
+        iKeywords = NULL;
+    }
+        
+    iResolutionWidth = 0;
+    iResolutionHeight = 0;
+    iMaxVolume = 0;
+	iBitRate = 0;
+    iSeekable = ETrue;
+    iPausableStream = ETrue;
+    iLiveStream = 0;
+    iAudioEnabled = 0;
+    iVideoEnabled = 0;
+    iDrmProtected = EFalse;
+    iFourCCCode = 0;
+
+    iDuration = 0;
+    iCreationTime = 0;
+    iModificationTime = 0;
+}
+
+//  EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/src/mpxvideohelixplayback.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,431 @@
+/*
+* 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:  This class plays local video file
+ *
+*/
+
+// Version : %version: 15 %
+
+
+//
+//  INCLUDE FILES
+//
+#include <apgcli.h>
+#include <e32cmn.h>
+#include <mpxcenrepwatcher.h>
+#include <mpxcenrepobserver.h>
+#include <mpxmediageneraldefs.h>
+#include <mpxcommandgeneraldefs.h>
+#include <mpxmessagegeneraldefs.h>
+#include <mpxplaybackcommanddefs.h>
+#include <mmf/server/mmffile.h>
+
+#include "mpxvideohelixplayback.h"
+#include "mpxvideoprivatecrkeys.h"
+#include <mpxvideoplaybackdefs.h>
+
+//
+//  CONSTANTS
+//
+const TUid KLocalPlaybackUid = { 0x10282551 };
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+//  ----------------------------------------------------------------------------
+//    Two-phased constructor.
+//  ----------------------------------------------------------------------------
+//
+CMPXVideoHelixPlayback* CMPXVideoHelixPlayback::NewL( TAny* /*aInitParams*/ )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoHelixPlayback::NewL()"));
+
+    CMPXVideoHelixPlayback* p = new (ELeave) CMPXVideoHelixPlayback();
+    CleanupStack::PushL(p);
+    p->ConstructL();
+    CleanupStack::Pop(p);
+    return p;
+}
+
+//  ----------------------------------------------------------------------------
+//    Symbian 2nd phase constructor can leave.
+//  ----------------------------------------------------------------------------
+//
+void CMPXVideoHelixPlayback::ConstructL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoHelixPlayback::ConstructL()"));
+
+    iVideoPlaybackCtlr = CMPXVideoPlaybackController::NewL( *iObs );
+
+    User::LeaveIfError( iFs.Connect() );
+    iFs.ShareProtected();
+}
+
+//  ----------------------------------------------------------------------------
+//    C++ constructor
+//  ----------------------------------------------------------------------------
+//
+CMPXVideoHelixPlayback::CMPXVideoHelixPlayback()
+{
+    MPX_DEBUG(_L("CMPXVideoHelixPlayback::CMPXVideoHelixPlayback()"));
+}
+
+//  ----------------------------------------------------------------------------
+//    Destructor
+//  ----------------------------------------------------------------------------
+//
+CMPXVideoHelixPlayback::~CMPXVideoHelixPlayback()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoHelixPlayback::~CMPXVideoHelixPlayback"));
+
+    iFs.Close();
+
+    if ( iVideoPlaybackCtlr )
+    {
+        delete iVideoPlaybackCtlr;
+        iVideoPlaybackCtlr = NULL;
+    }
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    Sets the file name and file handle
+//  ------------------------------------------------------------------------------------------------
+//
+void CMPXVideoHelixPlayback::OpenFileHandleL( const TDesC& aUri, RFile& aFile )
+{
+    MPX_ENTER_EXIT(
+            _L("CMPXVideoHelixPlayback::OpenFileHandleL( RFile )"),
+            _L("aSong %S"), &aUri );
+
+    if ( aFile.SubSessionHandle() )
+    {
+        aFile.Close();
+    }
+
+    TInt err = aFile.Open( iFs, aUri, EFileRead | EFileShareReadersOrWriters );
+
+    //
+    //  Check if RFile64 is needed
+    //
+    if ( err == KErrTooBig )
+    {
+        User::Leave( KErrTooBig );
+    }
+    else if ( err != KErrNone )
+    {
+        CheckForStreamingUrlL( aUri );
+    }
+}
+
+//  ----------------------------------------------------------------------------
+//    Initializes a clip for playback from a file name
+//  ----------------------------------------------------------------------------
+//
+void CMPXVideoHelixPlayback::InitialiseL( const TDesC& aSong )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoHelixPlayback::InitialiseL()"),
+                  _L("aSong %S"), &aSong );
+
+    InitialiseWithPositionL( aSong );
+}
+
+
+//  ----------------------------------------------------------------------------
+//    Initializes a clip for playback from a file name with position
+//  ----------------------------------------------------------------------------
+//
+void CMPXVideoHelixPlayback::InitialiseWithPositionL( const TDesC& aSong, TInt aPosition )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoHelixPlayback::InitialiseL()"),
+                   _L("aSong %S, aPosition %d"), &aSong, aPosition );
+
+    RFile fileHandle;
+
+    CleanupClosePushL( fileHandle );
+
+    MPX_TRAPD( err, OpenFileHandleL( aSong, fileHandle ));
+
+    if ( err == KErrNone )
+    {
+        iVideoPlaybackCtlr->OpenFileL( aSong, fileHandle, aPosition );
+    }
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+    else if ( err == KErrTooBig )
+    {
+        //
+        // use RFile64 handle
+        //
+        RFile64 fileHandle64;
+        CleanupClosePushL( fileHandle64 );
+
+        MPX_TRAPD( err, OpenFileHandle64L( aSong, fileHandle64 ));
+
+        if ( err != KErrNone )
+        {
+            // Handle error
+            iVideoPlaybackCtlr->HandleError( err );
+        }
+        else
+        {
+                iVideoPlaybackCtlr->OpenFile64L( aSong, fileHandle64, aPosition );
+        }
+
+        CleanupStack::PopAndDestroy(); // fileHandle64
+    }
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+    else
+    {
+        // Handle error
+        iVideoPlaybackCtlr->HandleError( err );
+    }
+
+    CleanupStack::PopAndDestroy(); // fileHandle
+}
+
+//  ----------------------------------------------------------------------------
+//    Initializes a clip for playback from a file handle
+//  ----------------------------------------------------------------------------
+//
+void CMPXVideoHelixPlayback::InitialiseL( RFile& aSong )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoHelixPlayback::InitialiseL( RFile )"));
+
+    InitialiseWithPositionL( aSong );
+}
+
+//  ----------------------------------------------------------------------------
+//    Initializes a clip for playback from a file handle with position
+//  ----------------------------------------------------------------------------
+//
+void CMPXVideoHelixPlayback::InitialiseWithPositionL( RFile& aSong, TInt aPosition )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoHelixPlayback::InitialiseWithPositionL( RFile )"),
+                   _L("aPosition %d"), aPosition );
+
+    TFileName filename;
+    aSong.FullName( filename );
+
+    iVideoPlaybackCtlr->OpenFileL( filename, aSong, aPosition );
+}
+
+
+//  ----------------------------------------------------------------------------
+//    Initializes a clip for playback from a file name
+//  ----------------------------------------------------------------------------
+//
+void CMPXVideoHelixPlayback::InitStreamingL( const TDesC& aUri,
+                                             const TDesC8& /*aType*/,
+                                             TInt aAccessPoint,
+                                             TInt aPosition )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoHelixPlayback::InitStreamingL()"),
+                   _L("aUri %S, aAccessPoint %d, aPosition %d"), &aUri, aAccessPoint, aPosition );
+
+    RFile fileHandle;
+
+    CleanupClosePushL( fileHandle );
+
+    MPX_TRAPD( err, OpenFileHandleL( aUri, fileHandle ));
+
+    if ( err != KErrNone )
+    {
+        // Handle error
+        iVideoPlaybackCtlr->HandleError( err );
+    }
+    else
+    {
+        iVideoPlaybackCtlr->OpenFileL( aUri, fileHandle, aPosition, aAccessPoint );
+    }
+
+    CleanupStack::PopAndDestroy();
+}
+
+//  ----------------------------------------------------------------------------
+//    Initializes a clip for playback from a file handle
+//  ----------------------------------------------------------------------------
+//
+void CMPXVideoHelixPlayback::InitStreamingL( RFile& aFile, TInt aAccessPoint, TInt aPosition  )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoHelixPlayback::InitStreamingL( RFile )"),
+                   _L("aAccessPoint = %d, aPosition = %d"), aAccessPoint, aPosition );
+
+    TFileName filename;
+    aFile.FullName( filename );
+
+    iVideoPlaybackCtlr->OpenFileL( filename, aFile, aPosition, aAccessPoint );
+}
+
+//  ----------------------------------------------------------------------------
+//    Executes a command on the selected song
+//  ----------------------------------------------------------------------------
+//
+void CMPXVideoHelixPlayback::CommandL( CMPXCommand& aCmd )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoHelixPlayback::CommandL() - CMPXCommand"));
+
+    iVideoPlaybackCtlr->HandleCommandL( aCmd );
+}
+
+
+//  ----------------------------------------------------------------------------
+//    Executes a command on the selected song
+//  ----------------------------------------------------------------------------
+//
+void CMPXVideoHelixPlayback::CommandL(TMPXPlaybackCommand aCmd, TInt aData)
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoHelixPlayback::CommandL() - TMPXPlaybackCommand"));
+
+    iVideoPlaybackCtlr->HandleCommandL(aCmd, aData);
+}
+
+
+//  ----------------------------------------------------------------------------
+//    Sets a property of the plugin
+//  ----------------------------------------------------------------------------
+//
+void CMPXVideoHelixPlayback::SetL( TMPXPlaybackProperty aProperty, TInt aValue )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoHelixPlayback::SetL()"));
+
+    // Route the SetL() to VideoPlaybackController
+    iVideoPlaybackCtlr->SetPropertyL(aProperty, aValue);
+}
+
+//  ----------------------------------------------------------------------------
+//    Gets a property of the plugin (async)
+//  ----------------------------------------------------------------------------
+//
+void CMPXVideoHelixPlayback::PropertyL( TMPXPlaybackProperty aProperty ) const
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoHelixPlayback::PropertyL()"));
+
+    // Route the PropertyL() to VideoPlaybackController
+    iVideoPlaybackCtlr->GetPropertyL( aProperty );
+}
+
+//  ----------------------------------------------------------------------------
+//    Gets a list of sub players, UPnP only
+//  ----------------------------------------------------------------------------
+//
+void CMPXVideoHelixPlayback::SubPlayerNamesL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoHelixPlayback::SubPlayerNamesL()"));
+    iObs->HandleSubPlayerNames( KLocalPlaybackUid, NULL, ETrue, KErrNone );
+}
+
+//  ----------------------------------------------------------------------------
+//    Select a sub player
+//  ----------------------------------------------------------------------------
+//
+void CMPXVideoHelixPlayback::SelectSubPlayerL( TInt /*aIndex*/ )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoHelixPlayback::SelectSubPlayerL()"));
+    User::Leave( KErrNotSupported );
+}
+
+//  ----------------------------------------------------------------------------
+//    Gets media properties
+//  ----------------------------------------------------------------------------
+//
+void CMPXVideoHelixPlayback::MediaL( const TArray<TMPXAttribute>& aAttrs )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoHelixPlayback::MediaL()"));
+    iVideoPlaybackCtlr->SendMediaL( aAttrs );
+}
+
+//  ----------------------------------------------------------------------------
+//    Cancel request
+//  ----------------------------------------------------------------------------
+//
+void CMPXVideoHelixPlayback::CancelRequest()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoHelixPlayback::CancelRequest()"));
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoHelixPlayback::CheckForStreamingUrlL()
+//  ------------------------------------------------------------------------------------------------
+//
+void CMPXVideoHelixPlayback::CheckForStreamingUrlL( const TDesC& aUri )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoHelixPlayback::CMPXVideoHelixPlayback::CheckForStreamingUrlL()"));
+
+    CMediaRecognizer* recognizer = CMediaRecognizer::NewL();
+    CleanupStack::PushL( recognizer );
+
+    if ( ! recognizer->IsValidStreamingPrefix( aUri ) )
+    {
+        User::LeaveIfError( KErrNotFound );
+    }
+
+    CleanupStack::PopAndDestroy( recognizer );
+}
+
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+//  ------------------------------------------------------------------------------------------------
+//    Sets the file name and 64-bit file handle
+//  ------------------------------------------------------------------------------------------------
+//
+void CMPXVideoHelixPlayback::OpenFileHandle64L( const TDesC& aUri, RFile64& aFile )
+{
+    MPX_ENTER_EXIT(
+            _L("CMPXVideoHelixPlayback::OpenFileHandle64L( RFile64 )"),
+            _L("aSong %S"), &aUri );
+
+    if ( aFile.SubSessionHandle() )
+    {
+        aFile.Close();
+    }
+
+    TInt err = aFile.Open( iFs, aUri, EFileRead | EFileShareReadersOrWriters );
+
+    if ( err != KErrNone )
+    {
+        CheckForStreamingUrlL( aUri );
+    }
+}
+
+//  ----------------------------------------------------------------------------
+//    Initializes a clip for playback from a 64-bit file handle
+//  ----------------------------------------------------------------------------
+//
+void CMPXVideoHelixPlayback::Initialise64L( RFile64& aSong, TInt aPosition )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoHelixPlayback::Initialise64L( RFile64 )"),
+                   _L("aPosition %d"), aPosition );
+    TFileName filename;
+    aSong.FullName( filename );
+
+    iVideoPlaybackCtlr->OpenFile64L( filename, aSong, aPosition );
+}
+
+//  ----------------------------------------------------------------------------
+//    Initializes a clip for playback from a 64-bit file handle
+//  ----------------------------------------------------------------------------
+//
+void CMPXVideoHelixPlayback::InitStreaming64L( RFile64& aFile, TInt aAccessPoint, TInt aPosition )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoHelixPlayback::InitStreaming64L( RFile64 )"),
+                   _L("aAccessPoint = %d, aPosition %d"), aAccessPoint, aPosition );
+
+    TFileName filename;
+    aFile.FullName( filename );
+
+    iVideoPlaybackCtlr->OpenFile64L( filename, aFile, aPosition, aAccessPoint );
+}
+
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/src/mpxvideohelixplaybackproxy.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,48 @@
+/*
+* 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:  Standard proxy of the ECOM plugin
+ *
+*/
+
+// Version : %version: 3 %
+
+
+
+#include <implementationproxy.h>
+#include "mpxvideohelixplayback.h"
+
+#if ( ! defined IMPLEMENTATION_PROXY_ENTRY )
+typedef TAny* TProxyNewLPtr;
+#define IMPLEMENTATION_PROXY_ENTRY(aUid,aFuncPtr) \
+            { {aUid}, (TProxyNewLPtr)(aFuncPtr) }
+#endif
+
+// ----------------------------------------------------------------------------
+// The list of implementations
+// ----------------------------------------------------------------------------
+//
+const TImplementationProxy ImplementationTable[] = 
+    { IMPLEMENTATION_PROXY_ENTRY( 0x10282551, CMPXVideoHelixPlayback::NewL ) };
+
+// ----------------------------------------------------------------------------
+// The proxy of implementations
+// ----------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+{
+    aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+    return ImplementationTable;
+}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/src/mpxvideoplaybackcontroller.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,2574 @@
+/*
+* 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:  This class plays local video file
+ *
+*/
+
+
+// Version : %version: 66 %
+
+
+//
+//  INCLUDE FILES
+//
+#include <eikenv.h>
+#include <mpxcenrepobserver.h>
+#include <mpxcenrepwatcher.h>
+#include <mpxmediageneraldefs.h>
+#include <mpxcommandgeneraldefs.h>
+#include <mpxmessagegeneraldefs.h>
+#include <mpxmediageneralextdefs.h>
+#include <mpxplaybackcommanddefs.h>
+#include <mpxplaybackpluginobserver.h>
+#include <mpxplaybackplugin.h>
+#include <AudioPreference.h>
+#include <mpxplaybackplugin.h>
+
+#include <coreapplicationuisdomainpskeys.h>
+#include <ctsydomainpskeys.h>
+#include <mmf/common/mmferrors.h>
+
+#include <e32std.h>
+#include <devsoundif.h>
+#include <avkondomainpskeys.h>
+#include <hwrmlight.h>
+#include <centralrepository.h>  // For display timeout setting
+#include <hwrmlightdomaincrkeys.h>
+
+#include "mpxvideoregion.h"
+#include "mpxvideoplaybackcontroller.h"
+#include "mpxvideoplaybackstate.h"
+#include "mpxvideoprivatecrkeys.h"
+#include "mpxvideohelixplayback.h"
+#include "mpxvideoseeker.h"
+#include "mpxvideoplayerutility.h"
+#include "mpxvideodrmhelper.h"
+#include <mpxvideoplaybackdefs.h>
+#include "mpxmediavideodefs.h"
+
+//
+//  CONSTANTS
+//
+#define KMAXMIMETYPELENGTH 256
+
+//
+//  Backlight Timeout in Micro Seconds
+//
+const TInt KMPXBackLightTimeOut = 3500000;
+const TInt KMPXInactivityTimeout  = 3 * KMPXBackLightTimeOut;
+const TInt KMPXMicroSecondsInASecond = 1000000;
+
+#define KOneKilobyte 1024
+
+_LIT( KTitle, "Title" );
+_LIT( KLiveStream, "LiveStream" );
+_LIT( KSeekable, "Seekable" );
+_LIT( KArtist, "Artist" );
+_LIT( KAuthor, "Author" );
+_LIT( KFormat, "MimeType" );
+_LIT( KTrue, "1" );
+_LIT( KFalse, "0" );
+_LIT (KMPStreamingPauseSupported, "StreamingPauseSupported");
+_LIT( KDescription, "Description" );
+_LIT( KAbstract, "Abstract" );
+_LIT( KLocation, "Location" );
+_LIT( KRightCopy, "Copyright" );
+_LIT( KLanguage, "Language" );
+_LIT( KKeywords, "Keywords" );
+_LIT( KCreated, "CreationTime" );
+_LIT( KLastModified, "ModificationTime" );
+
+
+// ============================ MEMBER FUNCTIONS ===================================================
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXVideoPlaybackController::NewL()
+//  ------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackController* CMPXVideoPlaybackController::NewL( MMPXPlaybackPluginObserver& aObs )
+{
+   CMPXVideoPlaybackController* self = new( ELeave ) CMPXVideoPlaybackController();
+   CleanupStack::PushL( self );
+   self->ConstructL( aObs );
+   CleanupStack::Pop();
+   return self;
+}
+
+//  ----------------------------------------------------------------------------
+//  CMPXVideoPlaybackController::CreatePreInitStatesL()
+//  ----------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackController::CreatePreInitStatesL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::CreatePreInitStatesL()"));
+
+    iNotIntialisedState = CMPXNotInitialisedState::NewL(this);
+    iInitialisingState  = CMPXInitialisingState::NewL(this);
+
+    // Set the default state to non initialised
+    iState              = iNotIntialisedState;
+}
+
+//  ----------------------------------------------------------------------------
+//  CMPXVideoPlaybackController::CreatePostInitStatesL()
+//  ----------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackController::CreatePostInitStatesL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::CreatePostInitStatesL()"));
+
+    //
+    //  Check if the post init states have been created
+    //
+    if ( ! iInitialisedState )
+    {
+        iInitialisedState   = CMPXInitialisedState::NewL(this);
+        iPlayingState       = CMPXPlayingState::NewL(this);
+        iBufferingState     = CMPXBufferingState::NewL(this);
+        iPausedState        = CMPXPausedState::NewL(this);
+        iSeekingState       = CMPXSeekingState::NewL(this);
+        iStoppedState       = CMPXStoppedState::NewL(this);
+    }
+}
+
+//  ----------------------------------------------------------------------------
+//  CMPXVideoPlaybackController::ConstructL
+//  Symbian 2nd phase constructor can leave.
+//  ----------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackController::ConstructL( MMPXPlaybackPluginObserver& aObs )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::ConstructL()"));
+
+    iMPXPluginObs = &aObs;
+    iAccessPointId = KUseDefaultIap;
+    iVideoSeeker = CMPXVideoSeeker::NewL( this );
+
+    iSeekable = ETrue;
+
+    InitVolumeWatchersL();
+
+    CreatePreInitStatesL();
+
+    iPlayer = CMpxVideoPlayerUtility::NewL( this );
+
+    iBackLightTimer = CPeriodic::NewL( CActive::EPriorityStandard );
+
+    iDrmHelper = CMpxVideoDrmHelper::NewL();
+
+    iCallDetector = CMPXCallDetector::NewL( this );
+    iCallDetector->RequestNotification();
+
+    iSavedPosition = 0;
+    iViewActivated  = EFalse;
+}
+
+//  ----------------------------------------------------------------------------
+//  CMPXVideoPlaybackController::CloseController()
+//  ----------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackController::CloseController()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::CloseController()"));
+    ChangeState( EMPXVideoNotInitialized );
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackController::OpenFileL()
+//  ------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackController::OpenFileL( const TDesC& aMediaFile,
+                                             RFile& aFile,
+                                             TInt aPosition,
+                                             TInt aAccessPointId )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::OpenFileL()"),
+                   _L("file = %S"), &aMediaFile );
+
+    TBool fileExists = EFalse;
+
+    ChangeState( EMPXVideoInitializing );
+
+    if ( iClipName )
+    {
+        delete iClipName;
+        iClipName = NULL;
+    }
+
+    iClipName = aMediaFile.AllocL();
+    iAccessPointId = aAccessPointId;
+
+    //
+    //  If file handle exists, duplicate it to the controller
+    //
+    if ( aFile.SubSessionHandle() )
+    {
+        if ( iFileHandle.SubSessionHandle() )
+        {
+            iFileHandle.Close();
+        }
+
+        User::LeaveIfError( iFileHandle.Duplicate( aFile ) );
+
+        fileExists = ETrue;
+    }
+
+    DetermineMediaTypeL();
+    SetPlaybackModeL();
+
+    iSavedPosition = aPosition;
+
+    //
+    //  Create accessory monitor to search for TV-Out events
+    //
+    if ( ! iAccessoryMonitor )
+    {
+        iAccessoryMonitor = CMPXVideoAccessoryObserver::NewL( this );
+    }
+
+    if ( fileExists )
+    {
+        //
+        //  Ensure there are rights for protected clips
+        //
+        TInt drmError = iDrmHelper->GetDrmRightsStatus( iFileHandle );
+
+        if ( drmError )
+        {
+            //
+            //  Send error to observer for handling
+            //
+            HandleError( drmError );
+        }
+        else
+        {
+            iState->OpenFileL( iFileHandle );
+        }
+    }
+    else
+    {
+        iState->OpenFileL( iClipName->Des() );
+    }
+}
+
+//  ----------------------------------------------------------------------------
+//    C++ constructor
+//  ----------------------------------------------------------------------------
+//
+CMPXVideoPlaybackController::CMPXVideoPlaybackController()
+    : iAppInForeground(ETrue)
+    , iAllowAutoPlay(ETrue)
+    , iHelixLoadingStarted(EFalse)
+    , iLightStatus(CHWRMLight::ELightStatusUnknown)
+{
+}
+
+//  ----------------------------------------------------------------------------
+//    Destructor
+//  ----------------------------------------------------------------------------
+//
+CMPXVideoPlaybackController::~CMPXVideoPlaybackController()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::~CMPXVideoPlaybackController"));
+
+    delete iDrmHelper;
+    delete iAccessoryMonitor;
+
+    delete iNotIntialisedState;
+    delete iInitialisingState;
+    delete iInitialisedState;
+    delete iPlayingState;
+    delete iBufferingState;
+    delete iPausedState;
+    delete iSeekingState;
+    delete iStoppedState;
+
+    if ( iCallDetector )
+    {
+        iCallDetector->Cancel();
+
+        delete iCallDetector;
+        iCallDetector = NULL;
+    }
+
+    if ( iPlaybackMode )
+    {
+        delete iPlaybackMode;
+        iPlaybackMode = NULL;
+    }
+
+    if ( iVolumeWatcher )
+    {
+        delete iVolumeWatcher;
+        iVolumeWatcher = NULL;
+    }
+
+    if ( iMuteWatcher )
+    {
+        delete iMuteWatcher;
+        iMuteWatcher = NULL;
+    }
+
+    if ( iFileDetails )
+    {
+        delete iFileDetails;
+        iFileDetails = NULL;
+    }
+
+    if ( iClipName )
+    {
+        delete iClipName;
+        iClipName = NULL;
+    }
+
+    if ( iRecognizedMimeType )
+    {
+        delete iRecognizedMimeType;
+        iRecognizedMimeType = NULL;
+    }
+
+    if ( iVideoSeeker )
+    {
+        delete iVideoSeeker;
+        iVideoSeeker = NULL;
+    }
+
+    if ( iFileHandle.SubSessionHandle() )
+    {
+        iFileHandle.Close();
+    }
+
+    if ( iBackLightTimer )
+    {
+        iBackLightTimer->Cancel();
+        delete iBackLightTimer;
+        iBackLightTimer = NULL;
+    }
+
+    if ( iPlayer )
+    {
+        delete iPlayer;
+        iPlayer = NULL;
+    }
+
+    if ( iUserActivityTimer )
+    {
+        iUserActivityTimer->Cancel();
+        delete iUserActivityTimer;
+        iUserActivityTimer = NULL;
+    }
+
+    ReleaseLights();
+
+    CancelDisplayTimer();
+
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+    if ( iFileHandle64.SubSessionHandle() )
+    {
+        iFileHandle64.Close();
+    }
+
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+    iViewActivated  = EFalse;
+}
+
+//  ----------------------------------------------------------------------------
+//    Executes general playback commands supported by the playback FW
+//    CMPXVideoPlaybackController::HandleGeneralPlaybackCommandL()
+//  ----------------------------------------------------------------------------
+//
+void
+CMPXVideoPlaybackController::HandleGeneralPlaybackCommandL( CMPXCommand& aCmd )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::HandleGeneralPlaybackTypeL()"));
+
+    if ( aCmd.IsSupported( KMPXCommandPlaybackGeneralType ) )
+    {
+        TMPXPlaybackCommand cmd = static_cast<TMPXPlaybackCommand>
+                                      (aCmd.ValueTObjectL<TInt>(KMPXCommandPlaybackGeneralType ));
+
+        MPX_DEBUG(_L("CMPXVideoPlaybackController::HandleGeneralPlaybackCommandL() id = %d"), cmd );
+
+        DoHandleCommandL( cmd );
+    }
+}
+
+//  ----------------------------------------------------------------------------
+//    Executes general playback commands supported by the playback FW
+//    CMPXVideoPlaybackController::HandleCustomPlaybackCommandL()
+//  ----------------------------------------------------------------------------
+//
+void
+CMPXVideoPlaybackController::HandleCustomPlaybackCommandL( CMPXCommand& aCmd )
+{
+    MPX_ENTER_EXIT(
+        _L("CMPXVideoPlaybackController::HandleCustomPlaybackCommandL()") );
+
+    if ( aCmd.IsSupported( KMPXMediaVideoPlaybackCommand ) )
+    {
+        TMPXVideoPlaybackCommand cmd = static_cast<TMPXVideoPlaybackCommand>
+                            (aCmd.ValueTObjectL<TInt>(KMPXMediaVideoPlaybackCommand));
+
+        MPX_DEBUG(_L("CMPXVideoPlaybackController::HandleCustomPlaybackCommandL() cmd = %d"), cmd );
+
+        switch ( cmd )
+        {
+            case EPbCmdInitView:
+            {
+                if ( iState != iNotIntialisedState )
+                {
+                    aCmd.SetTextValueL( KMPXMediaVideoPlaybackFileName, *iClipName );
+                    aCmd.SetTObjectValueL<TInt>( KMPXMediaVideoMode, iPlaybackMode->GetMode() );
+
+                    aCmd.SetTObjectValueL<TInt>( KMPXMediaVideoTvOutConnected,
+                                                 iAccessoryMonitor->IsTvOutConnected() );
+
+                    if ( iRecognizedMimeType )
+                    {
+                        aCmd.SetTextValueL( KMPXMediaVideoRecognizedMimeType,
+                                            *iRecognizedMimeType );
+                    }
+                }
+
+                break;
+            }
+            case EPbCmdSetDisplayWindow:
+            {
+                SetDisplayWindowL( aCmd );
+                break;
+            }
+            case EPbCmdAbortDSA:
+            {
+                AbortDSA();
+                break;
+            }
+            case EPbCmdRestartDSA:
+            {
+                RestartDSA( aCmd );
+                break;
+            }
+            case EPbCmdStartVideoSeekingForward:
+            {
+                iState->HandleStartSeekL( ETrue );
+                break;
+            }
+            case EPbCmdStartVideoSeekingBackward:
+            {
+                iState->HandleStartSeekL( EFalse );
+                break;
+            }
+            case EPbCmdStopVideoSeeking:
+            {
+                iState->HandleStopSeekL();
+                break;
+            }
+            case EPbCmdHandleForeground:
+            {
+                iAppInForeground = ETrue;
+                iState->HandleForeground();
+                break;
+            }
+            case EPbCmdHandleBackground:
+            {
+                iAppInForeground =
+                    static_cast<TBool>(aCmd.ValueTObjectL<TBool>(KMPXMediaVideoAppForeground));
+
+                iState->HandleBackground();
+                break;
+            }
+            case EPbCmdNaturalAspectRatio:
+            {
+                iState->SetAspectRatioL( aCmd, EMMFNatural );
+                break;
+            }
+            case EPbCmdZoomAspectRatio:
+            {
+                iState->SetAspectRatioL( aCmd, EMMFZoom );
+                break;
+            }
+            case EPbCmdStretchAspectRatio:
+            {
+                iState->SetAspectRatioL( aCmd, EMMFStretch );
+                break;
+            }
+            case EPbCmdUpdateSeekable:
+            {
+                iState->UpdateSeekableL( aCmd );
+                break;
+            }
+            case EPbCmdEndofClipReached:
+            {
+                iState->HandleEndOfClip();
+                break;
+            }
+            case EPbCmdHandleIncreaseVolume:
+            {
+                HandleVolumeL( ETrue );
+                break;
+            }
+            case EPbCmdHandleDecreaseVolume:
+            {
+                HandleVolumeL( EFalse );
+                break;
+            }
+            case EPbCmdCustomPause:
+            {
+                iState->HandleCustomPause();
+                break;
+            }
+            case EPbCmdCustomPlay:
+            {
+                iState->HandleCustomPlay();
+                break;
+            }
+            case EPbCmdRetrieveBufferingPercentage:
+            {
+                TInt bufferingPercentage = 100;
+
+                //
+                //  Check if Helix is in the loading state.  If not, return 100 since
+                //  Helix believes they are fully loaded
+                //
+                if ( iHelixLoadingStarted )
+                {
+                    bufferingPercentage = iState->RetrieveBufferingPercentage();
+                }
+
+                aCmd.SetTObjectValueL<TInt>( KMPXMediaVideoBufferingPercentage,
+                                             bufferingPercentage );
+
+                break;
+            }
+            case EPbCmdSetPosterFrame:
+            {
+                iState->HandleSetPosterFrame();
+                break;
+            }
+            case EPbCmdSurfaceRemovedFromWindow:
+            {
+                TSurfaceId surfaceId =
+                    aCmd.ValueTObjectL<TSurfaceId>( KMPXMediaVideoDisplayTSurfaceId );
+
+                TInt error = iPlayer->RemoveSurfaceFromHelix( surfaceId );
+
+                if ( error != KErrNone )
+                {
+                    MPX_TRAPD( err, iState->SendErrorToViewL( error ) );
+                }
+
+                break;
+            }
+        }
+    }
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackController::HandlePdlCommandL()
+//  ------------------------------------------------------------------------------------------------
+//
+void
+CMPXVideoPlaybackController::HandlePdlCommandL( CMPXCommand& aCmd )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::HandlePdlCommandL()"));
+
+    TMPXPlaybackPdCommand cmd =
+        static_cast<TMPXPlaybackPdCommand>(*aCmd.Value<TInt>(KMPXCommandPlaybackGeneralType));
+
+    switch ( cmd )
+    {
+        case EPbCmdStartPd:
+        {
+            //
+            //  Set the media type to PDL so the PDL mode will be created
+            //
+            iMediaType = CMediaRecognizer::EProgressiveDownload;
+            SetPlaybackModeL();
+            iPlaybackMode->ConnectToDownloadL( aCmd );
+
+            break;
+        }
+        case EPbCmdGetPdStatus:
+        {
+            if ( iPlaybackMode )
+            {
+                iPlaybackMode->GetPdlStatusL( aCmd );
+            }
+            else
+            {
+                //
+                //  There must be an error since the playback mode does not exist
+                //  Return a state of not downloading since the error will be handled
+                //  during the MediaL() call.
+                //
+                aCmd.SetTObjectValueL<TMPXPlaybackPdDownloadState>( KMPXCommandPlaybackPDState,
+                                                                    EPbDlStateNotDownloading );
+                aCmd.SetTObjectValueL<TInt>( KMPXCommandPlaybackPDDownloadedBytes, KOneKilobyte );
+                aCmd.SetTObjectValueL<TInt>( KMPXCommandPlaybackPDTotalBytes, KOneKilobyte );
+            }
+
+            break;
+        }
+        default:
+        {
+            break;
+        }
+    }
+}
+
+//  ----------------------------------------------------------------------------
+//    Set the DataSource and DataSink to the IMMFController
+//
+//  ----------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackController::HandleCommandL( CMPXCommand& aCmd )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::HandleCommandL() - CMPXCommand"));
+
+    if ( aCmd.IsSupported( KMPXCommandGeneralId ) )
+    {
+        TInt cmdId = *aCmd.Value<TInt>(KMPXCommandGeneralId);
+
+        MPX_DEBUG(_L("CMPXVideoPlaybackController::HandleCommandL() id = 0x%08x"), cmdId );
+
+        switch ( cmdId )
+        {
+            case KMPXCommandIdPlaybackGeneral:
+            {
+                HandleGeneralPlaybackCommandL( aCmd );
+                break;
+            }
+            case KMPXMediaIdVideoPlayback:
+            {
+                HandleCustomPlaybackCommandL( aCmd );
+                break;
+            }
+            case KMPXCommandIdPlaybackPD:
+            {
+                HandlePdlCommandL( aCmd );
+                break;
+            }
+        }
+    }
+}
+
+//  ----------------------------------------------------------------------------
+//    CMPXVideoPlaybackController::HandleCommandL
+//
+//  ----------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackController::HandleCommandL(TMPXPlaybackCommand aCmd, TInt /*aData*/)
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::HandleCommandL() - TMPXPlaybackCommand"));
+
+    DoHandleCommandL( aCmd );
+}
+
+//  ----------------------------------------------------------------------------
+//    CMPXVideoPlaybackController::DoHandleCommandL
+//  ----------------------------------------------------------------------------
+void CMPXVideoPlaybackController::DoHandleCommandL(TInt aCmd)
+{
+    MPX_ENTER_EXIT(
+        _L("CMPXVideoPlaybackController::DoHandleCommandL()"),
+        _L("Command = %d"), aCmd );
+
+    switch (aCmd)
+    {
+        case EPbCmdPlay:
+        {
+            iState->HandlePlay();
+            break;
+        }
+        case EPbCmdPause:
+        {
+            iState->HandlePause();
+            break;
+        }
+        case EPbCmdPlayPause:
+        {
+            iState->HandlePlayPause();
+            break;
+        }
+        case EPbCmdStartSeekForward:
+        {
+            iState->HandleStartSeekL( ETrue );
+            break;
+        }
+        case EPbCmdStartSeekBackward:
+        {
+            iState->HandleStartSeekL( EFalse );
+            break;
+        }
+        case EPbCmdStopSeeking:
+        {
+            iState->HandleStopSeekL();
+            break;
+        }
+        case EPbCmdClose:
+        {
+            iState->HandleClose();
+            break;
+        }
+        case EPbCmdStop:
+        {
+            iState->HandleStop();
+            break;
+        }
+        default:
+        {
+            break;
+        }
+    }
+}
+
+//  ----------------------------------------------------------------------------
+//    CMPXVideoPlaybackController::HandleMMFEvent
+//  ----------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackController::HandleMMFEvent( const TMMFEvent& aEvent )
+{
+    MPX_ENTER_EXIT(
+        _L("CMPXVideoPlaybackController::HandleMMFEvent()"),
+        _L("EventType = 0x%08x, ErrorCode = %d"), aEvent.iEventType, aEvent.iErrorCode );
+
+    if ( aEvent.iEventType == KMMFEventCategoryVideoOpenComplete )
+    {
+        iState->HandleOpenComplete( aEvent.iErrorCode );
+    }
+    else if ( aEvent.iEventType == KMMFEventCategoryVideoPrepareComplete )
+    {
+        iState->HandlePrepareComplete( aEvent.iErrorCode );
+    }
+    else if ( aEvent.iEventType == KMMFEventCategoryPlaybackComplete )
+    {
+        iState->HandlePlaybackComplete( aEvent.iErrorCode );
+    }
+    else if ( aEvent.iEventType == KMMFEventCategoryVideoLoadingStarted )
+    {
+        //
+        //  Set the flag to retrieve the Buffering percentage from Helix
+        //
+        iHelixLoadingStarted = ETrue;
+
+        iState->HandleLoadingStarted();
+    }
+    else if ( aEvent.iEventType == KMMFEventCategoryVideoLoadingComplete )
+    {
+        //
+        //  Set the flag to retrieve the Buffering percentage from Helix
+        //
+        iHelixLoadingStarted = EFalse;
+
+        iState->HandleLoadingComplete( aEvent.iErrorCode );
+    }
+#ifdef SYMBIAN_BUILD_GCE
+    else if ( aEvent.iEventType == KMMFEventCategoryVideoSurfaceCreated )
+    {
+        TInt error = iPlayer->VideoSurfaceCreated();
+
+        if ( error != KErrNone )
+        {
+            MPX_TRAPD( err, iState->SendErrorToViewL( error ) );
+        }
+    }
+    else if ( aEvent.iEventType == KMMFEventCategoryVideoSurfaceParametersChanged )
+    {
+        TInt error = iPlayer->SurfaceParametersChanged();
+
+        if ( error != KErrNone )
+        {
+            MPX_TRAPD( err, iState->SendErrorToViewL( error ) );
+        }
+    }
+    else if ( aEvent.iEventType == KMMFEventCategoryVideoRemoveSurface )
+    {
+        iPlayer->RemoveSurface();
+    }
+#endif // SYMBIAN_BUILD_GCE
+    else if ( aEvent.iEventType == KMMFEventCategoryVideoPlayerGeneralError )
+    {
+        switch ( aEvent.iErrorCode )
+        {
+            case KErrDisconnected:
+            case KErrTimedOut:
+            {
+                iState->ResolveTimeoutError(aEvent.iErrorCode);
+                break;
+            }
+            case KErrHardwareNotAvailable:
+            case KErrMMAudioDevice:
+            case KErrMMVideoDevice:
+            {
+                // Resource lost; go to pause state
+                iState->HandlePause();
+                break;
+            }
+            default:
+            {
+                iState->HandleUnexpectedError( aEvent.iErrorCode );
+                break;
+            }
+        }
+    }
+    else if ( aEvent.iEventType == KMMFEventCategoryAudioResourceAvailable )
+    {
+      // ?????
+    }
+    else
+    {
+        //
+        //  unexpected MMF event
+        //
+    }
+}
+
+//  ----------------------------------------------------------------------------
+//    CMPXVideoHelixPlayback::RestartDSA()
+//
+//    This is not state dependent so the ctlr can handle this
+//  ----------------------------------------------------------------------------
+void CMPXVideoPlaybackController::RestartDSA( CMPXCommand& aCmd )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoHelixPlayback::RestartDSA()"));
+
+    CMPXVideoRegion* videoRegion =
+        aCmd.ValueCObjectL<CMPXVideoRegion>(KMPXMediaVideoPlaybackDSARegion);
+
+    iPlayer->RestartDsa( videoRegion->GetRegion() );
+
+    delete videoRegion;
+}
+
+//  ----------------------------------------------------------------------------
+//    CMPXVideoPlaybackController::SetDisplayWindowL()
+//
+//    This is not state dependent .
+//    Note: The view can control the when it sends this command
+//  ----------------------------------------------------------------------------
+void CMPXVideoPlaybackController::SetDisplayWindowL( CMPXCommand& aCmd )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::SetDisplayWindowL()"));
+
+    TRect rect =
+        static_cast<TRect>( aCmd.ValueTObjectL<TRect>(KMPXMediaVideoPlaybackTRect) );
+
+    MPX_DEBUG(_L("CMPXVideoHelixPlayback::SetDisplayWindowL() region sent"));
+
+    CMPXVideoRegion* videoRegion =
+        aCmd.ValueCObjectL<CMPXVideoRegion>(KMPXMediaVideoPlaybackDSARegion);
+
+    CleanupStack::PushL( videoRegion );
+
+    iPlayer->SetDisplayWindowL( rect, rect, videoRegion->GetRegion() );
+
+    CleanupStack::PopAndDestroy( videoRegion );
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXVideoPlaybackController::SetVolumeCenRepL
+//  Sets the volume level in Central Repository
+//  ------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackController::SetVolumeCenRepL( TInt aVolume )
+{
+    MPX_ENTER_EXIT(
+        _L("CMPXVideoPlaybackController::SetVolumeCenRepL()"),
+        _L("aVolume = %d"), aVolume );
+
+    if ( iFileDetails && iFileDetails->iAudioEnabled && !iAccessoryMonitor->IsTvOutConnected() )
+    {
+        TInt volume( 0 );
+
+        if ( aVolume > KPbPlaybackVolumeLevelMax )
+        {
+            volume = KPbPlaybackVolumeLevelMax;
+        }
+        else if ( aVolume < KPbPlaybackVolumeLevelMin )
+        {
+            volume = KPbPlaybackVolumeLevelMin;
+        }
+        else
+        {
+            volume = aVolume;
+        }
+
+        //
+        // Volume needs to have n number of steps.
+        // For example, if we get 26, we need to save it as 25 in 20 volume steps
+        // For example, if we get 77, we need to save it as 70 in 10 volume steps
+        //
+        volume -= volume % iVolumeNormalizer;
+
+        MPX_DEBUG(
+            _L("CMPXVideoPlaybackController::SetVolumeCenRepL(): Setting volume = %d"), volume );
+
+        iVolumeWatcher->SetValueL( volume );
+
+        SetMuteCenRepL( volume > 0? EFalse: ETrue );
+    }
+    else
+    {
+        MPX_DEBUG(_L("CMPXVideoPlaybackController::SetVolumeCenRepL(): Audio isn't enabled"));
+    }
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXVideoPlaybackController::SetMuteCenRepL
+//  ------------------------------------------------------------------------------------------------
+void CMPXVideoPlaybackController::SetMuteCenRepL( TBool aMute )
+{
+    if ( iFileDetails && iFileDetails->iAudioEnabled )
+    {
+        iMuteWatcher->SetValueL( aMute );
+
+        MPX_DEBUG(_L("CMPXVideoPlaybackController::SetMuteCenRepL(): Mute = %d"), aMute );
+    }
+    else
+    {
+        MPX_DEBUG(_L("CMPXVideoPlaybackController::SetMuteCenRepL() : Audio isn't enabled"));
+    }
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXVideoPlaybackController::SetVolumeMMFL
+//
+//  Sets the volume level in MMF
+//
+//  NOTE: This is done only after the HandleSettingChange callback from CenRep
+//        has been received as a result of a prior iVolumeWatcher->SetValueL call
+//  ------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackController::SetVolumeMMFL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::SetVolumeMMFL()"));
+
+    TInt volume = iVolumeWatcher->CurrentValueL();
+    TBool mute = iMuteWatcher->CurrentValueL();
+
+    MPX_DEBUG(
+            _L("CMPXVideoPlaybackController::SetVolumeMMFL() volume = %d, mute = %d")
+            , volume, mute );
+
+    TInt newVolume = 0;
+
+    if ( ! mute )
+    {
+        //
+        // If it was muted and previous volume level was KPbPlaybackVolumeLevelMin, set the volume to next level
+        //
+        if ( volume == KPbPlaybackVolumeLevelMin )
+        {
+            volume = KPbPlaybackVolumeLevelMin + iVolumeNormalizer;
+        }
+
+        newVolume = volume * iFileDetails->iMaxVolume / KPbPlaybackVolumeLevelMax;
+    }
+
+    MPX_DEBUG(_L("CMPXVideoPlaybackController::SetVolumeMMFL() new volume = %d"), newVolume );
+
+    //  Change MMF Audio player's volume
+    iPlayer->SetVolumeL( newVolume );
+
+    if ( ! mute )
+    {
+        iMPXPluginObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPVolumeChanged,
+                                          newVolume,
+                                          KErrNone );
+    }
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    Handle a change in a setting value.
+//  ------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackController::HandleSettingChange( const TUid& aRepositoryUid,
+                                                       TUint32 aSettingId )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::HandleSettingChange()"));
+
+    if ( aRepositoryUid == KCRUidMPXVideoSettings )
+    {
+        switch ( aSettingId )
+        {
+            case KMPXVideoPlaybackMute:
+            {
+                TInt muteValue( EFalse );
+
+                TRAP_IGNORE( muteValue = iMuteWatcher->CurrentValueL() );
+
+                iMPXPluginObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPMuteChanged,
+                                                  muteValue,
+                                                  KErrNone );
+                // fall through
+            }
+            case KMPXVideoPlaybackVolume:
+            {
+                //
+                //  this is the callback from cen-rep
+                //  let the state decide if it needs to do something
+                //
+                iState->HandleVolumeChange();
+                break;
+            }
+        }
+    }
+}
+
+//  ----------------------------------------------------------------------------
+//  CMPXVideoPlaybackController::SetPropertyL()
+//
+//  Sets the property of the plugin
+//  ----------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackController::SetPropertyL( TMPXPlaybackProperty aProperty, TInt aValue )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::SetPropertyL()"),
+                   _L("prop %d, val %d"), aProperty, aValue );
+
+    switch ( aProperty )
+    {
+        case EPbPropertyPosition:
+        {
+            iState->HandleSetPositionL( aValue );
+
+            //
+            // Set Position is a synchronous call. It needs not wait for any callback
+            // so HandlePluginEvent can be issued at this time.
+            //
+            iMPXPluginObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPSetComplete,
+                                              aProperty,
+                                              KErrNone );
+            break;
+        }
+        case EPbPropertyVolume:
+        {
+            //
+            // Volume is an asynchronous call. After a new volume value is saved
+            // in CenRep, it needs to wait for a callback. At that time, HandlePluginEvent
+            // for volume will be issued.
+            //
+            SetVolumeCenRepL( aValue );
+            break;
+        }
+        case EPbPropertyMute:
+        {
+            //
+            // Mute is an asynchronous call. After a new mute value is saved
+            // in CenRep, it needs to wait for a callback. At that time, HandlePluginEvent
+            // for mute will be issued.
+            //
+            SetMuteCenRepL( aValue );
+            break;
+        }
+        default:
+        {
+            User::Leave( KErrNotSupported );
+        }
+    }
+
+}
+
+//  ----------------------------------------------------------------------------
+//  CMPXVideoPlaybackController::GetPropertyL
+//
+//    Gets a property of the plugin (async)
+//  ----------------------------------------------------------------------------
+
+void CMPXVideoPlaybackController::GetPropertyL( TMPXPlaybackProperty aProperty ) const
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::GetPropertyL()"),
+                   _L("aProperty = %d"), aProperty );
+
+    TInt value = 0;
+    TInt err = KErrNone;
+
+    switch( aProperty )
+    {
+        case EPbPropertyPosition:
+        {
+            TTimeIntervalMicroSeconds pos = iPlayer->PositionL();
+
+            value = pos.Int64() / KPbMilliMultiplier;
+
+            break;
+        }
+        case EPbPropertyDuration:
+        {
+            if ( iFileDetails )
+            {
+                value = iFileDetails->iDuration.Int64() / KPbMilliMultiplier;
+            }
+
+            break;
+        }
+        case EPbPropertyVolume:
+        {
+            TInt volume = 0;
+
+            if ( ! iMuteWatcher->CurrentValueL() )
+            {
+                volume = iVolumeWatcher->CurrentValueL();
+            }
+
+            value = volume;
+
+            break;
+        }
+        case EPbPropertyMaxVolume:
+        {
+            if ( iFileDetails )
+            {
+                value = iFileDetails->iMaxVolume;
+            }
+            break;
+        }
+        case EPbPropertyMute:
+        {
+            TInt volume = iPlayer->Volume();
+
+            value = volume ? 0 : 1;
+
+            break;
+        }
+        case EPbPropertySupportedFeatures:
+        {
+            value = 0;
+            break;
+        }
+        default:
+        {
+            User::Leave( KErrNotSupported );
+        }
+    }
+
+    if ( iMPXPluginObs )
+    {
+        MPX_DEBUG(_L("CMPXVideoPlaybackController::GetPropertyL() value = %d"), value);
+
+        iMPXPluginObs->HandleProperty( aProperty, value, err );
+    }
+}
+
+//
+//  ----------------------------------------------------------------------------
+//    Sends the media properties
+//  ----------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackController::SendMediaL( const TArray<TMPXAttribute>& aAttrs )
+{
+    MPX_ENTER_EXIT( _L("CMPXVideoPlaybackController::SendMediaL()"));
+
+    TInt retError = KErrNone;
+
+    iViewActivated = ETrue;
+
+    iPlayer->SendSurfaceCreatedCommand();
+
+    RArray<TInt> suppIds;
+    CleanupClosePushL( suppIds );
+
+    suppIds.AppendL( KMPXMediaIdGeneral );
+    suppIds.AppendL( KMPXMediaIdVideo );
+
+    CMPXMedia* media = CMPXMedia::NewL( suppIds.Array() );
+
+    CleanupStack::PopAndDestroy( &suppIds );
+    CleanupStack::PushL( media );
+
+    retError = iState->RetrieveFileDetailsL( aAttrs, media );
+
+    iMPXPluginObs->HandleMedia( *media, retError );
+
+    CleanupStack::PopAndDestroy( media );
+}
+
+//
+//  ----------------------------------------------------------------------------
+//  CMPXVideoPlaybackController::ChangeState
+//  ----------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackController::ChangeState(TMPXVideoPlaybackState aChangeToState)
+{
+    MPX_ENTER_EXIT( _L("CMPXVideoPlaybackController::ChangeState()"),
+                    _L("newState = %d"), aChangeToState );
+
+    if ( aChangeToState != iState->GetState() )
+    {
+        switch ( aChangeToState )
+        {
+            case EMPXVideoPlaying:
+            {
+                iState = iPlayingState;
+
+                //
+                //  If clip is audio only, stop the backlight timer and break switch
+                //  If clip has audio and video, proceed to the next case which will
+                //  start the backlight timer if needed
+                //
+                if ( iFileDetails->iVideoEnabled )
+                {
+                    StartLightsControl();
+                }
+                else
+                {
+                    CancelLightsControl();
+                }
+
+                break;
+            }
+            case EMPXVideoPaused:
+            {
+                iState = iPausedState;
+                CancelLightsControl();
+                break;
+            }
+            case EMPXVideoInitializing:
+            {
+                iState = iInitialisingState;
+                StartLightsControl();
+                break;
+            }
+            case EMPXVideoInitialized:
+            {
+                iState = iInitialisedState;
+                StartLightsControl();
+                break;
+            }
+            case EMPXVideoBuffering:
+            {
+                iState = iBufferingState;
+                StartLightsControl();
+                break;
+            }
+            case EMPXVideoSeeking:
+            {
+                iState = iSeekingState;
+                StartLightsControl();
+                break;
+            }
+            case EMPXVideoStopped:
+            {
+                iState = iStoppedState;
+                CancelLightsControl();
+                break;
+            }
+            case EMPXVideoNotInitialized:
+            {
+                ResetMemberVariables();
+                iState = iNotIntialisedState;
+                CancelLightsControl();
+                break;
+            }
+        }
+    }
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    Reads the file details from the media properties
+//  ------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackController::ReadFileDetailsL()
+{
+    MPX_ENTER_EXIT( _L("CMPXVideoPlaybackController::ReadFileDetailsL()"));
+
+    CMPXVideoFileDetails* temp = iFileDetails;
+
+    //
+    //  Create the file details class and delete old data
+    //
+    iFileDetails = CMPXVideoFileDetails::NewL();
+    delete temp;
+
+    iFileDetails->iClipName = iClipName->AllocL();
+
+    //
+    //  Resolution
+    //
+    TSize size;
+    iPlayer->VideoFrameSizeL( size );
+    iFileDetails->iResolutionHeight = size.iHeight;
+    iFileDetails->iResolutionWidth = size.iWidth;
+
+    //
+    //  Video Track
+    //
+    TInt videoBitRate = iPlayer->VideoBitRateL();
+    iFileDetails->iVideoEnabled = ( videoBitRate != 0 );
+
+    iFileDetails->iBitRate = videoBitRate + iPlayer->AudioBitRateL();
+
+    //
+    // Drm Protected
+    //
+    if ( iFileHandle.SubSessionHandle() )
+    {
+        iFileDetails->iDrmProtected = iDrmHelper->IsProtectedL( iFileHandle );
+    }
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+    else if ( iFileHandle64.SubSessionHandle() )
+    {
+        iFileDetails->iDrmProtected = iDrmHelper->IsProtected64L( iFileHandle64 );
+    }
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+
+    //
+    //  Audio Track
+    //
+    iFileDetails->iAudioEnabled = iPlayer->AudioEnabledL();
+
+    //
+    //  Duration
+    //
+    iFileDetails->iDuration = iPlayer->DurationL();
+
+    //
+    //  Max Volume
+    //
+    iFileDetails->iMaxVolume = iPlayer->MaxVolume();
+
+    //
+    //  FourCC Code
+    //
+    iFileDetails->iFourCCCode  = iPlayer->FourCCCode();
+
+    //
+    //  Mime Type
+    //
+    HBufC8* mimeType = HBufC8::NewL( KMAXMIMETYPELENGTH );
+    CleanupStack::PushL( mimeType );
+
+    TPtr8 des = mimeType->Des();
+
+    TInt err = iPlayer->VideoFormatMimeType( des );
+
+    if ( ! err )
+    {
+        HBufC* mimeType16 = HBufC::NewLC( des.Length() );
+        TPtr des16( mimeType16->Des() );
+
+        des16.Copy( des );
+        iFileDetails->iMimeType = des16.AllocL();
+
+        CleanupStack::PopAndDestroy( mimeType16 );
+    }
+
+    CleanupStack::PopAndDestroy( mimeType );
+
+    //
+    //  Loop through the meta data entries
+    //
+    TInt metaCount = 0;
+
+    MPX_TRAPD( error, metaCount = iPlayer->NumberOfMetaDataEntriesL() );
+
+    if ( ! error )
+    {
+        CMMFMetaDataEntry* metaData = NULL;
+
+        for ( TInt i = 0 ; i < metaCount ; ++i )
+        {
+            metaData = iPlayer->MetaDataEntryL(i);
+
+            CleanupStack::PushL( metaData );
+
+            if ( ! metaData->Name().CompareF( KSeekable ) )
+            {
+                if ( ! metaData->Value().CompareF( KFalse ) )
+                {
+                    iFileDetails->iSeekable = EFalse;
+                }
+            }
+            else if ( ! metaData->Name().CompareF( KLiveStream ) )
+            {
+                if ( ! metaData->Value().CompareF( KTrue ) )
+                {
+                    iFileDetails->iLiveStream = ETrue;
+                }
+            }
+            else if ( ! metaData->Name().CompareF( KTitle ) )
+            {
+                iFileDetails->iTitle = metaData->Value().AllocL();
+            }
+            else if ( ( ! metaData->Name().CompareF( KArtist ) ) ||
+                      ( ! metaData->Name().CompareF( KAuthor ) ) )
+            {
+                //
+                //  Do not overwrite the artist
+                //
+                if ( ! iFileDetails->iArtist )
+                {
+                    iFileDetails->iArtist = metaData->Value().AllocL();
+                }
+            }
+            else if ( ! metaData->Name().CompareF( KFormat ) )
+            {
+                //
+                //  Do not overwrite the mime type
+                //
+                if ( ! iFileDetails->iMimeType )
+                {
+                    iFileDetails->iMimeType = metaData->Value().AllocL();
+                }
+            }
+            else if ( !metaData->Name().CompareF(KMPStreamingPauseSupported) )
+            {
+                if ( ! metaData->Value().CompareF( KFalse ) )
+                {
+                    // Streaming Pause is not supported by server
+                    iFileDetails->iPausableStream = EFalse;
+                }
+            }
+            else if ( ( ! metaData->Name().CompareF( KDescription ) ) ||
+                      ( ! metaData->Name().CompareF( KAbstract ) ) )
+            {
+                //
+                //  Do not overwrite the description
+                //
+                if ( ! iFileDetails->iDescription )
+                {
+                    iFileDetails->iDescription = metaData->Value().AllocL();
+                }
+            }
+            else if ( !metaData->Name().CompareF( KLocation ) )
+            {
+                iFileDetails->iLocation = metaData->Value().AllocL();
+            }
+            else if ( !metaData->Name().CompareF( KRightCopy ) )
+            {
+                iFileDetails->iCopyright = metaData->Value().AllocL();
+            }
+            else if ( !metaData->Name().CompareF( KLanguage ) )
+            {
+                iFileDetails->iLanguage = metaData->Value().AllocL();
+            }
+            else if ( !metaData->Name().CompareF( KKeywords ) )
+            {
+                iFileDetails->iKeywords = metaData->Value().AllocL();
+            }
+            else if ( !metaData->Name().CompareF( KCreated ) )
+            {
+                TLex lex( metaData->Value() );
+                lex.Val( iFileDetails->iCreationTime );
+            }
+            else if ( !metaData->Name().CompareF( KLastModified ) )
+            {
+                TLex lex( metaData->Value() );
+                lex.Val( iFileDetails->iModificationTime );
+            }
+
+            CleanupStack::PopAndDestroy( metaData );
+        }
+
+        // Update the seek value for asx clips with the value
+        // received from the engine ( single item )
+        iFileDetails->iSeekable &= iSeekable;
+
+        //
+        // If it is live streaming, seekable and PausableStream should be EFalse
+        // Helix sends ETrue for "Seekable" and "PausableStream" in case of live streaming
+        //
+        if ( iFileDetails->iLiveStream || !iFileDetails->iPausableStream )
+        {
+            iFileDetails->iSeekable = EFalse;
+            iFileDetails->iPausableStream = EFalse;
+        }
+    }
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXVideoPlaybackController::GetModeToSet
+//  ------------------------------------------------------------------------------------------------
+//
+TMPXVideoMode CMPXVideoPlaybackController::GetModeToSet()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackController::GetModeToSet()"));
+
+    TMPXVideoMode changeToMode = EMPXVideoLocal;   // default
+
+    //
+    //  CMediaRecognizer can not recognize live media - as there isn't
+    //  sufficient info available from file name or file handle to make that
+    //  determination - so first check the file details for LIVE
+    //
+    if ( iFileDetails && iFileDetails->iLiveStream )
+    {
+        changeToMode = EMPXVideoLiveStreaming;
+    }
+    else
+    {
+        switch ( iMediaType )
+        {
+            case CMediaRecognizer::ELocalVideoFile: //intentional fall through
+            case CMediaRecognizer::ELocalAudioFile: //intentional fall through
+            case CMediaRecognizer::ELocalAudioPlaylist:
+            {
+                // changeToMode initialized to EMPXVideoLocal
+                // re-assignment not needed
+                break;
+            }
+            case CMediaRecognizer::EProgressiveDownload:
+            {
+                changeToMode = EMPXVideoProgressiveDownload;
+                break;
+            }
+            case CMediaRecognizer::ELocalAsxFile:    //intentional fall through
+            case CMediaRecognizer::ELocalRamFile:    //intentional fall through
+            case CMediaRecognizer::ELocalSdpFile:    //intentional fall through
+            case CMediaRecognizer::EUrl:
+            {
+                changeToMode = EMPXVideoStreaming;
+                break;
+            }
+            case CMediaRecognizer::EUnidentified:   //intentional fall through
+            default:
+            {
+                changeToMode = EMPXVideoLocal;
+                break;
+            }
+        }
+    }
+
+    MPX_DEBUG(_L("CMPXVideoPlaybackController::GetModeToSet() mode = %d"), changeToMode);
+
+    return changeToMode;
+}
+
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXVideoPlaybackController::SetPlaybackModeL
+//  ------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackController::SetPlaybackModeL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::SetPlaybackModeL()"));
+
+    //
+    //  Do not allow the mode to be switched from PDL once it is set
+    //
+    if ( ! iPlaybackMode || iPlaybackMode->GetMode() != EMPXVideoProgressiveDownload )
+    {
+        //
+        //  determine what mode the controller needs to be in
+        //
+        TMPXVideoMode mode = GetModeToSet();
+
+        //
+        //  Set new mode when no mode has been set or this is a new mode
+        //
+        if ( ! iPlaybackMode || mode != iPlaybackMode->GetMode() )
+        {
+            CMPXVideoPlaybackMode* temp = iPlaybackMode;
+
+            switch ( mode )
+            {
+                case EMPXVideoLocal:
+                    iPlaybackMode = CMPXLocalPlaybackMode::NewL( this );
+                    break;
+                case EMPXVideoProgressiveDownload:
+                    iPlaybackMode = CMPXProgressiveDLPlaybackMode::NewL( this );
+                    break;
+                case EMPXVideoStreaming:
+                    iPlaybackMode = CMPXStreamingPlaybackMode::NewL( this );
+                    break;
+                case EMPXVideoLiveStreaming:
+                    iPlaybackMode = CMPXLiveStreamingPlaybackMode::NewL( this );
+                    break;
+                default:
+                    iPlaybackMode = CMPXLocalPlaybackMode::NewL( this );
+                    break;
+            }
+
+            delete temp;
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackController::DetermineMediaTypeL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackController::DetermineMediaTypeL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::DetermineMediaTypeL()"));
+
+    CMediaRecognizer::TMediaType mediaType = CMediaRecognizer::EUnidentified;
+
+    CMediaRecognizer* recognizer = CMediaRecognizer::NewL();
+    CleanupStack::PushL(recognizer);
+
+    if ( iFileHandle.SubSessionHandle() )
+    {
+        TInt size(0);
+        iFileHandle.Size( size );
+
+        if ( size > 0 )
+        {
+            mediaType = recognizer->IdentifyMediaTypeL( iClipName->Des(), iFileHandle, ETrue );
+
+            iRecognizedMimeType = recognizer->MimeTypeL( iFileHandle ).AllocL();
+        }
+    }
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+    else if ( iFileHandle64.SubSessionHandle() )
+    {
+        TInt64 size(0);
+        iFileHandle64.Size( size );
+
+        if ( size > 0 )
+        {
+            mediaType = recognizer->IdentifyMediaTypeL( iClipName->Des(), iFileHandle64, ETrue );
+
+            iRecognizedMimeType = recognizer->MimeTypeL( iFileHandle64 ).AllocL();
+        }
+    }
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+    else
+    {
+        if ( recognizer->IsValidStreamingPrefix( iClipName->Des() ) )
+        {
+            //
+            //   check the descriptor to determine if it has a valid streaming prefix
+            //
+            mediaType = CMediaRecognizer::EUrl;
+        }
+    }
+
+    CleanupStack::PopAndDestroy( recognizer );
+
+    iMediaType = mediaType;
+}
+
+// -----------------------------------------------------------------------------
+// CMPXVideoPlaybackController::IsPhoneCall
+// -----------------------------------------------------------------------------
+//
+TBool CMPXVideoPlaybackController::IsPhoneCall()
+{
+    TInt state = 0;
+    TBool call;
+    RProperty SystemState;
+
+    SystemState.Attach( KPSUidCtsyCallInformation, KCTsyCallState );
+
+    TInt error = SystemState.Get( state );
+
+    if ( error || ( state == EPSCTsyCallStateNone || state == EPSCTsyCallStateUninitialized ) )
+    {
+        call = EFalse;
+    }
+    else
+    {
+        call = ETrue;
+    }
+
+    MPX_DEBUG(_L("CMPXVideoPlaybackController::IsPhoneCall(%d)"), call);
+
+    SystemState.Close();
+    return call;
+}
+
+// -----------------------------------------------------------------------------
+// CMPXVideoPlaybackController::IsActivePhoneCall
+// -----------------------------------------------------------------------------
+//
+TBool CMPXVideoPlaybackController::IsActivePhoneCall()
+{
+    TBool retVal = EFalse;
+    TInt state = 0;
+    RProperty SystemState;
+
+    SystemState.Attach( KPSUidCtsyCallInformation, KCTsyCallState );
+
+    if ( !SystemState.Get( state ) && state == EPSCTsyCallStateConnected )
+    {
+        retVal = ETrue;
+    }
+
+    MPX_DEBUG(_L("CMPXVideoPlaybackController::IsActivePhoneCall(%d)"), retVal);
+
+    SystemState.Close();
+
+    return retVal;
+}
+
+// -----------------------------------------------------------------------------
+// CMPXVideoPlaybackController::IsVideoCall
+// -----------------------------------------------------------------------------
+//
+TBool CMPXVideoPlaybackController::IsVideoCall()
+{
+    TInt callType;
+
+    RProperty::Get( KPSUidCtsyCallInformation,
+                    KCTsyCallType,
+                    callType );// Ignore errors
+
+    TBool videoCall = ( callType == EPSCTsyCallTypeH324Multimedia );
+
+    MPX_DEBUG(_L("CMPXVideoPlaybackController::IsVideoCall(%d)"), videoCall );
+
+    return videoCall;
+}
+
+// -----------------------------------------------------------------------------
+// CMPXVideoPlaybackController::IsVoiceCall
+// -----------------------------------------------------------------------------
+//
+TBool CMPXVideoPlaybackController::IsVoiceCall()
+{
+    TBool call;
+    TInt type = 0;
+    RProperty SystemState;
+
+    SystemState.Attach( KPSUidCtsyCallInformation, KCTsyCallState );
+
+    TInt error = SystemState.Get( KPSUidCtsyCallInformation, KCTsyCallType, type );
+
+    if ( ! error && ( (type == EPSCTsyCallTypeCSVoice) || (type == EPSCTsyCallTypeVoIP) ) )
+    {
+        call = ETrue;
+    }
+    else
+    {
+        call = EFalse;
+    }
+
+    MPX_DEBUG(_L("CMPXVideoPlaybackController::IsVoiceCall(%d)"), call);
+
+    SystemState.Close();
+    return call;
+}
+
+// -----------------------------------------------------------------------------
+// CMPXVideoPlaybackController::IsAlarm
+// -----------------------------------------------------------------------------
+//
+TBool CMPXVideoPlaybackController::IsAlarm()
+{
+    TBool alarm( EFalse );
+
+    RProperty::Get( KPSUidCoreApplicationUIs, KLightsAlarmLightActive, alarm );
+
+    alarm = ( alarm == ELightsBlinking ) ? ETrue : EFalse; // Ignore errors
+
+    MPX_DEBUG(_L("CMPXVideoPlaybackController::IsAlarm(%d)"), alarm);
+
+    return alarm;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackController::IsKeyLocked
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoPlaybackController::IsKeyLocked()
+{
+    TBool keylock( EFalse );
+    RProperty::Get( KPSUidAvkonDomain, KAknKeyguardStatus, keylock );
+
+    MPX_DEBUG(_L("CMPXVideoPlaybackController::IsKeyLocked(%d)"), keylock);
+
+    return keylock;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackController::SendTvOutEventL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackController::SendTvOutEventL( TBool aConnected )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::SendTvOutEventL()"));
+
+    //
+    //  Send notice to the playback view with TV-Out connection status
+    //  and TV-Out playback allowed flag
+    //
+    CMPXMessage* message = CMPXMessage::NewL();
+    CleanupStack::PushL( message );
+
+    message->SetTObjectValueL<TMPXMessageId>( KMPXMessageGeneralId, KMPXMediaIdVideoPlayback );
+    message->SetTObjectValueL<TMPXVideoPlaybackCommand>
+        ( KMPXMediaVideoPlaybackCommand, EPbCmdTvOutEvent );
+    message->SetTObjectValueL<TInt>( KMPXMediaVideoTvOutConnected, aConnected );
+
+    iMPXPluginObs->HandlePlaybackMessage( message, KErrNone );
+
+    CleanupStack::PopAndDestroy( message );
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackController::SendHideControlsEventL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackController::SendHideControlsEventL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::SendHideControlsEventL()"));
+
+    //
+    //  Send notice to the playback view to hide the controls
+    //  when key lock
+    //
+    CMPXMessage* message = CMPXMessage::NewL();
+    CleanupStack::PushL( message );
+
+    message->SetTObjectValueL<TMPXMessageId>( KMPXMessageGeneralId, KMPXMediaIdVideoPlayback );
+
+    message->SetTObjectValueL<TMPXVideoPlaybackCommand>
+        ( KMPXMediaVideoPlaybackCommand, EPbCmdHideControls );
+
+    iMPXPluginObs->HandlePlaybackMessage( message, KErrNone );
+
+    CleanupStack::PopAndDestroy( message );
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackController::HandleTvOutEventL()
+//  ------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackController::HandleTvOutEventL( TBool aConnected )
+{
+    MPX_ENTER_EXIT( _L("CMPXVideoPlaybackController::HandleTvOutEventL()"),
+                    _L("aConnected = %d"), aConnected );
+
+    SendTvOutEventL( aConnected );
+
+    //
+    //  Check playback status of clip with new Tv-Out status
+    //
+    if ( aConnected )
+    {
+        //
+        //  TV-Out accessory connected
+        //
+        // If lights are being controlled enable display timer so that screen backlight will be turned
+        // of after timeout.
+        if ( iBackLightTimer->IsActive() )
+        {
+            RestartDisplayTimer();
+        }
+    }
+    else
+    {
+        // TV out disconnected
+        CancelDisplayTimer();
+
+        // Ensure that lights are on after this
+        ReleaseLights();
+
+        // Pause playback since TV-Out accessory has been disconnected.
+        DoHandleCommandL( EPbCmdPause );
+    }
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackController::CancelBackLightTimer
+//  ------------------------------------------------------------------------------------------------
+void  CMPXVideoPlaybackController::CancelBackLightTimer()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::CancelBackLightTimer()"));
+
+    if ( iBackLightTimer->IsActive() )
+    {
+        iBackLightTimer->Cancel();
+    }
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackState::StartBackLightTimer
+//  ------------------------------------------------------------------------------------------------
+void  CMPXVideoPlaybackController::StartBackLightTimer()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::StartBackLightTimer()"));
+
+    if ( !iBackLightTimer->IsActive() )
+    {
+        iBackLightTimer->Start(
+            0,
+            KMPXBackLightTimeOut,
+            TCallBack( CMPXVideoPlaybackController::HandleBackLightTimeout, this ));
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// Handle back light timer timeout callback
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMPXVideoPlaybackController::HandleBackLightTimeout( TAny* aPtr )
+{
+    static_cast<CMPXVideoPlaybackController*>(aPtr)->DoHandleBackLightTimeout();
+    return KErrNone;
+}
+
+// -------------------------------------------------------------------------------------------------
+// Handle back light timer timeout
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackController::DoHandleBackLightTimeout()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::DoHandleBackLightTimeout()"));
+
+    TBool tvOutConnected( EFalse );
+
+    if ( iAccessoryMonitor )
+    {
+        tvOutConnected = iAccessoryMonitor->IsTvOutConnected();
+    }
+
+    // User activity timer runs always when TV-out is connected
+    // it keeps resetting display timer and keeps lights on whenever there is user activity
+    if ( tvOutConnected )
+    {
+        MPX_DEBUG(_L("CMPXVideoPlaybackController::DoHandleBackLightTimeout() inactivity time = %d"), User::InactivityTime().Int() );
+
+        // Cancel activity timer. Otherwise resetting inactivity time would fire user activity detection
+        CancelUserActivityTimer();
+    }
+
+    User::ResetInactivityTime();
+
+    if ( tvOutConnected )
+    {
+        // Restart user activity timer. It must be running between backlight timer intervals so that backlight
+        // can be turned on if user activity is detected.
+        RestartUserActivityTimer();
+    }
+}
+
+// -----------------------------------------------------------------------------
+// CMPXVideoPlaybackController::StartLightsControl
+// -----------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackController::StartLightsControl()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::StartLightsControl()"));
+
+    StartBackLightTimer();
+
+    if (iAccessoryMonitor )
+    {
+        if ( iAccessoryMonitor->IsTvOutConnected() )
+        {
+            RestartDisplayTimer();
+        }
+    }
+}
+
+// -----------------------------------------------------------------------------
+// CMPXVideoPlaybackController::CancelLightsControl
+// -----------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackController::CancelLightsControl()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::CancelLightsControl()"));
+
+    // This is called whenever there is no need to keep screensaver of anymore
+    // This means that also displaytimer and activity monitoring can be stopped.
+    // This method is not correct place for these calls
+    CancelBackLightTimer();
+
+    CancelUserActivityTimer();
+
+    CancelDisplayTimer();
+
+    // Ensure that lights are on
+    EnableDisplayBacklight();
+
+    // Release lights if releserved
+    ReleaseLights();
+}
+
+
+// -----------------------------------------------------------------------------
+// CMPXVideoPlaybackController::InitDisplayTimerL
+// -----------------------------------------------------------------------------
+//
+TTimeIntervalMicroSeconds32 CMPXVideoPlaybackController::InitDisplayTimerL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::InitDisplayTimerL()"));
+
+    if ( !iDisplayTimer )
+    {
+        iDisplayTimer = CPeriodic::NewL( CPeriodic::EPriorityStandard );
+
+        MPX_DEBUG(_L("CMPXVideoPlaybackController::InitDisplayTimerL() - created") );
+    }
+
+    if ( iDisplayTimerTimeout.Int() == 0 )
+    {
+        // Get the display light time-out value from CenRep
+        CRepository* repository = CRepository::NewLC( KCRUidLightSettings  );
+        // What's the timeout value (in seconds ) for the display light?
+        TInt displayTimeOut ( 0 );
+        repository->Get( KDisplayLightsTimeout, displayTimeOut );
+
+        if ( ( displayTimeOut * KMPXMicroSecondsInASecond ) > KMaxTInt )
+        {
+            iDisplayTimerTimeout = KMaxTInt;
+        }
+        else
+        {
+            iDisplayTimerTimeout = displayTimeOut * KMPXMicroSecondsInASecond;
+        }
+
+        CleanupStack::PopAndDestroy( repository );
+    }
+
+    MPX_DEBUG( _L("CMPXVideoPlaybackController::InitDisplayTimerL Timeout(%d)"), iDisplayTimerTimeout.Int() );
+
+    // Convert the timeout value to microseconds
+    return iDisplayTimerTimeout;
+}
+
+// -----------------------------------------------------------------------------
+// CMPXVideoPlaybackController::RestartDisplayTimer
+// -----------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackController::RestartDisplayTimer()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::RestartDisplayTimer"));
+
+    TTimeIntervalMicroSeconds32 displayTimeOut(0);
+    // Leave system to safe state if following leaves. Lights stay on
+    MPX_TRAPD(err, displayTimeOut=InitDisplayTimerL(); )
+    if ( err == KErrNone )
+    {
+        // check if the display timer is running and cancel it
+        if ( iDisplayTimer->IsActive() )
+        {
+            iDisplayTimer->Cancel();
+        }
+
+        MPX_DEBUG( _L("CMPXVideoPlaybackController::RestartDisplayTimer() restarting displayTimer to=%d ms"), displayTimeOut.Int() );
+
+        iDisplayTimer->Start( displayTimeOut, displayTimeOut,
+            TCallBack( CMPXVideoPlaybackController::HandleDisplayTimeout, this ) );
+    }
+}
+
+// -----------------------------------------------------------------------------
+// CMPXVideoPlaybackController::CancelDisplayTimer
+// -----------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackController::CancelDisplayTimer()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::CancelDisplayTimer"));
+
+    if ( iDisplayTimer )
+    {
+        if ( iDisplayTimer->IsActive() )
+        {
+            iDisplayTimer->Cancel();
+        }
+        delete iDisplayTimer;
+        iDisplayTimer = NULL;
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackUserInputHandler::HandleDisplayTimeout
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMPXVideoPlaybackController::HandleDisplayTimeout( TAny* aPtr )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::HandleDisplayTimeout"));
+
+    static_cast<CMPXVideoPlaybackController*>(aPtr)->DoHandleDisplayTimeout();
+
+    return KErrNone;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackUserInputHandler::DoHandleDisplayTimeout
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackController::DoHandleDisplayTimeout( )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::DoHandleDisplayTimeout"));
+
+    DisableDisplayBacklight();
+    // Avoid missing user activity immediately after lights are turned off
+    RestartUserActivityTimer();
+}
+
+
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXVideoPlaybackController::EnableDisplayBacklight
+//  ------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackController::EnableDisplayBacklight()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::EnableDisplayBacklight()"));
+
+    // ELightStatusUnknown - We are not controlling lights and we don't care about lights
+    // ELightOn            - Ligths are certainly on
+    MPX_DEBUG(_L("CMPXVideoPlaybackController::EnableDisplayBacklight() iLightStatus=%d"), iLightStatus );
+
+    // We are responsible of turning lights on only if we have switched them off.
+    if ( iLightStatus == CHWRMLight::ELightOff )
+    {
+
+        MPX_TRAPD( err,
+        {
+            // Following GetLightsL() call will not leave.
+            // This call should not result to creation of CHWRMLight in this case
+            // because CHWRMLight was created when lights were turned off.
+            CHWRMLight* lights= GetLightsL();
+            if ( lights->LightStatus(CHWRMLight::EPrimaryDisplay) == CHWRMLight::ELightOff )
+            {
+                MPX_DEBUG(_L("CMPXVideoPlaybackController::EnableDisplayBacklight() enabling") );
+
+                lights->LightOnL( CHWRMLight::EPrimaryDisplay, 0  );
+                iLightStatus = CHWRMLight::ELightOn;
+            }
+        } );
+    }
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXVideoPlaybackController::DisableDisplayBacklight
+//  ------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackController::DisableDisplayBacklight()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::DisableDisplayBacklight()"));
+
+    // No major harm done if following block leaves. Lights are left on
+    MPX_TRAPD( err,
+    {
+        CHWRMLight* lights = GetLightsL();
+        if ( lights->LightStatus(CHWRMLight::EPrimaryDisplay) == CHWRMLight::ELightOn )
+        {
+           MPX_DEBUG(_L("CMPXVideoPlaybackController::DisableDisplayBacklight() disabling") );
+
+           lights->LightOffL( CHWRMLight::EPrimaryDisplay, 0  );
+           iLightStatus = CHWRMLight::ELightOff;
+        }
+    } );
+}
+
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXVideoPlaybackController::InitUserActivityTimer
+//  ------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackController::InitUserActivityTimerL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::InitUserActivityTimerL()"));
+
+    iUserActivityTimer = CPeriodic::NewL( CActive::EPriorityStandard);
+
+    // This timer will not run to the end. Timer will be canceled and reset at backlight timeout.
+    iUserActivityTimer->Start(
+        0,
+        KMPXInactivityTimeout,
+        TCallBack( CMPXVideoPlaybackController::HandleUserActivityTimeout, this ));
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXVideoPlaybackController::RestartUserActivityTimer
+//  ------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackController::RestartUserActivityTimer()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::RestartUserActivityTimer()"));
+
+    if ( !iUserActivityTimer )
+    {
+       // This is first call. Create and initialize timer
+       MPX_TRAPD( err,
+       {
+           InitUserActivityTimerL();
+       } );
+
+       // If user activity timer creation fails we can't detect user activity and
+       // get lights back on when user taps screen.
+       // Leave lights on.
+       if ( err != KErrNone )
+       {
+           EnableDisplayBacklight();
+       }
+    }
+
+    if ( iUserActivityTimer )
+    {
+        if ( iUserActivityTimer->IsActive() )
+        {
+            iUserActivityTimer->Cancel();
+        }
+
+        // Not interested about inactivity callback, only activity
+        // If CPeriodic::Inactivity is started with argument 0
+        // timer will fire when system's user inactivity timer resets.
+        iUserActivityTimer->Inactivity( 0 );
+    }
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXVideoPlaybackController::CancelUserActivityTimer
+//  ------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackController::CancelUserActivityTimer()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::CancelUserActivityTimer()"));
+
+    if  ( iUserActivityTimer )
+    {
+        if ( iUserActivityTimer->IsActive() )
+        {
+            iUserActivityTimer->Cancel();
+        }
+    }
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXVideoPlaybackController::HandleUserActivityTimeout
+//  ------------------------------------------------------------------------------------------------
+//
+TInt CMPXVideoPlaybackController::HandleUserActivityTimeout( TAny* aPtr )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::HandleUserActivityTimeout()"));
+
+    static_cast<CMPXVideoPlaybackController*>(aPtr)->DoHandleUserActivityTimeout();
+    return KErrNone;
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXVideoPlaybackController::DoHandleUserActivityTimeout
+//  ------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackController::DoHandleUserActivityTimeout()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::DoHandleUserActivityTimeout()"));
+
+    // Act only once for detected activity.
+    if ( iUserActivityTimer->IsActive() )
+    {
+        iUserActivityTimer->Cancel();
+    }
+
+    // iUserActivityTimer runs when TV-out is connected and playback with video is going on
+    // This timer fires in two situations.
+    // a) Lights are off and user activity is detected - Turn lights on and restart display timer
+    // b) Lights are on and user activity is detected - restart display timer to prevent lights go off
+    EnableDisplayBacklight();
+
+    // Start counting down to next lights off
+    RestartDisplayTimer();
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXVideoPlaybackController::GetLightsL
+//  ------------------------------------------------------------------------------------------------
+//
+CHWRMLight* CMPXVideoPlaybackController::GetLightsL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::GetLightsL()"));
+
+    if ( !iLight )
+    {
+        MPX_DEBUG( _L("CMPXVideoPlaybackController::GetLightsL() - creating") );
+        iLight = CHWRMLight::NewL();
+    }
+    return iLight;
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXVideoPlaybackController::ReleaseLights
+//  ------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackController::ReleaseLights()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::ReleaseLights()"));
+
+    if ( iLight )
+    {
+        // If iLights was created when ReleaseLights was called then TV out must be connected and lights may be off.
+        // This call ensures that lights are on again.
+        EnableDisplayBacklight();
+
+        MPX_DEBUG( _L("CMPXVideoPlaybackController::ReleaseLights() - deleting") );
+        delete iLight;
+        iLight = NULL;
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackController::InitVolumeWatchers()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackController::InitVolumeWatchersL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::InitVolumeWatchers()"));
+
+    if ( ! iVolumeWatcher )
+    {
+        iVolumeWatcher = CMPXCenRepWatcher::NewL( KCRUidMPXVideoSettings,
+                                                  KMPXVideoPlaybackVolume,
+                                                  this );
+    }
+
+    if ( ! iMuteWatcher )
+    {
+        iMuteWatcher = CMPXCenRepWatcher::NewL( KCRUidMPXVideoSettings,
+                                                KMPXVideoPlaybackMute,
+                                                this );
+    }
+
+    //
+    // MPX framework volume range : 0-100
+    //
+    CDevSoundIf* devSoundIf = CDevSoundIf::NewL();
+    TInt volumeSteps =  devSoundIf->GetNumberOfVolumeSteps();
+    delete devSoundIf;
+
+    //
+    // MPX issues GetPropertyL(EPbPropertyVolume) before MMF gets called.
+    // Hence, set iVolumeNormalizer value during construction time.
+    //
+    SetVolumeSteps( volumeSteps );
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXVideoPlaybackController::HandleError
+//  ------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackController::HandleError( TInt error )
+{
+    MPX_ENTER_EXIT( _L("CMPXVideoPlaybackController::HandleError()"),
+                    _L("error = %d"), error );
+
+    ChangeState( EMPXVideoNotInitialized );
+
+    //
+    //  Move the FW state to Initialized so that it can request for Media
+    //
+    iMPXPluginObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPInitialised, 0, KErrNone );
+
+    iPBPluginError = error;
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackController::ResetMemberVariables
+//  ------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackController::ResetMemberVariables()
+{
+    MPX_ENTER_EXIT( _L("CMPXVideoPlaybackController::ResetMemberVariables()"));
+
+    iPlayer->Reset();
+
+    //
+    // Delete the video accessory observer when the plugin
+    // goes back to Not Initialised state.
+    //
+    if ( iAccessoryMonitor )
+    {
+        delete iAccessoryMonitor;
+        iAccessoryMonitor = NULL;
+    }
+
+    if ( iFileDetails )
+    {
+        delete iFileDetails;
+        iFileDetails = NULL;
+    }
+
+    if ( iRecognizedMimeType )
+    {
+        delete iRecognizedMimeType;
+        iRecognizedMimeType = NULL;
+    }
+
+    if ( iFileHandle.SubSessionHandle() )
+    {
+        iFileHandle.Close();
+    }
+
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+    if ( iFileHandle64.SubSessionHandle() )
+    {
+        iFileHandle64.Close();
+    }
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+    iSeekable = ETrue;
+
+    //
+    //  Needs to be last thing destroyed since PDL requires the
+    //  controller to be unloaded to move clip
+    //
+    delete iPlaybackMode;
+    iPlaybackMode = NULL;
+
+    //
+    //  Reset the flag to retrieve the Buffering percentage from Helix
+    //
+    iHelixLoadingStarted = EFalse;
+
+    iSavedPosition = 0;
+
+    iViewActivated  = EFalse;
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXVideoPlaybackController::HandleVolumeL
+//  ------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackController::HandleVolumeL( TBool aIncrease )
+{
+    MPX_ENTER_EXIT( _L("CMPXVideoPlaybackController::HandleVolumeL()"),
+                    _L("aIncrease = %d"), aIncrease );
+
+    TInt volume = iVolumeWatcher->CurrentValueL();
+    TInt diff = iVolumeNormalizer;
+
+    if ( ! aIncrease )
+    {
+        diff *= -1;
+    }
+
+    volume += diff;
+
+    //
+    // save the current volume level in CenRep
+    //
+    SetVolumeCenRepL( volume );
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXVideoPlaybackController::SetVolumeSteps
+//  ------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackController::SetVolumeSteps( TInt aVolumeSteps )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackController::SetVolumeSteps(%d)"), aVolumeSteps );
+
+    iVolumeNormalizer = KPbPlaybackVolumeLevelMax / aVolumeSteps;
+}
+
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackController::OpenFile64L()
+//  ------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackController::OpenFile64L( const TDesC& aMediaFile,
+                                               RFile64& aFile,
+                                               TInt aPosition,
+                                               TInt aAccessPointId )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::OpenFile64L( RFile64 )"),
+                   _L("file = %S, position = %d"), &aMediaFile, aPosition );
+
+    TBool fileExists = EFalse;
+
+    ChangeState( EMPXVideoInitializing );
+
+    if ( iClipName )
+    {
+        delete iClipName;
+        iClipName = NULL;
+    }
+
+    iClipName = aMediaFile.AllocL();
+    iAccessPointId = aAccessPointId;
+
+    //
+    //  If file handle exists, duplicate it to the controller
+    //
+    if ( aFile.SubSessionHandle() )
+    {
+        if ( iFileHandle64.SubSessionHandle() )
+        {
+            iFileHandle64.Close();
+        }
+
+        User::LeaveIfError( iFileHandle64.Duplicate( aFile ) );
+
+        fileExists = ETrue;
+    }
+
+    DetermineMediaTypeL();
+    SetPlaybackModeL();
+
+    iSavedPosition = aPosition;
+
+    //
+    //  Create accessory monitor to search for TV-Out events
+    //
+    if ( ! iAccessoryMonitor )
+    {
+        iAccessoryMonitor = CMPXVideoAccessoryObserver::NewL( this );
+    }
+
+    if ( fileExists )
+    {
+        //
+        //  Ensure there are rights for protected clips
+        //
+        TInt drmError = iDrmHelper->GetDrmRightsStatus64( iFileHandle64 );
+
+        if ( drmError )
+        {
+            //
+            //  Send error to observer for handling
+            //
+            HandleError( drmError );
+        }
+        else
+        {
+            iState->OpenFile64L( iFileHandle64 );
+        }
+    }
+    else
+    {
+        iState->OpenFileL( iClipName->Des() );
+    }
+}
+
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackController::IsViewActivated()
+//  ------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoPlaybackController::IsViewActivated()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackController::IsViewActivated(%d)"), iViewActivated);
+    return iViewActivated;
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackController::HandleFrameReady()
+//  ------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackController::HandleFrameReady(TInt aError)
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackController::HandleFrameReady"));
+
+    iPlaybackMode->HandleFrameReady(aError);
+}
+
+void CMPXVideoPlaybackController::CallDetectedL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::CallDetectedL"));
+
+    // Pause playback
+    DoHandleCommandL( EPbCmdPause );
+}
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/src/mpxvideoplaybackmode.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,754 @@
+/*
+* 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:  This class plays local video file
+*
+*/
+
+
+// Version : %version: 36 %
+
+
+//
+//  INCLUDE FILES
+//
+#include <mmf/server/mmffile.h>
+#include <MMFROPCustomCommandConstants.h>
+#include <mpxplaybackpluginobserver.h>
+#include <mpxmessagegeneraldefs.h>
+#include <mpxplaybackmessage.h>
+
+#include <etel.h>    // 3G
+#include <etelmm.h>
+#include <mmtsy_names.h>
+
+#include "mpxvideoplaybackcontroller.h"
+#include "mpxvideoplaybackmode.h"
+#include "mpxvideofiledetails.h"
+#include <mpxvideoplaybackdefs.h>
+#include "mpxvideodrmhelper.h"
+#include "mpxvideoposterframesetter.h"
+
+// Constants
+const TUid KUidInterfaceMMFHelixController = {0x101F855D};
+
+_LIT8(KMMFAccessPoint,"AccessPoint:Integer = \"%d\";");
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+//  ------------------------------------------------------------------------------------------------
+//    Symbian 2nd phase constructor can leave.
+//  ------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackMode::ConstructL( CMPXVideoPlaybackController* aVideoPlaybackCtlr )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackMode::ConstructL()"));
+
+    iVideoPlaybackCtlr = aVideoPlaybackCtlr;
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    C++ constructor
+//  ------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackMode::CMPXVideoPlaybackMode()
+{
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    Destructor
+//  ------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackMode::~CMPXVideoPlaybackMode()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackMode::~CMPXVideoPlaybackMode()"));
+
+    if ( iPosterFrameSetter )
+    {
+        delete iPosterFrameSetter;
+        iPosterFrameSetter = NULL;
+    }
+}
+
+//  ----------------------------------------------------------------------------
+//    CMPXVideoPlaybackMode::OpenFileL()
+//  ----------------------------------------------------------------------------
+void CMPXVideoPlaybackMode::OpenFileL( const TDesC& aMediaFile )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackMode::OpenFileL()"),
+                   _L("file = %S"), &aMediaFile );
+
+    iVideoPlaybackCtlr->iPlayer->OpenFileL( aMediaFile );
+}
+
+//  ----------------------------------------------------------------------------
+//    CMPXVideoPlaybackMode::OpenFileL()
+//  ----------------------------------------------------------------------------
+void CMPXVideoPlaybackMode::OpenFileL( const RFile& aMediaFile )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackMode::OpenFileL()"));
+
+    iVideoPlaybackCtlr->iPlayer->OpenFileL( aMediaFile );
+}
+
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+//  ----------------------------------------------------------------------------
+//    CMPXVideoPlaybackMode::OpenFile64L()
+//  ----------------------------------------------------------------------------
+void CMPXVideoPlaybackMode::OpenFile64L( const RFile64& aMediaFile )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackMode::OpenFile64L( RFile64 )"));
+
+    iVideoPlaybackCtlr->iPlayer->OpenFile64L( aMediaFile );
+}
+
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackMode::ConnectToDownloadL()
+//  ------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackMode::ConnectToDownloadL( CMPXCommand& /*aCmd*/ )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackMode::ConnectToDownloadL()"));
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackMode::GetPdlStatusL()
+//  ------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackMode::GetPdlStatusL( CMPXCommand& /*aCmd*/ )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackMode::GetPdlStatusL()"));
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackMode::HandleOpenComplete()
+//  ------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackMode::HandleOpenComplete()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackMode::HandleOpenComplete()"));
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackMode::UpdateSeekPosition()
+//  ------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackMode::UpdateSeekPosition( TInt64& aPosition )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackMode::UpdateSeekPosition()"));
+
+    iVideoPlaybackCtlr->iMPXPluginObs->HandlePluginEvent(
+        MMPXPlaybackPluginObserver::EPPositionChanged,
+        aPosition / KPbMilliMultiplier,
+        KErrNone );
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackMode::HandlePause()
+//  ------------------------------------------------------------------------------------------------
+TInt CMPXVideoPlaybackMode::HandlePause()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackMode::HandlePause()"));
+
+    MPX_TRAPD( err, iVideoPlaybackCtlr->iPlayer->PauseL() );
+
+    if ( err == KErrNone )
+    {
+        iVideoPlaybackCtlr->ChangeState( EMPXVideoPaused );
+
+        iVideoPlaybackCtlr->iMPXPluginObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPPaused,
+                                                              0,
+                                                              err );
+    }
+
+    return err;
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackMode::HandleBackground()
+//  ------------------------------------------------------------------------------------------------
+void CMPXVideoPlaybackMode::HandleBackground()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackMode::HandleBackground()"));
+
+    if ( iVideoPlaybackCtlr->iAppInForeground )
+    {
+        if ( iVideoPlaybackCtlr->IsAlarm() )
+        {
+            iVideoPlaybackCtlr->iState->HandlePause();
+        }
+        else if ( iVideoPlaybackCtlr->IsKeyLocked() &&
+                  iVideoPlaybackCtlr->iFileDetails->iVideoEnabled )
+        {
+            iVideoPlaybackCtlr->iState->HandlePause();
+            TRAP_IGNORE( iVideoPlaybackCtlr->SendHideControlsEventL() );
+        }
+    }
+    else
+    {
+         iVideoPlaybackCtlr->iState->HandlePause();
+    }
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXVideoPlaybackMode::CanPlayNow()
+//  ------------------------------------------------------------------------------------------------
+TBool CMPXVideoPlaybackMode::CanPlayNow()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackMode::CanPlayNow"));
+
+    TBool playAllowed = EFalse;
+
+    if ( iVideoPlaybackCtlr->iAppInForeground && iVideoPlaybackCtlr->iAllowAutoPlay )
+    {
+        if ( iVideoPlaybackCtlr->IsVideoCall() )
+        {
+            MPX_TRAPD( err,
+                iVideoPlaybackCtlr->iState->SendErrorToViewL( KMPXVideoCallOngoingError ) );
+        }
+        else if ( iVideoPlaybackCtlr->IsKeyLocked() &&
+                  iVideoPlaybackCtlr->iFileDetails->iVideoEnabled )
+        {
+            // playback not allowed for the clip having video if keylock is true
+            // Let playAllowed remain false
+        }
+        else
+        {
+            playAllowed = ETrue;
+        }
+    }
+
+    return playAllowed;
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXVideoPlaybackMode::IsNetworkMode2GL
+//  ------------------------------------------------------------------------------------------------
+TBool CMPXVideoPlaybackMode::IsNetworkMode2GL()
+{
+    TBool networkMode2g( EFalse );
+    RMobilePhone mobilePhone;
+    RTelServer telServer;          // 3G
+
+    RTelServer::TPhoneInfo phoneInfo;
+    RMobilePhone::TMobilePhoneNetworkMode networkMode;
+
+    User::LeaveIfError( telServer.Connect() );
+    User::LeaveIfError( telServer.LoadPhoneModule( KMmTsyModuleName ) );
+
+    TInt numPhones;
+    User::LeaveIfError(telServer.EnumeratePhones( numPhones ) );
+
+    if ( numPhones <= 0 )
+    {
+        User::Leave( KErrCorrupt );
+    }
+
+    User::LeaveIfError( telServer.GetPhoneInfo( 0, phoneInfo ) );
+    User::LeaveIfError( mobilePhone.Open( telServer, phoneInfo.iName ) );
+    User::LeaveIfError( mobilePhone.Initialise() );
+
+    User::LeaveIfError( mobilePhone.GetCurrentMode( networkMode ) );
+
+    if ( networkMode == RMobilePhone::ENetworkModeGsm)
+    {
+        networkMode2g = ETrue;
+    }
+
+    mobilePhone.Close();
+    telServer.Close();
+
+    MPX_DEBUG(_L("CMPXVideoPlaybackMode::IsNetworkMode2GL(%d)"), networkMode2g);
+
+    return networkMode2g;
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackMode::HandleSetPosterFrame()
+//  ------------------------------------------------------------------------------------------------
+void CMPXVideoPlaybackMode::HandleSetPosterFrame()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackMode::HandleSetPosterFrame()"));
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackMode::HandleSetPosterFrame()
+//  ------------------------------------------------------------------------------------------------
+void CMPXVideoPlaybackMode::HandleFrameReady( TInt /*aError*/ )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackMode::HandleFrameReady()"));
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackMode::SendErrorToView()
+//  ------------------------------------------------------------------------------------------------
+TBool CMPXVideoPlaybackMode::SendErrorToView( TInt /*aError*/ )
+{
+    MPX_DEBUG(_L("CMPXLocalPlaybackMode::SendErrorToView(%d)"), ETrue);
+
+    return ETrue;
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackMode::HandlePauseToPlayTransitionL()
+//  ------------------------------------------------------------------------------------------------
+void CMPXVideoPlaybackMode::HandlePauseToPlayTransitionL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackMode::HandlePauseToPlayTransitionL()"));
+
+    iVideoPlaybackCtlr->iState->IssuePlayCommand( EMPXVideoPlaying,
+                                                  MMPXPlaybackPluginObserver::EPPlaying );
+}
+
+//************************************************************************************************//
+//          CMPXLocalPlaybackMode
+//************************************************************************************************//
+CMPXVideoPlaybackMode*
+CMPXLocalPlaybackMode::NewL( CMPXVideoPlaybackController* aVideoPlaybackCtlr )
+{
+   MPX_ENTER_EXIT(_L("CMPXLocalPlaybackMode::NewL()"));
+   CMPXLocalPlaybackMode* self = new( ELeave ) CMPXLocalPlaybackMode();
+   CleanupStack::PushL( self );
+   self->ConstructL(aVideoPlaybackCtlr);
+   CleanupStack::Pop();
+   return self;
+}
+
+CMPXLocalPlaybackMode::~CMPXLocalPlaybackMode()
+{
+    MPX_DEBUG(_L("CMPXLocalPlaybackMode::~CMPXLocalPlaybackMode()"));
+}
+
+void CMPXLocalPlaybackMode::HandleSetPosterFrame()
+{
+    MPX_DEBUG(_L("CMPXLocalPlaybackMode::HandleSetPosterFrame()"));
+
+    // create poster frame setter if it does not already exist
+    if ( ! iPosterFrameSetter )
+    {
+        TRAP_IGNORE(iPosterFrameSetter = CMPXVideoPosterFrameSetter::NewL( iVideoPlaybackCtlr ));
+    }
+
+    if ( iPosterFrameSetter )
+    {
+        iPosterFrameSetter->RequestPosterFrame();
+    }
+}
+
+void CMPXLocalPlaybackMode::HandleFrameReady(TInt aError)
+{
+    MPX_DEBUG(_L("CMPXLocalPlaybackMode::HandleFrameReady()"));
+
+    iPosterFrameSetter->HandlePosterFrameReady(aError);
+}
+
+
+//************************************************************************************************//
+//          CMPXStreamingPlaybackMode
+//************************************************************************************************//
+CMPXVideoPlaybackMode*
+CMPXStreamingPlaybackMode::NewL( CMPXVideoPlaybackController* aVideoPlaybackCtlr )
+{
+   MPX_ENTER_EXIT(_L("CMPXStreamingPlaybackMode::NewL()"));
+
+   CMPXStreamingPlaybackMode* self = new( ELeave ) CMPXStreamingPlaybackMode();
+   CleanupStack::PushL( self );
+   self->ConstructL(aVideoPlaybackCtlr);
+   CleanupStack::Pop();
+   return self;
+}
+
+CMPXStreamingPlaybackMode::~CMPXStreamingPlaybackMode()
+{
+    MPX_DEBUG(_L("CMPXStreamingPlaybackMode::~CMPXStreamingPlaybackMode()"));
+}
+
+//  ----------------------------------------------------------------------------
+//    CMPXStreamingPlaybackMode::OpenFileL()
+//  ----------------------------------------------------------------------------
+void CMPXStreamingPlaybackMode::OpenFileL( const TDesC& aMediaFile )
+{
+    MPX_ENTER_EXIT(_L("CMPXStreamingPlaybackMode::OpenFileL()"), _L("file = %S"), &aMediaFile );
+
+    iVideoPlaybackCtlr->iPlayer->OpenUrlL( aMediaFile, iVideoPlaybackCtlr->iAccessPointId );
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXStreamingPlaybackMode::HandleOpenComplete()
+//  ------------------------------------------------------------------------------------------------
+//
+void CMPXStreamingPlaybackMode::HandleOpenComplete()
+{
+    MPX_ENTER_EXIT(_L("CMPXStreamingPlaybackMode::HandleOpenComplete()"));
+
+    //
+    //  There is no need to send the access point if it is set to use default.
+    //  SDP files are opened as KMmfUidFileSource type, we need to set the access point for
+    //  SDP files before Prepare is called on Helix for RAM files and URLs - access point is
+    //  already been set at the point of adding data source
+    //
+    if ( iVideoPlaybackCtlr->iAccessPointId != KUseDefaultIap &&
+         iVideoPlaybackCtlr->iMediaType == CMediaRecognizer::ELocalSdpFile )
+    {
+        const TMMFMessageDestinationPckg destinationPckg(KUidInterfaceMMFHelixController);
+        const TPckgBuf<TBool> savePckg( EFalse );
+
+        HBufC8* tempBuf = NULL;
+        TInt apMaxLen = 3;
+
+        MPX_TRAPD( err,
+        {
+            HBufC8* accessPoint = HBufC8::NewLC( KMMFAccessPoint().Length() + apMaxLen );
+            accessPoint->Des().Format( KMMFAccessPoint, iVideoPlaybackCtlr->iAccessPointId );
+
+            tempBuf = HBufC8::NewLC( accessPoint->Length() );
+            tempBuf->Des().Copy( accessPoint->Des() );
+
+            if ( tempBuf )
+            {
+                iVideoPlaybackCtlr->iPlayer->CustomCommandSync(
+                                                 destinationPckg,
+                                                 EMMFROPControllerSetApplicationConfig,
+                                                 tempBuf->Des(),
+                                                 savePckg );
+            }
+
+            CleanupStack::PopAndDestroy(2);
+        } );
+    }
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXStreamingPlaybackMode::CanPlayNow
+//  ------------------------------------------------------------------------------------------------
+TBool CMPXStreamingPlaybackMode::CanPlayNow()
+{
+    MPX_ENTER_EXIT(_L("CMPXStreamingPlaybackMode::CanPlayNow"));
+
+    TBool playAllowed = EFalse;
+
+    if ( iVideoPlaybackCtlr->iAppInForeground && iVideoPlaybackCtlr->iAllowAutoPlay )
+    {
+        if ( iVideoPlaybackCtlr->IsVideoCall() )
+        {
+            MPX_TRAPD(err,
+                      iVideoPlaybackCtlr->iState->SendErrorToViewL( KMPXVideoCallOngoingError ));
+        }
+        else if ( iVideoPlaybackCtlr->IsKeyLocked() &&
+                  iVideoPlaybackCtlr->iFileDetails->iVideoEnabled )
+        {
+            // playback not allowed for the clip having video if keylock is true
+            // Let playAllowed remain false
+        }
+        else
+        {
+            MPX_TRAPD( err,
+                       playAllowed = !( iVideoPlaybackCtlr->IsVoiceCall() && IsNetworkMode2GL() ) );
+
+            if ( !playAllowed )
+            {
+                MPX_TRAPD( err,
+                    iVideoPlaybackCtlr->iState->SendErrorToViewL(
+                        KMPXVideoPlayOver2GDuringVoiceCallError ) );
+            }
+        }
+    }
+
+    return  playAllowed;
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXStreamingPlaybackMode::HandlePause()
+//  ------------------------------------------------------------------------------------------------
+TInt CMPXStreamingPlaybackMode::HandlePause()
+{
+    MPX_ENTER_EXIT(_L("CMPXStreamingPlaybackMode::HandlePause()"));
+
+    TInt err = KErrNone;
+
+    if ( iVideoPlaybackCtlr->iFileDetails->iPausableStream )
+    {
+        MPX_TRAP( err, iVideoPlaybackCtlr->iPlayer->PauseL() );
+
+        if ( err == KErrNone )
+        {
+            iVideoPlaybackCtlr->ChangeState( EMPXVideoPaused );
+
+            iVideoPlaybackCtlr->iMPXPluginObs->HandlePluginEvent(
+                                                   MMPXPlaybackPluginObserver::EPPaused,
+                                                   0,
+                                                   err );
+        }
+    }
+    // Streaming link is non-pausable and no alarm stop playback
+    else if ( ! iVideoPlaybackCtlr->IsAlarm() )
+    {
+        iVideoPlaybackCtlr->iPlayer->Stop();
+
+        iVideoPlaybackCtlr->ChangeState( EMPXVideoStopped );
+
+        iVideoPlaybackCtlr->iMPXPluginObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPStopped,
+                                                              0,
+                                                              KErrNone );
+    }
+
+    return err;
+}
+
+
+//************************************************************************************************//
+//          CMPXLiveStreamingPlaybackMode
+//************************************************************************************************//
+
+CMPXVideoPlaybackMode*
+CMPXLiveStreamingPlaybackMode::NewL( CMPXVideoPlaybackController* aVideoPlaybackCtlr )
+{
+   MPX_ENTER_EXIT(_L("CMPXLiveStreamingPlaybackMode::NewL()"));
+
+   CMPXLiveStreamingPlaybackMode* self =
+            new( ELeave ) CMPXLiveStreamingPlaybackMode();
+   CleanupStack::PushL( self );
+   self->ConstructL(aVideoPlaybackCtlr);
+   CleanupStack::Pop();
+   return self;
+}
+
+CMPXLiveStreamingPlaybackMode::~CMPXLiveStreamingPlaybackMode()
+{
+    MPX_DEBUG(_L("CMPXLiveStreamingPlaybackMode::~CMPXLiveStreamingPlaybackMode"));
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXLiveStreamingPlaybackMode::HandlePause()
+//  ------------------------------------------------------------------------------------------------
+TInt CMPXLiveStreamingPlaybackMode::HandlePause()
+{
+    MPX_ENTER_EXIT(_L("CMPXLiveStreamingPlaybackMode::HandlePause()"));
+
+    //
+    //  Send a stop command to the player, but change state to pause
+    //  The view will not close and the play button will be the only active button
+    //
+    iVideoPlaybackCtlr->iPlayer->Stop();
+
+    iVideoPlaybackCtlr->ChangeState( EMPXVideoPaused );
+
+    iVideoPlaybackCtlr->iMPXPluginObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPPaused,
+                                                          0,
+                                                          KErrNone );
+
+    return KErrNone;
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXLiveStreamingPlaybackMode::SendErrorToView()
+//  ------------------------------------------------------------------------------------------------
+TBool CMPXLiveStreamingPlaybackMode::SendErrorToView( TInt aError )
+{
+    TBool retval = ETrue;
+
+    if ( aError == KErrSessionClosed )
+    {
+        retval = EFalse;
+    }
+
+    MPX_DEBUG(_L("CMPXLiveStreamingPlaybackMode::SendErrorToView(%d)"), retval);
+
+    return retval;
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXLiveStreamingPlaybackMode::HandlePauseToPlayTransitionL()
+//  ------------------------------------------------------------------------------------------------
+void CMPXLiveStreamingPlaybackMode::HandlePauseToPlayTransitionL()
+{
+    MPX_ENTER_EXIT(_L("CMPXLiveStreamingPlaybackMode::HandlePauseToPlayTransitionL()"));
+
+    //
+    //  For live streaming, the controller must be reinitialized
+    //  Send a state change to Initializing to the view
+    //
+    CMPXMessage* msg = CMPXMessage::NewL();
+    CleanupStack::PushL( msg );
+
+    msg->SetTObjectValueL<TMPXMessageId>( KMPXMessageGeneralId, KMPXMessageGeneral );
+    msg->SetTObjectValueL<TInt>( KMPXMessageGeneralEvent, TMPXPlaybackMessage::EStateChanged );
+    msg->SetTObjectValueL<TInt>( KMPXMessageGeneralType, EPbStateInitialising );
+    msg->SetTObjectValueL<TInt>( KMPXMessageGeneralData, 0 );
+
+    iVideoPlaybackCtlr->iMPXPluginObs->HandlePlaybackMessage( msg, KErrNone );
+
+    CleanupStack::PopAndDestroy( msg );
+
+    iVideoPlaybackCtlr->ChangeState( EMPXVideoInitializing );
+
+    iVideoPlaybackCtlr->iPlayer->Reset();
+
+    //
+    //  Reinitialize the player with the file handle or url
+    //
+    if ( iVideoPlaybackCtlr->iFileHandle.SubSessionHandle() )
+    {
+        iVideoPlaybackCtlr->iPlayer->OpenFileL( iVideoPlaybackCtlr->iFileHandle );
+    }
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+    else if ( iVideoPlaybackCtlr->iFileHandle64.SubSessionHandle() )
+    {
+        iVideoPlaybackCtlr->iPlayer->OpenFile64L( iVideoPlaybackCtlr->iFileHandle64 );
+    }
+#endif
+    else
+    {
+        iVideoPlaybackCtlr->iPlayer->OpenUrlL( iVideoPlaybackCtlr->iClipName->Des(),
+                                               iVideoPlaybackCtlr->iAccessPointId );
+    }
+}
+
+
+//************************************************************************************************//
+//          CMPXProgressiveDLPlaybackMode
+//************************************************************************************************//
+CMPXVideoPlaybackMode*
+CMPXProgressiveDLPlaybackMode::NewL( CMPXVideoPlaybackController* aVideoPlaybackCtlr )
+{
+   MPX_ENTER_EXIT(_L("CMPXProgressiveDLPlaybackMode::NewL()"));
+
+   CMPXProgressiveDLPlaybackMode* self = new( ELeave ) CMPXProgressiveDLPlaybackMode();
+   CleanupStack::PushL( self );
+   self->ConstructL( aVideoPlaybackCtlr );
+   CleanupStack::Pop();
+   return self;
+}
+
+void CMPXProgressiveDLPlaybackMode::ConstructL( CMPXVideoPlaybackController* aVideoPlaybackCtlr )
+{
+    iVideoPlaybackCtlr = aVideoPlaybackCtlr;
+
+#ifdef USE_S60_DOWNLOAD_MANAGER
+    //
+    //  Create the Download Mgr Interface
+    //
+    iDlMgrIf = CMPXVideoDlMgrIf::NewL( iVideoPlaybackCtlr );
+#endif // USE_S60_DOWNLOAD_MANAGER
+
+}
+
+CMPXProgressiveDLPlaybackMode::~CMPXProgressiveDLPlaybackMode()
+{
+    MPX_DEBUG(_L("CMPXProgressiveDLPlaybackMode::~CMPXProgressiveDLPlaybackMode()"));
+
+#ifdef USE_S60_DOWNLOAD_MANAGER
+    if ( iDlMgrIf )
+    {
+        delete iDlMgrIf;
+        iDlMgrIf = NULL;
+    }
+#endif // USE_S60_DOWNLOAD_MANAGER
+
+}
+
+#ifdef USE_S60_DOWNLOAD_MANAGER
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXProgressiveDLPlaybackMode::ConnectToDownloadL()
+//  ------------------------------------------------------------------------------------------------
+//
+void CMPXProgressiveDLPlaybackMode::ConnectToDownloadL( CMPXCommand& aCmd )
+{
+    MPX_ENTER_EXIT(_L("CMPXProgressiveDLPlaybackMode::ConnectToDownloadL()"));
+
+    iDlMgrIf->ConnectToDownloadL( aCmd );
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXProgressiveDLPlaybackMode::HandleOpenComplete()
+//  ------------------------------------------------------------------------------------------------
+//
+void CMPXProgressiveDLPlaybackMode::HandleOpenComplete()
+{
+    MPX_ENTER_EXIT(_L("CMPXProgressiveDLPlaybackMode::HandleOpenComplete()"));
+
+    //
+    //  Helix needs the download id before the prepare command has been sent
+    //  to enable PDL
+    //
+    iDlMgrIf->DoHandleOpenComplete();
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXProgressiveDLPlaybackMode::GetPdlStatusL()
+//  ------------------------------------------------------------------------------------------------
+//
+void CMPXProgressiveDLPlaybackMode::GetPdlStatusL( CMPXCommand& aCmd )
+{
+    MPX_DEBUG(_L("CMPXProgressiveDLPlaybackMode::GetPdlStatusL()"));
+
+    iDlMgrIf->GetPdlStatusL( aCmd );
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXProgressiveDLPlaybackMode::UpdateSeekPosition()
+//  ------------------------------------------------------------------------------------------------
+//
+void CMPXProgressiveDLPlaybackMode::UpdateSeekPosition( TInt64& aPosition )
+{
+    MPX_DEBUG(_L("CMPXProgressiveDLPlaybackMode::UpdateSeekPosition()"));
+
+    TReal duration = (TReal)iVideoPlaybackCtlr->iFileDetails->iDuration.Int64();
+    TReal playbackRatio = (TReal)aPosition / duration;
+    TReal downloadRatio = iDlMgrIf->GetDownloadRatio();
+
+    //
+    //  Limit the seek position to the downloaded part of the file
+    //
+    if ( playbackRatio > downloadRatio )
+    {
+        aPosition = downloadRatio * duration;
+    }
+
+    iVideoPlaybackCtlr->iMPXPluginObs->HandlePluginEvent(
+        MMPXPlaybackPluginObserver::EPPositionChanged,
+        aPosition / KPbMilliMultiplier,
+        KErrNone );
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXProgressiveDLPlaybackMode::OpenFileL()
+//  ------------------------------------------------------------------------------------------------
+void CMPXProgressiveDLPlaybackMode::OpenFileL( const RFile& aMediaFile )
+{
+    MPX_ENTER_EXIT(_L("CMPXProgressiveDLPlaybackMode::OpenFileL()"));
+
+    iDlMgrIf->UpdateDownloadSizeL();
+    CMPXVideoPlaybackMode::OpenFileL( aMediaFile );
+}
+
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+//  ------------------------------------------------------------------------------------------------
+//    CMPXProgressiveDLPlaybackMode::OpenFile64L()
+//  ------------------------------------------------------------------------------------------------
+void CMPXProgressiveDLPlaybackMode::OpenFile64L( const RFile64& aMediaFile )
+{
+    MPX_ENTER_EXIT(_L("CMPXProgressiveDLPlaybackMode::OpenFile64L( RFile64 )"));
+
+    iDlMgrIf->UpdateDownloadSizeL();
+    CMPXVideoPlaybackMode::OpenFile64L( aMediaFile );
+}
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+#endif // USE_S60_DOWNLOAD_MANAGER
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/src/mpxvideoplaybackstate.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,2098 @@
+/*
+* 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:  This class plays local video file
+*
+*/
+
+
+// Version : %version: 51 %
+
+
+//
+//  INCLUDE FILES
+//
+#include <mpxcommandgeneraldefs.h>
+#include <mpxmessagegeneraldefs.h>
+#include <mpxmediageneralextdefs.h>
+
+#include "mpxvideoplaybackcontroller.h"
+#include "mpxvideoplaybackstate.h"
+#include <mpxvideoplaybackdefs.h>
+#include <mpxplaybackpluginobserver.h>
+#include <mpxmediageneraldefs.h>
+#include <mpxcenrepwatcher.h>
+
+#include <mmf/server/mmffile.h>
+#include <mmf/common/mmferrors.h>
+
+#include "mpxvideoseeker.h"
+#include "mpxvideoplayerutility.h"
+#include "mpxmediavideodefs.h"
+
+//
+//  CONSTANTS
+//
+
+// ============================ MEMBER FUNCTIONS ===================================================
+
+//  ------------------------------------------------------------------------------------------------
+//    Symbian 2nd phase constructor can leave.
+//  ------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackState::ConstructL( CMPXVideoPlaybackController* aVideoPlaybackCtlr )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackState::ConstructL()"));
+
+    iVideoPlaybackCtlr = aVideoPlaybackCtlr;
+
+    User::LeaveIfError( iFs.Connect() );
+    iFs.ShareProtected();
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    C++ constructor
+//  ------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackState::CMPXVideoPlaybackState()
+{
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    Destructor
+//  ------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackState::~CMPXVideoPlaybackState()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackState::~CMPXVideoPlaybackState()"));
+
+    iFs.Close();
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackState::OpenFileL
+//  ------------------------------------------------------------------------------------------------
+void CMPXVideoPlaybackState::OpenFileL( const TDesC& /*aMediaFile*/ )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackState::OpenFileL()"));
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackState::OpenFileL
+//  ------------------------------------------------------------------------------------------------
+void CMPXVideoPlaybackState::OpenFileL( const RFile& /*aMediaFile*/ )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackState::OpenFileL()"));
+}
+
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackState::OpenFile64L
+//  ------------------------------------------------------------------------------------------------
+void CMPXVideoPlaybackState::OpenFile64L( const RFile64& /*aMediaFile*/ )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackState::OpenFile64L( RFile64 )"));
+}
+
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackState::HandlePlay()
+//  ------------------------------------------------------------------------------------------------
+void CMPXVideoPlaybackState::HandlePlay()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackState::HandlePlay()"));
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackState::HandlePause()
+//  ------------------------------------------------------------------------------------------------
+void CMPXVideoPlaybackState::HandlePause()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackState::HandlePause()"));
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackState::HandlePlayPause()
+//
+//  ------------------------------------------------------------------------------------------------
+void CMPXVideoPlaybackState::HandlePlayPause()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackState::HandlePlayPause()"));
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackState::HandleStop()
+//  ------------------------------------------------------------------------------------------------
+void CMPXVideoPlaybackState::HandleStop()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackState::HandleStop()"));
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXVideoPlaybackState::HandleClose
+//  ------------------------------------------------------------------------------------------------
+void CMPXVideoPlaybackState::HandleClose()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackState::HandleClose()"));
+
+    iVideoPlaybackCtlr->iPlayer->Stop();
+
+    iVideoPlaybackCtlr->CloseController();
+
+    iVideoPlaybackCtlr->iMPXPluginObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPClosed,
+                                                          0,
+                                                          KErrNone );
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackState::HandleStartSeekL()
+//  ------------------------------------------------------------------------------------------------
+void CMPXVideoPlaybackState::HandleStartSeekL( TBool /*aForward*/ )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackState::HandleStartSeekL()"));
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackState::HandleStopSeekL()
+//  ------------------------------------------------------------------------------------------------
+void CMPXVideoPlaybackState::HandleStopSeekL()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackState::HandleStopSeekL()"));
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackState::HandleSetPosterFrame()
+//  ------------------------------------------------------------------------------------------------
+void CMPXVideoPlaybackState::HandleSetPosterFrame()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackState::HandleSetPosterFrame()"));
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackState::HandleForeground()
+//  ------------------------------------------------------------------------------------------------
+void CMPXVideoPlaybackState::HandleForeground()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackState::HandleForeground()"));
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackState::HandleBackground()
+//  ------------------------------------------------------------------------------------------------
+void CMPXVideoPlaybackState::HandleBackground()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackState::HandleBackground()"));
+    HandlePause();
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackState::HandleOpenComplete()
+//  ------------------------------------------------------------------------------------------------
+void CMPXVideoPlaybackState::HandleOpenComplete( TInt /*aError*/ )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackState::HandleOpenComplete()"));
+}
+
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackState::HandlePrepareComplete()
+//  ------------------------------------------------------------------------------------------------
+void CMPXVideoPlaybackState::HandlePrepareComplete(TInt /*aError*/)
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackState::HandlePrepareComplete()"));
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackState::HandleLoadingStarted()
+//  ------------------------------------------------------------------------------------------------
+void CMPXVideoPlaybackState::HandleLoadingStarted()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackState::HandleLoadingStarted()"));
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackState::HandleLoadingComplete()
+//  ------------------------------------------------------------------------------------------------
+void CMPXVideoPlaybackState::HandleLoadingComplete(TInt /*aError*/)
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackState::HandleLoadingComplete()"));
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackState::HandlePlaybackComplete()
+//  ------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackState::HandlePlaybackComplete( TInt aError )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackState::HandlePlaybackComplete()"),
+                   _L("error = %d"), aError );
+
+    iVideoPlaybackCtlr->ChangeState( EMPXVideoStopped );
+
+    if ( aError == KErrNone )
+    {
+        iVideoPlaybackCtlr->iMPXPluginObs->HandlePluginEvent(
+            MMPXPlaybackPluginObserver::EPPlayComplete,
+            0,
+            aError );
+    }
+    else
+    {
+        //
+        //  Notify the view of an error
+        //
+        MPX_TRAPD( err, SendErrorToViewL( aError ) );
+    }
+}
+
+//  ----------------------------------------------------------------------------
+//    CMPXVideoPlaybackState::HandleEndOfClip()
+//  ----------------------------------------------------------------------------
+void CMPXVideoPlaybackState::HandleEndOfClip()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackState::HandleEndOfClip()"));
+
+    // Stop the player
+    iVideoPlaybackCtlr->iPlayer->Stop();
+
+    iVideoPlaybackCtlr->ChangeState( EMPXVideoStopped );
+
+    iVideoPlaybackCtlr->iMPXPluginObs->HandlePluginEvent(
+        MMPXPlaybackPluginObserver::EPPlayComplete,
+        0,
+        KErrNone );
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackState::HandleVolumeChange()
+//  ------------------------------------------------------------------------------------------------
+void CMPXVideoPlaybackState::HandleVolumeChange()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackState::HandleVolumeChange()"));
+
+    MPX_TRAPD( err, iVideoPlaybackCtlr->SetVolumeMMFL() );
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackState::HandleSetPositionL()
+//  ------------------------------------------------------------------------------------------------
+void CMPXVideoPlaybackState::HandleSetPositionL(TInt /*aValue*/)
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackState::HandleSetPositionL()"));
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackState::RetrieveFileDetailsL
+//  ------------------------------------------------------------------------------------------------
+TInt CMPXVideoPlaybackState::RetrieveFileDetailsL( const TArray<TMPXAttribute>& aAttrs,
+                                                   CMPXMedia* aMedia )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackState::RetrieveFileDetailsL()"));
+
+    TUint attrG(0);  //  General attributes
+    TUint attrV(0);  //  Video attributes
+
+    if ( iVideoPlaybackCtlr->iPBPluginError != KErrNone )
+    {
+        if ( iVideoPlaybackCtlr->iClipName )
+        {
+            aMedia->SetTextValueL(
+                TMPXAttribute( KMPXMediaIdGeneral, EMPXMediaGeneralUri ),
+                *( iVideoPlaybackCtlr->iClipName ) );
+        }
+
+        aMedia->SetTObjectValueL<TInt>(
+            TMPXAttribute( KMPXMediaVideoError ), iVideoPlaybackCtlr->iPBPluginError );
+
+        iVideoPlaybackCtlr->iPBPluginError = KErrNone;
+    }
+    else
+    {
+        for ( TInt i = 0 ; i < aAttrs.Count() ; ++i )
+        {
+            TMPXAttribute attr( aAttrs[i] );
+
+            if ( attr.ContentId() == KMPXMediaIdGeneral )
+            {
+                attrG |= attr.AttributeId();
+            }
+            else if ( attr.ContentId() == KMPXMediaIdVideo )
+            {
+                attrV |= attr.AttributeId();
+            }
+        }
+
+        RetrieveGeneralAttributesL( aMedia, attrG );
+        RetrieveVideoAttributesL( aMedia, attrV );
+    }
+
+    return KErrNone;
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackState::RetrieveGeneralAttributesL
+//  ------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackState::RetrieveGeneralAttributesL(  CMPXMedia* aMedia, TUint attrG  )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackState::RetrieveGeneralAttributesL()"));
+
+    //
+    //  Clip name include path excluding scheme
+    //
+    if ( attrG & EMPXMediaGeneralUri )
+    {
+        aMedia->SetTextValueL(
+            TMPXAttribute( KMPXMediaIdGeneral, EMPXMediaGeneralUri ),
+            *( iVideoPlaybackCtlr->iFileDetails->iClipName ) );
+    }
+
+    //
+    //  Duration
+    //
+    if ( attrG & EMPXMediaGeneralDuration )
+    {
+        aMedia->SetTObjectValueL<TInt>(
+            TMPXAttribute( KMPXMediaIdGeneral, EMPXMediaGeneralDuration ),
+            iVideoPlaybackCtlr->iFileDetails->iDuration.Int64() / KPbMilliMultiplier);
+    }
+
+    //
+    //  Title
+    //
+    if ( ( attrG & EMPXMediaGeneralTitle ) && iVideoPlaybackCtlr->iFileDetails->iTitle )
+    {
+        aMedia->SetTextValueL(
+            TMPXAttribute( KMPXMediaIdGeneral, EMPXMediaGeneralTitle ),
+            *( iVideoPlaybackCtlr->iFileDetails->iTitle ) );
+    }
+
+    //
+    //  Mime Type
+    //
+    if ( ( attrG & EMPXMediaGeneralMimeType ) && iVideoPlaybackCtlr->iFileDetails->iMimeType )
+    {
+         aMedia->SetTextValueL(
+             TMPXAttribute( KMPXMediaIdGeneral, EMPXMediaGeneralMimeType ),
+             *( iVideoPlaybackCtlr->iFileDetails->iMimeType ) );
+    }
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackState::RetrieveVideoAttributesL
+//  ------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackState::RetrieveVideoAttributesL(  CMPXMedia* aMedia, TUint attrV  )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackState::RetrieveVideoAttributesL()"));
+
+    //
+    //  Artist
+    //
+    if ( ( attrV & KMPXMediaVideoArtist.iAttributeId ) &&
+         ( iVideoPlaybackCtlr->iFileDetails->iArtist ) )
+    {
+        aMedia->SetTextValueL(
+            TMPXAttribute( KMPXMediaVideoArtist ),
+            *( iVideoPlaybackCtlr->iFileDetails->iArtist ) );
+    }
+
+    //
+    //  Partial Playback
+    //
+    if ( attrV & KMPXMediaVideoPartialPlayback.iAttributeId )
+    {
+        aMedia->SetTObjectValueL<TInt>(
+            TMPXAttribute( KMPXMediaVideoPartialPlayback ),
+            iVideoPlaybackCtlr->iFileDetails->iPartialPlayback );
+    }
+
+    //
+    //  Audio Enabled
+    //
+    if ( attrV & KMPXMediaVideoAudioEnabled.iAttributeId )
+    {
+        aMedia->SetTObjectValueL<TInt>(
+            TMPXAttribute( KMPXMediaVideoAudioEnabled ),
+            iVideoPlaybackCtlr->iFileDetails->iAudioEnabled );
+    }
+
+    //
+    //  Video Enabled
+    //
+    if ( attrV & KMPXMediaVideoVideoEnabled.iAttributeId )
+    {
+        aMedia->SetTObjectValueL<TInt>(
+            TMPXAttribute( KMPXMediaVideoVideoEnabled ),
+            iVideoPlaybackCtlr->iFileDetails->iVideoEnabled );
+    }
+
+    //
+    //  Playback Mode
+    //
+    if ( attrV & KMPXMediaVideoPlaybackMode.iAttributeId )
+    {
+        aMedia->SetTObjectValueL<TInt>(
+            TMPXAttribute( KMPXMediaVideoPlaybackMode ),
+            iVideoPlaybackCtlr->iPlaybackMode->GetMode() );
+    }
+
+    //
+    //  Seekable
+    //
+    if ( attrV & KMPXMediaVideoSeekable.iAttributeId )
+    {
+        aMedia->SetTObjectValueL<TBool>(
+            TMPXAttribute( KMPXMediaVideoSeekable ),
+            iVideoPlaybackCtlr->iFileDetails->iSeekable );
+    }
+
+    //
+    //  Pausable
+    //
+    if ( attrV & KMPXMediaVideoPausableStream.iAttributeId )
+    {
+        aMedia->SetTObjectValueL<TBool>(
+            TMPXAttribute( KMPXMediaVideoPausableStream ),
+            iVideoPlaybackCtlr->iFileDetails->iPausableStream );
+    }
+
+    //
+    //  Video Height
+    //
+    if ( attrV & KMPXMediaVideoHeight.iAttributeId )
+    {
+        aMedia->SetTObjectValueL<TInt>(
+            TMPXAttribute( KMPXMediaVideoHeight ),
+            iVideoPlaybackCtlr->iFileDetails->iResolutionHeight );
+    }
+
+    //
+    //  Video Width
+    //
+    if ( attrV & KMPXMediaVideoWidth.iAttributeId )
+    {
+        aMedia->SetTObjectValueL<TInt>(
+            TMPXAttribute( KMPXMediaVideoWidth ),
+            iVideoPlaybackCtlr->iFileDetails->iResolutionWidth );
+    }
+
+    //
+    //  TV-Out Connected
+    //
+    if ( attrV & KMPXMediaVideoTvOutConnected.iAttributeId )
+    {
+        aMedia->SetTObjectValueL<TInt>(
+            TMPXAttribute( KMPXMediaVideoTvOutConnected ),
+            iVideoPlaybackCtlr->iAccessoryMonitor->IsTvOutConnected() );
+    }
+
+    //
+    //  BitRate
+    //
+    if ( attrV & KMPXMediaVideoBitRate.iAttributeId )
+    {
+        aMedia->SetTObjectValueL<TInt>(
+            TMPXAttribute( KMPXMediaVideoBitRate ),
+            iVideoPlaybackCtlr->iFileDetails->iBitRate );
+    }
+
+    //
+    //  FourCC Code
+    //
+    if ( attrV & KMPXMediaFourCCCode.iAttributeId )
+    {
+        aMedia->SetTObjectValueL<TUint32>(
+            TMPXAttribute( KMPXMediaFourCCCode ),
+            iVideoPlaybackCtlr->iFileDetails->iFourCCCode );
+    }
+
+    //
+    //  Drm Protected
+    //
+    if ( attrV & KMPXMediaVideoDrmProtected.iAttributeId )
+    {
+        aMedia->SetTObjectValueL<TInt>(
+            TMPXAttribute( KMPXMediaVideoDrmProtected ),
+            iVideoPlaybackCtlr->iFileDetails->iDrmProtected );
+    }
+
+    //
+    //  Description
+    //
+    if ( ( attrV & KMPXMediaVideoDescription.iAttributeId ) &&
+         ( iVideoPlaybackCtlr->iFileDetails->iDescription ) )
+    {
+        aMedia->SetTextValueL(
+            TMPXAttribute( KMPXMediaVideoDescription ),
+            *( iVideoPlaybackCtlr->iFileDetails->iDescription ) );
+    }
+
+    //
+    //  Location
+    //
+    if ( ( attrV & KMPXMediaVideoLocation.iAttributeId ) &&
+         ( iVideoPlaybackCtlr->iFileDetails->iLocation ) )
+    {
+        aMedia->SetTextValueL(
+            TMPXAttribute( KMPXMediaVideoLocation ),
+            *( iVideoPlaybackCtlr->iFileDetails->iLocation ) );
+    }
+
+    //
+    //  Copyright
+    //
+    if ( ( attrV & KMPXMediaVideoCopyright.iAttributeId ) &&
+         ( iVideoPlaybackCtlr->iFileDetails->iCopyright ) )
+    {
+        aMedia->SetTextValueL(
+            TMPXAttribute( KMPXMediaVideoCopyright ),
+            *( iVideoPlaybackCtlr->iFileDetails->iCopyright ) );
+    }
+
+    //
+    //  Language
+    //
+    if ( ( attrV & KMPXMediaVideoLanguage.iAttributeId ) &&
+         ( iVideoPlaybackCtlr->iFileDetails->iLanguage ) )
+    {
+        aMedia->SetTextValueL(
+            TMPXAttribute( KMPXMediaVideoLanguage ),
+            *( iVideoPlaybackCtlr->iFileDetails->iLanguage ) );
+    }
+
+    //
+    //  Keywords
+    //
+    if ( ( attrV & KMPXMediaVideoKeywords.iAttributeId ) &&
+         ( iVideoPlaybackCtlr->iFileDetails->iKeywords ) )
+    {
+        aMedia->SetTextValueL(
+            TMPXAttribute( KMPXMediaVideoKeywords ),
+            *( iVideoPlaybackCtlr->iFileDetails->iKeywords ) );
+    }
+
+    //
+    //  Creation date/time
+    //
+    if ( attrV & KMPXMediaVideoCreated.iAttributeId )
+    {
+        aMedia->SetTObjectValueL<TInt>(
+            TMPXAttribute( KMPXMediaVideoCreated ),
+            iVideoPlaybackCtlr->iFileDetails->iCreationTime );
+    }
+
+    //
+    //  Last Modified date/time
+    //
+    if ( attrV & KMPXMediaVideoLastModified.iAttributeId )
+    {
+        aMedia->SetTObjectValueL<TInt>(
+            TMPXAttribute( KMPXMediaVideoLastModified ),
+            iVideoPlaybackCtlr->iFileDetails->iModificationTime );
+    }
+
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackState::SendErrorToViewL
+//  ------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackState::SendErrorToViewL( TInt aError )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackState::SendErrorToViewL()"),
+                   _L("aError = %d"), aError );
+
+    //
+    //  create command to pass to playback plugin
+    //
+    CMPXMessage* message = CMPXMessage::NewL();
+    CleanupStack::PushL( message );
+
+    message->SetTObjectValueL<TMPXMessageId>( KMPXMessageGeneralId, KMPXMediaIdVideoPlayback );
+
+    message->SetTObjectValueL<TMPXVideoPlaybackCommand>
+        ( KMPXMediaVideoPlaybackCommand, EPbCmdPluginError );
+
+    message->SetTObjectValueL<TInt>( KMPXMediaVideoError, aError );
+
+    iVideoPlaybackCtlr->iMPXPluginObs->HandlePlaybackMessage( message, KErrNone );
+
+    CleanupStack::PopAndDestroy( message );
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackController::HandleUnexpectedError
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackState::HandleUnexpectedError( TInt aError )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackState::HandleUnexpectedError()"),
+                   _L("aError = %d"), aError );
+
+    MPX_TRAPD( err, SendErrorToViewL( aError ) );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackController::ResolveTimeoutError
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackState::ResolveTimeoutError(TInt aError)
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackState::ResolveTimeoutError()"),
+                   _L("aError = %d"), aError );
+
+    MPX_TRAPD( err, SendErrorToViewL( aError ) );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackState::SetAspectRatioL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackState::SetAspectRatioL( CMPXCommand& aCmd, TMMFScalingType aType )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackState::SetAspectRatioL()"),
+                   _L("aType = %d"), aType);
+
+    TMMFMessageDestinationPckg destinationPckg( KUidInterfaceMMFControllerScalingMsg );
+
+    TPckgBuf<TInt> scaleTypePckg( aType );
+
+    TInt err =
+        iVideoPlaybackCtlr->iPlayer->CustomCommandSync( destinationPckg,
+                                                        EMMFSetScalingType,
+                                                        scaleTypePckg,
+                                                        KNullDesC8 );
+
+    if ( err )
+    {
+        MPX_DEBUG(_L("CMPXVideoPlaybackState::SetAspectRatioL FAIL [%d]"), err);
+    }
+    else
+    {
+        iVideoPlaybackCtlr->iPlayer->RefreshFrameL();
+
+    }
+
+    aCmd.SetTObjectValueL<TInt>( KMPXMediaVideoAspectRatio, aType );
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackState::CommandHandleBackground
+//  ------------------------------------------------------------------------------------------------
+void  CMPXVideoPlaybackState::CommandHandleBackground()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackState::CommandHandleBackground()"));
+
+    //
+    //  Block playback in the following cases:
+    //  -  App is not in foreground
+    //  -  Alarm
+    //  -  Phone call
+    //  -  Video call
+    //
+    if ( !iVideoPlaybackCtlr->iAppInForeground ||
+         iVideoPlaybackCtlr->IsAlarm() ||
+         iVideoPlaybackCtlr->IsPhoneCall() ||
+         iVideoPlaybackCtlr->IsVideoCall() )
+    {
+        iVideoPlaybackCtlr->iAllowAutoPlay = EFalse;
+    }
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackState::CommandHandleForeground
+//  ------------------------------------------------------------------------------------------------
+void  CMPXVideoPlaybackState::CommandHandleForeground()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackState::CommandHandleForeground()"));
+
+    if ( ! iVideoPlaybackCtlr->IsActivePhoneCall() )
+    {
+        iVideoPlaybackCtlr->iAllowAutoPlay = ETrue;
+    }
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackState::HandleCustomPause()
+//  ------------------------------------------------------------------------------------------------
+void CMPXVideoPlaybackState::HandleCustomPause()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackState::HandleCustomPause()"));
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackState::HandleCustomPlay()
+//  ------------------------------------------------------------------------------------------------
+void CMPXVideoPlaybackState::HandleCustomPlay()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackState::HandleCustomPlay()"));
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackState::RetrieveBufferingPercentage()
+//  ------------------------------------------------------------------------------------------------
+TInt CMPXVideoPlaybackState::RetrieveBufferingPercentage()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackState::RetrieveBufferingPercentage()"));
+    return 100;
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackState::IssuePlayCommand()
+//  ------------------------------------------------------------------------------------------------
+void CMPXVideoPlaybackState::IssuePlayCommand( TMPXVideoPlaybackState aState,
+                                               MMPXPlaybackPluginObserver::TEvent aEvent,
+                                               TBool aSendEvent )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackState::IssuePlayCommand()"),
+                   _L("aState = %d, aEvent  = %d, aSendEvent = %d"), aState, aEvent, aSendEvent );
+
+    MPX_TRAPD( err, iVideoPlaybackCtlr->iPlayer->PlayL() );
+
+    if ( err == KErrNone )
+    {
+        iVideoPlaybackCtlr->ChangeState( aState );
+
+        if ( aSendEvent )
+        {
+            iVideoPlaybackCtlr->iMPXPluginObs->HandlePluginEvent( aEvent, 0, KErrNone );
+        }
+    }
+    else
+    {
+        TRAP_IGNORE( SendErrorToViewL( err ) );
+    }
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackState::UpdateSeekableL()
+//  ------------------------------------------------------------------------------------------------
+void CMPXVideoPlaybackState::UpdateSeekableL( CMPXCommand& aCmd )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackState::UpdateSeekableL()"));
+
+    iVideoPlaybackCtlr->iSeekable = aCmd.ValueTObjectL<TBool>(KMPXMediaGeneralExtVideoSeekable);
+
+    if ( iVideoPlaybackCtlr->iFileDetails )
+    {
+        iVideoPlaybackCtlr->iFileDetails->iSeekable &= iVideoPlaybackCtlr->iSeekable;
+    }
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXVideoPlaybackState::DoHandlePause()
+//  ------------------------------------------------------------------------------------------------
+void CMPXVideoPlaybackState::DoHandlePause()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackState::DoHandlePause()"));
+
+    TInt err = iVideoPlaybackCtlr->iPlaybackMode->HandlePause();
+
+    if ( err != KErrNone )
+    {
+        MPX_TRAPD( err2, SendErrorToViewL( err ) );
+    }
+}
+
+// *************************************************************************************************
+//
+//                          STATE SUB-CLASSES
+//
+// *************************************************************************************************
+
+
+
+// *************************************************************************************************
+//
+//                       CMPXNotInitialisedState
+//
+// *************************************************************************************************
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXNotInitialisedState::NewL()
+//  ------------------------------------------------------------------------------------------------
+CMPXVideoPlaybackState* CMPXNotInitialisedState::NewL(
+        CMPXVideoPlaybackController* aVideoPlaybackCtlr )
+{
+    MPX_ENTER_EXIT(_L("CMPXNotInitialisedState::NewL()"));
+
+    CMPXNotInitialisedState* self = new( ELeave ) CMPXNotInitialisedState();
+    CleanupStack::PushL( self );
+    self->ConstructL(aVideoPlaybackCtlr);
+    CleanupStack::Pop();
+    return self;
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXNotInitialisedState::~CMPXNotInitialisedState()
+//  ------------------------------------------------------------------------------------------------
+CMPXNotInitialisedState::~CMPXNotInitialisedState()
+{
+    MPX_DEBUG(_L("CMPXNotInitialisedState::~CMPXNotInitialisedState()"));
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXNotInitialisedState::HandleVolumeChange
+//  ------------------------------------------------------------------------------------------------
+void CMPXNotInitialisedState::HandleVolumeChange()
+{
+    MPX_DEBUG(_L("CMPXNotInitialisedState::HandleVolumeChange()"));
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXNotInitialisedState::RetrieveFileDetailsL
+//  ------------------------------------------------------------------------------------------------
+TInt CMPXNotInitialisedState::RetrieveFileDetailsL( const TArray<TMPXAttribute>& /*aAttrs*/,
+                                                    CMPXMedia* aMedia )
+{
+    MPX_DEBUG(_L("CMPXNotInitialisedState::RetrieveFileDetailsL()"));
+
+    TInt error = KErrNone;
+
+    if ( iVideoPlaybackCtlr->iPBPluginError != KErrNone )
+    {
+        if ( iVideoPlaybackCtlr->iClipName )
+        {
+            //
+            //  Send the clip name and error code for further processing
+            //
+            aMedia->SetTextValueL(
+                TMPXAttribute( KMPXMediaIdGeneral, EMPXMediaGeneralUri ),
+                *( iVideoPlaybackCtlr->iClipName ) );
+        }
+
+        aMedia->SetTObjectValueL<TInt>(
+            TMPXAttribute( KMPXMediaVideoError ), iVideoPlaybackCtlr->iPBPluginError );
+
+        iVideoPlaybackCtlr->iPBPluginError = KErrNone;
+    }
+    else
+    {
+        //
+        //  Invalid call for this state
+        //  Send HandleMedia with KErrNotReady
+        //
+        error = KErrNotReady;
+    }
+
+    return error;
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXNotInitialisedState::HandleClose
+//  ------------------------------------------------------------------------------------------------
+void CMPXNotInitialisedState::HandleClose()
+{
+    MPX_DEBUG(_L("CMPXNotInitialisedState::HandleClose()"));
+
+    iVideoPlaybackCtlr->CloseController();
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXNotInitialisedState::SetAspectRatioL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXNotInitialisedState::SetAspectRatioL( CMPXCommand& /*aCmd*/, TMMFScalingType /*aType*/ )
+{
+    MPX_DEBUG(_L("CMPXNotInitialisedState::SetAspectRatioL()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXNotInitialisedState::HandleUnexpectedError
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXNotInitialisedState::HandleUnexpectedError( TInt /*aError*/ )
+{
+    MPX_ENTER_EXIT(_L("CMPXNotInitialisedState::HandleUnexpectedError()"));
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXNotInitialisedState::HandleBackground()
+//  ------------------------------------------------------------------------------------------------
+void CMPXNotInitialisedState::HandleBackground()
+{
+    MPX_ENTER_EXIT(_L("CMPXNotInitialisedState::HandleBackground()"));
+    CommandHandleBackground();
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXNotInitialisedState::HandleForeground()
+//  ------------------------------------------------------------------------------------------------
+void CMPXNotInitialisedState::HandleForeground()
+{
+    MPX_ENTER_EXIT(_L("CMPXNotInitialisedState::HandleForeground()"));
+    CommandHandleForeground();
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXNotInitialisedState::HandlePlay()
+//  ------------------------------------------------------------------------------------------------
+void CMPXNotInitialisedState::HandlePlay()
+{
+    MPX_DEBUG(_L("CMPXNotInitialisedState::HandlePlay() Plugin error"));
+
+    MPX_TRAPD( err, SendErrorToViewL( iVideoPlaybackCtlr->iPBPluginError ) );
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXNotInitialisedState::UpdateSeekableL()
+//  ------------------------------------------------------------------------------------------------
+void CMPXNotInitialisedState::UpdateSeekableL( CMPXCommand& /*aCmd*/ )
+{
+    MPX_DEBUG(_L("CMPXNotInitialisedState::UpdateSeekableL()"));
+
+    //
+    //  Do not update the seekable state since the plugin is in the not initialized state
+    //  An error probably occurred, plugin went to not initialized.  If update was applied,
+    //  it would not be cleared for the next clip since we are already in not initialized
+    //  state.
+    //
+}
+
+// *************************************************************************************************
+//
+//                       CMPXInitialisingState
+//
+// *************************************************************************************************
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXInitialisingState::NewL()
+//  ------------------------------------------------------------------------------------------------
+CMPXVideoPlaybackState* CMPXInitialisingState::NewL(
+        CMPXVideoPlaybackController* aVideoPlaybackCtlr )
+{
+    MPX_ENTER_EXIT(_L("CMPXInitialisingState::NewL()"));
+
+    CMPXInitialisingState* self = new( ELeave ) CMPXInitialisingState();
+    CleanupStack::PushL( self );
+    self->ConstructL(aVideoPlaybackCtlr);
+    CleanupStack::Pop();
+    return self;
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXInitialisingState::~CMPXInitialisingState()
+//  ------------------------------------------------------------------------------------------------
+CMPXInitialisingState::~CMPXInitialisingState()
+{
+    MPX_DEBUG(_L("CMPXInitialisingState::~CMPXInitialisingState()"));
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXInitialisingState::OpenFileL
+//  ------------------------------------------------------------------------------------------------
+void CMPXInitialisingState::OpenFileL( const TDesC& aMediaFile )
+{
+    MPX_ENTER_EXIT(_L("CMPXInitialisingState::OpenFileL()"),
+                   _L("link = %S"), &aMediaFile );
+
+    iVideoPlaybackCtlr->iPBPluginError = KErrNone;
+
+    iVideoPlaybackCtlr->iPlaybackMode->OpenFileL( aMediaFile );
+}
+
+//  ----------------------------------------------------------------------------
+//  CMPXInitialisingState::OpenFileL
+//  ----------------------------------------------------------------------------
+void CMPXInitialisingState::OpenFileL( const RFile& aMediaFile )
+{
+    MPX_ENTER_EXIT(_L("CMPXInitialisingState::OpenFileL()"));
+
+    // Reset the plugin error
+    iVideoPlaybackCtlr->iPBPluginError = KErrNone;
+
+    iVideoPlaybackCtlr->iPlaybackMode->OpenFileL( aMediaFile );
+}
+
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+//  ----------------------------------------------------------------------------
+//  CMPXInitialisingState::OpenFile64L
+//  ----------------------------------------------------------------------------
+void CMPXInitialisingState::OpenFile64L( const RFile64& aMediaFile )
+{
+    MPX_ENTER_EXIT(_L("CMPXInitialisingState::OpenFile64L( RFile64 )"));
+
+    // Reset the plugin error
+    iVideoPlaybackCtlr->iPBPluginError = KErrNone;
+
+    iVideoPlaybackCtlr->iPlaybackMode->OpenFile64L( aMediaFile );
+}
+
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXInitialisingState::RetrieveFileDetailsL
+//  ------------------------------------------------------------------------------------------------
+TInt CMPXInitialisingState::RetrieveFileDetailsL( const TArray<TMPXAttribute>& /*aAttrs*/,
+                                                  CMPXMedia* /*aMedia*/ )
+{
+    MPX_DEBUG(_L("CMPXInitialisingState::RetrieveFileDetailsL()"));
+
+    //
+    //  Invalid call for this state
+    //  Send HandleMedia with KErrNotReady
+    //
+    return KErrNotReady;
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXInitialisingState::HandleOpenComplete()
+//
+//    State doesn't change just send prepare to MMF
+//  ------------------------------------------------------------------------------------------------
+//
+void CMPXInitialisingState::HandleOpenComplete( TInt aError )
+{
+    MPX_ENTER_EXIT(
+        _L("CMPXInitialisingState::HandleOpenComplete()"),
+        _L("error = %d"), aError );
+
+    if ( aError == KErrNone )
+    {
+        iVideoPlaybackCtlr->iPlaybackMode->HandleOpenComplete();
+
+        //
+        //  call setposition with converted value saved in openfile
+        //
+        if ( iVideoPlaybackCtlr->iSavedPosition > 0 )
+        {
+            MPX_DEBUG(_L("CMPXInitialisingState::HandleOpenComplete()  iSavedPosition %d"), iVideoPlaybackCtlr->iSavedPosition );
+
+            TInt64 pos( iVideoPlaybackCtlr->iSavedPosition );
+            pos *= KPbMilliMultiplier;
+
+            MPX_TRAPD( err, iVideoPlaybackCtlr->iPlayer->SetPositionL( pos ) );
+        }
+
+        MPX_DEBUG(_L("CMPXInitialisingState::HandleOpenComplete()  Sending Prepare()"));
+
+        iVideoPlaybackCtlr->iPlayer->Prepare();
+    }
+    else
+    {
+        iVideoPlaybackCtlr->HandleError( aError );
+    }
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXInitialisingState::HandlePrepareComplete
+//  ------------------------------------------------------------------------------------------------
+void CMPXInitialisingState::HandlePrepareComplete( TInt aError )
+{
+    MPX_ENTER_EXIT( _L("CMPXInitialisingState::HandlePrepareComplete()"),
+                    _L("error = %d"), aError);
+
+    TInt duration = 0;
+
+    if ( aError == KErrNone || aError == KErrMMPartialPlayback )
+    {
+        // Since PrepareComplete was successful - create post-init state instances needed
+        MPX_TRAPD( error, iVideoPlaybackCtlr->CreatePostInitStatesL() );
+
+        //
+        //  Read in the file details
+        //
+        MPX_TRAPD( err, iVideoPlaybackCtlr->ReadFileDetailsL() );
+
+        if ( aError == KErrMMPartialPlayback )
+        {
+            iVideoPlaybackCtlr->iFileDetails->iPartialPlayback = ETrue;
+        }
+
+        // for streaming playback, we should know whether its LIVE or On-Demand
+        // at this time
+        // in case of live streaming, playback controller's mode would need to change
+        MPX_TRAPD( setModeErr, iVideoPlaybackCtlr->SetPlaybackModeL() );
+
+        duration = iVideoPlaybackCtlr->iFileDetails->iDuration.Int64() / KPbMilliMultiplier;
+
+        MPX_TRAPD(setVolErr, iVideoPlaybackCtlr->SetVolumeMMFL());
+
+        //
+        //  Sent a open request, transistion to EMPXVideoInitialized
+        //
+        iVideoPlaybackCtlr->ChangeState( EMPXVideoInitialized );
+
+        iVideoPlaybackCtlr->iMPXPluginObs->
+            HandlePluginEvent( MMPXPlaybackPluginObserver::EPInitialised, duration, KErrNone );
+    }
+    else
+    {
+        iVideoPlaybackCtlr->HandleError( aError );
+    }
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXInitialisingState::HandleVolumeChange
+//  ------------------------------------------------------------------------------------------------
+void CMPXInitialisingState::HandleVolumeChange()
+{
+    MPX_DEBUG(_L("CMPXInitialisingState::HandleVolumeChange()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXInitialisingState::SetAspectRatioL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXInitialisingState::SetAspectRatioL( CMPXCommand& /*aCmd*/, TMMFScalingType /*aType*/ )
+{
+    MPX_DEBUG(_L("CMPXInitialisingState::SetAspectRatioL()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXInitialisingState::HandleUnexpectedError
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXInitialisingState::HandleUnexpectedError( TInt /*aError*/ )
+{
+    MPX_ENTER_EXIT(_L("CMPXInitialisingState::HandleUnexpectedError()"));
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXInitialisingState::HandleBackground()
+//  ------------------------------------------------------------------------------------------------
+void CMPXInitialisingState::HandleBackground()
+{
+    MPX_ENTER_EXIT(_L("CMPXInitialisingState::HandleBackground()"));
+    CommandHandleBackground();
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXInitialisingState::HandleForeground()
+//  ------------------------------------------------------------------------------------------------
+void CMPXInitialisingState::HandleForeground()
+{
+    MPX_ENTER_EXIT(_L("CMPXInitialisingState::HandleForeground()"));
+    CommandHandleForeground();
+}
+
+// *************************************************************************************************
+//
+//                       CMPXInitialisedState
+//
+// *************************************************************************************************
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXInitialisedState::NewL()
+//  ------------------------------------------------------------------------------------------------
+CMPXVideoPlaybackState* CMPXInitialisedState::NewL(
+        CMPXVideoPlaybackController* aVideoPlaybackCtlr )
+{
+    MPX_ENTER_EXIT(_L("CMPXInitialisedState::NewL()"));
+
+    CMPXInitialisedState* self = new( ELeave ) CMPXInitialisedState();
+    CleanupStack::PushL( self );
+    self->ConstructL(aVideoPlaybackCtlr);
+    CleanupStack::Pop();
+    return self;
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXInitialisedState::~CMPXInitialisedState()
+//  ------------------------------------------------------------------------------------------------
+CMPXInitialisedState::~CMPXInitialisedState()
+{
+    MPX_DEBUG(_L("CMPXInitialisedState::~CMPXInitialisedState()"));
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXInitialisedState::HandlePlay()
+//  ------------------------------------------------------------------------------------------------
+void CMPXInitialisedState::HandlePlay()
+{
+    MPX_DEBUG(_L("CMPXInitialisedState::HandlePlay()"));
+
+    if ( iVideoPlaybackCtlr->iPlaybackMode->CanPlayNow() )
+    {
+        IssuePlayCommand( EMPXVideoBuffering, MMPXPlaybackPluginObserver::EPBufferingStarted );
+    }
+    else
+    {
+        HandlePause();
+    }
+
+    iVideoPlaybackCtlr->iAllowAutoPlay = ETrue;
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXInitialisedState::HandleSetPositionL()
+//  ------------------------------------------------------------------------------------------------
+void CMPXInitialisedState::HandleSetPositionL( TInt aPosition )
+{
+    MPX_ENTER_EXIT(_L("CMPXInitialisedState::HandleSetPositionL()"),
+                   _L("position = %d"), aPosition );
+
+    if ( iVideoPlaybackCtlr->iFileDetails->iSeekable )
+    {
+        TInt64 pos( aPosition );
+
+        pos *= KPbMilliMultiplier;
+
+        //
+        //  No need to set position unless it is not 0
+        //
+        if ( pos != 0 )
+        {
+            iVideoPlaybackCtlr->iPlayer->SetPositionL( pos );
+        }
+    }
+    else
+    {
+        MPX_DEBUG(_L("CMPXInitialisedState::HandleSetPosition() FAIL - file is not seekable"));
+    }
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXInitialisedState::HandleStop()
+//  ------------------------------------------------------------------------------------------------
+void CMPXInitialisedState::HandleStop()
+{
+    MPX_ENTER_EXIT(_L("CMPXInitialisedState::HandleStop()"));
+
+    iVideoPlaybackCtlr->iPlayer->Stop();
+
+    iVideoPlaybackCtlr->ChangeState( EMPXVideoStopped );
+
+    iVideoPlaybackCtlr->iMPXPluginObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPStopped,
+                                                          0,
+                                                          KErrNone );
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXInitialisedState::HandleBackground()
+//  ------------------------------------------------------------------------------------------------
+void CMPXInitialisedState::HandleBackground()
+{
+    MPX_ENTER_EXIT(_L("CMPXInitialisedState::HandleBackground()"));
+    CommandHandleBackground();
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXInitialisedState::HandleForeground()
+//  ------------------------------------------------------------------------------------------------
+void CMPXInitialisedState::HandleForeground()
+{
+    MPX_ENTER_EXIT(_L("CMPXInitialisedState::HandleForeground()"));
+    CommandHandleForeground();
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXInitialisedState::HandlePause()
+//  ------------------------------------------------------------------------------------------------
+void CMPXInitialisedState::HandlePause()
+{
+    MPX_ENTER_EXIT(_L("CMPXInitialisedState::HandlePause()"));
+
+    TInt err = iVideoPlaybackCtlr->iPlaybackMode->HandlePause();
+
+    if ( err != KErrNone )
+    {
+        MPX_DEBUG(_L("CMPXInitialisedState::HandlePause() err = %d"), err);
+
+        //
+        //  For Initialized state, Helix will return an error of KErrNotReady since the DRM
+        //  rights consumption has not started.  Ignore the KErrNotReady error and transition
+        //  to the stopped state since no rights have been consumed.  This will free up
+        //  memory by closing the playback.
+        //
+        if ( err == KErrNotReady && iVideoPlaybackCtlr->iFileDetails->iDrmProtected )
+        {
+            HandleStop();
+        }
+        else
+        {
+            MPX_TRAPD( err2, SendErrorToViewL( err ) );
+        }
+    }
+}
+
+// *************************************************************************************************
+//
+//                          CMPXPlayingState
+//
+// *************************************************************************************************
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXPlayingState::NewL()
+//  ------------------------------------------------------------------------------------------------
+CMPXVideoPlaybackState* CMPXPlayingState::NewL(
+        CMPXVideoPlaybackController* aVideoPlaybackCtlr )
+{
+    MPX_ENTER_EXIT(_L("CMPXPlayingState::NewL()"));
+
+    CMPXPlayingState* self = new( ELeave ) CMPXPlayingState();
+    CleanupStack::PushL( self );
+    self->ConstructL(aVideoPlaybackCtlr);
+    CleanupStack::Pop();
+    return self;
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXPlayingState::~CMPXPlayingState()
+//  ------------------------------------------------------------------------------------------------
+CMPXPlayingState::~CMPXPlayingState()
+{
+    MPX_DEBUG(_L("CMPXPlayingState::~CMPXPlayingState()"));
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXPlayingState::HandleLoadingStarted()
+//  ------------------------------------------------------------------------------------------------
+void CMPXPlayingState::HandleLoadingStarted()
+{
+    MPX_DEBUG(_L("CMPXPlayingState::HandleLoadingStarted()"));
+
+    TInt loadingPercentage(0);
+
+    MPX_TRAPD( error, iVideoPlaybackCtlr->iPlayer->GetVideoLoadingProgressL( loadingPercentage ) );
+
+    if ( error == KErrNone )
+    {
+        MPX_DEBUG(_L("CMPXPlayingState::HandleLoadingStarted() Loading = %d"), loadingPercentage);
+
+        // if buffering is 100% - there is no need to transition to Buffering state
+        if ( loadingPercentage < 100 )
+        {
+            iVideoPlaybackCtlr->ChangeState( EMPXVideoBuffering );
+            iVideoPlaybackCtlr->iMPXPluginObs->HandlePluginEvent(
+                                                   MMPXPlaybackPluginObserver::EPBufferingStarted,
+                                                   0,
+                                                   KErrNone );
+        }
+    }
+    else
+    {
+        MPX_TRAPD( err, SendErrorToViewL( error ) );
+    }
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXPlayingState::HandleStop()
+//  ------------------------------------------------------------------------------------------------
+void CMPXPlayingState::HandleStop()
+{
+    MPX_ENTER_EXIT(_L("CMPXPlayingState::HandleStop()"));
+
+    iVideoPlaybackCtlr->iPlayer->Stop();
+
+    iVideoPlaybackCtlr->ChangeState(EMPXVideoStopped);
+
+    iVideoPlaybackCtlr->iMPXPluginObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPStopped,
+                                                          0,
+                                                          KErrNone );
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXPlayingState::HandlePause()
+//  ------------------------------------------------------------------------------------------------
+void CMPXPlayingState::HandlePause()
+{
+    MPX_ENTER_EXIT(_L("CMPXPlayingState::HandlePause()"));
+
+    DoHandlePause();
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXPlayingState::HandlePlayPause()
+//
+//  ------------------------------------------------------------------------------------------------
+void CMPXPlayingState::HandlePlayPause()
+{
+    MPX_DEBUG(_L("CMPXPlayingState::HandlePlayPause()"));
+    HandlePause();
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXPlayingState::HandleSetPosterFrame()
+//  ------------------------------------------------------------------------------------------------
+void CMPXPlayingState::HandleSetPosterFrame()
+{
+    MPX_DEBUG(_L("CMPXPlayingState::HandleSetPosterFrame()"));
+
+    iVideoPlaybackCtlr->iPlaybackMode->HandleSetPosterFrame();
+}
+
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXPlayingState::HandleStartSeekL()
+//  ------------------------------------------------------------------------------------------------
+void CMPXPlayingState::HandleStartSeekL( TBool aForward )
+{
+    MPX_ENTER_EXIT(_L("CMPXPlayingState::HandleStartSeekL()"));
+
+    if ( iVideoPlaybackCtlr->iFileDetails->iSeekable )
+    {
+        TTimeIntervalMicroSeconds pos = iVideoPlaybackCtlr->iPlayer->PositionL();
+
+        iVideoPlaybackCtlr->iVideoSeeker->StartSeekingL(
+            aForward,
+            GetState(),
+            pos.Int64(),
+            iVideoPlaybackCtlr->iFileDetails->iDuration.Int64() );
+
+        iVideoPlaybackCtlr->ChangeState( EMPXVideoSeeking );
+
+        iVideoPlaybackCtlr->iMPXPluginObs->HandlePluginEvent(
+            MMPXPlaybackPluginObserver::EPPluginSeeking,
+            0,
+            KErrNone );
+    }
+    else
+    {
+        MPX_DEBUG(_L("CMPXPlayingState::HandleStartSeek() FAIL - file is not seekable"));
+    }
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXPlayingState::HandleSetPositionL()
+//  ------------------------------------------------------------------------------------------------
+void CMPXPlayingState::HandleSetPositionL( TInt aPosition )
+{
+    MPX_ENTER_EXIT(_L("CMPXPlayingState::HandleSetPositionL()"),
+                   _L("position = %d"), aPosition );
+
+    if ( iVideoPlaybackCtlr->iFileDetails->iSeekable )
+    {
+        TInt64 pos( aPosition );
+
+        pos *= KPbMilliMultiplier;
+
+        //
+        //  Helix can't handle set position in playing state
+        //
+        iVideoPlaybackCtlr->iPlayer->PauseL();
+        iVideoPlaybackCtlr->iPlayer->SetPositionL( pos );
+
+        MPX_TRAPD( err, iVideoPlaybackCtlr->iPlayer->PlayL() );
+
+        if ( err != KErrNone )
+        {
+            SendErrorToViewL( err );
+        }
+    }
+    else
+    {
+        MPX_DEBUG(_L("CMPXPlayingState::HandleSetPosition() FAIL - file is not seekable"));
+    }
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXPlayingState::ResolveTimeoutError()
+//  ------------------------------------------------------------------------------------------------
+void CMPXPlayingState::ResolveTimeoutError( TInt aError )
+{
+    MPX_ENTER_EXIT(_L("CMPXPlayingState::ResolveTimeoutError()"),
+                   _L("aError = %d"), aError );
+
+    // Timeout while playing. Show disconnect dialog.
+    MPX_TRAPD( err, SendErrorToViewL( KErrDisconnected ) );
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXPlayingState::HandleBackground()
+//  ------------------------------------------------------------------------------------------------
+void CMPXPlayingState::HandleBackground()
+{
+    MPX_ENTER_EXIT(_L("CMPXPlayingState::HandleBackground()"));
+    iVideoPlaybackCtlr->iPlaybackMode->HandleBackground();
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXPlayingState::HandleCustomPause()
+//  As the custom pause can only be sent for non-live playback
+//  There is no need to call the  playback mode class to handle the custom pause
+//  ------------------------------------------------------------------------------------------------
+void CMPXPlayingState::HandleCustomPause()
+{
+    MPX_ENTER_EXIT(_L("CMPXPlayingState::HandleCustomPause()"));
+
+    MPX_TRAPD( err, iVideoPlaybackCtlr->iPlayer->PauseL() );
+
+    if ( err == KErrNone )
+    {
+        iVideoPlaybackCtlr->ChangeState( EMPXVideoPaused );
+    }
+    else
+    {
+        TRAP_IGNORE( iVideoPlaybackCtlr->iState->SendErrorToViewL( err ) );
+    }
+}
+
+// *************************************************************************************************
+//
+//                          CMPXPausedState
+//
+// *************************************************************************************************
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXVideoPlaybackState* CMPXPausedState::NewL()
+//  ------------------------------------------------------------------------------------------------
+CMPXVideoPlaybackState* CMPXPausedState::NewL( CMPXVideoPlaybackController* aVideoPlaybackCtlr )
+{
+    MPX_ENTER_EXIT(_L("CMPXPausedState::NewL()"));
+
+    CMPXPausedState* self = new( ELeave ) CMPXPausedState();
+    CleanupStack::PushL( self );
+    self->ConstructL(aVideoPlaybackCtlr);
+    CleanupStack::Pop();
+    return self;
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXPausedState::~CMPXPausedState()
+//  ------------------------------------------------------------------------------------------------
+CMPXPausedState::~CMPXPausedState()
+{
+    MPX_DEBUG(_L("CMPXPausedState::~CMPXPausedState()"));
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXPausedState::HandlePlay()
+//  ------------------------------------------------------------------------------------------------
+void CMPXPausedState::HandlePlay()
+{
+    MPX_ENTER_EXIT(_L("CMPXPausedState::HandlePlay()"));
+
+    if ( iVideoPlaybackCtlr->iPlaybackMode->CanPlayNow() )
+    {
+        MPX_TRAPD( error, iVideoPlaybackCtlr->iPlaybackMode->HandlePauseToPlayTransitionL() );
+    }
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXPausedState::HandlePlayPause()
+//  ------------------------------------------------------------------------------------------------
+void CMPXPausedState::HandlePlayPause()
+{
+    MPX_DEBUG(_L("CMPXPausedState::HandlePlayPause()"));
+    HandlePlay();
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXPausedState::HandleSetPosterFrame()
+//  ------------------------------------------------------------------------------------------------
+void CMPXPausedState::HandleSetPosterFrame()
+{
+    MPX_DEBUG(_L("CMPXPausedState::HandleSetPosterFrame()"));
+
+    iVideoPlaybackCtlr->iPlaybackMode->HandleSetPosterFrame();
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXPausedState::HandleSetPositionL()
+//  ------------------------------------------------------------------------------------------------
+void CMPXPausedState::HandleSetPositionL( TInt aPosition )
+{
+    MPX_ENTER_EXIT(_L("CMPXPausedState::HandleSetPositionL()"),
+                   _L("position = %d"), aPosition );
+
+    if ( iVideoPlaybackCtlr->iFileDetails->iSeekable )
+    {
+        TInt64 pos( aPosition );
+
+        pos *= KPbMilliMultiplier;
+
+        iVideoPlaybackCtlr->iPlayer->SetPositionL( pos );
+    }
+    else
+    {
+        MPX_DEBUG(_L("CMPXPausedState::HandleSetPosition() FAIL - file is not seekable"));
+    }
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXPausedState::HandleStop()
+//  ------------------------------------------------------------------------------------------------
+void CMPXPausedState::HandleStop()
+{
+    MPX_ENTER_EXIT(_L("CMPXPausedState::HandleStop()"));
+
+    iVideoPlaybackCtlr->iPlayer->Stop();
+
+    iVideoPlaybackCtlr->ChangeState(EMPXVideoStopped);
+
+    iVideoPlaybackCtlr->iMPXPluginObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPStopped,
+                                                          0,
+                                                          KErrNone );
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXPausedState::HandleStartSeekL()
+//  ------------------------------------------------------------------------------------------------
+void CMPXPausedState::HandleStartSeekL( TBool aForward )
+{
+    MPX_ENTER_EXIT(_L("CMPXPausedState::HandleStartSeekL()"));
+
+    if ( iVideoPlaybackCtlr->iFileDetails->iSeekable )
+    {
+        TTimeIntervalMicroSeconds pos = iVideoPlaybackCtlr->iPlayer->PositionL();
+
+        iVideoPlaybackCtlr->iVideoSeeker->StartSeekingL(
+            aForward,
+            GetState(),
+            pos.Int64(),
+            iVideoPlaybackCtlr->iFileDetails->iDuration.Int64() );
+
+        iVideoPlaybackCtlr->ChangeState( EMPXVideoSeeking );
+
+        iVideoPlaybackCtlr->iMPXPluginObs->HandlePluginEvent(
+            MMPXPlaybackPluginObserver::EPPluginSeeking,
+            0,
+            KErrNone );
+    }
+    else
+    {
+        MPX_DEBUG(_L("CMPXPlayingState::HandleStartSeek() FAIL - file is not seekable"));
+    }
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXPausedState::HandleForeground()
+//  ------------------------------------------------------------------------------------------------
+void CMPXPausedState::HandleForeground()
+{
+    MPX_ENTER_EXIT(_L("CMPXPausedState::HandleForeground()"));
+
+    MPX_TRAPD( err, iVideoPlaybackCtlr->iPlayer->RefreshFrameL() );
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXPausedState::HandleCustomPlay()
+//    Handle the custom play command only when in paused state.
+//    No state change is sent to the framework
+//  ------------------------------------------------------------------------------------------------
+void CMPXPausedState::HandleCustomPlay()
+{
+    MPX_ENTER_EXIT(_L("CMPXPausedState::HandleCustomPlay()"));
+
+    if ( iVideoPlaybackCtlr->iPlaybackMode->CanPlayNow() )
+    {
+        IssuePlayCommand( EMPXVideoPlaying, MMPXPlaybackPluginObserver::EPPlaying, EFalse );
+    }
+    else
+    {
+        // As the custom play command could not resume the playback. Send a pause event to
+        // the view though the MPX FW to get the view state in sync playback plugin.
+        iVideoPlaybackCtlr->iMPXPluginObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPPaused,
+                                                              0,
+                                                              KErrNone );
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXPausedState::HandleUnexpectedError
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXPausedState::HandleUnexpectedError( TInt aError )
+{
+    MPX_ENTER_EXIT(_L("CMPXPausedState::HandleUnexpectedError()"),
+                   _L("aError = %d"), aError );
+
+    if ( iVideoPlaybackCtlr->iPlaybackMode->SendErrorToView( aError ) )
+    {
+        MPX_TRAPD( err, SendErrorToViewL( aError ) );
+    }
+}
+
+// *************************************************************************************************
+//
+//                          CMPXStoppedState
+//
+// *************************************************************************************************
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXStoppedState::NewL()
+//  ------------------------------------------------------------------------------------------------
+CMPXVideoPlaybackState* CMPXStoppedState::NewL( CMPXVideoPlaybackController* aVideoPlaybackCtlr )
+{
+    MPX_ENTER_EXIT(_L("CMPXStoppedState::NewL()"));
+
+    CMPXStoppedState* self = new( ELeave ) CMPXStoppedState();
+    CleanupStack::PushL( self );
+    self->ConstructL(aVideoPlaybackCtlr);
+    CleanupStack::Pop();
+    return self;
+}
+//  ------------------------------------------------------------------------------------------------
+//  CMPXStoppedState::~CMPXStoppedState()
+//  ------------------------------------------------------------------------------------------------
+CMPXStoppedState::~CMPXStoppedState()
+{
+    MPX_DEBUG(_L("CMPXStoppedState::~CMPXStoppedState()"));
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXStoppedState::HandlePlay()
+//  ------------------------------------------------------------------------------------------------
+void CMPXStoppedState::HandlePlay()
+{
+    MPX_DEBUG(_L("CMPXStoppedState::HandlePlay()"));
+
+    if ( iVideoPlaybackCtlr->iPlaybackMode->CanPlayNow() )
+    {
+        IssuePlayCommand( EMPXVideoPlaying, MMPXPlaybackPluginObserver::EPPlaying );
+    }
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXStoppedState::HandleSetPositionL()
+//  ------------------------------------------------------------------------------------------------
+void CMPXStoppedState::HandleSetPositionL(TInt aPosition)
+{
+    MPX_ENTER_EXIT(_L("CMPXStoppedState::HandleSetPositionL()"),
+                   _L("position = %d"), aPosition );
+
+    if ( iVideoPlaybackCtlr->iFileDetails->iSeekable )
+    {
+        TInt64 pos( aPosition );
+
+        pos *= KPbMilliMultiplier;
+
+        iVideoPlaybackCtlr->iPlayer->SetPositionL( pos );
+    }
+    else
+    {
+        MPX_DEBUG(_L("CMPXStoppedState::HandleSetPosition() FAIL - file is not seekable"));
+    }
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXStoppedState::HandleClose
+//  ------------------------------------------------------------------------------------------------
+void CMPXStoppedState::HandleClose()
+{
+    MPX_ENTER_EXIT(_L("CMPXStoppedState::HandleClose()"));
+
+    iVideoPlaybackCtlr->CloseController();
+
+    iVideoPlaybackCtlr->iMPXPluginObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPClosed,
+                                                          0,
+                                                          KErrNone );
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXStoppedState::ResolveTimeoutError()
+//  ------------------------------------------------------------------------------------------------
+void CMPXStoppedState::ResolveTimeoutError( TInt aError )
+{
+    MPX_ENTER_EXIT(_L("CMPXStoppedState::ResolveTimeoutError()"),
+                   _L("aError = %d"), aError );
+
+    // Don't handle the error. Already in the stopped state
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXStoppedState::HandleUnexpectedError
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXStoppedState::HandleUnexpectedError( TInt aError )
+{
+    MPX_ENTER_EXIT(_L("CMPXStoppedState::HandleUnexpectedError()"),
+                   _L("aError = %d"), aError );
+
+    if ( iVideoPlaybackCtlr->iPlaybackMode->SendErrorToView( aError ) )
+    {
+        MPX_TRAPD( err, SendErrorToViewL( aError ) );
+    }
+}
+
+// *************************************************************************************************
+//
+//                          CMPXBufferingState
+//
+// *************************************************************************************************
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXBufferingState::NewL()
+//  ------------------------------------------------------------------------------------------------
+CMPXVideoPlaybackState* CMPXBufferingState::NewL( CMPXVideoPlaybackController* aVideoPlaybackCtlr )
+{
+    MPX_ENTER_EXIT(_L("CMPXBufferingState::NewL()"));
+
+    CMPXBufferingState* self = new( ELeave ) CMPXBufferingState();
+    CleanupStack::PushL( self );
+    self->ConstructL(aVideoPlaybackCtlr);
+    CleanupStack::Pop();
+    return self;
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXBufferingState::~CMPXBufferingState()
+//  ------------------------------------------------------------------------------------------------
+CMPXBufferingState::~CMPXBufferingState()
+{
+    MPX_DEBUG(_L("CMPXBufferingState::~CMPXBufferingState()"));
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXBufferingState::HandleLoadingStarted()
+//  ------------------------------------------------------------------------------------------------
+void CMPXBufferingState::HandleLoadingStarted()
+{
+    MPX_DEBUG(_L("CMPXBufferingState::HandleLoadingStarted()"));
+
+    TInt loadingPercentage = RetrieveBufferingPercentage();
+
+    if ( loadingPercentage < 100 )
+    {
+        MPX_TRAPD( err,
+        {
+            CMPXMessage* message = CMPXMessage::NewL();
+            CleanupStack::PushL( message );
+
+            message->SetTObjectValueL<TMPXMessageId>( KMPXMessageGeneralId,
+                                                      KMPXMediaIdVideoPlayback );
+
+            message->SetTObjectValueL<TMPXVideoPlaybackCommand>( KMPXMediaVideoPlaybackCommand,
+                                                                 EPbCmdLoadingStarted );
+
+            iVideoPlaybackCtlr->iMPXPluginObs->HandlePlaybackMessage( message, KErrNone );
+
+            CleanupStack::PopAndDestroy( message );
+        } );
+    }
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXBufferingState::HandleLoadingComplete()
+//  ------------------------------------------------------------------------------------------------
+void CMPXBufferingState::HandleLoadingComplete( TInt aError )
+{
+    MPX_ENTER_EXIT(_L("CMPXBufferingState::HandleLoadingComplete()"),
+                   _L("error = %d"), aError );
+
+    if ( aError == KErrNone )
+    {
+        if ( iVideoPlaybackCtlr->iPlaybackMode->CanPlayNow() )
+        {
+            iVideoPlaybackCtlr->ChangeState( EMPXVideoPlaying );
+
+            iVideoPlaybackCtlr->iMPXPluginObs->HandlePluginEvent(
+                                                    MMPXPlaybackPluginObserver::EPPlaying,
+                                                    0,
+                                                    KErrNone );
+        }
+        else
+        {
+            //
+            //  Delayed pause, background event was received while we were in buffering state
+            //
+            DoHandlePause();
+        }
+    }
+    else
+    {
+        HandleClose();
+    }
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXBufferingState::HandleStop()
+//  ------------------------------------------------------------------------------------------------
+void CMPXBufferingState::HandleStop()
+{
+    MPX_ENTER_EXIT(_L("CMPXBufferingState::HandleStop()"));
+
+    iVideoPlaybackCtlr->iPlayer->Stop();
+
+    iVideoPlaybackCtlr->ChangeState( EMPXVideoStopped );
+
+    iVideoPlaybackCtlr->iMPXPluginObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPStopped,
+                                                          0,
+                                                          KErrNone );
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXBufferingState::HandleBackground()
+//  ------------------------------------------------------------------------------------------------
+void CMPXBufferingState::HandleBackground()
+{
+    MPX_DEBUG(_L("CMPXBufferingState::HandleBackground()"));
+    iVideoPlaybackCtlr->iPlaybackMode->HandleBackground();
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXBufferingState::HandleForeground()
+//  ------------------------------------------------------------------------------------------------
+void CMPXBufferingState::HandleForeground()
+{
+    MPX_DEBUG(_L("CMPXBufferingState::HandleForeground()"));
+
+    //
+    //  We are in buffering state and received a background and foreground event
+    //  playback will continue when buffering is complete
+    //
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXBufferingState::HandlePause()
+//  ------------------------------------------------------------------------------------------------
+void CMPXBufferingState::HandlePause()
+{
+    MPX_DEBUG(_L("CMPXBufferingState::HandlePause()"));
+
+    //
+    //  PDL must take action on the pause while buffering when the download is paused
+    //
+    if ( iVideoPlaybackCtlr->iPlaybackMode->IsDownloadPaused() )
+    {
+        DoHandlePause();
+    }
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXBufferingState::ResolveTimeoutError()
+//  ------------------------------------------------------------------------------------------------
+void CMPXBufferingState::ResolveTimeoutError( TInt aError )
+{
+    MPX_ENTER_EXIT(_L("CMPXBufferingState::ResolveTimeoutError()"),
+                   _L("aError = %d"), aError );
+
+    // Timeout while buffering. Show buffer error.
+    MPX_TRAPD( err, SendErrorToViewL( KErrTimedOut ) );
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXBufferingState::RetrieveBufferingPercentage()
+//  ------------------------------------------------------------------------------------------------
+TInt CMPXBufferingState::RetrieveBufferingPercentage()
+{
+    TInt loadingProgress( 0 );
+
+    MPX_TRAPD( error, iVideoPlaybackCtlr->iPlayer->GetVideoLoadingProgressL( loadingProgress ) );
+    MPX_DEBUG(_L("CMPXBufferingState::RetrieveBufferingPercentage(%d)"), loadingProgress);
+
+    return loadingProgress;
+}
+
+// *************************************************************************************************
+//
+//                          CMPXSeekingState
+//
+// *************************************************************************************************
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXSeekingState::NewL()
+//  ------------------------------------------------------------------------------------------------
+CMPXVideoPlaybackState* CMPXSeekingState::NewL( CMPXVideoPlaybackController* aVideoPlaybackCtlr )
+{
+    MPX_ENTER_EXIT(_L("CMPXSeekingState::NewL()"));
+
+    CMPXSeekingState* self = new( ELeave ) CMPXSeekingState();
+    CleanupStack::PushL( self );
+    self->ConstructL(aVideoPlaybackCtlr);
+    CleanupStack::Pop();
+    return self;
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXSeekingState::~CMPXSeekingState()
+//  ------------------------------------------------------------------------------------------------
+CMPXSeekingState::~CMPXSeekingState()
+{
+    MPX_DEBUG(_L("CMPXSeekingState::~CMPXSeekingState()"));
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXSeekingState::HandlePlay()
+//  ------------------------------------------------------------------------------------------------
+void CMPXSeekingState::HandlePlay()
+{
+    MPX_DEBUG(_L("CMPXSeekingState::HandlePlay()"));
+
+    if ( iVideoPlaybackCtlr->iPlaybackMode->CanPlayNow() )
+    {
+        IssuePlayCommand( EMPXVideoPlaying, MMPXPlaybackPluginObserver::EPPlaying );
+    }
+    else
+    {
+        HandlePause();
+    }
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMPXSeekingState::HandleBackground()
+//  ------------------------------------------------------------------------------------------------
+void CMPXSeekingState::HandleBackground()
+{
+    MPX_ENTER_EXIT(_L("CMPXSeekingState::HandleBackground()"));
+
+    MPX_TRAPD( err, HandleStopSeekL() );
+    iVideoPlaybackCtlr->iPlaybackMode->HandleBackground();
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXSeekingState::HandlePause()
+//  ------------------------------------------------------------------------------------------------
+void CMPXSeekingState::HandlePause()
+{
+    MPX_ENTER_EXIT(_L("CMPXSeekingState::HandlePause()"));
+
+    MPX_TRAPD( err, HandleStopSeekL() );
+
+    DoHandlePause();
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXSeekingState::HandleStopSeekL()
+//  ------------------------------------------------------------------------------------------------
+void CMPXSeekingState::HandleStopSeekL()
+{
+    MPX_ENTER_EXIT(_L("CMPXSeekingState::HandleStopSeekL()"));
+
+    iVideoPlaybackCtlr->iVideoSeeker->StopSeekingL();
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXSeekingState::HandleSetPositionL()
+//  ------------------------------------------------------------------------------------------------
+void CMPXSeekingState::HandleSetPositionL( TInt aPosition )
+{
+    MPX_ENTER_EXIT(_L("CMPXSeekingState::HandleSetPositionL()"),
+                   _L("position = %d"), aPosition );
+
+    if ( iVideoPlaybackCtlr->iFileDetails->iSeekable )
+    {
+        TInt64 pos( aPosition );
+
+        pos *= KPbMilliMultiplier;
+
+        iVideoPlaybackCtlr->iPlayer->SetPositionL( pos );
+    }
+    else
+    {
+        MPX_DEBUG(_L("CMPXSeekingState::HandleSetPosition() FAIL - file is not seekable"));
+    }
+}
+
+//  ------------------------------------------------------------------------------------------------
+//  CMPXSeekingState::HandleStop()
+//  ------------------------------------------------------------------------------------------------
+void CMPXSeekingState::HandleStop()
+{
+    MPX_ENTER_EXIT(_L("CMPXSeekingState::HandleStop()"));
+
+    iVideoPlaybackCtlr->iPlayer->Stop();
+
+    iVideoPlaybackCtlr->ChangeState( EMPXVideoStopped );
+
+    iVideoPlaybackCtlr->iMPXPluginObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPStopped,
+                                                          0,
+                                                          KErrNone );
+}
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/src/mpxvideoplayerutility.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,805 @@
+/*
+* 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:  This class is the interface between the playback plugin and RMMFController
+*
+*/
+
+
+// Version : %version: ou1cpsw#24 %
+
+
+#include <AudioPreference.h>
+#include <mmf/server/mmffile.h>
+#include <caf/caftypes.h>
+#include <mpxmessagegeneraldefs.h>
+#include <fbs.h>
+
+#include "mpxvideoplayerutility.h"
+#include "mpxvideoplaybackcontroller.h"
+#include <mpxvideoplaybackdefs.h>
+#include "mpxvideo_debug.h"
+#include "mpxvideoconnectionutility.h"
+
+const TInt KBufferExpandSize = 100;
+const TUid KSourceUid = { KMmfUidFileSource };
+
+CMpxVideoPlayerUtility*
+CMpxVideoPlayerUtility::NewL( CMPXVideoPlaybackController* aVideoPlaybackCtrl )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::NewL()"));
+
+    CMpxVideoPlayerUtility* self = new (ELeave) CMpxVideoPlayerUtility( aVideoPlaybackCtrl );
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+}
+
+CMpxVideoPlayerUtility::CMpxVideoPlayerUtility( CMPXVideoPlaybackController* aVideoPlaybackCtrl )
+    : CActive( EPriorityStandard )
+    , iVideoPlaybackController( aVideoPlaybackCtrl )
+    , iVideoControllerCustomCommands( iController )
+    , iVideoPlayControllerCustomCommands( iController )
+    , iAudioPlayDeviceCustomCommands( iController )
+    , iDrmCustomCommands( iController )
+    , iVideoPlayControllerExtCustomCommands( iController )
+#ifdef SYMBIAN_BUILD_GCE
+    , iVideoPlaySurfaceSupportCustomCommands( iController )
+#endif
+{
+}
+
+void CMpxVideoPlayerUtility::ConstructL()
+{
+    OpenControllerL();
+
+    CActiveScheduler::Add( this );
+}
+
+CMpxVideoPlayerUtility::~CMpxVideoPlayerUtility()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::~CMpxVideoPlayerUtility()"));
+
+    Close();
+}
+
+void CMpxVideoPlayerUtility::Close()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::Close()"));
+
+    if ( iControllerEventMonitor )
+    {
+        iControllerEventMonitor->Cancel();
+        delete iControllerEventMonitor;
+        iControllerEventMonitor = NULL;
+    }
+
+    iSurfaceId = TSurfaceId::CreateNullId();
+
+    iController.Close();
+    iDirectScreenAccessAbort = EFalse;
+
+    if ( IsActive() )
+    {
+        Cancel();
+
+        if ( iPosterFrameBitmap )
+        {
+            delete iPosterFrameBitmap;
+            iPosterFrameBitmap = NULL;
+        }
+    }
+}
+
+void CMpxVideoPlayerUtility::Reset()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::Reset()"));
+
+    Close();
+    MPX_TRAPD( err, OpenControllerL() );
+}
+
+void CMpxVideoPlayerUtility::OpenControllerL()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::OpenControllerL()"));
+
+    const TUid KHelixUID = {0x101F8514};
+
+    TMMFPrioritySettings settings;
+    settings.iPriority = KAudioPriorityRealOnePlayer;
+    settings.iPref = TMdaPriorityPreference( KAudioPrefRealOneLocalPlayback );
+
+    User::LeaveIfError( iController.Open( KHelixUID, settings, ETrue ) );
+
+    //
+    //  Let MMF Controller (Helix) handle evaluation & consumption of DRM rights
+    //  this call is necessary since default Helix behavior (for OMA 1&2) is to
+    //  not consume rights. Helix's default behavior for WMDRM is to consume rights.
+    //  This call ensures Helix will consume rights for all DRM types.
+    //
+    iDrmCustomCommands.DisableAutomaticIntent( EFalse );
+
+    //
+    //  Start monitoring controller events
+    //
+    if ( iControllerEventMonitor )
+    {
+        iControllerEventMonitor->Cancel();
+        delete iControllerEventMonitor;
+        iControllerEventMonitor = NULL;
+    }
+
+    iControllerEventMonitor = CMMFControllerEventMonitor::NewL( *this, iController );
+
+    iControllerEventMonitor->Start();
+}
+
+TTimeIntervalMicroSeconds CMpxVideoPlayerUtility::PositionL() const
+{
+    TTimeIntervalMicroSeconds position;
+    User::LeaveIfError( iController.GetPosition( position ) );
+
+    MPX_DEBUG(_L("CMpxVideoPlayerUtility::PositionL(%Ld)"), position.Int64());
+
+    return position;
+}
+
+TTimeIntervalMicroSeconds CMpxVideoPlayerUtility::DurationL() const
+{
+    TTimeIntervalMicroSeconds duration;
+    User::LeaveIfError( iController.GetDuration( duration ) );
+
+    MPX_DEBUG(_L("CMpxVideoPlayerUtility::DurationL(%Ld)"), duration.Int64());
+
+    return duration;
+}
+
+TInt CMpxVideoPlayerUtility::NumberOfMetaDataEntriesL() const
+{
+    TInt num = 0;
+    User::LeaveIfError( iController.GetNumberOfMetaDataEntries( num ) );
+
+    MPX_DEBUG(_L("CMpxVideoPlayerUtility::NumberOfMetaDataEntriesL(%d)"), num);
+
+    return num;
+}
+
+CMMFMetaDataEntry* CMpxVideoPlayerUtility::MetaDataEntryL( TInt aMetaDataIndex ) const
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::MetaDataEntryL()"),
+                   _L("index = %d"), aMetaDataIndex );
+
+    return iController.GetMetaDataEntryL( aMetaDataIndex );
+}
+
+void CMpxVideoPlayerUtility::SetVolumeL( TInt aVolume )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::SetVolumeL()"),
+                   _L("volume = %d"), aVolume );
+
+    User::LeaveIfError( iAudioPlayDeviceCustomCommands.SetVolume( aVolume ) );
+}
+
+TInt CMpxVideoPlayerUtility::Volume() const
+{
+    TInt vol = 0;
+    iAudioPlayDeviceCustomCommands.GetVolume( vol );
+
+    MPX_DEBUG(_L("CMpxVideoPlayerUtility::Volume(%d)"), vol);
+
+    return vol;
+}
+
+TInt CMpxVideoPlayerUtility::MaxVolume() const
+{
+    TInt maxVol = 0;
+    iAudioPlayDeviceCustomCommands.GetMaxVolume( maxVol );
+
+    MPX_DEBUG(_L("CMpxVideoPlayerUtility::MaxVolume(%d)"), maxVol);
+
+    return maxVol;
+}
+
+void CMpxVideoPlayerUtility::VideoFrameSizeL( TSize& aSize ) const
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::VideoFrameSizeL()"));
+    User::LeaveIfError( iVideoControllerCustomCommands.GetVideoFrameSize( aSize ) );
+}
+
+TInt CMpxVideoPlayerUtility::VideoBitRateL() const
+{
+    TInt bitRate;
+    User::LeaveIfError( iVideoControllerCustomCommands.GetVideoBitRate( bitRate ) );
+
+    MPX_DEBUG(_L("CMpxVideoPlayerUtility::VideoBitRateL(%d)"), bitRate);
+
+    return bitRate;
+}
+TInt CMpxVideoPlayerUtility::AudioBitRateL() const
+{
+    TInt bitRate;
+    User::LeaveIfError( iVideoControllerCustomCommands.GetAudioBitRate( bitRate ) );
+
+    MPX_DEBUG(_L("CMpxVideoPlayerUtility::AudioBitRateL(%d)"), bitRate);
+
+    return bitRate;
+}
+
+TInt CMpxVideoPlayerUtility::VideoFormatMimeType( TDes8& aMimeType ) const
+{
+    return iVideoControllerCustomCommands.GetVideoMimeType( aMimeType );
+}
+
+TUint32 CMpxVideoPlayerUtility::FourCCCode() const
+{
+    TFourCC aFourCC( 0 );
+    iVideoControllerCustomCommands.GetAudioCodec( aFourCC );
+
+    return aFourCC.FourCC();
+}
+
+void CMpxVideoPlayerUtility::RefreshFrameL()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::RefreshFrameL()"));
+
+    User::LeaveIfError( iVideoPlayControllerCustomCommands.RefreshFrame() );
+}
+
+void CMpxVideoPlayerUtility::RestartDsa( const TRegion& aRegion )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::RestartDsa()"));
+
+    iVideoPlayControllerCustomCommands.UpdateDisplayRegion( aRegion );
+    iVideoPlayControllerCustomCommands.DirectScreenAccessEvent( EResumeDSA );
+}
+
+void CMpxVideoPlayerUtility::AbortDsa()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::AbortDsa()"));
+
+    iVideoPlayControllerCustomCommands.DirectScreenAccessEvent( EAbortDSA );
+    iDirectScreenAccessAbort = ETrue;
+}
+
+void CMpxVideoPlayerUtility::SetDisplayWindowL( const TRect& aScreenRect,
+                                                const TRect& aClipRect,
+                                                const TRegion& aDrawingRegion )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::SetDisplayWindowL()"));
+
+    User::LeaveIfError(
+            iVideoPlayControllerCustomCommands.SetDisplayWindow( aScreenRect, aClipRect) );
+
+    User::LeaveIfError(
+            iVideoPlayControllerCustomCommands.UpdateDisplayRegion( aDrawingRegion ) );
+
+    if ( iDirectScreenAccessAbort )
+    {
+        User::LeaveIfError(
+                iVideoPlayControllerCustomCommands.DirectScreenAccessEvent( EResumeDSA ) );
+
+        iDirectScreenAccessAbort = EFalse;
+    }
+}
+
+TBool CMpxVideoPlayerUtility::AudioEnabledL() const
+{
+    TBool enabled;
+    User::LeaveIfError( iVideoPlayControllerCustomCommands.GetAudioEnabled( enabled ) );
+
+    MPX_DEBUG(_L("CMpxVideoPlayerUtility::AudioEnabledL(%d)"), enabled);
+
+    return enabled;
+}
+
+void CMpxVideoPlayerUtility::Prepare()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::Prepare()"));
+
+    TInt error = iVideoPlayControllerCustomCommands.Prepare();
+
+    if ( error )
+    {
+        TMMFEvent event( KMMFEventCategoryVideoPrepareComplete, error );
+        iVideoPlaybackController->HandleMMFEvent( event );
+    }
+}
+
+void CMpxVideoPlayerUtility::GetVideoLoadingProgressL( TInt& aPercentageProgress )
+{
+    User::LeaveIfError(
+        iVideoPlayControllerCustomCommands.GetLoadingProgress( aPercentageProgress ) );
+
+    MPX_DEBUG(_L("CMpxVideoPlayerUtility::GetVideoLoadingProgressL(%d)"), aPercentageProgress );
+}
+
+void CMpxVideoPlayerUtility::GetFrameL()
+{
+    MPX_DEBUG(_L("CMpxVideoPlayerUtility::GetFrameL"));
+
+    // dont get another frame if a request is already pending
+    //
+    if ( ! IsActive() )
+    {
+        iPosterFrameBitmap = new (ELeave) CFbsBitmap;
+        User::LeaveIfError(iPosterFrameBitmap->Create(TSize(0,0), EColor16MU));
+
+        iVideoPlayControllerCustomCommands.GetFrame( *iPosterFrameBitmap, iStatus );
+        SetActive();
+    }
+
+}
+
+void CMpxVideoPlayerUtility::RunL()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::RunL()"));
+
+    if ( iStatus.Int() == KErrNone )
+    {
+        iVideoPlaybackController->HandleFrameReady( iStatus.Int() );
+    }
+    else
+    {
+        // Bitmap ownership will NOT be transferred to thumbnail manager so delete it
+        delete iPosterFrameBitmap;
+        iPosterFrameBitmap = NULL;
+    }
+}
+
+void CMpxVideoPlayerUtility::DoCancel()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::DoCancel()"));
+
+    // Bitmap ownership will NOT be transferred to thumbnail manager so delete it
+    delete iPosterFrameBitmap;
+    iPosterFrameBitmap = NULL;
+}
+
+CFbsBitmap& CMpxVideoPlayerUtility::GetBitmap()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::GetBitmap()"));
+
+    return *iPosterFrameBitmap;
+}
+
+void CMpxVideoPlayerUtility::PlayL()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::PlayL()"));
+
+    User::LeaveIfError( iController.Play() );
+}
+
+void CMpxVideoPlayerUtility::PauseL()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::PauseL()"));
+
+    User::LeaveIfError( iController.Pause() );
+}
+
+void CMpxVideoPlayerUtility::SetPlayVelocityL( TInt aVelocity )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::SetPlayVelocityL()"),
+                   _L("velocity = %d"), aVelocity);
+
+    User::LeaveIfError( iVideoPlayControllerExtCustomCommands.SetPlayVelocity( aVelocity ) );
+}
+
+void CMpxVideoPlayerUtility::SetPositionL(const TTimeIntervalMicroSeconds& aPosition)
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::SetPositionL()"),
+                   _L("aPosition = %Ld"), aPosition.Int64());
+
+    User::LeaveIfError( iController.SetPosition( aPosition ) );
+}
+
+TInt CMpxVideoPlayerUtility::Stop()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::Stop()"));
+
+    return iController.Stop();
+}
+
+void CMpxVideoPlayerUtility::HandleEvent( const TMMFEvent& aEvent )
+{
+    MPX_ENTER_EXIT(
+        _L("CMpxVideoPlayerUtility::HandleEvent()"),
+        _L("EventType = 0x%08x, ErrorCode = %d"), aEvent.iEventType, aEvent.iErrorCode );
+
+    //
+    //  Call on the controller to handle the event
+    //
+    iVideoPlaybackController->HandleMMFEvent( aEvent );
+}
+
+void CMpxVideoPlayerUtility::OpenFileL( const RFile& aFile )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::OpenFileL()"));
+
+    RFile& file = const_cast<RFile&>( aFile );
+
+    TMMFileHandleSource filehandlesource( file,
+                                          ContentAccess::KDefaultContentObject,
+                                          ContentAccess::EPlay );
+
+    HBufC* uniqueId = filehandlesource.UniqueId().AllocL();
+    CleanupStack::PushL( uniqueId );
+
+    TBool enableUi = filehandlesource.IsUIEnabled();
+
+    //
+    //  Create config for file handle source
+    //
+    CBufFlat* buf = CBufFlat::NewL( KBufferExpandSize );
+    CleanupStack::PushL( buf );
+
+    RBufWriteStream stream;
+    stream.Open( *buf );
+
+    CleanupClosePushL( stream );
+
+    TPckgBuf<RFile*> fileptr( &file );
+
+    stream.WriteInt32L( KMMFileHandleSourceUid.iUid );
+    stream.WriteL( fileptr );
+
+    TInt length = 0;
+
+    if ( uniqueId )
+    {
+        length = uniqueId->Length();
+    }
+
+    stream.WriteInt32L( length );
+
+    if ( length > 0 )
+    {
+        stream.WriteL( *uniqueId );
+    }
+
+    stream.WriteInt32L( enableUi );
+
+    stream.CommitL();
+
+    CleanupStack::PopAndDestroy( &stream );
+
+    HBufC8* sourceData = buf->Ptr(0).AllocL();
+
+    iController.AddDataSource( KSourceUid, sourceData->Des() );
+    iController.AddDataSink( KUidMmfAudioOutput, KNullDesC8 );
+
+    delete sourceData;
+
+#ifdef SYMBIAN_BUILD_GCE
+    iVideoPlaySurfaceSupportCustomCommands.UseSurfaces();
+#endif
+
+    CleanupStack::PopAndDestroy( buf );
+    CleanupStack::PopAndDestroy( uniqueId );
+}
+
+void CMpxVideoPlayerUtility::OpenFileL( const TDesC& aFileName )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::OpenFileL()"),
+                   _L("aFileName = %S"), &aFileName);
+
+    TMMFFileConfig srcConfig;
+    srcConfig().iPath = aFileName;
+
+    const TUid KSourceUid = { KMmfUidFileSource };
+
+    iController.AddDataSource( KSourceUid, srcConfig );
+    iController.AddDataSink( KUidMmfAudioOutput, KNullDesC8 );
+}
+
+void CMpxVideoPlayerUtility::OpenUrlL( const TDesC& aUrl, TInt aApId )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::OpenUrlL()"),
+                   _L("aUrl = %S, ApId = %d"), &aUrl, aApId);
+
+    CBufFlat* urlCfgBuffer = NULL;
+    
+    // Change access point to streaming accesspoint if necessary
+    aApId = MpxVideoConnectionUtility::CheckAccessPointL(aApId);
+    
+    CMMFUrlParams* urlCfg = CMMFUrlParams::NewL( aUrl, aApId );
+    CleanupStack::PushL( urlCfg );
+
+    urlCfgBuffer = urlCfg->ExternalizeToCBufFlatLC();
+
+    iController.AddDataSource( KUidMmfUrlSource, urlCfgBuffer->Ptr(0) );
+    iController.AddDataSink( KUidMmfAudioOutput, KNullDesC8 );
+
+#ifdef SYMBIAN_BUILD_GCE
+    iVideoPlaySurfaceSupportCustomCommands.UseSurfaces();
+#endif
+
+    CleanupStack::PopAndDestroy( 2 );  // urlCfg & urlCfgBuffer
+}
+
+TInt CMpxVideoPlayerUtility::CustomCommandSync( const TMMFMessageDestinationPckg& aDestination,
+                                                TInt aFunction,
+                                                const TDesC8& aDataTo1,
+                                                const TDesC8& aDataTo2 )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::CustomCommandSync()"));
+
+    return iController.CustomCommandSync( aDestination, aFunction, aDataTo1, aDataTo2 );
+}
+
+
+#ifdef SYMBIAN_BUILD_GCE
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayerUtility::VideoSurfaceCreated()
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMpxVideoPlayerUtility::VideoSurfaceCreated()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::VideoSurfaceCreated()"));
+
+    TInt error = KErrNone;
+
+    if ( iSurfaceId.IsNull() )
+    {
+        TSurfaceId surfaceId;
+
+        error = iVideoPlaySurfaceSupportCustomCommands.GetSurfaceParameters( surfaceId,
+                                                                             iCropRect,
+                                                                             iAspectRatio );
+
+        if ( error == KErrNone )
+        {
+            if ( iVideoPlaybackController->IsViewActivated() )
+            {
+                //
+                //  Send data to the display handler to remove old surface and add new surface
+                //
+                MPX_TRAPD( err, SendSurfaceCommandL( EPbMsgVideoSurfaceCreated,
+                                                     surfaceId,
+                                                     iCropRect,
+                                                     iAspectRatio ) );
+            }
+
+            iSurfaceId = surfaceId;
+        }
+    }
+    else
+    {
+        error = KErrAlreadyExists;
+    }
+
+    return error;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayerUtility::SurfaceParametersChanged()
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMpxVideoPlayerUtility::SurfaceParametersChanged()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::SurfaceParametersChanged()"));
+
+    TInt error = KErrNone;
+
+    if ( iSurfaceId.IsNull() )
+    {
+        error = KErrNotSupported;
+    }
+    else
+    {
+        TSurfaceId surfaceId;
+        TRect cropRect;
+        TVideoAspectRatio aspectRatio;
+
+        error = iVideoPlaySurfaceSupportCustomCommands.GetSurfaceParameters( surfaceId,
+                                                                             cropRect,
+                                                                             aspectRatio );
+
+        if ( error == KErrNone )
+        {
+            if ( iSurfaceId != surfaceId )
+            {
+                error = KErrInUse;
+            }
+            else
+            {
+                //
+                //  Send data to the display handler to remove old surface and add new surface
+                //
+                MPX_TRAPD( err, SendSurfaceCommandL( EPbMsgVideoSurfaceChanged,
+                                                     surfaceId,
+                                                     cropRect,
+                                                     aspectRatio ) );
+            }
+        }
+    }
+
+    return error;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayerUtility::RemoveSurface()
+// -------------------------------------------------------------------------------------------------
+//
+void CMpxVideoPlayerUtility::RemoveSurface()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::RemoveSurface()"));
+
+    if ( ! iSurfaceId.IsNull() )
+    {
+        //
+        //  Send command to view to remove the surface
+        //
+        MPX_TRAPD( err, SendSurfaceCommandL( EPbMsgVideoSurfaceRemoved ) );
+
+        iSurfaceId = TSurfaceId::CreateNullId();
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayerUtility::RemoveSurfaceFromHelix()
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMpxVideoPlayerUtility::RemoveSurfaceFromHelix( TSurfaceId aSurfaceId )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::RemoveSurfaceFromHelix()"));
+
+    TInt error = KErrNone;
+
+    error = iVideoPlaySurfaceSupportCustomCommands.SurfaceRemoved( aSurfaceId );
+
+    return error;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayerUtility::SendSurfaceCommandL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMpxVideoPlayerUtility::SendSurfaceCommandL( TInt aCmd )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::SendSurfaceCommandL()"),
+                   _L("aCmd = %d"), aCmd );
+
+    if ( iVideoPlaybackController->iMPXPluginObs )
+    {
+        CMPXMessage* msg = CMPXMessage::NewL();
+        CleanupStack::PushL( msg );
+
+        msg->SetTObjectValueL<TInt>( KMPXMessageGeneralId, KMPXMediaIdVideoDisplayMessage );
+        msg->SetTObjectValueL<TInt>( KMPXMediaVideoDisplayCommand, aCmd );
+
+        iVideoPlaybackController->iMPXPluginObs->HandlePlaybackMessage( *msg );
+
+        CleanupStack::PopAndDestroy( msg );
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayerUtility::SendSurfaceCommandL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMpxVideoPlayerUtility::SendSurfaceCommandL( TInt aCmd,
+                                                  const TSurfaceId& aSurfaceId,
+                                                  const TRect& aCropRect,
+                                                  TVideoAspectRatio aAspectRatio )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::SendSurfaceCommandL()"),
+                   _L("aCmd = %d"), aCmd );
+
+    if ( iVideoPlaybackController->iMPXPluginObs )
+    {
+        CMPXMessage* msg = CMPXMessage::NewL();
+        CleanupStack::PushL( msg );
+
+        msg->SetTObjectValueL<TInt>( KMPXMessageGeneralId, KMPXMediaIdVideoDisplayMessage );
+        msg->SetTObjectValueL<TInt>( KMPXMediaVideoDisplayCommand, aCmd );
+        msg->SetTObjectValueL<TSurfaceId>( KMPXMediaVideoDisplayTSurfaceId, aSurfaceId );
+        msg->SetTObjectValueL<TRect>( KMPXMediaVideoDisplayCropRect, aCropRect );
+        msg->SetTObjectValueL<TVideoAspectRatio>( KMPXMediaVideoDisplayAspectRatio, aAspectRatio );
+
+        iVideoPlaybackController->iMPXPluginObs->HandlePlaybackMessage( *msg );
+
+        CleanupStack::PopAndDestroy( msg );
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayerUtility::SendSurfaceCreatedCommand()
+// -------------------------------------------------------------------------------------------------
+//
+void CMpxVideoPlayerUtility::SendSurfaceCreatedCommand()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::SendSurfaceCreatedCommand()"));
+
+    if ( ! iSurfaceId.IsNull() )
+    {
+        MPX_TRAPD( err, SendSurfaceCommandL( EPbMsgVideoSurfaceCreated,
+                                             iSurfaceId,
+                                             iCropRect,
+                                             iAspectRatio ) );
+    }
+}
+
+#endif
+
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+void CMpxVideoPlayerUtility::OpenFile64L( const RFile64& aFile )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::OpenFile64L( RFile64 )"));
+
+    RFile64& file = const_cast<RFile64&>( aFile );
+
+    TMMFileHandleSource filehandlesource( file,
+                                          ContentAccess::KDefaultContentObject,
+                                          ContentAccess::EPlay );
+
+    HBufC* uniqueId = filehandlesource.UniqueId().AllocL();
+    CleanupStack::PushL( uniqueId );
+
+    TBool enableUi = filehandlesource.IsUIEnabled();
+
+    //
+    //  Create config for file handle source
+    //
+    CBufFlat* buf = CBufFlat::NewL( KBufferExpandSize );
+    CleanupStack::PushL( buf );
+
+    RBufWriteStream stream;
+    stream.Open( *buf );
+
+    CleanupClosePushL( stream );
+
+    TPckgBuf<RFile64*> fileptr( &file );
+
+    stream.WriteInt32L( KMMFileHandleSourceUid.iUid );
+    stream.WriteL( fileptr );
+
+    TInt length = 0;
+
+    if ( uniqueId )
+    {
+        length = uniqueId->Length();
+    }
+
+    stream.WriteInt32L( length );
+
+    if ( length > 0 )
+    {
+        stream.WriteL( *uniqueId );
+    }
+
+    stream.WriteInt32L( enableUi );
+
+    stream.CommitL();
+
+    CleanupStack::PopAndDestroy( &stream );
+
+    HBufC8* sourceData = buf->Ptr(0).AllocL();
+
+    iController.AddDataSource( KSourceUid, sourceData->Des() );
+    iController.AddDataSink( KUidMmfAudioOutput, KNullDesC8 );
+
+    delete sourceData;
+
+#ifdef SYMBIAN_BUILD_GCE
+    iVideoPlaySurfaceSupportCustomCommands.UseSurfaces();
+#endif
+
+    CleanupStack::PopAndDestroy( buf );
+    CleanupStack::PopAndDestroy( uniqueId );
+}
+
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/src/mpxvideoposterframesetter.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,164 @@
+/*
+* 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: poster frame setter
+ *
+*/
+
+// Version : %version: ou1cpsw#2 %
+
+
+// INCLUDE FILES
+#include <fbs.h>
+#include <mpxvideoplaybackdefs.h>
+
+#include "mpxvideoposterframesetter.h"
+#include "mpxvideoplaybackcontroller.h"
+#include "mpxvideo_debug.h"
+
+// ============================ MEMBER FUNCTIONS ===================================================
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPosterFrameSetter::CMPXVideoPosterFrameSetter
+// C++ default constructor can NOT contain any code, that might leave.
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPosterFrameSetter::CMPXVideoPosterFrameSetter( CMPXVideoPlaybackController* aVideoPlaybackCtlr )
+    : iVideoPlaybackCtlr( aVideoPlaybackCtlr )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPosterFrameSetter::CMPXVideoPosterFrameSetter()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPosterFrameSetter::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPosterFrameSetter::ConstructL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPosterFrameSetter::ConstructL()"));
+    
+    iTNManager = CThumbnailManager::NewL( *this );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPosterFrameSetter::NewL
+// Two-phased constructor.
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPosterFrameSetter* CMPXVideoPosterFrameSetter::NewL( CMPXVideoPlaybackController* aVideoPlaybackCtlr )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPosterFrameSetter::NewL()"));
+
+    CMPXVideoPosterFrameSetter* self = new( ELeave ) CMPXVideoPosterFrameSetter( aVideoPlaybackCtlr );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPosterFrameSetter::~CMPXVideoPosterFrameSetter
+// Destructor
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPosterFrameSetter::~CMPXVideoPosterFrameSetter()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPosterFrameSetter::~CMPXVideoPosterFrameSetter()"));
+
+    if ( iTNManager )
+    {
+        delete iTNManager;
+        iTNManager = NULL;
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPosterFrameSetter::RequestPosterFrameL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPosterFrameSetter::RequestPosterFrame()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPosterFrameSetter::RequestPosterFrame()"));
+    
+    if ( ! iVideoPlaybackCtlr->iFileDetails->iDrmProtected )
+    {
+        TRAP_IGNORE( iVideoPlaybackCtlr->iPlayer->GetFrameL() );    
+    }
+    else
+    {
+        MPX_TRAPD(err, 
+                  iVideoPlaybackCtlr->iState->SendErrorToViewL(KMPXVideoSetPosterFrameNotSupported));     
+    }   
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPosterFrameSetter::HandlePosterFrameReady
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPosterFrameSetter::HandlePosterFrameReady(TInt aError)
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPosterFrameSetter::HandlePosterFrameReady()"));
+    
+    if ( aError == KErrNone )
+    {     
+        CThumbnailObjectSource* tnSource( 0 );
+        TRAP_IGNORE
+        (
+            tnSource = CThumbnailObjectSource::NewL( &iVideoPlaybackCtlr->iPlayer->GetBitmap(),
+                                                      iVideoPlaybackCtlr->iClipName->Des() );
+            
+            CleanupStack::PushL( tnSource );
+            iRequestId = iTNManager->SetThumbnailL( *tnSource );
+            CleanupStack::PopAndDestroy( tnSource );
+        );    
+    }        
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPosterFrameSetter::ThumbnailPreviewReady
+//
+// callback method from MThumbnailManagerObserver
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPosterFrameSetter::ThumbnailPreviewReady( MThumbnailData& /*aThumbnail*/,
+                                                        TThumbnailRequestId /*aId*/ )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPosterFrameSetter::ThumbnailPreviewReady()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPosterFrameSetter::ThumbnailReady
+//
+// callback method from MThumbnailManagerObserver
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPosterFrameSetter::ThumbnailReady( TInt aError, 
+                                                 MThumbnailData& /*aThumbnail*/,
+                                                 TThumbnailRequestId /*aId*/ )
+{
+    MPX_DEBUG(_L("CMPXVideoPosterFrameSetter::ThumbnailReady() aError = %d"), aError );
+    
+    if ( aError == KErrNone )
+    {
+        MPX_TRAPD( err, 
+                   iVideoPlaybackCtlr->iState->SendErrorToViewL( KMPXVideoSetPosterFrameSuccess ) );    
+    }
+    else
+    {
+        MPX_TRAPD( err, 
+                   iVideoPlaybackCtlr->iState->SendErrorToViewL( KMPXVideoSetPosterFrameFailure ) );    
+    }
+}
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/src/mpxvideoseeker.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,366 @@
+/*
+* 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: Seek or trickplay
+ *
+*/
+
+// Version : %version: 10 %
+
+
+// INCLUDE FILES
+#include <mpxplaybackpluginobserver.h>
+
+#include "mpxvideoseeker.h"
+#include "mpxvideoplaybackcontroller.h"
+#include "mpxvideo_debug.h"
+
+// CONSTANTS
+
+#if TRICK_PLAY
+const TInt KDefaultPlaySpeed(100);        // 1x
+const TInt KDefaultTrickPlaySpeed(400);   // 4x
+#else
+const TInt KTrickPlayTimeout(2000000);    // 2 sec
+const TInt KSpeedInterval(125000);        // 125 msec
+const TInt KDurationA(90000000);          // 90 sec
+const TInt KDurationB(180000000);         // 180 sec
+const TInt64 KSpeedAIncrements(2000000);  // 2 sec
+const TInt64 KSpeedBIncrements(4000000);  // 4 sec
+const TInt64 KSpeedOffset(3000000);       // 3 sec
+#endif
+
+// ============================ MEMBER FUNCTIONS ===================================================
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoSeeker::CMPXVideoSeeker
+// C++ default constructor can NOT contain any code, that might leave.
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoSeeker::CMPXVideoSeeker( CMPXVideoPlaybackController* aVideoPlaybackCtlr )
+    : iVideoPlaybackCtlr( aVideoPlaybackCtlr )
+{
+    MPX_DEBUG(_L("CMPXVideoSeeker::CMPXVideoSeeker()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoSeeker::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoSeeker::ConstructL()
+{
+    MPX_DEBUG(_L("CMPXVideoSeeker::ConstructL()"));
+
+    iTrickPlayTimer = CPeriodic::NewL( CActive::EPriorityStandard );
+    iSeekTimer = CPeriodic::NewL( CActive::EPriorityStandard );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoSeeker::NewL
+// Two-phased constructor.
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoSeeker* CMPXVideoSeeker::NewL( CMPXVideoPlaybackController* aVideoPlaybackCtlr )
+{
+    MPX_DEBUG(_L("CMPXVideoSeeker::NewL()"));
+
+    CMPXVideoSeeker* self = new( ELeave ) CMPXVideoSeeker( aVideoPlaybackCtlr );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoSeeker::~CMPXVideoSeeker
+// Destructor
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoSeeker::~CMPXVideoSeeker()
+{
+    MPX_DEBUG(_L("CMPXVideoSeeker::~CMPXVideoSeeker()"));
+
+    if ( iTrickPlayTimer )
+    {
+        iTrickPlayTimer->Cancel();
+        delete iTrickPlayTimer;
+    }
+
+    if ( iSeekTimer )
+    {
+        iSeekTimer->Cancel();
+        delete iSeekTimer;
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoSeeker::StartSeeking
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoSeeker::StartSeekingL( TBool aForward,
+                                     TMPXVideoPlaybackState aState,
+                                     TInt64 aPosition,
+                                     TInt64 aDuration )
+{
+    MPX_DEBUG(_L("CMPXVideoSeeker::StartSeekingL() forward = (%d)"), aForward );
+
+    TInt err = KErrNone;
+    iPreviousState = aState;
+    iForward = aForward;
+    iPosition = aPosition;
+    iDuration = aDuration;
+
+#if TRICK_PLAY
+    if ( iPreviousState == EMPXVideoPaused )
+    {
+        iVideoPlaybackCtlr->iPlayer->Play();
+    }
+
+    TInt trickplaySpeed = KDefaultTrickPlaySpeed;
+
+    if ( ! iForward )
+    {
+        trickplaySpeed *= -1;
+    }
+
+    //
+    // Start trick play with 4x speed as default
+    //
+    MPX_TRAP( iVideoPlaybackCtlr->iPlayer->SetPlayVelocityL( trickplaySpeed ) );
+
+#else
+    if ( iPreviousState == EMPXVideoPlaying )
+    {
+        iVideoPlaybackCtlr->iPlayer->PauseL();
+    }
+
+    iIncrements = KSpeedAIncrements / 2;
+    TInt interval = KSpeedInterval * 2;
+
+    if ( !iForward )
+    {
+        iIncrements *= -1;
+    }
+
+    if ( ! iSeekTimer->IsActive() )
+    {
+        iSeekTimer->Start( 0,
+                           interval,
+                           TCallBack( CMPXVideoSeeker::UpdatePosition, this ) );
+    }
+#endif
+
+    if ( err == KErrNone )
+    {
+        if ( ! iTrickPlayTimer->IsActive() )
+        {
+            iTrickPlayTimer->Start( KTrickPlayTimeout,
+                                    0,
+                                    TCallBack( CMPXVideoSeeker::StopTrickPlay, this ) );
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoSeeker::StopSeekingL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoSeeker::StopSeekingL()
+{
+    MPX_DEBUG(_L("CMPXVideoSeeker::StopSeekingL()"));
+
+    TBool seekTimerActive = EFalse;
+
+    if ( iTrickPlayTimer->IsActive() )
+    {
+        iTrickPlayTimer->Cancel();
+    }
+
+    if ( iSeekTimer->IsActive() )
+    {
+        seekTimerActive = ETrue;
+        iSeekTimer->Cancel();
+    }
+
+    //
+    // If it reaches the end of a clip, issue stop
+    //
+    if ( iDuration <= iPosition )
+    {
+        iVideoPlaybackCtlr->iState->HandleEndOfClip();
+    }
+    else
+    {
+        if ( seekTimerActive )
+        {
+            iVideoPlaybackCtlr->iPlayer->SetPositionL( iPosition );
+
+            if ( iPreviousState == EMPXVideoPlaying )
+            {
+                iVideoPlaybackCtlr->DoHandleCommandL( EPbCmdPlay );
+            }
+            else if (iPreviousState == EMPXVideoPaused )
+            {
+                iVideoPlaybackCtlr->DoHandleCommandL( EPbCmdPause );
+            }
+            else
+            {
+                iVideoPlaybackCtlr->ChangeState( iPreviousState );
+            }
+        }
+
+#if TRICK_PLAY
+        else
+        {
+            //
+            // Start trick play with default speed
+            //
+            MPX_TRAP( iVideoPlaybackCtlr->iPlayer->SetPlayVelocityL( KDefaultPlaySpeed ) );
+
+            if ( iPreviousState == EMPXVideoPaused )
+            {
+                iVideoPlaybackCtlr->DoHandleCommandL( EPbCmdPause );
+            }
+            else if ( iPreviousState == EMPXVideoPlaying )
+            {
+                iVideoPlaybackCtlr->DoHandleCommandL( EPbCmdPlay );
+            }
+        }
+#endif
+    }
+
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoSeeker::StopTrickPlay
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMPXVideoSeeker::StopTrickPlay( TAny* aPtr )
+{
+    MPX_DEBUG(_L("CMPXVideoSeeker::StopTrickPlay()"));
+
+	static_cast<CMPXVideoSeeker*>(aPtr)->DoStopTrickPlay();
+
+	return KErrNone;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoSeeker::DoStopTrickPlay
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoSeeker::DoStopTrickPlay()
+{
+    MPX_DEBUG(_L("CMPXVideoSeeker::DoStopTrickPlay()"));
+
+    TInt err = KErrNone;
+
+    //
+    // Stop trick play
+    //
+    if ( iTrickPlayTimer->IsActive() )
+    {
+        iTrickPlayTimer->Cancel();
+    }
+
+#if TRICK_PLAY
+    MPX_TRAP( err,
+              iVideoPlaybackCtlr->iPlayer->SetPlayVelocityL( KDefaultPlaySpeed );
+              iVideoPlaybackCtlr->iPlayer->PauseL() );
+#endif
+
+    if ( err == KErrNone )
+    {
+        ConvertToSeeking();
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoSeeker::ConvertToSeeking
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoSeeker::ConvertToSeeking()
+{
+    MPX_DEBUG(_L("CMPXVideoSeeker::ConvertToSeeking()"));
+
+    //
+    // Start seeking (increments in every 125 msec)
+    // - ~ 90sec      : Increment is 2 sec
+    // - 91sec~180sec : Increment is 4 sec
+    // - 181sec~      : Increment depends on the duration
+    //                  ( 0.5 % * duration ) + 3 sec
+    //
+    if ( iDuration < KDurationA )
+    {
+        iIncrements = KSpeedAIncrements;
+    }
+    else
+    {
+        if ( iDuration < KDurationB )
+        {
+            iIncrements = KSpeedBIncrements;
+        }
+        else
+        {
+            iIncrements = (TInt)( iDuration / 200 ) + KSpeedOffset;
+        }
+    }
+
+    if ( !iForward )
+    {
+        iIncrements *= -1;
+    }
+
+    if ( iSeekTimer->IsActive() )
+    {
+        iSeekTimer->Cancel();
+    }
+
+    iSeekTimer->Start( 0, KSpeedInterval, TCallBack( CMPXVideoSeeker::UpdatePosition, this ) );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoSeeker::UpdatePosition
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMPXVideoSeeker::UpdatePosition( TAny* aPtr )
+{
+    MPX_DEBUG(_L("CMPXVideoSeeker::UpdatePosition()"));
+
+    static_cast<CMPXVideoSeeker*>(aPtr)->DoUpdatePosition();
+    return KErrNone;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoSeeker::DoUpdatePosition
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoSeeker::DoUpdatePosition()
+{
+    MPX_DEBUG(_L("CMPXVideoSeeker::DoUpdatePosition()"));
+
+    iPosition += iIncrements;
+
+    if ( iPosition > iDuration )
+    {
+        iPosition = iDuration;
+    }
+    else if ( iPosition < 0 )
+    {
+        iPosition = 0;
+    }
+
+    iVideoPlaybackCtlr->iPlaybackMode->UpdateSeekPosition( iPosition );
+}
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/bwins/videohelixtestu.def	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,80 @@
+EXPORTS
+	?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * LibEntryL(class CTestModuleIf &)
+	?Close@RConnection@@QAEXXZ @ 2 NONAME ; void RConnection::Close(void)
+	?Connect@RSocketServ@@QAEHI@Z @ 3 NONAME ; int RSocketServ::Connect(unsigned int)
+	?SetBoolAttribute@RHttpDownloadMgr@@QAEHIH@Z @ 4 NONAME ; int RHttpDownloadMgr::SetBoolAttribute(unsigned int, int)
+	?GetConnectionInfo@RConnectionMonitor@@QBEHIAAI0@Z @ 5 NONAME ; int RConnectionMonitor::GetConnectionInfo(unsigned int, unsigned int &, unsigned int &) const
+	?GetBoolAttribute@RHttpDownload@@QAEHIAAH@Z @ 6 NONAME ; int RHttpDownload::GetBoolAttribute(unsigned int, int &)
+	?Disconnect@RHttpDownloadMgr@@QAEHXZ @ 7 NONAME ; int RHttpDownloadMgr::Disconnect(void)
+	??0RConnection@@QAE@XZ @ 8 NONAME ; RConnection::RConnection(void)
+	?StartAll@RHttpDownloadMgr@@QAEHXZ @ 9 NONAME ; int RHttpDownloadMgr::StartAll(void)
+	??0RHttpDownloadMgr@@QAE@XZ @ 10 NONAME ; RHttpDownloadMgr::RHttpDownloadMgr(void)
+	?ResetAll@RHttpDownloadMgr@@QAEHXZ @ 11 NONAME ; int RHttpDownloadMgr::ResetAll(void)
+	?GetStringAttribute@RHttpDownload@@QAEHIAAVTDes8@@@Z @ 12 NONAME ; int RHttpDownload::GetStringAttribute(unsigned int, class TDes8 &)
+	?SetBoolAttribute@RHttpDownload@@QAEHIH@Z @ 13 NONAME ; int RHttpDownload::SetBoolAttribute(unsigned int, int)
+	?AttachToDownloadL@RHttpDownloadMgrApiExt@@QAEAAVRHttpDownload@@J@Z @ 14 NONAME ; class RHttpDownload & RHttpDownloadMgrApiExt::AttachToDownloadL(long)
+	?GetStringAttribute@RHttpDownloadMgr@@QAEHIAAVTDes16@@@Z @ 15 NONAME ; int RHttpDownloadMgr::GetStringAttribute(unsigned int, class TDes16 &)
+	?CreateCodDownloadL@RHttpDownloadMgr@@QAEAAVRHttpDownload@@ABVTDesC8@@00PAVCEikonEnv@@AAH@Z @ 16 NONAME ; class RHttpDownload & RHttpDownloadMgr::CreateCodDownloadL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class CEikonEnv *, int &)
+	?IsValidUrlPrefix@CMediaRecognizer@@QAEHABVTDesC16@@@Z @ 17 NONAME ; int CMediaRecognizer::IsValidUrlPrefix(class TDesC16 const &)
+	?Delete@RHttpDownload@@QAEHXZ @ 18 NONAME ; int RHttpDownload::Delete(void)
+	?Open@RConnection@@QAEHAAVRSocketServ@@I@Z @ 19 NONAME ; int RConnection::Open(class RSocketServ &, unsigned int)
+	??0TCommDbConnPref@@QAE@XZ @ 20 NONAME ; TCommDbConnPref::TCommDbConnPref(void)
+	?WaitForRequest@User@@SAXAAVTRequestStatus@@@Z @ 21 NONAME ; void User::WaitForRequest(class TRequestStatus &)
+	?SetIntAttribute@RHttpDownloadMgr@@QAEHIJ@Z @ 22 NONAME ; int RHttpDownloadMgr::SetIntAttribute(unsigned int, long)
+	?MimeTypeL@CMediaRecognizer@@QAE?AV?$TBuf@$0BAA@@@AAVRFile@@@Z @ 23 NONAME ; class TBuf<256> CMediaRecognizer::MimeTypeL(class RFile &)
+	?SetDialogPreference@TCommDbConnPref@@QAEXW4TCommDbDialogPref@@@Z @ 24 NONAME ; void TCommDbConnPref::SetDialogPreference(enum TCommDbDialogPref)
+	?SetStringAttribute@RHttpDownload@@QAEHIABVTDesC8@@@Z @ 25 NONAME ; int RHttpDownload::SetStringAttribute(unsigned int, class TDesC8 const &)
+	?Close@RHttpDownloadMgr@@QAEXXZ @ 26 NONAME ; void RHttpDownloadMgr::Close(void)
+	?Move@RHttpDownload@@QAEHXZ @ 27 NONAME ; int RHttpDownload::Move(void)
+	?IdentifyMediaTypeL@CMediaRecognizer@@QAE?AW4TMediaType@1@ABVTDesC16@@AAVRFile64@@H@Z @ 28 NONAME ; enum CMediaRecognizer::TMediaType CMediaRecognizer::IdentifyMediaTypeL(class TDesC16 const &, class RFile64 &, int)
+	?IsValidUrlPrefix@CMediaRecognizer@@QAEHABVTDesC8@@@Z @ 29 NONAME ; int CMediaRecognizer::IsValidUrlPrefix(class TDesC8 const &)
+	?SetStringAttribute@RHttpDownloadMgr@@QAEHIABVTDesC8@@@Z @ 30 NONAME ; int RHttpDownloadMgr::SetStringAttribute(unsigned int, class TDesC8 const &)
+	?CreateDownloadL@RHttpDownloadMgr@@QAEAAVRHttpDownload@@ABVTDesC8@@AAH@Z @ 31 NONAME ; class RHttpDownload & RHttpDownloadMgr::CreateDownloadL(class TDesC8 const &, int &)
+	?SetDefaultIntAttribute@RHttpDownloadMgr@@QAEHIJ@Z @ 32 NONAME ; int RHttpDownloadMgr::SetDefaultIntAttribute(unsigned int, long)
+	?GetStringAttribute@RHttpDownloadMgr@@QAEHIAAVTDes8@@@Z @ 33 NONAME ; int RHttpDownloadMgr::GetStringAttribute(unsigned int, class TDes8 &)
+	?MimeTypeL@CMediaRecognizer@@QAE?AV?$TBuf@$0BAA@@@ABVTDesC16@@@Z @ 34 NONAME ; class TBuf<256> CMediaRecognizer::MimeTypeL(class TDesC16 const &)
+	?GetStringAttribute@RHttpDownload@@QAEHIAAVTDes16@@@Z @ 35 NONAME ; int RHttpDownload::GetStringAttribute(unsigned int, class TDes16 &)
+	?SetDefaultBoolAttribute@RHttpDownloadMgr@@QAEHIH@Z @ 36 NONAME ; int RHttpDownloadMgr::SetDefaultBoolAttribute(unsigned int, int)
+	?GetUintAttribute@RConnectionMonitor@@QAEXIIIAAIAAVTRequestStatus@@@Z @ 37 NONAME ; void RConnectionMonitor::GetUintAttribute(unsigned int, unsigned int, unsigned int, unsigned int &, class TRequestStatus &)
+	?Compare@TCommDbConnPref@@UBEHABV1@@Z @ 38 NONAME ; int TCommDbConnPref::Compare(class TCommDbConnPref const &) const
+	??0RHttpDownloadMgrApiExt@@QAE@XZ @ 39 NONAME ; RHttpDownloadMgrApiExt::RHttpDownloadMgrApiExt(void)
+	?SetIntAttribute@RHttpDownload@@QAEHIJ@Z @ 40 NONAME ; int RHttpDownload::SetIntAttribute(unsigned int, long)
+	?CreateClientSideDownloadL@RHttpDownloadMgr@@QAEAAVRHttpDownload@@HAAH@Z @ 41 NONAME ; class RHttpDownload & RHttpDownloadMgr::CreateClientSideDownloadL(int, int &)
+	?Start@RHttpDownload@@QAEHXZ @ 42 NONAME ; int RHttpDownload::Start(void)
+	?PauseAll@RHttpDownloadMgr@@QAEHXZ @ 43 NONAME ; int RHttpDownloadMgr::PauseAll(void)
+	?IsValidStreamingPrefix@CMediaRecognizer@@QAEHABVTDesC16@@@Z @ 44 NONAME ; int CMediaRecognizer::IsValidStreamingPrefix(class TDesC16 const &)
+	??0TConnPref@@QAE@XZ @ 45 NONAME ; TConnPref::TConnPref(void)
+	?CurrentDownloads@RHttpDownloadMgr@@QBEABV?$CArrayPtrFlat@VRHttpDownload@@@@XZ @ 46 NONAME ; class CArrayPtrFlat<class RHttpDownload> const & RHttpDownloadMgr::CurrentDownloads(void) const
+	?GetFileHandleAttribute@RHttpDownload@@QAEHAAVRFile@@@Z @ 47 NONAME ; int RHttpDownload::GetFileHandleAttribute(class RFile &)
+	?FreeFilehandle@CMediaRecognizer@@QAEXXZ @ 48 NONAME ; void CMediaRecognizer::FreeFilehandle(void)
+	?Version@RHttpDownloadMgr@@QBE?AVTVersion@@XZ @ 49 NONAME ; class TVersion RHttpDownloadMgr::Version(void) const
+	?SetFileHandleAttribute@RHttpDownload@@QAEHAAVRFile@@@Z @ 50 NONAME ; int RHttpDownload::SetFileHandleAttribute(class RFile &)
+	?Pause@RHttpDownload@@QAEHXZ @ 51 NONAME ; int RHttpDownload::Pause(void)
+	?GetIntAttribute@RHttpDownload@@QAEHIAAJ@Z @ 52 NONAME ; int RHttpDownload::GetIntAttribute(unsigned int, long &)
+	?RemoveObserver@RHttpDownloadMgr@@QAEXAAVMHttpDownloadMgrObserver@@@Z @ 53 NONAME ; void RHttpDownloadMgr::RemoveObserver(class MHttpDownloadMgrObserver &)
+	?ConnectL@RHttpDownloadMgr@@QAEXVTUid@@AAVMHttpDownloadMgrObserver@@H@Z @ 54 NONAME ; void RHttpDownloadMgr::ConnectL(class TUid, class MHttpDownloadMgrObserver &, int)
+	?NewL@CMediaRecognizer@@SAPAV1@XZ @ 55 NONAME ; class CMediaRecognizer * CMediaRecognizer::NewL(void)
+	?SetStringAttribute@RHttpDownload@@QAEHIABVTDesC16@@@Z @ 56 NONAME ; int RHttpDownload::SetStringAttribute(unsigned int, class TDesC16 const &)
+	??0RSocketServ@@QAE@XZ @ 57 NONAME ; RSocketServ::RSocketServ(void)
+	?IdentifyMediaTypeL@CMediaRecognizer@@QAE?AW4TMediaType@1@ABVTDesC16@@H@Z @ 58 NONAME ; enum CMediaRecognizer::TMediaType CMediaRecognizer::IdentifyMediaTypeL(class TDesC16 const &, int)
+	?GetBoolAttribute@RHttpDownloadMgr@@QAEHIAAH@Z @ 59 NONAME ; int RHttpDownloadMgr::GetBoolAttribute(unsigned int, int &)
+	?SetDefaultStringAttribute@RHttpDownloadMgr@@QAEHIABVTDesC16@@@Z @ 60 NONAME ; int RHttpDownloadMgr::SetDefaultStringAttribute(unsigned int, class TDesC16 const &)
+	??1CMediaRecognizer@@UAE@XZ @ 61 NONAME ; CMediaRecognizer::~CMediaRecognizer(void)
+	?SetDefaultStringAttribute@RHttpDownloadMgr@@QAEHIABVTDesC8@@@Z @ 62 NONAME ; int RHttpDownloadMgr::SetDefaultStringAttribute(unsigned int, class TDesC8 const &)
+	?SetNextUriObserver@RHttpDownloadMgr@@QAEXPAVMHttpDownloadMgrNextUriObserver@@@Z @ 63 NONAME ; void RHttpDownloadMgr::SetNextUriObserver(class MHttpDownloadMgrNextUriObserver *)
+	?IdentifyMediaTypeL@CMediaRecognizer@@QAE?AW4TMediaType@1@ABVTDesC16@@AAVRFile@@H@Z @ 64 NONAME ; enum CMediaRecognizer::TMediaType CMediaRecognizer::IdentifyMediaTypeL(class TDesC16 const &, class RFile &, int)
+	?Start@RConnection@@QAEHAAVTConnPref@@@Z @ 65 NONAME ; int RConnection::Start(class TConnPref &)
+	?GetIntAttribute@RHttpDownloadMgr@@QAEHIAAJ@Z @ 66 NONAME ; int RHttpDownloadMgr::GetIntAttribute(unsigned int, long &)
+	?Close@RConnectionMonitor@@QAEXXZ @ 67 NONAME ; void RConnectionMonitor::Close(void)
+	?SetStringAttribute@RHttpDownloadMgr@@QAEHIABVTDesC16@@@Z @ 68 NONAME ; int RHttpDownloadMgr::SetStringAttribute(unsigned int, class TDesC16 const &)
+	?Reset@RHttpDownload@@QAEHXZ @ 69 NONAME ; int RHttpDownload::Reset(void)
+	?GetIntAttribute@RConnectionMonitor@@QAEXIIIAAHAAVTRequestStatus@@@Z @ 70 NONAME ; void RConnectionMonitor::GetIntAttribute(unsigned int, unsigned int, unsigned int, int &, class TRequestStatus &)
+	?GetConnectionCount@RConnectionMonitor@@QAEXAAIAAVTRequestStatus@@@Z @ 71 NONAME ; void RConnectionMonitor::GetConnectionCount(unsigned int &, class TRequestStatus &)
+	?DeleteAll@RHttpDownloadMgr@@QAEHXZ @ 72 NONAME ; int RHttpDownloadMgr::DeleteAll(void)
+	?ConnectL@RConnectionMonitor@@QAEHXZ @ 73 NONAME ; int RConnectionMonitor::ConnectL(void)
+	?FindDownload@RHttpDownloadMgr@@QAEPAVRHttpDownload@@ABVTDesC8@@0@Z @ 74 NONAME ; class RHttpDownload * RHttpDownloadMgr::FindDownload(class TDesC8 const &, class TDesC8 const &)
+	?AddObserverL@RHttpDownloadMgr@@QAEXAAVMHttpDownloadMgrObserver@@@Z @ 75 NONAME ; void RHttpDownloadMgr::AddObserverL(class MHttpDownloadMgrObserver &)
+	?MimeTypeL@CMediaRecognizer@@QAE?AV?$TBuf@$0BAA@@@AAVRFile64@@@Z @ 76 NONAME ; class TBuf<256> CMediaRecognizer::MimeTypeL(class RFile64 &)
+	??1RConnection@@UAE@XZ @ 77 NONAME ; RConnection::~RConnection(void)
+	?CreateDownloadL@RHttpDownloadMgr@@QAEAAVRHttpDownload@@ABVTDesC8@@@Z @ 78 NONAME ; class RHttpDownload & RHttpDownloadMgr::CreateDownloadL(class TDesC8 const &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/conf/videohelixtest.cfg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,935 @@
+[Define]
+KErrNone 0
+KErrNotFound -1
+KErrGeneral -2
+KErrNotSupported -5
+KErrDied -13
+KErrCouldNotConnect -34
+KErrMMPartialPlayback -12017
+
+EPbCmdPlay 0
+EPbCmdPause 2
+EPbCmdStop 3
+EPbCmdClose 14
+
+EPbCmdAbortDSA 1
+EPbCmdRestartDSA 2
+EPbCmdSetDisplayWindow 3
+EPbCmdStartVideoSeekingForward 4
+EPbCmdStartVideoSeekingBackward 5
+EPbCmdStopVideoSeeking 6
+EPbCmdHandleForeground 7
+EPbCmdHandleBackground 8
+EPbCmdNaturalAspectRatio 9
+EPbCmdZoomAspectRatio 10
+EPbCmdStretchAspectRatio 11
+EPbCmdHandleIncreaseVolume 17 
+EPbCmdHandleDecreaseVolume 18 
+EPbCmdSetPosterFrame 24
+
+EMMFNatural 2
+EMMFZoom 3
+EMMFStretch 4
+
+EPbPropertyVolume 0
+EPbPropertyMaxVolume 1
+EPbPropertyMute 3
+EPbPropertyPosition 10
+EPbPropertyDuration 11
+EPbPropertyInvalid 100
+
+EPbDlStateNotDownloading 0
+EPbDlStateDownloading 2
+
+ETvOutPlaybackAllowed 1
+
+ENoEvent 0
+EAddEvent 1
+
+ECallbackPlaying 1
+ECallbackPaused 3
+ECallbackStopped 4
+ECallbackClosed 5
+ECallbackBuffering 25
+
+ERFile 1
+ERFile64 0
+EMPXVideoLocal 0
+
+[Enddefine]
+
+[Test]
+title 1.  InitialiseL with file missing
+create videohelixtest test
+test Initialize 0 10 vhpp_nofile.3gp KErrNotFound KErrNone KErrNone
+waittestclass test
+test GetMedia 
+waittestclass test
+delete test
+pause 1000
+[Endtest] 
+
+[Test]
+title 2.  OpenComplete returns error
+create videohelixtest test
+test Initialize 0 10 vhpp_test.3gp KErrNone KErrNotSupported KErrNone
+waittestclass test
+pause 100
+test GetMedia 
+waittestclass test
+delete test
+pause 1000
+[Endtest] 
+
+[Test]
+title 3.  PrepareComplete returns error
+create videohelixtest test
+test Initialize 0 10 vhpp_test.3gp KErrNone KErrNone KErrGeneral
+waittestclass test
+pause 100
+test GetMedia 
+waittestclass test
+delete test
+pause 1000
+[Endtest] 
+
+[Test]
+title 4.  PrepareComplete returns Partial Playback
+create videohelixtest test
+test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrMMPartialPlayback
+waittestclass test
+pause 100
+test GetMedia 
+waittestclass test
+delete test
+pause 1000
+[Endtest] 
+
+[Test]
+title 5.  General Playback Commands
+create videohelixtest test
+test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
+waittestclass test
+pause 100
+test IssueGeneralCommand EPbCmdPlay KErrNone ECallbackBuffering
+waittestclass test
+test IssueGeneralCommand EPbCmdPause KErrNone ECallbackPaused
+waittestclass test
+test IssueGeneralCommand EPbCmdStop KErrNone ECallbackStopped
+waittestclass test
+test IssuePlaybackCommand EPbCmdPlay KErrNone ECallbackPlaying
+waittestclass test
+test IssuePlaybackCommand EPbCmdPause KErrNone ECallbackPaused
+waittestclass test
+test IssuePlaybackCommand EPbCmdStop KErrNone ECallbackStopped
+waittestclass test
+test IssuePlaybackCommand EPbCmdClose KErrNone ECallbackClosed
+waittestclass test
+delete test
+pause 1000
+[Endtest] 
+
+[Test]
+title 6.  Video Playback Commands
+create videohelixtest test
+test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
+waittestclass test
+test IssueVideoCommand EPbCmdAbortDSA
+test IssueVideoCommand EPbCmdRestartDSA 1 1 99 99
+test IssueVideoCommand EPbCmdSetDisplayWindow 2 2 98 98
+delete test
+pause 1000
+[Endtest] 
+
+[Test]
+title 7.  InitialiseL with 32-bit file handle
+create videohelixtest test
+test InitializeHandle ERFile 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
+waittestclass test
+delete test
+pause 1000
+[Endtest] 
+
+[Test]
+//
+// SetVolume 10 : current vol (10)
+// SetMute    1 : current vol (0)
+//
+title 8.  Set/Retrieve Volume
+create videohelixtest test
+test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
+waittestclass test
+test GetProperty EPbPropertyMaxVolume 100
+waittestclass test
+test SetProperty EPbPropertyVolume 10 EAddEvent
+waittestclass test
+pause 100
+test GetProperty EPbPropertyVolume 10
+waittestclass test
+test SetProperty EPbPropertyMute 1
+waittestclass test
+pause 100
+test GetProperty EPbPropertyMute 1
+waittestclass test
+delete test
+pause 1000
+[Endtest] 
+
+[Test]
+title 9.  Set/Retrieve Position & Duration
+create videohelixtest test
+test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
+waittestclass test
+test SetProperty EPbPropertyPosition 10000
+waittestclass test
+test GetProperty EPbPropertyPosition 10000
+waittestclass test
+test GetProperty EPbPropertyDuration 60000
+waittestclass test
+test SetProperty EPbPropertyInvalid 10000
+test GetProperty EPbPropertyInvalid 10000
+delete test
+pause 1000
+[Endtest] 
+
+[Test]
+title 10.  SubPlayer Functions
+create videohelixtest test
+test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
+waittestclass test
+test GetSubPlayerNames 
+waittestclass test
+test SelectSubPlayer 
+test SubPlayerName 
+test SubPlayerIndex 
+test CancelRequest 
+delete test
+pause 1000
+[Endtest] 
+
+[Test]
+title 11.  Get Media
+create videohelixtest test
+test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
+waittestclass test
+test GetMedia 
+waittestclass test
+delete test
+pause 1000
+[Endtest] 
+
+[Test]
+title 12.  Play Complete No Error
+create videohelixtest test
+test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
+waittestclass test
+test SetPlaybackComplete KErrNone 60000
+waittestclass test
+delete test
+pause 1000
+[Endtest] 
+
+[Test]
+title 13.  Play Complete with error
+create videohelixtest test
+test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
+waittestclass test
+test SetPlaybackComplete KErrCouldNotConnect 60000
+waittestclass test
+delete test
+pause 1000
+[Endtest] 
+
+
+[Test]
+title 14.  STATE: Do Pause when stopped
+create videohelixtest test
+test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
+waittestclass test
+test IssueGeneralCommand EPbCmdPlay KErrNone ECallbackBuffering
+waittestclass test
+test IssueGeneralCommand EPbCmdStop KErrNone ECallbackStopped
+waittestclass test
+test IssueGeneralCommand EPbCmdPause KErrNotSupported
+delete test
+pause 1000
+[Endtest] 
+
+
+[Test]
+title 15.  STATE: Do Stop when stopped
+create videohelixtest test
+test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
+waittestclass test
+test IssueGeneralCommand EPbCmdPlay KErrNone ECallbackBuffering
+waittestclass test
+test IssueGeneralCommand EPbCmdStop KErrNone ECallbackStopped
+waittestclass test
+test IssueGeneralCommand EPbCmdStop KErrNotSupported
+delete test
+pause 1000
+[Endtest] 
+
+
+[Test]
+title 16.  STATE: SetPos when playing/paused/stopped
+create videohelixtest test
+test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
+waittestclass test
+test IssueGeneralCommand EPbCmdPlay KErrNone ECallbackBuffering
+waittestclass test
+test SetProperty EPbPropertyPosition 10000
+waittestclass test
+test GetProperty EPbPropertyPosition 10000
+
+test IssueGeneralCommand EPbCmdPause KErrNone ECallbackPaused
+waittestclass test
+test SetProperty EPbPropertyPosition 10000
+waittestclass test
+test GetProperty EPbPropertyPosition 10000
+
+test IssueGeneralCommand EPbCmdStop KErrNone ECallbackStopped
+waittestclass test
+test SetProperty EPbPropertyPosition 10000
+waittestclass test
+test GetProperty EPbPropertyPosition 10000
+
+delete test
+pause 1000
+[Endtest]
+
+
+[Test]
+title 17.  STATE: Do Play when Paused
+create videohelixtest test
+test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
+waittestclass test
+test IssueGeneralCommand EPbCmdPlay KErrNone ECallbackBuffering
+waittestclass test
+test IssueGeneralCommand EPbCmdPause KErrNone ECallbackPaused
+waittestclass test
+test IssueGeneralCommand EPbCmdPlay KErrNone ECallbackPlaying
+waittestclass test
+delete test
+pause 1000
+[Endtest] 
+
+
+[Test]
+title 18.  STATE: SetPos when initialised
+create videohelixtest test
+test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
+waittestclass test
+test SetProperty EPbPropertyPosition 10000
+waittestclass test
+test GetProperty EPbPropertyPosition 10000
+waittestclass test
+delete test
+pause 1000
+[Endtest]
+
+
+[Test]
+//
+// Can't save the volume while initilizing, so GetVolume will be the value in CenRep
+//
+title 19.  STATE: Misc operations when not-initialized
+create videohelixtest test
+test Initialize 0 10 vhpp_test.3gp KErrNone KErrNone KErrGeneral
+waittestclass test
+test GetMedia 
+test SetProperty EPbPropertyVolume 50 ENoEvent
+waittestclass test
+pause 100
+test GetProperty EPbPropertyVolume 40
+waittestclass test
+test IssueGeneralCommand EPbCmdStop KErrNotSupported
+delete test
+pause 1000
+[Endtest] 
+
+
+[Test]
+title 20.  STATE: Close when playing
+create videohelixtest test
+test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
+waittestclass test
+test IssueGeneralCommand EPbCmdPlay KErrNone ECallbackBuffering
+waittestclass test
+pause 1000
+test IssuePlaybackCommand EPbCmdClose KErrNone ECallbackClosed
+waittestclass test
+delete test
+pause 1000
+[Endtest]
+
+
+[Test]
+title 21.  Initialise with rtsp link & AP
+create videohelixtest test
+test InitializeLink 0 10 rtsp:\/\/link.3gp KErrNone KErrNone KErrNone
+waittestclass test
+delete test
+pause 1000
+[Endtest]
+
+
+[Test]
+title 22.  Seek Fwd when playing
+create videohelixtest test
+test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
+waittestclass test
+test IssueGeneralCommand EPbCmdPlay KErrNone ECallbackBuffering
+waittestclass test
+test IssueSeekingCommand EPbCmdStartVideoSeekingForward EAddEvent
+pause 3000
+test IssueSeekingCommand EPbCmdStopVideoSeeking ECallbackPlaying
+delete test
+pause 1000
+[Endtest]
+
+
+[Test]
+title 23.  Seek back when paused
+create videohelixtest test
+test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
+waittestclass test
+test IssueGeneralCommand EPbCmdPlay KErrNone ECallbackBuffering
+waittestclass test
+test IssueGeneralCommand EPbCmdPause KErrNone ECallbackPaused
+waittestclass test
+test IssueSeekingCommand EPbCmdStartVideoSeekingBackward EAddEvent
+pause 3000
+test IssueSeekingCommand EPbCmdStopVideoSeeking ECallbackPaused
+delete test
+pause 1000
+[Endtest]
+
+
+[Test]
+title 24.  Seek when stopped
+create videohelixtest test
+test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
+waittestclass test
+test IssueGeneralCommand EPbCmdPlay KErrNone ECallbackBuffering
+waittestclass test
+test IssueGeneralCommand EPbCmdStop KErrNone ECallbackStopped
+waittestclass test
+test IssueSeekingCommand EPbCmdStartVideoSeekingForward ENoEvent
+pause 3000
+test IssueSeekingCommand EPbCmdStopVideoSeeking ENoEvent
+delete test
+pause 1000
+[Endtest]
+
+[Test]
+title 25.  Play rtsp link (forces buffering state)
+create videohelixtest test
+test InitializeLink 0 10 rtsp:\/\/link.3gp KErrNone KErrNone KErrNone
+waittestclass test
+test IssueGeneralCommand EPbCmdPlay KErrNone ECallbackBuffering
+waittestclass test
+delete test
+pause 1000
+[Endtest]
+
+[Test]
+title 26.  PDL - Connect to Download
+create videohelixtest test
+test ConnectToDownload 1 vhpp_test.3gp
+waittestclass test
+delete test
+pause 1000
+[Endtest]
+
+[Test]
+title 27.  PDL - Download State Transitions
+create videohelixtest test
+test ConnectToDownload 2 vhpp_test.3gp
+waittestclass test
+test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
+waittestclass test
+test PauseDownload 
+waittestclass test
+test ResumeDownload 50
+waittestclass test
+delete test
+pause 1000
+[Endtest]
+
+[Test]
+title 28.  PDL - Download Complete / Move
+create videohelixtest test
+test ConnectToDownload 3 vhpp_test.3gp
+waittestclass test
+test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
+waittestclass test
+test IssueGeneralCommand EPbCmdPlay KErrNone ECallbackBuffering
+waittestclass test
+test ResumeDownload 100
+waittestclass test
+pause 100
+test IssuePlaybackCommand EPbCmdClose KErrNone ECallbackClosed
+waittestclass test
+delete test
+pause 1000
+[Endtest]
+
+[Test]
+title 29.  PDL - Cancel Download
+create videohelixtest test
+test ConnectToDownload 2 vhpp_test.3gp
+waittestclass test
+test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
+waittestclass test
+test CancelDownload 
+waittestclass test
+delete test
+pause 1000
+[Endtest]
+
+[Test]
+title 30.  PDL - Retrieve PDL Status
+create videohelixtest test
+test ConnectToDownload 2 vhpp_test.3gp
+waittestclass test
+test RetrievePdlStatus EPbDlStateDownloading 25 100 
+delete test
+pause 1000
+[Endtest]
+
+[Test]
+title 31.  Change aspect ratio to zoom->stretch->natural
+create videohelixtest test
+test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
+waittestclass test
+test IssueVideoCommand EPbCmdSetDisplayWindow 2 2 98 98
+test IssueGeneralCommand EPbCmdPlay KErrNone ECallbackBuffering
+waittestclass test
+test ChangeAspectRatioL EPbCmdStretchAspectRatio EMMFStretch
+test ChangeAspectRatioL EPbCmdNaturalAspectRatio EMMFNatural
+test ChangeAspectRatioL EPbCmdZoomAspectRatio EMMFZoom
+pause 1000
+delete test
+pause 1000
+[Endtest]
+
+[Test]
+title 32.  Alarm: Paused
+create videohelixtest test
+test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
+waittestclass test
+test IssueGeneralCommand EPbCmdPlay KErrNone ECallbackBuffering
+waittestclass test
+test AlarmOn EPbCmdHandleBackground
+waittestclass test
+delete test
+pause 1000
+[Endtest] 
+
+[Test]
+title 33.  Incoming Phone Call: Rejected
+create videohelixtest test
+test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
+waittestclass test
+test IssueGeneralCommand EPbCmdPlay KErrNone ECallbackBuffering
+waittestclass test
+test PhoneCallRejected EPbCmdHandleBackground EPbCmdHandleForeground
+waittestclass test
+delete test
+pause 1000
+[Endtest]
+
+[Test]
+title 34.  Incoming Voice Call: Accepted
+create videohelixtest test
+test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
+waittestclass test
+test IssueGeneralCommand EPbCmdPlay KErrNone ECallbackBuffering
+waittestclass test
+test VoiceCallAccepted EPbCmdHandleBackground EPbCmdHandleForeground
+pause 1000
+test EndPhoneCall
+delete test
+pause 1000
+[Endtest]
+
+[Test]
+title 35.  Incoming Video Call: Accepted
+create videohelixtest test
+test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
+waittestclass test
+test IssueGeneralCommand EPbCmdPlay KErrNone ECallbackBuffering
+waittestclass test
+test VideoCallAccepted EPbCmdHandleBackground EPbCmdHandleForeground
+pause 1000
+test EndPhoneCall
+delete test
+pause 1000
+[Endtest]
+
+[Test]
+title 36.  Play During Video Call
+create videohelixtest test
+test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
+waittestclass test
+test PlayduringVideoCall
+pause 100
+test IssueGeneralCommand EPbCmdPlay KErrNone ECallbackBuffering
+pause 1000
+test EndPhoneCall
+delete test
+pause 1000
+[Endtest]
+
+[Test]
+title 37.  Play During voice Call
+create videohelixtest test
+test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
+waittestclass test
+test PlayduringVoiceCall
+pause 100
+test IssueGeneralCommand EPbCmdPlay KErrNone ECallbackPlaying
+pause 1000
+test EndPhoneCall
+delete test
+pause 1000
+[Endtest]
+
+[Test]
+title 38.  Initialise with SDP file via 32-bit file handle
+create videohelixtest test
+test InitializeHandle ERFile 60000 10 sdp_test.sdp KErrNone KErrNone KErrNone
+waittestclass test
+delete test
+pause 1000
+[Endtest]
+
+[Test]
+title 39.  Tv-Out before Initialization - Playback Allowed
+create videohelixtest test
+test SetTvOutConnected ETvOutPlaybackAllowed
+test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
+waittestclass test
+pause 100
+test DisconnectTvOut
+waittestclass test
+delete test
+pause 1000
+[Endtest]
+
+[Test]
+title 40.  Tv-Out after Initialization - Playback Allowed
+create videohelixtest test
+test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
+waittestclass test
+pause 100
+test ConnectTvOut ETvOutPlaybackAllowed
+waittestclass test
+test DisconnectTvOut
+waittestclass test
+delete test
+pause 1000
+[Endtest]
+
+[Test]
+title 41.  Tv-Out before Initialization - DRM Playback Allowed
+create videohelixtest test
+test SetTvOutConnected ETvOutPlaybackAllowed
+test Initialize 0 10 dcf.odf KErrNone KErrNone KErrNone
+waittestclass test
+pause 100
+test GetMedia 
+waittestclass test
+delete test
+pause 1000
+[Endtest]
+
+[Test]
+title 42.  Tv-Out after Initialization - DRM Playback Allowed
+create videohelixtest test
+test Initialize 0 10 dcf.odf KErrNone KErrNone KErrNone
+waittestclass test
+test ConnectTvOut ETvOutPlaybackAllowed
+waittestclass test
+test DisconnectTvOut
+waittestclass test
+delete test
+pause 1000
+[Endtest]
+
+[Test]
+title 43.  DRM Protected file with Rights
+create videohelixtest test
+test SetDrmProtected 0
+test Initialize 0 10 dcf.odf KErrNone KErrNone KErrNone
+waittestclass test
+test IssueGeneralCommand EPbCmdPlay KErrNone ECallbackBuffering
+waittestclass test
+delete test
+pause 1000
+[Endtest]
+
+[Test]
+title 44.  DRM Protected file without rights
+create videohelixtest test
+test SetDrmProtected -17452
+test Initialize 0 10 vhpp_test.3gp KErrNone KErrNone -17452
+waittestclass test
+pause 100
+test GetMedia 
+waittestclass test
+delete test
+pause 1000
+[Endtest]
+
+[Test]
+title 45.  EndOfClip Custom Commands
+create videohelixtest test
+test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
+waittestclass test
+test IssueSeekedToEndCommand
+delete test
+pause 1000
+[Endtest] 
+
+[Test]
+title 46.  PDL - Not enough Data
+create videohelixtest test
+test ConnectToDownload 2 vhpp_test.3gp
+waittestclass test
+test Initialize 0 10 vhpp_test.3gp KErrNone KErrNone KErrNotSupported
+waittestclass test
+test GetMedia 
+waittestclass test
+test RetrievePdlStatus EPbDlStateNotDownloading 1024 1024 
+delete test
+pause 1000
+[Endtest]
+
+[Test] 
+title 47.  Handle volume increase (10-steps)
+create videohelixtest test 
+test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone 
+waittestclass test 
+test SetProperty EPbPropertyVolume 50 EAddEvent 
+waittestclass test 
+pause 1000 
+test GetProperty EPbPropertyVolume 50
+waittestclass test
+test HandleVolume EPbCmdHandleIncreaseVolume 60
+waittestclass test 
+pause 1000 
+test GetProperty EPbPropertyVolume 60
+waittestclass test
+pause 1000 
+delete test 
+pause 1000 
+[Endtest] 
+  
+[Test] 
+title 48.  Handle volume decrease (10-steps)
+create videohelixtest test 
+test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone 
+waittestclass test 
+test SetProperty EPbPropertyVolume 50 EAddEvent 
+waittestclass test 
+pause 1000 
+test GetProperty EPbPropertyVolume 50
+waittestclass test
+test HandleVolume EPbCmdHandleDecreaseVolume 40
+waittestclass test 
+pause 1000 
+test GetProperty EPbPropertyVolume 40
+waittestclass test
+pause 1000 
+delete test 
+pause 1000 
+[Endtest] 
+
+[Test] 
+title 49.  Handle volume increase (20-steps)
+create videohelixtest test 
+test Initialize 60000 20 vhpp_test.3gp KErrNone KErrNone KErrNone 
+waittestclass test 
+test SetProperty EPbPropertyVolume 50 EAddEvent 
+waittestclass test 
+pause 1000 
+test GetProperty EPbPropertyVolume 50
+waittestclass test
+test HandleVolume EPbCmdHandleIncreaseVolume 55
+waittestclass test 
+pause 1000 
+test GetProperty EPbPropertyVolume 55
+waittestclass test
+pause 1000 
+delete test 
+pause 1000 
+[Endtest] 
+  
+[Test] 
+title 50.  Handle volume decrease (20-steps)
+create videohelixtest test 
+test Initialize 60000 20 vhpp_test.3gp KErrNone KErrNone KErrNone 
+waittestclass test 
+test SetProperty EPbPropertyVolume 50 EAddEvent 
+waittestclass test 
+pause 1000 
+test GetProperty EPbPropertyVolume 50
+waittestclass test
+test HandleVolume EPbCmdHandleDecreaseVolume 45
+waittestclass test 
+pause 1000 
+test GetProperty EPbPropertyVolume 45
+waittestclass test
+pause 1000 
+delete test 
+pause 1000 
+[Endtest] 
+
+[Test]
+title 51.  InitialiseL with 64-bit file handle
+create videohelixtest test
+test InitializeHandle ERFile64 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
+waittestclass test
+delete test
+pause 1000
+[Endtest] 
+
+[Test]
+title 52.  Initialise with SDP file via 64-bit file handle
+create videohelixtest test
+test InitializeHandle ERFile64 60000 10 sdp_test.sdp KErrNone KErrNone KErrNone
+waittestclass test
+delete test
+pause 1000
+[Endtest]
+
+[Test]
+title 53.  InitialiseWithPositionL with file missing
+create videohelixtest test
+test InitializeWithPositionL 0 10 6575 vhpp_nofile.3gp KErrNotFound KErrNone KErrNone
+waittestclass test
+test GetMedia 
+waittestclass test
+delete test
+pause 1000
+[Endtest] 
+
+[Test]
+title 54.  InitialiseL with 32-bit file handle
+create videohelixtest test
+test InitializeHandleWithPositionL ERFile 60000 10 6575 vhpp_test.3gp KErrNone KErrNone KErrNone
+waittestclass test
+delete test
+pause 1000
+[Endtest] 
+
+[Test]
+title 55.  Initialise with rtsp link & AP
+create videohelixtest test
+test InitializeLinkWithPositionL 0 10 6575 rtsp:\/\/link.3gp KErrNone KErrNone KErrNone
+waittestclass test
+delete test
+pause 1000
+[Endtest]
+
+[Test]
+title 56.  Play rtsp link (forces buffering state)
+create videohelixtest test
+test InitializeLinkWithPositionL 0 10 6575 rtsp:\/\/link.3gp KErrNone KErrNone KErrNone
+waittestclass test
+test IssueGeneralCommand EPbCmdPlay KErrNone ECallbackBuffering
+waittestclass test
+delete test
+pause 1000
+[Endtest]
+
+[Test]
+title 57.  Initialise with SDP file via 32-bit file handle
+create videohelixtest test
+test InitializeHandleWithPositionL ERFile 60000 10 6575 sdp_test.sdp KErrNone KErrNone KErrNone
+waittestclass test
+delete test
+pause 1000
+[Endtest]
+
+[Test]
+title 58.  InitialiseL with 64-bit file handle
+create videohelixtest test
+test InitializeHandleWithPositionL ERFile64 60000 10 6575 vhpp_test.3gp KErrNone KErrNone KErrNone
+waittestclass test
+delete test
+pause 1000
+[Endtest] 
+
+[Test]
+title 59.  Initialise with SDP file via 64-bit file handle
+create videohelixtest test
+test InitializeHandleWithPositionL ERFile64 60000 10 6575 sdp_test.sdp KErrNone KErrNone KErrNone
+waittestclass test
+delete test
+pause 1000
+[Endtest]
+
+[Test]
+title 60.  Set Poster Frame
+create videohelixtest test
+test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
+waittestclass test
+pause 100
+test IssueGeneralCommand EPbCmdPlay KErrNone ECallbackBuffering
+waittestclass test
+test IssueVideoCommand EPbCmdSetPosterFrame
+delete test
+pause 1000
+[Endtest]
+
+[Test]
+title 61.  InitialiseL link via 32-bit file handle
+create videohelixtest test
+test InitializeStreamingWithSdpFileHandleL ERFile 60000 10 sdp_test.sdp KErrNone KErrNone KErrNone
+waittestclass test
+delete test
+pause 1000
+[Endtest] 
+
+[Test]
+title 62.  InitialiseL link via 64-bit file handle
+create videohelixtest test
+test InitializeStreamingWithSdpFileHandleL ERFile64 60000 10 sdp_test.sdp KErrNone KErrNone KErrNone
+waittestclass test
+delete test
+pause 1000
+[Endtest]
+
+[Test]
+title 63. Retrieve FileName and playback mode -- Custom Commands EPbCmdInitView
+create videohelixtest test
+test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
+waittestclass test
+test RetrieveFileNameAndModeL vhpp_test.3gp EMPXVideoLocal
+pause 1000
+delete test
+pause 1000
+[Endtest] 
+
+[Test]
+title 64. StartConnectionL
+create videohelixtest test
+test  StartDefaultConnectionL
+pause 1000
+delete test
+pause 1000
+[Endtest] 
+
+[Test]
+title 65. CheckAccessPointL
+create videohelixtest test
+test  CheckAccessPointL
+pause 1000
+delete test
+pause 1000
+[Endtest] 
+
+
Binary file videoplayback/videohelix/tsrc/ut_videohelixtest/data/mmc/dcf.odf has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/data/mmc/sdp_test.sdp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,1 @@
+VideoFrameSizeWidth=640;VideoFrameSizeHeight=480;VideoBitRate=100;AudioBitRate=100;AudioEnabled=1;Duration=60000000;MimeType=video/3gpp;NumMetaDataEntries=6;Seekable=1;LiveStream=0;Title=STIFTestClip;Description=Descripton;Artist=Artist;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/data/mmc/vhpp_test.3gp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,1 @@
+VideoFrameSizeWidth=640;VideoFrameSizeHeight=480;VideoBitRate=100;AudioBitRate=100;AudioEnabled=1;Duration=60000000;MimeType=video/3gpp;NumMetaDataEntries=6;Seekable=1;LiveStream=0;Title=STIFTestClip;Description=Descripton;Artist=Artist;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/eabi/videohelixtestu.def	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,136 @@
+EXPORTS
+	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
+	_ZN11RConnection4OpenER11RSocketServj @ 2 NONAME
+	_ZN11RConnection5CloseEv @ 3 NONAME
+	_ZN11RConnection5StartER9TConnPref @ 4 NONAME
+	_ZN11RConnectionC1Ev @ 5 NONAME
+	_ZN11RConnectionC2Ev @ 6 NONAME
+	_ZN11RConnectionD0Ev @ 7 NONAME
+	_ZN11RConnectionD1Ev @ 8 NONAME
+	_ZN11RConnectionD2Ev @ 9 NONAME
+	_ZN11RSocketServ7ConnectEj @ 10 NONAME
+	_ZN11RSocketServC1Ev @ 11 NONAME
+	_ZN11RSocketServC2Ev @ 12 NONAME
+	_ZN13RHttpDownload15GetIntAttributeEjRl @ 13 NONAME
+	_ZN13RHttpDownload15SetIntAttributeEjl @ 14 NONAME
+	_ZN13RHttpDownload16GetBoolAttributeEjRi @ 15 NONAME
+	_ZN13RHttpDownload16SetBoolAttributeEji @ 16 NONAME
+	_ZN13RHttpDownload18GetStringAttributeEjR5TDes8 @ 17 NONAME
+	_ZN13RHttpDownload18GetStringAttributeEjR6TDes16 @ 18 NONAME
+	_ZN13RHttpDownload18SetStringAttributeEjRK6TDesC8 @ 19 NONAME
+	_ZN13RHttpDownload18SetStringAttributeEjRK7TDesC16 @ 20 NONAME
+	_ZN13RHttpDownload22GetFileHandleAttributeER5RFile @ 21 NONAME
+	_ZN13RHttpDownload22SetFileHandleAttributeER5RFile @ 22 NONAME
+	_ZN13RHttpDownload4MoveEv @ 23 NONAME
+	_ZN13RHttpDownload5PauseEv @ 24 NONAME
+	_ZN13RHttpDownload5ResetEv @ 25 NONAME
+	_ZN13RHttpDownload5StartEv @ 26 NONAME
+	_ZN13RHttpDownload6DeleteEv @ 27 NONAME
+	_ZN15TCommDbConnPref19SetDialogPreferenceE17TCommDbDialogPref @ 28 NONAME
+	_ZN15TCommDbConnPrefC1Ev @ 29 NONAME
+	_ZN15TCommDbConnPrefC2Ev @ 30 NONAME
+	_ZN16CMediaRecognizer14FreeFilehandleEv @ 31 NONAME
+	_ZN16CMediaRecognizer16IsValidUrlPrefixERK6TDesC8 @ 32 NONAME
+	_ZN16CMediaRecognizer16IsValidUrlPrefixERK7TDesC16 @ 33 NONAME
+	_ZN16CMediaRecognizer18IdentifyMediaTypeLERK7TDesC16R5RFilei @ 34 NONAME
+	_ZN16CMediaRecognizer18IdentifyMediaTypeLERK7TDesC16R7RFile64i @ 35 NONAME
+	_ZN16CMediaRecognizer18IdentifyMediaTypeLERK7TDesC16i @ 36 NONAME
+	_ZN16CMediaRecognizer22IsValidStreamingPrefixERK7TDesC16 @ 37 NONAME
+	_ZN16CMediaRecognizer4NewLEv @ 38 NONAME
+	_ZN16CMediaRecognizer9MimeTypeLER5RFile @ 39 NONAME
+	_ZN16CMediaRecognizer9MimeTypeLER7RFile64 @ 40 NONAME
+	_ZN16CMediaRecognizer9MimeTypeLERK7TDesC16 @ 41 NONAME
+	_ZN16CMediaRecognizerD0Ev @ 42 NONAME
+	_ZN16CMediaRecognizerD1Ev @ 43 NONAME
+	_ZN16CMediaRecognizerD2Ev @ 44 NONAME
+	_ZN16RHttpDownloadMgr10DisconnectEv @ 45 NONAME
+	_ZN16RHttpDownloadMgr12AddObserverLER24MHttpDownloadMgrObserver @ 46 NONAME
+	_ZN16RHttpDownloadMgr12FindDownloadERK6TDesC8S2_ @ 47 NONAME
+	_ZN16RHttpDownloadMgr14RemoveObserverER24MHttpDownloadMgrObserver @ 48 NONAME
+	_ZN16RHttpDownloadMgr15CreateDownloadLERK6TDesC8 @ 49 NONAME
+	_ZN16RHttpDownloadMgr15CreateDownloadLERK6TDesC8Ri @ 50 NONAME
+	_ZN16RHttpDownloadMgr15GetIntAttributeEjRl @ 51 NONAME
+	_ZN16RHttpDownloadMgr15SetIntAttributeEjl @ 52 NONAME
+	_ZN16RHttpDownloadMgr16GetBoolAttributeEjRi @ 53 NONAME
+	_ZN16RHttpDownloadMgr16SetBoolAttributeEji @ 54 NONAME
+	_ZN16RHttpDownloadMgr18CreateCodDownloadLERK6TDesC8S2_S2_P9CEikonEnvRi @ 55 NONAME
+	_ZN16RHttpDownloadMgr18GetStringAttributeEjR5TDes8 @ 56 NONAME
+	_ZN16RHttpDownloadMgr18GetStringAttributeEjR6TDes16 @ 57 NONAME
+	_ZN16RHttpDownloadMgr18SetNextUriObserverEP31MHttpDownloadMgrNextUriObserver @ 58 NONAME
+	_ZN16RHttpDownloadMgr18SetStringAttributeEjRK6TDesC8 @ 59 NONAME
+	_ZN16RHttpDownloadMgr18SetStringAttributeEjRK7TDesC16 @ 60 NONAME
+	_ZN16RHttpDownloadMgr22SetDefaultIntAttributeEjl @ 61 NONAME
+	_ZN16RHttpDownloadMgr23SetDefaultBoolAttributeEji @ 62 NONAME
+	_ZN16RHttpDownloadMgr25CreateClientSideDownloadLEiRi @ 63 NONAME
+	_ZN16RHttpDownloadMgr25SetDefaultStringAttributeEjRK6TDesC8 @ 64 NONAME
+	_ZN16RHttpDownloadMgr25SetDefaultStringAttributeEjRK7TDesC16 @ 65 NONAME
+	_ZN16RHttpDownloadMgr5CloseEv @ 66 NONAME
+	_ZN16RHttpDownloadMgr8ConnectLE4TUidR24MHttpDownloadMgrObserveri @ 67 NONAME
+	_ZN16RHttpDownloadMgr8PauseAllEv @ 68 NONAME
+	_ZN16RHttpDownloadMgr8ResetAllEv @ 69 NONAME
+	_ZN16RHttpDownloadMgr8StartAllEv @ 70 NONAME
+	_ZN16RHttpDownloadMgr9DeleteAllEv @ 71 NONAME
+	_ZN16RHttpDownloadMgrC1Ev @ 72 NONAME
+	_ZN16RHttpDownloadMgrC2Ev @ 73 NONAME
+	_ZN18RConnectionMonitor15GetIntAttributeEjjjRiR14TRequestStatus @ 74 NONAME
+	_ZN18RConnectionMonitor16GetUintAttributeEjjjRjR14TRequestStatus @ 75 NONAME
+	_ZN18RConnectionMonitor18GetConnectionCountERjR14TRequestStatus @ 76 NONAME
+	_ZN18RConnectionMonitor5CloseEv @ 77 NONAME
+	_ZN18RConnectionMonitor8ConnectLEv @ 78 NONAME
+	_ZN22RHttpDownloadMgrApiExt17AttachToDownloadLEl @ 79 NONAME
+	_ZN22RHttpDownloadMgrApiExtC1Ev @ 80 NONAME
+	_ZN22RHttpDownloadMgrApiExtC2Ev @ 81 NONAME
+	_ZN4User14WaitForRequestER14TRequestStatus @ 82 NONAME
+	_ZN9TConnPrefC1Ev @ 83 NONAME
+	_ZN9TConnPrefC2Ev @ 84 NONAME
+	_ZNK15TCommDbConnPref7CompareERKS_ @ 85 NONAME
+	_ZNK16RHttpDownloadMgr16CurrentDownloadsEv @ 86 NONAME
+	_ZNK16RHttpDownloadMgr7VersionEv @ 87 NONAME
+	_ZNK18RConnectionMonitor17GetConnectionInfoEjRjS0_ @ 88 NONAME
+	_ZTI11RConnection @ 89 NONAME
+	_ZTI13RHttpDownload @ 90 NONAME
+	_ZTI14CSimpleTimeout @ 91 NONAME
+	_ZTI15CDlMgrTestClass @ 92 NONAME
+	_ZTI15CMPXPausedState @ 93 NONAME
+	_ZTI15CMPXVideoRegion @ 94 NONAME
+	_ZTI15TCommDbConnPref @ 95 NONAME
+	_ZTI16CMPXPlayingState @ 96 NONAME
+	_ZTI16CMPXSeekingState @ 97 NONAME
+	_ZTI16CMPXStoppedState @ 98 NONAME
+	_ZTI16CMPXVideoDlMgrIf @ 99 NONAME
+	_ZTI16RHttpDownloadMgr @ 100 NONAME
+	_ZTI17CThumbnailManager @ 101 NONAME
+	_ZTI18CMPXBufferingState @ 102 NONAME
+	_ZTI18CMpxVideoDrmHelper @ 103 NONAME
+	_ZTI20CMPXInitialisedState @ 104 NONAME
+	_ZTI21CMPXInitialisingState @ 105 NONAME
+	_ZTI21CMPXLocalPlaybackMode @ 106 NONAME
+	_ZTI22CThumbnailObjectSource @ 107 NONAME
+	_ZTI23CMPXNotInitialisedState @ 108 NONAME
+	_ZTI25CMPXStreamingPlaybackMode @ 109 NONAME
+	_ZTI29CMPXLiveStreamingPlaybackMode @ 110 NONAME
+	_ZTI29CMPXProgressiveDLPlaybackMode @ 111 NONAME
+	_ZTV11RConnection @ 112 NONAME
+	_ZTV13RHttpDownload @ 113 NONAME
+	_ZTV14CSimpleTimeout @ 114 NONAME
+	_ZTV15CDlMgrTestClass @ 115 NONAME
+	_ZTV15CMPXPausedState @ 116 NONAME
+	_ZTV15CMPXVideoRegion @ 117 NONAME
+	_ZTV15TCommDbConnPref @ 118 NONAME
+	_ZTV16CMPXPlayingState @ 119 NONAME
+	_ZTV16CMPXSeekingState @ 120 NONAME
+	_ZTV16CMPXStoppedState @ 121 NONAME
+	_ZTV16CMPXVideoDlMgrIf @ 122 NONAME
+	_ZTV16RHttpDownloadMgr @ 123 NONAME
+	_ZTV17CThumbnailManager @ 124 NONAME
+	_ZTV18CMPXBufferingState @ 125 NONAME
+	_ZTV18CMpxVideoDrmHelper @ 126 NONAME
+	_ZTV20CMPXInitialisedState @ 127 NONAME
+	_ZTV21CMPXInitialisingState @ 128 NONAME
+	_ZTV21CMPXLocalPlaybackMode @ 129 NONAME
+	_ZTV22CThumbnailObjectSource @ 130 NONAME
+	_ZTV23CMPXNotInitialisedState @ 131 NONAME
+	_ZTV25CMPXStreamingPlaybackMode @ 132 NONAME
+	_ZTV29CMPXLiveStreamingPlaybackMode @ 133 NONAME
+	_ZTV29CMPXProgressiveDLPlaybackMode @ 134 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,35 @@
+/*
+* 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 videohelixtest class.
+*
+*/
+
+// Version : %version: 3 %
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_TESTEXPORTS
+../data/mmc/vhpp_test.3gp           /epoc32/winscw/c/data/videos/vhpp_test.3gp
+../data/mmc/sdp_test.sdp            /epoc32/winscw/c/data/videos/sdp_test.sdp
+../data/mmc/dcf.odf                 /epoc32/winscw/c/data/videos/dcf.odf
+
+../conf/videohelixtest.cfg          /epoc32/winscw/c/testframework/videohelixtest.cfg
+../init/testframework.ini           /epoc32/winscw/c/testframework/testframework.ini
+
+PRJ_TESTMMPFILES
+videohelixtest.mmp
+
+// EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/group/videohelixtest.mmp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,100 @@
+/*
+* 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:  Project definition file for project videohelixtest class.
+*
+*/
+
+// Version : %version:  ou1cpsw#13 %
+
+
+
+#include <platform_paths.hrh>
+
+TARGET          videohelixtest.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E3
+
+OPTION GCC      -save-temps
+
+EPOCALLOWDLLDATA
+
+CAPABILITY      ALL -TCB
+
+DEFFILE         videohelixtest.def
+
+APP_LAYER_SYSTEMINCLUDE
+
+USERINCLUDE     ../inc
+USERINCLUDE     ../../../inc
+USERINCLUDE     ../../../../inc
+USERINCLUDE     ../../../../../inc
+
+SOURCEPATH      ../src
+SOURCE          videohelixtest.cpp
+SOURCE          videohelixtestbody.cpp
+SOURCE          timeoutcontroller.cpp
+SOURCE          mpxvideoplayerutility_stub.cpp
+SOURCE          dlmgr_stub.cpp
+SOURCE          mpxvideoregion.cpp
+SOURCE          stifutilities.cpp
+SOURCE          mediarecognizer_stub.cpp
+SOURCE          mpxvideoaccessoryobserver_stub.cpp
+SOURCE          mpxvideodrmhelper_stub.cpp
+SOURCE          tnmgr_stub.cpp
+SOURCE          rconnection_stub.cpp
+
+SOURCEPATH      ../../../src
+SOURCE          mpxvideodlmgrif.cpp
+SOURCE          mpxvideofiledetails.cpp
+SOURCE          mpxvideohelixplayback.cpp
+SOURCE          mpxvideoplaybackcontroller.cpp
+SOURCE          mpxvideoplaybackmode.cpp
+SOURCE          mpxvideoplaybackstate.cpp
+SOURCE          mpxvideoseeker.cpp
+SOURCE          mpxvideoposterframesetter.cpp
+SOURCE          mpxcalldetector.cpp
+SOURCE          mpxvideoconnectionutility.cpp
+
+LIBRARY         euser.lib
+LIBRARY         mpxcommon.lib
+LIBRARY         stiftestinterface.lib
+LIBRARY         stiftestengine.lib
+LIBRARY         efsrv.lib
+LIBRARY         estor.lib
+
+LIBRARY         accclient.lib
+LIBRARY         accpolicy.lib
+LIBRARY         acccontrol.lib
+LIBRARY         accsrvutil.lib
+
+LIBRARY         mmfcontrollerframework.lib
+LIBRARY         mmfstandardcustomcommands.lib
+
+LIBRARY         hal.lib
+LIBRARY         caf.lib
+LIBRARY         sysutil.lib
+LIBRARY         ecom.lib
+LIBRARY         platformenv.lib
+LIBRARY         charconv.lib
+LIBRARY         etel.lib
+LIBRARY         etelmm.lib
+LIBRARY         centralrepository.lib
+LIBRARY         flogger.lib
+LIBRARY         playbackhelper.lib
+LIBRARY         hwrmlightclient.lib   // Lights control
+LIBRARY         fbscli.lib
+
+MACRO           USE_S60_DOWNLOAD_MANAGER
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/group/videohelixtest.pkg	Thu Nov 04 11:16:56 2010 +0200
@@ -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 videohelixtest STIF test
+;
+; Version : %version: 4 %
+;
+
+; Languages
+&EN
+
+; Provide value for uid
+#{"Video Helix STIF"}, (0x101FB3E3), 1, 0, 1, TYPE=SA, RU
+
+; Series60 product id for S60 3.0
+[0x101F7961], 0, 0, 0, {"Series60ProductID"}
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+; Install files
+"\epoc32\release\armv5\udeb\videohelixtest.dll"   -   "!:\sys\bin\videohelixtest.dll"
+
+"..\conf\videohelixtest.cfg" - "c:\testframework\videohelixtest.cfg"
+"..\init\testframework.ini" - "c:\testframework\testframework.ini"
+
+"..\data\mmc\dcf.odf" - "f:\testing\data\dcf.odf"
+"..\data\mmc\sdp_test.sdp" - "f:\testing\data\sdp_test.sdp"
+"..\data\mmc\vhpp_test.3gp" - "f:\testing\data\vhpp_test.3gp"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/dlmgr_stub.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,192 @@
+/*
+* 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:  API extensions for RHttpDownloadMgr Stub
+ *
+*/
+
+// Version : %version: 5 %
+
+#ifdef USE_S60_DOWNLOAD_MANAGER 
+
+#ifndef __RHTTPDOWNLOADMGRAPIEXT_H__
+#define __RHTTPDOWNLOADMGRAPIEXT_H__
+
+
+#include <e32base.h>
+#include <f32file.h>
+#include <eikenv.h>
+#include <httpdownloadmgrcommon.h>
+
+#include "videohelixtest.h"
+
+class RHttpDownloadMgr;
+
+class CDlMgrTestClass : public CBase
+{
+    public:
+        static CDlMgrTestClass* NewL();
+        virtual ~CDlMgrTestClass();
+
+        void AddStifObserver( MStifTestObserver* aStifObserver );
+        void AttachToDownloadL( const TInt32 aDlId );
+
+        void AddDownloadMgr( RHttpDownloadMgr* aDlMgr );
+
+        void PauseDownload();
+        void ResumeDownload();
+        void CancelDownload();
+
+    private:
+        CDlMgrTestClass();
+        void ConstructL();
+
+    private:
+        MStifTestObserver* iStifObserver;
+        RHttpDownloadMgr*  iDlMgr;
+};
+
+class RHttpDownload : public CBase
+{
+    public:
+
+        IMPORT_C TInt SetBoolAttribute( const TUint aAttribute, TBool aValue );
+        IMPORT_C TInt GetBoolAttribute( const TUint aAttribute, TBool& aValue );
+
+        IMPORT_C TInt GetStringAttribute( const TUint aAttribute, TDes16& aValue  );
+        IMPORT_C TInt SetStringAttribute( const TUint aAttribute, const TDesC16& aValue );
+
+        IMPORT_C TInt GetStringAttribute( const TUint aAttribute, TDes8& aValue  );
+        IMPORT_C TInt SetStringAttribute( const TUint aAttribute, const TDesC8& aValue );
+
+        IMPORT_C TInt GetIntAttribute( const TUint aAttribute, TInt32& aValue );
+        IMPORT_C TInt SetIntAttribute( const TUint aAttribute, TInt32 aValue );
+
+        IMPORT_C TInt GetFileHandleAttribute( RFile& aFile );
+        IMPORT_C TInt SetFileHandleAttribute( RFile& aFile );
+
+        IMPORT_C TInt Start();
+
+        IMPORT_C TInt Pause();
+
+        IMPORT_C TInt Delete();
+
+        IMPORT_C TInt Move();
+
+        IMPORT_C TInt Reset();
+
+        RHttpDownload( RHttpDownloadMgr* aServer );
+
+        ~RHttpDownload();
+
+    public:
+
+        TInt iLength;
+        TInt iState;
+        TInt iSize;
+        TInt iErrorId;
+        TInt iGlobalError;
+
+        TBool iProgressive;
+
+        HBufC* iLocalFile;
+        HBufC* iDestFile;
+
+        RHttpDownloadMgr*  iServer;
+};
+
+NONSHARABLE_CLASS( THttpDownloadEvent )
+{
+    public:
+        THttpDownloadState iDownloadState;
+        THttpProgressState iProgressState;
+};
+
+
+class MHttpDownloadMgrObserver
+{
+    public:
+        virtual void HandleDMgrEventL( RHttpDownload& aDownload, THttpDownloadEvent aEvent ) = 0;
+};
+
+
+class MHttpDownloadMgrNextUriObserver
+{
+    public:
+        virtual void NextUriL( RHttpDownload& aDownload, const TDesC8& aUri ) = 0;
+};
+
+
+typedef CArrayPtrFlat<RHttpDownload> CDownloadArray;
+typedef CArrayPtrFlat<MHttpDownloadMgrObserver>  CDownloadMgrObserver;
+
+class RHttpDownloadMgr : public CBase
+{
+    public:
+
+        IMPORT_C RHttpDownloadMgr();
+        IMPORT_C void ConnectL( TUid aAppUid, MHttpDownloadMgrObserver& aObserver, TBool aMaster );
+        IMPORT_C TVersion Version() const;
+        IMPORT_C void Close();
+        IMPORT_C const CDownloadArray& CurrentDownloads() const;
+        IMPORT_C RHttpDownload& CreateDownloadL( const TDesC8& aUrl, TBool& aResult );
+        IMPORT_C RHttpDownload& CreateDownloadL( const TDesC8& aUrl );
+        IMPORT_C RHttpDownload& CreateClientSideDownloadL( TInt aHttpTransaction,TBool& aResult );
+        IMPORT_C RHttpDownload& CreateCodDownloadL( const TDesC8& aUrl, const TDesC8& aBuf, const TDesC8& aMimeType, CEikonEnv* aEikEnv, TBool& aResult );
+        IMPORT_C RHttpDownload* FindDownload( const TDesC8& aUrl, const TDesC8& aMsgBody );
+        IMPORT_C TInt PauseAll();
+        IMPORT_C TInt StartAll();
+        IMPORT_C TInt ResetAll();
+        IMPORT_C TInt DeleteAll();
+        IMPORT_C TInt Disconnect();
+        IMPORT_C TInt GetIntAttribute( const TUint aAttribute, TInt32& aValue );
+        IMPORT_C TInt GetBoolAttribute( const TUint aAttribute, TBool& aValue );
+        IMPORT_C TInt GetStringAttribute( const TUint aAttribute, TDes16& aValue  );
+        IMPORT_C TInt GetStringAttribute( const TUint aAttribute, TDes8& aValue  );
+        IMPORT_C TInt SetIntAttribute( const TUint aAttribute, TInt32 aValue );
+        IMPORT_C TInt SetBoolAttribute( const TUint aAttribute, TBool aValue );
+        IMPORT_C TInt SetStringAttribute( const TUint aAttribute, const TDesC16& aValue );
+        IMPORT_C TInt SetStringAttribute( const TUint aAttribute, const TDesC8& aValue );
+        IMPORT_C TInt SetDefaultIntAttribute( const TUint aAttribute, TInt32 aValue );
+        IMPORT_C TInt SetDefaultBoolAttribute( const TUint aAttribute, TBool aValue );
+        IMPORT_C TInt SetDefaultStringAttribute( const TUint aAttribute, const TDesC16& aValue );
+        IMPORT_C TInt SetDefaultStringAttribute( const TUint aAttribute, const TDesC8& aValue );
+        IMPORT_C void AddObserverL( MHttpDownloadMgrObserver& aObserver );
+        IMPORT_C void RemoveObserver( MHttpDownloadMgrObserver& aObserver );
+        IMPORT_C void SetNextUriObserver( MHttpDownloadMgrNextUriObserver* aObserver );
+
+        ~RHttpDownloadMgr();
+
+        static TInt UpdateDownloadProgress( TAny* aPtr );
+        void DoUpdateDownloadProgress();
+
+    public:
+
+        CDownloadArray*        iDownloadArray;
+        CDownloadMgrObserver*  iObservers;
+        CIdle*                 iUpdateSize;
+        CDlMgrTestClass*       iDlMgrCallback;
+};
+
+
+class RHttpDownloadMgrApiExt : public RHttpDownloadMgr
+{
+    public:
+
+        IMPORT_C RHttpDownloadMgrApiExt();
+        IMPORT_C RHttpDownload& AttachToDownloadL( const TInt32 aDlId );
+};
+
+#endif // __RHTTPDOWNLOADMGRAPIEXT_H__
+
+#endif // USE_S60_DOWNLOAD_MANAGER 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/mpxvideoaccessoryobserver_stub.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,101 @@
+/*
+* 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:   This class observes the accessory framework.
+ *
+*/
+
+// Version : %version: 5 %
+
+
+
+#ifndef MPXVIDEOACCESSORYOBSERVER_H
+#define MPXVIDEOACCESSORYOBSERVER_H
+
+//
+//  INCLUDES
+//
+#include <e32std.h>
+#include <e32base.h>
+
+#include "mpxvideo_debug.h"
+
+//
+//  FORWARD DECLARATIONS
+//
+class CMPXVideoPlaybackController;
+
+//
+//  CLASS DECLARATION
+//
+
+NONSHARABLE_CLASS( CMPXVideoAccessoryObserver )
+{
+    public:
+        /*
+         *  Two phase constructor
+         *  @param aObs  Reference to an event observer
+         */
+        static CMPXVideoAccessoryObserver* NewL( CMPXVideoPlaybackController* aController );
+
+        /*
+         *  Destructor
+         */
+        virtual ~CMPXVideoAccessoryObserver();
+
+    public:
+
+        /*
+         *  Returns the status of the TV-Out cable connection
+         *  @return the cable connection status
+         *     ETrue    cable is connected.
+         *     EFalse   cable is not connected.
+         */
+        TBool IsTvOutConnected();
+
+        /*
+         *  Returns if the playback is allowed when the TV-Out cable is connected
+         *  @return  playback is allowed
+         *     ETrue    playback is allowed.
+         *     EFalse   playback is not allowed.
+         */
+        TBool IsTvOutPlaybackAllowed();
+
+        void UpdateTvOutStatusL( TBool aTvOutConnected );
+        void SetTvOutConnected( TBool aConnected );
+        void SetTvOutPlaybackAllowed( TBool aAllowed );
+
+    private:
+
+        /*
+         *  C++ default constructor.
+         *  @param aObs  Reference to an event observer
+         */
+        CMPXVideoAccessoryObserver( CMPXVideoPlaybackController* aController );
+
+        /*
+         *  By default Symbian 2nd phase constructor is private.
+         *  Create and connect to the driver and Central Repository.
+         */
+        void ConstructL();
+
+    private:
+
+        CMPXVideoPlaybackController*        iController;
+        TBool                               iTvOutConnected;
+        TBool                               iTvOutPlaybackAllowed;
+};
+
+#endif  //  MPXVIDEOACCESSORYOBSERVER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/mpxvideoplayerutility_stub.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,197 @@
+/*
+* 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:  This class is the interface between the playback plugin and RMMFController
+ *
+*/
+
+// Version : %version: 15 %
+
+
+#ifndef __MPXVIDEOPLAYERUTILITY__
+#define __MPXVIDEOPLAYERUTILITY__
+
+//
+//  INCLUDES
+//
+#include <mmf/common/mmfcontroller.h>
+#include <e32base.h>
+
+#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
+#include <mmf/common/mmfstandardcustomcommandsimpl.h>
+#else
+#include <mmf/common/mmfstandardcustomcommands.h>
+#endif
+
+#include <mmf/common/mmfdrmcustomcommands.h>
+
+#ifdef SYMBIAN_BUILD_GCE
+#include <mmf/common/mmfvideosurfacecustomcommands.h>
+#endif
+
+#include "videohelixtest.h"
+
+typedef CArrayPtrFlat<TMMFEvent> CMmfCallbackArray;
+
+//
+//  FORWARD DECLARATIONS
+//
+class CMPXVideoPlaybackController;
+class CFbsBitmap;
+
+//
+//  CLASS DECLARATION
+//
+
+NONSHARABLE_CLASS( CMpxVideoPlayerUtility ) : public CBase,
+                                              public MMMFControllerEventMonitorObserver
+{
+    public:
+
+        static CMpxVideoPlayerUtility* NewL( CMPXVideoPlaybackController* aVideoPlaybackCtrl );
+        ~CMpxVideoPlayerUtility();
+
+        void Reset();
+
+        void OpenFileL( const TDesC& aFileName );
+        void OpenFileL( const RFile& aFile );
+        void OpenUrlL( const TDesC& aUrl, TInt aApId );
+
+        TTimeIntervalMicroSeconds PositionL() const;
+        TTimeIntervalMicroSeconds DurationL() const;
+
+        TInt NumberOfMetaDataEntriesL() const;
+        CMMFMetaDataEntry* MetaDataEntryL( TInt aIndex ) const;
+
+        TBool AudioEnabledL() const;
+        void SetVolumeL( TInt aVolume );
+        TInt Volume() const;
+        TInt MaxVolume() const;
+
+        void VideoFrameSizeL( TSize& aSize ) const;
+        TInt VideoBitRateL() const;
+        TInt AudioBitRateL() const;
+        TInt VideoFormatMimeType( TDes8& aMimeType ) const;
+        TUint32 FourCCCode() const;
+        void RefreshFrameL();
+
+        void RestartDsa( const TRegion& aRegion );
+        void AbortDsa();
+        void SetDisplayWindowL( const TRect& aScreenRect,
+                                const TRect& aClipRect,
+                                const TRegion& aDrawingRegion );
+
+        TInt CustomCommandSync( const TMMFMessageDestinationPckg& aDestination,
+                                TInt aFunction,
+                                const TDesC8& aDataTo1,
+                                const TDesC8& aDataTo2 );
+
+        void Prepare();
+        void PlayL();
+        void PauseL();
+        void Close();
+        TInt Stop();
+
+        void SetPositionL( const TTimeIntervalMicroSeconds& aPosition );
+
+        void SetPlayVelocityL( TInt aVelocity );
+
+        void GetVideoLoadingProgressL( TInt& aPercentageProgress );
+
+        //
+        //  MMMFControllerEventMonitorObserver Implementation
+        //
+        void HandleEvent( const TMMFEvent& aEvent );
+
+        void AddStifObserver( MStifTestObserver* aStifObserver );
+
+        void SetVolumeSteps( TInt aVolumeSteps );
+
+        void SurfaceRemovedFromView();
+
+        void GetFrameL();
+        CFbsBitmap& GetBitmap();
+
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+        void OpenFile64L( const RFile64& aFile );
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+#ifdef SYMBIAN_BUILD_GCE
+
+        TInt VideoSurfaceCreated();
+        TInt SurfaceParametersChanged();
+        void RemoveSurface();
+        TInt RemoveSurfaceFromHelix( TSurfaceId aSurfaceId );;
+        void SendSurfaceCreatedCommand();
+
+#endif
+
+    private:
+
+        void ConstructL();
+        CMpxVideoPlayerUtility( CMPXVideoPlaybackController* aVideoPlaybackCtrl );
+        void OpenControllerL();
+
+        static TInt SendMmfEvent( TAny* aPtr );
+        void DoSendMmfEvent();
+        void AddCallbackEvent( TMMFEvent* event );
+
+        TInt ReadOpenError();
+        void ReadFileDetails( const RFile& aFile );
+        void ParseFileDetails( TDesC8& aBuffer );
+        TInt ParseDetail( TPtrC8& aData );
+        void FindFileDetail( TPtrC8& aItem, TPtrC8& value );
+
+    private:
+
+        //
+        //  Data
+        //
+        CMPXVideoPlaybackController*     iVideoPlaybackController;
+        CIdle*                           iCallback;
+        CMmfCallbackArray*               iEventArray;
+        MStifTestObserver*               iStifObserver;
+
+        TBool                            iFirstPlayCmd;
+
+        RArray<CMMFMetaDataEntry*> iMetaData;
+
+        HBufC8*   iMimeType;
+        HBufC8*   iTitle;
+        HBufC8*   iDescription;
+        HBufC8*   iArtist;
+        HBufC8*   iLocation;
+        HBufC8*   iCopyright;
+        HBufC8*   iLanguage;
+        HBufC8*   iKeywords;
+
+        TSize    iSize;
+
+        TInt     iNumMetaDataEntries;
+        TInt     iAudioBitRate;
+        TInt     iVideoBitRate;
+        TInt     iVolume;
+        TInt     iCreationTime;
+        TInt     iModificationTime;
+
+        TBool    iAudioEnabled;
+        TBool    iSeekable;
+        TBool    iLiveStream;
+
+        TTimeIntervalMicroSeconds iPosition;
+        TTimeIntervalMicroSeconds iDuration;
+
+        CFbsBitmap* iPosterFrameBitmap;
+};
+
+#endif /* __MPXVIDEOPLAYERUTILITY__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/mpxvideoregion.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,52 @@
+/*
+* 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:  Externalizable container for DSA region
+*
+*/
+
+// Version : %version: 2 %
+
+
+ 
+
+#ifndef CMPXVIDEOREGION_H
+#define CMPXVIDEOREGION_H
+
+
+#include <e32base.h>
+#include <s32strm.h>
+
+class CMPXVideoRegion: public CBase 
+{  
+public:    
+    static CMPXVideoRegion* NewL();
+    static CMPXVideoRegion* NewLC();
+    ~CMPXVideoRegion();
+
+    void Print();
+    void SetRegion( RRegion& aRegion );
+    TRegion& GetRegion();
+   
+    void ExternalizeL( RWriteStream& aStream ) const;
+    void InternalizeL( RReadStream& aStream );
+    
+private:
+    CMPXVideoRegion(); 
+    void ConstructL();
+    
+private:
+    RRegion* iRegion;
+};
+
+#endif // CMPXVIDEOREGION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/stifutilities.h	Thu Nov 04 11:16:56 2010 +0200
@@ -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:  mpx utilities class stub for STIF testing
+*
+*/
+
+// Version : %version: 2 %
+
+#ifndef STIFUTILITIES_H_
+#define STIFUTILITIES_H_
+
+#include "dlmgr_stub.h"
+#include "mpxvideoplayerutility_stub.h"
+#include "mpxvideoaccessoryobserver_stub.h"
+
+class StifUtilities : public CBase
+{
+    public:
+        static void CreateStifUtility();
+
+    public:
+        CMpxVideoPlayerUtility*     iPlayerUtility;
+        CDlMgrTestClass*            iDlMgrTester;
+        CMPXVideoAccessoryObserver* iAccObserver;
+};
+
+#endif /*STIFUTILITIES_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/timeoutcontroller.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,76 @@
+/*
+* Copyright (c) 2006 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:  Simple player for preemption purposes
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+#include <e32svr.h>
+#include <stifparser.h>
+#include <stiflogger.h>
+#include <stiftestinterface.h>
+
+
+class MTimeoutObserver
+{
+    public: // New functions
+    
+        virtual void HandleTimeout(TInt error) = 0;
+};
+    
+
+_LIT(KFormatTimeStamp, "%:0%J%:1%T%:2%S%.%*C4%:3%+B");
+
+
+class CSimpleTimeout : public CActive
+{
+    public:     // Constructors and destructor
+
+        static CSimpleTimeout* NewL( MTimeoutObserver* aObserver, 
+                                     CStifLogger* aLogger );
+
+        ~CSimpleTimeout();
+
+    public:     // New functions
+
+        void Start( TTimeIntervalMicroSeconds aTimeout );
+
+        void Stop();
+
+
+    public:     // Functions from base classes
+
+        void RunL();
+
+        void DoCancel();
+
+        TInt RunError( TInt aError );
+
+    private:
+
+        void ConstructL(MTimeoutObserver* aObserver, CStifLogger* aLogger);
+        CSimpleTimeout();
+
+
+    private:    // Data
+        MTimeoutObserver*   iObserver;
+        RTimer                           iTimer;
+
+        // Storage for testcase timeout.
+        TTime                       iTestCaseTimeout;
+        CStifLogger*                iLog;
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/tnmgr_stub.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,68 @@
+/*
+* 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:  Thumbnail Manager Stub
+ *
+*/
+
+// Version : %version: 1 %
+
+#ifndef TNMGR_STUB_H_
+#define TNMGR_STUB_H_
+
+class CFbsBitmap;
+class MThumbnailData;
+//class MThumbnailManagerObserver;
+
+typedef TInt TThumbnailRequestId;
+
+class MThumbnailManagerObserver
+    {
+public:
+
+    virtual void ThumbnailPreviewReady( MThumbnailData& aThumbnail,
+                                        TThumbnailRequestId aId ) = 0;
+
+    virtual void ThumbnailReady( TInt aError, MThumbnailData& aThumbnail,
+                                 TThumbnailRequestId aId ) = 0;
+};
+
+
+class CThumbnailObjectSource : public CBase
+    {
+public:
+
+    CThumbnailObjectSource( CFbsBitmap*  aBitmap, const TDesC& aUri );
+    virtual ~CThumbnailObjectSource();    
+    static CThumbnailObjectSource* NewL( CFbsBitmap*  aBitmap, const TDesC& aUri );
+};
+
+
+
+class CThumbnailManager : public CBase
+{
+    
+public:
+    
+    CThumbnailManager( MThumbnailManagerObserver& aObserver );
+    virtual ~CThumbnailManager();
+    static CThumbnailManager* NewL( MThumbnailManagerObserver& aObserver ); 
+    
+    TThumbnailRequestId SetThumbnailL( CThumbnailObjectSource& source );   
+    
+public:
+    MThumbnailManagerObserver&   iObserver;
+};
+
+
+#endif /* TNMGR_STUB_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/videohelixtest.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,270 @@
+/*
+* 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:  Test Harness for VideoHelix Playback Plugin
+ *
+*/
+
+// Version : %version: 17 %
+
+
+#ifndef __VHPPTESTCASE_H__
+#define __VHPPTESTCASE_H__
+
+//  INCLUDES
+
+#include <stiflogger.h>
+#include <testscripterinternal.h>
+#include <stiftestmodule.h>
+
+#include <mpxplaybackpluginobserver.h>
+#include <mpxplaybackplugin.h>
+#include <mpxplaybackpluginversion2.h>
+
+#include <coreapplicationuisdomainpskeys.h>
+#include <ctsydomainpskeys.h>
+#include <mmf/common/mmferrors.h>
+
+#include <AccessoryServer.h>
+#include <AccessoryControl.h>
+#include <AccPolGIDHeader.h>
+#include <AccPolGenericID.h>
+
+#include <mpxvideoplaybackdefs.h>
+#include "timeoutController.h"
+
+// MACROS
+#define TEST_CLASS_VERSION_MAJOR 0
+#define TEST_CLASS_VERSION_MINOR 0
+#define TEST_CLASS_VERSION_BUILD 0
+
+//
+//  FORWARD DECLARATIONS
+//
+class CMpxVideoPlayerUtility;
+class CDlMgrTestClass;
+class CMPXVideoAccessoryObserver;
+
+// CLASS DECLARATION
+
+
+enum TDlMgrStifEvents
+{
+    EConnectedToDownload,
+    EFileMoving
+};
+
+typedef struct
+{
+    TInt  iEvent;
+    TInt  iData;
+    TInt  iError;
+} TCallbackEvent;
+
+typedef CArrayPtrFlat<TCallbackEvent> CCallbackEventArray;
+
+NONSHARABLE_CLASS( MStifTestObserver )
+{
+    public:
+        virtual void HandleUtilityEvent( TCallbackEvent* aEvent ) = 0;
+};
+
+/**
+*  CVHPPTestClass test
+*  class for STIF Test Framework TestScripter.
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+NONSHARABLE_CLASS( CVHPPTestClass ) : public CScriptBase,
+                                      public MTimeoutObserver,
+                                      public MMPXPlaybackPluginObserver,
+                                      public MStifTestObserver
+{
+    public:  // Constructors and destructor
+
+        /*
+         * Two-phased constructor.
+         */
+        static CVHPPTestClass* NewL( CTestModuleIf& aTestModuleIf );
+
+        /*
+         * Destructor.
+         */
+        virtual ~CVHPPTestClass();
+
+        void HandleUtilityEvent( TCallbackEvent* aEvent );
+
+    public: // Functions from base classes
+
+        /*
+         * From CScriptBase Runs a script line.
+         * @param aItem Script line containing method name and parameters
+         * @return Symbian OS error code
+         */
+        virtual TInt RunMethodL( CStifItemParser& aItem );
+
+    private:
+
+        /*
+         * C++ default constructor.
+         */
+        CVHPPTestClass( CTestModuleIf& aTestModuleIf );
+
+        /*
+         * By default Symbian 2nd phase constructor is private.
+         */
+        void ConstructL();
+
+        // ---------------------------------------------------------------------
+        //  Test Cases
+        // ---------------------------------------------------------------------
+        virtual TInt InitializeL( CStifItemParser& aItem );
+        virtual TInt InitializeHandleL( CStifItemParser& aItem );
+        virtual TInt InitializeLinkL( CStifItemParser& aItem );
+        virtual TInt InitializeSdpL( CStifItemParser& aItem );
+        virtual TInt IssueGeneralCommandL( CStifItemParser& aItem );
+        virtual TInt IssuePlaybackCommandL( CStifItemParser& aItem );
+        virtual TInt IssueVideoCommandL( CStifItemParser& aItem );
+        virtual TInt IssueSeekingCommandL( CStifItemParser& aItem );
+        virtual TInt SetPropertyL( CStifItemParser& aItem );
+        virtual TInt GetPropertyL( CStifItemParser& aItem );
+        virtual TInt GetSubPlayerNamesL( CStifItemParser& aItem );
+        virtual TInt SelectSubPlayerL( CStifItemParser& aItem );
+        virtual TInt SubPlayerName( CStifItemParser& aItem );
+        virtual TInt SubPlayerIndex( CStifItemParser& aItem );
+        virtual TInt GetMediaL( CStifItemParser& aItem );
+        virtual TInt CancelRequest( CStifItemParser& aItem );
+        virtual TInt SetPlaybackCompleteL( CStifItemParser& aItem );
+        virtual TInt SetUnexpectedMmfEventL( CStifItemParser& aItem );
+        virtual TInt ConnectToDownloadL( CStifItemParser& aItem );
+        virtual TInt PauseDownloadL( CStifItemParser& aItem );
+        virtual TInt ResumeDownloadL( CStifItemParser& aItem );
+        virtual TInt CancelDownloadL( CStifItemParser& aItem );
+        virtual TInt RetrievePdlStatusL( CStifItemParser& aItem );
+        virtual TInt ChangeAspectRatioL( CStifItemParser& aItem );
+
+        virtual TInt AlarmOn( CStifItemParser& aItem );
+
+        virtual TInt PhoneCallRejected( CStifItemParser& aItem );
+        virtual TInt VoiceCallAccepted( CStifItemParser& aItem );
+        virtual TInt VideoCallAccepted( CStifItemParser& aItem );
+        virtual TInt PlayduringVideoCall( CStifItemParser& aItem );
+        virtual TInt PlayduringVoiceCall( CStifItemParser& aItem );
+        virtual TInt EndPhoneCall();
+        virtual TInt SetTvOutConnectedL( CStifItemParser& aItem );
+        virtual TInt SetTvOutDisconnectedL();
+        virtual TInt ConnectTvOutL( CStifItemParser& aItem );
+        virtual TInt DisconnectTvOutL();
+        virtual TInt SetDrmProtectedL( CStifItemParser& aItem );
+        virtual TInt IssueSeekedToEndCommandL( CStifItemParser& aItem );
+        virtual TInt HandleVolumeL( CStifItemParser& aItem );
+        virtual TInt InitializeWithPositionL( CStifItemParser& aItem );
+        virtual TInt InitializeLinkWithPositionL( CStifItemParser& aItem );
+        virtual TInt InitializeHandleWithPositionL( CStifItemParser& aItem );
+        virtual TInt InitializeStreamingWithSdpFileHandleL( CStifItemParser& aItem  );
+        virtual TInt RetrieveFileNameAndModeL( CStifItemParser& aItem );
+        virtual TInt StartDefaultConnectionL(  CStifItemParser& aItem  );
+        virtual TInt CheckAccessPointL(  CStifItemParser& aItem  );
+
+        // ---------------------------------------------------------------------
+        //  Helper Functions
+        // ---------------------------------------------------------------------
+        TInt ReadFileInitializationParameters( CStifItemParser& aItem, TDes& aFilename );
+        TInt ReadInitializationErrors( CStifItemParser& aItem );
+        void CreateGeneralPlaybackCommandL( TMPXPlaybackCommand aCmd );
+        void WriteControllerError( const TDesC& aFilename, TInt aData );
+        void PreparePluginL();
+        TRect ReadRect( CStifItemParser& aItem );
+        TInt ParsePlaybackCommand( CStifItemParser& aItem, TInt& aCmd );
+        void CreateVideoPlaybackCommandL( CStifItemParser& aItem,
+                                          TMPXVideoPlaybackCommand aCmd );
+        void SendPdlCustomCommandL( TMPXPlaybackPdCommand aCustomCmd );
+        void CreateBackgroundCommand( TBool aBackground );
+        TInt SetVolumeSteps(  TInt aVolumeSteps  );
+
+
+        //----------------------------------------------------------------------
+        //  MMPXPlaybackPluginObserver Implementation
+        //----------------------------------------------------------------------
+        virtual void HandlePluginEvent( TEvent aEvent,
+                                        TInt aData,
+                                        TInt aError );
+
+        virtual void HandlePlaybackMessage( const CMPXMessage& aMsg )
+        {
+            HandlePlaybackMessage(const_cast<CMPXMessage*>(&aMsg), KErrNone);
+        }
+
+        virtual void HandlePlaybackMessage( CMPXMessage* aMsg,
+                                            TInt aErr );
+
+        //----------------------------------------------------------------------
+        //  MMPXPlaybackEngineObserver Implementation
+        //----------------------------------------------------------------------
+        virtual void HandleProperty( TMPXPlaybackProperty aProperty,
+                                     TInt aValue,
+                                     TInt aError );
+
+        virtual void HandleSubPlayerNames( TUid aPlayer,
+                                           const MDesCArray* aSubPlayers,
+                                           TBool aComplete,
+                                           TInt aError );
+
+        virtual void HandleMedia( const CMPXMedia& aMedia,
+                                  TInt aError )
+        {
+            HandleMedia( const_cast<CMPXMedia*>(&aMedia), aError );
+        }
+
+        virtual void HandleMedia( CMPXMedia* aMedia, TInt aError );
+
+        virtual void HandlePlaybackCommandComplete( CMPXCommand* aCommandResult,
+                                                    TInt aError );
+
+
+        //----------------------------------------------------------------------
+        //  MTimeoutObserver Implementation
+        //----------------------------------------------------------------------
+        void HandleTimeout( TInt error );
+
+        //----------------------------------------------------------------------
+        //  Other Methods
+        //----------------------------------------------------------------------
+        void AddExpectedEvent( TCallbackEvent* event );
+        void AddErrorEvent( TInt aError );
+        void ProcessEvent( TCallbackEvent* aCallback );
+        void ProcessErrorEvent( TInt aError );
+
+        void CleanupTempFiles();
+
+    private:
+        CTestModuleIf&                iTestModuleIf;
+        CMPXPlaybackPluginVersion2*   iPlaybackPlugin;
+        CStifLogger*                  iLog;
+        CSimpleTimeout*               iTimeoutController;
+
+        CMpxVideoPlayerUtility*       iPlayerUtility;
+        CDlMgrTestClass*              iDlMgrTester;
+        CMPXVideoAccessoryObserver*   iAccObserver;
+
+
+        CCallbackEventArray*          iExpectedCallbackArray;
+        TInt                          iExpectedError;
+        TBool                         iFirstPlayCmd;
+        TBool                         iAllowPositionCallback;
+};
+
+#endif  //  __VHPPTESTCASE_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/init/testframework.ini	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,200 @@
+#
+# 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'.
+#   + XML, Test report will be xml type, for example 'TestReport.xml'.
+#          Note, that xml format is available only when output is set to FILE.
+#
+# 	- 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_videohelixtest
+
+TestReportFormat= TXT         # Possible values: TXT, HTML or XML
+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'
+
+Timeout= 0                    # Default timeout value for each test case. In milliseconds
+#UITestingSupport= YES        # Possible values: YES or NO
+#SeparateProcesses= YES       # Possible values: YES or NO (default: NO)
+[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\videohelixtest.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:\LOGS\TestFramework\
+#EmulatorFormat= HTML         # Possible values: TXT or HTML
+#EmulatorOutput= FILE         # Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML         # 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/src/dlmgr_stub.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,588 @@
+/*
+* 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:  API extensions for RHttpDownloadMgr
+*
+*/
+
+// Version : %version: 4 %
+
+#include "stifutilities.h"
+#include "dlmgr_stub.h"
+#include "mpxvideo_debug.h"
+
+CDlMgrTestClass*
+CDlMgrTestClass::NewL()
+{
+    MPX_ENTER_EXIT(_L("CDlMgrTestClass::NewL()"));
+
+    StifUtilities* utility = reinterpret_cast<StifUtilities*>( Dll::Tls() );
+
+    if ( ! utility->iDlMgrTester )
+    {
+        utility->iDlMgrTester = new CDlMgrTestClass();
+    }
+
+    return utility->iDlMgrTester;
+}
+
+CDlMgrTestClass::CDlMgrTestClass()
+{
+}
+
+CDlMgrTestClass::~CDlMgrTestClass()
+{
+}
+
+void
+CDlMgrTestClass::AddStifObserver( MStifTestObserver* aStifObserver )
+{
+    MPX_ENTER_EXIT(_L("CDlMgrTestClass::AddStifObserver()"));
+
+    iStifObserver = aStifObserver;
+}
+
+void
+CDlMgrTestClass::AttachToDownloadL( const TInt32 aDlId )
+{
+    MPX_ENTER_EXIT(_L("CDlMgrTestClass::AttachToDownloadL()"));
+
+    if ( iStifObserver )
+    {
+        TCallbackEvent* event = new TCallbackEvent;
+        event->iEvent = EConnectedToDownload;
+        event->iData  = aDlId;
+        event->iError = KErrNone;
+        iStifObserver->HandleUtilityEvent( event );
+    }
+}
+
+void
+CDlMgrTestClass::AddDownloadMgr( RHttpDownloadMgr* aDlMgr )
+{
+    iDlMgr = aDlMgr;
+}
+
+void
+CDlMgrTestClass::PauseDownload()
+{
+    iDlMgr->PauseAll();
+}
+
+void
+CDlMgrTestClass::ResumeDownload()
+{
+    iDlMgr->StartAll();
+}
+
+void
+CDlMgrTestClass::CancelDownload()
+{
+    iDlMgr->DeleteAll();
+}
+
+EXPORT_C TInt
+RHttpDownload::SetBoolAttribute( const TUint aAttribute, TBool aValue )
+{
+    MPX_DEBUG(_L("RHttpDownload::SetBoolAttribute(%d, %d)"), aAttribute, aValue);
+
+    if ( aAttribute == EDlAttrProgressive )
+    {
+        iProgressive = aValue;
+    }
+
+    return KErrNone;
+}
+
+EXPORT_C TInt
+RHttpDownload::GetBoolAttribute( const TUint aAttribute, TBool& aValue )
+{
+    if ( aAttribute == EDlAttrProgressive )
+    {
+        aValue = iProgressive;
+    }
+
+    MPX_DEBUG(_L("RHttpDownload::GetBoolAttribute(%d, %d)"), aAttribute, aValue);
+
+    return KErrNone;
+}
+
+EXPORT_C TInt
+RHttpDownload::GetStringAttribute( const TUint /*aAttribute*/, TDes16& /*aValue*/ )
+{
+    return KErrNone;
+}
+
+EXPORT_C TInt
+RHttpDownload::SetStringAttribute( const TUint aAttribute, const TDesC16& aValue)
+{
+    MPX_DEBUG(_L("RHttpDownload::SetStringAttribute(%d, %S)"), aAttribute, &aValue);
+
+    if ( aAttribute == EDlAttrLocalFileName )
+    {
+        iLocalFile = aValue.Alloc();
+    }
+    else if ( aAttribute == EDlAttrDestFilename )
+    {
+        iDestFile = aValue.Alloc();
+    }
+
+    return KErrNone;
+}
+
+EXPORT_C TInt
+RHttpDownload::GetStringAttribute( const TUint /*aAttribute*/, TDes8& /*aValue*/ )
+{
+    return KErrNone;
+}
+
+EXPORT_C TInt
+RHttpDownload::SetStringAttribute( const TUint /*aAttribute*/, const TDesC8& /*aValue*/ )
+{
+    return KErrNone;
+}
+
+EXPORT_C TInt
+RHttpDownload::GetIntAttribute( const TUint aAttribute, TInt32& aValue )
+{
+    switch ( aAttribute )
+    {
+        case EDlAttrLength:
+        {
+            aValue = iLength;
+            break;
+        }
+        case EDlAttrDownloadedSize:
+        {
+            aValue = iSize;
+            break;
+        }
+        case EDlAttrState:
+        {
+            aValue = iState;
+            break;
+        }
+        case EDlAttrErrorId:
+        {
+            aValue = iErrorId;
+            break;
+        }
+        case EDlAttrGlobalErrorId:
+        {
+            aValue = iGlobalError;
+        }
+    }
+
+    MPX_DEBUG(_L("RHttpDownload::GetIntAttribute(%d, %d)"), aAttribute, aValue);
+
+    return KErrNone;
+}
+
+EXPORT_C TInt
+RHttpDownload::SetIntAttribute( const TUint /*aAttribute*/, TInt32 /*aValue*/ )
+{
+    return KErrNone;
+}
+
+EXPORT_C TInt
+RHttpDownload::GetFileHandleAttribute( RFile& /*aFile*/ )
+{
+    return KErrNone;
+}
+
+EXPORT_C TInt
+RHttpDownload::SetFileHandleAttribute( RFile& /*aFile*/ )
+{
+    return KErrNone;
+}
+
+EXPORT_C TInt
+RHttpDownload::Start()
+{
+    MPX_DEBUG(_L("RHttpDownload::Start()"));
+
+    iState = EHttpDlInprogress;
+
+    RFile file;
+    _LIT(KFileName, "\\vhpp_dlmgr.txt");
+
+    RFs fs;
+    fs.Connect();
+
+    file.Open( fs, KFileName, EFileRead | EFileShareAny );
+
+    TInt dlSize;
+    HBufC8* fBuf = HBufC8::NewL( 16 );
+    TPtr8 fileBuf = fBuf->Des();
+
+    file.Read( fileBuf, 16 );
+
+    TLex8 number( fileBuf );
+    number.Val( dlSize );
+
+    iSize = dlSize;
+
+    file.Close();
+    fs.Close();
+
+    iServer->iUpdateSize->Start(
+        TCallBack( RHttpDownloadMgr::UpdateDownloadProgress, iServer ) );
+
+    return KErrNone;
+}
+
+EXPORT_C TInt
+RHttpDownload::Pause()
+{
+    MPX_DEBUG(_L("RHttpDownload::Pause()"));
+
+    iState = EHttpDlPaused;
+
+    iServer->iUpdateSize->Start(
+        TCallBack( RHttpDownloadMgr::UpdateDownloadProgress, iServer ) );
+
+    return KErrNone;
+}
+
+EXPORT_C TInt
+RHttpDownload::Delete()
+{
+    MPX_DEBUG(_L("RHttpDownload::Delete()"));
+
+    iState = EHttpDlFailed;
+
+    iServer->iUpdateSize->Start(
+        TCallBack( RHttpDownloadMgr::UpdateDownloadProgress, iServer ) );
+
+    return KErrNone;
+}
+
+EXPORT_C TInt
+RHttpDownload::Move()
+{
+    MPX_DEBUG(_L("RHttpDownload::Move()"));
+    return KErrNone;
+}
+
+EXPORT_C TInt
+RHttpDownload::Reset()
+{
+    MPX_DEBUG(_L("RHttpDownload::Reset()"));
+    return KErrNone;
+}
+
+RHttpDownload::RHttpDownload( RHttpDownloadMgr* aServer )
+{
+    iServer = aServer;
+}
+
+RHttpDownload::~RHttpDownload()
+{
+    if ( iLocalFile )
+    {
+        delete iLocalFile;
+    }
+
+    if ( iDestFile )
+    {
+        delete iDestFile;
+    }
+}
+
+EXPORT_C
+RHttpDownloadMgr::RHttpDownloadMgr()
+{
+    MPX_DEBUG(_L("RHttpDownloadMgr::RHttpDownloadMgr()"));
+
+    iDownloadArray = new (ELeave) CArrayPtrFlat< RHttpDownload >( 1 );
+
+    iObservers = new (ELeave) CDownloadMgrObserver( 1 );
+
+    iUpdateSize = CIdle::NewL( CActive::EPriorityLow );
+
+    iDlMgrCallback = CDlMgrTestClass::NewL();
+
+    iDlMgrCallback->AddDownloadMgr( this );
+}
+
+RHttpDownloadMgr::~RHttpDownloadMgr()
+{
+    delete iDownloadArray;
+    delete iObservers;
+
+    if ( iUpdateSize->IsActive() )
+    {
+        iUpdateSize->Cancel();
+    }
+
+    delete iUpdateSize;
+
+    delete iDlMgrCallback;
+}
+
+EXPORT_C void
+RHttpDownloadMgr::ConnectL( TUid /*aAppUid*/, MHttpDownloadMgrObserver& aObserver, TBool /*aMaster*/ )
+{
+    MPX_DEBUG(_L("RHttpDownloadMgr::ConnectL()"));
+
+    iObservers->AppendL( &aObserver );
+}
+
+EXPORT_C TVersion
+RHttpDownloadMgr::Version() const
+{
+    TVersion temp;
+
+    return temp;
+}
+
+EXPORT_C void
+RHttpDownloadMgr::Close()
+{
+}
+
+EXPORT_C const CDownloadArray&
+RHttpDownloadMgr::CurrentDownloads() const
+{
+    return (*iDownloadArray);
+}
+
+EXPORT_C RHttpDownload&
+RHttpDownloadMgr::CreateDownloadL( const TDesC8& /*aUrl*/, TBool& /*aResult*/ )
+{
+    RHttpDownload* dl = new RHttpDownload( this );
+
+    iDownloadArray->AppendL( dl );
+
+    return *(*iDownloadArray)[0];
+}
+
+EXPORT_C RHttpDownload&
+RHttpDownloadMgr::CreateDownloadL( const TDesC8& /*aUrl*/ )
+{
+    RHttpDownload* dl = new RHttpDownload( this );
+
+    iDownloadArray->AppendL( dl );
+
+    return *(*iDownloadArray)[0];
+}
+
+EXPORT_C RHttpDownload&
+RHttpDownloadMgr::CreateClientSideDownloadL( TInt /*aHttpTransaction*/, TBool& /*aResult*/ )
+{
+    return *(*iDownloadArray)[0];
+}
+
+EXPORT_C RHttpDownload&
+RHttpDownloadMgr::CreateCodDownloadL( const TDesC8& /*aUrl*/, const TDesC8& /*aBuf*/, const TDesC8& /*aMimeType*/, CEikonEnv* /*aEikEnv*/, TBool& /*aResult*/ )
+{
+    return *(*iDownloadArray)[0];
+}
+
+EXPORT_C RHttpDownload*
+RHttpDownloadMgr::FindDownload( const TDesC8& /*aUrl*/, const TDesC8& /*aMsgBody*/ )
+{
+    return (*iDownloadArray)[0];
+}
+
+EXPORT_C TInt
+RHttpDownloadMgr::PauseAll()
+{
+    MPX_DEBUG(_L("RHttpDownloadMgr::PauseAll()"));
+
+    (*iDownloadArray)[0]->Pause();
+
+    return KErrNone;
+}
+
+EXPORT_C TInt
+RHttpDownloadMgr::StartAll()
+{
+    MPX_DEBUG(_L("RHttpDownloadMgr::PauseAll()"));
+
+    (*iDownloadArray)[0]->Start();
+
+    return KErrNone;
+}
+
+EXPORT_C TInt
+RHttpDownloadMgr::ResetAll()
+{
+    return KErrNone;
+}
+
+EXPORT_C TInt
+RHttpDownloadMgr::DeleteAll()
+{
+    (*iDownloadArray)[0]->Delete();
+
+    return KErrNone;
+}
+
+EXPORT_C TInt
+RHttpDownloadMgr::Disconnect()
+{
+    return KErrNone;
+}
+
+EXPORT_C TInt
+RHttpDownloadMgr::GetIntAttribute( const TUint /*aAttribute*/, TInt32& /*aValue*/ )
+{
+    return KErrNone;
+}
+
+EXPORT_C TInt
+RHttpDownloadMgr::GetBoolAttribute( const TUint /*aAttribute*/, TBool& /*aValue*/ )
+{
+    return KErrNone;
+}
+
+EXPORT_C TInt
+RHttpDownloadMgr::GetStringAttribute( const TUint /*aAttribute*/, TDes16& /*aValue*/  )
+{
+    return KErrNone;
+}
+
+EXPORT_C TInt
+RHttpDownloadMgr::GetStringAttribute( const TUint /*aAttribute*/, TDes8& /*aValue*/ )
+{
+    return KErrNone;
+}
+
+EXPORT_C TInt
+RHttpDownloadMgr::SetIntAttribute( const TUint /*aAttribute*/, TInt32 /*aValue*/ )
+{
+    return KErrNone;
+}
+
+EXPORT_C TInt
+RHttpDownloadMgr::SetBoolAttribute( const TUint /*aAttribute*/, TBool /*aValue*/ )
+{
+    return KErrNone;
+}
+
+EXPORT_C TInt
+RHttpDownloadMgr::SetStringAttribute( const TUint /*aAttribute*/, const TDesC16& /*aValue*/ )
+{
+    return KErrNone;
+}
+
+EXPORT_C TInt
+RHttpDownloadMgr::SetStringAttribute( const TUint /*aAttribute*/, const TDesC8& /*aValue*/ )
+{
+    return KErrNone;
+}
+
+EXPORT_C TInt
+RHttpDownloadMgr::SetDefaultIntAttribute( const TUint /*aAttribute*/, TInt32 /*aValue*/ )
+{
+    return KErrNone;
+}
+
+EXPORT_C TInt
+RHttpDownloadMgr::SetDefaultBoolAttribute( const TUint /*aAttribute*/, TBool /*aValue*/ )
+{
+    return KErrNone;
+}
+
+EXPORT_C TInt
+RHttpDownloadMgr::SetDefaultStringAttribute( const TUint /*aAttribute*/, const TDesC16& /*aValue*/ )
+{
+    return KErrNone;
+}
+
+EXPORT_C TInt
+RHttpDownloadMgr::SetDefaultStringAttribute( const TUint /*aAttribute*/, const TDesC8& /*aValue*/ )
+{
+    return KErrNone;
+}
+
+EXPORT_C void
+RHttpDownloadMgr::AddObserverL( MHttpDownloadMgrObserver& /*aObserver*/ )
+{
+}
+
+EXPORT_C void
+RHttpDownloadMgr::RemoveObserver( MHttpDownloadMgrObserver& /*aObserver*/ )
+{
+}
+
+EXPORT_C void
+RHttpDownloadMgr::SetNextUriObserver( MHttpDownloadMgrNextUriObserver* /*aObserver*/ )
+{
+}
+
+void
+RHttpDownloadMgr::DoUpdateDownloadProgress()
+{
+    MPX_ENTER_EXIT(_L("RHttpDownloadMgr::DoUpdateDownloadProgress()"));
+
+    RHttpDownload* dl = (*iDownloadArray)[0];
+
+    THttpDownloadEvent event;
+
+    event.iDownloadState = (THttpDownloadState)dl->iState;
+    event.iProgressState = EHttpProgResponseBodyReceived;
+
+    MPX_DEBUG(_L("RHttpDownloadMgr::DoUpdateDownloadProgress() dl->iSize=%d"), dl->iSize );
+
+    if ( dl->iState == EHttpDlInprogress )
+    {
+        if ( dl->iSize >= dl->iLength )
+        {
+            dl->iState = EHttpDlCompleted;
+
+            event.iDownloadState = (THttpDownloadState)dl->iState;
+            event.iProgressState = EHttpProgNone;
+        }
+    }
+
+    (*iObservers)[0]->HandleDMgrEventL( *dl, event );
+}
+
+TInt
+RHttpDownloadMgr::UpdateDownloadProgress( TAny* aPtr )
+{
+    MPX_ENTER_EXIT(_L("RHttpDownloadMgr::UpdateDownloadProgress()"));
+
+    static_cast<RHttpDownloadMgr*>(aPtr)->DoUpdateDownloadProgress();
+
+    return KErrNone;
+}
+
+EXPORT_C
+RHttpDownloadMgrApiExt::RHttpDownloadMgrApiExt()
+{
+    MPX_DEBUG(_L("RHttpDownloadMgrApiExt::RHttpDownloadMgrApiExt()"));
+}
+
+EXPORT_C RHttpDownload&
+RHttpDownloadMgrApiExt::AttachToDownloadL( const TInt32 aDlId )
+{
+    MPX_DEBUG(_L("RHttpDownloadMgrApiExt::AttachToDownloadL(%d)"), aDlId);
+
+    RHttpDownload* dl = new RHttpDownload( this );
+
+    dl->iErrorId = KErrNone;
+    dl->iGlobalError = KErrNone;
+
+    iDlMgrCallback->AttachToDownloadL( aDlId );
+
+    dl->iState   = EHttpDlInprogress;
+    dl->iSize    = 25;
+    dl->iLength  = 100;
+
+    iDownloadArray->AppendL( dl );
+
+    return *(*iDownloadArray)[0];
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/src/mediarecognizer_stub.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,324 @@
+/*
+* 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:  Implementation of CMediaRecognizer Stub
+*
+*/
+
+// Version : %version: 5 %
+
+
+// INCLUDE FILES
+#include <utf.h>
+#include <mediarecognizer.h>
+
+#include "mpxvideo_debug.h"
+
+// CONSTANTS
+
+
+#ifdef __WINDOWS_MEDIA
+_LIT(KRtspTcpPrefix,"rtspt://");
+_LIT(KRtspUdpPrefix,"rtspu://");
+_LIT(KHttpPrefix,"http://");
+_LIT(KHttpTcpPrefix,"httpt://");
+_LIT(KMmsPrefix,"mms://");
+_LIT(KMmstPrefix,"mmst://");
+#endif // __WINDOWS_MEDIA
+
+_LIT(KRtspPrefix,"rtsp://");
+_LIT(KFilePrefix,"file://");
+
+const TInt KMinPrefixLength = 6;
+
+
+// ============================ MEMBER FUNCTIONS ===================================================
+
+// -------------------------------------------------------------------------------------------------
+// CMediaRecognizer::CMediaRecognizer
+// C++ default constructor can NOT contain any code, that might leave.
+// -------------------------------------------------------------------------------------------------
+//
+CMediaRecognizer::CMediaRecognizer()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMediaRecognizer::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -------------------------------------------------------------------------------------------------
+//
+void CMediaRecognizer::ConstructL()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMediaRecognizer::NewL
+// Two-phased constructor.
+// -------------------------------------------------------------------------------------------------
+//
+EXPORT_C CMediaRecognizer* CMediaRecognizer::NewL()
+{
+    MPX_DEBUG(_L("CMediaRecognizer::NewL()"));
+
+    CMediaRecognizer* self = new( ELeave ) CMediaRecognizer;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMediaRecognizer::~CMediaRecognizer
+// Destructor
+// -------------------------------------------------------------------------------------------------
+//
+EXPORT_C CMediaRecognizer::~CMediaRecognizer()
+{
+    MPX_DEBUG(_L("CMediaRecognizer::~CMediaRecognizer()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+//  CMediaRecognizer::IdentifyMediaTypeL
+// -------------------------------------------------------------------------------------------------
+//
+EXPORT_C CMediaRecognizer::TMediaType
+CMediaRecognizer::IdentifyMediaTypeL( const TDesC& /*aMediaName*/, TBool /*aIncludeUrls*/ )
+{
+    MPX_DEBUG(_L("CMediaRecognizer::IdentifyMediaTypeL()"));
+
+    TMediaType ret = EUrl;
+
+    return ret;
+}
+
+// -------------------------------------------------------------------------------------------------
+//  CMediaRecognizer::IdentifyMediaTypeL
+// -------------------------------------------------------------------------------------------------
+//
+EXPORT_C CMediaRecognizer::TMediaType
+CMediaRecognizer::IdentifyMediaTypeL( const TDesC& aMediaName, RFile& aFile, TBool /*aIncludeUrls*/ )
+{
+    MPX_DEBUG(_L("CMediaRecognizer::IdentifyMediaTypeL()"));
+
+    TMediaType ret = EUnidentified;
+
+    if ( aFile.SubSessionHandle() )
+    {
+        ret = MediaTypeL( aMediaName );
+    }
+    else
+    {
+        ret = EUrl;
+    }
+
+    return ret;
+}
+
+// -------------------------------------------------------------------------------------------------
+//  CMediaRecognizer::MediaTypeL
+// -------------------------------------------------------------------------------------------------
+//
+CMediaRecognizer::TMediaType CMediaRecognizer::MediaTypeL( const TDesC& aMediaName )
+{
+    MPX_DEBUG(_L("CMediaRecognizer::IdentifyMediaTypeL()"));
+
+    TMediaType ret = EUnidentified;
+
+    _LIT(KSdpExt,".sdp");
+    _LIT(K3gpExt,".3gp");
+
+    if ( aMediaName.Right(KSdpExt.iTypeLength).CompareF(KSdpExt) == 0 )
+    {
+        ret = ELocalSdpFile;
+    }
+    else if ( aMediaName.Right(K3gpExt.iTypeLength).CompareF(K3gpExt) == 0 )
+    {
+        ret = ELocalVideoFile;
+    }
+
+    return ret;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMediaRecognizer::MimeTypeL
+// -------------------------------------------------------------------------------------------------
+//
+EXPORT_C TBuf<KMaxDataTypeLength> CMediaRecognizer::MimeTypeL( const TDesC& /*aLocalFile*/ )
+{
+    MPX_DEBUG(_L("CMediaRecognizer::MimeTypeL()"));
+
+    TPtrC mimeType( KNullDesC );
+
+    return mimeType;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMediaRecognizer::FreeFilehandle
+// -------------------------------------------------------------------------------------------------
+//
+EXPORT_C void CMediaRecognizer::FreeFilehandle()
+{
+    MPX_DEBUG(_L("CMediaRecognizer::FreeFilehandle()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMediaRecognizer::MimeTypeL
+// -------------------------------------------------------------------------------------------------
+//
+EXPORT_C TBuf<KMaxDataTypeLength> CMediaRecognizer::MimeTypeL( RFile& /*aFile*/ )
+{
+    MPX_DEBUG(_L("CMediaRecognizer::MimeTypeL()"));
+
+    TPtrC mimeType( KNullDesC );
+
+    return mimeType;
+}
+
+//--------------------------------------------------------------------------------------------------
+//  CMediaRecognizer::IsValidStreamingPrefix
+//  Check for a valid streaming prefix given a URL
+//--------------------------------------------------------------------------------------------------
+//
+EXPORT_C TBool CMediaRecognizer::IsValidStreamingPrefix( const TDesC& aUrl )
+{
+    TBool retVal = EFalse;
+
+    if ( aUrl.Length() >= KMinPrefixLength )
+    {
+        MPX_DEBUG(_L("CMediaRecognizer::IsValidStreamingPrefix(%S)"), &aUrl);
+
+#ifdef __WINDOWS_MEDIA
+        if ( ( ! aUrl.Left(KRtspPrefix().Length()).CompareF(KRtspPrefix) ) ||
+             ( ! aUrl.Left(KHttpPrefix().Length()).CompareF(KHttpPrefix) ) ||
+             ( ! aUrl.Left(KMmsPrefix().Length()).CompareF(KMmsPrefix) )   ||
+             ( ! aUrl.Left(KMmstPrefix().Length()).CompareF(KMmstPrefix) ) ||
+             ( ! aUrl.Left(KHttpTcpPrefix().Length()).CompareF(KHttpTcpPrefix) ) ||
+             ( ! aUrl.Left(KRtspTcpPrefix().Length()).CompareF(KRtspTcpPrefix) ) ||
+             ( ! aUrl.Left(KRtspUdpPrefix().Length()).CompareF(KRtspUdpPrefix) ) )
+#else
+        if ( ! aUrl.Left( KRtspPrefix().Length() ).CompareF( KRtspPrefix ) )
+#endif
+        {
+            retVal = ETrue;
+        }
+    }
+
+    MPX_DEBUG(_L("CMediaRecognizer::IsValidStreamingPrefix() ret %d"), retVal);
+
+    return retVal;
+}
+
+//--------------------------------------------------------------------------------------------------
+//  CMediaRecognizer::IsValidUrlPrefix
+//  Check for a valid prefix given a URL
+//--------------------------------------------------------------------------------------------------
+//
+EXPORT_C TBool CMediaRecognizer::IsValidUrlPrefix( const TDesC& aUrl )
+{
+    TBool retVal = EFalse;
+
+    if ( aUrl.Length() >= KMinPrefixLength )
+    {
+        MPX_DEBUG(_L("CMediaRecognizer::IsValidUrlPrefix(%S)"), &aUrl);
+
+        if ( ( ! aUrl.Left(KFilePrefix().Length()).CompareF(KFilePrefix) ) ||
+#ifdef __WINDOWS_MEDIA
+             ( ! aUrl.Left(KHttpPrefix().Length()).CompareF(KHttpPrefix) ) ||
+             ( ! aUrl.Left(KMmsPrefix().Length()).CompareF(KMmsPrefix) )   ||
+             ( ! aUrl.Left(KMmstPrefix().Length()).CompareF(KMmstPrefix) ) ||
+             ( ! aUrl.Left(KHttpTcpPrefix().Length()).CompareF(KHttpTcpPrefix) ) ||
+             ( ! aUrl.Left(KRtspTcpPrefix().Length()).CompareF(KRtspTcpPrefix) ) ||
+             ( ! aUrl.Left(KRtspUdpPrefix().Length()).CompareF(KRtspUdpPrefix) ) ||
+#endif
+             ( ! aUrl.Left(KRtspPrefix().Length()).CompareF(KRtspPrefix) ) )
+        {
+            retVal = ETrue;
+        }
+    }
+
+    MPX_DEBUG(_L("CMediaRecognizer::IsValidUrlPrefix() ret %d"), retVal);
+
+    return retVal;
+}
+
+//--------------------------------------------------------------------------------------------------
+//  CMediaRecognizer::IsValidUrlPrefix
+//  Check for a valid prefix given a URL
+//--------------------------------------------------------------------------------------------------
+//
+EXPORT_C TBool CMediaRecognizer::IsValidUrlPrefix( const TDesC8& aUrl )
+{
+    MPX_DEBUG(_L("CMediaRecognizer::IsValidUrlPrefix(TDesC8)"));
+
+    TBool retVal = EFalse;
+
+    if ( aUrl.Length() >= KMinPrefixLength )
+    {
+        HBufC16* buf16 = NULL;
+
+        TRAPD( err, buf16 = CnvUtfConverter::ConvertToUnicodeFromUtf8L(aUrl); );
+
+        if ( ! err )
+        {
+            retVal = IsValidUrlPrefix( buf16->Des() );
+            delete buf16;
+        }
+    }
+
+    MPX_DEBUG(_L("CMediaRecognizer::IsValidUrlPrefix(TDesC8) ret %d"), retVal);
+
+    return retVal;
+}
+
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+// -------------------------------------------------------------------------------------------------
+//  CMediaRecognizer::IdentifyMediaTypeL
+// -------------------------------------------------------------------------------------------------
+//
+EXPORT_C CMediaRecognizer::TMediaType
+CMediaRecognizer::IdentifyMediaTypeL( const TDesC& aMediaName, RFile64& aFile, TBool /*aIncludeUrls*/ )
+{
+    MPX_DEBUG(_L("CMediaRecognizer::IdentifyMediaTypeL( RFile64 )"));
+
+    TMediaType ret = EUnidentified;
+
+    if ( aFile.SubSessionHandle() )
+    {
+        ret = MediaTypeL( aMediaName );
+    }
+    else
+    {
+        ret = EUrl;
+    }
+
+    return ret;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMediaRecognizer::MimeTypeL
+// -------------------------------------------------------------------------------------------------
+//
+EXPORT_C TBuf<KMaxDataTypeLength> CMediaRecognizer::MimeTypeL( RFile64& /*aFile*/ )
+{
+    MPX_DEBUG(_L("CMediaRecognizer::MimeTypeL( RFile64 )"));
+
+    TPtrC mimeType( KNullDesC );
+
+    return mimeType;
+}
+
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/src/mpxvideoaccessoryobserver_stub.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,137 @@
+/*
+* 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:  This class is the stub for the accessory observer.
+ *
+*/
+
+// Version : %version: 5 %
+
+//
+//  INCLUDE FILES
+//
+#include "stifutilities.h"
+#include "mpxvideoaccessoryobserver_stub.h"
+#include "mpxvideoplaybackcontroller.h"
+
+
+//
+// ============================ MEMBER FUNCTIONS ===================================================
+//
+
+
+CMPXVideoAccessoryObserver*
+CMPXVideoAccessoryObserver::NewL( CMPXVideoPlaybackController* aController )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoAccessoryObserver::NewL()"));
+
+    CMPXVideoAccessoryObserver* self = new (ELeave) CMPXVideoAccessoryObserver( aController );
+
+    StifUtilities* utility = reinterpret_cast<StifUtilities*>( Dll::Tls() );
+
+    if ( utility->iAccObserver )
+    {
+        utility->iAccObserver->iController = aController;
+    }
+    else
+    {
+        utility->iAccObserver = new (ELeave) CMPXVideoAccessoryObserver( aController );
+        utility->iAccObserver->ConstructL();
+    }
+
+    return utility->iAccObserver;
+}
+
+
+void CMPXVideoAccessoryObserver::ConstructL()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoAccessoryObserver::CMPXVideoAccessoryObserver
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoAccessoryObserver::CMPXVideoAccessoryObserver( CMPXVideoPlaybackController* aController )
+    : iController( aController )
+    , iTvOutConnected( EFalse )
+    , iTvOutPlaybackAllowed( ETrue )
+{
+}
+
+CMPXVideoAccessoryObserver::~CMPXVideoAccessoryObserver()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoAccessoryObserver::~CMPXVideoAccessoryObserver()"));
+}
+
+void CMPXVideoAccessoryObserver::SetTvOutConnected( TBool aConnected )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoAccessoryObserver::SetTvOutConnected()"),
+                   _L("aConnected = %d"), aConnected);
+
+    iTvOutConnected = aConnected;
+
+    if ( ! iTvOutConnected )
+    {
+        iTvOutPlaybackAllowed = ETrue;
+    }
+}
+
+void CMPXVideoAccessoryObserver::SetTvOutPlaybackAllowed( TBool aAllowed )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoAccessoryObserver::SetTvOutPlaybackAllowed()"),
+                   _L("aAllowed = %d"), aAllowed);
+
+    iTvOutPlaybackAllowed = aAllowed;
+}
+
+void CMPXVideoAccessoryObserver::UpdateTvOutStatusL( TBool aTvOutConnected )
+{
+    MPX_DEBUG(_L("CMPXVideoAccessoryObserver::UpdateTvOutStatusL()"));
+
+    //
+    //  Check if the TV-Out status has changed
+    //
+    if ( iTvOutConnected != aTvOutConnected )
+    {
+        iTvOutConnected = aTvOutConnected;
+
+        iController->HandleTvOutEventL( iTvOutConnected );
+    }
+
+    MPX_DEBUG(_L("    iTvOutConnected = %d"), iTvOutConnected);
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoAccessoryObserver::IsTvOutConnected
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoAccessoryObserver::IsTvOutConnected()
+{
+    MPX_DEBUG(_L("CMPXVideoAccessoryObserver::IsTvOutConnected(%d)"), iTvOutConnected);
+
+    return iTvOutConnected;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoAccessoryObserver::IsTvOutPlaybackAllowed
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoAccessoryObserver::IsTvOutPlaybackAllowed()
+{
+    TBool playAllowed = ( ! iTvOutConnected || iTvOutPlaybackAllowed );
+    MPX_DEBUG(_L("CMPXVideoAccessoryObserver::IsTvOutPlaybackAllowed(%d)"), playAllowed);
+
+    return playAllowed;
+}
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/src/mpxvideodrmhelper_stub.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,178 @@
+/*
+* 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:   This class handles the DRM functions for the playback plugin
+*
+*/
+
+// Version : %version: 7 %
+
+
+#include "mpxvideodrmhelper.h"
+#include "mpxvideo_debug.h"
+
+_LIT( KDrmRightsFile, "c:\\vhpp_drmrights.txt" );
+
+CMpxVideoDrmHelper::CMpxVideoDrmHelper()
+{
+}
+
+CMpxVideoDrmHelper::~CMpxVideoDrmHelper()
+{
+}
+
+
+CMpxVideoDrmHelper* CMpxVideoDrmHelper::NewL()
+{
+    CMpxVideoDrmHelper* self = new( ELeave ) CMpxVideoDrmHelper();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+}
+
+void CMpxVideoDrmHelper::ConstructL()
+{
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMpxVideoDrmHelper::IsProtectedL()
+//  ------------------------------------------------------------------------------------------------
+//
+TBool CMpxVideoDrmHelper::IsProtectedL( RFile& aFile )
+{
+    TBool drmProtected = EFalse;
+
+    RFs fs;
+    RFile file;
+
+    fs.Connect();
+
+    TInt openError = file.Open( fs, KDrmRightsFile, EFileRead | EFileShareAny );
+
+    if ( openError == KErrNone )
+    {
+        drmProtected = ETrue;
+        file.Close();
+    }
+
+    fs.Close();
+
+    return drmProtected;
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMpxVideoDrmHelper::GetDrmRightsStatus()
+//  ------------------------------------------------------------------------------------------------
+//
+TInt CMpxVideoDrmHelper::GetDrmRightsStatus( RFile& aFile )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoDrmHelper::GetDrmRightsStatus()"));
+
+    TInt drmError = KErrNone;
+
+    MPX_DEBUG(_L("CMpxVideoDrmHelper::GetDrmRightsStatus() drmError = %d"), drmError);
+
+    RFs fs;
+    RFile file;
+
+    fs.Connect();
+
+    TInt openError = file.Open( fs, KDrmRightsFile, EFileRead | EFileShareAny );
+
+    if ( openError == KErrNone )
+    {
+        HBufC8* fBuf = HBufC8::NewL( 16 );
+        TPtr8 fileBuf = fBuf->Des();
+
+        file.Read( fileBuf, 16 );
+
+        TLex8 number( fileBuf );
+        number.Val( drmError );
+
+        file.Close();
+    }
+
+    fs.Close();
+
+    return drmError;
+}
+
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+//  ------------------------------------------------------------------------------------------------
+//    CMpxVideoDrmHelper::IsProtected64L()
+//  ------------------------------------------------------------------------------------------------
+//
+TBool CMpxVideoDrmHelper::IsProtected64L( RFile64& aFile )
+{
+    TBool drmProtected = EFalse;
+
+    RFs fs;
+    RFile64 file;
+
+    fs.Connect();
+
+    TInt openError = file.Open( fs, KDrmRightsFile, EFileRead | EFileShareAny );
+
+    if ( openError == KErrNone )
+    {
+        drmProtected = ETrue;
+        file.Close();
+    }
+
+    fs.Close();
+
+    return drmProtected;
+}
+
+//  ------------------------------------------------------------------------------------------------
+//    CMpxVideoDrmHelper::GetDrmRightsStatus64()
+//  ------------------------------------------------------------------------------------------------
+//
+TInt CMpxVideoDrmHelper::GetDrmRightsStatus64( RFile64& aFile )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoDrmHelper::GetDrmRightsStatus()"));
+
+    TInt drmError = KErrNone;
+
+    MPX_DEBUG(_L("CMpxVideoDrmHelper::GetDrmRightsStatus() drmError = %d"), drmError);
+
+    RFs fs;
+    RFile64 file;
+
+    fs.Connect();
+
+    TInt openError = file.Open( fs, KDrmRightsFile, EFileRead | EFileShareAny );
+
+    if ( openError == KErrNone )
+    {
+        HBufC8* fBuf = HBufC8::NewL( 16 );
+        TPtr8 fileBuf = fBuf->Des();
+
+        file.Read( fileBuf, 16 );
+
+        TLex8 number( fileBuf );
+        number.Val( drmError );
+
+        file.Close();
+    }
+
+    fs.Close();
+
+    return drmError;
+}
+
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+//  EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/src/mpxvideoplayerutility_stub.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,805 @@
+/*
+* 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: Stub for helix
+*
+*/
+
+// Version : %version: 18 %
+
+#include <audiopreference.h>
+#include <mmf/server/mmffile.h>
+
+#include "stifutilities.h"
+#include "mpxvideoplayerutility_stub.h"
+#include "mpxvideoplaybackcontroller.h"
+#include "mpxvideo_debug.h"
+
+
+
+#define MAX_VOLUME 100
+
+CMpxVideoPlayerUtility*
+CMpxVideoPlayerUtility::NewL( CMPXVideoPlaybackController* aVideoPlaybackCtrl )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::NewL()"));
+
+    StifUtilities* utility = reinterpret_cast<StifUtilities*>( Dll::Tls() );
+
+    if ( ! utility->iPlayerUtility )
+    {
+        utility->iPlayerUtility = new (ELeave) CMpxVideoPlayerUtility( aVideoPlaybackCtrl );
+        utility->iPlayerUtility->ConstructL();
+    }
+
+    return utility->iPlayerUtility;
+}
+
+CMpxVideoPlayerUtility::CMpxVideoPlayerUtility( CMPXVideoPlaybackController* aVideoPlaybackCtrl )
+    : iVideoPlaybackController( aVideoPlaybackCtrl )
+    , iFirstPlayCmd( ETrue )
+{
+}
+
+void CMpxVideoPlayerUtility::ConstructL()
+{
+    iEventArray = new (ELeave) CMmfCallbackArray( 1 );
+    iCallback   = CIdle::NewL( CActive::EPriorityLow );
+}
+
+CMpxVideoPlayerUtility::~CMpxVideoPlayerUtility()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::~CMpxVideoPlayerUtility()"));
+
+    if ( iCallback->IsActive() )
+    {
+        iCallback->Cancel();
+    }
+
+    delete iCallback;
+
+    iEventArray->ResetAndDestroy();
+}
+
+void CMpxVideoPlayerUtility::Close()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::Close()"));
+}
+
+void CMpxVideoPlayerUtility::Reset()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::Reset()"));
+}
+
+void CMpxVideoPlayerUtility::OpenControllerL()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::OpenControllerL()"));
+}
+
+TTimeIntervalMicroSeconds CMpxVideoPlayerUtility::PositionL() const
+{
+    MPX_DEBUG(_L("CMpxVideoPlayerUtility::PositionL(%Ld)"), iPosition.Int64());
+
+    return iPosition;
+}
+
+TTimeIntervalMicroSeconds CMpxVideoPlayerUtility::DurationL() const
+{
+    TTimeIntervalMicroSeconds dur( iDuration );
+    MPX_DEBUG(_L("CMpxVideoPlayerUtility::DurationL(%Ld)"), dur.Int64());
+    return dur;
+}
+
+TInt CMpxVideoPlayerUtility::NumberOfMetaDataEntriesL() const
+{
+    MPX_DEBUG(_L("CMpxVideoPlayerUtility::NumberOfMetaDataEntriesL(%d)"), iMetaData.Count() );
+
+    return iMetaData.Count();
+}
+
+CMMFMetaDataEntry* CMpxVideoPlayerUtility::MetaDataEntryL( TInt aMetaDataIndex ) const
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::MetaDataEntryL()"),
+                   _L("index = %d"), aMetaDataIndex );
+
+    CMMFMetaDataEntry* pEntry = NULL;
+
+    if ( aMetaDataIndex < iMetaData.Count() )
+    {
+        CMMFMetaDataEntry* pTmp = iMetaData[aMetaDataIndex];
+
+        if ( pTmp )
+        {
+            pEntry = CMMFMetaDataEntry::NewL( pTmp->Name(), pTmp->Value() );
+        }
+    }
+
+    return pEntry;
+}
+
+void CMpxVideoPlayerUtility::SetVolumeL( TInt aVolume )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::SetVolumeL()"),
+                   _L("volume = %d"), aVolume );
+
+    iVolume = aVolume;
+}
+
+TInt CMpxVideoPlayerUtility::Volume() const
+{
+    TInt vol = iVolume;
+
+    MPX_DEBUG(_L("CMpxVideoPlayerUtility::Volume(%d)"), vol);
+
+    return vol;
+}
+
+TInt CMpxVideoPlayerUtility::MaxVolume() const
+{
+    TInt maxVol = MAX_VOLUME;
+
+    MPX_DEBUG(_L("CMpxVideoPlayerUtility::MaxVolume(%d)"), maxVol);
+
+    return maxVol;
+}
+
+void CMpxVideoPlayerUtility::VideoFrameSizeL( TSize& aSize ) const
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::VideoFrameSizeL()"));
+    aSize = iSize;
+}
+
+TInt CMpxVideoPlayerUtility::AudioBitRateL() const
+{
+    TInt bitRate = iAudioBitRate;
+
+    MPX_DEBUG(_L("CMpxVideoPlayerUtility::AudioBitRateL(%d)"), bitRate);
+
+    return bitRate;
+}
+
+TInt CMpxVideoPlayerUtility::VideoBitRateL() const
+{
+    TInt bitRate = iVideoBitRate;
+
+    MPX_DEBUG(_L("CMpxVideoPlayerUtility::VideoBitRateL(%d)"), bitRate);
+
+    return bitRate;
+}
+
+TInt CMpxVideoPlayerUtility::VideoFormatMimeType( TDes8& aMimeType ) const
+{
+    if ( iMimeType )
+    {
+        aMimeType = iMimeType->Des();
+    }
+
+    return KErrNone;
+}
+
+void CMpxVideoPlayerUtility::RefreshFrameL()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::RefreshFrameL()"));
+}
+
+void CMpxVideoPlayerUtility::RestartDsa( const TRegion& /*aRegion*/ )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::RestartDsa()"));
+
+    if ( iStifObserver )
+    {
+        TCallbackEvent* event = new TCallbackEvent;
+        event->iEvent = EPbCmdRestartDSA;
+        event->iData  = 0;
+        event->iError = KErrNone;
+        iStifObserver->HandleUtilityEvent( event );
+    }
+}
+
+void CMpxVideoPlayerUtility::AbortDsa()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::AbortDsa()"));
+
+    if ( iStifObserver )
+    {
+        TCallbackEvent* event = new TCallbackEvent;
+        event->iEvent = EPbCmdAbortDSA;
+        event->iData  = 0;
+        event->iError = KErrNone;
+        iStifObserver->HandleUtilityEvent( event );
+    }
+}
+
+void CMpxVideoPlayerUtility::SetDisplayWindowL( const TRect& /*aScreenRect*/,
+                                                const TRect& /*aClipRect*/,
+                                                const TRegion& /*aDrawingRegion*/ )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::SetDisplayWindowL()"));
+
+    if ( iStifObserver )
+    {
+        TCallbackEvent* event = new TCallbackEvent;
+        event->iEvent = EPbCmdSetDisplayWindow;
+        event->iData  = 0;
+        event->iError = KErrNone;
+        iStifObserver->HandleUtilityEvent( event );
+    }
+}
+
+TBool CMpxVideoPlayerUtility::AudioEnabledL() const
+{
+    TBool enabled = iAudioEnabled;
+
+    MPX_DEBUG(_L("CMpxVideoPlayerUtility::AudioEnabledL(%d)"), enabled);
+
+    return enabled;
+}
+
+void CMpxVideoPlayerUtility::Prepare()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::Prepare()"));
+
+    //
+    //  Read PrepareComplete error
+    //
+    RFile file;
+    _LIT(KFileName, "\\vhpp_prepareerror.txt");
+
+    RFs fs;
+    fs.Connect();
+
+    file.Open( fs, KFileName, EFileRead | EFileShareAny );
+
+    TInt prepError;
+    HBufC8* fBuf = HBufC8::NewL( 16 );
+    TPtr8 fileBuf = fBuf->Des();
+
+    file.Read( fileBuf, 16 );
+
+    TLex8 number( fileBuf );
+    number.Val( prepError );
+
+    TMMFEvent* event = new TMMFEvent();
+
+    event->iEventType = KMMFEventCategoryVideoPrepareComplete;
+    event->iErrorCode = prepError;
+
+    AddCallbackEvent( event );
+
+    file.Close();
+    fs.Close();
+}
+
+void CMpxVideoPlayerUtility::GetVideoLoadingProgressL( TInt& aPercentageProgress )
+{
+    aPercentageProgress = 100;
+
+    MPX_DEBUG(_L("CMpxVideoPlayerUtility::GetVideoLoadingProgressL(%d)"), aPercentageProgress );
+}
+
+void CMpxVideoPlayerUtility::PlayL()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::PlayL()"));
+
+    if ( iFirstPlayCmd )
+    {
+        //
+        //  Send Loading Started
+        //
+        TMMFEvent* event = new TMMFEvent();
+        event->iErrorCode = KErrNone;
+        event->iEventType = KMMFEventCategoryVideoLoadingStarted;
+
+        AddCallbackEvent( event );
+
+        //
+        //  Send Loading Complete
+        //
+        event = new TMMFEvent();
+        event->iErrorCode = KErrNone;
+        event->iEventType = KMMFEventCategoryVideoLoadingComplete;
+
+        AddCallbackEvent( event );
+
+        iFirstPlayCmd = EFalse;
+    }
+}
+
+void CMpxVideoPlayerUtility::PauseL()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::PauseL()"));
+}
+
+void CMpxVideoPlayerUtility::SetPlayVelocityL( TInt aVelocity )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::SetPlayVelocityL()"),
+                   _L("velocity = %d"), aVelocity);
+}
+
+void CMpxVideoPlayerUtility::SetPositionL(const TTimeIntervalMicroSeconds& aPosition)
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::SetPositionL()"),
+                   _L("aPosition = %Ld"), aPosition.Int64());
+
+    iPosition = aPosition;
+
+    RFile file;
+    _LIT(KFileName, "\\vhpp_playerror.txt");
+
+    RFs fs;
+    fs.Connect();
+
+    TInt err = file.Open( fs, KFileName, EFileRead | EFileShareAny );
+
+    if ( err == KErrNone )
+    {
+        TInt playError;
+        HBufC8* fBuf = HBufC8::NewL( 16 );
+        TPtr8 fileBuf = fBuf->Des();
+
+        file.Read( fileBuf, 16 );
+
+        TLex8 number( fileBuf );
+        number.Val( playError );
+
+        TMMFEvent* event = new TMMFEvent();
+
+        event->iErrorCode = playError;
+
+        if ( iPosition >= iDuration )
+        {
+            MPX_DEBUG(_L("    Sending PlaybackComplete()"));
+
+            //
+            //  Send Playback Complete
+            //
+            event->iEventType = KMMFEventCategoryPlaybackComplete;
+        }
+        else if ( iPosition < 0 )
+        {
+            //
+            //  Send Event
+            //
+            event->iEventType = KMMFEventCategoryVideoPlayerGeneralError;
+        }
+
+        AddCallbackEvent( event );
+    }
+
+    file.Close();
+    fs.Close();
+}
+
+TInt CMpxVideoPlayerUtility::Stop()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::Stop()"));
+
+    return KErrNone;
+}
+
+void CMpxVideoPlayerUtility::HandleEvent( const TMMFEvent& aEvent )
+{
+    MPX_ENTER_EXIT(
+        _L("CMpxVideoPlayerUtility::HandleEvent()"),
+        _L("EventType = 0x%08x, ErrorCode = %d"), aEvent.iEventType, aEvent.iErrorCode );
+
+    //
+    //  Call on the controller to handle the event
+    //
+    iVideoPlaybackController->HandleMMFEvent( aEvent );
+}
+
+void CMpxVideoPlayerUtility::OpenFileL( const RFile& aFile )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::OpenFileL()"));
+
+    TInt openError = ReadOpenError();
+
+    if ( ! openError )
+    {
+        ReadFileDetails( aFile );
+    }
+}
+
+void CMpxVideoPlayerUtility::OpenFileL( const TDesC& aFileName )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::OpenFileL()"),
+                   _L("aFileName = %S"), &aFileName);
+}
+
+void CMpxVideoPlayerUtility::OpenUrlL( const TDesC& aUrl, TInt aApId )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::OpenUrlL()"),
+                   _L("aUrl = %S, ApId = %d"), &aUrl, aApId);
+
+    TInt openError = ReadOpenError();
+}
+
+void CMpxVideoPlayerUtility::GetFrameL()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::GetFrameL()"));
+
+    if ( iStifObserver )
+    {
+        TCallbackEvent* event = new TCallbackEvent;
+        event->iEvent = EPbCmdSetPosterFrame;
+        event->iData  = 0;
+        event->iError = KErrNone;
+        iStifObserver->HandleUtilityEvent( event );
+    }
+
+    iVideoPlaybackController->HandleFrameReady( KErrGeneral );
+}
+
+CFbsBitmap& CMpxVideoPlayerUtility::GetBitmap()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::GetBitmap()"));
+
+    iPosterFrameBitmap = new (ELeave) CFbsBitmap;
+    return *iPosterFrameBitmap;
+}
+
+TInt CMpxVideoPlayerUtility::ReadOpenError()
+{
+    //
+    //  Read OpenComplete error
+    //
+    RFile file;
+    _LIT(KFileName, "\\vhpp_openerror.txt");
+
+    RFs fs;
+    fs.Connect();
+
+    file.Open( fs, KFileName, EFileRead | EFileShareAny );
+
+    TInt openError;
+    HBufC8* fBuf = HBufC8::NewL( 16 );
+    TPtr8 fileBuf = fBuf->Des();
+
+    file.Read( fileBuf, 16 );
+
+    TLex8 number( fileBuf );
+    number.Val( openError );
+
+    TMMFEvent* event = new TMMFEvent();
+
+    event->iEventType = KMMFEventCategoryVideoOpenComplete;
+    event->iErrorCode = openError;
+
+    AddCallbackEvent( event );
+
+    file.Close();
+    fs.Close();
+
+    return openError;
+}
+
+
+TInt CMpxVideoPlayerUtility::CustomCommandSync( const TMMFMessageDestinationPckg& /*aDestination*/,
+                                                TInt /*aFunction*/,
+                                                const TDesC8& /*aDataTo1*/,
+                                                const TDesC8& /*aDataTo2*/ )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::CustomCommandSync()"));
+
+    return KErrNone;
+}
+
+TInt CMpxVideoPlayerUtility::SendMmfEvent( TAny* aPtr )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::SendMmfEvent()"));
+
+    static_cast<CMpxVideoPlayerUtility*>(aPtr)->DoSendMmfEvent();
+
+    return KErrNone;
+}
+
+void CMpxVideoPlayerUtility::DoSendMmfEvent()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::DoSendMmfEvent()"));
+
+    TInt count = iEventArray->Count();
+
+    if ( count > 0 )
+    {
+        TMMFEvent* event = (*iEventArray)[0];
+
+        iVideoPlaybackController->HandleMMFEvent( *event );
+
+        if ( count > 1 )
+        {
+            //
+            //  More events exist, start another callback
+            //
+            iCallback->Start( TCallBack( CMpxVideoPlayerUtility::SendMmfEvent, this ) );
+        }
+
+        iEventArray->Delete( 0 );
+    }
+}
+
+void CMpxVideoPlayerUtility::AddCallbackEvent( TMMFEvent* event )
+{
+    iEventArray->AppendL( event );
+
+    if ( ! iCallback->IsActive() )
+    {
+        iCallback->Start( TCallBack( CMpxVideoPlayerUtility::SendMmfEvent, this ) );
+    }
+}
+
+void CMpxVideoPlayerUtility::AddStifObserver( MStifTestObserver* aStifObserver )
+{
+    iStifObserver = aStifObserver;
+}
+
+void CMpxVideoPlayerUtility::ReadFileDetails( const RFile& aFile )
+{
+    MPX_DEBUG(_L("CMpxVideoPlayerUtility::ReadFileDetails()"));
+
+    HBufC8* fBuf = HBufC8::NewL( 1024 );
+    TPtr8 fileBuf = fBuf->Des();
+
+    aFile.Read( fileBuf, 1024 );
+
+    ParseFileDetails( fileBuf );
+}
+
+void CMpxVideoPlayerUtility::ParseFileDetails( TDesC8& aBuffer )
+{
+    MPX_DEBUG(_L("CMpxVideoPlayerUtility::ParseFileDetails()"));
+
+    TPtrC8 bufferPtr;
+    bufferPtr.Set( aBuffer );
+
+    TInt offset;
+
+    TInt error = KErrNone;
+
+    do
+    {
+        error = KErrNone;
+        TPtrC8 ptr;
+
+        offset = bufferPtr.Find(_L8(";"));
+
+        if ( offset == KErrNotFound )
+        {
+            error = offset;
+        }
+        else
+        {
+            ptr.Set( bufferPtr.Left( offset ) );
+            bufferPtr.Set( bufferPtr.Mid( ++offset ));
+
+            ParseDetail( ptr );
+        }
+    }
+    while ( ! error );
+}
+
+
+TInt CMpxVideoPlayerUtility::ParseDetail( TPtrC8& aData )
+{
+    MPX_DEBUG(_L("CMpxVideoPlayerUtility::ParseDetail()"));
+
+    TInt error = KErrNone;
+
+    TPtrC8 item;
+    TPtrC8 value;
+
+    TInt offset = aData.Find(_L8("="));
+
+    if ( offset == KErrNotFound )
+    {
+        error = offset;
+    }
+    else
+    {
+        item.Set( aData.Left( offset ) );
+        value.Set( aData.Mid( ++offset ) );
+
+        FindFileDetail( item, value );
+    }
+
+    return error;
+}
+
+
+void CMpxVideoPlayerUtility::FindFileDetail( TPtrC8& aItem, TPtrC8& value )
+{
+    MPX_DEBUG(_L("CMpxVideoPlayerUtility::FindFileDetail()"));
+
+    if ( ! aItem.Compare(_L8("VideoFrameSizeWidth")) )
+    {
+        TLex8 lex(value);
+        lex.Val( iSize.iWidth );
+    }
+    else if ( ! aItem.Compare(_L8("VideoFrameSizeHeight")) )
+    {
+        TLex8 lex(value);
+        lex.Val( iSize.iHeight );
+    }
+    else if ( ! aItem.Compare(_L8("VideoBitRate")) )
+    {
+        TLex8 lex(value);
+        lex.Val( iVideoBitRate );
+    }
+    else if ( ! aItem.Compare(_L8("AudioBitRate")) )
+    {
+        TLex8 lex(value);
+        lex.Val( iAudioBitRate );
+    }
+    else if ( ! aItem.Compare(_L8("AudioEnabled")) )
+    {
+        TLex8 lex(value);
+        lex.Val( iAudioEnabled );
+    }
+    else if ( ! aItem.Compare(_L8("Duration")) )
+    {
+        TInt dur = 0;
+        TLex8 lex(value);
+        lex.Val( dur );
+
+        iDuration = dur;
+    }
+    else if ( ! aItem.Compare(_L8("MimeType")) )
+    {
+        delete iMimeType;
+
+        iMimeType = value.AllocL();
+    }
+    else if ( ! aItem.Compare(_L8("NumMetaDataEntries")) )
+    {
+        TLex8 lex(value);
+        lex.Val( iNumMetaDataEntries );
+    }
+    else if ( ! aItem.Compare(_L8("Seekable")) )
+    {
+        TLex8 lex(value);
+        lex.Val( iSeekable );
+    }
+    else if ( ! aItem.Compare(_L8("LiveStream")) )
+    {
+        TLex8 lex(value);
+        lex.Val( iLiveStream );
+    }
+    else if ( ! aItem.Compare(_L8("Title")) )
+    {
+        delete iTitle;
+
+        iTitle = value.AllocL();
+    }
+    else if ( ! aItem.Compare(_L8("Description")) ||
+              ! aItem.Compare(_L8("Abstract")) )
+    {
+        if ( ! iDescription )
+        {
+            iDescription = value.AllocL();
+        }
+    }
+    else if ( ! aItem.Compare(_L8("Artist")) )
+    {
+        delete iArtist;
+
+        iArtist = value.AllocL();
+    }
+    else if ( ! aItem.Compare(_L8("Location")) )
+    {
+        delete iLocation;
+
+        iLocation = value.AllocL();
+    }
+    else if ( ! aItem.Compare(_L8("Copyright")) )
+    {
+        delete iCopyright;
+
+        iCopyright = value.AllocL();
+    }
+    else if ( ! aItem.Compare(_L8("Language")) )
+    {
+        delete iLanguage;
+
+        iLanguage = value.AllocL();
+    }
+    else if ( ! aItem.Compare(_L8("Keywords")) )
+    {
+        delete iKeywords;
+
+        iKeywords = value.AllocL();
+    }
+    else if ( ! aItem.Compare(_L8("CreationTime")) )
+    {
+        TLex8 lex(value);
+        lex.Val( iCreationTime );
+    }
+    else if ( ! aItem.Compare(_L8("ModificationTime")) )
+    {
+        TLex8 lex(value);
+        lex.Val( iModificationTime );
+    }
+
+    HBufC* name = HBufC::NewL( aItem.Length() );
+    TPtr namePtr( name->Des() );
+    namePtr.Copy( aItem );
+
+    HBufC* data = HBufC::NewL( value.Length() );
+    TPtr dataPtr( data->Des() );
+    dataPtr.Copy( value );
+
+    CMMFMetaDataEntry* pEntry = CMMFMetaDataEntry::NewL( namePtr, dataPtr );
+    iMetaData.Append( pEntry );
+}
+
+void CMpxVideoPlayerUtility::SetVolumeSteps( TInt aVolumeSteps )
+{
+    MPX_DEBUG(_L("CMpxVideoPlayerUtility::SetVolumeSteps()"));
+
+    //
+    // variate volume steps to set expected result for STIF
+    // depending on if it's a 10-steps or 20-steps)
+    //
+    iVideoPlaybackController->SetVolumeSteps( aVolumeSteps );
+}
+
+TUint32 CMpxVideoPlayerUtility::FourCCCode() const
+{
+    MPX_DEBUG(_L("CMpxVideoPlayerUtility::FourCCCode()"));
+
+    return 0;
+}
+
+#ifdef SYMBIAN_BUILD_GCE
+
+TInt CMpxVideoPlayerUtility::VideoSurfaceCreated()
+{
+    return KErrNone;
+}
+
+TInt CMpxVideoPlayerUtility::SurfaceParametersChanged()
+{
+    return KErrNone;
+}
+
+void CMpxVideoPlayerUtility::RemoveSurface()
+{
+}
+
+TInt CMpxVideoPlayerUtility::RemoveSurfaceFromHelix( TSurfaceId aSurfaceId )
+{
+    return KErrNone;
+}
+
+void CMpxVideoPlayerUtility::SendSurfaceCreatedCommand()
+{
+    MPX_DEBUG(_L("CMpxVideoPlayerUtility::SendSurfaceCreatedCommand()"));
+}
+
+#endif
+
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+void CMpxVideoPlayerUtility::OpenFile64L( const RFile64& aFile )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::OpenFile64L()"));
+
+    TInt openError = ReadOpenError();
+
+    if ( ! openError )
+    {
+        ReadFileDetails( aFile );
+    }
+}
+
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/src/mpxvideoregion.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,131 @@
+/*
+* 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:  Inline implementation of MPXVideoRegion
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+#include <e32std.h>
+#include <s32strm.h>
+
+#include "mpxvideoregion.h"
+#include "mpxvideo_debug.h"
+
+CMPXVideoRegion*
+CMPXVideoRegion::NewL()
+{
+    CMPXVideoRegion* self = CMPXVideoRegion::NewLC();
+    CleanupStack::Pop( self );
+    return self;
+}
+
+CMPXVideoRegion*
+CMPXVideoRegion::NewLC()
+{
+    CMPXVideoRegion* self = new (ELeave) CMPXVideoRegion();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+}
+
+void
+CMPXVideoRegion::ConstructL()
+{
+    iRegion = new RRegion( 10 );
+}
+
+CMPXVideoRegion::CMPXVideoRegion()
+{
+}
+
+CMPXVideoRegion::~CMPXVideoRegion()
+{
+    iRegion->Destroy();
+}
+
+void
+CMPXVideoRegion::Print()
+{
+    if ( iRegion->CheckError() )
+    {
+        MPX_DEBUG(_L("CMPXVideoRegion::Print() Error in DSA Region"));
+        return;
+    }
+
+    MPX_DEBUG(_L("CMPXVideoRegion::Print() Rect Count = %d"),
+        iRegion->Count() );
+
+    const TRect* rectList = iRegion->RectangleList();
+
+    for ( TInt i = 0 ; i < iRegion->Count() ; ++i )
+    {
+        MPX_DEBUG(_L("CMPXVideoRegion::Print() Rect %d"), i);
+
+        MPX_DEBUG(_L( "CMPXVideoRegion::Print() (%d, %d), (%d, %d)"),
+            rectList[i].iTl.iX, rectList[i].iTl.iY,
+            rectList[i].iBr.iX, rectList[i].iBr.iY );
+    }
+}
+
+void
+CMPXVideoRegion::SetRegion( RRegion& aRegion )
+{
+    iRegion->Copy( aRegion );
+}
+
+TRegion&
+CMPXVideoRegion::GetRegion()
+{
+    return *iRegion;
+}
+
+void
+CMPXVideoRegion::ExternalizeL( RWriteStream& aStream ) const
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoRegion::ExternalizeL()"));
+
+    aStream.WriteInt32L( iRegion->Count() );
+
+    const TRect* rectList = iRegion->RectangleList();
+
+    for ( TInt i = 0 ; i < iRegion->Count() ; ++i )
+    {
+        aStream.WriteInt32L( rectList[i].iTl.iX );
+        aStream.WriteInt32L( rectList[i].iTl.iY );
+        aStream.WriteInt32L( rectList[i].iBr.iX );
+        aStream.WriteInt32L( rectList[i].iBr.iY );
+    }
+}
+
+void
+CMPXVideoRegion::InternalizeL( RReadStream& aStream )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoRegion::InternalizeL()"));
+
+    TInt32 count = aStream.ReadInt32L();
+
+    for ( TInt i = 0 ; i < count; ++i )
+    {
+        TInt32 a = aStream.ReadInt32L();
+        TInt32 b = aStream.ReadInt32L();
+        TInt32 c = aStream.ReadInt32L();
+        TInt32 d = aStream.ReadInt32L();
+
+        TRect* rect = new (ELeave) TRect( a, b, c, d );
+        iRegion->AddRect( *rect );
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/src/rconnection_stub.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,206 @@
+/*
+* 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:  Connection management stub implementation 
+*
+*/
+
+// Version : %version:  1 %
+
+// #include "rconnection_stub.h"  // TODO: lets see if this is needed at all
+#include <es_sock.h>
+#include <commdbconnpref.h>
+#include <rconnmon.h>  // RConnectionMonitor
+
+
+#include "mpxvideo_debug.h"
+
+
+
+EXPORT_C
+RSocketServ::RSocketServ() 
+{       
+    MPX_ENTER_EXIT(_L("RSocketServ::RSocketServ() - stub impl"));
+}
+    
+EXPORT_C    
+TInt RSocketServ::Connect(TUint aMessageSlots )
+{   
+    MPX_ENTER_EXIT(_L("RSocketServ::Connect() - stub impl"));
+    return KErrNone;
+}
+   
+EXPORT_C 
+TConnPref::TConnPref( ) 
+{
+    MPX_ENTER_EXIT(_L("TConnPref::TConnPref() - stub impl"));
+}
+
+EXPORT_C
+TCommDbConnPref::TCommDbConnPref() 
+{
+    MPX_ENTER_EXIT(_L("TCommDbConnPref::TCommDbConnPref() - stub impl"));
+}
+
+EXPORT_C
+void TCommDbConnPref::SetDialogPreference(TCommDbDialogPref aDialogPref)
+{
+    MPX_ENTER_EXIT(_L("TCommDbConnPref::SetDialogPreference() - stub impl"));
+}
+
+EXPORT_C
+RConnection::RConnection(): iNewISPId(0)
+{
+    MPX_ENTER_EXIT(_L("RConnection::RConnection() - stub impl"));
+}
+
+EXPORT_C 
+TInt RConnection::Open(RSocketServ& aSocketServer, TUint aConnectionType )
+{
+    MPX_ENTER_EXIT(_L("RConnection::Open() - stub impl"));
+    return KErrNone;
+}
+
+EXPORT_C 
+TInt RConnection::Start(TConnPref& aPref)
+{
+    MPX_ENTER_EXIT(_L("RConnection::Start() - stub impl"));
+    return KErrNone;
+}
+
+EXPORT_C 
+void RConnection::Close( )
+{
+    MPX_ENTER_EXIT(_L("RConnection::Close() - stub impl"));
+}
+
+EXPORT_C
+RConnection::~RConnection()
+{
+    MPX_ENTER_EXIT(_L("RConnection::~RConnection - stub impl"));
+}     
+
+/*
+EXPORT_C
+RConnectionMonitor::RConnectionMonitor()
+{
+    MPX_ENTER_EXIT(_L("RConnectionMonitor::RConnectionMonitor() - stub impl")); 
+}*/
+
+EXPORT_C TInt TCommDbConnPref::Compare(const TCommDbConnPref& aPref) const
+{
+    MPX_ENTER_EXIT(_L("TCommDbConnPref::Compare() - stub impl"));
+    return 0;  // not really called
+}
+
+
+
+EXPORT_C
+TInt RConnectionMonitor::ConnectL()
+{
+    MPX_ENTER_EXIT(_L("RConnectionMonitor::ConnectL() - stub impl")); 
+    return KErrNone;
+}
+
+EXPORT_C
+void RConnectionMonitor::Close()
+{
+    MPX_ENTER_EXIT(_L("RConnectionMonitor::Close() - stub impl")); 
+}
+
+EXPORT_C
+void RConnectionMonitor::GetConnectionCount(
+               TUint& aConnectionCount,
+               TRequestStatus& aStatus )
+{
+    MPX_ENTER_EXIT(_L("RConnectionMonitor::GetConnectionCount() - stub impl")); 
+    
+    // put value and change request status
+    aConnectionCount = 1;
+    aStatus = KErrNone;
+}
+    
+EXPORT_C
+TInt RConnectionMonitor::GetConnectionInfo(
+                const TUint aIndex,
+                TUint& aConnectionId,
+                TUint& aSubConnectionCount ) const 
+{
+    MPX_ENTER_EXIT(_L("RConnectionMonitor::GetConnectionInfo() - stub impl")); 
+   
+    // This connection is handled as GPRS
+    aConnectionId = 7;   
+    
+    return KErrNone;
+}
+
+EXPORT_C
+void RConnectionMonitor::GetIntAttribute(
+        const TUint aConnectionId,
+        const TUint aSubConnectionId,
+        const TUint aAttribute,
+        TInt& aValue,
+        TRequestStatus& aStatus ) 
+{
+    MPX_ENTER_EXIT(_L("RConnectionMonitor::GetIntAttribute() - stub impl")); 
+    
+    // this call is asking for bearer
+    // connection 7 is GPRS others are WLAN
+    if ( aConnectionId == 7 )
+    {
+        aValue = EBearerGPRS;
+    }
+    else 
+    {
+        aValue = EBearerWLAN;
+    }
+    
+}
+
+EXPORT_C
+void RConnectionMonitor::GetUintAttribute(
+        const TUint aConnectionId,
+        const TUint aSubConnectionId,
+        const TUint aAttribute,
+        TUint& aValue,
+        TRequestStatus& aStatus )
+{
+    MPX_ENTER_EXIT(_L("RConnectionMonitor::GetUintAttribute() - stub impl"));  
+    
+    
+    // Asking iapId
+    if (KIAPId == aAttribute && aConnectionId == 7)
+    {
+        aValue = 13;  // iap id 13, handled as GPRS
+    }
+    else
+    {
+        aValue = 10;   
+    }
+   
+ 
+    aStatus = KErrNone;
+}
+
+EXPORT_C
+void User::WaitForRequest(TRequestStatus& aStatus)
+{
+ //      TRequestStatus* ptrStatus = &aStatus;
+  //     User::RequestComplete(ptrStatus,KErrNone);                  
+        aStatus = KErrNone;
+       return;
+}
+
+
+// TODO TRequeststatus and waitforrequest needs implementation
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/src/stifutilities.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* 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:  mpx utilities class stub for STIF testing
+*
+*/
+
+// Version : %version: 2 %
+
+#include "stifutilities.h"
+
+void StifUtilities::CreateStifUtility()
+{
+    StifUtilities* utility = reinterpret_cast<StifUtilities*>( Dll::Tls() );
+
+    utility = new (ELeave) StifUtilities;
+
+    Dll::SetTls( utility );
+}
+
+// EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/src/timeoutcontroller.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,221 @@
+/*
+* 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 "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:  Timeout controller
+*
+*/
+
+// Version : %version: 3 %
+
+
+#include "timeoutcontroller.h"
+#include "mpxvideo_debug.h"
+
+/*
+-------------------------------------------------------------------------------
+Class: CSimpleTimeout
+Method: CSimpleTimeout
+Description: Default constructor
+C++ default constructor can NOT contain any code, that might leave.
+Parameters: None
+Return Values: None
+Errors/Exceptions: None
+Status: Approved
+-------------------------------------------------------------------------------
+*/
+CSimpleTimeout::CSimpleTimeout()
+    : CActive (CActive::EPriorityStandard)
+{
+    MPX_DEBUG(_L("CSimpleTimeout::CSimpleTimeout"));
+}
+
+// -----------------------------------------------------------------------------
+// CSimpleTimeout::ConstructL()
+// Symbian OS second phase constructor.
+// -----------------------------------------------------------------------------
+//
+void
+CSimpleTimeout::ConstructL( MTimeoutObserver* aObserver, CStifLogger* aLogger )
+{
+    MPX_DEBUG(_L("CSimpleTimeout::ConstructL"));
+
+    iObserver = aObserver;
+    iLog = aLogger;
+    iTimer.CreateLocal();
+    iTestCaseTimeout = 0;  // Initialize
+
+    // Add to active scheduler
+    CActiveScheduler::Add ( this );
+}
+
+// -----------------------------------------------------------------------------
+// CSimpleTimeout::NewL()
+// Two-phased constructor.
+// Returns: CSimpleTimeout* : pointer to created object
+// -----------------------------------------------------------------------------
+//
+CSimpleTimeout*
+CSimpleTimeout::NewL( MTimeoutObserver* aTestClass, CStifLogger* aLogger )
+{
+    MPX_DEBUG(_L("CSimpleTimeout::NewL"));
+
+    CSimpleTimeout* self = new ( ELeave ) CSimpleTimeout();
+    CleanupStack::PushL( self );
+    self->ConstructL( aTestClass, aLogger);
+    CleanupStack::Pop( self );
+
+    return self;
+}
+
+// -----------------------------------------------------------------------------
+// CSimpleTimeout::~CSimpleTimeout()
+// Destructor.
+// -----------------------------------------------------------------------------
+//
+CSimpleTimeout::~CSimpleTimeout()
+{
+    MPX_DEBUG(_L("CSimpleTimeout::~CSimpleTimeout"));
+    Cancel();
+    iTimer.Close();
+}
+
+// -----------------------------------------------------------------------------
+// CSimpleTimeout::Start()
+// Start timeout counting.
+// -----------------------------------------------------------------------------
+//
+void
+CSimpleTimeout::Start( TTimeIntervalMicroSeconds aTimeout )
+{
+    MPX_DEBUG(_L("CSimpleTimeout::Start"));
+
+    if ( IsActive() )
+    {
+        Cancel();
+    }
+
+    // Request timer
+    TTime endTime;
+    endTime.HomeTime();
+    endTime = endTime + aTimeout;
+
+    TInt64 miliseconds = aTimeout.Int64();
+    miliseconds /= 1000;
+
+    TBuf<30> dateString;
+    TRAP_IGNORE(endTime.FormatL(dateString, KFormatTimeStamp));
+    iLog->Log(_L("Timer=%LD ms, EndTime=%S"), miliseconds, &dateString);
+
+    // Store absolute timeout
+    iTestCaseTimeout = endTime;
+
+    // Taken from STIF engine
+    // Note: iTimer.After() method cannot use because there needed
+    // TTimeIntervalMicroSeconds32 and it is 32 bit. So then cannot create
+    // timeout time that is long enough. At() uses 64 bit value=>Long enough.
+    iTimer.At( iStatus, endTime );
+    SetActive();
+}
+
+// -----------------------------------------------------------------------------
+// CSimpleTimeout::Stop()
+// Start timeout counting.
+// -----------------------------------------------------------------------------
+//
+void
+CSimpleTimeout::Stop()
+{
+    MPX_DEBUG(_L("CSimpleTimeout::Stop"));
+
+    if ( IsActive() )
+    {
+        Cancel();
+    }
+}
+
+// -----------------------------------------------------------------------------
+// CSimpleTimeout::RunL()
+// RunL handles completed timeouts.
+// -----------------------------------------------------------------------------
+//
+void
+CSimpleTimeout::RunL()
+{
+    MPX_DEBUG(_L("CSimpleTimeout::RunL"));
+
+    iLog->Log(_L("CSimpleTimeout::RunL"));
+
+    TTime timeout;
+    timeout.HomeTime();
+
+    // Handle the abort case when system time gets changed, but timeout is
+    // still valid. All other cases should timeout since they invalidate the
+    // logic of the timers.
+    if ( iStatus == KErrAbort)
+    {
+        if ( iTestCaseTimeout > timeout )
+        {
+            MPX_DEBUG(_L(
+                "Absolute timer still valid. Restaring timer. iStatus: %d" ),
+                iStatus.Int() );
+
+            // Start new timer
+            iStatus = KErrNone; // reset value
+            iTimer.At ( iStatus, iTestCaseTimeout );  // restart timer
+            SetActive();
+        }
+        else
+        {
+            // Absolute timer no longer valid. Must timeout.
+            iLog->Log(_L("Absolute timeout no longer valid"));
+            iObserver->HandleTimeout(KErrNone);
+        }
+
+    }
+    else
+    {
+        // Status was not KErrAbort. Timing out!
+        // iLog->Log(_L("CSimpleTimeout::RunL - Timeout !!"), iTimeout);
+        iLog->Log(_L("Timing out"));
+        iObserver->HandleTimeout(KErrNone);
+    }
+}
+
+// -----------------------------------------------------------------------------
+// CSimpleTimeout::DoCancel()
+// Cancel active request.
+// -----------------------------------------------------------------------------
+//
+void
+CSimpleTimeout::DoCancel()
+{
+    MPX_DEBUG(_L("CSimpleTimeout::DoCancel"));
+    iTimer.Cancel();
+}
+
+// -----------------------------------------------------------------------------
+// CSimpleTimeout::RunError()
+// Handle errors. Just let framework handle errors because
+// RunL does not leave.
+// Returns: Symbian OS error code
+// -----------------------------------------------------------------------------
+//
+TInt CSimpleTimeout::RunError( TInt aError )
+{
+    MPX_DEBUG(_L("CSimpleTimeout::RunError"));
+    iLog->Log(_L("Timeout error %d"), aError);
+    iObserver->HandleTimeout(aError);
+    return aError;
+}
+
+// EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/src/tnmgr_stub.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,70 @@
+/*
+* 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:  Thumbnail Manager stub impl
+*
+*/
+
+// Version : %version:  2 %
+
+#include <fbs.h>
+#include "tnmgr_stub.h"
+#include "mpxvideo_debug.h"
+
+
+/****************************************************
+ * CThumbnailManager stub implementation
+ ****************************************************/
+CThumbnailManager::~CThumbnailManager()
+{
+}
+
+CThumbnailManager* CThumbnailManager::NewL( MThumbnailManagerObserver& aObserver )
+{
+    MPX_ENTER_EXIT(_L("CThumbnailManager::NewL() - stub impl"));
+    CThumbnailManager* self = new( ELeave )CThumbnailManager( aObserver );    
+    return self;
+}
+
+CThumbnailManager::CThumbnailManager( MThumbnailManagerObserver&  aObserver )
+: iObserver( aObserver )
+{
+    MPX_ENTER_EXIT(_L("CThumbnailManager::CThumbnailManager() - stub impl"));
+}
+
+TThumbnailRequestId CThumbnailManager::SetThumbnailL( CThumbnailObjectSource& /* aObjectSource */ )
+{   
+    MPX_ENTER_EXIT(_L("CThumbnailManager::SetThumbnailL() - stub impl"));
+    return 0;
+}
+
+
+/****************************************************
+ * CThumbnailObjectSource stub implementation
+ ****************************************************/
+CThumbnailObjectSource::~CThumbnailObjectSource()
+{
+}
+
+CThumbnailObjectSource* CThumbnailObjectSource::NewL( CFbsBitmap*  aBitmap, const TDesC& aUri )
+{
+    MPX_ENTER_EXIT(_L("CThumbnailObjectSource::NewL() - stub impl"));
+    CThumbnailObjectSource* self = new( ELeave )CThumbnailObjectSource( aBitmap, aUri );
+    return self;
+}
+
+CThumbnailObjectSource::CThumbnailObjectSource( CFbsBitmap*  /* aBitmap */ , const TDesC& /* aUri */ )
+{
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/src/videohelixtest.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,207 @@
+/*
+* 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:  Test Harness for VideoHelix Playback Plugin
+*
+*/
+
+// Version : %version: 7 %
+
+
+// INCLUDE FILES
+
+#include "stifutilities.h"
+#include "mpxvideoprivatecrkeys.h"
+#include "videohelixtest.h"
+#include "mpxvideoplayerutility_stub.h"
+#include "mpxvideohelixplayback.h"
+#include "mpxvideo_debug.h"
+
+#include <stiftestinterface.h>
+#include <settingserverclient.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CVHPPTestClass::CVHPPTestClass
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CVHPPTestClass::CVHPPTestClass( CTestModuleIf& aTestModuleIf )
+    : CScriptBase( aTestModuleIf )
+    , iTestModuleIf( aTestModuleIf )
+    , iFirstPlayCmd( ETrue )
+{
+}
+
+// -----------------------------------------------------------------------------
+// CVHPPTestClass::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CVHPPTestClass::ConstructL()
+{
+    MPX_DEBUG(_L("CVHPPTestClass::ConstructL"));
+
+    //
+    //  Read logger settings to check whether test case name is to be
+    //  appended to log file name.
+    //
+    RSettingServer settingServer;
+
+    User::LeaveIfError( settingServer.Connect() );
+
+    //
+    //  Struct to StifLogger settigs.
+    //
+    TLoggerSettings loggerSettings;
+
+    //
+    //  Parse StifLogger defaults from STIF initialization file.
+    //
+    User::LeaveIfError( settingServer.GetLoggerSettings(loggerSettings) );
+
+    //
+    //  Close Setting server session
+    //
+    settingServer.Close();
+
+    TFileName logFileName;
+
+    if ( loggerSettings.iAddTestCaseTitle )
+    {
+        _LIT( KVHPPTestClassLogFileWithTitle, "VHPPTestClass_[%S].txt" );
+
+        TName title;
+        TestModuleIf().GetTestCaseTitleL(title);
+        logFileName.Format( KVHPPTestClassLogFileWithTitle, &title );
+    }
+    else
+    {
+        _LIT( KVHPPTestClassLogFile, "VHPPTestClass.txt" );
+
+        logFileName.Copy( KVHPPTestClassLogFile );
+    }
+
+    _LIT( KVHPPTestClassLogPath, "\\logs\\testframework\\VHPPTestClass\\" );
+
+
+    iLog = CStifLogger::NewL( KVHPPTestClassLogPath,
+                              logFileName,
+                              CStifLogger::ETxt,
+                              CStifLogger::EFile,
+                              EFalse );
+
+    TVersion moduleVersion;
+
+    moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR;
+    moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR;
+    moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD;
+
+    TFileName moduleName;
+
+    moduleName = _L("CVHPPTestClass.dll");
+
+    TBool newVersionOfMethod = ETrue;
+
+    TestModuleIf().SendTestModuleVersion( moduleVersion,
+                                          moduleName,
+                                          newVersionOfMethod );
+
+    StifUtilities::CreateStifUtility();
+
+    iAccObserver = CMPXVideoAccessoryObserver::NewL( NULL );
+
+    iTimeoutController = CSimpleTimeout::NewL (this, iLog);
+
+    iExpectedCallbackArray = new (ELeave) CArrayPtrFlat<TCallbackEvent>( 1 );
+
+    //
+    //  CenRep volume range is 0 - number of steps (either 10 or 20).
+    //  Set default CenRep values as volume(40), mute(0)
+    //
+    CRepository* volCenRep = CRepository::NewL( KCRUidMPXVideoSettings );
+    volCenRep->Set( KMPXVideoPlaybackVolume, 40 );
+    volCenRep->Set( KMPXVideoPlaybackMute, 0 );
+    delete volCenRep;
+
+    //
+    //  Create VideoHelix Playback Plugin for STIF testing
+    //
+    iPlaybackPlugin = CMPXVideoHelixPlayback::NewL( iLog );
+
+    iPlayerUtility = CMpxVideoPlayerUtility::NewL( NULL );
+    iPlayerUtility->AddStifObserver( this );
+}
+
+// -----------------------------------------------------------------------------
+// CVHPPTestClass::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CVHPPTestClass*
+CVHPPTestClass::NewL( CTestModuleIf& aTestModuleIf )
+{
+    CVHPPTestClass* self =
+        new (ELeave) CVHPPTestClass( aTestModuleIf );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+}
+
+// -----------------------------------------------------------------------------
+//  Destructor
+// -----------------------------------------------------------------------------
+//
+CVHPPTestClass::~CVHPPTestClass()
+{
+    MPX_DEBUG(_L("CVHPPTestClass::~CVHPPTestClass()"));
+
+    CleanupTempFiles();
+
+    if ( iTimeoutController->IsActive() )
+    {
+        _LIT( KPanic, "Event Pending" );
+        User::Panic( KPanic, -33 );
+    }
+
+    delete iTimeoutController;
+
+    delete iPlaybackPlugin;
+
+    REComSession::FinalClose();
+
+    delete iLog;
+
+    StifUtilities* utility = reinterpret_cast<StifUtilities*>( Dll::Tls() );
+    delete utility;
+    Dll::SetTls( NULL );
+}
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+//  LibEntryL is a polymorphic Dll entry point.
+//  Returns: CScriptBase: New CScriptBase derived object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CScriptBase* LibEntryL( CTestModuleIf& aTestModuleIf )
+{
+    return ( CScriptBase* ) CVHPPTestClass::NewL( aTestModuleIf );
+}
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/src/videohelixtestbody.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,2635 @@
+/*
+* 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:  Test Harness for VideoHelixPlaybackPlugin
+*
+*/
+
+// Version : %version:  29 %
+
+
+// [INCLUDE FILES] - do not remove
+#include <e32svr.h>
+#include <stifparser.h>
+#include <stiftestinterface.h>
+
+#include <mpxmediageneraldefs.h>
+#include <mpxcommandgeneraldefs.h>
+#include <mmf/common/mmferrors.h>
+#include <mpxplaybackpluginversion2.h>
+#include <mpxmessagegeneraldefs.h>
+
+#include <accpolnamevaluerecord.h>
+#include <accconfigfileparser.h>
+#include <acccongenericid.h>
+#include <accpolnamevaluerecord.h>
+
+#include "dlmgr_stub.h"
+#include "mpxvideoregion.h"
+#include "videohelixtest.h"
+#include "mpxvideoaccessoryobserver_stub.h"
+#include <mpxvideoplaybackdefs.h>
+#include "mpxmediavideodefs.h"
+#include "mpxvideo_debug.h"
+#include "mpxvideoplayerutility_stub.h"
+#include "mpxhelixplaybackplugindefs.h"
+#include "mpxvideoconnectionutility.h"
+
+#ifdef __WINSCW__
+    _LIT( KVideoTestPath, "c:\\data\\Videos\\" );
+#else
+    _LIT( KVideoTestPath, "f:\\testing\\data\\" );
+#endif
+
+_LIT( KOpenControllerFilename, "c:\\vhpp_openerror.txt" );
+_LIT( KPrepareControllerFilename, "c:\\vhpp_prepareerror.txt" );
+_LIT( KPlaybackCompleteFilename, "c:\\vhpp_playerror.txt" );
+_LIT( KDlMgrFile, "c:\\vhpp_dlmgr.txt" );
+_LIT( KDrmRightsFile, "c:\\vhpp_drmrights.txt" );
+
+#define ELightsNotBlinking 1
+#define ELightsBlinking 2
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+//  CVHPPTestClass::RunMethodL
+//  Run specified method. Contains also table of test mothods and their names.
+// -----------------------------------------------------------------------------
+//
+TInt CVHPPTestClass::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( "Initialize", CVHPPTestClass::InitializeL ),
+        ENTRY( "InitializeHandle", CVHPPTestClass::InitializeHandleL ),
+        ENTRY( "InitializeLink", CVHPPTestClass::InitializeLinkL ),
+        ENTRY( "InitializeSdp", CVHPPTestClass::InitializeSdpL ),
+        ENTRY( "IssueGeneralCommand", CVHPPTestClass::IssueGeneralCommandL),
+        ENTRY( "IssuePlaybackCommand", CVHPPTestClass::IssuePlaybackCommandL),
+        ENTRY( "IssueVideoCommand", CVHPPTestClass::IssueVideoCommandL),
+        ENTRY( "IssueSeekingCommand", CVHPPTestClass::IssueSeekingCommandL),
+        ENTRY( "SetProperty", CVHPPTestClass::SetPropertyL),
+        ENTRY( "GetProperty", CVHPPTestClass::GetPropertyL),
+        ENTRY( "GetSubPlayerNames", CVHPPTestClass::GetSubPlayerNamesL),
+        ENTRY( "SelectSubPlayer", CVHPPTestClass::SelectSubPlayerL),
+        ENTRY( "SubPlayerName", CVHPPTestClass::SubPlayerName),
+        ENTRY( "SubPlayerIndex", CVHPPTestClass::SubPlayerIndex),
+        ENTRY( "CancelRequest", CVHPPTestClass::CancelRequest),
+        ENTRY( "GetMedia", CVHPPTestClass::GetMediaL),
+        ENTRY( "SetPlaybackComplete", CVHPPTestClass::SetPlaybackCompleteL),
+        ENTRY( "SetUnexpectedMmfEvent", CVHPPTestClass::SetUnexpectedMmfEventL),
+        ENTRY( "ConnectToDownload", CVHPPTestClass::ConnectToDownloadL),
+        ENTRY( "PauseDownload", CVHPPTestClass::PauseDownloadL),
+        ENTRY( "ResumeDownload", CVHPPTestClass::ResumeDownloadL),
+        ENTRY( "CancelDownload", CVHPPTestClass::CancelDownloadL),
+        ENTRY( "RetrievePdlStatus", CVHPPTestClass::RetrievePdlStatusL),
+        ENTRY( "ChangeAspectRatioL", CVHPPTestClass::ChangeAspectRatioL),
+
+        ENTRY( "AlarmOn", CVHPPTestClass::AlarmOn),
+        ENTRY( "PhoneCallRejected", CVHPPTestClass::PhoneCallRejected),
+        ENTRY( "VoiceCallAccepted", CVHPPTestClass::VoiceCallAccepted),
+        ENTRY( "VideoCallAccepted", CVHPPTestClass::VideoCallAccepted),
+        ENTRY( "PlayduringVideoCall", CVHPPTestClass::PlayduringVideoCall),
+        ENTRY( "PlayduringVoiceCall", CVHPPTestClass::PlayduringVoiceCall),
+
+        ENTRY( "EndPhoneCall", CVHPPTestClass::EndPhoneCall),
+
+        ENTRY( "SetTvOutConnected", CVHPPTestClass::SetTvOutConnectedL ),
+        ENTRY( "SetTvOutDisconnected", CVHPPTestClass::SetTvOutDisconnectedL ),
+        ENTRY( "ConnectTvOut", CVHPPTestClass::ConnectTvOutL ),
+        ENTRY( "DisconnectTvOut", CVHPPTestClass::DisconnectTvOutL ),
+
+        ENTRY( "SetDrmProtected", CVHPPTestClass::SetDrmProtectedL ),
+        ENTRY( "IssueSeekedToEndCommand", CVHPPTestClass::IssueSeekedToEndCommandL),
+        ENTRY( "HandleVolume", CVHPPTestClass::HandleVolumeL ),
+
+        ENTRY ("InitializeWithPositionL", CVHPPTestClass::InitializeWithPositionL),
+        ENTRY ("InitializeLinkWithPositionL", CVHPPTestClass::InitializeLinkWithPositionL),
+        ENTRY ("InitializeHandleWithPositionL", CVHPPTestClass::InitializeHandleWithPositionL),
+        ENTRY ( "InitializeStreamingWithSdpFileHandleL", CVHPPTestClass::InitializeStreamingWithSdpFileHandleL ),
+        ENTRY ( "RetrieveFileNameAndModeL", CVHPPTestClass::RetrieveFileNameAndModeL ),        
+        ENTRY ( "StartDefaultConnectionL", CVHPPTestClass::StartDefaultConnectionL ),
+        ENTRY ( "CheckAccessPointL", CVHPPTestClass::CheckAccessPointL )
+
+        //
+        //  ADD NEW ENTRIES HERE
+        //
+        // ENTRY( "SendPlayCommandToServer",
+        //        CVHPPTestClass::SendPlayCommandToServer ),
+        // [test cases entries] - Do not remove
+    };
+
+    const TInt count = sizeof( KFunctions ) / sizeof( TStifFunctionInfo );
+
+    return RunInternalL( KFunctions, count, aItem );
+}
+
+void
+CVHPPTestClass::WriteControllerError( const TDesC& aFilename, TInt aData )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::WriteControllerError()"),
+                   _L("file = %S, data = %d"), &aFilename, aData );
+
+    //
+    //  Write to test file so the controller open fails
+    //
+    RFile file;
+
+    RFs fs;
+    TInt error = fs.Connect();
+
+    TBuf8<16> tgt;
+    tgt.Num( aData );
+
+    file.Replace( fs, aFilename, EFileWrite );
+
+    file.Write( tgt );
+
+    file.Close();
+    fs.Close();
+}
+
+void
+CVHPPTestClass::CreateGeneralPlaybackCommandL( TMPXPlaybackCommand aCmd )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::CreateGeneralPlaybackCommandL()"),
+                   _L("aCmd = %d"), aCmd );
+
+    CMPXCommand* cmd = CMPXCommand::NewL();
+    CleanupStack::PushL( cmd );
+
+    cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
+
+    cmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId,
+                                 KMPXCommandIdPlaybackGeneral );
+
+    cmd->SetTObjectValueL<TInt>( KMPXCommandPlaybackGeneralType, aCmd );
+
+    iPlaybackPlugin->CommandL( *cmd );
+
+    CleanupStack::PopAndDestroy( cmd );
+}
+
+void
+CVHPPTestClass::PreparePluginL()
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::PreparePluginL()"));
+
+    //
+    //  Set this class as the observer for the Plugin events
+    //
+    iLog->Log(_L("    SetObserver on Plugin"));
+    iPlaybackPlugin->SetObserver( *this );
+
+    //
+    //  Create Playback Message
+    //
+    iLog->Log(_L("    Close the Plugin"));
+    CreateGeneralPlaybackCommandL( EPbCmdClose );
+}
+
+TInt
+CVHPPTestClass::ReadFileInitializationParameters( CStifItemParser& aItem, TDes& aFilename )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::ReadFileInitializationParameters()"));
+
+    TPtrC filename;
+
+    //
+    //  Read in the filename from the config file
+    //
+    TInt err = aItem.GetNextString( filename );
+
+    if ( err == KErrNone )
+    {
+        //
+        //  Build the full path to the file
+        //
+        aFilename.Append( KVideoTestPath );
+        aFilename.Append( filename );
+
+        err = ReadInitializationErrors( aItem );
+    }
+
+    return err;
+}
+
+TInt
+CVHPPTestClass::ReadInitializationErrors( CStifItemParser& aItem )
+{
+    TInt err;
+    TInt initError;
+    TInt openError;
+    TInt prepError;
+
+    //
+    //  Read in the expected init error code
+    //
+    err = aItem.GetNextInt( initError );
+
+    if ( err == KErrNone && initError != KErrNone )
+    {
+        AddErrorEvent( initError );
+    }
+    else
+    {
+        //
+        //  Read in the expected open complete error code
+        //
+        err = aItem.GetNextInt( openError );
+
+        WriteControllerError( KOpenControllerFilename, openError );
+
+        if ( err == KErrNone && openError != KErrNone )
+        {
+            AddErrorEvent( openError );
+        }
+        else
+        {
+            //
+            //  Open Complete does not return error
+            //  Read in the expected prepare complete error code
+            //
+            err = aItem.GetNextInt( prepError );
+
+            WriteControllerError( KPrepareControllerFilename, prepError );
+
+            if ( err == KErrNone && prepError != KErrNone )
+            {
+                AddErrorEvent( prepError );
+            }
+        }
+    }
+
+    return err;
+}
+
+// -----------------------------------------------------------------------------
+//  CVHPPTestClass::InitializeL
+//  Test creation of a general playback command.
+// -----------------------------------------------------------------------------
+//
+TInt
+CVHPPTestClass::InitializeL( CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::InitializeL()"));
+    iLog->Log(_L("CVHPPTestClass::InitializeL()"));
+
+    TInt duration;
+    TInt volumeSteps;
+    
+    TInt 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();
+    
+                //
+                //  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 );
+            }
+        }
+    }
+
+    return err;
+}
+
+// -----------------------------------------------------------------------------
+//  CVHPPTestClass::InitializeLinkL
+//  Test creation of a general playback command.
+// -----------------------------------------------------------------------------
+//
+TInt
+CVHPPTestClass::InitializeLinkL( CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::InitializeLinkL()"));
+    iLog->Log(_L("CVHPPTestClass::InitializeLinkL()"));
+
+    TInt duration;
+    TInt volumeSteps;
+    TInt 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 );
+        
+            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 );
+                }
+            }
+        }
+    }
+
+    return err;
+}
+
+// -----------------------------------------------------------------------------
+//  CVHPPTestClass::InitializeSdpL
+//  Test creation of a general playback command.
+// -----------------------------------------------------------------------------
+//
+TInt
+CVHPPTestClass::InitializeSdpL( CStifItemParser& /*aItem*/ )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::InitializeSdpL()"));
+    iLog->Log(_L("CVHPPTestClass::InitializeSdpL()"));
+
+    TBuf<120> fullPath;
+    TInt      initError = KErrNone;
+
+    TInt err = KErrNone;// = ReadInitializationParameters( aItem, fullPath, initError );
+
+    if ( err == KErrNone )
+    {
+        PreparePluginL();
+
+        MPX_DEBUG(_L("Initialize the Plugin:  filename = %S"), &fullPath);
+        iLog->Log(_L("Initialize the Plugin:  filename = %S"), &fullPath);
+
+
+        TRAPD( err,
+               static_cast<CMPXPlaybackPluginVersion2*>(iPlaybackPlugin)->InitStreamingL
+                                     ( fullPath, KNullDesC8, 11 );
+              );
+
+        MPX_DEBUG(_L("CVHPPTestClass::InitialisePluginL(%d)"), err);
+
+        if ( err == initError )
+        {
+            MPX_DEBUG(_L("InitialiseL() returned proper error %d"), err);
+            iLog->Log(_L("InitialiseL() returned proper error %d"), err);
+            err = KErrNone;
+        }
+    }
+
+    return err;
+}
+
+
+TInt
+CVHPPTestClass::InitializeHandleL( CStifItemParser& aItem  )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::InitializeHandleL()"));
+    iLog->Log(_L("CVHPPTestClass::InitializeHandleL()"));
+
+    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
+                    //
+                    if ( fileHandle32 )
+                    {
+                        RFile file;
+                        User::LeaveIfError( file.Open( fs, fullPath, EFileRead ) );
+                        iPlaybackPlugin->InitialiseL( file );
+                        file.Close();
+                    }
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+                    else
+                    {
+                        RFile64 file64;
+                        User::LeaveIfError( file64.Open( fs, fullPath, EFileRead ) );
+                        iPlaybackPlugin->Initialise64L( file64 );
+                        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;
+}
+
+TRect
+CVHPPTestClass::ReadRect( CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::ReadRect()"));
+
+    TRect rect;
+
+    TInt value;
+
+    if ( ! aItem.GetNextInt( value ) )
+    {
+        rect.iTl.iX = value;
+
+        if ( ! aItem.GetNextInt( value ) )
+        {
+            rect.iTl.iY = value;
+
+            if ( ! aItem.GetNextInt( value ) )
+            {
+                rect.iBr.iX = value;
+
+                if ( ! aItem.GetNextInt( value ) )
+                {
+                    rect.iBr.iY = value;
+                }
+            }
+        }
+    }
+
+    return rect;
+}
+
+void
+CVHPPTestClass::CreateVideoPlaybackCommandL( CStifItemParser& aItem,
+                                             TMPXVideoPlaybackCommand aCmd )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::CreateVideoPlaybackCommandL()"),
+                   _L("aCmd = %d"), aCmd );
+
+    //
+    //  create command to pass to playback plugin
+    //
+    CMPXCommand* cmd = CMPXCommand::NewL();
+    CleanupStack::PushL( cmd );
+
+    cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
+
+    cmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId,
+                                 KMPXMediaIdVideoPlayback );
+
+    cmd->SetTObjectValueL<TInt>( KMPXMediaVideoPlaybackCommand, aCmd );
+
+    switch ( aCmd )
+    {
+        case EPbCmdRestartDSA:
+        {
+            TRect rect = ReadRect( aItem );
+            RRegion region( rect );
+
+            CMPXVideoRegion* vidReg = CMPXVideoRegion::NewL();
+            CleanupStack::PushL( vidReg );
+
+            vidReg->SetRegion( region );
+
+            vidReg->Print();
+
+            cmd->SetCObjectValueL<CMPXVideoRegion>( KMPXMediaVideoPlaybackDSARegion, vidReg );
+
+            CleanupStack::PopAndDestroy( vidReg );
+
+            break;
+        }
+        case EPbCmdSetDisplayWindow:
+        {
+            TRect rect = ReadRect( aItem );
+            RRegion region( rect );
+
+            CMPXVideoRegion* vidReg = CMPXVideoRegion::NewL();
+            CleanupStack::PushL( vidReg );
+
+            vidReg->SetRegion( region);
+
+            vidReg->Print();
+
+            cmd->SetTObjectValueL<TRect>( KMPXMediaVideoPlaybackTRect, rect );
+
+            cmd->SetCObjectValueL<CMPXVideoRegion>( KMPXMediaVideoPlaybackDSARegion, vidReg );
+
+            CleanupStack::PopAndDestroy( vidReg );
+
+            break;
+        }
+    }
+
+    iPlaybackPlugin->CommandL( *cmd );
+
+    CleanupStack::PopAndDestroy( cmd );
+}
+
+// -----------------------------------------------------------------------------
+//  CVHPPTestClass::IssueVideoCommandL
+//  Test creation of a general playback command.
+// -----------------------------------------------------------------------------
+//
+TInt
+CVHPPTestClass::IssueVideoCommandL( CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::IssueVideoCommandL()"));
+    iLog->Log(_L("CVHPPTestClass::IssueVideoCommandL()"));
+
+    TInt vidCmd;
+    TInt err = aItem.GetNextInt( vidCmd );
+
+    if ( err == KErrNone )
+    {
+        TCallbackEvent* event = new TCallbackEvent;
+
+        event->iEvent = vidCmd;
+        event->iData  = 0;
+        event->iError = KErrNone;
+
+        AddExpectedEvent( event );
+
+        CreateVideoPlaybackCommandL( aItem, (TMPXVideoPlaybackCommand)vidCmd );
+    }
+
+    return KErrNone;
+}
+
+TInt
+CVHPPTestClass::IssueSeekingCommandL( CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::IssueSeekingCommandL()"));
+    iLog->Log(_L("CVHPPTestClass::IssueSeekingCommandL()"));
+
+    TInt vidCmd;
+    TInt err = aItem.GetNextInt( vidCmd );
+
+    //
+    //  Seeking is starting, allow posiiton callbacks
+    //
+    iAllowPositionCallback = ETrue;
+
+    if ( err == KErrNone )
+    {
+        TCallbackEvent* event = new TCallbackEvent;
+
+        if ( vidCmd == EPbCmdStartVideoSeekingForward || vidCmd == EPbCmdStartVideoSeekingBackward )
+        {
+            TBool addEvent = ETrue;
+
+            aItem.GetNextInt( addEvent );
+
+            if ( addEvent )
+            {
+                event->iEvent = EPPluginSeeking;
+                event->iData  = 0;
+                event->iError = KErrNone;
+                AddExpectedEvent( event );
+            }
+        }
+        else if ( vidCmd == EPbCmdStopVideoSeeking )
+        {
+            TInt callbackEvent;
+            aItem.GetNextInt( callbackEvent );
+
+            if ( callbackEvent )
+            {
+                event->iEvent = callbackEvent;
+                event->iData  = 0;
+                event->iError = KErrNone;
+                AddExpectedEvent( event );
+
+                iAllowPositionCallback = EFalse;
+            }
+        }
+
+        CreateVideoPlaybackCommandL( aItem, (TMPXVideoPlaybackCommand)vidCmd );
+    }
+
+    return KErrNone;
+}
+
+// -----------------------------------------------------------------------------
+//  CVHPPTestClass::IssueSeekedToEndCommandL
+//  Test creation of a End of Clip command.
+// -----------------------------------------------------------------------------
+//
+TInt
+CVHPPTestClass::IssueSeekedToEndCommandL( CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::IssueSeekedToEndCommandL()"));
+    iLog->Log(_L("CVHPPTestClass::IssueSeekedToEndCommandL()"));
+
+    TCallbackEvent* event = new TCallbackEvent;
+
+    event->iEvent = EPPlayComplete;
+    event->iData  = 0;
+    event->iError = KErrNone;
+
+    AddExpectedEvent( event );
+
+    CreateVideoPlaybackCommandL( aItem, EPbCmdEndofClipReached);
+
+    return KErrNone;
+}
+
+TInt
+CVHPPTestClass::ParsePlaybackCommand( CStifItemParser& aItem, TInt& aCmd )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::ParsePlaybackCommand()"));
+
+    TInt err = aItem.GetNextInt( aCmd );
+
+    if ( err == KErrNone )
+    {
+        TCallbackEvent* event = new TCallbackEvent;
+        event->iData  = 0;
+
+        err = aItem.GetNextInt( event->iError );
+
+        if ( err == KErrNone )
+        {
+            if ( event->iError == KErrNotSupported )
+            {
+                delete event;
+            }
+            else
+            {
+                err = aItem.GetNextInt( event->iEvent );
+
+                if ( err == KErrNone )
+                {
+                    if ( event->iEvent == EPBufferingStarted )
+                    {
+                        //
+                        //  A playing command will be added also
+                        //
+                        AddExpectedEvent( event );
+
+                        event = new TCallbackEvent;
+                        event->iEvent = EPPlaying;
+                        event->iData  = 0;
+                        event->iError = KErrNone;
+                    }
+
+                    AddExpectedEvent( event );
+                }
+            }
+        }
+    }
+
+    return err;
+}
+
+// -----------------------------------------------------------------------------
+//  CVHPPTestClass::IssueGeneralCommandL
+//  Test creation of a general playback command.
+// -----------------------------------------------------------------------------
+//
+TInt
+CVHPPTestClass::IssueGeneralCommandL( CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::IssueGeneralCommandL()"));
+    iLog->Log(_L("CVHPPTestClass::IssueGeneralCommandL()"));
+
+    TInt genCmd = 0;
+
+    TInt error = ParsePlaybackCommand( aItem, genCmd );
+
+    if ( error == KErrNone )
+    {
+        CreateGeneralPlaybackCommandL( (TMPXPlaybackCommand)genCmd );
+    }
+
+    return error;
+}
+
+TInt
+CVHPPTestClass::IssuePlaybackCommandL( CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::IssuePlaybackCommandL()"));
+    iLog->Log(_L("CVHPPTestClass::IssuePlaybackCommandL()"));
+
+    TInt genCmd;
+
+    TInt error = ParsePlaybackCommand( aItem, genCmd );
+
+    if ( error == KErrNone )
+    {
+        iPlaybackPlugin->CommandL( (TMPXPlaybackCommand)genCmd, 0 );
+    }
+
+    return error;
+}
+
+TInt
+CVHPPTestClass::SetPropertyL( CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::SetPropertyL()"));
+    iLog->Log(_L("CVHPPTestClass::SetPropertyL()"));
+
+    TInt property;
+    TInt value;
+
+    TInt trapErr = KErrNone;
+    TInt err = aItem.GetNextInt( property );
+
+    if ( err == KErrNone )
+    {
+        err = aItem.GetNextInt( value );
+
+        if ( err == KErrNone )
+        {
+            if ( property >= EPbPropertyNum )
+            {
+                trapErr = KErrNotSupported;
+            }
+            else
+            {
+                TCallbackEvent* event = new TCallbackEvent;
+
+                if ( property == EPbPropertyVolume )
+                {
+                    TInt addEvent;
+                    err = aItem.GetNextInt( addEvent );
+
+                    if ( err == KErrNone && addEvent )
+                    {
+                        event->iEvent = EPVolumeChanged;
+                        event->iData  = value;
+                        event->iError = KErrNone;
+                        AddExpectedEvent( event );
+                    }
+                }
+                else if ( property == EPbPropertyMute )
+                {
+                    event->iEvent = EPMuteChanged;
+                    event->iData  = value;
+                    event->iError = KErrNone;
+                    AddExpectedEvent( event );
+                }
+				else
+				{
+					event->iEvent = EPSetComplete;
+					event->iData  = property;
+					event->iError = KErrNone;
+					AddExpectedEvent( event );
+				}
+				
+            }
+
+            TRAP( err, iPlaybackPlugin->SetL( (TMPXPlaybackProperty)property, value ) );
+        }
+    }
+
+    if ( err == trapErr )
+    {
+        MPX_DEBUG(_L("CVHPPTestClass::SetPropertyL() leaves with proper error"));
+        err = KErrNone;
+    }
+
+    return err;
+}
+
+TInt
+CVHPPTestClass::GetPropertyL( CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::GetPropertyL()"));
+    iLog->Log(_L("CVHPPTestClass::GetPropertyL()"));
+
+    TInt property;
+    TInt value;
+
+    TInt trapErr = KErrNone;
+
+    TInt err = aItem.GetNextInt( property );
+
+    if ( err == KErrNone )
+    {
+        err = aItem.GetNextInt( value );
+
+        if ( err == KErrNone )
+        {
+            if ( property >= EPbPropertyNum )
+            {
+                trapErr = KErrNotSupported;
+            }
+            else
+            {
+                TCallbackEvent* event = new TCallbackEvent;
+
+                event->iEvent = property;
+                event->iData  = value;
+                event->iError = KErrNone;
+
+                AddExpectedEvent( event );
+            }
+
+            TRAP( err, iPlaybackPlugin->PropertyL( (TMPXPlaybackProperty)property ) );
+        }
+    }
+
+    if ( err == trapErr )
+    {
+        MPX_DEBUG(_L("CVHPPTestClass::GetPropertyL() leaves with proper error"));
+        err = KErrNone;
+    }
+
+    return err;
+}
+
+TInt
+CVHPPTestClass::GetSubPlayerNamesL( CStifItemParser& /*aItem*/ )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::GetSubPlayerNamesL()"));
+    iLog->Log(_L("CVHPPTestClass::GetSubPlayerNmaesL()"));
+
+    iPlaybackPlugin->SubPlayerNamesL();
+
+    return KErrNone;
+}
+
+TInt
+CVHPPTestClass::SelectSubPlayerL( CStifItemParser& /*aItem*/ )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::SelectSubPlayerL()"));
+    iLog->Log(_L("CVHPPTestClass::SelectSubPlayerL()"));
+
+    TRAPD( err, iPlaybackPlugin->SelectSubPlayerL( 1 ); );
+
+    if ( err == KErrNotSupported )
+    {
+        err = KErrNone;
+    }
+
+    return err;
+}
+
+TInt
+CVHPPTestClass::SubPlayerName( CStifItemParser& /*aItem*/ )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::SubPlayerName()"));
+    iLog->Log(_L("CVHPPTestClass::SubPlayerName()"));
+
+    TInt err = KErrNone;
+
+    TDesC name = iPlaybackPlugin->SubPlayerName();
+
+    if ( name != KNullDesC )
+    {
+        err = KErrNotFound;
+    }
+
+    return err;
+}
+
+TInt
+CVHPPTestClass::SubPlayerIndex( CStifItemParser& /*aItem*/ )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::SubPlayerIndex()"));
+    iLog->Log(_L("CVHPPTestClass::SubPlayerIndex()"));
+
+    TInt err = iPlaybackPlugin->SubPlayerIndex();
+
+    if ( err == KErrNotFound )
+    {
+        err = KErrNone;
+    }
+
+    return err;
+}
+
+TInt
+CVHPPTestClass::GetMediaL( CStifItemParser& /*aItem*/ )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::GetMediaL()"));
+    iLog->Log(_L("CVHPPTestClass::GetMediaL()"));
+
+    RArray<TMPXAttribute> attrs;
+    CleanupClosePushL(attrs);
+
+    // TMPXAttribute attr( KMPXMediaGeneralAll );
+
+    attrs.Append( KMPXMediaGeneralAll );
+    attrs.Append( KMPXMediaVideoAll );
+
+    iPlaybackPlugin->MediaL( attrs.Array() );
+
+    CleanupStack::PopAndDestroy( &attrs );
+
+    return KErrNone;
+}
+
+TInt
+CVHPPTestClass::CancelRequest( CStifItemParser& /*aItem*/ )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::CancelRequest()"));
+    iLog->Log(_L("CVHPPTestClass::CancelRequest()"));
+
+    iPlaybackPlugin->CancelRequest();
+
+    return KErrNone;
+}
+
+TInt
+CVHPPTestClass::SetPlaybackCompleteL( CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::SetPlaybackCompleteL()"));
+    iLog->Log(_L("CVHPPTestClass::SetPlaybackCompleteL()"));
+
+    TInt playError = KErrNone;
+
+    TInt err = aItem.GetNextInt( playError );
+
+    if ( err == KErrNone )
+    {
+        TInt duration;
+
+        err = aItem.GetNextInt( duration );
+
+        if ( err == KErrNone )
+        {
+            WriteControllerError( KPlaybackCompleteFilename, playError );
+
+            TCallbackEvent* event = new TCallbackEvent;
+            event->iEvent = EPSetComplete;
+            event->iData  = EPbPropertyPosition;
+            event->iError = KErrNone;
+            AddExpectedEvent( event );
+
+            //
+            //  Trigger a playback complete by setting time to duration
+            //
+            iPlaybackPlugin->SetL( EPbPropertyPosition, duration );
+
+            if ( playError )
+            {
+                AddErrorEvent( playError );
+            }
+            else
+            {
+                TCallbackEvent* event = new TCallbackEvent;
+
+                event->iEvent = EPPlayComplete;
+                event->iData  = 0;
+                event->iError = playError;
+
+                AddExpectedEvent( event );
+            }
+        }
+    }
+
+    return KErrNone;
+}
+
+TInt
+CVHPPTestClass::SetUnexpectedMmfEventL( CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::SetUnexpectedMmfEventL()"));
+    iLog->Log(_L("CVHPPTestClass::SetUnexpectedMmfEventL()"));
+
+    TInt playError = KErrNone;
+
+    TInt err = aItem.GetNextInt( playError );
+
+    if ( err == KErrNone )
+    {
+        WriteControllerError( KPlaybackCompleteFilename, playError );
+
+        //
+        //  Trigger an unexpected event by setting time to a negative value
+        //
+        iPlaybackPlugin->SetL( EPbPropertyPosition, -1 );
+
+        TCallbackEvent* event = new TCallbackEvent;
+
+        event->iEvent = EPClosed;
+        event->iData  = 0;
+        event->iError = playError;
+
+        AddExpectedEvent( event );
+    }
+
+    return KErrNone;
+}
+
+// -----------------------------------------------------------------------------
+//  CVHPPTestClass::ConnectToDownload
+// -----------------------------------------------------------------------------
+//
+TInt
+CVHPPTestClass::ConnectToDownloadL( CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::ConnectToDownloadL()"));
+    iLog->Log(_L("CVHPPTestClass::ConnectToDownloadL()"));
+
+    TInt err = KErrNone;
+    
+#ifdef USE_S60_DOWNLOAD_MANAGER       
+    
+    iDlMgrTester = CDlMgrTestClass::NewL();
+    iDlMgrTester->AddStifObserver( this );
+
+    TInt dlId;
+    TPtrC filename;
+    TBuf<120> fullPath;
+
+    //
+    //   Read in the download id and filename
+    //
+    err = aItem.GetNextInt( dlId );
+
+    if ( err == KErrNone )
+    {
+        err = aItem.GetNextString( filename );
+
+        if ( err == KErrNone )
+        {
+            TCallbackEvent* event = new TCallbackEvent;
+            event->iEvent = EConnectedToDownload;
+            event->iData  = dlId;
+            event->iError = KErrNone;
+
+            AddExpectedEvent( event );
+
+            //
+            //  Build the full path to the file
+            //
+            fullPath.Append( KVideoTestPath );
+            fullPath.Append( filename );
+
+            CMPXCommand* cmd = CMPXCommand::NewL();
+            CleanupStack::PushL( cmd );
+
+            cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
+            cmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId, KMPXCommandIdPlaybackPD );
+            cmd->SetTObjectValueL<TMPXPlaybackPdCommand>( KMPXCommandPlaybackGeneralType, EPbCmdStartPd );
+            cmd->SetTObjectValueL<TInt>( KMPXCommandPlaybackPDTransactionID, dlId );
+            cmd->SetTextValueL( KMPXMediaVideoPlaybackFileName, fullPath );
+            cmd->SetTObjectValueL<TInt>( KMPXMediaVideoMovePdlFile, ETrue );
+
+            iPlaybackPlugin->CommandL( *cmd );
+
+            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
+    Signal();
+	
+#endif // USE_S60_DOWNLOAD_MANAGER
+    
+    return err;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CVHPPTestClass::SendPdlCustomCommandL()
+// -------------------------------------------------------------------------------------------------
+//
+void
+CVHPPTestClass::SendPdlCustomCommandL( TMPXPlaybackPdCommand aCustomCmd )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::SendPdlCustomCommandL"),
+                   _L("aCustomCmd = %d"), aCustomCmd );
+
+#ifdef USE_S60_DOWNLOAD_MANAGER     
+
+    CMPXCommand* cmd = CMPXCommand::NewL();
+    CleanupStack::PushL( cmd );
+
+    cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
+    cmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId, KMPXCommandIdPlaybackPD );
+    cmd->SetTObjectValueL<TMPXPlaybackPdCommand>( KMPXCommandPlaybackGeneralType, aCustomCmd );
+
+    iPlaybackPlugin->CommandL( *cmd );
+
+    CleanupStack::PopAndDestroy( cmd );
+	
+#else // USE_S60_DOWNLOAD_MANAGER     
+	
+	// Signal TestScripter to continue from waittestclass
+    Signal();
+	
+#endif // USE_S60_DOWNLOAD_MANAGER
+
+}
+
+// -----------------------------------------------------------------------------
+//  CVHPPTestClass::PauseDownloadL
+// -----------------------------------------------------------------------------
+//
+TInt
+CVHPPTestClass::PauseDownloadL( CStifItemParser& /*aItem*/ )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::PauseDownloadL()"));
+    iLog->Log(_L("CVHPPTestClass::PauseDownloadL()"));
+
+#ifdef USE_S60_DOWNLOAD_MANAGER   
+    
+    TCallbackEvent* event = new TCallbackEvent;
+
+    event->iEvent = EPDownloadStateChanged;
+    event->iData  = EPbDlStateDownloadPaused;
+    event->iError = KErrNone;
+
+    AddExpectedEvent( event );
+
+    iDlMgrTester->PauseDownload();
+    
+#else // USE_S60_DOWNLOAD_MANAGER    
+	
+	// Signal TestScripter to continue from waittestclass
+    Signal();
+	
+#endif // USE_S60_DOWNLOAD_MANAGER 
+    
+    return KErrNone;
+}
+
+// -----------------------------------------------------------------------------
+//  CVHPPTestClass::ResumeDownloadL
+// -----------------------------------------------------------------------------
+//
+TInt
+CVHPPTestClass::ResumeDownloadL( CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::ResumeDownloadL()"));
+    iLog->Log(_L("CVHPPTestClass::ResumeDownloadL()"));
+
+    TInt err = KErrNone;
+    
+#ifdef USE_S60_DOWNLOAD_MANAGER 
+    
+    TInt dlSize;
+
+    err = aItem.GetNextInt( dlSize );
+
+    if ( err == KErrNone )
+    {
+        WriteControllerError( KDlMgrFile, dlSize );
+
+        TCallbackEvent* event = new TCallbackEvent;
+
+        event->iEvent = EPDownloadStateChanged;
+        event->iError = KErrNone;
+
+        if ( dlSize >= 100 )
+        {
+            event->iData = EPbDlStateDownloadCompleted;
+        }
+        else
+        {
+            event->iData  = EPbDlStateDownloading;
+        }
+
+        AddExpectedEvent( event );
+
+        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
+    Signal();
+	
+#endif // USE_S60_DOWNLOAD_MANAGER 
+    
+    return err;
+}
+
+// -----------------------------------------------------------------------------
+//  CVHPPTestClass::CancelDownloadL
+// -----------------------------------------------------------------------------
+//
+TInt
+CVHPPTestClass::CancelDownloadL( CStifItemParser& /*aItem*/ )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::CancelDownloadL()"));
+    iLog->Log(_L("CVHPPTestClass::CancelDownloadL()"));
+
+#ifdef USE_S60_DOWNLOAD_MANAGER 
+    
+    TCallbackEvent* event = new TCallbackEvent;
+
+    event->iEvent = EPDownloadStateChanged;
+    event->iData  = EPbDlStateDownloadCanceled;
+    event->iError = KErrNone;
+
+    AddExpectedEvent( event );
+
+    iDlMgrTester->CancelDownload();
+
+#else // USE_S60_DOWNLOAD_MANAGER    
+	
+	// Signal TestScripter to continue from waittestclass
+    Signal();
+	
+#endif // USE_S60_DOWNLOAD_MANAGER 
+    
+    return KErrNone;
+}
+
+// -----------------------------------------------------------------------------
+//  CVHPPTestClass::RetrievePdlStatusL
+// -----------------------------------------------------------------------------
+//
+TInt
+CVHPPTestClass::RetrievePdlStatusL( CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::RetrievePdlStatusL()"));
+    iLog->Log(_L("CVHPPTestClass::RetrievePdlStatusL()"));
+
+    TInt err = KErrNone;
+    
+#ifdef USE_S60_DOWNLOAD_MANAGER 
+    
+    TInt pdlState;
+    TInt expectedPdlState;
+    TInt downloadedBytes;
+    TInt expectedDownloadedBytes;
+    TInt downloadSize;
+    TInt expectedDownloadSize;
+
+    //
+    //   Read in the expected download data
+    //
+    err = aItem.GetNextInt( expectedPdlState );
+
+    if ( err == KErrNone )
+    {
+        err = aItem.GetNextInt( expectedDownloadedBytes );
+
+        if ( err == KErrNone )
+        {
+            err = aItem.GetNextInt( expectedDownloadSize );
+        }
+    }
+
+    if ( err == KErrNone )
+    {
+        CMPXCommand* cmd( CMPXCommand::NewL() );
+        CleanupStack::PushL( cmd );
+
+        cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
+        cmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId, KMPXCommandIdPlaybackPD );
+        cmd->SetTObjectValueL<TMPXPlaybackPdCommand>( KMPXCommandPlaybackGeneralType,
+                                                      EPbCmdGetPdStatus );
+
+        iPlaybackPlugin->CommandL( *cmd );
+
+        //
+        //  Parse the PDL information
+        //
+
+        pdlState = cmd->ValueTObjectL<TMPXPlaybackPdDownloadState>( KMPXCommandPlaybackPDState );
+        downloadedBytes = cmd->ValueTObjectL<TInt>( KMPXCommandPlaybackPDDownloadedBytes );
+        downloadSize = cmd->ValueTObjectL<TInt>( KMPXCommandPlaybackPDTotalBytes );
+
+        MPX_DEBUG(_L("    Expected Data:  PDL State = %d, current size = %d, total size = %d"),
+            expectedPdlState, expectedDownloadedBytes, expectedDownloadSize );
+
+        MPX_DEBUG(_L("    Received PDL State = %d, current size = %d, total size = %d"),
+            pdlState, downloadedBytes, downloadSize );
+
+        if ( ( expectedPdlState != pdlState ) ||
+             ( expectedDownloadedBytes != downloadedBytes ) ||
+             ( expectedDownloadSize != downloadSize ) )
+        {
+            err = KErrGeneral;
+        }
+
+        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
+    Signal();
+	
+#endif // USE_S60_DOWNLOAD_MANAGER 
+    
+    return err;
+}
+
+void
+CVHPPTestClass::HandlePluginEvent( TEvent aEvent, TInt aData, TInt aError )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::HandlePluginEvent"),
+                   _L("(%d, %d, %d)"), aEvent, aData, aError );
+
+    iLog->Log(_L("CVHPPTestClass::HandlePluginEvent(%d, %d, %d)"),
+        aEvent, aData, aError);
+
+    TCallbackEvent* callback = new TCallbackEvent;
+
+    callback->iEvent = aEvent;
+    callback->iData  = aData;
+    callback->iError = aError;
+
+    ProcessEvent( callback );
+}
+
+void
+CVHPPTestClass::HandlePlaybackMessage( CMPXMessage* aMsg, TInt /*aErr*/ )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::HandlePlaybackMessage()"));
+    iLog->Log(_L("CVHPPTestClass::HandlePlaybackMessage"));
+
+    TMPXMessageId id( *(aMsg->Value<TMPXMessageId>(KMPXMessageGeneralId)) );
+
+    if ( KMPXMediaIdVideoPlayback == id )
+    {
+        TMPXVideoPlaybackCommand message =
+            ( *(aMsg->Value<TMPXVideoPlaybackCommand>(KMPXMediaVideoPlaybackCommand)) );
+
+        switch ( message )
+        {
+            case EPbCmdPluginError:
+            {
+                TInt error( *aMsg->Value<TInt>( KMPXMediaVideoError ) );
+
+                ProcessErrorEvent( error );
+                break;
+            }
+            case EPbCmdTvOutEvent:
+            {
+                TCallbackEvent* callback = new TCallbackEvent;
+
+                callback->iEvent = EPbCmdTvOutEvent;
+                callback->iData  = *aMsg->Value<TInt>( KMPXMediaVideoTvOutConnected );
+                callback->iError = KErrNone;
+
+                ProcessEvent( callback );
+
+                break;
+            }
+        }
+    }
+}
+
+void
+CVHPPTestClass::HandleProperty( TMPXPlaybackProperty aProperty,
+                                TInt aValue,
+                                TInt aError )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::HandleProperty()"));
+    iLog->Log(_L("CVHPPTestClass::HandleProperty"));
+
+    TCallbackEvent* callback = new TCallbackEvent;
+
+    callback->iEvent = aProperty;
+    callback->iData  = aValue;
+    callback->iError = aError;
+
+    ProcessEvent( callback );
+}
+
+void
+CVHPPTestClass::HandleSubPlayerNames( TUid /*aPlayer*/,
+                                      const MDesCArray* /*aSubPlayers*/,
+                                      TBool /*aComplete*/,
+                                      TInt /*aError*/ )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::HandleSubPlayerNames()"));
+    iLog->Log(_L("CVHPPTestClass::HandleSubPlayerNames"));
+
+    Signal();
+}
+
+void
+CVHPPTestClass::HandleMedia( CMPXMedia* aMedia, TInt /*aError*/ )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::HandleMedia()"));
+    iLog->Log(_L("CVHPPTestClass::HandleMedia"));
+
+    //
+    //  Check for an error condition
+    //
+    if ( aMedia->IsSupported( KMPXMediaVideoError ) )
+    {
+        MPX_DEBUG(_L("CVHPPTestClass::HandleMedia() Plugin has error"));
+
+        TInt error = aMedia->ValueTObjectL<TInt>( KMPXMediaVideoError );
+
+        ProcessErrorEvent( error );
+    }
+    else
+    {
+        TBool partialPlaybackError = EFalse;
+
+        if ( aMedia->IsSupported( KMPXMediaVideoPartialPlayback ) )
+        {
+            partialPlaybackError = aMedia->ValueTObjectL<TInt>( KMPXMediaVideoPartialPlayback );
+        }
+
+        if ( partialPlaybackError )
+        {
+            ProcessErrorEvent( KErrMMPartialPlayback );
+        }
+        else
+        {
+            Signal();
+        }
+    }
+}
+
+void
+CVHPPTestClass::HandlePlaybackCommandComplete( CMPXCommand* /*aCommandResult*/,
+                                               TInt /*aError*/ )
+{
+    MPX_DEBUG(_L("CVHPPTestClass::HandlePlaybackCommandComplete"));
+}
+
+void
+CVHPPTestClass::AddExpectedEvent( TCallbackEvent* aEvent )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::AddExpectedEvent()"));
+
+    iExpectedCallbackArray->AppendL( aEvent );
+
+    if ( iTimeoutController && ! iTimeoutController->IsActive() )
+    {
+        iTimeoutController->Start( TTimeIntervalMicroSeconds(15000000) );
+    }
+}
+
+void
+CVHPPTestClass::AddErrorEvent( TInt aError )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::AddErrorEvent"),
+                   _L("(%d)"), aError );
+
+    iExpectedError = aError;
+
+    if ( iTimeoutController && ! iTimeoutController->IsActive() )
+    {
+        iTimeoutController->Start( TTimeIntervalMicroSeconds(15000000) );
+    }
+}
+
+void
+CVHPPTestClass::HandleTimeout( TInt aError )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::HandleTimeout"),
+                   _L("(%d)"), aError );
+
+    if ( aError == KErrNone )
+    {
+        iLog->Log(_L("    Callback timed out"));
+        Signal( KErrTimedOut );
+    }
+    else
+    {
+        iLog->Log(_L("    Callback timeout error %d"), aError);
+        Signal( aError );
+    }
+}
+
+void
+CVHPPTestClass::ProcessEvent( TCallbackEvent* aCallback )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::ProcessEvent"));
+    
+    if ( iExpectedCallbackArray->Count() > 0 )
+    {
+        TCallbackEvent* expectedCallback = (*iExpectedCallbackArray)[0];
+
+        MPX_DEBUG(_L("CVHPPTestClass::ProcessEvent(%d,%d,%d) Expected(%d,%d,%d)"),
+            aCallback->iEvent, aCallback->iData, aCallback->iError,
+            expectedCallback->iEvent, expectedCallback->iData, expectedCallback->iError);
+
+        if ( expectedCallback->iEvent == aCallback->iEvent )
+        {
+            if ( expectedCallback->iData == aCallback->iData &&
+                 expectedCallback->iError == aCallback->iError )
+            {
+                MPX_DEBUG(_L("Callback received with proper error code"));
+                iLog->Log(_L("Callback received with proper error code"));
+
+                //
+                //  Pop the event from the array
+                //
+                iExpectedCallbackArray->Delete( 0 );
+
+                if ( iExpectedCallbackArray->Count() == 0 )
+                {
+                    iTimeoutController->Cancel();
+                }
+
+                Signal();
+            }
+            else
+            {
+                iTimeoutController->Cancel();
+                MPX_DEBUG(_L("Callback received with wrong error code"));
+                iLog->Log(_L("Callback received with wrong error code"));
+                Signal( KErrGeneral );
+            }
+        }
+    }
+    else
+    {
+        if ( ! ( iAllowPositionCallback && aCallback->iEvent == EPPositionChanged ) )
+        {
+            //
+            //  Unexpected event
+            //
+            _LIT( KPanic, "Unexpected Event" );
+            User::Panic( KPanic, -33 );
+        }
+    }
+
+    delete aCallback;
+}
+
+void
+CVHPPTestClass::ProcessErrorEvent( TInt aError )
+{
+    MPX_DEBUG(_L("CVHPPTestClass::ProcessErrorEvent(%d) ExpectedError(%d)"),
+        aError, iExpectedError );
+
+    iLog->Log(_L("    Error received (%d)"), aError );
+
+    if ( iExpectedError == aError )
+    {
+        iTimeoutController->Cancel();
+
+        MPX_DEBUG(_L("Error received with proper error code"));
+        iLog->Log(_L("Error received with proper error code"));
+        Signal();
+
+        iExpectedError = KErrNone;
+    }
+    else
+    {
+        iTimeoutController->Cancel();
+
+        MPX_DEBUG(_L("Unexpected error received"));
+        iLog->Log(_L("Unexpected error received"));
+        Signal( KErrAbort );
+
+        iExpectedError = KErrNone;
+    }
+}
+
+// -----------------------------------------------------------------------------
+//  CVHPPTestClass::ChangeAspectRatioL
+// -----------------------------------------------------------------------------
+//
+TInt
+CVHPPTestClass::ChangeAspectRatioL( CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::ChangeAspectRatioL()"));
+    iLog->Log(_L("CVHPPTestClass::ChangeAspectRatioL()"));
+
+    TInt aspectRatioCmd = 0;
+    TInt expectedResult = 0;
+    TInt err = aItem.GetNextInt( aspectRatioCmd );
+
+    if ( err == KErrNone )
+    {
+        err = aItem.GetNextInt( expectedResult );
+
+        if ( err == KErrNone )
+        {
+            //
+            //  create command to pass to playback plugin
+            //
+            CMPXCommand* cmd = CMPXCommand::NewL();
+            CleanupStack::PushL( cmd );
+
+            cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
+            cmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId, KMPXMediaIdVideoPlayback );
+
+            cmd->SetTObjectValueL<TInt>( KMPXMediaVideoPlaybackCommand,
+                                         (TMPXVideoPlaybackCommand)aspectRatioCmd );
+
+            iPlaybackPlugin->CommandL( *cmd );
+
+            TInt result = cmd->ValueTObjectL<TInt>( KMPXMediaVideoAspectRatio );
+
+            if ( expectedResult != result )
+            {
+                err = KErrGeneral;
+            }
+
+            CleanupStack::PopAndDestroy( cmd );
+        }
+    }
+
+    return err;
+}
+
+// -----------------------------------------------------------------------------
+//  CVHPPTestClass::AlarmOn
+// -----------------------------------------------------------------------------
+//
+TInt
+CVHPPTestClass::AlarmOn( CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::AlarmOn()"));
+    iLog->Log(_L("CVHPPTestClass::AlarmOn()"));
+
+    TInt backgroundCmd = 0;
+    TInt err = aItem.GetNextInt( backgroundCmd );
+
+    if ( err == KErrNone )
+    {
+        //callback event
+        TCallbackEvent* event = new TCallbackEvent;
+        event->iError = 0;
+        event->iData  = 0;
+        event->iEvent = EPPaused;
+        AddExpectedEvent( event );
+
+        // set alarm status
+        RProperty::Set( KPSUidCoreApplicationUIs, KLightsAlarmLightActive, ELightsBlinking );
+
+        //
+        //  create background Cmd to pass to playback plugin
+        //
+        CMPXCommand* cmdPause = CMPXCommand::NewL();
+        CleanupStack::PushL( cmdPause );
+        cmdPause->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
+        cmdPause->SetTObjectValueL<TInt>( KMPXCommandGeneralId, KMPXMediaIdVideoPlayback );
+        cmdPause->SetTObjectValueL<TInt>( KMPXMediaVideoPlaybackCommand, backgroundCmd );
+        cmdPause->SetTObjectValueL<TBool>( KMPXMediaVideoAppForeground, ETrue );
+        iPlaybackPlugin->CommandL( *cmdPause );
+        CleanupStack::PopAndDestroy( cmdPause );
+
+        //reset alarm
+        RProperty::Set( KPSUidCoreApplicationUIs, KLightsAlarmLightActive, ELightsNotBlinking );
+    }
+
+    return err;
+}
+
+// -----------------------------------------------------------------------------
+//  CVHPPTestClass::PhoneCallRejected
+// -----------------------------------------------------------------------------
+//
+TInt
+CVHPPTestClass::PhoneCallRejected( CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::PhoneCallRejected()"));
+    iLog->Log(_L("CVHPPTestClass::PhoneCallRejected()"));
+
+    TInt background = 0;
+    TInt err = aItem.GetNextInt( background );
+    TCallbackEvent* event = new TCallbackEvent;
+
+    if ( err == KErrNone )
+    {
+        //callback event
+        TCallbackEvent* event = new TCallbackEvent;
+        event->iError = 0;
+        event->iData  = 0;
+        event->iEvent = EPPaused;
+        AddExpectedEvent( event );
+
+        //set phone call as ringing
+        RProperty::Set(KPSUidCtsyCallInformation, KCTsyCallState, EPSCTsyCallStateRinging);
+
+        //pause
+        CreateBackgroundCommand(background);
+
+        err = aItem.GetNextInt( background );
+
+        if ( err == KErrNone )
+        {
+            CreateBackgroundCommand(background);
+        }
+    }
+
+    return err;
+}
+
+// -----------------------------------------------------------------------------
+//  CVHPPTestClass::VoiceCallAccepted
+// -----------------------------------------------------------------------------
+//
+TInt
+CVHPPTestClass::VoiceCallAccepted( CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::VoiceCallAccepted()"));
+    iLog->Log(_L("CVHPPTestClass::VoiceCallAccepted()"));
+
+    TInt background = 0;
+    TInt err = aItem.GetNextInt( background );
+
+    if ( err == KErrNone )
+    {
+        //callback event
+        TCallbackEvent* event = new TCallbackEvent;
+        event->iError = 0;
+        event->iData  = 0;
+        event->iEvent = EPPaused;
+        AddExpectedEvent( event );
+
+        //set phone call as ringing
+        RProperty::Set(KPSUidCtsyCallInformation, KCTsyCallState, EPSCTsyCallStateRinging);
+
+        //pause
+        CreateBackgroundCommand(background);
+
+        err = aItem.GetNextInt( background );
+
+        if ( err == KErrNone )
+        {
+            //set phone call as Connected
+            RProperty::Set(KPSUidCtsyCallInformation, KCTsyCallState, EPSCTsyCallStateConnected);
+
+            CreateBackgroundCommand(background);
+         }
+    }
+
+    return err;
+}
+
+// -----------------------------------------------------------------------------
+//  CVHPPTestClass::VideoCallAccepted
+// -----------------------------------------------------------------------------
+//
+TInt
+CVHPPTestClass::VideoCallAccepted( CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::VideoCallAccepted()"));
+    iLog->Log(_L("CVHPPTestClass::VideoCallAccepted()"));
+
+    TInt background = 0;
+    TInt err = aItem.GetNextInt( background );
+
+    if ( err == KErrNone )
+    {
+        //callback event
+        TCallbackEvent* event = new TCallbackEvent;
+        event->iError = 0;
+        event->iData  = 0;
+        event->iEvent = EPPaused;
+        AddExpectedEvent( event );
+
+        //set phone call as ringing
+        RProperty::Set(KPSUidCtsyCallInformation, KCTsyCallState, EPSCTsyCallStateRinging);
+
+        //pause
+        CreateBackgroundCommand(background);
+
+        err = aItem.GetNextInt( background );
+
+        if ( err == KErrNone )
+        {
+            //set phone call as Connected
+            RProperty::Set(KPSUidCtsyCallInformation, KCTsyCallType, EPSCTsyCallTypeH324Multimedia);
+
+           CreateBackgroundCommand(background);
+        }
+    }
+
+    return err;
+}
+
+// -----------------------------------------------------------------------------
+//  CVHPPTestClass::PlayduringVideoCall
+// -----------------------------------------------------------------------------
+//
+TInt
+CVHPPTestClass::PlayduringVideoCall( CStifItemParser& /*aItem*/ )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::PlayduringVideoCall()"));
+    iLog->Log(_L("CVHPPTestClass::PlayduringVideoCall()"));
+
+    TInt err = 0;
+
+    //set phone call as Connected
+    err = RProperty::Set(KPSUidCtsyCallInformation, KCTsyCallType, EPSCTsyCallTypeH324Multimedia);
+
+    AddErrorEvent(KMPXVideoCallOngoingError);
+
+    return err;
+}
+
+// -----------------------------------------------------------------------------
+//  CVHPPTestClass::PlayduringVoiceCall
+// -----------------------------------------------------------------------------
+//
+TInt
+CVHPPTestClass::PlayduringVoiceCall( CStifItemParser& /*aItem*/ )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::PlayduringVoiceCall()"));
+    iLog->Log(_L("CVHPPTestClass::PlayduringVoiceCall()"));
+
+    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);
+
+    AddErrorEvent(KMPXVideoPlayOver2GDuringVoiceCallError);
+
+    return err;
+}
+
+TInt
+CVHPPTestClass::EndPhoneCall()
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::EndPhoneCall()"));
+    iLog->Log(_L("CVHPPTestClass::EndPhoneCall()"));
+
+    //Disconnect phone call
+    RProperty::Set(KPSUidCtsyCallInformation, KCTsyCallState, EPSCTsyCallStateNone);
+    RProperty::Set(KPSUidCtsyCallInformation, KCTsyCallType, EPSCTsyCallTypeNone);
+
+    return KErrNone;
+}
+
+TInt
+CVHPPTestClass::ConnectTvOutL( CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::ConnectTvOutL()"));
+    iLog->Log(_L("CVHPPTestClass::ConnectTvOutL()"));
+
+    TBool playable = EFalse;
+
+    TInt err = aItem.GetNextInt( playable );
+
+    if ( err == KErrNone )
+    {
+        iAccObserver->SetTvOutPlaybackAllowed( playable );
+
+        //
+        //  Add event for callback
+        //
+        TCallbackEvent* event = new TCallbackEvent;
+
+        event->iEvent = EPbCmdTvOutEvent;
+        event->iData  = ETrue;
+        event->iError = KErrNone;
+
+        AddExpectedEvent( event );
+    }
+
+    iAccObserver->UpdateTvOutStatusL( ETrue );
+
+    return err;
+}
+
+TInt
+CVHPPTestClass::DisconnectTvOutL()
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::DisconnectTvOutL()"));
+    iLog->Log(_L("CVHPPTestClass::DisconnectTvOutL()"));
+
+    //
+    //  Add event for callback
+    //
+    TCallbackEvent* event = new TCallbackEvent;
+
+    event->iEvent = EPbCmdTvOutEvent;
+    event->iData  = EFalse;
+    event->iError = KErrNone;
+
+    AddExpectedEvent( event );
+
+    event = new TCallbackEvent;
+    event->iEvent = EPPaused;
+    event->iData  = 0;
+    event->iError = KErrNone;
+
+    AddExpectedEvent( event );
+
+    iAccObserver->UpdateTvOutStatusL( EFalse );
+
+    return KErrNone;
+}
+
+void
+CVHPPTestClass::CreateBackgroundCommand( TBool aBackground )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::CreateBackgroundCommand()"),
+                   _L("aBackground = %d"), aBackground );
+
+    CMPXCommand* cmd = CMPXCommand::NewL();
+    CleanupStack::PushL( cmd );
+    cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
+    cmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId, KMPXMediaIdVideoPlayback );
+    cmd->SetTObjectValueL<TInt>( KMPXMediaVideoPlaybackCommand, aBackground );
+    cmd->SetTObjectValueL<TBool>( KMPXMediaVideoAppForeground, ETrue );
+    iPlaybackPlugin->CommandL( *cmd );
+    CleanupStack::PopAndDestroy( cmd );
+}
+
+TInt
+CVHPPTestClass::SetTvOutConnectedL( CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::SetTvOutConnectedL()"));
+    iLog->Log(_L("CVHPPTestClass::SetTvOutConnectedL()"));
+
+    TInt allowed = ETrue;
+
+    TInt err = aItem.GetNextInt( allowed );
+
+    if ( err == KErrNone )
+    {
+        iAccObserver->SetTvOutConnected( ETrue );
+        iAccObserver->SetTvOutPlaybackAllowed( allowed );
+    }
+
+    return err;
+}
+
+TInt
+CVHPPTestClass::SetTvOutDisconnectedL()
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::SetTvOutDisconnectedL()"));
+    iLog->Log(_L("CVHPPTestClass::SetTvOutDisconnectedL()"));
+
+    iAccObserver->SetTvOutConnected( EFalse );
+    iAccObserver->SetTvOutPlaybackAllowed( ETrue );
+
+    return KErrNone;
+}
+
+void
+CVHPPTestClass::HandleUtilityEvent( TCallbackEvent* aEvent )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::HandleUtilityEvent"),
+                   _L("(%d, %d, %d)"), aEvent->iEvent, aEvent->iData, aEvent->iError );
+
+    ProcessEvent( aEvent );
+}
+
+void
+CVHPPTestClass::CleanupTempFiles()
+{
+    RFs fs;
+    TInt error = fs.Connect();
+
+    error = fs.Delete( KOpenControllerFilename );
+    error = fs.Delete( KPrepareControllerFilename );
+    error = fs.Delete( KPlaybackCompleteFilename );
+    error = fs.Delete( KDlMgrFile );
+    error = fs.Delete( KDrmRightsFile );
+
+    fs.Close();
+}
+
+TInt
+CVHPPTestClass::SetDrmProtectedL( CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::SetDrmProtectedL()"));
+
+    TBool drmError = EFalse;
+
+    TInt err = aItem.GetNextInt( drmError );
+
+    if ( err == KErrNone )
+    {
+        WriteControllerError( KDrmRightsFile, drmError );
+    }
+
+    return err;
+}
+
+// ----------------------------------------------------------------------------- 
+//  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; 
+    
+    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 ); 
+    
+            //
+            // send command to playback plugin
+            //
+            CreateVideoPlaybackCommandL( aItem, (TMPXVideoPlaybackCommand)command ); 
+        } 
+    }
+    
+    if ( err == KErrNone )
+    {
+        MPX_DEBUG(_L("CVHPPTestClass::HandleVolumeL() leaves with proper error"));
+    }
+    
+    return err; 
+} 
+
+
+TInt
+CVHPPTestClass::InitializeWithPositionL( CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::InitializeL()"));
+    iLog->Log(_L("CVHPPTestClass::InitializeL()"));
+
+    TInt duration;
+    TInt volumeSteps;
+    TInt position;
+    
+    TInt 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 );
+            
+            err = aItem.GetNextInt( position );
+            
+            if (err == KErrNone )
+            {
+                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 );
+                }
+
+            }
+        }
+    }
+
+    return err;
+}
+
+
+TInt
+CVHPPTestClass::InitializeLinkWithPositionL( CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::InitializeLinkL()"));
+    iLog->Log(_L("CVHPPTestClass::InitializeLinkL()"));
+
+    TInt duration;
+    TInt volumeSteps;
+    TInt position;
+    
+    TInt 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 );
+            
+            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 );
+                    }
+                }
+            }
+        }
+    }
+
+    return err;
+}
+
+
+TInt
+CVHPPTestClass::InitializeHandleWithPositionL( CStifItemParser& aItem  )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::InitializeHandleL()"));
+    iLog->Log(_L("CVHPPTestClass::InitializeHandleL()"));
+
+    TInt duration;
+    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
+                //
+                SetVolumeSteps( volumeSteps );
+
+                err = aItem.GetNextInt( position );
+
+                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
+                        //
+                        if ( fileHandle32 )
+                        {
+                            RFile file;
+                            file.Open( fs, fullPath, EFileRead );
+                            iPlaybackPlugin->InitialiseWithPositionL( file, position );
+                            file.Close();
+                        }
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+                        else
+                        {
+                            RFile64 file64;
+                            file64.Open( fs, fullPath, EFileRead );
+                            iPlaybackPlugin->Initialise64L( file64, position );
+                            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;
+}
+
+TInt
+CVHPPTestClass::InitializeStreamingWithSdpFileHandleL( CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::InitializeStreamingWithSdpFileHandleL()"));
+    iLog->Log(_L("CVHPPTestClass::InitializeStreamingWithSdpFileHandleL()"));
+
+    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();
+					}
+    #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();
+					}
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+					
+					fs.Close();
+                }
+            } 
+        } 
+    } 
+    return err;
+}
+
+TInt
+CVHPPTestClass::RetrieveFileNameAndModeL( CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT( _L("CVHPPTestClass::RetrieveFileNameAndModeL()") );
+    iLog->Log( _L("CVHPPTestClass::RetrieveFileNameAndModeL()") );
+
+    TBuf<120>	fullPath;
+    TPtrC		fileName;
+    TInt		err;
+    
+    err = aItem.GetNextString( fileName );
+
+    if ( err == KErrNone )
+    {
+        //
+        //  Build the full path to the file
+        //
+        fullPath.Append( KVideoTestPath );
+        fullPath.Append( fileName );
+        
+        TInt mode;
+        err = aItem.GetNextInt( mode);
+        
+        if ( err == KErrNone )
+        {
+ 			CMPXCommand* cmd = CMPXCommand::NewL();
+			CleanupStack::PushL( cmd );
+	
+			cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
+			cmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId,
+										 KMPXMediaIdVideoPlayback );
+			cmd->SetTObjectValueL<TInt>( KMPXMediaVideoPlaybackCommand, EPbCmdInitView );
+			
+			iPlaybackPlugin->CommandL( *cmd );
+			
+			TPtrC clipName( cmd->ValueText( KMPXMediaVideoPlaybackFileName ) );
+			TMPXVideoMode  playbackMode = (TMPXVideoMode) cmd->ValueTObjectL<TInt>( 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 );
+        }
+    }
+
+    return err;
+}
+
+TInt CVHPPTestClass::StartDefaultConnectionL(  CStifItemParser& aItem  )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::StartDefaultConnectionL()"));
+    iLog->Log(_L("CVHPPTestClass::StartDefaultConnectionL()"));
+    
+    // Everything else is ok except leave
+    MPX_TRAPD(err, MpxVideoConnectionUtility::StartDefaultConnectionL() );
+    
+    return err;
+}
+
+TInt CVHPPTestClass::CheckAccessPointL(  CStifItemParser& aItem  )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::CheckAccessPointL()"));
+    iLog->Log(_L("CVHPPTestClass::CheckAccessPointL()"));
+    
+    TInt err(KErrNone);
+    // TODO tests 
+    TInt retVal(0);
+    // retval should be -1  when called with IapId 13
+    // because iapId 13 is handled as GPRS in stub code
+    retVal = MpxVideoConnectionUtility::CheckAccessPointL( 13 );  // number 2 has implementation is stub side
+    
+    if ( -1 != retVal )
+    {
+        MPX_DEBUG ( _L("ERROR MpxVideoConnectionUtility::CheckAccessPointL() returned: %d"), retVal);
+        err = KErrNotFound;
+    }
+   
+    
+    return err;
+}
+
+//  EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videopdlplaybackviewplugin/data/2001e5a7.rss	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2001 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:  Resource definitions for project mpxvideopdlplaybackviewplugin
+*
+*/
+
+// Version : %version: 4 %
+
+
+
+
+// INCLUDES
+#include <ecom/registryinfo.rh>
+#include <mpxviewplugin.hrh>
+
+#include "mpxvideoplaybackuids.hrh"
+
+// RESOURCE DEFINITIONS 
+
+/**
+ * The opaque_data syntax is made up of three parts: 
+ * a list of Uids for resolving the view plugin, feature flags, priority.
+ * 
+ * <p>uid1;uid2;uid3</p>
+ *  uid*: uid of the supported Playback/Collection plugin.
+ *  E.g. if the view plugin supports Local Playback plugin, the list of
+ *  uids will be: 0x101FFC06
+ *
+ * <t>uid</t>
+ *  uid: plugin type uid.
+ *  E.g. if the view plugin supports playback type, uid will be: 0x101FFCA0
+ *
+ * <f>flags</f> [optional]
+ *  flags: sum of the required feature flags that listed in mpxviewplugin.hrh. 
+ *  E.g. if the view plugin needs to be pre-loaded and it's user-selectable,
+ *  then flags = KMPXVpFeaturePreLoaded + KMPXVpFeatureUserSelectable = 0x0003.
+ *
+ * <i>priority</i> [optional]
+ *  priority: a value of type TMPXViewPluginPriorities. This value determines
+ *  which view plugin will be resolved when several plugins can support the 
+ *  same set of Uids. 
+ *  Default value of this field is EMPXViewPluginPriorityNormal.
+ */
+RESOURCE REGISTRY_INFO theInfo
+    {
+    dll_uid = KMPXVIDEOPDLPLAYBACKVIEWPLUGINUID;
+
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            interface_uid = KMPXViewPluginInterfaceUid;
+            implementations = 
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = KMPXVIDEOPDLPLAYBACKVIEWPLUGINIMPLEMENTATIONUID;
+                    version_no = 1;
+                    display_name = "Video PDL Playback View Plugin";
+                    default_data = "";
+                    opaque_data = "<p>0x10282551</p>"
+                                  "<t>0x101FFCA0</t>"
+                                  "<f>0x0002</f>"
+                                  "<i>"EMPXViewPluginPriorityLowest"</i>";
+                    }
+                };
+            }
+        };
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videopdlplaybackviewplugin/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* 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:  Build information file for project mpxvideoplaybackviewplugin.
+*
+*/
+
+// Version : %version: 5 %
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/mpxvideopdlplaybackviewplugin.iby   CORE_APP_LAYER_IBY_EXPORT_PATH(mpxvideopdlplaybackviewplugin.iby)
+
+PRJ_MMPFILES
+mpxvideopdlplaybackviewplugin.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videopdlplaybackviewplugin/group/mpxvideopdlplaybackviewplugin.mmp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,51 @@
+/*
+* 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 mpxvideoplaybackviewplugin.
+*
+*/
+
+// Version : %version: 6 %
+
+
+#include <data_caging_paths.hrh>
+#include <bldvariant.hrh>
+#include <platform_paths.hrh>
+
+TARGET              mpxvideopdlplaybackviewplugin.dll
+TARGETTYPE          PLUGIN
+UID                 0x10009D8D 0x2001E5A7
+
+CAPABILITY          CAP_ECOM_PLUGIN
+VENDORID            VID_DEFAULT
+
+SOURCEPATH          ../src
+
+SOURCE              mpxvideopdlplaybackviewplugin.cpp 
+SOURCE              mpxvideopdlplaybackviewpluginproxy.cpp
+
+START RESOURCE      ../data/2001e5a7.rss
+TARGET              mpxvideopdlplaybackviewplugin.rsc
+HEADER
+LANGUAGE_IDS 
+END // RESOURCE
+
+USERINCLUDE         ../inc
+USERINCLUDE         ../../inc
+USERINCLUDE         ../../../inc
+
+APP_LAYER_SYSTEMINCLUDE
+
+LIBRARY             euser.lib 
+LIBRARY             mpxviewplugin.lib 
+LIBRARY             mpxvideoplaybackviews.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videopdlplaybackviewplugin/inc/mpxvideopdlplaybackviewplugin.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,63 @@
+/*
+* 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:  MPX Video playback view plugin definition.
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+// This file defines the API for mpxvideopdlplaybackviewplugin.dll
+
+#ifndef __VIDEOPDLPLAYBACKVIEWPLUGIN_H__
+#define __VIDEOPDLPLAYBACKVIEWPLUGIN_H__
+
+//  Include Files
+
+#include <e32base.h>
+#include <e32std.h>
+
+#include <mpxaknviewplugin.h>
+
+//  Constants
+
+
+//  Class Definitions
+
+NONSHARABLE_CLASS( CMPXVideoPdlPlaybackViewPlugin ) : public CMPXAknViewPlugin
+{
+public:
+	static CMPXVideoPdlPlaybackViewPlugin* NewL();
+	static CMPXVideoPdlPlaybackViewPlugin* NewLC();
+	~CMPXVideoPdlPlaybackViewPlugin();
+
+public:
+    /*
+     * From CMPXAknViewPlugin
+     * Construct Avkon view.
+     *
+     * @since S60 v3.0
+     * @return Pointer to a newly created Avkon view.
+     */
+    CAknView* ConstructViewLC();
+
+private: 
+	CMPXVideoPdlPlaybackViewPlugin();
+	void ConstructL();
+};
+
+#endif  // __VIDEOPDLPLAYBACKVIEWPLUGIN_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videopdlplaybackviewplugin/rom/mpxvideopdlplaybackviewplugin.iby	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,27 @@
+/*
+* 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: IBY for mpxvideopdlplaybackviewplugin.dll
+*
+*/
+
+// Version : %version: 2 %
+
+#ifndef __MPXVIDEOPDLPLAYBACKVIEWPLUGIN_IBY__
+#define __MPXVIDEOPDLPLAYBACKVIEWPLUGIN_IBY__
+
+#include <data_caging_paths_for_iby.hrh>
+
+ECOM_PLUGIN( mpxvideopdlplaybackviewplugin.dll, mpxvideopdlplaybackviewplugin.rsc )
+
+#endif // __MPXVIDEOPDLPLAYBACKVIEWPLUGIN_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videopdlplaybackviewplugin/src/mpxvideopdlplaybackviewplugin.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,67 @@
+/*
+* 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:  Implementation of Video Playback view plugin
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+//  Include Files  
+
+#include "mpxvideopdlplaybackview.h"
+#include "mpxvideopdlplaybackviewplugin.h"
+
+//  Member Functions
+
+CMPXVideoPdlPlaybackViewPlugin* CMPXVideoPdlPlaybackViewPlugin::NewLC()
+{
+    CMPXVideoPdlPlaybackViewPlugin* self = new (ELeave) CMPXVideoPdlPlaybackViewPlugin;
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+}
+
+CMPXVideoPdlPlaybackViewPlugin* CMPXVideoPdlPlaybackViewPlugin::NewL()
+{
+    CMPXVideoPdlPlaybackViewPlugin* self = CMPXVideoPdlPlaybackViewPlugin::NewLC();
+    CleanupStack::Pop(self);
+    return self;
+}
+
+CMPXVideoPdlPlaybackViewPlugin::CMPXVideoPdlPlaybackViewPlugin()
+// note, CBase initialises all member variables to zero
+{
+}
+
+void CMPXVideoPdlPlaybackViewPlugin::ConstructL()
+{
+}
+
+CMPXVideoPdlPlaybackViewPlugin::~CMPXVideoPdlPlaybackViewPlugin()
+{
+}
+
+// ---------------------------------------------------------------------------
+// From CMPXAknViewPlugin
+// Construct Avkon view.
+// ---------------------------------------------------------------------------
+//
+CAknView* CMPXVideoPdlPlaybackViewPlugin::ConstructViewLC()
+{
+    return CMPXVideoPdlPlaybackView::NewLC();
+}
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videopdlplaybackviewplugin/src/mpxvideopdlplaybackviewpluginproxy.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,56 @@
+/*
+* 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:  Standard proxy of the ECOM plugin
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+// INCLUDE FILES
+#include <ecom/implementationproxy.h>
+
+#include "mpxvideoplaybackuids.hrh"
+#include "mpxvideopdlplaybackviewplugin.h"
+
+#if ( !defined IMPLEMENTATION_PROXY_ENTRY )
+typedef TAny* TProxyNewLPtr;
+#define IMPLEMENTATION_PROXY_ENTRY( aUid,aFuncPtr ) { { aUid }, ( TProxyNewLPtr )( aFuncPtr ) }
+#endif
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// The list of implementations
+// ---------------------------------------------------------------------------
+//
+const TImplementationProxy ImplementationTable[] = 
+{ 
+    IMPLEMENTATION_PROXY_ENTRY( KMPXVIDEOPDLPLAYBACKVIEWPLUGINIMPLEMENTATIONUID,
+                                CMPXVideoPdlPlaybackViewPlugin::NewL ) 
+};
+
+// ---------------------------------------------------------------------------
+// The proxy of implementations
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount )
+{
+    aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy );
+    return ImplementationTable;
+}
+
+// EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/bwins/mpxvideoplaybackcontrolsu.def	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,8 @@
+EXPORTS
+	??1CMPXVideoPlaybackControlsController@@UAE@XZ @ 1 NONAME ; CMPXVideoPlaybackControlsController::~CMPXVideoPlaybackControlsController(void)
+	?AddFileDetailsL@CMPXVideoPlaybackControlsController@@QAEXPAVCMPXVideoPlaybackViewFileDetails@@@Z @ 2 NONAME ; void CMPXVideoPlaybackControlsController::AddFileDetailsL(class CMPXVideoPlaybackViewFileDetails *)
+	?DoHandlePointerEventL@CMPXVideoPlaybackControl@@QAEXABUTPointerEvent@@@Z @ 3 NONAME ; void CMPXVideoPlaybackControl::DoHandlePointerEventL(struct TPointerEvent const &)
+	?GetBitmap@CMPXVideoPlaybackControlsController@@QAEPAVCEikImage@@W4TMPXVideoPlaybackControls@@@Z @ 4 NONAME ; class CEikImage * CMPXVideoPlaybackControlsController::GetBitmap(enum TMPXVideoPlaybackControls)
+	?HandleEventL@CMPXVideoPlaybackControlsController@@QAEXW4TMPXVideoPlaybackControlCommandIds@@H@Z @ 5 NONAME ; void CMPXVideoPlaybackControlsController::HandleEventL(enum TMPXVideoPlaybackControlCommandIds, int)
+	?NewL@CMPXVideoPlaybackControlsController@@SAPAV1@PAVCMPXVideoPlaybackContainer@@VTRect@@PAVCMPXVideoPlaybackViewFileDetails@@@Z @ 6 NONAME ; class CMPXVideoPlaybackControlsController * CMPXVideoPlaybackControlsController::NewL(class CMPXVideoPlaybackContainer *, class TRect, class CMPXVideoPlaybackViewFileDetails *)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/data/mpxvideoplaybackcontrols.rss	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,242 @@
+/*
+* 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:  Resource definitions for project mpxvideoplaybackcontrols
+*
+*/
+
+// Version : %version: 5 %
+
+
+
+
+// RESOURCE NAME IDENTIFIER
+NAME    MVPC // 4 letter ID
+
+// INCLUDES
+#include <eikon.rh>
+#include <avkon.rh>
+#include <bldvariant.hrh>
+
+#include <avkon.rsg>
+
+#include <avkon.loc>
+#include <mpxvideoplaybackcontrols.loc>
+
+#include <avkon.mbg>
+#include <mpxvideoplaybackcontrols.mbg>
+
+// DATA
+#define KBITMAPPATH "\\resource\\apps\\mpxvideoplaybackcontrols.mbm"
+
+#define KBITMAPFILE_MBM "mpxvideoplaybackcontrols.mbm"
+#define KBITMAPFILE_MIF "mpxvideoplaybackcontrols.mif"
+
+// RESOURCE IDENTIFIER
+RESOURCE RSS_SIGNATURE { }
+
+RESOURCE TBUF 
+{
+    buf = "MPXVideoPlaybackControls";
+}
+
+STRUCT AVKON_BUTTONS
+{
+    STRUCT buttons[];
+}
+
+//--------------------------------------------------------------------------------------------------
+//
+//    r_mpx_video_playback_controls_icons_mbm_file
+//
+//--------------------------------------------------------------------------------------------------
+//
+RESOURCE TBUF r_mpx_video_playback_controls_icons_mbm_file
+{
+    buf = KBITMAPFILE_MBM;
+}
+
+//--------------------------------------------------------------------------------------------------
+//
+//    r_mpx_video_playback_controls_icons_mif_file
+//
+//--------------------------------------------------------------------------------------------------
+//
+RESOURCE TBUF r_mpx_video_playback_controls_icons_mif_file
+{
+    buf = KBITMAPFILE_MIF;
+}
+
+// -------------------------------------------------------------------------------------------------
+//
+//    r_mpx_video_playback_controls_fake_sk_details
+//    Fake Soft Key label: Details
+//
+// -------------------------------------------------------------------------------------------------
+//
+RESOURCE TBUF r_mpx_video_playback_controls_fake_sk_details
+{
+    buf = text_softkey_details;
+}
+
+// -------------------------------------------------------------------------------------------------
+//
+//    r_mpx_video_playback_controls_fake_sk_back
+//    Fake Soft Key label: back
+//
+// -------------------------------------------------------------------------------------------------
+//
+RESOURCE TBUF r_mpx_video_playback_controls_fake_sk_back
+{
+    buf = text_softkey_back;
+}
+
+// -------------------------------------------------------------------------------------------------
+//
+//    r_mpx_loading
+//
+// -------------------------------------------------------------------------------------------------
+//
+RESOURCE TBUF r_mpx_loading
+{
+    buf = qtn_mpx_video_wait_loading;
+}
+
+// -------------------------------------------------------------------------------------------------
+//
+//    r_mpx_live_streaming
+//    live streaming indicator
+//
+// -------------------------------------------------------------------------------------------------
+//
+RESOURCE TBUF r_mpx_live_streaming
+{
+    buf = qtn_mpx_video_live_streaming;
+}
+
+// -------------------------------------------------------------------------------------------------
+//
+//    r_mpx_filename_heading
+//    Filename heading
+//
+// -------------------------------------------------------------------------------------------------
+//
+RESOURCE TBUF r_mpx_filename_heading
+{
+    buf = qtn_mpx_filename_heading;
+}
+
+
+// -------------------------------------------------------------------------------------------------
+//
+//    r_mpx_title_heading
+//    title heading
+//
+// -------------------------------------------------------------------------------------------------
+//
+RESOURCE TBUF r_mpx_title_heading
+{
+    buf = qtn_mpx_title_heading;
+}
+
+
+// -------------------------------------------------------------------------------------------------
+//
+//    r_mpx_artist_heading
+//    artist heading
+//
+// -------------------------------------------------------------------------------------------------
+//
+RESOURCE TBUF r_mpx_artist_heading
+{
+    buf = qtn_mpx_artist_heading;
+}
+
+
+// -------------------------------------------------------------------------------------------------
+//
+//    r_mpx_format_heading
+//    format heading
+//
+// -------------------------------------------------------------------------------------------------
+//
+RESOURCE TBUF r_mpx_format_heading
+{
+    buf = qtn_mpx_format_heading;
+}
+
+
+// -------------------------------------------------------------------------------------------------
+//
+//    r_mpx_resolution_heading
+//    resolution heading
+//
+// -------------------------------------------------------------------------------------------------
+//
+RESOURCE TBUF r_mpx_resolution_heading
+{
+    buf = qtn_mpx_resolution_heading;
+}
+
+
+// -------------------------------------------------------------------------------------------------
+//
+//    r_mpx_duration_heading
+//    duration heading
+//
+// -------------------------------------------------------------------------------------------------
+//
+RESOURCE TBUF r_mpx_duration_heading
+{
+    buf = qtn_mpx_duration_heading;
+}
+
+
+// -------------------------------------------------------------------------------------------------
+//
+//    r_mpx_bitrate_heading
+//    bitrate heading
+//
+// -------------------------------------------------------------------------------------------------
+//
+RESOURCE TBUF r_mpx_bitrate_heading
+{
+    buf = qtn_mpx_bitrate_heading;
+}
+
+// ---------------------------------------------------
+//
+//    r_mpx_bitrate_units
+//
+// ---------------------------------------------------
+//
+RESOURCE TBUF r_mpx_bitrate_units
+    {
+    buf = qtn_mpx_bitrate_kbps;
+    }
+
+// -------------------------------------------------------------------------------------------------
+//
+//    r_mpx_license_heading
+//    license heading
+//
+// -------------------------------------------------------------------------------------------------
+//
+RESOURCE TBUF r_mpx_license_heading
+{
+    buf = qtn_mpx_license_heading;
+}
+
+
+
+// EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/eabi/mpxvideoplaybackcontrolsu.def	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,34 @@
+EXPORTS
+	_ZN24CMPXVideoPlaybackControl21DoHandlePointerEventLERK13TPointerEvent @ 1 NONAME
+	_ZN35CMPXVideoPlaybackControlsController12HandleEventLE34TMPXVideoPlaybackControlCommandIdsi @ 2 NONAME
+	_ZN35CMPXVideoPlaybackControlsController15AddFileDetailsLEP32CMPXVideoPlaybackViewFileDetails @ 3 NONAME
+	_ZN35CMPXVideoPlaybackControlsController4NewLEP26CMPXVideoPlaybackContainer5TRectP32CMPXVideoPlaybackViewFileDetails @ 4 NONAME
+	_ZN35CMPXVideoPlaybackControlsController9GetBitmapE25TMPXVideoPlaybackControls @ 5 NONAME
+	_ZN35CMPXVideoPlaybackControlsControllerD0Ev @ 6 NONAME
+	_ZN35CMPXVideoPlaybackControlsControllerD1Ev @ 7 NONAME
+	_ZN35CMPXVideoPlaybackControlsControllerD2Ev @ 8 NONAME
+	_ZTI23CMPXVideoPlaybackButton @ 9 NONAME ; #<TI>#
+	_ZTI24CMPXVideoPlaybackControl @ 10 NONAME ; #<TI>#
+	_ZTI26CMPXVideoPlaybackButtonBar @ 11 NONAME ; #<TI>#
+	_ZTI26CMPXVideoPlaybackVolumeBar @ 12 NONAME ; #<TI>#
+	_ZTI27CMPXVideoPlaybackControlPdl @ 13 NONAME ; #<TI>#
+	_ZTI28CMPXVideoPlaybackProgressBar @ 14 NONAME ; #<TI>#
+	_ZTI30CMPXVideoPlaybackControlPolicy @ 15 NONAME ; #<TI>#
+	_ZTI32CMPXVideoPlaybackAspectRatioIcon @ 16 NONAME ; #<TI>#
+	_ZTI34CMPXVideoPlaybackBrandingAnimation @ 17 NONAME ; #<TI>#
+	_ZTI35CMPXVideoPlaybackControlsController @ 18 NONAME ; #<TI>#
+	_ZTI37CMPXVideoPlaybackControlConfiguration @ 19 NONAME ; #<TI>#
+	_ZTV23CMPXVideoPlaybackButton @ 20 NONAME ; #<VT>#
+	_ZTV24CMPXVideoPlaybackControl @ 21 NONAME ; #<VT>#
+	_ZTV26CMPXVideoPlaybackButtonBar @ 22 NONAME ; #<VT>#
+	_ZTV26CMPXVideoPlaybackVolumeBar @ 23 NONAME ; #<VT>#
+	_ZTV27CMPXVideoPlaybackControlPdl @ 24 NONAME ; #<VT>#
+	_ZTV28CMPXVideoPlaybackProgressBar @ 25 NONAME ; #<VT>#
+	_ZTV30CMPXVideoPlaybackControlPolicy @ 26 NONAME ; #<VT>#
+	_ZTV32CMPXVideoPlaybackAspectRatioIcon @ 27 NONAME ; #<VT>#
+	_ZTV34CMPXVideoPlaybackBrandingAnimation @ 28 NONAME ; #<VT>#
+	_ZTV35CMPXVideoPlaybackControlsController @ 29 NONAME ; #<VT>#
+	_ZTV37CMPXVideoPlaybackControlConfiguration @ 30 NONAME ; #<VT>#
+	_ZTI35CMPXVideoPlaybackMediaDetailsViewer @ 31 NONAME ; #<TI>#
+	_ZTV35CMPXVideoPlaybackMediaDetailsViewer @ 32 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,60 @@
+/*
+* 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:  Build information file for project mpxvideoplaybackcontrols.
+*
+*/
+
+// Version : %version: 5 %
+
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/mpxvideoplaybackcontrols.iby        CORE_APP_LAYER_IBY_EXPORT_PATH(mpxvideoplaybackcontrols.iby)
+../rom/mpxvideoplaybackcontrolsrsc.iby     LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(mpxvideoplaybackcontrolsrsc.iby)
+../loc/mpxvideoplaybackcontrols.loc        APP_LAYER_LOC_EXPORT_PATH(mpxvideoplaybackcontrols.loc)
+
+icons/qgn_graf_realplayer_splash_01.svg    /epoc32/s60/icons/qgn_graf_realplayer_splash_01.svg
+icons/qgn_graf_realplayer_splash_02.svg    /epoc32/s60/icons/qgn_graf_realplayer_splash_02.svg
+icons/qgn_graf_realplayer_splash_03.svg    /epoc32/s60/icons/qgn_graf_realplayer_splash_03.svg
+icons/qgn_graf_realplayer_splash_04.svg    /epoc32/s60/icons/qgn_graf_realplayer_splash_04.svg
+icons/qgn_graf_realplayer_splash_05.svg    /epoc32/s60/icons/qgn_graf_realplayer_splash_05.svg
+icons/qgn_graf_realplayer_splash_06.svg    /epoc32/s60/icons/qgn_graf_realplayer_splash_06.svg
+icons/qgn_graf_realplayer_splash_07.svg    /epoc32/s60/icons/qgn_graf_realplayer_splash_07.svg
+icons/qgn_graf_realplayer_splash_08.svg    /epoc32/s60/icons/qgn_graf_realplayer_splash_08.svg
+icons/qgn_graf_realplayer_splash_09.svg    /epoc32/s60/icons/qgn_graf_realplayer_splash_09.svg
+icons/qgn_graf_realplayer_splash_10.svg    /epoc32/s60/icons/qgn_graf_realplayer_splash_10.svg
+icons/qgn_graf_realplayer_splash_11.svg    /epoc32/s60/icons/qgn_graf_realplayer_splash_11.svg
+icons/qgn_graf_realplayer_splash_12.svg    /epoc32/s60/icons/qgn_graf_realplayer_splash_12.svg
+icons/qgn_graf_realplayer_splash_13.svg    /epoc32/s60/icons/qgn_graf_realplayer_splash_13.svg
+icons/qgn_graf_realplayer_splash_14.svg    /epoc32/s60/icons/qgn_graf_realplayer_splash_14.svg
+icons/qgn_graf_realplayer_splash_15.svg    /epoc32/s60/icons/qgn_graf_realplayer_splash_15.svg
+icons/qgn_graf_realplayer_splash_16.svg    /epoc32/s60/icons/qgn_graf_realplayer_splash_16.svg
+icons/qgn_graf_realplayer_splash_17.svg    /epoc32/s60/icons/qgn_graf_realplayer_splash_17.svg
+icons/qgn_indi_mp_ratio_orig.svg           /epoc32/s60/icons/qgn_indi_mp_ratio_orig.svg
+icons/qgn_indi_mp_ratio_stretch.svg        /epoc32/s60/icons/qgn_indi_mp_ratio_stretch.svg
+icons/qgn_indi_mp_ratio_zoom.svg           /epoc32/s60/icons/qgn_indi_mp_ratio_zoom.svg
+
+PRJ_MMPFILES
+mpxvideoplaybackcontrols.mmp
+
+PRJ_EXTENSIONS
+START EXTENSION s60/mifconv
+OPTION TARGETFILE mpxvideoplaybackcontrols.mif
+OPTION HEADERFILE mpxvideoplaybackcontrols.mbg
+OPTION SOURCEFILE iconlist.txt
+END
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/group/iconlist.txt	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,60 @@
+-c32,8 qgn_graf_nslider_vertical_top
+-c32,8 qgn_graf_nslider_vertical_middle
+-c32,8 qgn_graf_nslider_vertical_bottom
+-c32,8 qgn_indi_nslider_level_increase
+-c32,8 qgn_indi_nslider_level_decrease
+-c32,8 qgn_indi_nslider_unmuted
+-c32,8 qgn_indi_nslider_muted
+-c32,8 qgn_graf_nslider_vertical_marker
+-c32,8 qgn_graf_nslider_vertical_marker_selected
+-c32,8 qgn_graf_mup2_bar_frame
+-c32,8 qgn_graf_mup2_bar_progress
+-c32,8 qgn_graf_mup2_bar_progress_2
+-c32,8 qgn_graf_nslider_marker
+-c32,8 qgn_graf_nslider_marker_selected
+-c32,8 qgn_graf_startup_21
+-c8,8 qgn_indi_onimage_audio
+-c8,8 qgn_menu_rp
+-c32,8 qgn_prop_image_tb_play2
+-c32,8 qgn_prop_image_tb_pause
+-c32,8 qgn_prop_image_tb_pause_dimmed
+-c32,8 qgn_prop_fusionplayer_tb_next
+-c32,8 qgn_prop_fusionplayer_tb_next_focused
+-c32,8 qgn_prop_fusionplayer_tb_next_dimmed
+-c32,8 qgn_prop_fusionplayer_tb_prev
+-c32,8 qgn_prop_fusionplayer_tb_prev_focused
+-c32,8 qgn_prop_fusionplayer_tb_prev_dimmed
+-c32,8 qgn_graf_ring_wait_01
+-c32,8 qgn_graf_ring_wait_02
+-c32,8 qgn_graf_ring_wait_03
+-c32,8 qgn_graf_ring_wait_04
+-c32,8 qgn_graf_ring_wait_05
+-c32,8 qgn_graf_ring_wait_06
+-c32,8 qgn_graf_ring_wait_07
+-c32,8 qgn_graf_ring_wait_08
+-c32,8 qgn_graf_ring_wait_09
+-c32,8 qgn_graf_ring_wait_10
+-c32,8 qgn_graf_mup_lst_corrupttrack
+-c32,8 qgn_prop_video_corrupted
+-c32,8 qgn_graf_realplayer_splash_01
+-c32,8 qgn_graf_realplayer_splash_02
+-c32,8 qgn_graf_realplayer_splash_03
+-c32,8 qgn_graf_realplayer_splash_04
+-c32,8 qgn_graf_realplayer_splash_05
+-c32,8 qgn_graf_realplayer_splash_06
+-c32,8 qgn_graf_realplayer_splash_07
+-c32,8 qgn_graf_realplayer_splash_08
+-c32,8 qgn_graf_realplayer_splash_09
+-c32,8 qgn_graf_realplayer_splash_10
+-c32,8 qgn_graf_realplayer_splash_11
+-c32,8 qgn_graf_realplayer_splash_12
+-c32,8 qgn_graf_realplayer_splash_13
+-c32,8 qgn_graf_realplayer_splash_14
+-c32,8 qgn_graf_realplayer_splash_15
+-c32,8 qgn_graf_realplayer_splash_16
+-c32,8 qgn_graf_realplayer_splash_17
+-c8,8 qgn_indi_mp_ongoing_interrupt
+-c8,8 qgn_indi_mp_ratio_orig
+-c8,8 qgn_indi_mp_ratio_stretch
+-c8,8 qgn_indi_mp_ratio_zoom
+-c32,8 qgn_graf_back_black
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/group/icons/qgn_graf_realplayer_splash_01.svg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="tiny" height="143px" version="1.1" viewBox="0 0 174 143" width="174px" x="0px" y="0px">
+<g>
+<rect fill="none" height="143" width="174"/>
+<polygon fill="#828282" points="74.024,96.548 74.024,96.548 74.024,87.955 79.305,87.955 79.305,89.406 75.759,89.406    75.759,91.314 78.525,91.314 78.525,92.768 75.759,92.768 75.759,95.096 79.383,95.096 79.383,96.548  "/>
+<path d="M88.227,96.547h-1.641v-3.17c0-0.669-0.035-1.104-0.105-1.301s-0.185-0.35-0.342-0.459   c-0.158-0.109-0.349-0.164-0.57-0.164c-0.285,0-0.54,0.078-0.767,0.234c-0.227,0.151-0.381,0.358-0.465,0.619   c-0.084,0.258-0.126,0.73-0.126,1.428v2.813h-1.64v-6.232h1.53v0.914c0.54-0.69,1.222-1.039,2.042-1.039   c0.361,0,0.692,0.063,0.992,0.195c0.299,0.131,0.525,0.297,0.68,0.5c0.153,0.203,0.264,0.434,0.32,0.69   c0.061,0.257,0.092,0.627,0.092,1.104V96.547L88.227,96.547z" fill="#828282"/>
+<path d="M91.711,92.221h-1.555c0.169-0.611,0.527-1.298,0.939-1.593c0.408-0.294,1.021-0.44,1.834-0.44   c0.732,0,1.279,0.088,1.644,0.265c0.36,0.175,0.614,0.396,0.761,0.659c0.148,0.27,0.223,0.762,0.223,1.476l-0.031,1.92   c0,0.55,0.025,0.95,0.078,1.21c0.057,0.264,0.151,0.537,0.297,0.834h-1.625c-0.043-0.104-0.096-0.266-0.155-0.479   c-0.027-0.096-0.05-0.155-0.062-0.188c-0.283,0.274-0.584,0.479-0.904,0.617c-0.317,0.14-0.66,0.206-1.023,0.206   c-0.645,0-1.146-0.174-1.52-0.521c-0.367-0.348-0.555-0.785-0.555-1.313c0-0.354,0.084-0.662,0.252-0.938   c0.168-0.271,0.403-0.483,0.707-0.631c0.303-0.146,0.74-0.273,1.313-0.384c0.771-0.146,1.305-0.276,1.603-0.401v-0.17   c0-0.322-0.078-0.553-0.236-0.688c-0.153-0.139-0.45-0.206-0.891-0.206c-0.295,0-0.525,0.062-0.688,0.177   C91.945,91.749,91.814,91.925,91.711,92.221 M93.932,93.596c-0.213,0.069-0.549,0.152-1.011,0.25   c-0.459,0.096-0.76,0.19-0.901,0.284c-0.215,0.149-0.324,0.343-0.324,0.575c0,0.229,0.091,0.427,0.264,0.593   c0.174,0.167,0.396,0.25,0.661,0.25c0.298,0,0.583-0.097,0.854-0.291c0.197-0.146,0.332-0.327,0.396-0.54   c0.044-0.14,0.065-0.404,0.065-0.797v-0.324" fill="#828282"/>
+<path d="M99.314,96.547v-8.594h1.641v3.102c0.507-0.578,1.107-0.867,1.802-0.867c0.757,0,1.382,0.275,1.877,0.824   c0.495,0.551,0.742,1.34,0.742,2.369c0,1.064-0.251,1.885-0.757,2.459c-0.504,0.576-1.115,0.863-1.836,0.863   c-0.354,0-0.703-0.092-1.047-0.273c-0.346-0.183-0.646-0.449-0.891-0.797v0.914H99.314 M100.922,93.316   c0,0.646,0.102,1.123,0.307,1.433c0.287,0.438,0.666,0.657,1.145,0.657c0.361,0,0.676-0.155,0.936-0.467   c0.258-0.313,0.387-0.805,0.387-1.476c0-0.712-0.131-1.229-0.391-1.542c-0.261-0.313-0.592-0.473-0.992-0.473   c-0.396,0-0.729,0.15-0.988,0.461C101.055,92.223,100.922,92.689,100.922,93.316" fill="#828282"/>
+<path d="M115.986,94.859h1.744c-0.211,0.602-0.545,1.059-0.998,1.373c-0.455,0.313-1.023,0.472-1.707,0.472   c-1.08,0-1.881-0.354-2.399-1.063c-0.409-0.564-0.614-1.283-0.614-2.146c0-1.033,0.271-1.845,0.809-2.431   c0.539-0.584,1.225-0.877,2.049-0.877c0.926,0,1.652,0.31,2.188,0.918c0.535,0.613,0.791,1.556,0.771,2.815H113.7   c0.012,0.488,0.144,0.868,0.397,1.14c0.252,0.272,0.564,0.408,0.943,0.408c0.257,0,0.477-0.07,0.646-0.212   C115.811,95.165,115.908,95.031,115.986,94.859 M116.184,92.906c-0.012-0.475-0.135-0.836-0.367-1.082   c-0.23-0.248-0.519-0.371-0.854-0.371c-0.357,0-0.654,0.131-0.889,0.391c-0.233,0.262-0.35,0.615-0.346,1.063H116.184   L116.184,92.906" fill="#828282"/>
+<path d="M126.186,96.547h-1.531v-0.914c-0.252,0.355-0.553,0.623-0.896,0.803c-0.344,0.182-0.69,0.271-1.042,0.271   c-0.713,0-1.322-0.289-1.83-0.865c-0.509-0.576-0.763-1.383-0.763-2.416c0-1.057,0.247-1.855,0.743-2.406   c0.492-0.553,1.119-0.824,1.877-0.824c0.693,0,1.295,0.289,1.802,0.867v-3.104h1.642v8.592L126.186,96.547 M121.811,93.316   c0,0.664,0.092,1.146,0.275,1.441c0.268,0.434,0.641,0.646,1.118,0.646c0.38,0,0.704-0.16,0.971-0.483   c0.267-0.321,0.4-0.806,0.4-1.446c0-0.718-0.13-1.23-0.39-1.55c-0.261-0.313-0.588-0.473-0.994-0.473   c-0.396,0-0.721,0.155-0.984,0.467C121.941,92.232,121.811,92.695,121.811,93.316" fill="#828282"/>
+<path d="M107.619,87.954h1.465v6.968c0,0.773,0.23,1.234,0.691,1.383c-0.229,0.43-0.613,0.646-1.16,0.646   c-0.664,0-0.996-0.461-0.996-1.385V87.954L107.619,87.954z" fill="#828282"/>
+<path d="M79.853,70.617c-1.015,0-2.356-0.167-2.356-0.167s-8.336,4.231-9.764,5.073   c-0.02-0.049,1.236-2.258,1.547-3.107c0.063-0.17-0.146-0.447-0.371-0.447c-0.582,0-1.314,0.101-2.509,0.095   c-11.423,0-16.711-5.935-16.711-8.958c0-4.03,6.263-8.743,15.843-8.743c4.238,0,10.453,0.671,13.107,2.34   c0.88-0.174,1.783-0.26,2.673-0.26c1.288,0,2.606,0.196,3.807,0.6l0,0c-6.327-4.967-12.986-6.204-19.587-6.204   c-12.972,0-21.33,5.268-21.33,11.995c0,6.767,10.156,12.78,21.33,12.78c0.688,0.021,1.232,0.121,1.04,0.559   c-0.184,0.417-2.91,4.688-3.744,6.221c-0.243,0.443,0.051,0.73,0.581,0.588l20.527-12.84l0,0   C82.847,70.432,81.506,70.617,79.853,70.617z" fill="#2976BB"/>
+<path d="M60.564,68.814h5.172l1.141-4.441c0.596-2.194,1.689-2.959,3.877-2.959c0.645,0,1.342,0.102,1.937,0.253   l0.994-3.571c-0.498-0.102-0.994-0.153-1.841-0.153c-1.289,0-2.979,0.818-3.875,1.939h-0.05l0.398-1.685h-4.969L60.564,68.814   L60.564,68.814z" fill="#FFFFFF"/>
+<path d="M78.344,62.333c0.417-1.124,1.353-1.787,2.762-1.787c1.406,0,2.084,0.612,2.084,1.43   c0,0.102-0.054,0.253-0.054,0.357H78.344L78.344,62.333 M82.197,65.75c-0.261,0.358-0.935,0.765-2.137,0.765   c-1.667,0-2.188-0.969-2.188-2.091h10.056c0.209-0.663,0.26-1.275,0.26-1.838c0-3.316-3.75-4.645-6.875-4.645   c-3.543,0-8.493,1.581-8.493,6.482c0,2.552,2.034,4.695,7.034,4.695c6.096,0,7.136-2.653,7.501-3.37h-5.157L82.197,65.75" fill="#FFFFFF"/>
+<path d="M93.861,65.801c0-0.816,0.875-1.12,1.75-1.225c0.977-0.051,1.955-0.101,2.828-0.459   c-0.358,1.581-1.078,2.602-2.881,2.602C94.736,66.719,93.861,66.514,93.861,65.801L93.861,65.801 M95.404,61.412   c0.31-0.766,1.082-1.071,2.111-1.071c0.82,0,1.692,0.203,1.692,0.918c0,1.326-2.419,1.123-3.911,1.223   c-4.013,0.206-6.734,0.972-6.734,3.781c0,2.04,2.105,2.856,4.521,2.856c1.545,0,3.352-0.46,4.271-1.327h0.054   c0,0.356,0.052,0.713,0.206,1.021h5.195c-0.207-0.461-0.104-0.103-0.207-0.919c0-0.716,1.696-5.462,1.696-7.146   c0-2.551-4.271-2.807-6.791-2.807c-3.396,0-6.276,0.665-7.103,3.472L95.404,61.412L95.404,61.412" fill="#FFFFFF"/>
+<polygon fill="#FFFFFF" points="104.313,68.815 104.313,68.815 109.523,68.815 113.418,54.217 108.207,54.217  "/>
+<polygon fill="#FFFFFF" points="115.221,66.548 115.221,66.548 114.289,66.548 114.289,68.96 113.516,68.96 113.516,66.548    112.584,66.548 112.584,65.971 115.221,65.971  "/>
+<polygon fill="#FFFFFF" points="119.084,68.96 119.084,68.96 118.313,68.96 118.313,66.958 117.762,68.258 117.229,68.258    116.68,66.958 116.68,68.96 115.943,68.96 115.943,65.971 116.848,65.971 117.516,67.471 118.184,65.971 119.084,65.971  "/>
+</g>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/group/icons/qgn_graf_realplayer_splash_02.svg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="tiny" height="143px" version="1.1" viewBox="0 0 174 143" width="174px" x="0px" y="0px">
+<g>
+<rect fill="none" height="143" width="174"/>
+<polygon fill="#828282" points="74.024,96.548 74.024,96.548 74.024,87.955 79.305,87.955 79.305,89.406 75.759,89.406    75.759,91.314 78.525,91.314 78.525,92.768 75.759,92.768 75.759,95.096 79.383,95.096 79.383,96.548  "/>
+<path d="M88.227,96.547h-1.641v-3.17c0-0.669-0.035-1.104-0.105-1.301s-0.185-0.35-0.342-0.459   c-0.158-0.109-0.349-0.164-0.57-0.164c-0.285,0-0.54,0.078-0.767,0.234c-0.227,0.151-0.381,0.358-0.465,0.619   c-0.084,0.258-0.126,0.73-0.126,1.428v2.813h-1.64v-6.232h1.53v0.914c0.54-0.69,1.222-1.039,2.042-1.039   c0.361,0,0.692,0.063,0.992,0.195c0.299,0.131,0.525,0.297,0.68,0.5c0.153,0.203,0.264,0.434,0.32,0.69   c0.061,0.257,0.092,0.627,0.092,1.104V96.547L88.227,96.547z" fill="#828282"/>
+<path d="M91.711,92.221h-1.555c0.169-0.611,0.527-1.298,0.939-1.593c0.408-0.294,1.021-0.44,1.834-0.44   c0.732,0,1.279,0.088,1.644,0.265c0.36,0.175,0.614,0.396,0.761,0.659c0.148,0.27,0.223,0.762,0.223,1.476l-0.031,1.92   c0,0.55,0.025,0.95,0.078,1.21c0.057,0.264,0.151,0.537,0.297,0.834h-1.625c-0.043-0.104-0.096-0.266-0.155-0.479   c-0.027-0.096-0.05-0.155-0.062-0.188c-0.283,0.274-0.584,0.479-0.904,0.617c-0.317,0.14-0.66,0.206-1.023,0.206   c-0.645,0-1.146-0.174-1.52-0.521c-0.367-0.348-0.555-0.785-0.555-1.313c0-0.354,0.084-0.662,0.252-0.938   c0.168-0.271,0.403-0.483,0.707-0.631c0.303-0.146,0.74-0.273,1.313-0.384c0.771-0.146,1.305-0.276,1.603-0.401v-0.17   c0-0.322-0.078-0.553-0.236-0.688c-0.153-0.139-0.45-0.206-0.891-0.206c-0.295,0-0.525,0.062-0.688,0.177   C91.945,91.749,91.814,91.925,91.711,92.221 M93.932,93.596c-0.213,0.069-0.549,0.152-1.011,0.25   c-0.459,0.096-0.76,0.19-0.901,0.284c-0.215,0.149-0.324,0.343-0.324,0.575c0,0.229,0.091,0.427,0.264,0.593   c0.174,0.167,0.396,0.25,0.661,0.25c0.298,0,0.583-0.097,0.854-0.291c0.197-0.146,0.332-0.327,0.396-0.54   c0.044-0.14,0.065-0.404,0.065-0.797v-0.324" fill="#828282"/>
+<path d="M99.314,96.547v-8.594h1.641v3.102c0.507-0.578,1.107-0.867,1.802-0.867c0.757,0,1.382,0.275,1.877,0.824   c0.495,0.551,0.742,1.34,0.742,2.369c0,1.064-0.251,1.885-0.757,2.459c-0.504,0.576-1.115,0.863-1.836,0.863   c-0.354,0-0.703-0.092-1.047-0.273c-0.346-0.183-0.646-0.449-0.891-0.797v0.914H99.314 M100.922,93.316   c0,0.646,0.102,1.123,0.307,1.433c0.287,0.438,0.666,0.657,1.145,0.657c0.361,0,0.676-0.155,0.936-0.467   c0.258-0.313,0.387-0.805,0.387-1.476c0-0.712-0.131-1.229-0.391-1.542c-0.261-0.313-0.592-0.473-0.992-0.473   c-0.396,0-0.729,0.15-0.988,0.461C101.055,92.223,100.922,92.689,100.922,93.316" fill="#828282"/>
+<path d="M115.986,94.859h1.744c-0.211,0.602-0.545,1.059-0.998,1.373c-0.455,0.313-1.023,0.472-1.707,0.472   c-1.08,0-1.881-0.354-2.399-1.063c-0.409-0.564-0.614-1.283-0.614-2.146c0-1.033,0.271-1.845,0.809-2.431   c0.539-0.584,1.225-0.877,2.049-0.877c0.926,0,1.652,0.31,2.188,0.918c0.535,0.613,0.791,1.556,0.771,2.815H113.7   c0.012,0.488,0.144,0.868,0.397,1.14c0.252,0.272,0.564,0.408,0.943,0.408c0.257,0,0.477-0.07,0.646-0.212   C115.811,95.165,115.908,95.031,115.986,94.859 M116.184,92.906c-0.012-0.475-0.135-0.836-0.367-1.082   c-0.23-0.248-0.519-0.371-0.854-0.371c-0.357,0-0.654,0.131-0.889,0.391c-0.233,0.262-0.35,0.615-0.346,1.063H116.184   L116.184,92.906" fill="#828282"/>
+<path d="M126.186,96.547h-1.531v-0.914c-0.252,0.355-0.553,0.623-0.896,0.803c-0.344,0.182-0.69,0.271-1.042,0.271   c-0.713,0-1.322-0.289-1.83-0.865c-0.509-0.576-0.763-1.383-0.763-2.416c0-1.057,0.247-1.855,0.743-2.406   c0.492-0.553,1.119-0.824,1.877-0.824c0.693,0,1.295,0.289,1.802,0.867v-3.104h1.642v8.592L126.186,96.547 M121.811,93.316   c0,0.664,0.092,1.146,0.275,1.441c0.268,0.434,0.641,0.646,1.118,0.646c0.38,0,0.704-0.16,0.971-0.483   c0.267-0.321,0.4-0.806,0.4-1.446c0-0.718-0.13-1.23-0.39-1.55c-0.261-0.313-0.588-0.473-0.994-0.473   c-0.396,0-0.721,0.155-0.984,0.467C121.941,92.232,121.811,92.695,121.811,93.316" fill="#828282"/>
+<path d="M107.619,87.954h1.465v6.968c0,0.773,0.23,1.234,0.691,1.383c-0.229,0.43-0.613,0.646-1.16,0.646   c-0.664,0-0.996-0.461-0.996-1.385V87.954L107.619,87.954z" fill="#828282"/>
+<path d="M79.853,70.617c-1.015,0-2.356-0.167-2.356-0.167s-8.336,4.231-9.764,5.073   c-0.02-0.049,1.236-2.258,1.547-3.107c0.063-0.17-0.146-0.447-0.371-0.447c-0.582,0-1.314,0.101-2.509,0.095   c-11.423,0-16.711-5.935-16.711-8.958c0-4.03,6.263-8.743,15.843-8.743c4.238,0,10.453,0.671,13.107,2.34   c0.88-0.174,1.783-0.26,2.673-0.26c1.288,0,2.606,0.196,3.807,0.6l0,0c-6.327-4.967-12.986-6.204-19.587-6.204   c-12.972,0-21.33,5.268-21.33,11.995c0,6.767,10.156,12.78,21.33,12.78c0.688,0.021,1.232,0.121,1.04,0.559   c-0.184,0.417-2.91,4.688-3.744,6.221c-0.243,0.443,0.051,0.73,0.581,0.588l20.527-12.84l0,0   C82.847,70.432,81.506,70.617,79.853,70.617z" fill="#2976BB"/>
+<path d="M60.564,68.814h5.172l1.141-4.441c0.596-2.194,1.689-2.959,3.877-2.959c0.645,0,1.342,0.102,1.937,0.253   l0.994-3.571c-0.498-0.102-0.994-0.153-1.841-0.153c-1.289,0-2.979,0.818-3.875,1.939h-0.05l0.398-1.685h-4.969L60.564,68.814   L60.564,68.814z" fill="#FFFFFF"/>
+<path d="M78.344,62.333c0.417-1.124,1.353-1.787,2.762-1.787c1.406,0,2.084,0.612,2.084,1.43   c0,0.102-0.054,0.253-0.054,0.357H78.344L78.344,62.333 M82.197,65.75c-0.261,0.358-0.935,0.765-2.137,0.765   c-1.667,0-2.188-0.969-2.188-2.091h10.056c0.209-0.663,0.26-1.275,0.26-1.838c0-3.316-3.75-4.645-6.875-4.645   c-3.543,0-8.493,1.581-8.493,6.482c0,2.552,2.034,4.695,7.034,4.695c6.096,0,7.136-2.653,7.501-3.37h-5.157L82.197,65.75" fill="#FFFFFF"/>
+<path d="M93.861,65.801c0-0.816,0.875-1.12,1.75-1.225c0.977-0.051,1.955-0.101,2.828-0.459   c-0.358,1.581-1.078,2.602-2.881,2.602C94.736,66.719,93.861,66.514,93.861,65.801L93.861,65.801 M95.404,61.412   c0.31-0.766,1.082-1.071,2.111-1.071c0.82,0,1.692,0.203,1.692,0.918c0,1.326-2.419,1.123-3.911,1.223   c-4.013,0.206-6.734,0.972-6.734,3.781c0,2.04,2.105,2.856,4.521,2.856c1.545,0,3.352-0.46,4.271-1.327h0.054   c0,0.356,0.052,0.713,0.206,1.021h5.195c-0.207-0.461-0.104-0.103-0.207-0.919c0-0.716,1.696-5.462,1.696-7.146   c0-2.551-4.271-2.807-6.791-2.807c-3.396,0-6.276,0.665-7.103,3.472L95.404,61.412L95.404,61.412" fill="#FFFFFF"/>
+<polygon fill="#FFFFFF" points="104.313,68.815 104.313,68.815 109.523,68.815 113.418,54.217 108.207,54.217  "/>
+<polygon fill="#FFFFFF" points="115.221,66.548 115.221,66.548 114.289,66.548 114.289,68.96 113.516,68.96 113.516,66.548    112.584,66.548 112.584,65.971 115.221,65.971  "/>
+<polygon fill="#FFFFFF" points="119.084,68.96 119.084,68.96 118.313,68.96 118.313,66.958 117.762,68.258 117.229,68.258    116.68,66.958 116.68,68.96 115.943,68.96 115.943,65.971 116.848,65.971 117.516,67.471 118.184,65.971 119.084,65.971  "/>
+<rect fill="#99CCCC" height="16" width="3.496" x="85.231" y="2.39"/>
+</g>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/group/icons/qgn_graf_realplayer_splash_03.svg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="tiny" height="143px" version="1.1" viewBox="0 0 174 143" width="174px" x="0px" y="0px">
+<g>
+<rect fill="none" height="143" width="174"/>
+<polygon fill="#828282" points="74.024,96.548 74.024,96.548 74.024,87.955 79.305,87.955 79.305,89.406 75.759,89.406    75.759,91.314 78.525,91.314 78.525,92.768 75.759,92.768 75.759,95.096 79.383,95.096 79.383,96.548  "/>
+<path d="M88.227,96.547h-1.641v-3.17c0-0.669-0.035-1.104-0.105-1.301s-0.185-0.35-0.342-0.459   c-0.158-0.109-0.349-0.164-0.57-0.164c-0.285,0-0.54,0.078-0.767,0.234c-0.227,0.151-0.381,0.358-0.465,0.619   c-0.084,0.258-0.126,0.73-0.126,1.428v2.813h-1.64v-6.232h1.53v0.914c0.54-0.69,1.222-1.039,2.042-1.039   c0.361,0,0.692,0.063,0.992,0.195c0.299,0.131,0.525,0.297,0.68,0.5c0.153,0.203,0.264,0.434,0.32,0.69   c0.061,0.257,0.092,0.627,0.092,1.104V96.547L88.227,96.547z" fill="#828282"/>
+<path d="M91.711,92.221h-1.555c0.169-0.611,0.527-1.298,0.939-1.593c0.408-0.294,1.021-0.44,1.834-0.44   c0.732,0,1.279,0.088,1.644,0.265c0.36,0.175,0.614,0.396,0.761,0.659c0.148,0.27,0.223,0.762,0.223,1.476l-0.031,1.92   c0,0.55,0.025,0.95,0.078,1.21c0.057,0.264,0.151,0.537,0.297,0.834h-1.625c-0.043-0.104-0.096-0.266-0.155-0.479   c-0.027-0.096-0.05-0.155-0.062-0.188c-0.283,0.274-0.584,0.479-0.904,0.617c-0.317,0.14-0.66,0.206-1.023,0.206   c-0.645,0-1.146-0.174-1.52-0.521c-0.367-0.348-0.555-0.785-0.555-1.313c0-0.354,0.084-0.662,0.252-0.938   c0.168-0.271,0.403-0.483,0.707-0.631c0.303-0.146,0.74-0.273,1.313-0.384c0.771-0.146,1.305-0.276,1.603-0.401v-0.17   c0-0.322-0.078-0.553-0.236-0.688c-0.153-0.139-0.45-0.206-0.891-0.206c-0.295,0-0.525,0.062-0.688,0.177   C91.945,91.749,91.814,91.925,91.711,92.221 M93.932,93.596c-0.213,0.069-0.549,0.152-1.011,0.25   c-0.459,0.096-0.76,0.19-0.901,0.284c-0.215,0.149-0.324,0.343-0.324,0.575c0,0.229,0.091,0.427,0.264,0.593   c0.174,0.167,0.396,0.25,0.661,0.25c0.298,0,0.583-0.097,0.854-0.291c0.197-0.146,0.332-0.327,0.396-0.54   c0.044-0.14,0.065-0.404,0.065-0.797v-0.324" fill="#828282"/>
+<path d="M99.314,96.547v-8.594h1.641v3.102c0.507-0.578,1.107-0.867,1.802-0.867c0.757,0,1.382,0.275,1.877,0.824   c0.495,0.551,0.742,1.34,0.742,2.369c0,1.064-0.251,1.885-0.757,2.459c-0.504,0.576-1.115,0.863-1.836,0.863   c-0.354,0-0.703-0.092-1.047-0.273c-0.346-0.183-0.646-0.449-0.891-0.797v0.914H99.314 M100.922,93.316   c0,0.646,0.102,1.123,0.307,1.433c0.287,0.438,0.666,0.657,1.145,0.657c0.361,0,0.676-0.155,0.936-0.467   c0.258-0.313,0.387-0.805,0.387-1.476c0-0.712-0.131-1.229-0.391-1.542c-0.261-0.313-0.592-0.473-0.992-0.473   c-0.396,0-0.729,0.15-0.988,0.461C101.055,92.223,100.922,92.689,100.922,93.316" fill="#828282"/>
+<path d="M115.986,94.859h1.744c-0.211,0.602-0.545,1.059-0.998,1.373c-0.455,0.313-1.023,0.472-1.707,0.472   c-1.08,0-1.881-0.354-2.399-1.063c-0.409-0.564-0.614-1.283-0.614-2.146c0-1.033,0.271-1.845,0.809-2.431   c0.539-0.584,1.225-0.877,2.049-0.877c0.926,0,1.652,0.31,2.188,0.918c0.535,0.613,0.791,1.556,0.771,2.815H113.7   c0.012,0.488,0.144,0.868,0.397,1.14c0.252,0.272,0.564,0.408,0.943,0.408c0.257,0,0.477-0.07,0.646-0.212   C115.811,95.165,115.908,95.031,115.986,94.859 M116.184,92.906c-0.012-0.475-0.135-0.836-0.367-1.082   c-0.23-0.248-0.519-0.371-0.854-0.371c-0.357,0-0.654,0.131-0.889,0.391c-0.233,0.262-0.35,0.615-0.346,1.063H116.184   L116.184,92.906" fill="#828282"/>
+<path d="M126.186,96.547h-1.531v-0.914c-0.252,0.355-0.553,0.623-0.896,0.803c-0.344,0.182-0.69,0.271-1.042,0.271   c-0.713,0-1.322-0.289-1.83-0.865c-0.509-0.576-0.763-1.383-0.763-2.416c0-1.057,0.247-1.855,0.743-2.406   c0.492-0.553,1.119-0.824,1.877-0.824c0.693,0,1.295,0.289,1.802,0.867v-3.104h1.642v8.592L126.186,96.547 M121.811,93.316   c0,0.664,0.092,1.146,0.275,1.441c0.268,0.434,0.641,0.646,1.118,0.646c0.38,0,0.704-0.16,0.971-0.483   c0.267-0.321,0.4-0.806,0.4-1.446c0-0.718-0.13-1.23-0.39-1.55c-0.261-0.313-0.588-0.473-0.994-0.473   c-0.396,0-0.721,0.155-0.984,0.467C121.941,92.232,121.811,92.695,121.811,93.316" fill="#828282"/>
+<path d="M107.619,87.954h1.465v6.968c0,0.773,0.23,1.234,0.691,1.383c-0.229,0.43-0.613,0.646-1.16,0.646   c-0.664,0-0.996-0.461-0.996-1.385V87.954L107.619,87.954z" fill="#828282"/>
+<path d="M79.853,70.617c-1.015,0-2.356-0.167-2.356-0.167s-8.336,4.231-9.764,5.073   c-0.02-0.049,1.236-2.258,1.547-3.107c0.063-0.17-0.146-0.447-0.371-0.447c-0.582,0-1.314,0.101-2.509,0.095   c-11.423,0-16.711-5.935-16.711-8.958c0-4.03,6.263-8.743,15.843-8.743c4.238,0,10.453,0.671,13.107,2.34   c0.88-0.174,1.783-0.26,2.673-0.26c1.288,0,2.606,0.196,3.807,0.6l0,0c-6.327-4.967-12.986-6.204-19.587-6.204   c-12.972,0-21.33,5.268-21.33,11.995c0,6.767,10.156,12.78,21.33,12.78c0.688,0.021,1.232,0.121,1.04,0.559   c-0.184,0.417-2.91,4.688-3.744,6.221c-0.243,0.443,0.051,0.73,0.581,0.588l20.527-12.84l0,0   C82.847,70.432,81.506,70.617,79.853,70.617z" fill="#2976BB"/>
+<path d="M60.564,68.814h5.172l1.141-4.441c0.596-2.194,1.689-2.959,3.877-2.959c0.645,0,1.342,0.102,1.937,0.253   l0.994-3.571c-0.498-0.102-0.994-0.153-1.841-0.153c-1.289,0-2.979,0.818-3.875,1.939h-0.05l0.398-1.685h-4.969L60.564,68.814   L60.564,68.814z" fill="#FFFFFF"/>
+<path d="M78.344,62.333c0.417-1.124,1.353-1.787,2.762-1.787c1.406,0,2.084,0.612,2.084,1.43   c0,0.102-0.054,0.253-0.054,0.357H78.344L78.344,62.333 M82.197,65.75c-0.261,0.358-0.935,0.765-2.137,0.765   c-1.667,0-2.188-0.969-2.188-2.091h10.056c0.209-0.663,0.26-1.275,0.26-1.838c0-3.316-3.75-4.645-6.875-4.645   c-3.543,0-8.493,1.581-8.493,6.482c0,2.552,2.034,4.695,7.034,4.695c6.096,0,7.136-2.653,7.501-3.37h-5.157L82.197,65.75" fill="#FFFFFF"/>
+<path d="M93.861,65.801c0-0.816,0.875-1.12,1.75-1.225c0.977-0.051,1.955-0.101,2.828-0.459   c-0.358,1.581-1.078,2.602-2.881,2.602C94.736,66.719,93.861,66.514,93.861,65.801L93.861,65.801 M95.404,61.412   c0.31-0.766,1.082-1.071,2.111-1.071c0.82,0,1.692,0.203,1.692,0.918c0,1.326-2.419,1.123-3.911,1.223   c-4.013,0.206-6.734,0.972-6.734,3.781c0,2.04,2.105,2.856,4.521,2.856c1.545,0,3.352-0.46,4.271-1.327h0.054   c0,0.356,0.052,0.713,0.206,1.021h5.195c-0.207-0.461-0.104-0.103-0.207-0.919c0-0.716,1.696-5.462,1.696-7.146   c0-2.551-4.271-2.807-6.791-2.807c-3.396,0-6.276,0.665-7.103,3.472L95.404,61.412L95.404,61.412" fill="#FFFFFF"/>
+<polygon fill="#FFFFFF" points="104.313,68.815 104.313,68.815 109.523,68.815 113.418,54.217 108.207,54.217  "/>
+<polygon fill="#FFFFFF" points="115.221,66.548 115.221,66.548 114.289,66.548 114.289,68.96 113.516,68.96 113.516,66.548    112.584,66.548 112.584,65.971 115.221,65.971  "/>
+<polygon fill="#FFFFFF" points="119.084,68.96 119.084,68.96 118.313,68.96 118.313,66.958 117.762,68.258 117.229,68.258    116.68,66.958 116.68,68.96 115.943,68.96 115.943,65.971 116.848,65.971 117.516,67.471 118.184,65.971 119.084,65.971  "/>
+<rect fill="#99CCCC" height="16" width="3.496" x="85.231" y="2.39"/>
+<rect fill="#99CCCC" height="15.988" transform="matrix(-0.9241 -0.3821 0.3821 -0.9241 205.8219 70.7539)" width="3.494" x="108.19" y="6.946"/>
+</g>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/group/icons/qgn_graf_realplayer_splash_04.svg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="tiny" height="143px" version="1.1" viewBox="0 0 174 143" width="174px" x="0px" y="0px">
+<g>
+<rect fill="none" height="143" width="174"/>
+<polygon fill="#828282" points="74.024,96.548 74.024,96.548 74.024,87.955 79.305,87.955 79.305,89.406 75.759,89.406    75.759,91.314 78.525,91.314 78.525,92.768 75.759,92.768 75.759,95.096 79.383,95.096 79.383,96.548  "/>
+<path d="M88.227,96.547h-1.641v-3.17c0-0.669-0.035-1.104-0.105-1.301s-0.185-0.35-0.342-0.459   c-0.158-0.109-0.349-0.164-0.57-0.164c-0.285,0-0.54,0.078-0.767,0.234c-0.227,0.151-0.381,0.358-0.465,0.619   c-0.084,0.258-0.126,0.73-0.126,1.428v2.813h-1.64v-6.232h1.53v0.914c0.54-0.69,1.222-1.039,2.042-1.039   c0.361,0,0.692,0.063,0.992,0.195c0.299,0.131,0.525,0.297,0.68,0.5c0.153,0.203,0.264,0.434,0.32,0.69   c0.061,0.257,0.092,0.627,0.092,1.104V96.547L88.227,96.547z" fill="#828282"/>
+<path d="M91.711,92.221h-1.555c0.169-0.611,0.527-1.298,0.939-1.593c0.408-0.294,1.021-0.44,1.834-0.44   c0.732,0,1.279,0.088,1.644,0.265c0.36,0.175,0.614,0.396,0.761,0.659c0.148,0.27,0.223,0.762,0.223,1.476l-0.031,1.92   c0,0.55,0.025,0.95,0.078,1.21c0.057,0.264,0.151,0.537,0.297,0.834h-1.625c-0.043-0.104-0.096-0.266-0.155-0.479   c-0.027-0.096-0.05-0.155-0.062-0.188c-0.283,0.274-0.584,0.479-0.904,0.617c-0.317,0.14-0.66,0.206-1.023,0.206   c-0.645,0-1.146-0.174-1.52-0.521c-0.367-0.348-0.555-0.785-0.555-1.313c0-0.354,0.084-0.662,0.252-0.938   c0.168-0.271,0.403-0.483,0.707-0.631c0.303-0.146,0.74-0.273,1.313-0.384c0.771-0.146,1.305-0.276,1.603-0.401v-0.17   c0-0.322-0.078-0.553-0.236-0.688c-0.153-0.139-0.45-0.206-0.891-0.206c-0.295,0-0.525,0.062-0.688,0.177   C91.945,91.749,91.814,91.925,91.711,92.221 M93.932,93.596c-0.213,0.069-0.549,0.152-1.011,0.25   c-0.459,0.096-0.76,0.19-0.901,0.284c-0.215,0.149-0.324,0.343-0.324,0.575c0,0.229,0.091,0.427,0.264,0.593   c0.174,0.167,0.396,0.25,0.661,0.25c0.298,0,0.583-0.097,0.854-0.291c0.197-0.146,0.332-0.327,0.396-0.54   c0.044-0.14,0.065-0.404,0.065-0.797v-0.324" fill="#828282"/>
+<path d="M99.314,96.547v-8.594h1.641v3.102c0.507-0.578,1.107-0.867,1.802-0.867c0.757,0,1.382,0.275,1.877,0.824   c0.495,0.551,0.742,1.34,0.742,2.369c0,1.064-0.251,1.885-0.757,2.459c-0.504,0.576-1.115,0.863-1.836,0.863   c-0.354,0-0.703-0.092-1.047-0.273c-0.346-0.183-0.646-0.449-0.891-0.797v0.914H99.314 M100.922,93.316   c0,0.646,0.102,1.123,0.307,1.433c0.287,0.438,0.666,0.657,1.145,0.657c0.361,0,0.676-0.155,0.936-0.467   c0.258-0.313,0.387-0.805,0.387-1.476c0-0.712-0.131-1.229-0.391-1.542c-0.261-0.313-0.592-0.473-0.992-0.473   c-0.396,0-0.729,0.15-0.988,0.461C101.055,92.223,100.922,92.689,100.922,93.316" fill="#828282"/>
+<path d="M115.986,94.859h1.744c-0.211,0.602-0.545,1.059-0.998,1.373c-0.455,0.313-1.023,0.472-1.707,0.472   c-1.08,0-1.881-0.354-2.399-1.063c-0.409-0.564-0.614-1.283-0.614-2.146c0-1.033,0.271-1.845,0.809-2.431   c0.539-0.584,1.225-0.877,2.049-0.877c0.926,0,1.652,0.31,2.188,0.918c0.535,0.613,0.791,1.556,0.771,2.815H113.7   c0.012,0.488,0.144,0.868,0.397,1.14c0.252,0.272,0.564,0.408,0.943,0.408c0.257,0,0.477-0.07,0.646-0.212   C115.811,95.165,115.908,95.031,115.986,94.859 M116.184,92.906c-0.012-0.475-0.135-0.836-0.367-1.082   c-0.23-0.248-0.519-0.371-0.854-0.371c-0.357,0-0.654,0.131-0.889,0.391c-0.233,0.262-0.35,0.615-0.346,1.063H116.184   L116.184,92.906" fill="#828282"/>
+<path d="M126.186,96.547h-1.531v-0.914c-0.252,0.355-0.553,0.623-0.896,0.803c-0.344,0.182-0.69,0.271-1.042,0.271   c-0.713,0-1.322-0.289-1.83-0.865c-0.509-0.576-0.763-1.383-0.763-2.416c0-1.057,0.247-1.855,0.743-2.406   c0.492-0.553,1.119-0.824,1.877-0.824c0.693,0,1.295,0.289,1.802,0.867v-3.104h1.642v8.592L126.186,96.547 M121.811,93.316   c0,0.664,0.092,1.146,0.275,1.441c0.268,0.434,0.641,0.646,1.118,0.646c0.38,0,0.704-0.16,0.971-0.483   c0.267-0.321,0.4-0.806,0.4-1.446c0-0.718-0.13-1.23-0.39-1.55c-0.261-0.313-0.588-0.473-0.994-0.473   c-0.396,0-0.721,0.155-0.984,0.467C121.941,92.232,121.811,92.695,121.811,93.316" fill="#828282"/>
+<path d="M107.619,87.954h1.465v6.968c0,0.773,0.23,1.234,0.691,1.383c-0.229,0.43-0.613,0.646-1.16,0.646   c-0.664,0-0.996-0.461-0.996-1.385V87.954L107.619,87.954z" fill="#828282"/>
+<path d="M79.853,70.617c-1.015,0-2.356-0.167-2.356-0.167s-8.336,4.231-9.764,5.073   c-0.02-0.049,1.236-2.258,1.547-3.107c0.063-0.17-0.146-0.447-0.371-0.447c-0.582,0-1.314,0.101-2.509,0.095   c-11.423,0-16.711-5.935-16.711-8.958c0-4.03,6.263-8.743,15.843-8.743c4.238,0,10.453,0.671,13.107,2.34   c0.88-0.174,1.783-0.26,2.673-0.26c1.288,0,2.606,0.196,3.807,0.6l0,0c-6.327-4.967-12.986-6.204-19.587-6.204   c-12.972,0-21.33,5.268-21.33,11.995c0,6.767,10.156,12.78,21.33,12.78c0.688,0.021,1.232,0.121,1.04,0.559   c-0.184,0.417-2.91,4.688-3.744,6.221c-0.243,0.443,0.051,0.73,0.581,0.588l20.527-12.84l0,0   C82.847,70.432,81.506,70.617,79.853,70.617z" fill="#2976BB"/>
+<path d="M60.564,68.814h5.172l1.141-4.441c0.596-2.194,1.689-2.959,3.877-2.959c0.645,0,1.342,0.102,1.937,0.253   l0.994-3.571c-0.498-0.102-0.994-0.153-1.841-0.153c-1.289,0-2.979,0.818-3.875,1.939h-0.05l0.398-1.685h-4.969L60.564,68.814   L60.564,68.814z" fill="#FFFFFF"/>
+<path d="M78.344,62.333c0.417-1.124,1.353-1.787,2.762-1.787c1.406,0,2.084,0.612,2.084,1.43   c0,0.102-0.054,0.253-0.054,0.357H78.344L78.344,62.333 M82.197,65.75c-0.261,0.358-0.935,0.765-2.137,0.765   c-1.667,0-2.188-0.969-2.188-2.091h10.056c0.209-0.663,0.26-1.275,0.26-1.838c0-3.316-3.75-4.645-6.875-4.645   c-3.543,0-8.493,1.581-8.493,6.482c0,2.552,2.034,4.695,7.034,4.695c6.096,0,7.136-2.653,7.501-3.37h-5.157L82.197,65.75" fill="#FFFFFF"/>
+<path d="M93.861,65.801c0-0.816,0.875-1.12,1.75-1.225c0.977-0.051,1.955-0.101,2.828-0.459   c-0.358,1.581-1.078,2.602-2.881,2.602C94.736,66.719,93.861,66.514,93.861,65.801L93.861,65.801 M95.404,61.412   c0.31-0.766,1.082-1.071,2.111-1.071c0.82,0,1.692,0.203,1.692,0.918c0,1.326-2.419,1.123-3.911,1.223   c-4.013,0.206-6.734,0.972-6.734,3.781c0,2.04,2.105,2.856,4.521,2.856c1.545,0,3.352-0.46,4.271-1.327h0.054   c0,0.356,0.052,0.713,0.206,1.021h5.195c-0.207-0.461-0.104-0.103-0.207-0.919c0-0.716,1.696-5.462,1.696-7.146   c0-2.551-4.271-2.807-6.791-2.807c-3.396,0-6.276,0.665-7.103,3.472L95.404,61.412L95.404,61.412" fill="#FFFFFF"/>
+<polygon fill="#FFFFFF" points="104.313,68.815 104.313,68.815 109.523,68.815 113.418,54.217 108.207,54.217  "/>
+<polygon fill="#FFFFFF" points="115.221,66.548 115.221,66.548 114.289,66.548 114.289,68.96 113.516,68.96 113.516,66.548    112.584,66.548 112.584,65.971 115.221,65.971  "/>
+<polygon fill="#FFFFFF" points="119.084,68.96 119.084,68.96 118.313,68.96 118.313,66.958 117.762,68.258 117.229,68.258    116.68,66.958 116.68,68.96 115.943,68.96 115.943,65.971 116.848,65.971 117.516,67.471 118.184,65.971 119.084,65.971  "/>
+<rect fill="#99CCCC" height="16" width="3.496" x="85.231" y="2.39"/>
+<rect fill="#99CCCC" height="15.988" transform="matrix(-0.9241 -0.3821 0.3821 -0.9241 205.8219 70.7539)" width="3.494" x="108.19" y="6.946"/>
+<rect fill="#99CCCC" height="15.998" transform="matrix(0.7072 0.707 -0.707 0.7072 57.6263 -83.3022)" width="3.494" x="127.635" y="19.921"/>
+</g>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/group/icons/qgn_graf_realplayer_splash_05.svg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="tiny" height="143px" version="1.1" viewBox="0 0 174 143" width="174px" x="0px" y="0px">
+<g>
+<rect fill="none" height="143" width="174"/>
+<polygon fill="#828282" points="74.024,96.548 74.024,96.548 74.024,87.955 79.305,87.955 79.305,89.406 75.759,89.406    75.759,91.314 78.525,91.314 78.525,92.768 75.759,92.768 75.759,95.096 79.383,95.096 79.383,96.548  "/>
+<path d="M88.227,96.547h-1.641v-3.17c0-0.669-0.035-1.104-0.105-1.301s-0.185-0.35-0.342-0.459   c-0.158-0.109-0.349-0.164-0.57-0.164c-0.285,0-0.54,0.078-0.767,0.234c-0.227,0.151-0.381,0.358-0.465,0.619   c-0.084,0.258-0.126,0.73-0.126,1.428v2.813h-1.64v-6.232h1.53v0.914c0.54-0.69,1.222-1.039,2.042-1.039   c0.361,0,0.692,0.063,0.992,0.195c0.299,0.131,0.525,0.297,0.68,0.5c0.153,0.203,0.264,0.434,0.32,0.69   c0.061,0.257,0.092,0.627,0.092,1.104V96.547L88.227,96.547z" fill="#828282"/>
+<path d="M91.711,92.221h-1.555c0.169-0.611,0.527-1.298,0.939-1.593c0.408-0.294,1.021-0.44,1.834-0.44   c0.732,0,1.279,0.088,1.644,0.265c0.36,0.175,0.614,0.396,0.761,0.659c0.148,0.27,0.223,0.762,0.223,1.476l-0.031,1.92   c0,0.55,0.025,0.95,0.078,1.21c0.057,0.264,0.151,0.537,0.297,0.834h-1.625c-0.043-0.104-0.096-0.266-0.155-0.479   c-0.027-0.096-0.05-0.155-0.062-0.188c-0.283,0.274-0.584,0.479-0.904,0.617c-0.317,0.14-0.66,0.206-1.023,0.206   c-0.645,0-1.146-0.174-1.52-0.521c-0.367-0.348-0.555-0.785-0.555-1.313c0-0.354,0.084-0.662,0.252-0.938   c0.168-0.271,0.403-0.483,0.707-0.631c0.303-0.146,0.74-0.273,1.313-0.384c0.771-0.146,1.305-0.276,1.603-0.401v-0.17   c0-0.322-0.078-0.553-0.236-0.688c-0.153-0.139-0.45-0.206-0.891-0.206c-0.295,0-0.525,0.062-0.688,0.177   C91.945,91.749,91.814,91.925,91.711,92.221 M93.932,93.596c-0.213,0.069-0.549,0.152-1.011,0.25   c-0.459,0.096-0.76,0.19-0.901,0.284c-0.215,0.149-0.324,0.343-0.324,0.575c0,0.229,0.091,0.427,0.264,0.593   c0.174,0.167,0.396,0.25,0.661,0.25c0.298,0,0.583-0.097,0.854-0.291c0.197-0.146,0.332-0.327,0.396-0.54   c0.044-0.14,0.065-0.404,0.065-0.797v-0.324" fill="#828282"/>
+<path d="M99.314,96.547v-8.594h1.641v3.102c0.507-0.578,1.107-0.867,1.802-0.867c0.757,0,1.382,0.275,1.877,0.824   c0.495,0.551,0.742,1.34,0.742,2.369c0,1.064-0.251,1.885-0.757,2.459c-0.504,0.576-1.115,0.863-1.836,0.863   c-0.354,0-0.703-0.092-1.047-0.273c-0.346-0.183-0.646-0.449-0.891-0.797v0.914H99.314 M100.922,93.316   c0,0.646,0.102,1.123,0.307,1.433c0.287,0.438,0.666,0.657,1.145,0.657c0.361,0,0.676-0.155,0.936-0.467   c0.258-0.313,0.387-0.805,0.387-1.476c0-0.712-0.131-1.229-0.391-1.542c-0.261-0.313-0.592-0.473-0.992-0.473   c-0.396,0-0.729,0.15-0.988,0.461C101.055,92.223,100.922,92.689,100.922,93.316" fill="#828282"/>
+<path d="M115.986,94.859h1.744c-0.211,0.602-0.545,1.059-0.998,1.373c-0.455,0.313-1.023,0.472-1.707,0.472   c-1.08,0-1.881-0.354-2.399-1.063c-0.409-0.564-0.614-1.283-0.614-2.146c0-1.033,0.271-1.845,0.809-2.431   c0.539-0.584,1.225-0.877,2.049-0.877c0.926,0,1.652,0.31,2.188,0.918c0.535,0.613,0.791,1.556,0.771,2.815H113.7   c0.012,0.488,0.144,0.868,0.397,1.14c0.252,0.272,0.564,0.408,0.943,0.408c0.257,0,0.477-0.07,0.646-0.212   C115.811,95.165,115.908,95.031,115.986,94.859 M116.184,92.906c-0.012-0.475-0.135-0.836-0.367-1.082   c-0.23-0.248-0.519-0.371-0.854-0.371c-0.357,0-0.654,0.131-0.889,0.391c-0.233,0.262-0.35,0.615-0.346,1.063H116.184   L116.184,92.906" fill="#828282"/>
+<path d="M126.186,96.547h-1.531v-0.914c-0.252,0.355-0.553,0.623-0.896,0.803c-0.344,0.182-0.69,0.271-1.042,0.271   c-0.713,0-1.322-0.289-1.83-0.865c-0.509-0.576-0.763-1.383-0.763-2.416c0-1.057,0.247-1.855,0.743-2.406   c0.492-0.553,1.119-0.824,1.877-0.824c0.693,0,1.295,0.289,1.802,0.867v-3.104h1.642v8.592L126.186,96.547 M121.811,93.316   c0,0.664,0.092,1.146,0.275,1.441c0.268,0.434,0.641,0.646,1.118,0.646c0.38,0,0.704-0.16,0.971-0.483   c0.267-0.321,0.4-0.806,0.4-1.446c0-0.718-0.13-1.23-0.39-1.55c-0.261-0.313-0.588-0.473-0.994-0.473   c-0.396,0-0.721,0.155-0.984,0.467C121.941,92.232,121.811,92.695,121.811,93.316" fill="#828282"/>
+<path d="M107.619,87.954h1.465v6.968c0,0.773,0.23,1.234,0.691,1.383c-0.229,0.43-0.613,0.646-1.16,0.646   c-0.664,0-0.996-0.461-0.996-1.385V87.954L107.619,87.954z" fill="#828282"/>
+<path d="M79.853,70.617c-1.015,0-2.356-0.167-2.356-0.167s-8.336,4.231-9.764,5.073   c-0.02-0.049,1.236-2.258,1.547-3.107c0.063-0.17-0.146-0.447-0.371-0.447c-0.582,0-1.314,0.101-2.509,0.095   c-11.423,0-16.711-5.935-16.711-8.958c0-4.03,6.263-8.743,15.843-8.743c4.238,0,10.453,0.671,13.107,2.34   c0.88-0.174,1.783-0.26,2.673-0.26c1.288,0,2.606,0.196,3.807,0.6l0,0c-6.327-4.967-12.986-6.204-19.587-6.204   c-12.972,0-21.33,5.268-21.33,11.995c0,6.767,10.156,12.78,21.33,12.78c0.688,0.021,1.232,0.121,1.04,0.559   c-0.184,0.417-2.91,4.688-3.744,6.221c-0.243,0.443,0.051,0.73,0.581,0.588l20.527-12.84l0,0   C82.847,70.432,81.506,70.617,79.853,70.617z" fill="#2976BB"/>
+<path d="M60.564,68.814h5.172l1.141-4.441c0.596-2.194,1.689-2.959,3.877-2.959c0.645,0,1.342,0.102,1.937,0.253   l0.994-3.571c-0.498-0.102-0.994-0.153-1.841-0.153c-1.289,0-2.979,0.818-3.875,1.939h-0.05l0.398-1.685h-4.969L60.564,68.814   L60.564,68.814z" fill="#FFFFFF"/>
+<path d="M78.344,62.333c0.417-1.124,1.353-1.787,2.762-1.787c1.406,0,2.084,0.612,2.084,1.43   c0,0.102-0.054,0.253-0.054,0.357H78.344L78.344,62.333 M82.197,65.75c-0.261,0.358-0.935,0.765-2.137,0.765   c-1.667,0-2.188-0.969-2.188-2.091h10.056c0.209-0.663,0.26-1.275,0.26-1.838c0-3.316-3.75-4.645-6.875-4.645   c-3.543,0-8.493,1.581-8.493,6.482c0,2.552,2.034,4.695,7.034,4.695c6.096,0,7.136-2.653,7.501-3.37h-5.157L82.197,65.75" fill="#FFFFFF"/>
+<path d="M93.861,65.801c0-0.816,0.875-1.12,1.75-1.225c0.977-0.051,1.955-0.101,2.828-0.459   c-0.358,1.581-1.078,2.602-2.881,2.602C94.736,66.719,93.861,66.514,93.861,65.801L93.861,65.801 M95.404,61.412   c0.31-0.766,1.082-1.071,2.111-1.071c0.82,0,1.692,0.203,1.692,0.918c0,1.326-2.419,1.123-3.911,1.223   c-4.013,0.206-6.734,0.972-6.734,3.781c0,2.04,2.105,2.856,4.521,2.856c1.545,0,3.352-0.46,4.271-1.327h0.054   c0,0.356,0.052,0.713,0.206,1.021h5.195c-0.207-0.461-0.104-0.103-0.207-0.919c0-0.716,1.696-5.462,1.696-7.146   c0-2.551-4.271-2.807-6.791-2.807c-3.396,0-6.276,0.665-7.103,3.472L95.404,61.412L95.404,61.412" fill="#FFFFFF"/>
+<polygon fill="#FFFFFF" points="104.313,68.815 104.313,68.815 109.523,68.815 113.418,54.217 108.207,54.217  "/>
+<polygon fill="#FFFFFF" points="115.221,66.548 115.221,66.548 114.289,66.548 114.289,68.96 113.516,68.96 113.516,66.548    112.584,66.548 112.584,65.971 115.221,65.971  "/>
+<polygon fill="#FFFFFF" points="119.084,68.96 119.084,68.96 118.313,68.96 118.313,66.958 117.762,68.258 117.229,68.258    116.68,66.958 116.68,68.96 115.943,68.96 115.943,65.971 116.848,65.971 117.516,67.471 118.184,65.971 119.084,65.971  "/>
+<rect fill="#99CCCC" height="16" width="3.496" x="85.231" y="2.39"/>
+<rect fill="#99CCCC" height="15.988" transform="matrix(-0.9241 -0.3821 0.3821 -0.9241 205.8219 70.7539)" width="3.494" x="108.19" y="6.946"/>
+<rect fill="#99CCCC" height="15.998" transform="matrix(0.7072 0.707 -0.707 0.7072 57.6263 -83.3022)" width="3.494" x="127.635" y="19.921"/>
+<rect fill="#99CCCC" height="15.991" transform="matrix(0.3827 0.9239 -0.9239 0.3827 131.839 -102.3118)" width="3.496" x="140.731" y="39.504"/>
+</g>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/group/icons/qgn_graf_realplayer_splash_06.svg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="tiny" height="143px" version="1.1" viewBox="0 0 174 143" width="174px" x="0px" y="0px">
+<g>
+<rect fill="none" height="143" width="174"/>
+<polygon fill="#828282" points="74.024,96.548 74.024,96.548 74.024,87.955 79.305,87.955 79.305,89.406 75.759,89.406    75.759,91.314 78.525,91.314 78.525,92.768 75.759,92.768 75.759,95.096 79.383,95.096 79.383,96.548  "/>
+<path d="M88.227,96.547h-1.641v-3.17c0-0.669-0.035-1.104-0.105-1.301s-0.185-0.35-0.342-0.459   c-0.158-0.109-0.349-0.164-0.57-0.164c-0.285,0-0.54,0.078-0.767,0.234c-0.227,0.151-0.381,0.358-0.465,0.619   c-0.084,0.258-0.126,0.73-0.126,1.428v2.813h-1.64v-6.232h1.53v0.914c0.54-0.69,1.222-1.039,2.042-1.039   c0.361,0,0.692,0.063,0.992,0.195c0.299,0.131,0.525,0.297,0.68,0.5c0.153,0.203,0.264,0.434,0.32,0.69   c0.061,0.257,0.092,0.627,0.092,1.104V96.547L88.227,96.547z" fill="#828282"/>
+<path d="M91.711,92.221h-1.555c0.169-0.611,0.527-1.298,0.939-1.593c0.408-0.294,1.021-0.44,1.834-0.44   c0.732,0,1.279,0.088,1.644,0.265c0.36,0.175,0.614,0.396,0.761,0.659c0.148,0.27,0.223,0.762,0.223,1.476l-0.031,1.92   c0,0.55,0.025,0.95,0.078,1.21c0.057,0.264,0.151,0.537,0.297,0.834h-1.625c-0.043-0.104-0.096-0.266-0.155-0.479   c-0.027-0.096-0.05-0.155-0.062-0.188c-0.283,0.274-0.584,0.479-0.904,0.617c-0.317,0.14-0.66,0.206-1.023,0.206   c-0.645,0-1.146-0.174-1.52-0.521c-0.367-0.348-0.555-0.785-0.555-1.313c0-0.354,0.084-0.662,0.252-0.938   c0.168-0.271,0.403-0.483,0.707-0.631c0.303-0.146,0.74-0.273,1.313-0.384c0.771-0.146,1.305-0.276,1.603-0.401v-0.17   c0-0.322-0.078-0.553-0.236-0.688c-0.153-0.139-0.45-0.206-0.891-0.206c-0.295,0-0.525,0.062-0.688,0.177   C91.945,91.749,91.814,91.925,91.711,92.221 M93.932,93.596c-0.213,0.069-0.549,0.152-1.011,0.25   c-0.459,0.096-0.76,0.19-0.901,0.284c-0.215,0.149-0.324,0.343-0.324,0.575c0,0.229,0.091,0.427,0.264,0.593   c0.174,0.167,0.396,0.25,0.661,0.25c0.298,0,0.583-0.097,0.854-0.291c0.197-0.146,0.332-0.327,0.396-0.54   c0.044-0.14,0.065-0.404,0.065-0.797v-0.324" fill="#828282"/>
+<path d="M99.314,96.547v-8.594h1.641v3.102c0.507-0.578,1.107-0.867,1.802-0.867c0.757,0,1.382,0.275,1.877,0.824   c0.495,0.551,0.742,1.34,0.742,2.369c0,1.064-0.251,1.885-0.757,2.459c-0.504,0.576-1.115,0.863-1.836,0.863   c-0.354,0-0.703-0.092-1.047-0.273c-0.346-0.183-0.646-0.449-0.891-0.797v0.914H99.314 M100.922,93.316   c0,0.646,0.102,1.123,0.307,1.433c0.287,0.438,0.666,0.657,1.145,0.657c0.361,0,0.676-0.155,0.936-0.467   c0.258-0.313,0.387-0.805,0.387-1.476c0-0.712-0.131-1.229-0.391-1.542c-0.261-0.313-0.592-0.473-0.992-0.473   c-0.396,0-0.729,0.15-0.988,0.461C101.055,92.223,100.922,92.689,100.922,93.316" fill="#828282"/>
+<path d="M115.986,94.859h1.744c-0.211,0.602-0.545,1.059-0.998,1.373c-0.455,0.313-1.023,0.472-1.707,0.472   c-1.08,0-1.881-0.354-2.399-1.063c-0.409-0.564-0.614-1.283-0.614-2.146c0-1.033,0.271-1.845,0.809-2.431   c0.539-0.584,1.225-0.877,2.049-0.877c0.926,0,1.652,0.31,2.188,0.918c0.535,0.613,0.791,1.556,0.771,2.815H113.7   c0.012,0.488,0.144,0.868,0.397,1.14c0.252,0.272,0.564,0.408,0.943,0.408c0.257,0,0.477-0.07,0.646-0.212   C115.811,95.165,115.908,95.031,115.986,94.859 M116.184,92.906c-0.012-0.475-0.135-0.836-0.367-1.082   c-0.23-0.248-0.519-0.371-0.854-0.371c-0.357,0-0.654,0.131-0.889,0.391c-0.233,0.262-0.35,0.615-0.346,1.063H116.184   L116.184,92.906" fill="#828282"/>
+<path d="M126.186,96.547h-1.531v-0.914c-0.252,0.355-0.553,0.623-0.896,0.803c-0.344,0.182-0.69,0.271-1.042,0.271   c-0.713,0-1.322-0.289-1.83-0.865c-0.509-0.576-0.763-1.383-0.763-2.416c0-1.057,0.247-1.855,0.743-2.406   c0.492-0.553,1.119-0.824,1.877-0.824c0.693,0,1.295,0.289,1.802,0.867v-3.104h1.642v8.592L126.186,96.547 M121.811,93.316   c0,0.664,0.092,1.146,0.275,1.441c0.268,0.434,0.641,0.646,1.118,0.646c0.38,0,0.704-0.16,0.971-0.483   c0.267-0.321,0.4-0.806,0.4-1.446c0-0.718-0.13-1.23-0.39-1.55c-0.261-0.313-0.588-0.473-0.994-0.473   c-0.396,0-0.721,0.155-0.984,0.467C121.941,92.232,121.811,92.695,121.811,93.316" fill="#828282"/>
+<path d="M107.619,87.954h1.465v6.968c0,0.773,0.23,1.234,0.691,1.383c-0.229,0.43-0.613,0.646-1.16,0.646   c-0.664,0-0.996-0.461-0.996-1.385V87.954L107.619,87.954z" fill="#828282"/>
+<path d="M79.853,70.617c-1.015,0-2.356-0.167-2.356-0.167s-8.336,4.231-9.764,5.073   c-0.02-0.049,1.236-2.258,1.547-3.107c0.063-0.17-0.146-0.447-0.371-0.447c-0.582,0-1.314,0.101-2.509,0.095   c-11.423,0-16.711-5.935-16.711-8.958c0-4.03,6.263-8.743,15.843-8.743c4.238,0,10.453,0.671,13.107,2.34   c0.88-0.174,1.783-0.26,2.673-0.26c1.288,0,2.606,0.196,3.807,0.6l0,0c-6.327-4.967-12.986-6.204-19.587-6.204   c-12.972,0-21.33,5.268-21.33,11.995c0,6.767,10.156,12.78,21.33,12.78c0.688,0.021,1.232,0.121,1.04,0.559   c-0.184,0.417-2.91,4.688-3.744,6.221c-0.243,0.443,0.051,0.73,0.581,0.588l20.527-12.84l0,0   C82.847,70.432,81.506,70.617,79.853,70.617z" fill="#2976BB"/>
+<path d="M60.564,68.814h5.172l1.141-4.441c0.596-2.194,1.689-2.959,3.877-2.959c0.645,0,1.342,0.102,1.937,0.253   l0.994-3.571c-0.498-0.102-0.994-0.153-1.841-0.153c-1.289,0-2.979,0.818-3.875,1.939h-0.05l0.398-1.685h-4.969L60.564,68.814   L60.564,68.814z" fill="#FFFFFF"/>
+<path d="M78.344,62.333c0.417-1.124,1.353-1.787,2.762-1.787c1.406,0,2.084,0.612,2.084,1.43   c0,0.102-0.054,0.253-0.054,0.357H78.344L78.344,62.333 M82.197,65.75c-0.261,0.358-0.935,0.765-2.137,0.765   c-1.667,0-2.188-0.969-2.188-2.091h10.056c0.209-0.663,0.26-1.275,0.26-1.838c0-3.316-3.75-4.645-6.875-4.645   c-3.543,0-8.493,1.581-8.493,6.482c0,2.552,2.034,4.695,7.034,4.695c6.096,0,7.136-2.653,7.501-3.37h-5.157L82.197,65.75" fill="#FFFFFF"/>
+<path d="M93.861,65.801c0-0.816,0.875-1.12,1.75-1.225c0.977-0.051,1.955-0.101,2.828-0.459   c-0.358,1.581-1.078,2.602-2.881,2.602C94.736,66.719,93.861,66.514,93.861,65.801L93.861,65.801 M95.404,61.412   c0.31-0.766,1.082-1.071,2.111-1.071c0.82,0,1.692,0.203,1.692,0.918c0,1.326-2.419,1.123-3.911,1.223   c-4.013,0.206-6.734,0.972-6.734,3.781c0,2.04,2.105,2.856,4.521,2.856c1.545,0,3.352-0.46,4.271-1.327h0.054   c0,0.356,0.052,0.713,0.206,1.021h5.195c-0.207-0.461-0.104-0.103-0.207-0.919c0-0.716,1.696-5.462,1.696-7.146   c0-2.551-4.271-2.807-6.791-2.807c-3.396,0-6.276,0.665-7.103,3.472L95.404,61.412L95.404,61.412" fill="#FFFFFF"/>
+<polygon fill="#FFFFFF" points="104.313,68.815 104.313,68.815 109.523,68.815 113.418,54.217 108.207,54.217  "/>
+<polygon fill="#FFFFFF" points="115.221,66.548 115.221,66.548 114.289,66.548 114.289,68.96 113.516,68.96 113.516,66.548    112.584,66.548 112.584,65.971 115.221,65.971  "/>
+<polygon fill="#FFFFFF" points="119.084,68.96 119.084,68.96 118.313,68.96 118.313,66.958 117.762,68.258 117.229,68.258    116.68,66.958 116.68,68.96 115.943,68.96 115.943,65.971 116.848,65.971 117.516,67.471 118.184,65.971 119.084,65.971  "/>
+<rect fill="#99CCCC" height="16" width="3.496" x="85.231" y="2.39"/>
+<rect fill="#99CCCC" height="15.988" transform="matrix(-0.9241 -0.3821 0.3821 -0.9241 205.8219 70.7539)" width="3.494" x="108.19" y="6.946"/>
+<rect fill="#99CCCC" height="15.998" transform="matrix(0.7072 0.707 -0.707 0.7072 57.6263 -83.3022)" width="3.494" x="127.635" y="19.921"/>
+<rect fill="#99CCCC" height="15.991" transform="matrix(0.3827 0.9239 -0.9239 0.3827 131.839 -102.3118)" width="3.496" x="140.731" y="39.504"/>
+<rect fill="#99CCCC" height="3.496" width="16" x="139" y="68.67"/>
+</g>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/group/icons/qgn_graf_realplayer_splash_07.svg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="tiny" height="143px" version="1.1" viewBox="0 0 174 143" width="174px" x="0px" y="0px">
+<g>
+<rect fill="none" height="143" width="174"/>
+<polygon fill="#828282" points="74.024,96.548 74.024,96.548 74.024,87.955 79.305,87.955 79.305,89.406 75.759,89.406    75.759,91.314 78.525,91.314 78.525,92.768 75.759,92.768 75.759,95.096 79.383,95.096 79.383,96.548  "/>
+<path d="M88.227,96.547h-1.641v-3.17c0-0.669-0.035-1.104-0.105-1.301s-0.185-0.35-0.342-0.459   c-0.158-0.109-0.349-0.164-0.57-0.164c-0.285,0-0.54,0.078-0.767,0.234c-0.227,0.151-0.381,0.358-0.465,0.619   c-0.084,0.258-0.126,0.73-0.126,1.428v2.813h-1.64v-6.232h1.53v0.914c0.54-0.69,1.222-1.039,2.042-1.039   c0.361,0,0.692,0.063,0.992,0.195c0.299,0.131,0.525,0.297,0.68,0.5c0.153,0.203,0.264,0.434,0.32,0.69   c0.061,0.257,0.092,0.627,0.092,1.104V96.547L88.227,96.547z" fill="#828282"/>
+<path d="M91.711,92.221h-1.555c0.169-0.611,0.527-1.298,0.939-1.593c0.408-0.294,1.021-0.44,1.834-0.44   c0.732,0,1.279,0.088,1.644,0.265c0.36,0.175,0.614,0.396,0.761,0.659c0.148,0.27,0.223,0.762,0.223,1.476l-0.031,1.92   c0,0.55,0.025,0.95,0.078,1.21c0.057,0.264,0.151,0.537,0.297,0.834h-1.625c-0.043-0.104-0.096-0.266-0.155-0.479   c-0.027-0.096-0.05-0.155-0.062-0.188c-0.283,0.274-0.584,0.479-0.904,0.617c-0.317,0.14-0.66,0.206-1.023,0.206   c-0.645,0-1.146-0.174-1.52-0.521c-0.367-0.348-0.555-0.785-0.555-1.313c0-0.354,0.084-0.662,0.252-0.938   c0.168-0.271,0.403-0.483,0.707-0.631c0.303-0.146,0.74-0.273,1.313-0.384c0.771-0.146,1.305-0.276,1.603-0.401v-0.17   c0-0.322-0.078-0.553-0.236-0.688c-0.153-0.139-0.45-0.206-0.891-0.206c-0.295,0-0.525,0.062-0.688,0.177   C91.945,91.749,91.814,91.925,91.711,92.221 M93.932,93.596c-0.213,0.069-0.549,0.152-1.011,0.25   c-0.459,0.096-0.76,0.19-0.901,0.284c-0.215,0.149-0.324,0.343-0.324,0.575c0,0.229,0.091,0.427,0.264,0.593   c0.174,0.167,0.396,0.25,0.661,0.25c0.298,0,0.583-0.097,0.854-0.291c0.197-0.146,0.332-0.327,0.396-0.54   c0.044-0.14,0.065-0.404,0.065-0.797v-0.324" fill="#828282"/>
+<path d="M99.314,96.547v-8.594h1.641v3.102c0.507-0.578,1.107-0.867,1.802-0.867c0.757,0,1.382,0.275,1.877,0.824   c0.495,0.551,0.742,1.34,0.742,2.369c0,1.064-0.251,1.885-0.757,2.459c-0.504,0.576-1.115,0.863-1.836,0.863   c-0.354,0-0.703-0.092-1.047-0.273c-0.346-0.183-0.646-0.449-0.891-0.797v0.914H99.314 M100.922,93.316   c0,0.646,0.102,1.123,0.307,1.433c0.287,0.438,0.666,0.657,1.145,0.657c0.361,0,0.676-0.155,0.936-0.467   c0.258-0.313,0.387-0.805,0.387-1.476c0-0.712-0.131-1.229-0.391-1.542c-0.261-0.313-0.592-0.473-0.992-0.473   c-0.396,0-0.729,0.15-0.988,0.461C101.055,92.223,100.922,92.689,100.922,93.316" fill="#828282"/>
+<path d="M115.986,94.859h1.744c-0.211,0.602-0.545,1.059-0.998,1.373c-0.455,0.313-1.023,0.472-1.707,0.472   c-1.08,0-1.881-0.354-2.399-1.063c-0.409-0.564-0.614-1.283-0.614-2.146c0-1.033,0.271-1.845,0.809-2.431   c0.539-0.584,1.225-0.877,2.049-0.877c0.926,0,1.652,0.31,2.188,0.918c0.535,0.613,0.791,1.556,0.771,2.815H113.7   c0.012,0.488,0.144,0.868,0.397,1.14c0.252,0.272,0.564,0.408,0.943,0.408c0.257,0,0.477-0.07,0.646-0.212   C115.811,95.165,115.908,95.031,115.986,94.859 M116.184,92.906c-0.012-0.475-0.135-0.836-0.367-1.082   c-0.23-0.248-0.519-0.371-0.854-0.371c-0.357,0-0.654,0.131-0.889,0.391c-0.233,0.262-0.35,0.615-0.346,1.063H116.184   L116.184,92.906" fill="#828282"/>
+<path d="M126.186,96.547h-1.531v-0.914c-0.252,0.355-0.553,0.623-0.896,0.803c-0.344,0.182-0.69,0.271-1.042,0.271   c-0.713,0-1.322-0.289-1.83-0.865c-0.509-0.576-0.763-1.383-0.763-2.416c0-1.057,0.247-1.855,0.743-2.406   c0.492-0.553,1.119-0.824,1.877-0.824c0.693,0,1.295,0.289,1.802,0.867v-3.104h1.642v8.592L126.186,96.547 M121.811,93.316   c0,0.664,0.092,1.146,0.275,1.441c0.268,0.434,0.641,0.646,1.118,0.646c0.38,0,0.704-0.16,0.971-0.483   c0.267-0.321,0.4-0.806,0.4-1.446c0-0.718-0.13-1.23-0.39-1.55c-0.261-0.313-0.588-0.473-0.994-0.473   c-0.396,0-0.721,0.155-0.984,0.467C121.941,92.232,121.811,92.695,121.811,93.316" fill="#828282"/>
+<path d="M107.619,87.954h1.465v6.968c0,0.773,0.23,1.234,0.691,1.383c-0.229,0.43-0.613,0.646-1.16,0.646   c-0.664,0-0.996-0.461-0.996-1.385V87.954L107.619,87.954z" fill="#828282"/>
+<path d="M79.853,70.617c-1.015,0-2.356-0.167-2.356-0.167s-8.336,4.231-9.764,5.073   c-0.02-0.049,1.236-2.258,1.547-3.107c0.063-0.17-0.146-0.447-0.371-0.447c-0.582,0-1.314,0.101-2.509,0.095   c-11.423,0-16.711-5.935-16.711-8.958c0-4.03,6.263-8.743,15.843-8.743c4.238,0,10.453,0.671,13.107,2.34   c0.88-0.174,1.783-0.26,2.673-0.26c1.288,0,2.606,0.196,3.807,0.6l0,0c-6.327-4.967-12.986-6.204-19.587-6.204   c-12.972,0-21.33,5.268-21.33,11.995c0,6.767,10.156,12.78,21.33,12.78c0.688,0.021,1.232,0.121,1.04,0.559   c-0.184,0.417-2.91,4.688-3.744,6.221c-0.243,0.443,0.051,0.73,0.581,0.588l20.527-12.84l0,0   C82.847,70.432,81.506,70.617,79.853,70.617z" fill="#2976BB"/>
+<path d="M60.564,68.814h5.172l1.141-4.441c0.596-2.194,1.689-2.959,3.877-2.959c0.645,0,1.342,0.102,1.937,0.253   l0.994-3.571c-0.498-0.102-0.994-0.153-1.841-0.153c-1.289,0-2.979,0.818-3.875,1.939h-0.05l0.398-1.685h-4.969L60.564,68.814   L60.564,68.814z" fill="#FFFFFF"/>
+<path d="M78.344,62.333c0.417-1.124,1.353-1.787,2.762-1.787c1.406,0,2.084,0.612,2.084,1.43   c0,0.102-0.054,0.253-0.054,0.357H78.344L78.344,62.333 M82.197,65.75c-0.261,0.358-0.935,0.765-2.137,0.765   c-1.667,0-2.188-0.969-2.188-2.091h10.056c0.209-0.663,0.26-1.275,0.26-1.838c0-3.316-3.75-4.645-6.875-4.645   c-3.543,0-8.493,1.581-8.493,6.482c0,2.552,2.034,4.695,7.034,4.695c6.096,0,7.136-2.653,7.501-3.37h-5.157L82.197,65.75" fill="#FFFFFF"/>
+<path d="M93.861,65.801c0-0.816,0.875-1.12,1.75-1.225c0.977-0.051,1.955-0.101,2.828-0.459   c-0.358,1.581-1.078,2.602-2.881,2.602C94.736,66.719,93.861,66.514,93.861,65.801L93.861,65.801 M95.404,61.412   c0.31-0.766,1.082-1.071,2.111-1.071c0.82,0,1.692,0.203,1.692,0.918c0,1.326-2.419,1.123-3.911,1.223   c-4.013,0.206-6.734,0.972-6.734,3.781c0,2.04,2.105,2.856,4.521,2.856c1.545,0,3.352-0.46,4.271-1.327h0.054   c0,0.356,0.052,0.713,0.206,1.021h5.195c-0.207-0.461-0.104-0.103-0.207-0.919c0-0.716,1.696-5.462,1.696-7.146   c0-2.551-4.271-2.807-6.791-2.807c-3.396,0-6.276,0.665-7.103,3.472L95.404,61.412L95.404,61.412" fill="#FFFFFF"/>
+<polygon fill="#FFFFFF" points="104.313,68.815 104.313,68.815 109.523,68.815 113.418,54.217 108.207,54.217  "/>
+<polygon fill="#FFFFFF" points="115.221,66.548 115.221,66.548 114.289,66.548 114.289,68.96 113.516,68.96 113.516,66.548    112.584,66.548 112.584,65.971 115.221,65.971  "/>
+<polygon fill="#FFFFFF" points="119.084,68.96 119.084,68.96 118.313,68.96 118.313,66.958 117.762,68.258 117.229,68.258    116.68,66.958 116.68,68.96 115.943,68.96 115.943,65.971 116.848,65.971 117.516,67.471 118.184,65.971 119.084,65.971  "/>
+<rect fill="#99CCCC" height="16" width="3.496" x="85.231" y="2.39"/>
+<rect fill="#99CCCC" height="15.988" transform="matrix(-0.9241 -0.3821 0.3821 -0.9241 205.8219 70.7539)" width="3.494" x="108.19" y="6.946"/>
+<rect fill="#99CCCC" height="15.998" transform="matrix(0.7072 0.707 -0.707 0.7072 57.6263 -83.3022)" width="3.494" x="127.635" y="19.921"/>
+<rect fill="#99CCCC" height="15.991" transform="matrix(0.3827 0.9239 -0.9239 0.3827 131.839 -102.3118)" width="3.496" x="140.731" y="39.504"/>
+<rect fill="#99CCCC" height="3.496" width="16" x="139" y="68.67"/>
+<rect fill="#99CCCC" height="16.003" transform="matrix(0.3837 -0.9234 0.9234 0.3837 1.4789 189.0872)" width="3.494" x="140.663" y="85.434"/>
+</g>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/group/icons/qgn_graf_realplayer_splash_08.svg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="tiny" height="143px" version="1.1" viewBox="0 0 174 143" width="174px" x="0px" y="0px">
+<g>
+<rect fill="none" height="143" width="174"/>
+<polygon fill="#828282" points="74.024,96.548 74.024,96.548 74.024,87.955 79.305,87.955 79.305,89.406 75.759,89.406    75.759,91.314 78.525,91.314 78.525,92.768 75.759,92.768 75.759,95.096 79.383,95.096 79.383,96.548  "/>
+<path d="M88.227,96.547h-1.641v-3.17c0-0.669-0.035-1.104-0.105-1.301s-0.185-0.35-0.342-0.459   c-0.158-0.109-0.349-0.164-0.57-0.164c-0.285,0-0.54,0.078-0.767,0.234c-0.227,0.151-0.381,0.358-0.465,0.619   c-0.084,0.258-0.126,0.73-0.126,1.428v2.813h-1.64v-6.232h1.53v0.914c0.54-0.69,1.222-1.039,2.042-1.039   c0.361,0,0.692,0.063,0.992,0.195c0.299,0.131,0.525,0.297,0.68,0.5c0.153,0.203,0.264,0.434,0.32,0.69   c0.061,0.257,0.092,0.627,0.092,1.104V96.547L88.227,96.547z" fill="#828282"/>
+<path d="M91.711,92.221h-1.555c0.169-0.611,0.527-1.298,0.939-1.593c0.408-0.294,1.021-0.44,1.834-0.44   c0.732,0,1.279,0.088,1.644,0.265c0.36,0.175,0.614,0.396,0.761,0.659c0.148,0.27,0.223,0.762,0.223,1.476l-0.031,1.92   c0,0.55,0.025,0.95,0.078,1.21c0.057,0.264,0.151,0.537,0.297,0.834h-1.625c-0.043-0.104-0.096-0.266-0.155-0.479   c-0.027-0.096-0.05-0.155-0.062-0.188c-0.283,0.274-0.584,0.479-0.904,0.617c-0.317,0.14-0.66,0.206-1.023,0.206   c-0.645,0-1.146-0.174-1.52-0.521c-0.367-0.348-0.555-0.785-0.555-1.313c0-0.354,0.084-0.662,0.252-0.938   c0.168-0.271,0.403-0.483,0.707-0.631c0.303-0.146,0.74-0.273,1.313-0.384c0.771-0.146,1.305-0.276,1.603-0.401v-0.17   c0-0.322-0.078-0.553-0.236-0.688c-0.153-0.139-0.45-0.206-0.891-0.206c-0.295,0-0.525,0.062-0.688,0.177   C91.945,91.749,91.814,91.925,91.711,92.221 M93.932,93.596c-0.213,0.069-0.549,0.152-1.011,0.25   c-0.459,0.096-0.76,0.19-0.901,0.284c-0.215,0.149-0.324,0.343-0.324,0.575c0,0.229,0.091,0.427,0.264,0.593   c0.174,0.167,0.396,0.25,0.661,0.25c0.298,0,0.583-0.097,0.854-0.291c0.197-0.146,0.332-0.327,0.396-0.54   c0.044-0.14,0.065-0.404,0.065-0.797v-0.324" fill="#828282"/>
+<path d="M99.314,96.547v-8.594h1.641v3.102c0.507-0.578,1.107-0.867,1.802-0.867c0.757,0,1.382,0.275,1.877,0.824   c0.495,0.551,0.742,1.34,0.742,2.369c0,1.064-0.251,1.885-0.757,2.459c-0.504,0.576-1.115,0.863-1.836,0.863   c-0.354,0-0.703-0.092-1.047-0.273c-0.346-0.183-0.646-0.449-0.891-0.797v0.914H99.314 M100.922,93.316   c0,0.646,0.102,1.123,0.307,1.433c0.287,0.438,0.666,0.657,1.145,0.657c0.361,0,0.676-0.155,0.936-0.467   c0.258-0.313,0.387-0.805,0.387-1.476c0-0.712-0.131-1.229-0.391-1.542c-0.261-0.313-0.592-0.473-0.992-0.473   c-0.396,0-0.729,0.15-0.988,0.461C101.055,92.223,100.922,92.689,100.922,93.316" fill="#828282"/>
+<path d="M115.986,94.859h1.744c-0.211,0.602-0.545,1.059-0.998,1.373c-0.455,0.313-1.023,0.472-1.707,0.472   c-1.08,0-1.881-0.354-2.399-1.063c-0.409-0.564-0.614-1.283-0.614-2.146c0-1.033,0.271-1.845,0.809-2.431   c0.539-0.584,1.225-0.877,2.049-0.877c0.926,0,1.652,0.31,2.188,0.918c0.535,0.613,0.791,1.556,0.771,2.815H113.7   c0.012,0.488,0.144,0.868,0.397,1.14c0.252,0.272,0.564,0.408,0.943,0.408c0.257,0,0.477-0.07,0.646-0.212   C115.811,95.165,115.908,95.031,115.986,94.859 M116.184,92.906c-0.012-0.475-0.135-0.836-0.367-1.082   c-0.23-0.248-0.519-0.371-0.854-0.371c-0.357,0-0.654,0.131-0.889,0.391c-0.233,0.262-0.35,0.615-0.346,1.063H116.184   L116.184,92.906" fill="#828282"/>
+<path d="M126.186,96.547h-1.531v-0.914c-0.252,0.355-0.553,0.623-0.896,0.803c-0.344,0.182-0.69,0.271-1.042,0.271   c-0.713,0-1.322-0.289-1.83-0.865c-0.509-0.576-0.763-1.383-0.763-2.416c0-1.057,0.247-1.855,0.743-2.406   c0.492-0.553,1.119-0.824,1.877-0.824c0.693,0,1.295,0.289,1.802,0.867v-3.104h1.642v8.592L126.186,96.547 M121.811,93.316   c0,0.664,0.092,1.146,0.275,1.441c0.268,0.434,0.641,0.646,1.118,0.646c0.38,0,0.704-0.16,0.971-0.483   c0.267-0.321,0.4-0.806,0.4-1.446c0-0.718-0.13-1.23-0.39-1.55c-0.261-0.313-0.588-0.473-0.994-0.473   c-0.396,0-0.721,0.155-0.984,0.467C121.941,92.232,121.811,92.695,121.811,93.316" fill="#828282"/>
+<path d="M107.619,87.954h1.465v6.968c0,0.773,0.23,1.234,0.691,1.383c-0.229,0.43-0.613,0.646-1.16,0.646   c-0.664,0-0.996-0.461-0.996-1.385V87.954L107.619,87.954z" fill="#828282"/>
+<path d="M79.853,70.617c-1.015,0-2.356-0.167-2.356-0.167s-8.336,4.231-9.764,5.073   c-0.02-0.049,1.236-2.258,1.547-3.107c0.063-0.17-0.146-0.447-0.371-0.447c-0.582,0-1.314,0.101-2.509,0.095   c-11.423,0-16.711-5.935-16.711-8.958c0-4.03,6.263-8.743,15.843-8.743c4.238,0,10.453,0.671,13.107,2.34   c0.88-0.174,1.783-0.26,2.673-0.26c1.288,0,2.606,0.196,3.807,0.6l0,0c-6.327-4.967-12.986-6.204-19.587-6.204   c-12.972,0-21.33,5.268-21.33,11.995c0,6.767,10.156,12.78,21.33,12.78c0.688,0.021,1.232,0.121,1.04,0.559   c-0.184,0.417-2.91,4.688-3.744,6.221c-0.243,0.443,0.051,0.73,0.581,0.588l20.527-12.84l0,0   C82.847,70.432,81.506,70.617,79.853,70.617z" fill="#2976BB"/>
+<path d="M60.564,68.814h5.172l1.141-4.441c0.596-2.194,1.689-2.959,3.877-2.959c0.645,0,1.342,0.102,1.937,0.253   l0.994-3.571c-0.498-0.102-0.994-0.153-1.841-0.153c-1.289,0-2.979,0.818-3.875,1.939h-0.05l0.398-1.685h-4.969L60.564,68.814   L60.564,68.814z" fill="#FFFFFF"/>
+<path d="M78.344,62.333c0.417-1.124,1.353-1.787,2.762-1.787c1.406,0,2.084,0.612,2.084,1.43   c0,0.102-0.054,0.253-0.054,0.357H78.344L78.344,62.333 M82.197,65.75c-0.261,0.358-0.935,0.765-2.137,0.765   c-1.667,0-2.188-0.969-2.188-2.091h10.056c0.209-0.663,0.26-1.275,0.26-1.838c0-3.316-3.75-4.645-6.875-4.645   c-3.543,0-8.493,1.581-8.493,6.482c0,2.552,2.034,4.695,7.034,4.695c6.096,0,7.136-2.653,7.501-3.37h-5.157L82.197,65.75" fill="#FFFFFF"/>
+<path d="M93.861,65.801c0-0.816,0.875-1.12,1.75-1.225c0.977-0.051,1.955-0.101,2.828-0.459   c-0.358,1.581-1.078,2.602-2.881,2.602C94.736,66.719,93.861,66.514,93.861,65.801L93.861,65.801 M95.404,61.412   c0.31-0.766,1.082-1.071,2.111-1.071c0.82,0,1.692,0.203,1.692,0.918c0,1.326-2.419,1.123-3.911,1.223   c-4.013,0.206-6.734,0.972-6.734,3.781c0,2.04,2.105,2.856,4.521,2.856c1.545,0,3.352-0.46,4.271-1.327h0.054   c0,0.356,0.052,0.713,0.206,1.021h5.195c-0.207-0.461-0.104-0.103-0.207-0.919c0-0.716,1.696-5.462,1.696-7.146   c0-2.551-4.271-2.807-6.791-2.807c-3.396,0-6.276,0.665-7.103,3.472L95.404,61.412L95.404,61.412" fill="#FFFFFF"/>
+<polygon fill="#FFFFFF" points="104.313,68.815 104.313,68.815 109.523,68.815 113.418,54.217 108.207,54.217  "/>
+<polygon fill="#FFFFFF" points="115.221,66.548 115.221,66.548 114.289,66.548 114.289,68.96 113.516,68.96 113.516,66.548    112.584,66.548 112.584,65.971 115.221,65.971  "/>
+<polygon fill="#FFFFFF" points="119.084,68.96 119.084,68.96 118.313,68.96 118.313,66.958 117.762,68.258 117.229,68.258    116.68,66.958 116.68,68.96 115.943,68.96 115.943,65.971 116.848,65.971 117.516,67.471 118.184,65.971 119.084,65.971  "/>
+<rect fill="#99CCCC" height="16" width="3.496" x="85.231" y="2.39"/>
+<rect fill="#99CCCC" height="15.988" transform="matrix(-0.9241 -0.3821 0.3821 -0.9241 205.8219 70.7539)" width="3.494" x="108.19" y="6.946"/>
+<rect fill="#99CCCC" height="15.998" transform="matrix(0.7072 0.707 -0.707 0.7072 57.6263 -83.3022)" width="3.494" x="127.635" y="19.921"/>
+<rect fill="#99CCCC" height="15.991" transform="matrix(0.3827 0.9239 -0.9239 0.3827 131.839 -102.3118)" width="3.496" x="140.731" y="39.504"/>
+<rect fill="#99CCCC" height="3.496" width="16" x="139" y="68.67"/>
+<rect fill="#99CCCC" height="16.003" transform="matrix(0.3837 -0.9234 0.9234 0.3837 1.4789 189.0872)" width="3.494" x="140.663" y="85.434"/>
+<rect fill="#99CCCC" height="16.02" transform="matrix(0.7079 -0.7063 0.7063 0.7079 -41.9346 124.3225)" width="3.498" x="127.606" y="104.856"/>
+</g>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/group/icons/qgn_graf_realplayer_splash_09.svg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="tiny" height="143px" version="1.1" viewBox="0 0 174 143" width="174px" x="0px" y="0px">
+<g>
+<rect fill="none" height="143" width="174"/>
+<polygon fill="#828282" points="74.024,96.548 74.024,96.548 74.024,87.955 79.305,87.955 79.305,89.406 75.759,89.406    75.759,91.314 78.525,91.314 78.525,92.768 75.759,92.768 75.759,95.096 79.383,95.096 79.383,96.548  "/>
+<path d="M88.227,96.547h-1.641v-3.17c0-0.669-0.035-1.104-0.105-1.301s-0.185-0.35-0.342-0.459   c-0.158-0.109-0.349-0.164-0.57-0.164c-0.285,0-0.54,0.078-0.767,0.234c-0.227,0.151-0.381,0.358-0.465,0.619   c-0.084,0.258-0.126,0.73-0.126,1.428v2.813h-1.64v-6.232h1.53v0.914c0.54-0.69,1.222-1.039,2.042-1.039   c0.361,0,0.692,0.063,0.992,0.195c0.299,0.131,0.525,0.297,0.68,0.5c0.153,0.203,0.264,0.434,0.32,0.69   c0.061,0.257,0.092,0.627,0.092,1.104V96.547L88.227,96.547z" fill="#828282"/>
+<path d="M91.711,92.221h-1.555c0.169-0.611,0.527-1.298,0.939-1.593c0.408-0.294,1.021-0.44,1.834-0.44   c0.732,0,1.279,0.088,1.644,0.265c0.36,0.175,0.614,0.396,0.761,0.659c0.148,0.27,0.223,0.762,0.223,1.476l-0.031,1.92   c0,0.55,0.025,0.95,0.078,1.21c0.057,0.264,0.151,0.537,0.297,0.834h-1.625c-0.043-0.104-0.096-0.266-0.155-0.479   c-0.027-0.096-0.05-0.155-0.062-0.188c-0.283,0.274-0.584,0.479-0.904,0.617c-0.317,0.14-0.66,0.206-1.023,0.206   c-0.645,0-1.146-0.174-1.52-0.521c-0.367-0.348-0.555-0.785-0.555-1.313c0-0.354,0.084-0.662,0.252-0.938   c0.168-0.271,0.403-0.483,0.707-0.631c0.303-0.146,0.74-0.273,1.313-0.384c0.771-0.146,1.305-0.276,1.603-0.401v-0.17   c0-0.322-0.078-0.553-0.236-0.688c-0.153-0.139-0.45-0.206-0.891-0.206c-0.295,0-0.525,0.062-0.688,0.177   C91.945,91.749,91.814,91.925,91.711,92.221 M93.932,93.596c-0.213,0.069-0.549,0.152-1.011,0.25   c-0.459,0.096-0.76,0.19-0.901,0.284c-0.215,0.149-0.324,0.343-0.324,0.575c0,0.229,0.091,0.427,0.264,0.593   c0.174,0.167,0.396,0.25,0.661,0.25c0.298,0,0.583-0.097,0.854-0.291c0.197-0.146,0.332-0.327,0.396-0.54   c0.044-0.14,0.065-0.404,0.065-0.797v-0.324" fill="#828282"/>
+<path d="M99.314,96.547v-8.594h1.641v3.102c0.507-0.578,1.107-0.867,1.802-0.867c0.757,0,1.382,0.275,1.877,0.824   c0.495,0.551,0.742,1.34,0.742,2.369c0,1.064-0.251,1.885-0.757,2.459c-0.504,0.576-1.115,0.863-1.836,0.863   c-0.354,0-0.703-0.092-1.047-0.273c-0.346-0.183-0.646-0.449-0.891-0.797v0.914H99.314 M100.922,93.316   c0,0.646,0.102,1.123,0.307,1.433c0.287,0.438,0.666,0.657,1.145,0.657c0.361,0,0.676-0.155,0.936-0.467   c0.258-0.313,0.387-0.805,0.387-1.476c0-0.712-0.131-1.229-0.391-1.542c-0.261-0.313-0.592-0.473-0.992-0.473   c-0.396,0-0.729,0.15-0.988,0.461C101.055,92.223,100.922,92.689,100.922,93.316" fill="#828282"/>
+<path d="M115.986,94.859h1.744c-0.211,0.602-0.545,1.059-0.998,1.373c-0.455,0.313-1.023,0.472-1.707,0.472   c-1.08,0-1.881-0.354-2.399-1.063c-0.409-0.564-0.614-1.283-0.614-2.146c0-1.033,0.271-1.845,0.809-2.431   c0.539-0.584,1.225-0.877,2.049-0.877c0.926,0,1.652,0.31,2.188,0.918c0.535,0.613,0.791,1.556,0.771,2.815H113.7   c0.012,0.488,0.144,0.868,0.397,1.14c0.252,0.272,0.564,0.408,0.943,0.408c0.257,0,0.477-0.07,0.646-0.212   C115.811,95.165,115.908,95.031,115.986,94.859 M116.184,92.906c-0.012-0.475-0.135-0.836-0.367-1.082   c-0.23-0.248-0.519-0.371-0.854-0.371c-0.357,0-0.654,0.131-0.889,0.391c-0.233,0.262-0.35,0.615-0.346,1.063H116.184   L116.184,92.906" fill="#828282"/>
+<path d="M126.186,96.547h-1.531v-0.914c-0.252,0.355-0.553,0.623-0.896,0.803c-0.344,0.182-0.69,0.271-1.042,0.271   c-0.713,0-1.322-0.289-1.83-0.865c-0.509-0.576-0.763-1.383-0.763-2.416c0-1.057,0.247-1.855,0.743-2.406   c0.492-0.553,1.119-0.824,1.877-0.824c0.693,0,1.295,0.289,1.802,0.867v-3.104h1.642v8.592L126.186,96.547 M121.811,93.316   c0,0.664,0.092,1.146,0.275,1.441c0.268,0.434,0.641,0.646,1.118,0.646c0.38,0,0.704-0.16,0.971-0.483   c0.267-0.321,0.4-0.806,0.4-1.446c0-0.718-0.13-1.23-0.39-1.55c-0.261-0.313-0.588-0.473-0.994-0.473   c-0.396,0-0.721,0.155-0.984,0.467C121.941,92.232,121.811,92.695,121.811,93.316" fill="#828282"/>
+<path d="M107.619,87.954h1.465v6.968c0,0.773,0.23,1.234,0.691,1.383c-0.229,0.43-0.613,0.646-1.16,0.646   c-0.664,0-0.996-0.461-0.996-1.385V87.954L107.619,87.954z" fill="#828282"/>
+<path d="M79.853,70.617c-1.015,0-2.356-0.167-2.356-0.167s-8.336,4.231-9.764,5.073   c-0.02-0.049,1.236-2.258,1.547-3.107c0.063-0.17-0.146-0.447-0.371-0.447c-0.582,0-1.314,0.101-2.509,0.095   c-11.423,0-16.711-5.935-16.711-8.958c0-4.03,6.263-8.743,15.843-8.743c4.238,0,10.453,0.671,13.107,2.34   c0.88-0.174,1.783-0.26,2.673-0.26c1.288,0,2.606,0.196,3.807,0.6l0,0c-6.327-4.967-12.986-6.204-19.587-6.204   c-12.972,0-21.33,5.268-21.33,11.995c0,6.767,10.156,12.78,21.33,12.78c0.688,0.021,1.232,0.121,1.04,0.559   c-0.184,0.417-2.91,4.688-3.744,6.221c-0.243,0.443,0.051,0.73,0.581,0.588l20.527-12.84l0,0   C82.847,70.432,81.506,70.617,79.853,70.617z" fill="#2976BB"/>
+<path d="M60.564,68.814h5.172l1.141-4.441c0.596-2.194,1.689-2.959,3.877-2.959c0.645,0,1.342,0.102,1.937,0.253   l0.994-3.571c-0.498-0.102-0.994-0.153-1.841-0.153c-1.289,0-2.979,0.818-3.875,1.939h-0.05l0.398-1.685h-4.969L60.564,68.814   L60.564,68.814z" fill="#FFFFFF"/>
+<path d="M78.344,62.333c0.417-1.124,1.353-1.787,2.762-1.787c1.406,0,2.084,0.612,2.084,1.43   c0,0.102-0.054,0.253-0.054,0.357H78.344L78.344,62.333 M82.197,65.75c-0.261,0.358-0.935,0.765-2.137,0.765   c-1.667,0-2.188-0.969-2.188-2.091h10.056c0.209-0.663,0.26-1.275,0.26-1.838c0-3.316-3.75-4.645-6.875-4.645   c-3.543,0-8.493,1.581-8.493,6.482c0,2.552,2.034,4.695,7.034,4.695c6.096,0,7.136-2.653,7.501-3.37h-5.157L82.197,65.75" fill="#FFFFFF"/>
+<path d="M93.861,65.801c0-0.816,0.875-1.12,1.75-1.225c0.977-0.051,1.955-0.101,2.828-0.459   c-0.358,1.581-1.078,2.602-2.881,2.602C94.736,66.719,93.861,66.514,93.861,65.801L93.861,65.801 M95.404,61.412   c0.31-0.766,1.082-1.071,2.111-1.071c0.82,0,1.692,0.203,1.692,0.918c0,1.326-2.419,1.123-3.911,1.223   c-4.013,0.206-6.734,0.972-6.734,3.781c0,2.04,2.105,2.856,4.521,2.856c1.545,0,3.352-0.46,4.271-1.327h0.054   c0,0.356,0.052,0.713,0.206,1.021h5.195c-0.207-0.461-0.104-0.103-0.207-0.919c0-0.716,1.696-5.462,1.696-7.146   c0-2.551-4.271-2.807-6.791-2.807c-3.396,0-6.276,0.665-7.103,3.472L95.404,61.412L95.404,61.412" fill="#FFFFFF"/>
+<polygon fill="#FFFFFF" points="104.313,68.815 104.313,68.815 109.523,68.815 113.418,54.217 108.207,54.217  "/>
+<polygon fill="#FFFFFF" points="115.221,66.548 115.221,66.548 114.289,66.548 114.289,68.96 113.516,68.96 113.516,66.548    112.584,66.548 112.584,65.971 115.221,65.971  "/>
+<polygon fill="#FFFFFF" points="119.084,68.96 119.084,68.96 118.313,68.96 118.313,66.958 117.762,68.258 117.229,68.258    116.68,66.958 116.68,68.96 115.943,68.96 115.943,65.971 116.848,65.971 117.516,67.471 118.184,65.971 119.084,65.971  "/>
+<rect fill="#99CCCC" height="16" width="3.496" x="85.231" y="2.39"/>
+<rect fill="#99CCCC" height="15.988" transform="matrix(-0.9241 -0.3821 0.3821 -0.9241 205.8219 70.7539)" width="3.494" x="108.19" y="6.946"/>
+<rect fill="#99CCCC" height="15.998" transform="matrix(0.7072 0.707 -0.707 0.7072 57.6263 -83.3022)" width="3.494" x="127.635" y="19.921"/>
+<rect fill="#99CCCC" height="15.991" transform="matrix(0.3827 0.9239 -0.9239 0.3827 131.839 -102.3118)" width="3.496" x="140.731" y="39.504"/>
+<rect fill="#99CCCC" height="3.496" width="16" x="139" y="68.67"/>
+<rect fill="#99CCCC" height="16.003" transform="matrix(0.3837 -0.9234 0.9234 0.3837 1.4789 189.0872)" width="3.494" x="140.663" y="85.434"/>
+<rect fill="#99CCCC" height="16.02" transform="matrix(0.7079 -0.7063 0.7063 0.7079 -41.9346 124.3225)" width="3.498" x="127.606" y="104.856"/>
+<rect fill="#99CCCC" height="15.98" transform="matrix(-0.9237 0.383 -0.383 -0.9237 259.5883 200.0274)" width="3.493" x="108.134" y="117.866"/>
+</g>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/group/icons/qgn_graf_realplayer_splash_10.svg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="tiny" height="143px" version="1.1" viewBox="0 0 174 143" width="174px" x="0px" y="0px">
+<g>
+<rect fill="none" height="143" width="174"/>
+<polygon fill="#828282" points="74.024,96.548 74.024,96.548 74.024,87.955 79.305,87.955 79.305,89.406 75.759,89.406    75.759,91.314 78.525,91.314 78.525,92.768 75.759,92.768 75.759,95.096 79.383,95.096 79.383,96.548  "/>
+<path d="M88.227,96.547h-1.641v-3.17c0-0.669-0.035-1.104-0.105-1.301s-0.185-0.35-0.342-0.459   c-0.158-0.109-0.349-0.164-0.57-0.164c-0.285,0-0.54,0.078-0.767,0.234c-0.227,0.151-0.381,0.358-0.465,0.619   c-0.084,0.258-0.126,0.73-0.126,1.428v2.813h-1.64v-6.232h1.53v0.914c0.54-0.69,1.222-1.039,2.042-1.039   c0.361,0,0.692,0.063,0.992,0.195c0.299,0.131,0.525,0.297,0.68,0.5c0.153,0.203,0.264,0.434,0.32,0.69   c0.061,0.257,0.092,0.627,0.092,1.104V96.547L88.227,96.547z" fill="#828282"/>
+<path d="M91.711,92.221h-1.555c0.169-0.611,0.527-1.298,0.939-1.593c0.408-0.294,1.021-0.44,1.834-0.44   c0.732,0,1.279,0.088,1.644,0.265c0.36,0.175,0.614,0.396,0.761,0.659c0.148,0.27,0.223,0.762,0.223,1.476l-0.031,1.92   c0,0.55,0.025,0.95,0.078,1.21c0.057,0.264,0.151,0.537,0.297,0.834h-1.625c-0.043-0.104-0.096-0.266-0.155-0.479   c-0.027-0.096-0.05-0.155-0.062-0.188c-0.283,0.274-0.584,0.479-0.904,0.617c-0.317,0.14-0.66,0.206-1.023,0.206   c-0.645,0-1.146-0.174-1.52-0.521c-0.367-0.348-0.555-0.785-0.555-1.313c0-0.354,0.084-0.662,0.252-0.938   c0.168-0.271,0.403-0.483,0.707-0.631c0.303-0.146,0.74-0.273,1.313-0.384c0.771-0.146,1.305-0.276,1.603-0.401v-0.17   c0-0.322-0.078-0.553-0.236-0.688c-0.153-0.139-0.45-0.206-0.891-0.206c-0.295,0-0.525,0.062-0.688,0.177   C91.945,91.749,91.814,91.925,91.711,92.221 M93.932,93.596c-0.213,0.069-0.549,0.152-1.011,0.25   c-0.459,0.096-0.76,0.19-0.901,0.284c-0.215,0.149-0.324,0.343-0.324,0.575c0,0.229,0.091,0.427,0.264,0.593   c0.174,0.167,0.396,0.25,0.661,0.25c0.298,0,0.583-0.097,0.854-0.291c0.197-0.146,0.332-0.327,0.396-0.54   c0.044-0.14,0.065-0.404,0.065-0.797v-0.324" fill="#828282"/>
+<path d="M99.314,96.547v-8.594h1.641v3.102c0.507-0.578,1.107-0.867,1.802-0.867c0.757,0,1.382,0.275,1.877,0.824   c0.495,0.551,0.742,1.34,0.742,2.369c0,1.064-0.251,1.885-0.757,2.459c-0.504,0.576-1.115,0.863-1.836,0.863   c-0.354,0-0.703-0.092-1.047-0.273c-0.346-0.183-0.646-0.449-0.891-0.797v0.914H99.314 M100.922,93.316   c0,0.646,0.102,1.123,0.307,1.433c0.287,0.438,0.666,0.657,1.145,0.657c0.361,0,0.676-0.155,0.936-0.467   c0.258-0.313,0.387-0.805,0.387-1.476c0-0.712-0.131-1.229-0.391-1.542c-0.261-0.313-0.592-0.473-0.992-0.473   c-0.396,0-0.729,0.15-0.988,0.461C101.055,92.223,100.922,92.689,100.922,93.316" fill="#828282"/>
+<path d="M115.986,94.859h1.744c-0.211,0.602-0.545,1.059-0.998,1.373c-0.455,0.313-1.023,0.472-1.707,0.472   c-1.08,0-1.881-0.354-2.399-1.063c-0.409-0.564-0.614-1.283-0.614-2.146c0-1.033,0.271-1.845,0.809-2.431   c0.539-0.584,1.225-0.877,2.049-0.877c0.926,0,1.652,0.31,2.188,0.918c0.535,0.613,0.791,1.556,0.771,2.815H113.7   c0.012,0.488,0.144,0.868,0.397,1.14c0.252,0.272,0.564,0.408,0.943,0.408c0.257,0,0.477-0.07,0.646-0.212   C115.811,95.165,115.908,95.031,115.986,94.859 M116.184,92.906c-0.012-0.475-0.135-0.836-0.367-1.082   c-0.23-0.248-0.519-0.371-0.854-0.371c-0.357,0-0.654,0.131-0.889,0.391c-0.233,0.262-0.35,0.615-0.346,1.063H116.184   L116.184,92.906" fill="#828282"/>
+<path d="M126.186,96.547h-1.531v-0.914c-0.252,0.355-0.553,0.623-0.896,0.803c-0.344,0.182-0.69,0.271-1.042,0.271   c-0.713,0-1.322-0.289-1.83-0.865c-0.509-0.576-0.763-1.383-0.763-2.416c0-1.057,0.247-1.855,0.743-2.406   c0.492-0.553,1.119-0.824,1.877-0.824c0.693,0,1.295,0.289,1.802,0.867v-3.104h1.642v8.592L126.186,96.547 M121.811,93.316   c0,0.664,0.092,1.146,0.275,1.441c0.268,0.434,0.641,0.646,1.118,0.646c0.38,0,0.704-0.16,0.971-0.483   c0.267-0.321,0.4-0.806,0.4-1.446c0-0.718-0.13-1.23-0.39-1.55c-0.261-0.313-0.588-0.473-0.994-0.473   c-0.396,0-0.721,0.155-0.984,0.467C121.941,92.232,121.811,92.695,121.811,93.316" fill="#828282"/>
+<path d="M107.619,87.954h1.465v6.968c0,0.773,0.23,1.234,0.691,1.383c-0.229,0.43-0.613,0.646-1.16,0.646   c-0.664,0-0.996-0.461-0.996-1.385V87.954L107.619,87.954z" fill="#828282"/>
+<path d="M79.853,70.617c-1.015,0-2.356-0.167-2.356-0.167s-8.336,4.231-9.764,5.073   c-0.02-0.049,1.236-2.258,1.547-3.107c0.063-0.17-0.146-0.447-0.371-0.447c-0.582,0-1.314,0.101-2.509,0.095   c-11.423,0-16.711-5.935-16.711-8.958c0-4.03,6.263-8.743,15.843-8.743c4.238,0,10.453,0.671,13.107,2.34   c0.88-0.174,1.783-0.26,2.673-0.26c1.288,0,2.606,0.196,3.807,0.6l0,0c-6.327-4.967-12.986-6.204-19.587-6.204   c-12.972,0-21.33,5.268-21.33,11.995c0,6.767,10.156,12.78,21.33,12.78c0.688,0.021,1.232,0.121,1.04,0.559   c-0.184,0.417-2.91,4.688-3.744,6.221c-0.243,0.443,0.051,0.73,0.581,0.588l20.527-12.84l0,0   C82.847,70.432,81.506,70.617,79.853,70.617z" fill="#2976BB"/>
+<path d="M60.564,68.814h5.172l1.141-4.441c0.596-2.194,1.689-2.959,3.877-2.959c0.645,0,1.342,0.102,1.937,0.253   l0.994-3.571c-0.498-0.102-0.994-0.153-1.841-0.153c-1.289,0-2.979,0.818-3.875,1.939h-0.05l0.398-1.685h-4.969L60.564,68.814   L60.564,68.814z" fill="#FFFFFF"/>
+<path d="M78.344,62.333c0.417-1.124,1.353-1.787,2.762-1.787c1.406,0,2.084,0.612,2.084,1.43   c0,0.102-0.054,0.253-0.054,0.357H78.344L78.344,62.333 M82.197,65.75c-0.261,0.358-0.935,0.765-2.137,0.765   c-1.667,0-2.188-0.969-2.188-2.091h10.056c0.209-0.663,0.26-1.275,0.26-1.838c0-3.316-3.75-4.645-6.875-4.645   c-3.543,0-8.493,1.581-8.493,6.482c0,2.552,2.034,4.695,7.034,4.695c6.096,0,7.136-2.653,7.501-3.37h-5.157L82.197,65.75" fill="#FFFFFF"/>
+<path d="M93.861,65.801c0-0.816,0.875-1.12,1.75-1.225c0.977-0.051,1.955-0.101,2.828-0.459   c-0.358,1.581-1.078,2.602-2.881,2.602C94.736,66.719,93.861,66.514,93.861,65.801L93.861,65.801 M95.404,61.412   c0.31-0.766,1.082-1.071,2.111-1.071c0.82,0,1.692,0.203,1.692,0.918c0,1.326-2.419,1.123-3.911,1.223   c-4.013,0.206-6.734,0.972-6.734,3.781c0,2.04,2.105,2.856,4.521,2.856c1.545,0,3.352-0.46,4.271-1.327h0.054   c0,0.356,0.052,0.713,0.206,1.021h5.195c-0.207-0.461-0.104-0.103-0.207-0.919c0-0.716,1.696-5.462,1.696-7.146   c0-2.551-4.271-2.807-6.791-2.807c-3.396,0-6.276,0.665-7.103,3.472L95.404,61.412L95.404,61.412" fill="#FFFFFF"/>
+<polygon fill="#FFFFFF" points="104.313,68.815 104.313,68.815 109.523,68.815 113.418,54.217 108.207,54.217  "/>
+<polygon fill="#FFFFFF" points="115.221,66.548 115.221,66.548 114.289,66.548 114.289,68.96 113.516,68.96 113.516,66.548    112.584,66.548 112.584,65.971 115.221,65.971  "/>
+<polygon fill="#FFFFFF" points="119.084,68.96 119.084,68.96 118.313,68.96 118.313,66.958 117.762,68.258 117.229,68.258    116.68,66.958 116.68,68.96 115.943,68.96 115.943,65.971 116.848,65.971 117.516,67.471 118.184,65.971 119.084,65.971  "/>
+<rect fill="#99CCCC" height="16" width="3.496" x="85.231" y="2.39"/>
+<rect fill="#99CCCC" height="15.988" transform="matrix(-0.9241 -0.3821 0.3821 -0.9241 205.8219 70.7539)" width="3.494" x="108.19" y="6.946"/>
+<rect fill="#99CCCC" height="15.998" transform="matrix(0.7072 0.707 -0.707 0.7072 57.6263 -83.3022)" width="3.494" x="127.635" y="19.921"/>
+<rect fill="#99CCCC" height="15.991" transform="matrix(0.3827 0.9239 -0.9239 0.3827 131.839 -102.3118)" width="3.496" x="140.731" y="39.504"/>
+<rect fill="#99CCCC" height="3.496" width="16" x="139" y="68.67"/>
+<rect fill="#99CCCC" height="16.003" transform="matrix(0.3837 -0.9234 0.9234 0.3837 1.4789 189.0872)" width="3.494" x="140.663" y="85.434"/>
+<rect fill="#99CCCC" height="16.02" transform="matrix(0.7079 -0.7063 0.7063 0.7079 -41.9346 124.3225)" width="3.498" x="127.606" y="104.856"/>
+<rect fill="#99CCCC" height="15.98" transform="matrix(-0.9237 0.383 -0.383 -0.9237 259.5883 200.0274)" width="3.493" x="108.134" y="117.866"/>
+<rect fill="#99CCCC" height="16" width="3.495" x="85.216" y="122.391"/>
+</g>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/group/icons/qgn_graf_realplayer_splash_11.svg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="tiny" height="143px" version="1.1" viewBox="0 0 174 143" width="174px" x="0px" y="0px">
+<g>
+<rect fill="none" height="143" width="174"/>
+<polygon fill="#828282" points="74.024,96.548 74.024,96.548 74.024,87.955 79.305,87.955 79.305,89.406 75.759,89.406    75.759,91.314 78.525,91.314 78.525,92.768 75.759,92.768 75.759,95.096 79.383,95.096 79.383,96.548  "/>
+<path d="M88.227,96.547h-1.641v-3.17c0-0.669-0.035-1.104-0.105-1.301s-0.185-0.35-0.342-0.459   c-0.158-0.109-0.349-0.164-0.57-0.164c-0.285,0-0.54,0.078-0.767,0.234c-0.227,0.151-0.381,0.358-0.465,0.619   c-0.084,0.258-0.126,0.73-0.126,1.428v2.813h-1.64v-6.232h1.53v0.914c0.54-0.69,1.222-1.039,2.042-1.039   c0.361,0,0.692,0.063,0.992,0.195c0.299,0.131,0.525,0.297,0.68,0.5c0.153,0.203,0.264,0.434,0.32,0.69   c0.061,0.257,0.092,0.627,0.092,1.104V96.547L88.227,96.547z" fill="#828282"/>
+<path d="M91.711,92.221h-1.555c0.169-0.611,0.527-1.298,0.939-1.593c0.408-0.294,1.021-0.44,1.834-0.44   c0.732,0,1.279,0.088,1.644,0.265c0.36,0.175,0.614,0.396,0.761,0.659c0.148,0.27,0.223,0.762,0.223,1.476l-0.031,1.92   c0,0.55,0.025,0.95,0.078,1.21c0.057,0.264,0.151,0.537,0.297,0.834h-1.625c-0.043-0.104-0.096-0.266-0.155-0.479   c-0.027-0.096-0.05-0.155-0.062-0.188c-0.283,0.274-0.584,0.479-0.904,0.617c-0.317,0.14-0.66,0.206-1.023,0.206   c-0.645,0-1.146-0.174-1.52-0.521c-0.367-0.348-0.555-0.785-0.555-1.313c0-0.354,0.084-0.662,0.252-0.938   c0.168-0.271,0.403-0.483,0.707-0.631c0.303-0.146,0.74-0.273,1.313-0.384c0.771-0.146,1.305-0.276,1.603-0.401v-0.17   c0-0.322-0.078-0.553-0.236-0.688c-0.153-0.139-0.45-0.206-0.891-0.206c-0.295,0-0.525,0.062-0.688,0.177   C91.945,91.749,91.814,91.925,91.711,92.221 M93.932,93.596c-0.213,0.069-0.549,0.152-1.011,0.25   c-0.459,0.096-0.76,0.19-0.901,0.284c-0.215,0.149-0.324,0.343-0.324,0.575c0,0.229,0.091,0.427,0.264,0.593   c0.174,0.167,0.396,0.25,0.661,0.25c0.298,0,0.583-0.097,0.854-0.291c0.197-0.146,0.332-0.327,0.396-0.54   c0.044-0.14,0.065-0.404,0.065-0.797v-0.324" fill="#828282"/>
+<path d="M99.314,96.547v-8.594h1.641v3.102c0.507-0.578,1.107-0.867,1.802-0.867c0.757,0,1.382,0.275,1.877,0.824   c0.495,0.551,0.742,1.34,0.742,2.369c0,1.064-0.251,1.885-0.757,2.459c-0.504,0.576-1.115,0.863-1.836,0.863   c-0.354,0-0.703-0.092-1.047-0.273c-0.346-0.183-0.646-0.449-0.891-0.797v0.914H99.314 M100.922,93.316   c0,0.646,0.102,1.123,0.307,1.433c0.287,0.438,0.666,0.657,1.145,0.657c0.361,0,0.676-0.155,0.936-0.467   c0.258-0.313,0.387-0.805,0.387-1.476c0-0.712-0.131-1.229-0.391-1.542c-0.261-0.313-0.592-0.473-0.992-0.473   c-0.396,0-0.729,0.15-0.988,0.461C101.055,92.223,100.922,92.689,100.922,93.316" fill="#828282"/>
+<path d="M115.986,94.859h1.744c-0.211,0.602-0.545,1.059-0.998,1.373c-0.455,0.313-1.023,0.472-1.707,0.472   c-1.08,0-1.881-0.354-2.399-1.063c-0.409-0.564-0.614-1.283-0.614-2.146c0-1.033,0.271-1.845,0.809-2.431   c0.539-0.584,1.225-0.877,2.049-0.877c0.926,0,1.652,0.31,2.188,0.918c0.535,0.613,0.791,1.556,0.771,2.815H113.7   c0.012,0.488,0.144,0.868,0.397,1.14c0.252,0.272,0.564,0.408,0.943,0.408c0.257,0,0.477-0.07,0.646-0.212   C115.811,95.165,115.908,95.031,115.986,94.859 M116.184,92.906c-0.012-0.475-0.135-0.836-0.367-1.082   c-0.23-0.248-0.519-0.371-0.854-0.371c-0.357,0-0.654,0.131-0.889,0.391c-0.233,0.262-0.35,0.615-0.346,1.063H116.184   L116.184,92.906" fill="#828282"/>
+<path d="M126.186,96.547h-1.531v-0.914c-0.252,0.355-0.553,0.623-0.896,0.803c-0.344,0.182-0.69,0.271-1.042,0.271   c-0.713,0-1.322-0.289-1.83-0.865c-0.509-0.576-0.763-1.383-0.763-2.416c0-1.057,0.247-1.855,0.743-2.406   c0.492-0.553,1.119-0.824,1.877-0.824c0.693,0,1.295,0.289,1.802,0.867v-3.104h1.642v8.592L126.186,96.547 M121.811,93.316   c0,0.664,0.092,1.146,0.275,1.441c0.268,0.434,0.641,0.646,1.118,0.646c0.38,0,0.704-0.16,0.971-0.483   c0.267-0.321,0.4-0.806,0.4-1.446c0-0.718-0.13-1.23-0.39-1.55c-0.261-0.313-0.588-0.473-0.994-0.473   c-0.396,0-0.721,0.155-0.984,0.467C121.941,92.232,121.811,92.695,121.811,93.316" fill="#828282"/>
+<path d="M107.619,87.954h1.465v6.968c0,0.773,0.23,1.234,0.691,1.383c-0.229,0.43-0.613,0.646-1.16,0.646   c-0.664,0-0.996-0.461-0.996-1.385V87.954L107.619,87.954z" fill="#828282"/>
+<path d="M79.853,70.617c-1.015,0-2.356-0.167-2.356-0.167s-8.336,4.231-9.764,5.073   c-0.02-0.049,1.236-2.258,1.547-3.107c0.063-0.17-0.146-0.447-0.371-0.447c-0.582,0-1.314,0.101-2.509,0.095   c-11.423,0-16.711-5.935-16.711-8.958c0-4.03,6.263-8.743,15.843-8.743c4.238,0,10.453,0.671,13.107,2.34   c0.88-0.174,1.783-0.26,2.673-0.26c1.288,0,2.606,0.196,3.807,0.6l0,0c-6.327-4.967-12.986-6.204-19.587-6.204   c-12.972,0-21.33,5.268-21.33,11.995c0,6.767,10.156,12.78,21.33,12.78c0.688,0.021,1.232,0.121,1.04,0.559   c-0.184,0.417-2.91,4.688-3.744,6.221c-0.243,0.443,0.051,0.73,0.581,0.588l20.527-12.84l0,0   C82.847,70.432,81.506,70.617,79.853,70.617z" fill="#2976BB"/>
+<path d="M60.564,68.814h5.172l1.141-4.441c0.596-2.194,1.689-2.959,3.877-2.959c0.645,0,1.342,0.102,1.937,0.253   l0.994-3.571c-0.498-0.102-0.994-0.153-1.841-0.153c-1.289,0-2.979,0.818-3.875,1.939h-0.05l0.398-1.685h-4.969L60.564,68.814   L60.564,68.814z" fill="#FFFFFF"/>
+<path d="M78.344,62.333c0.417-1.124,1.353-1.787,2.762-1.787c1.406,0,2.084,0.612,2.084,1.43   c0,0.102-0.054,0.253-0.054,0.357H78.344L78.344,62.333 M82.197,65.75c-0.261,0.358-0.935,0.765-2.137,0.765   c-1.667,0-2.188-0.969-2.188-2.091h10.056c0.209-0.663,0.26-1.275,0.26-1.838c0-3.316-3.75-4.645-6.875-4.645   c-3.543,0-8.493,1.581-8.493,6.482c0,2.552,2.034,4.695,7.034,4.695c6.096,0,7.136-2.653,7.501-3.37h-5.157L82.197,65.75" fill="#FFFFFF"/>
+<path d="M93.861,65.801c0-0.816,0.875-1.12,1.75-1.225c0.977-0.051,1.955-0.101,2.828-0.459   c-0.358,1.581-1.078,2.602-2.881,2.602C94.736,66.719,93.861,66.514,93.861,65.801L93.861,65.801 M95.404,61.412   c0.31-0.766,1.082-1.071,2.111-1.071c0.82,0,1.692,0.203,1.692,0.918c0,1.326-2.419,1.123-3.911,1.223   c-4.013,0.206-6.734,0.972-6.734,3.781c0,2.04,2.105,2.856,4.521,2.856c1.545,0,3.352-0.46,4.271-1.327h0.054   c0,0.356,0.052,0.713,0.206,1.021h5.195c-0.207-0.461-0.104-0.103-0.207-0.919c0-0.716,1.696-5.462,1.696-7.146   c0-2.551-4.271-2.807-6.791-2.807c-3.396,0-6.276,0.665-7.103,3.472L95.404,61.412L95.404,61.412" fill="#FFFFFF"/>
+<polygon fill="#FFFFFF" points="104.313,68.815 104.313,68.815 109.523,68.815 113.418,54.217 108.207,54.217  "/>
+<polygon fill="#FFFFFF" points="115.221,66.548 115.221,66.548 114.289,66.548 114.289,68.96 113.516,68.96 113.516,66.548    112.584,66.548 112.584,65.971 115.221,65.971  "/>
+<polygon fill="#FFFFFF" points="119.084,68.96 119.084,68.96 118.313,68.96 118.313,66.958 117.762,68.258 117.229,68.258    116.68,66.958 116.68,68.96 115.943,68.96 115.943,65.971 116.848,65.971 117.516,67.471 118.184,65.971 119.084,65.971  "/>
+<rect fill="#99CCCC" height="16" width="3.496" x="85.231" y="2.39"/>
+<rect fill="#99CCCC" height="15.988" transform="matrix(-0.9241 -0.3821 0.3821 -0.9241 205.8219 70.7539)" width="3.494" x="108.19" y="6.946"/>
+<rect fill="#99CCCC" height="15.998" transform="matrix(0.7072 0.707 -0.707 0.7072 57.6263 -83.3022)" width="3.494" x="127.635" y="19.921"/>
+<rect fill="#99CCCC" height="15.991" transform="matrix(0.3827 0.9239 -0.9239 0.3827 131.839 -102.3118)" width="3.496" x="140.731" y="39.504"/>
+<rect fill="#99CCCC" height="3.496" width="16" x="139" y="68.67"/>
+<rect fill="#99CCCC" height="16.003" transform="matrix(0.3837 -0.9234 0.9234 0.3837 1.4789 189.0872)" width="3.494" x="140.663" y="85.434"/>
+<rect fill="#99CCCC" height="16.02" transform="matrix(0.7079 -0.7063 0.7063 0.7079 -41.9346 124.3225)" width="3.498" x="127.606" y="104.856"/>
+<rect fill="#99CCCC" height="15.98" transform="matrix(-0.9237 0.383 -0.383 -0.9237 259.5883 200.0274)" width="3.493" x="108.134" y="117.866"/>
+<rect fill="#99CCCC" height="16" width="3.495" x="85.216" y="122.391"/>
+<rect fill="#99CCCC" height="15.997" transform="matrix(0.9238 0.3828 -0.3828 0.9238 53.0481 -14.9199)" width="3.495" x="62.265" y="117.832"/>
+</g>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/group/icons/qgn_graf_realplayer_splash_12.svg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="tiny" height="143px" version="1.1" viewBox="0 0 174 143" width="174px" x="0px" y="0px">
+<g>
+<rect fill="none" height="143" width="174"/>
+<polygon fill="#828282" points="74.024,96.548 74.024,96.548 74.024,87.955 79.305,87.955 79.305,89.406 75.759,89.406    75.759,91.314 78.525,91.314 78.525,92.768 75.759,92.768 75.759,95.096 79.383,95.096 79.383,96.548  "/>
+<path d="M88.227,96.547h-1.641v-3.17c0-0.669-0.035-1.104-0.105-1.301s-0.185-0.35-0.342-0.459   c-0.158-0.109-0.349-0.164-0.57-0.164c-0.285,0-0.54,0.078-0.767,0.234c-0.227,0.151-0.381,0.358-0.465,0.619   c-0.084,0.258-0.126,0.73-0.126,1.428v2.813h-1.64v-6.232h1.53v0.914c0.54-0.69,1.222-1.039,2.042-1.039   c0.361,0,0.692,0.063,0.992,0.195c0.299,0.131,0.525,0.297,0.68,0.5c0.153,0.203,0.264,0.434,0.32,0.69   c0.061,0.257,0.092,0.627,0.092,1.104V96.547L88.227,96.547z" fill="#828282"/>
+<path d="M91.711,92.221h-1.555c0.169-0.611,0.527-1.298,0.939-1.593c0.408-0.294,1.021-0.44,1.834-0.44   c0.732,0,1.279,0.088,1.644,0.265c0.36,0.175,0.614,0.396,0.761,0.659c0.148,0.27,0.223,0.762,0.223,1.476l-0.031,1.92   c0,0.55,0.025,0.95,0.078,1.21c0.057,0.264,0.151,0.537,0.297,0.834h-1.625c-0.043-0.104-0.096-0.266-0.155-0.479   c-0.027-0.096-0.05-0.155-0.062-0.188c-0.283,0.274-0.584,0.479-0.904,0.617c-0.317,0.14-0.66,0.206-1.023,0.206   c-0.645,0-1.146-0.174-1.52-0.521c-0.367-0.348-0.555-0.785-0.555-1.313c0-0.354,0.084-0.662,0.252-0.938   c0.168-0.271,0.403-0.483,0.707-0.631c0.303-0.146,0.74-0.273,1.313-0.384c0.771-0.146,1.305-0.276,1.603-0.401v-0.17   c0-0.322-0.078-0.553-0.236-0.688c-0.153-0.139-0.45-0.206-0.891-0.206c-0.295,0-0.525,0.062-0.688,0.177   C91.945,91.749,91.814,91.925,91.711,92.221 M93.932,93.596c-0.213,0.069-0.549,0.152-1.011,0.25   c-0.459,0.096-0.76,0.19-0.901,0.284c-0.215,0.149-0.324,0.343-0.324,0.575c0,0.229,0.091,0.427,0.264,0.593   c0.174,0.167,0.396,0.25,0.661,0.25c0.298,0,0.583-0.097,0.854-0.291c0.197-0.146,0.332-0.327,0.396-0.54   c0.044-0.14,0.065-0.404,0.065-0.797v-0.324" fill="#828282"/>
+<path d="M99.314,96.547v-8.594h1.641v3.102c0.507-0.578,1.107-0.867,1.802-0.867c0.757,0,1.382,0.275,1.877,0.824   c0.495,0.551,0.742,1.34,0.742,2.369c0,1.064-0.251,1.885-0.757,2.459c-0.504,0.576-1.115,0.863-1.836,0.863   c-0.354,0-0.703-0.092-1.047-0.273c-0.346-0.183-0.646-0.449-0.891-0.797v0.914H99.314 M100.922,93.316   c0,0.646,0.102,1.123,0.307,1.433c0.287,0.438,0.666,0.657,1.145,0.657c0.361,0,0.676-0.155,0.936-0.467   c0.258-0.313,0.387-0.805,0.387-1.476c0-0.712-0.131-1.229-0.391-1.542c-0.261-0.313-0.592-0.473-0.992-0.473   c-0.396,0-0.729,0.15-0.988,0.461C101.055,92.223,100.922,92.689,100.922,93.316" fill="#828282"/>
+<path d="M115.986,94.859h1.744c-0.211,0.602-0.545,1.059-0.998,1.373c-0.455,0.313-1.023,0.472-1.707,0.472   c-1.08,0-1.881-0.354-2.399-1.063c-0.409-0.564-0.614-1.283-0.614-2.146c0-1.033,0.271-1.845,0.809-2.431   c0.539-0.584,1.225-0.877,2.049-0.877c0.926,0,1.652,0.31,2.188,0.918c0.535,0.613,0.791,1.556,0.771,2.815H113.7   c0.012,0.488,0.144,0.868,0.397,1.14c0.252,0.272,0.564,0.408,0.943,0.408c0.257,0,0.477-0.07,0.646-0.212   C115.811,95.165,115.908,95.031,115.986,94.859 M116.184,92.906c-0.012-0.475-0.135-0.836-0.367-1.082   c-0.23-0.248-0.519-0.371-0.854-0.371c-0.357,0-0.654,0.131-0.889,0.391c-0.233,0.262-0.35,0.615-0.346,1.063H116.184   L116.184,92.906" fill="#828282"/>
+<path d="M126.186,96.547h-1.531v-0.914c-0.252,0.355-0.553,0.623-0.896,0.803c-0.344,0.182-0.69,0.271-1.042,0.271   c-0.713,0-1.322-0.289-1.83-0.865c-0.509-0.576-0.763-1.383-0.763-2.416c0-1.057,0.247-1.855,0.743-2.406   c0.492-0.553,1.119-0.824,1.877-0.824c0.693,0,1.295,0.289,1.802,0.867v-3.104h1.642v8.592L126.186,96.547 M121.811,93.316   c0,0.664,0.092,1.146,0.275,1.441c0.268,0.434,0.641,0.646,1.118,0.646c0.38,0,0.704-0.16,0.971-0.483   c0.267-0.321,0.4-0.806,0.4-1.446c0-0.718-0.13-1.23-0.39-1.55c-0.261-0.313-0.588-0.473-0.994-0.473   c-0.396,0-0.721,0.155-0.984,0.467C121.941,92.232,121.811,92.695,121.811,93.316" fill="#828282"/>
+<path d="M107.619,87.954h1.465v6.968c0,0.773,0.23,1.234,0.691,1.383c-0.229,0.43-0.613,0.646-1.16,0.646   c-0.664,0-0.996-0.461-0.996-1.385V87.954L107.619,87.954z" fill="#828282"/>
+<path d="M79.853,70.617c-1.015,0-2.356-0.167-2.356-0.167s-8.336,4.231-9.764,5.073   c-0.02-0.049,1.236-2.258,1.547-3.107c0.063-0.17-0.146-0.447-0.371-0.447c-0.582,0-1.314,0.101-2.509,0.095   c-11.423,0-16.711-5.935-16.711-8.958c0-4.03,6.263-8.743,15.843-8.743c4.238,0,10.453,0.671,13.107,2.34   c0.88-0.174,1.783-0.26,2.673-0.26c1.288,0,2.606,0.196,3.807,0.6l0,0c-6.327-4.967-12.986-6.204-19.587-6.204   c-12.972,0-21.33,5.268-21.33,11.995c0,6.767,10.156,12.78,21.33,12.78c0.688,0.021,1.232,0.121,1.04,0.559   c-0.184,0.417-2.91,4.688-3.744,6.221c-0.243,0.443,0.051,0.73,0.581,0.588l20.527-12.84l0,0   C82.847,70.432,81.506,70.617,79.853,70.617z" fill="#2976BB"/>
+<path d="M60.564,68.814h5.172l1.141-4.441c0.596-2.194,1.689-2.959,3.877-2.959c0.645,0,1.342,0.102,1.937,0.253   l0.994-3.571c-0.498-0.102-0.994-0.153-1.841-0.153c-1.289,0-2.979,0.818-3.875,1.939h-0.05l0.398-1.685h-4.969L60.564,68.814   L60.564,68.814z" fill="#FFFFFF"/>
+<path d="M78.344,62.333c0.417-1.124,1.353-1.787,2.762-1.787c1.406,0,2.084,0.612,2.084,1.43   c0,0.102-0.054,0.253-0.054,0.357H78.344L78.344,62.333 M82.197,65.75c-0.261,0.358-0.935,0.765-2.137,0.765   c-1.667,0-2.188-0.969-2.188-2.091h10.056c0.209-0.663,0.26-1.275,0.26-1.838c0-3.316-3.75-4.645-6.875-4.645   c-3.543,0-8.493,1.581-8.493,6.482c0,2.552,2.034,4.695,7.034,4.695c6.096,0,7.136-2.653,7.501-3.37h-5.157L82.197,65.75" fill="#FFFFFF"/>
+<path d="M93.861,65.801c0-0.816,0.875-1.12,1.75-1.225c0.977-0.051,1.955-0.101,2.828-0.459   c-0.358,1.581-1.078,2.602-2.881,2.602C94.736,66.719,93.861,66.514,93.861,65.801L93.861,65.801 M95.404,61.412   c0.31-0.766,1.082-1.071,2.111-1.071c0.82,0,1.692,0.203,1.692,0.918c0,1.326-2.419,1.123-3.911,1.223   c-4.013,0.206-6.734,0.972-6.734,3.781c0,2.04,2.105,2.856,4.521,2.856c1.545,0,3.352-0.46,4.271-1.327h0.054   c0,0.356,0.052,0.713,0.206,1.021h5.195c-0.207-0.461-0.104-0.103-0.207-0.919c0-0.716,1.696-5.462,1.696-7.146   c0-2.551-4.271-2.807-6.791-2.807c-3.396,0-6.276,0.665-7.103,3.472L95.404,61.412L95.404,61.412" fill="#FFFFFF"/>
+<polygon fill="#FFFFFF" points="104.313,68.815 104.313,68.815 109.523,68.815 113.418,54.217 108.207,54.217  "/>
+<polygon fill="#FFFFFF" points="115.221,66.548 115.221,66.548 114.289,66.548 114.289,68.96 113.516,68.96 113.516,66.548    112.584,66.548 112.584,65.971 115.221,65.971  "/>
+<polygon fill="#FFFFFF" points="119.084,68.96 119.084,68.96 118.313,68.96 118.313,66.958 117.762,68.258 117.229,68.258    116.68,66.958 116.68,68.96 115.943,68.96 115.943,65.971 116.848,65.971 117.516,67.471 118.184,65.971 119.084,65.971  "/>
+<rect fill="#99CCCC" height="16" width="3.496" x="85.231" y="2.39"/>
+<rect fill="#99CCCC" height="15.988" transform="matrix(-0.9241 -0.3821 0.3821 -0.9241 205.8219 70.7539)" width="3.494" x="108.19" y="6.946"/>
+<rect fill="#99CCCC" height="15.998" transform="matrix(0.7072 0.707 -0.707 0.7072 57.6263 -83.3022)" width="3.494" x="127.635" y="19.921"/>
+<rect fill="#99CCCC" height="15.991" transform="matrix(0.3827 0.9239 -0.9239 0.3827 131.839 -102.3118)" width="3.496" x="140.731" y="39.504"/>
+<rect fill="#99CCCC" height="3.496" width="16" x="139" y="68.67"/>
+<rect fill="#99CCCC" height="16.003" transform="matrix(0.3837 -0.9234 0.9234 0.3837 1.4789 189.0872)" width="3.494" x="140.663" y="85.434"/>
+<rect fill="#99CCCC" height="16.02" transform="matrix(0.7079 -0.7063 0.7063 0.7079 -41.9346 124.3225)" width="3.498" x="127.606" y="104.856"/>
+<rect fill="#99CCCC" height="15.98" transform="matrix(-0.9237 0.383 -0.383 -0.9237 259.5883 200.0274)" width="3.493" x="108.134" y="117.866"/>
+<rect fill="#99CCCC" height="16" width="3.495" x="85.216" y="122.391"/>
+<rect fill="#99CCCC" height="15.997" transform="matrix(0.9238 0.3828 -0.3828 0.9238 53.0481 -14.9199)" width="3.495" x="62.265" y="117.832"/>
+<rect fill="#99CCCC" height="16.01" transform="matrix(-0.7073 -0.7069 0.7069 -0.7073 -3.6993 224.0054)" width="3.492" x="42.778" y="104.764"/>
+</g>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/group/icons/qgn_graf_realplayer_splash_13.svg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="tiny" height="143px" version="1.1" viewBox="0 0 174 143" width="174px" x="0px" y="0px">
+<g>
+<rect fill="none" height="143" width="174"/>
+<polygon fill="#828282" points="74.024,96.548 74.024,96.548 74.024,87.955 79.305,87.955 79.305,89.406 75.759,89.406    75.759,91.314 78.525,91.314 78.525,92.768 75.759,92.768 75.759,95.096 79.383,95.096 79.383,96.548  "/>
+<path d="M88.227,96.547h-1.641v-3.17c0-0.669-0.035-1.104-0.105-1.301s-0.185-0.35-0.342-0.459   c-0.158-0.109-0.349-0.164-0.57-0.164c-0.285,0-0.54,0.078-0.767,0.234c-0.227,0.151-0.381,0.358-0.465,0.619   c-0.084,0.258-0.126,0.73-0.126,1.428v2.813h-1.64v-6.232h1.53v0.914c0.54-0.69,1.222-1.039,2.042-1.039   c0.361,0,0.692,0.063,0.992,0.195c0.299,0.131,0.525,0.297,0.68,0.5c0.153,0.203,0.264,0.434,0.32,0.69   c0.061,0.257,0.092,0.627,0.092,1.104V96.547L88.227,96.547z" fill="#828282"/>
+<path d="M91.711,92.221h-1.555c0.169-0.611,0.527-1.298,0.939-1.593c0.408-0.294,1.021-0.44,1.834-0.44   c0.732,0,1.279,0.088,1.644,0.265c0.36,0.175,0.614,0.396,0.761,0.659c0.148,0.27,0.223,0.762,0.223,1.476l-0.031,1.92   c0,0.55,0.025,0.95,0.078,1.21c0.057,0.264,0.151,0.537,0.297,0.834h-1.625c-0.043-0.104-0.096-0.266-0.155-0.479   c-0.027-0.096-0.05-0.155-0.062-0.188c-0.283,0.274-0.584,0.479-0.904,0.617c-0.317,0.14-0.66,0.206-1.023,0.206   c-0.645,0-1.146-0.174-1.52-0.521c-0.367-0.348-0.555-0.785-0.555-1.313c0-0.354,0.084-0.662,0.252-0.938   c0.168-0.271,0.403-0.483,0.707-0.631c0.303-0.146,0.74-0.273,1.313-0.384c0.771-0.146,1.305-0.276,1.603-0.401v-0.17   c0-0.322-0.078-0.553-0.236-0.688c-0.153-0.139-0.45-0.206-0.891-0.206c-0.295,0-0.525,0.062-0.688,0.177   C91.945,91.749,91.814,91.925,91.711,92.221 M93.932,93.596c-0.213,0.069-0.549,0.152-1.011,0.25   c-0.459,0.096-0.76,0.19-0.901,0.284c-0.215,0.149-0.324,0.343-0.324,0.575c0,0.229,0.091,0.427,0.264,0.593   c0.174,0.167,0.396,0.25,0.661,0.25c0.298,0,0.583-0.097,0.854-0.291c0.197-0.146,0.332-0.327,0.396-0.54   c0.044-0.14,0.065-0.404,0.065-0.797v-0.324" fill="#828282"/>
+<path d="M99.314,96.547v-8.594h1.641v3.102c0.507-0.578,1.107-0.867,1.802-0.867c0.757,0,1.382,0.275,1.877,0.824   c0.495,0.551,0.742,1.34,0.742,2.369c0,1.064-0.251,1.885-0.757,2.459c-0.504,0.576-1.115,0.863-1.836,0.863   c-0.354,0-0.703-0.092-1.047-0.273c-0.346-0.183-0.646-0.449-0.891-0.797v0.914H99.314 M100.922,93.316   c0,0.646,0.102,1.123,0.307,1.433c0.287,0.438,0.666,0.657,1.145,0.657c0.361,0,0.676-0.155,0.936-0.467   c0.258-0.313,0.387-0.805,0.387-1.476c0-0.712-0.131-1.229-0.391-1.542c-0.261-0.313-0.592-0.473-0.992-0.473   c-0.396,0-0.729,0.15-0.988,0.461C101.055,92.223,100.922,92.689,100.922,93.316" fill="#828282"/>
+<path d="M115.986,94.859h1.744c-0.211,0.602-0.545,1.059-0.998,1.373c-0.455,0.313-1.023,0.472-1.707,0.472   c-1.08,0-1.881-0.354-2.399-1.063c-0.409-0.564-0.614-1.283-0.614-2.146c0-1.033,0.271-1.845,0.809-2.431   c0.539-0.584,1.225-0.877,2.049-0.877c0.926,0,1.652,0.31,2.188,0.918c0.535,0.613,0.791,1.556,0.771,2.815H113.7   c0.012,0.488,0.144,0.868,0.397,1.14c0.252,0.272,0.564,0.408,0.943,0.408c0.257,0,0.477-0.07,0.646-0.212   C115.811,95.165,115.908,95.031,115.986,94.859 M116.184,92.906c-0.012-0.475-0.135-0.836-0.367-1.082   c-0.23-0.248-0.519-0.371-0.854-0.371c-0.357,0-0.654,0.131-0.889,0.391c-0.233,0.262-0.35,0.615-0.346,1.063H116.184   L116.184,92.906" fill="#828282"/>
+<path d="M126.186,96.547h-1.531v-0.914c-0.252,0.355-0.553,0.623-0.896,0.803c-0.344,0.182-0.69,0.271-1.042,0.271   c-0.713,0-1.322-0.289-1.83-0.865c-0.509-0.576-0.763-1.383-0.763-2.416c0-1.057,0.247-1.855,0.743-2.406   c0.492-0.553,1.119-0.824,1.877-0.824c0.693,0,1.295,0.289,1.802,0.867v-3.104h1.642v8.592L126.186,96.547 M121.811,93.316   c0,0.664,0.092,1.146,0.275,1.441c0.268,0.434,0.641,0.646,1.118,0.646c0.38,0,0.704-0.16,0.971-0.483   c0.267-0.321,0.4-0.806,0.4-1.446c0-0.718-0.13-1.23-0.39-1.55c-0.261-0.313-0.588-0.473-0.994-0.473   c-0.396,0-0.721,0.155-0.984,0.467C121.941,92.232,121.811,92.695,121.811,93.316" fill="#828282"/>
+<path d="M107.619,87.954h1.465v6.968c0,0.773,0.23,1.234,0.691,1.383c-0.229,0.43-0.613,0.646-1.16,0.646   c-0.664,0-0.996-0.461-0.996-1.385V87.954L107.619,87.954z" fill="#828282"/>
+<path d="M79.853,70.617c-1.015,0-2.356-0.167-2.356-0.167s-8.336,4.231-9.764,5.073   c-0.02-0.049,1.236-2.258,1.547-3.107c0.063-0.17-0.146-0.447-0.371-0.447c-0.582,0-1.314,0.101-2.509,0.095   c-11.423,0-16.711-5.935-16.711-8.958c0-4.03,6.263-8.743,15.843-8.743c4.238,0,10.453,0.671,13.107,2.34   c0.88-0.174,1.783-0.26,2.673-0.26c1.288,0,2.606,0.196,3.807,0.6l0,0c-6.327-4.967-12.986-6.204-19.587-6.204   c-12.972,0-21.33,5.268-21.33,11.995c0,6.767,10.156,12.78,21.33,12.78c0.688,0.021,1.232,0.121,1.04,0.559   c-0.184,0.417-2.91,4.688-3.744,6.221c-0.243,0.443,0.051,0.73,0.581,0.588l20.527-12.84l0,0   C82.847,70.432,81.506,70.617,79.853,70.617z" fill="#2976BB"/>
+<path d="M60.564,68.814h5.172l1.141-4.441c0.596-2.194,1.689-2.959,3.877-2.959c0.645,0,1.342,0.102,1.937,0.253   l0.994-3.571c-0.498-0.102-0.994-0.153-1.841-0.153c-1.289,0-2.979,0.818-3.875,1.939h-0.05l0.398-1.685h-4.969L60.564,68.814   L60.564,68.814z" fill="#FFFFFF"/>
+<path d="M78.344,62.333c0.417-1.124,1.353-1.787,2.762-1.787c1.406,0,2.084,0.612,2.084,1.43   c0,0.102-0.054,0.253-0.054,0.357H78.344L78.344,62.333 M82.197,65.75c-0.261,0.358-0.935,0.765-2.137,0.765   c-1.667,0-2.188-0.969-2.188-2.091h10.056c0.209-0.663,0.26-1.275,0.26-1.838c0-3.316-3.75-4.645-6.875-4.645   c-3.543,0-8.493,1.581-8.493,6.482c0,2.552,2.034,4.695,7.034,4.695c6.096,0,7.136-2.653,7.501-3.37h-5.157L82.197,65.75" fill="#FFFFFF"/>
+<path d="M93.861,65.801c0-0.816,0.875-1.12,1.75-1.225c0.977-0.051,1.955-0.101,2.828-0.459   c-0.358,1.581-1.078,2.602-2.881,2.602C94.736,66.719,93.861,66.514,93.861,65.801L93.861,65.801 M95.404,61.412   c0.31-0.766,1.082-1.071,2.111-1.071c0.82,0,1.692,0.203,1.692,0.918c0,1.326-2.419,1.123-3.911,1.223   c-4.013,0.206-6.734,0.972-6.734,3.781c0,2.04,2.105,2.856,4.521,2.856c1.545,0,3.352-0.46,4.271-1.327h0.054   c0,0.356,0.052,0.713,0.206,1.021h5.195c-0.207-0.461-0.104-0.103-0.207-0.919c0-0.716,1.696-5.462,1.696-7.146   c0-2.551-4.271-2.807-6.791-2.807c-3.396,0-6.276,0.665-7.103,3.472L95.404,61.412L95.404,61.412" fill="#FFFFFF"/>
+<polygon fill="#FFFFFF" points="104.313,68.815 104.313,68.815 109.523,68.815 113.418,54.217 108.207,54.217  "/>
+<polygon fill="#FFFFFF" points="115.221,66.548 115.221,66.548 114.289,66.548 114.289,68.96 113.516,68.96 113.516,66.548    112.584,66.548 112.584,65.971 115.221,65.971  "/>
+<polygon fill="#FFFFFF" points="119.084,68.96 119.084,68.96 118.313,68.96 118.313,66.958 117.762,68.258 117.229,68.258    116.68,66.958 116.68,68.96 115.943,68.96 115.943,65.971 116.848,65.971 117.516,67.471 118.184,65.971 119.084,65.971  "/>
+<rect fill="#99CCCC" height="16" width="3.496" x="85.231" y="2.39"/>
+<rect fill="#99CCCC" height="15.988" transform="matrix(-0.9241 -0.3821 0.3821 -0.9241 205.8219 70.7539)" width="3.494" x="108.19" y="6.946"/>
+<rect fill="#99CCCC" height="15.998" transform="matrix(0.7072 0.707 -0.707 0.7072 57.6263 -83.3022)" width="3.494" x="127.635" y="19.921"/>
+<rect fill="#99CCCC" height="15.991" transform="matrix(0.3827 0.9239 -0.9239 0.3827 131.839 -102.3118)" width="3.496" x="140.731" y="39.504"/>
+<rect fill="#99CCCC" height="3.496" width="16" x="139" y="68.67"/>
+<rect fill="#99CCCC" height="16.003" transform="matrix(0.3837 -0.9234 0.9234 0.3837 1.4789 189.0872)" width="3.494" x="140.663" y="85.434"/>
+<rect fill="#99CCCC" height="16.02" transform="matrix(0.7079 -0.7063 0.7063 0.7079 -41.9346 124.3225)" width="3.498" x="127.606" y="104.856"/>
+<rect fill="#99CCCC" height="15.98" transform="matrix(-0.9237 0.383 -0.383 -0.9237 259.5883 200.0274)" width="3.493" x="108.134" y="117.866"/>
+<rect fill="#99CCCC" height="16" width="3.495" x="85.216" y="122.391"/>
+<rect fill="#99CCCC" height="15.997" transform="matrix(0.9238 0.3828 -0.3828 0.9238 53.0481 -14.9199)" width="3.495" x="62.265" y="117.832"/>
+<rect fill="#99CCCC" height="16.01" transform="matrix(-0.7073 -0.7069 0.7069 -0.7073 -3.6993 224.0054)" width="3.492" x="42.778" y="104.764"/>
+<rect fill="#99CCCC" height="15.997" transform="matrix(-0.3823 -0.924 0.924 -0.3823 -42.6359 158.1622)" width="3.492" x="29.799" y="85.333"/>
+</g>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/group/icons/qgn_graf_realplayer_splash_14.svg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="tiny" height="143px" version="1.1" viewBox="0 0 174 143" width="174px" x="0px" y="0px">
+<g>
+<rect fill="none" height="143" width="174"/>
+<polygon fill="#828282" points="74.024,96.548 74.024,96.548 74.024,87.955 79.305,87.955 79.305,89.406 75.759,89.406    75.759,91.314 78.525,91.314 78.525,92.768 75.759,92.768 75.759,95.096 79.383,95.096 79.383,96.548  "/>
+<path d="M88.227,96.547h-1.641v-3.17c0-0.669-0.035-1.104-0.105-1.301s-0.185-0.35-0.342-0.459   c-0.158-0.109-0.349-0.164-0.57-0.164c-0.285,0-0.54,0.078-0.767,0.234c-0.227,0.151-0.381,0.358-0.465,0.619   c-0.084,0.258-0.126,0.73-0.126,1.428v2.813h-1.64v-6.232h1.53v0.914c0.54-0.69,1.222-1.039,2.042-1.039   c0.361,0,0.692,0.063,0.992,0.195c0.299,0.131,0.525,0.297,0.68,0.5c0.153,0.203,0.264,0.434,0.32,0.69   c0.061,0.257,0.092,0.627,0.092,1.104V96.547L88.227,96.547z" fill="#828282"/>
+<path d="M91.711,92.221h-1.555c0.169-0.611,0.527-1.298,0.939-1.593c0.408-0.294,1.021-0.44,1.834-0.44   c0.732,0,1.279,0.088,1.644,0.265c0.36,0.175,0.614,0.396,0.761,0.659c0.148,0.27,0.223,0.762,0.223,1.476l-0.031,1.92   c0,0.55,0.025,0.95,0.078,1.21c0.057,0.264,0.151,0.537,0.297,0.834h-1.625c-0.043-0.104-0.096-0.266-0.155-0.479   c-0.027-0.096-0.05-0.155-0.062-0.188c-0.283,0.274-0.584,0.479-0.904,0.617c-0.317,0.14-0.66,0.206-1.023,0.206   c-0.645,0-1.146-0.174-1.52-0.521c-0.367-0.348-0.555-0.785-0.555-1.313c0-0.354,0.084-0.662,0.252-0.938   c0.168-0.271,0.403-0.483,0.707-0.631c0.303-0.146,0.74-0.273,1.313-0.384c0.771-0.146,1.305-0.276,1.603-0.401v-0.17   c0-0.322-0.078-0.553-0.236-0.688c-0.153-0.139-0.45-0.206-0.891-0.206c-0.295,0-0.525,0.062-0.688,0.177   C91.945,91.749,91.814,91.925,91.711,92.221 M93.932,93.596c-0.213,0.069-0.549,0.152-1.011,0.25   c-0.459,0.096-0.76,0.19-0.901,0.284c-0.215,0.149-0.324,0.343-0.324,0.575c0,0.229,0.091,0.427,0.264,0.593   c0.174,0.167,0.396,0.25,0.661,0.25c0.298,0,0.583-0.097,0.854-0.291c0.197-0.146,0.332-0.327,0.396-0.54   c0.044-0.14,0.065-0.404,0.065-0.797v-0.324" fill="#828282"/>
+<path d="M99.314,96.547v-8.594h1.641v3.102c0.507-0.578,1.107-0.867,1.802-0.867c0.757,0,1.382,0.275,1.877,0.824   c0.495,0.551,0.742,1.34,0.742,2.369c0,1.064-0.251,1.885-0.757,2.459c-0.504,0.576-1.115,0.863-1.836,0.863   c-0.354,0-0.703-0.092-1.047-0.273c-0.346-0.183-0.646-0.449-0.891-0.797v0.914H99.314 M100.922,93.316   c0,0.646,0.102,1.123,0.307,1.433c0.287,0.438,0.666,0.657,1.145,0.657c0.361,0,0.676-0.155,0.936-0.467   c0.258-0.313,0.387-0.805,0.387-1.476c0-0.712-0.131-1.229-0.391-1.542c-0.261-0.313-0.592-0.473-0.992-0.473   c-0.396,0-0.729,0.15-0.988,0.461C101.055,92.223,100.922,92.689,100.922,93.316" fill="#828282"/>
+<path d="M115.986,94.859h1.744c-0.211,0.602-0.545,1.059-0.998,1.373c-0.455,0.313-1.023,0.472-1.707,0.472   c-1.08,0-1.881-0.354-2.399-1.063c-0.409-0.564-0.614-1.283-0.614-2.146c0-1.033,0.271-1.845,0.809-2.431   c0.539-0.584,1.225-0.877,2.049-0.877c0.926,0,1.652,0.31,2.188,0.918c0.535,0.613,0.791,1.556,0.771,2.815H113.7   c0.012,0.488,0.144,0.868,0.397,1.14c0.252,0.272,0.564,0.408,0.943,0.408c0.257,0,0.477-0.07,0.646-0.212   C115.811,95.165,115.908,95.031,115.986,94.859 M116.184,92.906c-0.012-0.475-0.135-0.836-0.367-1.082   c-0.23-0.248-0.519-0.371-0.854-0.371c-0.357,0-0.654,0.131-0.889,0.391c-0.233,0.262-0.35,0.615-0.346,1.063H116.184   L116.184,92.906" fill="#828282"/>
+<path d="M126.186,96.547h-1.531v-0.914c-0.252,0.355-0.553,0.623-0.896,0.803c-0.344,0.182-0.69,0.271-1.042,0.271   c-0.713,0-1.322-0.289-1.83-0.865c-0.509-0.576-0.763-1.383-0.763-2.416c0-1.057,0.247-1.855,0.743-2.406   c0.492-0.553,1.119-0.824,1.877-0.824c0.693,0,1.295,0.289,1.802,0.867v-3.104h1.642v8.592L126.186,96.547 M121.811,93.316   c0,0.664,0.092,1.146,0.275,1.441c0.268,0.434,0.641,0.646,1.118,0.646c0.38,0,0.704-0.16,0.971-0.483   c0.267-0.321,0.4-0.806,0.4-1.446c0-0.718-0.13-1.23-0.39-1.55c-0.261-0.313-0.588-0.473-0.994-0.473   c-0.396,0-0.721,0.155-0.984,0.467C121.941,92.232,121.811,92.695,121.811,93.316" fill="#828282"/>
+<path d="M107.619,87.954h1.465v6.968c0,0.773,0.23,1.234,0.691,1.383c-0.229,0.43-0.613,0.646-1.16,0.646   c-0.664,0-0.996-0.461-0.996-1.385V87.954L107.619,87.954z" fill="#828282"/>
+<path d="M79.853,70.617c-1.015,0-2.356-0.167-2.356-0.167s-8.336,4.231-9.764,5.073   c-0.02-0.049,1.236-2.258,1.547-3.107c0.063-0.17-0.146-0.447-0.371-0.447c-0.582,0-1.314,0.101-2.509,0.095   c-11.423,0-16.711-5.935-16.711-8.958c0-4.03,6.263-8.743,15.843-8.743c4.238,0,10.453,0.671,13.107,2.34   c0.88-0.174,1.783-0.26,2.673-0.26c1.288,0,2.606,0.196,3.807,0.6l0,0c-6.327-4.967-12.986-6.204-19.587-6.204   c-12.972,0-21.33,5.268-21.33,11.995c0,6.767,10.156,12.78,21.33,12.78c0.688,0.021,1.232,0.121,1.04,0.559   c-0.184,0.417-2.91,4.688-3.744,6.221c-0.243,0.443,0.051,0.73,0.581,0.588l20.527-12.84l0,0   C82.847,70.432,81.506,70.617,79.853,70.617z" fill="#2976BB"/>
+<path d="M60.564,68.814h5.172l1.141-4.441c0.596-2.194,1.689-2.959,3.877-2.959c0.645,0,1.342,0.102,1.937,0.253   l0.994-3.571c-0.498-0.102-0.994-0.153-1.841-0.153c-1.289,0-2.979,0.818-3.875,1.939h-0.05l0.398-1.685h-4.969L60.564,68.814   L60.564,68.814z" fill="#FFFFFF"/>
+<path d="M78.344,62.333c0.417-1.124,1.353-1.787,2.762-1.787c1.406,0,2.084,0.612,2.084,1.43   c0,0.102-0.054,0.253-0.054,0.357H78.344L78.344,62.333 M82.197,65.75c-0.261,0.358-0.935,0.765-2.137,0.765   c-1.667,0-2.188-0.969-2.188-2.091h10.056c0.209-0.663,0.26-1.275,0.26-1.838c0-3.316-3.75-4.645-6.875-4.645   c-3.543,0-8.493,1.581-8.493,6.482c0,2.552,2.034,4.695,7.034,4.695c6.096,0,7.136-2.653,7.501-3.37h-5.157L82.197,65.75" fill="#FFFFFF"/>
+<path d="M93.861,65.801c0-0.816,0.875-1.12,1.75-1.225c0.977-0.051,1.955-0.101,2.828-0.459   c-0.358,1.581-1.078,2.602-2.881,2.602C94.736,66.719,93.861,66.514,93.861,65.801L93.861,65.801 M95.404,61.412   c0.31-0.766,1.082-1.071,2.111-1.071c0.82,0,1.692,0.203,1.692,0.918c0,1.326-2.419,1.123-3.911,1.223   c-4.013,0.206-6.734,0.972-6.734,3.781c0,2.04,2.105,2.856,4.521,2.856c1.545,0,3.352-0.46,4.271-1.327h0.054   c0,0.356,0.052,0.713,0.206,1.021h5.195c-0.207-0.461-0.104-0.103-0.207-0.919c0-0.716,1.696-5.462,1.696-7.146   c0-2.551-4.271-2.807-6.791-2.807c-3.396,0-6.276,0.665-7.103,3.472L95.404,61.412L95.404,61.412" fill="#FFFFFF"/>
+<polygon fill="#FFFFFF" points="104.313,68.815 104.313,68.815 109.523,68.815 113.418,54.217 108.207,54.217  "/>
+<polygon fill="#FFFFFF" points="115.221,66.548 115.221,66.548 114.289,66.548 114.289,68.96 113.516,68.96 113.516,66.548    112.584,66.548 112.584,65.971 115.221,65.971  "/>
+<polygon fill="#FFFFFF" points="119.084,68.96 119.084,68.96 118.313,68.96 118.313,66.958 117.762,68.258 117.229,68.258    116.68,66.958 116.68,68.96 115.943,68.96 115.943,65.971 116.848,65.971 117.516,67.471 118.184,65.971 119.084,65.971  "/>
+<rect fill="#99CCCC" height="16" width="3.496" x="85.231" y="2.39"/>
+<rect fill="#99CCCC" height="15.988" transform="matrix(-0.9241 -0.3821 0.3821 -0.9241 205.8219 70.7539)" width="3.494" x="108.19" y="6.946"/>
+<rect fill="#99CCCC" height="15.998" transform="matrix(0.7072 0.707 -0.707 0.7072 57.6263 -83.3022)" width="3.494" x="127.635" y="19.921"/>
+<rect fill="#99CCCC" height="15.991" transform="matrix(0.3827 0.9239 -0.9239 0.3827 131.839 -102.3118)" width="3.496" x="140.731" y="39.504"/>
+<rect fill="#99CCCC" height="3.496" width="16" x="139" y="68.67"/>
+<rect fill="#99CCCC" height="16.003" transform="matrix(0.3837 -0.9234 0.9234 0.3837 1.4789 189.0872)" width="3.494" x="140.663" y="85.434"/>
+<rect fill="#99CCCC" height="16.02" transform="matrix(0.7079 -0.7063 0.7063 0.7079 -41.9346 124.3225)" width="3.498" x="127.606" y="104.856"/>
+<rect fill="#99CCCC" height="15.98" transform="matrix(-0.9237 0.383 -0.383 -0.9237 259.5883 200.0274)" width="3.493" x="108.134" y="117.866"/>
+<rect fill="#99CCCC" height="16" width="3.495" x="85.216" y="122.391"/>
+<rect fill="#99CCCC" height="15.997" transform="matrix(0.9238 0.3828 -0.3828 0.9238 53.0481 -14.9199)" width="3.495" x="62.265" y="117.832"/>
+<rect fill="#99CCCC" height="16.01" transform="matrix(-0.7073 -0.7069 0.7069 -0.7073 -3.6993 224.0054)" width="3.492" x="42.778" y="104.764"/>
+<rect fill="#99CCCC" height="15.997" transform="matrix(-0.3823 -0.924 0.924 -0.3823 -42.6359 158.1622)" width="3.492" x="29.799" y="85.333"/>
+<rect fill="#99CCCC" height="3.495" width="16" x="19" y="68.515"/>
+</g>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/group/icons/qgn_graf_realplayer_splash_15.svg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="tiny" height="143px" version="1.1" viewBox="0 0 174 143" width="174px" x="0px" y="0px">
+<g>
+<rect fill="none" height="143" width="174"/>
+<polygon fill="#828282" points="74.024,96.548 74.024,96.548 74.024,87.955 79.305,87.955 79.305,89.406 75.759,89.406    75.759,91.314 78.525,91.314 78.525,92.768 75.759,92.768 75.759,95.096 79.383,95.096 79.383,96.548  "/>
+<path d="M88.227,96.547h-1.641v-3.17c0-0.669-0.035-1.104-0.105-1.301s-0.185-0.35-0.342-0.459   c-0.158-0.109-0.349-0.164-0.57-0.164c-0.285,0-0.54,0.078-0.767,0.234c-0.227,0.151-0.381,0.358-0.465,0.619   c-0.084,0.258-0.126,0.73-0.126,1.428v2.813h-1.64v-6.232h1.53v0.914c0.54-0.69,1.222-1.039,2.042-1.039   c0.361,0,0.692,0.063,0.992,0.195c0.299,0.131,0.525,0.297,0.68,0.5c0.153,0.203,0.264,0.434,0.32,0.69   c0.061,0.257,0.092,0.627,0.092,1.104V96.547L88.227,96.547z" fill="#828282"/>
+<path d="M91.711,92.221h-1.555c0.169-0.611,0.527-1.298,0.939-1.593c0.408-0.294,1.021-0.44,1.834-0.44   c0.732,0,1.279,0.088,1.644,0.265c0.36,0.175,0.614,0.396,0.761,0.659c0.148,0.27,0.223,0.762,0.223,1.476l-0.031,1.92   c0,0.55,0.025,0.95,0.078,1.21c0.057,0.264,0.151,0.537,0.297,0.834h-1.625c-0.043-0.104-0.096-0.266-0.155-0.479   c-0.027-0.096-0.05-0.155-0.062-0.188c-0.283,0.274-0.584,0.479-0.904,0.617c-0.317,0.14-0.66,0.206-1.023,0.206   c-0.645,0-1.146-0.174-1.52-0.521c-0.367-0.348-0.555-0.785-0.555-1.313c0-0.354,0.084-0.662,0.252-0.938   c0.168-0.271,0.403-0.483,0.707-0.631c0.303-0.146,0.74-0.273,1.313-0.384c0.771-0.146,1.305-0.276,1.603-0.401v-0.17   c0-0.322-0.078-0.553-0.236-0.688c-0.153-0.139-0.45-0.206-0.891-0.206c-0.295,0-0.525,0.062-0.688,0.177   C91.945,91.749,91.814,91.925,91.711,92.221 M93.932,93.596c-0.213,0.069-0.549,0.152-1.011,0.25   c-0.459,0.096-0.76,0.19-0.901,0.284c-0.215,0.149-0.324,0.343-0.324,0.575c0,0.229,0.091,0.427,0.264,0.593   c0.174,0.167,0.396,0.25,0.661,0.25c0.298,0,0.583-0.097,0.854-0.291c0.197-0.146,0.332-0.327,0.396-0.54   c0.044-0.14,0.065-0.404,0.065-0.797v-0.324" fill="#828282"/>
+<path d="M99.314,96.547v-8.594h1.641v3.102c0.507-0.578,1.107-0.867,1.802-0.867c0.757,0,1.382,0.275,1.877,0.824   c0.495,0.551,0.742,1.34,0.742,2.369c0,1.064-0.251,1.885-0.757,2.459c-0.504,0.576-1.115,0.863-1.836,0.863   c-0.354,0-0.703-0.092-1.047-0.273c-0.346-0.183-0.646-0.449-0.891-0.797v0.914H99.314 M100.922,93.316   c0,0.646,0.102,1.123,0.307,1.433c0.287,0.438,0.666,0.657,1.145,0.657c0.361,0,0.676-0.155,0.936-0.467   c0.258-0.313,0.387-0.805,0.387-1.476c0-0.712-0.131-1.229-0.391-1.542c-0.261-0.313-0.592-0.473-0.992-0.473   c-0.396,0-0.729,0.15-0.988,0.461C101.055,92.223,100.922,92.689,100.922,93.316" fill="#828282"/>
+<path d="M115.986,94.859h1.744c-0.211,0.602-0.545,1.059-0.998,1.373c-0.455,0.313-1.023,0.472-1.707,0.472   c-1.08,0-1.881-0.354-2.399-1.063c-0.409-0.564-0.614-1.283-0.614-2.146c0-1.033,0.271-1.845,0.809-2.431   c0.539-0.584,1.225-0.877,2.049-0.877c0.926,0,1.652,0.31,2.188,0.918c0.535,0.613,0.791,1.556,0.771,2.815H113.7   c0.012,0.488,0.144,0.868,0.397,1.14c0.252,0.272,0.564,0.408,0.943,0.408c0.257,0,0.477-0.07,0.646-0.212   C115.811,95.165,115.908,95.031,115.986,94.859 M116.184,92.906c-0.012-0.475-0.135-0.836-0.367-1.082   c-0.23-0.248-0.519-0.371-0.854-0.371c-0.357,0-0.654,0.131-0.889,0.391c-0.233,0.262-0.35,0.615-0.346,1.063H116.184   L116.184,92.906" fill="#828282"/>
+<path d="M126.186,96.547h-1.531v-0.914c-0.252,0.355-0.553,0.623-0.896,0.803c-0.344,0.182-0.69,0.271-1.042,0.271   c-0.713,0-1.322-0.289-1.83-0.865c-0.509-0.576-0.763-1.383-0.763-2.416c0-1.057,0.247-1.855,0.743-2.406   c0.492-0.553,1.119-0.824,1.877-0.824c0.693,0,1.295,0.289,1.802,0.867v-3.104h1.642v8.592L126.186,96.547 M121.811,93.316   c0,0.664,0.092,1.146,0.275,1.441c0.268,0.434,0.641,0.646,1.118,0.646c0.38,0,0.704-0.16,0.971-0.483   c0.267-0.321,0.4-0.806,0.4-1.446c0-0.718-0.13-1.23-0.39-1.55c-0.261-0.313-0.588-0.473-0.994-0.473   c-0.396,0-0.721,0.155-0.984,0.467C121.941,92.232,121.811,92.695,121.811,93.316" fill="#828282"/>
+<path d="M107.619,87.954h1.465v6.968c0,0.773,0.23,1.234,0.691,1.383c-0.229,0.43-0.613,0.646-1.16,0.646   c-0.664,0-0.996-0.461-0.996-1.385V87.954L107.619,87.954z" fill="#828282"/>
+<path d="M79.853,70.617c-1.015,0-2.356-0.167-2.356-0.167s-8.336,4.231-9.764,5.073   c-0.02-0.049,1.236-2.258,1.547-3.107c0.063-0.17-0.146-0.447-0.371-0.447c-0.582,0-1.314,0.101-2.509,0.095   c-11.423,0-16.711-5.935-16.711-8.958c0-4.03,6.263-8.743,15.843-8.743c4.238,0,10.453,0.671,13.107,2.34   c0.88-0.174,1.783-0.26,2.673-0.26c1.288,0,2.606,0.196,3.807,0.6l0,0c-6.327-4.967-12.986-6.204-19.587-6.204   c-12.972,0-21.33,5.268-21.33,11.995c0,6.767,10.156,12.78,21.33,12.78c0.688,0.021,1.232,0.121,1.04,0.559   c-0.184,0.417-2.91,4.688-3.744,6.221c-0.243,0.443,0.051,0.73,0.581,0.588l20.527-12.84l0,0   C82.847,70.432,81.506,70.617,79.853,70.617z" fill="#2976BB"/>
+<path d="M60.564,68.814h5.172l1.141-4.441c0.596-2.194,1.689-2.959,3.877-2.959c0.645,0,1.342,0.102,1.937,0.253   l0.994-3.571c-0.498-0.102-0.994-0.153-1.841-0.153c-1.289,0-2.979,0.818-3.875,1.939h-0.05l0.398-1.685h-4.969L60.564,68.814   L60.564,68.814z" fill="#FFFFFF"/>
+<path d="M78.344,62.333c0.417-1.124,1.353-1.787,2.762-1.787c1.406,0,2.084,0.612,2.084,1.43   c0,0.102-0.054,0.253-0.054,0.357H78.344L78.344,62.333 M82.197,65.75c-0.261,0.358-0.935,0.765-2.137,0.765   c-1.667,0-2.188-0.969-2.188-2.091h10.056c0.209-0.663,0.26-1.275,0.26-1.838c0-3.316-3.75-4.645-6.875-4.645   c-3.543,0-8.493,1.581-8.493,6.482c0,2.552,2.034,4.695,7.034,4.695c6.096,0,7.136-2.653,7.501-3.37h-5.157L82.197,65.75" fill="#FFFFFF"/>
+<path d="M93.861,65.801c0-0.816,0.875-1.12,1.75-1.225c0.977-0.051,1.955-0.101,2.828-0.459   c-0.358,1.581-1.078,2.602-2.881,2.602C94.736,66.719,93.861,66.514,93.861,65.801L93.861,65.801 M95.404,61.412   c0.31-0.766,1.082-1.071,2.111-1.071c0.82,0,1.692,0.203,1.692,0.918c0,1.326-2.419,1.123-3.911,1.223   c-4.013,0.206-6.734,0.972-6.734,3.781c0,2.04,2.105,2.856,4.521,2.856c1.545,0,3.352-0.46,4.271-1.327h0.054   c0,0.356,0.052,0.713,0.206,1.021h5.195c-0.207-0.461-0.104-0.103-0.207-0.919c0-0.716,1.696-5.462,1.696-7.146   c0-2.551-4.271-2.807-6.791-2.807c-3.396,0-6.276,0.665-7.103,3.472L95.404,61.412L95.404,61.412" fill="#FFFFFF"/>
+<polygon fill="#FFFFFF" points="104.313,68.815 104.313,68.815 109.523,68.815 113.418,54.217 108.207,54.217  "/>
+<polygon fill="#FFFFFF" points="115.221,66.548 115.221,66.548 114.289,66.548 114.289,68.96 113.516,68.96 113.516,66.548    112.584,66.548 112.584,65.971 115.221,65.971  "/>
+<polygon fill="#FFFFFF" points="119.084,68.96 119.084,68.96 118.313,68.96 118.313,66.958 117.762,68.258 117.229,68.258    116.68,66.958 116.68,68.96 115.943,68.96 115.943,65.971 116.848,65.971 117.516,67.471 118.184,65.971 119.084,65.971  "/>
+<rect fill="#99CCCC" height="16" width="3.496" x="85.231" y="2.39"/>
+<rect fill="#99CCCC" height="15.988" transform="matrix(-0.9241 -0.3821 0.3821 -0.9241 205.8219 70.7539)" width="3.494" x="108.19" y="6.946"/>
+<rect fill="#99CCCC" height="15.998" transform="matrix(0.7072 0.707 -0.707 0.7072 57.6263 -83.3022)" width="3.494" x="127.635" y="19.921"/>
+<rect fill="#99CCCC" height="15.991" transform="matrix(0.3827 0.9239 -0.9239 0.3827 131.839 -102.3118)" width="3.496" x="140.731" y="39.504"/>
+<rect fill="#99CCCC" height="3.496" width="16" x="139" y="68.67"/>
+<rect fill="#99CCCC" height="16.003" transform="matrix(0.3837 -0.9234 0.9234 0.3837 1.4789 189.0872)" width="3.494" x="140.663" y="85.434"/>
+<rect fill="#99CCCC" height="16.02" transform="matrix(0.7079 -0.7063 0.7063 0.7079 -41.9346 124.3225)" width="3.498" x="127.606" y="104.856"/>
+<rect fill="#99CCCC" height="15.98" transform="matrix(-0.9237 0.383 -0.383 -0.9237 259.5883 200.0274)" width="3.493" x="108.134" y="117.866"/>
+<rect fill="#99CCCC" height="16" width="3.495" x="85.216" y="122.391"/>
+<rect fill="#99CCCC" height="15.997" transform="matrix(0.9238 0.3828 -0.3828 0.9238 53.0481 -14.9199)" width="3.495" x="62.265" y="117.832"/>
+<rect fill="#99CCCC" height="16.01" transform="matrix(-0.7073 -0.7069 0.7069 -0.7073 -3.6993 224.0054)" width="3.492" x="42.778" y="104.764"/>
+<rect fill="#99CCCC" height="15.997" transform="matrix(-0.3823 -0.924 0.924 -0.3823 -42.6359 158.1622)" width="3.492" x="29.799" y="85.333"/>
+<rect fill="#99CCCC" height="3.495" width="16" x="19" y="68.515"/>
+<rect fill="#99CCCC" height="15.984" transform="matrix(-0.3818 0.9242 -0.9242 -0.3818 87.495 36.434)" width="3.493" x="29.816" y="39.486"/>
+</g>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/group/icons/qgn_graf_realplayer_splash_16.svg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="tiny" height="143px" version="1.1" viewBox="0 0 174 143" width="174px" x="0px" y="0px">
+<g>
+<rect fill="none" height="143" width="174"/>
+<polygon fill="#828282" points="74.024,96.548 74.024,96.548 74.024,87.955 79.305,87.955 79.305,89.406 75.759,89.406    75.759,91.314 78.525,91.314 78.525,92.768 75.759,92.768 75.759,95.096 79.383,95.096 79.383,96.548  "/>
+<path d="M88.227,96.547h-1.641v-3.17c0-0.669-0.035-1.104-0.105-1.301s-0.185-0.35-0.342-0.459   c-0.158-0.109-0.349-0.164-0.57-0.164c-0.285,0-0.54,0.078-0.767,0.234c-0.227,0.151-0.381,0.358-0.465,0.619   c-0.084,0.258-0.126,0.73-0.126,1.428v2.813h-1.64v-6.232h1.53v0.914c0.54-0.69,1.222-1.039,2.042-1.039   c0.361,0,0.692,0.063,0.992,0.195c0.299,0.131,0.525,0.297,0.68,0.5c0.153,0.203,0.264,0.434,0.32,0.69   c0.061,0.257,0.092,0.627,0.092,1.104V96.547L88.227,96.547z" fill="#828282"/>
+<path d="M91.711,92.221h-1.555c0.169-0.611,0.527-1.298,0.939-1.593c0.408-0.294,1.021-0.44,1.834-0.44   c0.732,0,1.279,0.088,1.644,0.265c0.36,0.175,0.614,0.396,0.761,0.659c0.148,0.27,0.223,0.762,0.223,1.476l-0.031,1.92   c0,0.55,0.025,0.95,0.078,1.21c0.057,0.264,0.151,0.537,0.297,0.834h-1.625c-0.043-0.104-0.096-0.266-0.155-0.479   c-0.027-0.096-0.05-0.155-0.062-0.188c-0.283,0.274-0.584,0.479-0.904,0.617c-0.317,0.14-0.66,0.206-1.023,0.206   c-0.645,0-1.146-0.174-1.52-0.521c-0.367-0.348-0.555-0.785-0.555-1.313c0-0.354,0.084-0.662,0.252-0.938   c0.168-0.271,0.403-0.483,0.707-0.631c0.303-0.146,0.74-0.273,1.313-0.384c0.771-0.146,1.305-0.276,1.603-0.401v-0.17   c0-0.322-0.078-0.553-0.236-0.688c-0.153-0.139-0.45-0.206-0.891-0.206c-0.295,0-0.525,0.062-0.688,0.177   C91.945,91.749,91.814,91.925,91.711,92.221 M93.932,93.596c-0.213,0.069-0.549,0.152-1.011,0.25   c-0.459,0.096-0.76,0.19-0.901,0.284c-0.215,0.149-0.324,0.343-0.324,0.575c0,0.229,0.091,0.427,0.264,0.593   c0.174,0.167,0.396,0.25,0.661,0.25c0.298,0,0.583-0.097,0.854-0.291c0.197-0.146,0.332-0.327,0.396-0.54   c0.044-0.14,0.065-0.404,0.065-0.797v-0.324" fill="#828282"/>
+<path d="M99.314,96.547v-8.594h1.641v3.102c0.507-0.578,1.107-0.867,1.802-0.867c0.757,0,1.382,0.275,1.877,0.824   c0.495,0.551,0.742,1.34,0.742,2.369c0,1.064-0.251,1.885-0.757,2.459c-0.504,0.576-1.115,0.863-1.836,0.863   c-0.354,0-0.703-0.092-1.047-0.273c-0.346-0.183-0.646-0.449-0.891-0.797v0.914H99.314 M100.922,93.316   c0,0.646,0.102,1.123,0.307,1.433c0.287,0.438,0.666,0.657,1.145,0.657c0.361,0,0.676-0.155,0.936-0.467   c0.258-0.313,0.387-0.805,0.387-1.476c0-0.712-0.131-1.229-0.391-1.542c-0.261-0.313-0.592-0.473-0.992-0.473   c-0.396,0-0.729,0.15-0.988,0.461C101.055,92.223,100.922,92.689,100.922,93.316" fill="#828282"/>
+<path d="M115.986,94.859h1.744c-0.211,0.602-0.545,1.059-0.998,1.373c-0.455,0.313-1.023,0.472-1.707,0.472   c-1.08,0-1.881-0.354-2.399-1.063c-0.409-0.564-0.614-1.283-0.614-2.146c0-1.033,0.271-1.845,0.809-2.431   c0.539-0.584,1.225-0.877,2.049-0.877c0.926,0,1.652,0.31,2.188,0.918c0.535,0.613,0.791,1.556,0.771,2.815H113.7   c0.012,0.488,0.144,0.868,0.397,1.14c0.252,0.272,0.564,0.408,0.943,0.408c0.257,0,0.477-0.07,0.646-0.212   C115.811,95.165,115.908,95.031,115.986,94.859 M116.184,92.906c-0.012-0.475-0.135-0.836-0.367-1.082   c-0.23-0.248-0.519-0.371-0.854-0.371c-0.357,0-0.654,0.131-0.889,0.391c-0.233,0.262-0.35,0.615-0.346,1.063H116.184   L116.184,92.906" fill="#828282"/>
+<path d="M126.186,96.547h-1.531v-0.914c-0.252,0.355-0.553,0.623-0.896,0.803c-0.344,0.182-0.69,0.271-1.042,0.271   c-0.713,0-1.322-0.289-1.83-0.865c-0.509-0.576-0.763-1.383-0.763-2.416c0-1.057,0.247-1.855,0.743-2.406   c0.492-0.553,1.119-0.824,1.877-0.824c0.693,0,1.295,0.289,1.802,0.867v-3.104h1.642v8.592L126.186,96.547 M121.811,93.316   c0,0.664,0.092,1.146,0.275,1.441c0.268,0.434,0.641,0.646,1.118,0.646c0.38,0,0.704-0.16,0.971-0.483   c0.267-0.321,0.4-0.806,0.4-1.446c0-0.718-0.13-1.23-0.39-1.55c-0.261-0.313-0.588-0.473-0.994-0.473   c-0.396,0-0.721,0.155-0.984,0.467C121.941,92.232,121.811,92.695,121.811,93.316" fill="#828282"/>
+<path d="M107.619,87.954h1.465v6.968c0,0.773,0.23,1.234,0.691,1.383c-0.229,0.43-0.613,0.646-1.16,0.646   c-0.664,0-0.996-0.461-0.996-1.385V87.954L107.619,87.954z" fill="#828282"/>
+<path d="M79.853,70.617c-1.015,0-2.356-0.167-2.356-0.167s-8.336,4.231-9.764,5.073   c-0.02-0.049,1.236-2.258,1.547-3.107c0.063-0.17-0.146-0.447-0.371-0.447c-0.582,0-1.314,0.101-2.509,0.095   c-11.423,0-16.711-5.935-16.711-8.958c0-4.03,6.263-8.743,15.843-8.743c4.238,0,10.453,0.671,13.107,2.34   c0.88-0.174,1.783-0.26,2.673-0.26c1.288,0,2.606,0.196,3.807,0.6l0,0c-6.327-4.967-12.986-6.204-19.587-6.204   c-12.972,0-21.33,5.268-21.33,11.995c0,6.767,10.156,12.78,21.33,12.78c0.688,0.021,1.232,0.121,1.04,0.559   c-0.184,0.417-2.91,4.688-3.744,6.221c-0.243,0.443,0.051,0.73,0.581,0.588l20.527-12.84l0,0   C82.847,70.432,81.506,70.617,79.853,70.617z" fill="#2976BB"/>
+<path d="M60.564,68.814h5.172l1.141-4.441c0.596-2.194,1.689-2.959,3.877-2.959c0.645,0,1.342,0.102,1.937,0.253   l0.994-3.571c-0.498-0.102-0.994-0.153-1.841-0.153c-1.289,0-2.979,0.818-3.875,1.939h-0.05l0.398-1.685h-4.969L60.564,68.814   L60.564,68.814z" fill="#FFFFFF"/>
+<path d="M78.344,62.333c0.417-1.124,1.353-1.787,2.762-1.787c1.406,0,2.084,0.612,2.084,1.43   c0,0.102-0.054,0.253-0.054,0.357H78.344L78.344,62.333 M82.197,65.75c-0.261,0.358-0.935,0.765-2.137,0.765   c-1.667,0-2.188-0.969-2.188-2.091h10.056c0.209-0.663,0.26-1.275,0.26-1.838c0-3.316-3.75-4.645-6.875-4.645   c-3.543,0-8.493,1.581-8.493,6.482c0,2.552,2.034,4.695,7.034,4.695c6.096,0,7.136-2.653,7.501-3.37h-5.157L82.197,65.75" fill="#FFFFFF"/>
+<path d="M93.861,65.801c0-0.816,0.875-1.12,1.75-1.225c0.977-0.051,1.955-0.101,2.828-0.459   c-0.358,1.581-1.078,2.602-2.881,2.602C94.736,66.719,93.861,66.514,93.861,65.801L93.861,65.801 M95.404,61.412   c0.31-0.766,1.082-1.071,2.111-1.071c0.82,0,1.692,0.203,1.692,0.918c0,1.326-2.419,1.123-3.911,1.223   c-4.013,0.206-6.734,0.972-6.734,3.781c0,2.04,2.105,2.856,4.521,2.856c1.545,0,3.352-0.46,4.271-1.327h0.054   c0,0.356,0.052,0.713,0.206,1.021h5.195c-0.207-0.461-0.104-0.103-0.207-0.919c0-0.716,1.696-5.462,1.696-7.146   c0-2.551-4.271-2.807-6.791-2.807c-3.396,0-6.276,0.665-7.103,3.472L95.404,61.412L95.404,61.412" fill="#FFFFFF"/>
+<polygon fill="#FFFFFF" points="104.313,68.815 104.313,68.815 109.523,68.815 113.418,54.217 108.207,54.217  "/>
+<polygon fill="#FFFFFF" points="115.221,66.548 115.221,66.548 114.289,66.548 114.289,68.96 113.516,68.96 113.516,66.548    112.584,66.548 112.584,65.971 115.221,65.971  "/>
+<polygon fill="#FFFFFF" points="119.084,68.96 119.084,68.96 118.313,68.96 118.313,66.958 117.762,68.258 117.229,68.258    116.68,66.958 116.68,68.96 115.943,68.96 115.943,65.971 116.848,65.971 117.516,67.471 118.184,65.971 119.084,65.971  "/>
+<rect fill="#99CCCC" height="16" width="3.496" x="85.231" y="2.39"/>
+<rect fill="#99CCCC" height="15.988" transform="matrix(-0.9241 -0.3821 0.3821 -0.9241 205.8219 70.7539)" width="3.494" x="108.19" y="6.946"/>
+<rect fill="#99CCCC" height="15.998" transform="matrix(0.7072 0.707 -0.707 0.7072 57.6263 -83.3022)" width="3.494" x="127.635" y="19.921"/>
+<rect fill="#99CCCC" height="15.991" transform="matrix(0.3827 0.9239 -0.9239 0.3827 131.839 -102.3118)" width="3.496" x="140.731" y="39.504"/>
+<rect fill="#99CCCC" height="3.496" width="16" x="139" y="68.67"/>
+<rect fill="#99CCCC" height="16.003" transform="matrix(0.3837 -0.9234 0.9234 0.3837 1.4789 189.0872)" width="3.494" x="140.663" y="85.434"/>
+<rect fill="#99CCCC" height="16.02" transform="matrix(0.7079 -0.7063 0.7063 0.7079 -41.9346 124.3225)" width="3.498" x="127.606" y="104.856"/>
+<rect fill="#99CCCC" height="15.98" transform="matrix(-0.9237 0.383 -0.383 -0.9237 259.5883 200.0274)" width="3.493" x="108.134" y="117.866"/>
+<rect fill="#99CCCC" height="16" width="3.495" x="85.216" y="122.391"/>
+<rect fill="#99CCCC" height="15.997" transform="matrix(0.9238 0.3828 -0.3828 0.9238 53.0481 -14.9199)" width="3.495" x="62.265" y="117.832"/>
+<rect fill="#99CCCC" height="16.01" transform="matrix(-0.7073 -0.7069 0.7069 -0.7073 -3.6993 224.0054)" width="3.492" x="42.778" y="104.764"/>
+<rect fill="#99CCCC" height="15.997" transform="matrix(-0.3823 -0.924 0.924 -0.3823 -42.6359 158.1622)" width="3.492" x="29.799" y="85.333"/>
+<rect fill="#99CCCC" height="3.495" width="16" x="19" y="68.515"/>
+<rect fill="#99CCCC" height="15.984" transform="matrix(-0.3818 0.9242 -0.9242 -0.3818 87.495 36.434)" width="3.493" x="29.816" y="39.486"/>
+<rect fill="#99CCCC" height="15.998" transform="matrix(-0.7065 0.7077 -0.7077 -0.7065 95.7396 16.3999)" width="3.496" x="42.721" y="20.054"/>
+</g>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/group/icons/qgn_graf_realplayer_splash_17.svg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="tiny" height="143px" version="1.1" viewBox="0 0 174 143" width="174px" x="0px" y="0px">
+<g>
+<rect fill="none" height="143" width="174"/>
+<polygon fill="#828282" points="74.024,96.548 74.024,96.548 74.024,87.955 79.305,87.955 79.305,89.406 75.759,89.406    75.759,91.314 78.525,91.314 78.525,92.768 75.759,92.768 75.759,95.096 79.383,95.096 79.383,96.548  "/>
+<path d="M88.227,96.547h-1.641v-3.17c0-0.669-0.035-1.104-0.105-1.301s-0.185-0.35-0.342-0.459   c-0.158-0.109-0.349-0.164-0.57-0.164c-0.285,0-0.54,0.078-0.767,0.234c-0.227,0.151-0.381,0.358-0.465,0.619   c-0.084,0.258-0.126,0.73-0.126,1.428v2.813h-1.64v-6.232h1.53v0.914c0.54-0.69,1.222-1.039,2.042-1.039   c0.361,0,0.692,0.063,0.992,0.195c0.299,0.131,0.525,0.297,0.68,0.5c0.153,0.203,0.264,0.434,0.32,0.69   c0.061,0.257,0.092,0.627,0.092,1.104V96.547L88.227,96.547z" fill="#828282"/>
+<path d="M91.711,92.221h-1.555c0.169-0.611,0.527-1.298,0.939-1.593c0.408-0.294,1.021-0.44,1.834-0.44   c0.732,0,1.279,0.088,1.644,0.265c0.36,0.175,0.614,0.396,0.761,0.659c0.148,0.27,0.223,0.762,0.223,1.476l-0.031,1.92   c0,0.55,0.025,0.95,0.078,1.21c0.057,0.264,0.151,0.537,0.297,0.834h-1.625c-0.043-0.104-0.096-0.266-0.155-0.479   c-0.027-0.096-0.05-0.155-0.062-0.188c-0.283,0.274-0.584,0.479-0.904,0.617c-0.317,0.14-0.66,0.206-1.023,0.206   c-0.645,0-1.146-0.174-1.52-0.521c-0.367-0.348-0.555-0.785-0.555-1.313c0-0.354,0.084-0.662,0.252-0.938   c0.168-0.271,0.403-0.483,0.707-0.631c0.303-0.146,0.74-0.273,1.313-0.384c0.771-0.146,1.305-0.276,1.603-0.401v-0.17   c0-0.322-0.078-0.553-0.236-0.688c-0.153-0.139-0.45-0.206-0.891-0.206c-0.295,0-0.525,0.062-0.688,0.177   C91.945,91.749,91.814,91.925,91.711,92.221 M93.932,93.596c-0.213,0.069-0.549,0.152-1.011,0.25   c-0.459,0.096-0.76,0.19-0.901,0.284c-0.215,0.149-0.324,0.343-0.324,0.575c0,0.229,0.091,0.427,0.264,0.593   c0.174,0.167,0.396,0.25,0.661,0.25c0.298,0,0.583-0.097,0.854-0.291c0.197-0.146,0.332-0.327,0.396-0.54   c0.044-0.14,0.065-0.404,0.065-0.797v-0.324" fill="#828282"/>
+<path d="M99.314,96.547v-8.594h1.641v3.102c0.507-0.578,1.107-0.867,1.802-0.867c0.757,0,1.382,0.275,1.877,0.824   c0.495,0.551,0.742,1.34,0.742,2.369c0,1.064-0.251,1.885-0.757,2.459c-0.504,0.576-1.115,0.863-1.836,0.863   c-0.354,0-0.703-0.092-1.047-0.273c-0.346-0.183-0.646-0.449-0.891-0.797v0.914H99.314 M100.922,93.316   c0,0.646,0.102,1.123,0.307,1.433c0.287,0.438,0.666,0.657,1.145,0.657c0.361,0,0.676-0.155,0.936-0.467   c0.258-0.313,0.387-0.805,0.387-1.476c0-0.712-0.131-1.229-0.391-1.542c-0.261-0.313-0.592-0.473-0.992-0.473   c-0.396,0-0.729,0.15-0.988,0.461C101.055,92.223,100.922,92.689,100.922,93.316" fill="#828282"/>
+<path d="M115.986,94.859h1.744c-0.211,0.602-0.545,1.059-0.998,1.373c-0.455,0.313-1.023,0.472-1.707,0.472   c-1.08,0-1.881-0.354-2.399-1.063c-0.409-0.564-0.614-1.283-0.614-2.146c0-1.033,0.271-1.845,0.809-2.431   c0.539-0.584,1.225-0.877,2.049-0.877c0.926,0,1.652,0.31,2.188,0.918c0.535,0.613,0.791,1.556,0.771,2.815H113.7   c0.012,0.488,0.144,0.868,0.397,1.14c0.252,0.272,0.564,0.408,0.943,0.408c0.257,0,0.477-0.07,0.646-0.212   C115.811,95.165,115.908,95.031,115.986,94.859 M116.184,92.906c-0.012-0.475-0.135-0.836-0.367-1.082   c-0.23-0.248-0.519-0.371-0.854-0.371c-0.357,0-0.654,0.131-0.889,0.391c-0.233,0.262-0.35,0.615-0.346,1.063H116.184   L116.184,92.906" fill="#828282"/>
+<path d="M126.186,96.547h-1.531v-0.914c-0.252,0.355-0.553,0.623-0.896,0.803c-0.344,0.182-0.69,0.271-1.042,0.271   c-0.713,0-1.322-0.289-1.83-0.865c-0.509-0.576-0.763-1.383-0.763-2.416c0-1.057,0.247-1.855,0.743-2.406   c0.492-0.553,1.119-0.824,1.877-0.824c0.693,0,1.295,0.289,1.802,0.867v-3.104h1.642v8.592L126.186,96.547 M121.811,93.316   c0,0.664,0.092,1.146,0.275,1.441c0.268,0.434,0.641,0.646,1.118,0.646c0.38,0,0.704-0.16,0.971-0.483   c0.267-0.321,0.4-0.806,0.4-1.446c0-0.718-0.13-1.23-0.39-1.55c-0.261-0.313-0.588-0.473-0.994-0.473   c-0.396,0-0.721,0.155-0.984,0.467C121.941,92.232,121.811,92.695,121.811,93.316" fill="#828282"/>
+<path d="M107.619,87.954h1.465v6.968c0,0.773,0.23,1.234,0.691,1.383c-0.229,0.43-0.613,0.646-1.16,0.646   c-0.664,0-0.996-0.461-0.996-1.385V87.954L107.619,87.954z" fill="#828282"/>
+<path d="M79.853,70.617c-1.015,0-2.356-0.167-2.356-0.167s-8.336,4.231-9.764,5.073   c-0.02-0.049,1.236-2.258,1.547-3.107c0.063-0.17-0.146-0.447-0.371-0.447c-0.582,0-1.314,0.101-2.509,0.095   c-11.423,0-16.711-5.935-16.711-8.958c0-4.03,6.263-8.743,15.843-8.743c4.238,0,10.453,0.671,13.107,2.34   c0.88-0.174,1.783-0.26,2.673-0.26c1.288,0,2.606,0.196,3.807,0.6l0,0c-6.327-4.967-12.986-6.204-19.587-6.204   c-12.972,0-21.33,5.268-21.33,11.995c0,6.767,10.156,12.78,21.33,12.78c0.688,0.021,1.232,0.121,1.04,0.559   c-0.184,0.417-2.91,4.688-3.744,6.221c-0.243,0.443,0.051,0.73,0.581,0.588l20.527-12.84l0,0   C82.847,70.432,81.506,70.617,79.853,70.617z" fill="#2976BB"/>
+<path d="M60.564,68.814h5.172l1.141-4.441c0.596-2.194,1.689-2.959,3.877-2.959c0.645,0,1.342,0.102,1.937,0.253   l0.994-3.571c-0.498-0.102-0.994-0.153-1.841-0.153c-1.289,0-2.979,0.818-3.875,1.939h-0.05l0.398-1.685h-4.969L60.564,68.814   L60.564,68.814z" fill="#FFFFFF"/>
+<path d="M78.344,62.333c0.417-1.124,1.353-1.787,2.762-1.787c1.406,0,2.084,0.612,2.084,1.43   c0,0.102-0.054,0.253-0.054,0.357H78.344L78.344,62.333 M82.197,65.75c-0.261,0.358-0.935,0.765-2.137,0.765   c-1.667,0-2.188-0.969-2.188-2.091h10.056c0.209-0.663,0.26-1.275,0.26-1.838c0-3.316-3.75-4.645-6.875-4.645   c-3.543,0-8.493,1.581-8.493,6.482c0,2.552,2.034,4.695,7.034,4.695c6.096,0,7.136-2.653,7.501-3.37h-5.157L82.197,65.75" fill="#FFFFFF"/>
+<path d="M93.861,65.801c0-0.816,0.875-1.12,1.75-1.225c0.977-0.051,1.955-0.101,2.828-0.459   c-0.358,1.581-1.078,2.602-2.881,2.602C94.736,66.719,93.861,66.514,93.861,65.801L93.861,65.801 M95.404,61.412   c0.31-0.766,1.082-1.071,2.111-1.071c0.82,0,1.692,0.203,1.692,0.918c0,1.326-2.419,1.123-3.911,1.223   c-4.013,0.206-6.734,0.972-6.734,3.781c0,2.04,2.105,2.856,4.521,2.856c1.545,0,3.352-0.46,4.271-1.327h0.054   c0,0.356,0.052,0.713,0.206,1.021h5.195c-0.207-0.461-0.104-0.103-0.207-0.919c0-0.716,1.696-5.462,1.696-7.146   c0-2.551-4.271-2.807-6.791-2.807c-3.396,0-6.276,0.665-7.103,3.472L95.404,61.412L95.404,61.412" fill="#FFFFFF"/>
+<polygon fill="#FFFFFF" points="104.313,68.815 104.313,68.815 109.523,68.815 113.418,54.217 108.207,54.217  "/>
+<polygon fill="#FFFFFF" points="115.221,66.548 115.221,66.548 114.289,66.548 114.289,68.96 113.516,68.96 113.516,66.548    112.584,66.548 112.584,65.971 115.221,65.971  "/>
+<polygon fill="#FFFFFF" points="119.084,68.96 119.084,68.96 118.313,68.96 118.313,66.958 117.762,68.258 117.229,68.258    116.68,66.958 116.68,68.96 115.943,68.96 115.943,65.971 116.848,65.971 117.516,67.471 118.184,65.971 119.084,65.971  "/>
+<rect fill="#99CCCC" height="16" width="3.496" x="85.231" y="2.39"/>
+<rect fill="#99CCCC" height="15.988" transform="matrix(-0.9241 -0.3821 0.3821 -0.9241 205.8219 70.7539)" width="3.494" x="108.19" y="6.946"/>
+<rect fill="#99CCCC" height="15.998" transform="matrix(0.7072 0.707 -0.707 0.7072 57.6263 -83.3022)" width="3.494" x="127.635" y="19.921"/>
+<rect fill="#99CCCC" height="15.991" transform="matrix(0.3827 0.9239 -0.9239 0.3827 131.839 -102.3118)" width="3.496" x="140.731" y="39.504"/>
+<rect fill="#99CCCC" height="3.496" width="16" x="139" y="68.67"/>
+<rect fill="#99CCCC" height="16.003" transform="matrix(0.3837 -0.9234 0.9234 0.3837 1.4789 189.0872)" width="3.494" x="140.663" y="85.434"/>
+<rect fill="#99CCCC" height="16.02" transform="matrix(0.7079 -0.7063 0.7063 0.7079 -41.9346 124.3225)" width="3.498" x="127.606" y="104.856"/>
+<rect fill="#99CCCC" height="15.98" transform="matrix(-0.9237 0.383 -0.383 -0.9237 259.5883 200.0274)" width="3.493" x="108.134" y="117.866"/>
+<rect fill="#99CCCC" height="16" width="3.495" x="85.216" y="122.391"/>
+<rect fill="#99CCCC" height="15.997" transform="matrix(0.9238 0.3828 -0.3828 0.9238 53.0481 -14.9199)" width="3.495" x="62.265" y="117.832"/>
+<rect fill="#99CCCC" height="16.01" transform="matrix(-0.7073 -0.7069 0.7069 -0.7073 -3.6993 224.0054)" width="3.492" x="42.778" y="104.764"/>
+<rect fill="#99CCCC" height="15.997" transform="matrix(-0.3823 -0.924 0.924 -0.3823 -42.6359 158.1622)" width="3.492" x="29.799" y="85.333"/>
+<rect fill="#99CCCC" height="3.495" width="16" x="19" y="68.515"/>
+<rect fill="#99CCCC" height="15.984" transform="matrix(-0.3818 0.9242 -0.9242 -0.3818 87.495 36.434)" width="3.493" x="29.816" y="39.486"/>
+<rect fill="#99CCCC" height="15.998" transform="matrix(-0.7065 0.7077 -0.7077 -0.7065 95.7396 16.3999)" width="3.496" x="42.721" y="20.054"/>
+<rect fill="#99CCCC" height="16.005" transform="matrix(0.9241 -0.3822 0.3822 0.9241 -0.8874 25.5505)" width="3.494" x="62.126" y="7.006"/>
+</g>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/group/icons/qgn_indi_mp_ratio_orig.svg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="35.999" height="36" viewBox="0 0 35.999 36">
+<rect fill="none" height="36" width="35.999"/>
+<polygon fill="#FFFFFF" points="35.215,32 33.217,32 2.784,32 0.784,32 0.784,30 0.784,6 0.784,4 2.784,4 33.217,4 35.215,4 35.215,6 35.215,30 35.215,32 "/>
+<path d="M2.784,6v24h30.434V6H2.784z M31.217,28H4.784V8h26.434V28z"/>
+<path d="M6.999,11.813v12.375H29V11.813H6.999z M27,22.188H8.999v-8.375H27V22.188z"/>
+<polygon points="31.23,19.259 29.05,18.001 31.23,16.741 "/>
+<polygon points="4.79,16.741 6.969,18 4.79,19.259 "/>
+<polygon points="20.213,28.006 15.785,28.006 18,24.172 "/>
+<polygon points="20.243,7.999 18.029,11.833 15.814,7.999 "/>
+</svg>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/group/icons/qgn_indi_mp_ratio_stretch.svg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="35.999" height="36" viewBox="0 0 35.999 36">
+<rect fill="none" height="36" width="35.999"/>
+<polygon fill="#FFFFFF" points="35.215,32 33.217,32 2.783,32 0.783,32 0.783,30 0.783,6 0.783,4 2.783,4 33.217,4 35.215,4 35.215,6 35.215,30 35.215,32 "/>
+<path d="M2.783,6v24h30.434V6H2.783z M31.217,28H4.783V8h26.434V28z"/>
+<path d="M6.999,11.813v12.375h22V11.813H6.999z M26.999,22.188h-18v-8.375h18V22.188z"/>
+<polygon points="7.017,19.259 4.837,18 7.017,16.741 "/>
+<polygon points="29.002,16.741 31.182,18 29.002,19.259 "/>
+<polygon points="15.785,24.202 20.213,24.202 17.999,28.036 "/>
+<polygon points="15.813,11.809 18.027,7.975 20.243,11.809 "/>
+</svg>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/group/icons/qgn_indi_mp_ratio_zoom.svg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="36" height="36" viewBox="0 0 36 36">
+<rect fill="none" height="36" width="36"/>
+<polygon fill="#FFFFFF" points="35.216,31.999 33.216,31.999 2.783,31.999 0.783,31.999 0.783,30 0.783,6 0.783,4 2.783,4 33.216,4 35.216,4 35.216,6 35.216,30 35.216,31.999 "/>
+<path d="M2.783,6v24h30.433V6H2.783z M31.169,28H4.833V8h26.337V28z"/>
+<path d="M27.071,31.98l-1.37-1.42l-4.159-4.315l-1.613-1.673l1.921-1.313c0.706-0.482,1.309-1.098,1.79-1.829 l1.352-2.052l1.703,1.768l4.22,4.377l1.358,1.41l-1.404,1.365l-2.383,2.311L27.071,31.98L27.071,31.98z" fill="#FFFFFF"/>
+<path d="M29.498,26.888l-4.218-4.377c-0.613,0.935-1.4,1.742-2.322,2.371l4.157,4.315L29.498,26.888z"/>
+<path d="M18.001,27.415c-5.333,0-9.669-4.34-9.669-9.677s4.336-9.677,9.669-9.677c5.329,0,9.666,4.34,9.666,9.677 S23.331,27.415,18.001,27.415L18.001,27.415z" fill="#FFFFFF"/>
+<path d="M18.002,10.026c-4.254,0-7.705,3.453-7.705,7.712c0,4.257,3.451,7.712,7.705,7.712c4.252,0,7.701-3.455,7.701-7.712 C25.703,13.479,22.254,10.026,18.002,10.026z M18.002,23.393c-3.116,0-5.651-2.536-5.651-5.655s2.535-5.655,5.651-5.655 c3.113,0,5.65,2.536,5.65,5.655S21.115,23.393,18.002,23.393z"/>
+<polygon points="22.542,16.73 19.126,16.73 19.126,13.312 16.872,13.312 16.872,16.73 13.458,16.73 13.458,18.989 16.872,18.989 16.872,22.407 19.126,22.407 19.126,18.989 22.542,18.989 "/>
+</svg>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/group/mpxvideoplaybackcontrols.mmp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,87 @@
+/*
+* 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 mpxvideoplaybackview.
+*
+*/
+
+// Version : %version: 12 %
+
+
+
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+TARGET              mpxvideoplaybackcontrols.dll
+TARGETTYPE          dll
+UID                 0x1000006C 0x200159B5
+
+CAPABILITY          CAP_GENERAL_DLL
+VENDORID            VID_DEFAULT
+
+SOURCEPATH          ../src
+
+START RESOURCE      ../data/mpxvideoplaybackcontrols.rss
+HEADER
+TARGETPATH          APP_RESOURCE_DIR
+LANGUAGE_IDS 
+END // RESOURCE
+
+SOURCE              mpxvideoplaybackcontrol.cpp
+SOURCE              mpxvideoplaybackcontrolpolicy.cpp
+SOURCE              mpxvideoplaybackcontrolconfiguration.cpp
+SOURCE              mpxvideoplaybackcontrolscontroller.cpp
+SOURCE              mpxvideoplaybackbutton.cpp
+SOURCE              mpxvideoplaybackbuttonbar.cpp
+SOURCE              mpxvideoplaybackvolumebar.cpp
+SOURCE              mpxvideoplaybackprogressbar.cpp
+SOURCE              mpxvideoplaybackcontrolpdl.cpp
+SOURCE              mpxvideoplaybackaspectratioicon.cpp
+SOURCE              mpxvideoplaybackbrandinganimation.cpp 
+SOURCE              mpxvideoplaybackmediadetailsviewer.cpp
+
+USERINCLUDE         ../inc
+USERINCLUDE         ../../inc
+USERINCLUDE         ../../../inc
+
+APP_LAYER_SYSTEMINCLUDE
+
+LIBRARY             euser.lib
+LIBRARY             ecom.lib
+LIBRARY             avkon.lib
+LIBRARY             cone.lib
+LIBRARY             eikcore.lib
+LIBRARY             ws32.lib
+LIBRARY             cdlengine.lib
+LIBRARY             bafl.lib
+LIBRARY             estor.lib
+LIBRARY             aknicon.lib
+LIBRARY             eikctl.lib
+LIBRARY             eikcoctl.lib
+LIBRARY             bitgdi.lib
+LIBRARY             fbscli.lib
+LIBRARY             commonengine.lib
+LIBRARY             efsrv.lib
+LIBRARY             gdi.lib
+LIBRARY             aknlayout2scalable.lib
+LIBRARY             aknlayout2.lib
+LIBRARY             mpxvideoplaybackviews.lib
+LIBRARY             aknskins.lib
+LIBRARY             egul.lib
+LIBRARY             touchfeedback.lib
+LIBRARY             bmpanim.lib
+LIBRARY             flogger.lib
+LIBRARY             playbackhelper.lib
+LIBRARY             centralrepository.lib // For display backlight timeout value
+
+//End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/inc/mpxvideoplaybackaspectratioicon.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,111 @@
+/*
+* 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:  Popup control for full screen container
+*
+*/
+
+
+// Version : %version: 7 %
+
+
+#ifndef MPXVIDEOPLAYBACKASPECTRATIOICON_H
+#define MPXVIDEOPLAYBACKASPECTRATIOICON_H
+
+//  INCLUDES
+#include <coecntrl.h>
+
+// FORWARD DECLARATIONS
+class CMPXVideoPlaybackControlsController;
+
+#ifdef RD_TACTILE_FEEDBACK
+class MTouchFeedback;
+#endif //RD_TACTILE_FEEDBACK
+
+class CMPXVideoPlaybackAspectRatioIcon : public CCoeControl
+{
+    public:
+        /**
+        * Two-phased constructor.
+        */
+        static CMPXVideoPlaybackAspectRatioIcon* NewL(
+                CMPXVideoPlaybackControlsController* aController, TRect aRect );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CMPXVideoPlaybackAspectRatioIcon();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CMPXVideoPlaybackAspectRatioIcon( CMPXVideoPlaybackControlsController* aController );
+
+        /**
+         * By default Symbian 2nd phase constructor is private.
+         */
+        void ConstructL( TRect aRect );
+
+    private:
+
+        /**
+        * From CoeControl,CountComponentControls.
+        * @return Number of contained component controls.
+        */
+        TInt CountComponentControls() const;
+
+        /**
+        * From CCoeControl,Draw.
+        * @param aRect drawable area.
+        */
+        void Draw( const TRect& aRect ) const;
+
+        /**
+        * From CoeControl,OfferKeyEventL
+        */
+        void HandlePointerEventL( const TPointerEvent& aPointerEvent );
+
+    private:
+        /**
+        * Creates new skins for the control
+        * @return void
+        */
+        void SkinChangeL();
+
+    public:
+
+        /**
+        * change the icon per aspect ratio
+        * @return void
+        */
+        void AspectRatioChanged( TInt aAspectRatio );
+
+    private:    // Data
+        CGulIcon*        iNaturalIcon;
+        CGulIcon*        iStretchIcon;
+        CGulIcon*        iZoomIcon;
+
+        TRect            iAspectRatioRect;
+
+#ifdef RD_TACTILE_FEEDBACK
+        MTouchFeedback*  iFeedback;
+#endif //RD_TACTILE_FEEDBACK
+
+        CMPXVideoPlaybackControlsController* iController;
+};
+
+#endif //MPXVIDEOPLAYBACKASPECTRATIOICON_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/inc/mpxvideoplaybackbrandinganimation.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,128 @@
+/*
+* 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:  Branding Animation control for full screen container
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+#ifndef MPXVIDEOPLAYBACKBRANDINGANIMATION_H
+#define MPXVIDEOPLAYBACKBRANDINGANIMATION_H
+
+//  INCLUDES
+#include <coecntrl.h>
+#include <f32file.h>
+
+// FORWARD DECLARATIONS
+class CMPXVideoPlaybackControlsController;
+
+
+class CMPXVideoPlaybackBrandingAnimation : public CCoeControl
+{
+    public:
+        /**
+        * Two-phased constructor.
+        */
+        static CMPXVideoPlaybackBrandingAnimation* NewL( 
+                CMPXVideoPlaybackControlsController* aController,
+                                                     TRect aRect, 
+                                                     TBool aRealFormat );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CMPXVideoPlaybackBrandingAnimation();
+               
+        /*
+         *  Start the Branding Animation timer
+         *  @since 9.2
+         */
+        void StartBrandingTimer();
+        
+        /*
+         *  Cancel the Branding Animation timer
+         *  @since 9.2
+         */
+        void CancelBrandingTimer();
+
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CMPXVideoPlaybackBrandingAnimation( CMPXVideoPlaybackControlsController* aController,
+                                            TBool aRealFormat );
+
+        /**
+         * By default Symbian 2nd phase constructor is private.
+         */
+        void ConstructL( TRect aRect );
+
+    private: 
+
+        /**
+        * From CoeControl,CountComponentControls.
+        * @return Number of contained component controls.
+        */
+        TInt CountComponentControls() const;
+
+        /**
+        * From CCoeControl,Draw.
+        * @param aRect drawable area.
+        */
+        void Draw( const TRect& aRect ) const;
+
+
+    private:
+        
+        /**
+        * Creates new bitmaps for the control
+        * @since 9.2 
+        * @return void
+        */
+        void CreateBitmapsL();
+        
+        /** 
+        * Timer callback for Branding Animation. 
+        * @since 9.2 
+        * @param aPtr Pointer to timers callback 
+        * @return KErrNone 
+        */ 
+        static TInt BrandingTimer( TAny* aPtr );
+
+        /** 
+        * Handle Branding Animation Timer
+        * @since 9.2 
+        * @return void 
+        */ 
+        void HandleBrandingTimer();
+
+    private:    // Data        
+        CArrayPtrFlat< CGulIcon >   iIconArray;
+
+        TRect                       iBrandingRect;
+        TInt                        iCount;
+        TInt                        iCurrentIndex;
+        CPeriodic*                  iBrandingTimer;  
+        TBool                       iRealFormat;
+        
+        CMPXVideoPlaybackControlsController* iController;
+};
+
+#endif //MPXVIDEOPLAYBACKBRANDINGANIMATION_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/inc/mpxvideoplaybackbutton.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,162 @@
+/*
+* 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:  Popup control for full screen container
+*
+*/
+
+// Version : %version: 7 %
+
+
+#ifndef MPXVIDEOPLAYBACKBUTTON_H
+#define MPXVIDEOPLAYBACKBUTTON_H
+
+//  INCLUDES
+#include <coecntrl.h>
+
+#include "mpxvideo_debug.h"
+#include "mpxvideoplaybackcontrolscontroller.h"
+
+// FORWARD DECLARATIONS
+
+#ifdef RD_TACTILE_FEEDBACK
+class MTouchFeedback;
+#endif //RD_TACTILE_FEEDBACK
+
+// DATA TYPES
+enum TMPXButtonState
+{
+   EMPXButtonNormal,
+   EMPXButtonDimmed,
+   EMPXButtonPressed
+};
+
+class CMPXVideoPlaybackButton : public CCoeControl
+{
+    public:
+        /**
+        * Two-phased constructor.
+        */
+        static CMPXVideoPlaybackButton* NewL( CMPXVideoPlaybackControlsController* aController,
+                                              TRect aRect, const TDesC &aIconPath );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CMPXVideoPlaybackButton();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CMPXVideoPlaybackButton();
+
+        /**
+         * By default Symbian 2nd phase constructor is private.
+         */
+        void ConstructL( CMPXVideoPlaybackControlsController* aController,
+                         TRect aRect, const TDesC &aIconPath );
+
+    private:
+
+        /**
+        * From CoeControl,CountComponentControls.
+        * @return Number of contained component controls.
+        */
+        TInt CountComponentControls() const;
+
+        /**
+        * From CCoeControl,Draw.
+        * @param aRect drawable area.
+        */
+        void Draw( const TRect& aRect ) const;
+
+    private:
+
+        /**
+        * Creates button per a state
+        */
+        CGulIcon* CreateButtonL( const TAknsItemID &aID,
+                                 const TInt aFileIndex,
+                                 const TInt aFileMaskIndex );
+
+    public:
+        /**
+        * Creates button for defautl cases
+        * @return void
+        */
+        void CreateDefaultButtonL( const TAknsItemID &aID,
+                                   const TInt aFileIndex,
+                                   const TInt aFileMaskIndex );
+
+        /**
+        * Creates button for dimmed state
+        * @return void
+        */
+        void CreateDimmedButtonL( const TAknsItemID &aID,
+                                  const TInt aFileIndex,
+                                  const TInt aFileMaskIndex );
+
+        /**
+        * Creates button for pressed button
+        * @return void
+        */
+        void CreatePressedButtonL( const TAknsItemID &aID,
+                                   const TInt aFileIndex,
+                                   const TInt aFileMaskIndex );
+
+        /**
+        * Set Dimmed
+        * @return void
+        */
+        void SetDimmed( TBool aDimmed );
+
+        /**
+        * Set pressed
+        * @return void
+        */
+        void SetPressed( TBool aPressed );
+
+        /**
+        * Check whether this button is dimmed or not
+        * @return void
+        */
+        inline TBool IsDimmed();
+
+    private:    // Data
+        CGulIcon*               iDefaultButton;
+        CGulIcon*               iDimmedButton;
+        CGulIcon*               iPressedButton;
+
+        TMPXButtonState         iState;
+        HBufC*                  iIConPath;
+
+        CMPXVideoPlaybackControlsController* iController;
+};
+
+// INLINE METHODS
+
+inline
+TBool CMPXVideoPlaybackButton::IsDimmed()
+{
+    TBool isDimmed = ( iState == EMPXButtonDimmed )? ETrue : EFalse;
+
+    MPX_DEBUG(_L("CMPXVideoPlaybackButton::IsDimmed() (%d)"), isDimmed);
+
+    return isDimmed;
+}
+
+#endif //MPXVIDEOPLAYBACKBUTTON_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/inc/mpxvideoplaybackbuttonbar.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,206 @@
+/*
+* 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:  Popup control for full screen container
+*
+*/
+
+// Version : %version: 9 %
+
+
+#ifndef MPXVIDEOPLAYBACKBUTTONBAR_H
+#define MPXVIDEOPLAYBACKBUTTONBAR_H
+
+//  INCLUDES
+#include <coecntrl.h>
+#include <mpxplaybackframeworkdefs.h>
+
+#include "mpxhelixplaybackplugindefs.h"
+#include "mpxvideo_debug.h"
+
+// FORWARD DECLARATIONS
+class CMPXVideoPlaybackButton;
+class CMPXVideoPlaybackViewFileDetails;
+class CMPXVideoPlaybackControlsController;
+
+#ifdef RD_TACTILE_FEEDBACK
+class MTouchFeedback;
+#endif //RD_TACTILE_FEEDBACK
+
+// DATA TYPES
+enum TMPXButton
+{
+    EMPXButtonFastForward,
+    EMPXButtonPlay,
+    EMPXButtonRewind,
+    EMPXButtonPause,
+    EMPXButtonCount    // Should always be the last value
+};
+
+enum TMPXButtonPressed
+{
+    EMPXNotPressed,
+    EMPXTopButtonPressed,
+    EMPXMiddleButtonPressed,
+    EMPXBottomButtonPressed
+};
+
+
+class CMPXVideoPlaybackButtonBar : public CCoeControl
+{
+    public:
+        /**
+        * Two-phased constructor.
+        */
+        static CMPXVideoPlaybackButtonBar* NewL( CMPXVideoPlaybackControlsController* aController,
+                                                 TRect aRect );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CMPXVideoPlaybackButtonBar();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CMPXVideoPlaybackButtonBar( CMPXVideoPlaybackControlsController* aController );
+
+        /**
+         * By default Symbian 2nd phase constructor is private.
+         */
+        void ConstructL( TRect aRect );
+
+    private:
+
+        /**
+        * From CoeControl,CountComponentControls.
+        * @return Number of contained component controls.
+        */
+        TInt CountComponentControls() const;
+
+        /**
+        * From CCoeControl,ComponentControl.
+        * @param aIndex index of a contained component control.
+        */
+        CCoeControl* ComponentControl( TInt aIndex ) const;
+
+        /**
+        * From CCoeControl,Draw.
+        * @param aRect drawable area.
+        */
+        void Draw( const TRect& aRect ) const;
+
+
+    public: // from CoeControl
+
+        /**
+        * From CoeControl,HandleResourceChange
+        */
+        void HandleResourceChange( TInt aType );
+
+        /**
+        * From CoeControl,SetContainerWindowL
+        */
+        void SetContainerWindowL( const CCoeControl& aContainer );
+
+        /**
+        * From CoeControl,OfferKeyEventL
+        */
+        void HandlePointerEventL( const TPointerEvent& aPointerEvent );
+
+    public:
+
+        /**
+        * Set changed state
+        * @return void
+        */
+        void UpdateStateOnButtonBar( TMPXPlaybackState aState );
+
+        /*
+         *  Update button's state based on file details
+         *  @since 5.0
+         */
+        void UpdateButtonBarState( CMPXVideoPlaybackViewFileDetails* aDetails  );
+
+        /*
+         *  Bring the button bar to its original state
+         *  @since 5.0
+         */
+        void Reset();
+
+    private:
+        /**
+        * Creates buttons
+        * @return void
+        */
+        void CreateButtonsL();
+
+        /**
+        * Creates new skins for the control.
+        * @return void
+        */
+        void SkinChangeL();
+
+        //
+        //  Performs logic for the button down events
+        //
+        void HandleButtonDownEventL( const TPointerEvent& aPointerEvent );
+
+        //
+        //  Performs logic for the button up events for top button
+        //
+        void HandleTopButtonUpEventL( const TPointerEvent& aPointerEvent );
+
+        //
+        //  Performs logic for the button up events for middle button
+        //
+        void HandleMiddleButtonUpEventL();
+
+        //
+        //  Performs logic for the button up events for bottom button
+        //
+        void HandleBottomButtonUpEventL( const TPointerEvent& aPointerEvent );
+
+        //
+        //  Callback fuction of iSeekingTimer
+        //
+        static TInt StartSeekingL( TAny* aPtr );
+
+        //
+        //  Start seeking
+        //
+        void DoStartSeekingL();
+
+    private:    // Data
+        CArrayPtrFlat< CMPXVideoPlaybackButton >  iButtons;
+        CMPXVideoPlaybackControlsController* iController;
+
+        TBool                                iSeeking;
+
+        TRect                                iTopButtonRect;
+        TRect                                iMiddleButtonRect;
+        TRect                                iBottomButtonRect;
+
+        TMPXButtonPressed                    iButtonPressed;
+        CPeriodic*                           iSeekingTimer;
+
+#ifdef RD_TACTILE_FEEDBACK
+        MTouchFeedback*                      iFeedback;
+#endif //RD_TACTILE_FEEDBACK
+};
+
+#endif //MPXVIDEOPLAYBACKBUTTONBAR_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/inc/mpxvideoplaybackcontrolconfiguration.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,101 @@
+/*
+* 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:  Implementation of CMPXVideoPlaybackControlConfiguration
+*
+*/
+
+// Version : %version: 5 %
+
+
+
+#ifndef MPXVIDEOPLAYBACKCONTROLCONFIGURATION_H_
+#define MPXVIDEOPLAYBACKCONTROLCONFIGURATION_H_
+
+// INCLUDES
+#include "mpxvideoplaybackcontrol.hrh"
+#include "mpxhelixplaybackplugindefs.h"
+
+// FORWARD DECLARATIONS
+class CMPXVideoPlaybackControlsController;
+class CMPXVideoPlaybackViewFileDetails;
+
+// DATA TYPES
+
+// CLASS DECLARATION
+class CMPXVideoPlaybackControlConfiguration : public CBase
+{
+
+    public: // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CMPXVideoPlaybackControlConfiguration* NewL(
+                        CMPXVideoPlaybackControlsController* aController );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CMPXVideoPlaybackControlConfiguration();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CMPXVideoPlaybackControlConfiguration( CMPXVideoPlaybackControlsController* aController );
+
+        /**
+        * Symbian 2nd phase constructor.
+        */
+        void ConstructL();
+
+    public:
+        /**
+        * Update control list
+        */
+        void UpdateControlListL( TMPXVideoPlaybackControlCommandIds aEvent,
+                                 TBool aShowArIcon = EFalse );
+
+        /**
+        * Return control list
+        */
+        RArray<TMPXVideoPlaybackControls>& ControlList();
+
+        void UpdateControlsWithFileDetailsL();
+
+    private:
+        /**
+        * Create control list
+        */
+        void CreateControlListL();
+
+        /**
+        * Delete controls from list
+        */
+        void DeleteControlFromList( TMPXVideoPlaybackControls aControl );
+
+    private:
+        CMPXVideoPlaybackControlsController*      iControlsController;
+        RArray<TMPXVideoPlaybackControls>         iControlsList;
+
+        TBool      iAspectRatioIconAdded;
+        TBool      iAudioOnlyIndicatorsAdded;
+        TBool      iTitleArtistIndicatorsAdded;
+        TBool      iDownloadPausedAdded;
+};
+
+#endif /*MPXVIDEOPLAYBACKCONTROLCONFIGURATION_H_*/
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/inc/mpxvideoplaybackcontrolpdl.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,71 @@
+/*
+* 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:  Implementation of CMPXVideoPlaybackControl
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+#ifndef MPXPLAYBACKCONTROLPDL_H_
+#define MPXPLAYBACKCONTROLPDL_H_
+
+// INCLUDES
+
+#include "mpxvideoplaybackcontrol.h"
+
+// DATA TYPES
+
+// CLASS DECLARATION
+
+class CMPXVideoPlaybackControlPdl : public CMPXVideoPlaybackControl
+{
+    public: // Constructors and destructor
+
+        /*
+         * Two-phased constructor.
+         */
+        static CMPXVideoPlaybackControlPdl* NewL( CMPXVideoPlaybackControlsController* aController,
+                                                  CCoeControl* aControl,
+                                                  TRect aRect,
+                                                  TMPXVideoPlaybackControls aControlIndex,
+                                                  TUint aProperties );
+
+        /*
+         * Destructor.
+         */
+        virtual ~CMPXVideoPlaybackControlPdl();
+
+    private:
+
+        /*
+         * C++ default constructor.
+         */
+        CMPXVideoPlaybackControlPdl( CMPXVideoPlaybackControlsController* aController,
+                                     CCoeControl* aControl,
+                                     TMPXVideoPlaybackControls aControlIndex,
+                                     TUint aProperties );
+
+    public:
+
+        /*
+         *  Sets visibility of each control
+         */
+        void MakeVisible( TBool aVisible );
+};
+
+#endif /*MPXPLAYBACKCONTROLPDL_H_*/
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/inc/mpxvideoplaybackcontrolpolicy.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,72 @@
+/*
+* 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:  Implementation of MPXVideoPlaybackControlPolicy
+*
+*/
+
+// Version : %version: 4 %
+
+
+
+#ifndef MPXVIDEOPLAYBACKCONTROLPOLICY_H_
+#define MPXVIDEOPLAYBACKCONTROLPOLICY_H_
+
+// INCLUDES
+#include "mpxvideoplaybackcontrol.hrh"
+
+// FORWARD DECLARATIONS
+class CMPXVideoPlaybackViewFileDetails;
+
+// DATA TYPES
+
+// CLASS DECLARATION
+class CMPXVideoPlaybackControlPolicy : public CBase
+{
+
+    public: // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CMPXVideoPlaybackControlPolicy* NewL();
+
+        /**
+        * Destructor.
+        */
+        virtual ~CMPXVideoPlaybackControlPolicy();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CMPXVideoPlaybackControlPolicy();
+
+        /**
+        * Symbian 2nd phase constructor.
+        */
+        void ConstructL();
+
+    public:
+        /**
+        * Sets the control properties per policy
+        */
+        void SetControlProperties( TMPXVideoPlaybackControls aControlIndex,
+                                   TUint& aProperties,
+                                   CMPXVideoPlaybackViewFileDetails* aDetails );
+};
+
+#endif /*MPXVIDEOPLAYBACKCONTROLPOLICY_H_*/
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/inc/mpxvideoplaybackprogressbar.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,215 @@
+/*
+* 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: Progress bar control
+*
+*/
+
+// Version : %version: 6 %
+
+
+
+#ifndef MPXVIDEOPLAYBACKPROGRESSBAR_H
+#define MPXVIDEOPLAYBACKPROGRESSBAR_H
+
+//  INCLUDES
+#include <coecntrl.h>
+
+#include "mpxhelixplaybackplugindefs.h"
+
+
+// FORWARD DECLARATIONS
+class CEikLabel;
+class CMPXVideoPlaybackViewFileDetails;
+class CMPXVideoPlaybackControlsController;
+
+#ifdef RD_TACTILE_FEEDBACK
+class MTouchFeedback;
+#endif //RD_TACTILE_FEEDBACK
+
+
+class CMPXVideoPlaybackProgressBar : public CCoeControl
+{
+    public:
+        /**
+        * Two-phased constructor.
+        */
+        static CMPXVideoPlaybackProgressBar* NewL( CMPXVideoPlaybackControlsController* aController,
+                                                   TRect aRect );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CMPXVideoPlaybackProgressBar();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CMPXVideoPlaybackProgressBar( CMPXVideoPlaybackControlsController* aController );
+
+        /**
+         * By default Symbian 2nd phase constructor is private.
+         */
+        void ConstructL( TRect aRect );
+
+    private: // from CoeControl
+
+        /**
+        * From CoeControl,CountComponentControls.
+        * @return Number of contained component controls.
+        */
+        TInt CountComponentControls() const;
+
+        /**
+        * From CCoeControl,ComponentControl.
+        * @param aIndex index of a contained component control.
+        */
+        CCoeControl* ComponentControl( TInt aIndex ) const;
+
+        /**
+        * From CCoeControl,Draw.
+        * @param aRect drawable area.
+        */
+        void Draw( const TRect& aRect ) const;
+
+    public: // from CoeControl
+
+        /**
+        * From CoeControl,OfferKeyEventL
+        */
+        void HandlePointerEventL( const TPointerEvent& aPointerEvent );
+
+        /**
+        * From CCoeControl.
+       */
+        void HandleResourceChange( TInt aType );
+
+    public:
+
+        /**
+        * Set changed duration
+        * @param aDur the duration text to be displayed
+        */
+        void DurationChangedL( TInt aDuration );
+
+        /**
+        * Set changed position
+        * @param aPos the position text to be displayed
+        * @since 5.0
+        */
+        void PositionChangedL( TInt aPosition, TBool aUserChanged = EFalse );
+
+        /*
+        *  Sets the size of download
+        *  @param aSize   Download size
+        *  @since 5.0
+        */
+        void SetDownloadSize( TInt aSize );
+        
+        /*
+        *  Updates the download size and calculates the download progress ratio
+        *  @param aSize   Updated Download Size
+        *  @since 5.0
+        */
+        void UpdateDownloadPosition( TInt aSize );
+        
+        /*
+         *  Creates the needed resource if the playback mode changes
+         *  @since 5.0
+         */
+        void UpdateProgressBarStateL( CMPXVideoPlaybackViewFileDetails* aDetails );
+        
+        /*
+         *  Abandons any ongoing pointer input 
+         *  @since 5.0
+         */        
+        void Reset();
+
+    private: //new fuctions
+        /**
+        * Set layout for each icon
+        */
+        void SetLayoutL();
+
+        /**
+        * Creates new skins for the control.
+        * @since 5.0
+        * @return void
+        */
+        void SkinChangeL();
+
+        /*
+        *  change times to readable format for MM:SS
+        *  @param aTime need to change aTime to readable format
+        *  @param aLabel label to assing readable time
+        */
+        void SetTextLWithReadableTimeL( TInt aTime, CEikLabel* aLabel );
+        
+        //
+        //  Performs logic for the button down events
+        //
+        void HandleButtonDownEventL( TReal aRatio );
+
+        //
+        //  Performs logic for the dragging events
+        //
+        void HandleDraggingEventL( TReal aRatio );
+        
+        //
+        //  Performs logic for the button up events
+        //
+        void HandleButtonUpEventL( TReal aRatio );
+        
+    private:    // Data
+        CMPXVideoPlaybackControlsController* iController;
+
+        CGulIcon*               iFrameIcon;
+        CGulIcon*               iPlaybackIcon;
+        CGulIcon*               iDownloadIcon;
+        CGulIcon*               iSliderIcon;
+        CGulIcon*               iSelectedSliderIcon;
+
+        TRect                   iFrameIconRect;
+        TRect                   iPlaybackRect;
+        TRect                   iDownloadRect;
+        TRect                   iSliderRect;
+
+        TReal                   iDuration;
+        TReal                   iPlaybackRatio;
+        TReal                   iDownloadRatio;
+
+        CEikLabel*              iPositionLabel;
+        CEikLabel*              iDurationLabel;
+
+        HBufC*                  iMinSecFormatString;
+        HBufC*                  iHourMinSecFormatString;
+        HBufC*                  iLiveStreamingString;
+
+        TBool                   iDragging;
+        TBool                   iPointerEventStarted;
+        TBool                   iWasPlaying;
+        
+        TInt                    iDownloadSize;
+        TInt                    iOldDLSize;
+
+#ifdef RD_TACTILE_FEEDBACK
+        MTouchFeedback*         iFeedback;
+#endif //RD_TACTILE_FEEDBACK
+
+};
+
+#endif //MPXVIDEOPLAYBACKPROGRESSBAR_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/inc/mpxvideoplaybackvolumebar.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,190 @@
+/*
+* 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:  Implementation of CMPXVideoPlaybackVolumeBar
+*
+*/
+
+// Version : %version: 9 %
+
+
+
+#ifndef MPXVIDEOPLAYBACKVOLUMEBAR_H
+#define MPXVIDEOPLAYBACKVOLUMEBAR_H
+
+//  INCLUDES
+#include <coecntrl.h>
+
+
+// FORWARD DECLARATIONS
+class CMPXVideoPlaybackControlsController;
+
+#ifdef RD_TACTILE_FEEDBACK
+class MTouchFeedback;
+#endif //RD_TACTILE_FEEDBACK
+
+// DATA TYPES
+enum TMPXVolumeDragging
+{
+   EVolumeNotDragging,
+   EVolumeIncreaseDragging,
+   EVolumeDecreaseDragging,
+   EVolumeSpeakerDragging,
+   EVolumeBarDragging
+};
+
+
+class CMPXVideoPlaybackVolumeBar : public CCoeControl
+{
+    public:
+        /**
+        * Two-phased constructor.
+        */
+        static CMPXVideoPlaybackVolumeBar* NewL( CMPXVideoPlaybackControlsController* aController,
+                                                 TRect aRect );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CMPXVideoPlaybackVolumeBar();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CMPXVideoPlaybackVolumeBar( CMPXVideoPlaybackControlsController* aController, TRect aRect );
+
+        /**
+         * By default Symbian 2nd phase constructor is private.
+         */
+        void ConstructL();
+        
+        void CreateSliderIconsL();
+
+    private: // from CoeControl
+
+        /**
+        * From CoeControl,CountComponentControls.
+        * @return Number of contained component controls.
+        */
+        TInt CountComponentControls() const;
+
+        /**
+        * From CCoeControl,Draw.
+        * @param aRect drawable area.
+        */
+        void Draw( const TRect& aRect ) const;
+
+    public: // from CoeControl
+
+        /**
+        * From CoeControl,OfferKeyEventL
+        */
+        void HandlePointerEventL( const TPointerEvent& aPointerEvent );
+
+        /**
+        * From CCoeControl.
+        */
+        void HandleResourceChange( TInt aType );
+
+    public:
+
+        /**
+        * Set changed volume
+        * @since 5.0
+        * @return void
+        */
+        void VolumeChanged( TInt aVolume );
+        
+        /*
+         *  Abandons any ongoing pointer input 
+         *  @since 5.0
+         */        
+        void Reset();
+ 
+        /**
+        * TV Out connected
+        * @return void
+        */
+        void UpdateTVOutStatusL( TBool aConnected );
+
+    private: //new fuctions
+        /**
+        * Set layout for each icon
+        */
+        void SetLayout();
+
+        /**
+        * Creates new skins for the control.
+        * @since 5.0
+        * @return void
+        */
+        void SkinChangeL();
+        
+        void HandleVolumeIncreaseL( const TPointerEvent& aPointerEvent );
+        void HandleVolumeDecreaseL( const TPointerEvent& aPointerEvent );
+        void HandleSpeakerControlEventL( const TPointerEvent& aPointerEvent );
+        void HandleVolumeBarEventL( const TPointerEvent& aPointerEvent );
+
+        static TInt HandleVolumeDragEventTimeOut( TAny* aPtr );
+        void DoHandleVolumeDragEventTimeOut();
+        void SetVolumeL( TInt aVolume ); 
+
+    private:    // Data
+        CGulIcon*               iSpeakerIcon;
+        CGulIcon*               iSpeakerMuteIcon;
+        CGulIcon*               iSliderIcon;
+        CGulIcon*               iSliderSelectedIcon;
+        CGulIcon*               iVolumeUpIcon;
+        CGulIcon*               iVolumeDownIcon;
+        CGulIcon*               iVolumeFrameIconTop;
+        CGulIcon*               iVolumeFrameIconMiddle;
+        CGulIcon*               iVolumeFrameIconBottom;
+        CGulIcon*               iNoAudioIcon; 
+
+        TReal                   iOneVolumeIncrementHeight;
+
+        TBool                   iMuted;
+        TInt                    iVolumeWhileDraggingEvent;
+
+        TRect                   iRect;
+        TRect                   iSliderRect;        
+        TRect                   iSpeakerRect;
+        TRect                   iSpeakerControlRect;
+        TRect                   iVolumeUpRect;
+        TRect                   iVolumeDownRect;
+        TRect                   iVolumeUpControlRect;
+        TRect                   iVolumeDownControlRect;
+        TRect                   iVolumeBarRect;
+        TRect                   iVolumeBarRectTop;
+        TRect                   iVolumeBarRectMiddle;
+        TRect                   iVolumeBarRectBottom;
+        TRect                   iVolumeControlRect;
+
+        TMPXVolumeDragging      iDragging;
+        
+        CPeriodic*              iDraggingHandlerTimer;
+
+        CMPXVideoPlaybackControlsController* iController;
+
+        TInt iCenteredSliderbarIconX;
+
+#ifdef RD_TACTILE_FEEDBACK
+        MTouchFeedback*         iFeedback;
+#endif //RD_TACTILE_FEEDBACK
+};
+
+#endif //MPXVIDEOPLAYBACKVOLUMEBAR_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/loc/mpxvideoplaybackcontrols.loc	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,121 @@
+/*
+* 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: loc file for mpxvideoplaybackcontrols
+*
+*/
+
+// Version : %version: 8 %
+
+//
+//  LOCALISATION STRINGS
+//
+
+// ********
+// Captions
+// ********
+
+//d:Shown when video content is loading/buffering
+//l:main_mp4_pane_t3
+//w:
+//r:5.2
+//
+#define qtn_mpx_video_wait_loading  "Loading"
+
+
+//d:Shown when streaming is live, and no duration present
+//l:mp4_progress_pane_t2
+//w:
+//r:5.2
+//
+#define qtn_mpx_video_live_streaming "Live streaming"
+
+
+//d:Shown in media details viewer. The maximum space allowed is appr. 15 characters.
+//l: none
+//w:
+//r:5.2
+//
+#define qtn_mpx_filename_heading  "Filename"
+
+
+//d:Shown in media details viewer. The maximum space allowed is appr. 15 characters.
+//l: none
+//w:
+//r:5.2
+//
+#define qtn_mpx_title_heading  "Title"
+
+
+//d:Shown in media details viewer. The maximum space allowed is appr. 15 characters.
+//l: none
+//w:
+//r:5.2
+//
+#define qtn_mpx_artist_heading  "Artist"
+
+
+//d:Shown in media details viewer. The maximum space allowed is appr. 15 characters.
+//l: none
+//w:
+//r:5.2
+//
+#define qtn_mpx_format_heading  "Format"
+
+
+//d:Shown in media details viewer. The maximum space allowed is appr. 20 characters.
+//l: none
+//w:
+//r:5.2
+//
+#define qtn_mpx_resolution_heading  "Resolution"
+
+
+//d:Shown in media details viewer. The maximum space allowed is appr. 20 characters.
+//l: none
+//w:
+//r:5.2
+//
+#define qtn_mpx_duration_heading  "Duration"
+
+
+//d:Shown in media details viewer. The maximum space allowed is appr. 20 characters.
+//l: none
+//w:
+//r:5.2
+//
+#define qtn_mpx_bitrate_heading  "Bitrate"
+
+
+//d:Clip bitrate. The maximum space allowed is appr. 20 characters.
+//d:%N is the bitrate of the video clip
+//l: none
+//r:5.2
+//
+#define qtn_mpx_bitrate_kbps "%N kbps"
+
+//d:Shown in media details viewer. The maximum space allowed is appr. 40 characters.
+//l: none
+//w:
+//r:5.2
+//
+#define qtn_mpx_license_heading  "Click here for License information"
+
+//d:Command text for "Details softkey
+//d:Opens a popup for detailed information.
+//l:control_pane_t1/opt7
+//r:5.2
+//
+#define qtn_mpx_details "Details"
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/rom/mpxvideoplaybackcontrols.iby	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,29 @@
+/*
+* 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: IBY for mpxvideoplaybackcontrols.dll
+*
+*/
+
+// Version : %version: 2 %
+
+#ifndef MPXVIDEOPLAYBACKCONTROLS_IBY
+#define MPXVIDEOPLAYBACKCONTROLS_IBY
+
+#include <data_caging_paths_for_iby.hrh>
+
+
+file=ABI_DIR\BUILD_DIR\mpxvideoplaybackcontrols.dll      SHARED_LIB_DIR\mpxvideoplaybackcontrols.dll
+SCALABLE_IMAGE( APP_BITMAP_DIR, APP_BITMAP_DIR, mpxvideoplaybackcontrols )
+
+#endif // MPXVIDEOPLAYBACKCONTROLS_IBY
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/rom/mpxvideoplaybackcontrolsrsc.iby	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,28 @@
+/*
+* 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: IBY for mpxvideoplaybackcontrols.dll
+*
+*/
+
+// Version : %version: 2 %
+
+#ifndef MPXVIDEOPLAYBACKCONTROLSRSC_IBY
+#define MPXVIDEOPLAYBACKCONTROLSRSC_IBY
+
+#include <data_caging_paths_for_iby.hrh>
+
+
+data=DATAZ_\APP_RESOURCE_DIR\mpxvideoplaybackcontrols.rsc        APP_RESOURCE_DIR\mpxvideoplaybackcontrols.rsc
+
+#endif // MPXVIDEOPLAYBACKCONTROLSRSC_IBY
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/src/mpxvideoplaybackaspectratioicon.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,331 @@
+/*
+* 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: Aspect ratio control
+*
+*/
+
+
+// Version : %version: ou1cpsw#15 %
+
+
+// INCLUDE FILES
+#include <eikenv.h>
+#include <gulicon.h>
+#include <AknUtils.h>
+#include <AknIconUtils.h>
+#include <AknsDrawUtils.h>
+#include <mpxvideoplaybackcontrols.mbg>
+
+#ifdef RD_TACTILE_FEEDBACK
+#include <touchfeedback.h>
+#endif //RD_TACTILE_FEEDBACK
+
+#include "mpxcommonvideoplaybackview.hrh"
+#include "mpxvideoplaybackaspectratioicon.h"
+#include "mpxvideoplaybackcontrolscontroller.h"
+#include "mpxvideo_debug.h"
+
+#include <AknTasHook.h> // For testability hooks
+
+// ============================ MEMBER FUNCTIONS ===================================================
+
+CMPXVideoPlaybackAspectRatioIcon::CMPXVideoPlaybackAspectRatioIcon(
+    CMPXVideoPlaybackControlsController* aController )
+    : iController( aController )
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackAspectRatioIcon::ConstructL()
+// Symbian 2nd phase constructor can leave.
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackAspectRatioIcon::ConstructL( TRect aRect )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackAspectRatioIcon::ConstructL()"));
+
+    SetRect( TRect( 0, 0, aRect.Width(), aRect.Height() ) );
+
+    iAspectRatioRect = TRect( Rect().iTl.iX + 15,
+                              Rect().iTl.iY + 15,
+                              Rect().iBr.iX - 15,
+                              Rect().iBr.iY - 15 );
+
+    SkinChangeL();
+
+#ifdef RD_TACTILE_FEEDBACK
+    iFeedback = MTouchFeedback::Instance();
+#endif //RD_TACTILE_FEEDBACK
+
+    AKNTASHOOK_ADDL( this, "CMPXVideoPlaybackAspectRatioIcon" );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackAspectRatioIcon::NewL()
+// Two-phased constructor.
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackAspectRatioIcon*
+CMPXVideoPlaybackAspectRatioIcon::NewL( CMPXVideoPlaybackControlsController* aController,
+                                        TRect aRect )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackAspectRatioIcon::NewL()"));
+
+    CMPXVideoPlaybackAspectRatioIcon* self =
+        new ( ELeave ) CMPXVideoPlaybackAspectRatioIcon( aController );
+
+    CleanupStack::PushL( self );
+    self->ConstructL( aRect );
+    CleanupStack::Pop();
+    return self;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackAspectRatioIcon::~CMPXVideoPlaybackAspectRatioIcon()
+// Destructor.
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackAspectRatioIcon::~CMPXVideoPlaybackAspectRatioIcon()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackAspectRatioIcon::~CMPXVideoPlaybackAspectRatioIcon()"));
+
+    AKNTASHOOK_REMOVE();
+    
+    if ( iNaturalIcon )
+    {
+        delete iNaturalIcon;
+        iNaturalIcon = NULL;
+    }
+
+    if ( iStretchIcon )
+    {
+        delete iStretchIcon;
+        iStretchIcon = NULL;
+    }
+
+    if ( iZoomIcon )
+    {
+        delete iZoomIcon;
+        iZoomIcon = NULL;
+    }
+
+#ifdef RD_TACTILE_FEEDBACK
+    if ( iFeedback )
+    {
+        iFeedback->RemoveFeedbackForControl(this);
+    }
+#endif //RD_TACTILE_FEEDBACK
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackAspectRatioIcon::SkinChangeL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackAspectRatioIcon::SkinChangeL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackAspectRatioIcon::SkinChangeL()"));
+
+    //
+    // Create icons
+    //
+    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+
+    TFileName iconsPath;
+    iController->LocateBitmapFileL( iconsPath );
+
+    if ( iNaturalIcon )
+    {
+        delete iNaturalIcon;
+        iNaturalIcon = NULL;
+    }
+
+    iNaturalIcon = AknsUtils::CreateGulIconL(
+        skin,
+        KAknsIIDQgnIndiCamsNight,
+        iconsPath,
+        EMbmMpxvideoplaybackcontrolsQgn_indi_mp_ratio_orig,
+        EMbmMpxvideoplaybackcontrolsQgn_indi_mp_ratio_orig_mask );
+
+    if ( iNaturalIcon )
+    {
+        AknIconUtils::SetSize( iNaturalIcon->Bitmap(),
+                               iAspectRatioRect.Size(),
+                               EAspectRatioNotPreserved );
+    }
+
+    if ( iStretchIcon )
+    {
+        delete iStretchIcon;
+        iStretchIcon = NULL;
+    }
+
+    iStretchIcon = AknsUtils::CreateGulIconL(
+        skin,
+        KAknsIIDQgnIndiCamsBright,
+        iconsPath,
+        EMbmMpxvideoplaybackcontrolsQgn_indi_mp_ratio_stretch,
+        EMbmMpxvideoplaybackcontrolsQgn_indi_mp_ratio_stretch_mask );
+
+    if ( iStretchIcon )
+    {
+        AknIconUtils::SetSize( iStretchIcon->Bitmap(),
+                               iAspectRatioRect.Size(),
+                               EAspectRatioNotPreserved );
+    }
+
+    if ( iZoomIcon )
+    {
+        delete iZoomIcon;
+        iZoomIcon = NULL;
+    }
+
+    iZoomIcon = AknsUtils::CreateGulIconL(
+        skin,
+        KAknsIIDQgnIndiCamsCloudy,
+        iconsPath,
+        EMbmMpxvideoplaybackcontrolsQgn_indi_mp_ratio_zoom,
+        EMbmMpxvideoplaybackcontrolsQgn_indi_mp_ratio_zoom_mask );
+
+    if ( iZoomIcon )
+    {
+        AknIconUtils::SetSize( iZoomIcon->Bitmap(),
+                               iAspectRatioRect.Size(),
+                               EAspectRatioNotPreserved );
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackAspectRatioIcon::CountComponentControls()
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMPXVideoPlaybackAspectRatioIcon::CountComponentControls() const
+{
+    return 0;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackAspectRatioIcon::Draw()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackAspectRatioIcon::Draw( const TRect& aRect ) const
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackAspectRatioIcon::Draw()"));
+
+    CWindowGc& gc = SystemGc();
+    gc.SetClippingRect( aRect );
+
+    if ( Window().DisplayMode() == EColor16MAP )
+    {
+        gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha );
+        gc.SetBrushColor( TRgb::Color16MAP( 255 ) );
+        gc.Clear( aRect );
+    }
+    else if ( Window().DisplayMode() == EColor16MA )
+    {
+        gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha );
+        gc.SetBrushColor( TRgb::Color16MA( 0 ) );
+        gc.Clear( aRect );
+    }
+
+    switch ( iController->AspectRatio() )
+    {
+        case EMMFStretch:
+        {
+            gc.BitBltMasked( iAspectRatioRect.iTl,
+                             iZoomIcon->Bitmap(),
+                             TRect( iAspectRatioRect.Size() ),
+                             iZoomIcon->Mask(),
+                             ETrue );
+            break;
+        }
+        case EMMFZoom:
+        {
+            gc.BitBltMasked( iAspectRatioRect.iTl,
+                             iNaturalIcon->Bitmap(),
+                             TRect( iAspectRatioRect.Size() ),
+                             iNaturalIcon->Mask(),
+                             ETrue );
+            break;
+        }
+        default:
+        {
+            gc.BitBltMasked( iAspectRatioRect.iTl,
+                             iStretchIcon->Bitmap(),
+                             TRect( iAspectRatioRect.Size() ),
+                             iStretchIcon->Mask(),
+                             ETrue );
+            break;
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackAspectRatioIcon::HandlePointerEventL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackAspectRatioIcon::HandlePointerEventL( const TPointerEvent& aPointerEvent )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackAspectRatioIcon::HandlePointerEventL()"),
+                   _L("aPointerEvent.iType = %d"), aPointerEvent.iType );
+
+    if ( aPointerEvent.iType == TPointerEvent::EButton1Down )
+    {
+#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
+    }
+    else if ( aPointerEvent.iType == TPointerEvent::EButton1Up )
+    {
+        TMPXVideoPlaybackViewCommandIds cmd = EMPXPbvCmdNaturalAspectRatio;
+
+        switch ( iController->AspectRatio() )
+        {
+            case EMMFStretch:
+            {
+                cmd = EMPXPbvCmdZoomAspectRatio;
+                break;
+            }
+            case EMMFNatural:
+            {
+                cmd = EMPXPbvCmdStretchAspectRatio;
+                break;
+            }
+        }
+
+        iController->HandleCommandL( cmd );
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackAspectRatioIcon::AspectRatioChanged()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackAspectRatioIcon::AspectRatioChanged( TInt aAspectRatio )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackAspectRatioIcon::AspectRatioChanged() (%d)"), aAspectRatio);
+
+    if ( IsVisible() )
+    {
+        DrawNow();
+    }
+}
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/src/mpxvideoplaybackbrandinganimation.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,308 @@
+/*
+* 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: Branding Animation control
+*
+*/
+
+
+// Version : %version: 10 %
+
+
+// INCLUDE FILES
+#include <eikenv.h>
+#include <gulicon.h>
+#include <AknUtils.h>
+#include <AknIconUtils.h>
+#include <AknsDrawUtils.h>
+#include <mpxvideoplaybackcontrols.mbg>
+
+#include "mpxvideoplaybackbrandinganimation.h"
+#include "mpxvideoplaybackcontrolscontroller.h"
+#include "mpxvideo_debug.h"
+
+
+const TInt KMPXRealBrandingAnimationArrayCount = 17;    // Real Branding frames' count
+const TInt KMPXGenericBrandingAnimationArrayCount = 10; // Generic Branding frames' count
+const TInt KMPXBrandingAnimationFrameInterval = 100000; // Represents delay between frames
+
+// ============================ MEMBER FUNCTIONS ===================================================
+
+CMPXVideoPlaybackBrandingAnimation::CMPXVideoPlaybackBrandingAnimation(
+    CMPXVideoPlaybackControlsController* aController, TBool aRealFormat )
+    : iIconArray( KMPXRealBrandingAnimationArrayCount )
+    , iRealFormat( aRealFormat )
+    , iController( aController )
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackBrandingAnimation::ConstructL()
+// Symbian 2nd phase constructor can leave.
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackBrandingAnimation::ConstructL( TRect aRect )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackBrandingAnimation::ConstructL()"));
+
+    //
+    // set rect
+    //
+    iBrandingRect = TRect( 0, 0, aRect.Width(), aRect.Height() );
+    SetRect( iBrandingRect );
+
+    //
+    // construct branding timer
+    //
+    iBrandingTimer = CPeriodic::NewL( CActive::EPriorityStandard );
+
+    //
+    // create branding bitmaps
+    //
+    CreateBitmapsL();
+
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackBrandingAnimation::NewL()
+// Two-phased constructor.
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackBrandingAnimation*
+CMPXVideoPlaybackBrandingAnimation::NewL( CMPXVideoPlaybackControlsController* aController,
+                                          TRect aRect,
+                                          TBool aRealFormat )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackBrandingAnimation::NewL()"));
+
+    CMPXVideoPlaybackBrandingAnimation* self =
+        new ( ELeave ) CMPXVideoPlaybackBrandingAnimation( aController, aRealFormat );
+
+    CleanupStack::PushL( self );
+    self->ConstructL( aRect );
+    CleanupStack::Pop();
+    return self;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackBrandingAnimation::~CMPXVideoPlaybackBrandingAnimation()
+// Destructor.
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackBrandingAnimation::~CMPXVideoPlaybackBrandingAnimation()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackBrandingAnimation::~CMPXVideoPlaybackBrandingAnimation()"));
+
+    iIconArray.ResetAndDestroy();
+
+    if ( iBrandingTimer )
+    {
+         iBrandingTimer->Cancel();
+         delete iBrandingTimer;
+         iBrandingTimer = NULL;
+    }
+
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackBrandingAnimation::CreateBitmapsL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackBrandingAnimation::CreateBitmapsL()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackBrandingAnimation::CreateBitmapsL()"));
+
+    //
+    // Create icons
+    //
+    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+
+    TFileName iconsPath;
+    iController->LocateBitmapFileL( iconsPath );
+
+    TInt bitmapIndex;
+
+    if ( iRealFormat )
+    {
+        //
+        // first frame of Real Player Branding Animation
+        //
+        bitmapIndex = EMbmMpxvideoplaybackcontrolsQgn_graf_realplayer_splash_01;
+
+        //
+        // number of Real Player animation frames
+        //
+        iCount = KMPXRealBrandingAnimationArrayCount;
+    }
+    else
+    {
+        //
+        // first frame of Generic Branding Animation
+        //
+        bitmapIndex = EMbmMpxvideoplaybackcontrolsQgn_graf_ring_wait_01;
+
+        //
+        // number of Generic animation frames
+        //
+        iCount = KMPXGenericBrandingAnimationArrayCount;
+    }
+
+    for ( TInt i = 0; i < iCount * 2; i = i + 2 )
+    {
+        //
+        // Create icons
+        //
+        CGulIcon* icon = AknsUtils::CreateGulIconL( skin,
+                                                    KAknsIIDQgnVideoPluginAnimBuffering,
+                                                    iconsPath,
+                                                    bitmapIndex + i ,
+                                                    bitmapIndex + i + 1 );
+
+        if ( icon )
+        {
+            //
+            // push icon to the cleanup stack
+            //
+            CleanupStack::PushL( icon );
+
+            //
+            // Set icon size
+            //
+            AknIconUtils::SetSize( icon->Bitmap(), iBrandingRect.Size(), EAspectRatioPreserved );
+
+            //
+            // Append icon to array
+            //
+            iIconArray.AppendL( icon );
+
+            //
+            // pop icon to the cleanup stack
+            //
+            CleanupStack::Pop( icon );
+        }
+    }
+
+    //
+    // start branding timer
+    //
+    StartBrandingTimer();
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackBrandingAnimation::CountComponentControls()
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMPXVideoPlaybackBrandingAnimation::CountComponentControls() const
+{
+    return 0;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackBrandingAnimation::Draw()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackBrandingAnimation::Draw( const TRect& aRect ) const
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackBrandingAnimation::Draw()"));
+
+    CWindowGc& gc = SystemGc();
+    gc.SetClippingRect( aRect );
+
+    if ( Window().DisplayMode() == EColor16MAP )
+    {
+        gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha );
+        gc.SetBrushColor( TRgb::Color16MAP( 255 ) );
+        gc.Clear( aRect );
+    }
+    else if ( Window().DisplayMode() == EColor16MA )
+    {
+        gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha );
+        gc.SetBrushColor( TRgb::Color16MA( 0 ) );
+        gc.Clear( aRect );
+    }
+
+    //
+    // draw branding animation
+    //
+    gc.BitBltMasked( iBrandingRect.iTl,
+                     iIconArray[ iCurrentIndex ]->Bitmap(),
+                     TRect( iBrandingRect.Size() ),
+                     iIconArray[ iCurrentIndex ]->Mask(),
+                     ETrue );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackBrandingAnimation::StartBrandingTimer
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackBrandingAnimation::StartBrandingTimer()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackBrandingAnimation::StartBrandingTimer()"));
+
+    //
+    // set branding timer
+    //
+    if ( ! iBrandingTimer->IsActive() )
+    {
+        iBrandingTimer->Start(
+            0,
+            KMPXBrandingAnimationFrameInterval,
+            TCallBack( CMPXVideoPlaybackBrandingAnimation::BrandingTimer, this ) );
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackBrandingAnimation::BrandingTimer
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMPXVideoPlaybackBrandingAnimation::BrandingTimer( TAny* aPtr )
+{
+    static_cast<CMPXVideoPlaybackBrandingAnimation*>(aPtr)->HandleBrandingTimer();
+    return KErrNone;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackBrandingAnimation::HandleBrandingTimer
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackBrandingAnimation::HandleBrandingTimer()
+{
+    //
+    // keep track of the current animation frame
+    //
+    iCurrentIndex = (++iCurrentIndex) % iCount;
+
+    //
+    // draw the current animation frame
+    //
+    if ( IsVisible() )
+    {
+        DrawNow();
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackBrandingAnimation::CancelBrandingTimer
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackBrandingAnimation::CancelBrandingTimer()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackBrandingAnimation::CancelBrandingTimer()"));
+
+    if ( iBrandingTimer->IsActive() )
+    {
+        iBrandingTimer->Cancel();
+    }
+}
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/src/mpxvideoplaybackbutton.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,300 @@
+/*
+* 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: Button control
+*
+*/
+
+
+// Version : %version: 10 %
+
+
+// INCLUDE FILES
+#include <eikenv.h>
+#include <gulicon.h>
+#include <AknUtils.h>
+#include <AknIconUtils.h>
+#include <AknsDrawUtils.h>
+
+#include "mpxvideoplaybackbutton.h"
+
+// ============================ MEMBER FUNCTIONS ===================================================
+
+CMPXVideoPlaybackButton::CMPXVideoPlaybackButton()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackButton::ConstructL()
+// Symbian 2nd phase constructor can leave.
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackButton::ConstructL( CMPXVideoPlaybackControlsController* aController,
+                                          TRect aRect, const TDesC &aIconPath )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackButton::ConstructL()"));
+
+    iIConPath = aIconPath.AllocL();
+    iController = aController;
+
+    SetRect( aRect );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackButton::NewL()
+// Two-phased constructor.
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackButton*
+CMPXVideoPlaybackButton::NewL( CMPXVideoPlaybackControlsController* aController,
+                               TRect aRect, const TDesC &aIconPath )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackButton::NewL()"));
+
+    CMPXVideoPlaybackButton* self = new ( ELeave ) CMPXVideoPlaybackButton();
+
+    CleanupStack::PushL( self );
+    self->ConstructL( aController, aRect, aIconPath );
+    CleanupStack::Pop();
+    return self;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackButton::~CMPXVideoPlaybackButton()
+// Destructor.
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackButton::~CMPXVideoPlaybackButton()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackButton::~CMPXVideoPlaybackButton()"));
+
+    if ( iIConPath )
+    {
+        delete iIConPath;
+        iIConPath = NULL;
+    }
+
+    if ( iDefaultButton )
+    {
+        delete iDefaultButton;
+        iDefaultButton = NULL;
+    }
+
+    if ( iDimmedButton )
+    {
+        delete iDimmedButton;
+        iDimmedButton = NULL;
+    }
+
+    if ( iPressedButton )
+    {
+        delete iPressedButton;
+        iPressedButton = NULL;
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackButton::CreateDefaultButtonL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackButton::CreateDefaultButtonL( const TAknsItemID &aID,
+                                                    const TInt aFileIndex,
+                                                    const TInt aFileMaskIndex )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackButton::CreateDefaultButtonL()"));
+
+    if ( iDefaultButton )
+    {
+        delete iDefaultButton;
+        iDefaultButton = NULL;
+    }
+
+    iDefaultButton = CreateButtonL( aID, aFileIndex, aFileMaskIndex );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackButton::CreateButtonL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackButton::CreateDimmedButtonL( const TAknsItemID &aID,
+                                                   const TInt aFileIndex,
+                                                   const TInt aFileMaskIndex )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackButton::CreateDimmedButtonL()"));
+
+    if ( iDimmedButton )
+    {
+        delete iDimmedButton;
+        iDimmedButton = NULL;
+    }
+
+    iDimmedButton = CreateButtonL( aID, aFileIndex, aFileMaskIndex );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackButton::CreatePressedButtonL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackButton::CreatePressedButtonL( const TAknsItemID &aID,
+                                                    const TInt aFileIndex,
+                                                    const TInt aFileMaskIndex )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackButton::CreatePressedButtonL()"));
+
+    if ( iPressedButton )
+    {
+        delete iPressedButton;
+        iPressedButton = NULL;
+    }
+
+    iPressedButton = CreateButtonL( aID, aFileIndex, aFileMaskIndex );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackButton::CreateButtonL()
+// -------------------------------------------------------------------------------------------------
+//
+CGulIcon* CMPXVideoPlaybackButton::CreateButtonL( const TAknsItemID &aID,
+                                                  const TInt aFileIndex,
+                                                  const TInt aFileMaskIndex )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackButton::CreateButtonL()"));
+
+    CGulIcon* icon = AknsUtils::CreateGulIconL( AknsUtils::SkinInstance(),
+                                                aID,
+                                                iIConPath->Des(),
+                                                aFileIndex,
+                                                aFileMaskIndex );
+
+    if ( icon )
+    {
+        AknIconUtils::SetSize( icon->Bitmap(),
+                               Rect().Size(),
+                               EAspectRatioNotPreserved );
+    }
+
+    return icon;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackButton::Draw()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackButton::Draw( const TRect& aRect ) const
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackButton::Draw()"));
+
+    CWindowGc& gc = SystemGc();
+    gc.SetClippingRect( aRect );
+
+    if ( Window().DisplayMode() == EColor16MAP )
+    {
+        gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha );
+        gc.SetBrushColor( TRgb::Color16MAP( 255 ) );
+        gc.Clear( aRect );
+    }
+    else if ( Window().DisplayMode() == EColor16MA )
+    {
+        gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha );
+        gc.SetBrushColor( TRgb::Color16MA( 0 ) );
+        gc.Clear( aRect );
+    }
+
+    switch ( iState )
+    {
+        case EMPXButtonNormal:
+        {
+            gc.BitBltMasked( Rect().iTl,
+                             iDefaultButton->Bitmap(),
+                             TRect( Rect().Size() ),
+                             iDefaultButton->Mask(),
+                             ETrue );
+            break;
+        }
+        case EMPXButtonDimmed:
+        {
+            gc.BitBltMasked( Rect().iTl,
+                             iDimmedButton->Bitmap(),
+                             TRect( Rect().Size() ),
+                             iDimmedButton->Mask(),
+                             ETrue );
+            break;
+        }
+        case EMPXButtonPressed:
+        {
+            gc.BitBltMasked( Rect().iTl,
+                             iPressedButton->Bitmap(),
+                             TRect( Rect().Size() ),
+                             iPressedButton->Mask(),
+                             ETrue );
+            break;
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackButton::CountComponentControls()
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMPXVideoPlaybackButton::CountComponentControls() const
+{
+    return 0;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackButton::SetDimmed
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackButton::SetDimmed( TBool aDimmed )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackButton::SetDimmed() (%d)"), aDimmed);
+
+    if ( aDimmed && iDimmedButton )
+    {
+        iState = EMPXButtonDimmed;
+    }
+    else if ( iState == EMPXButtonDimmed )
+    {
+        iState = EMPXButtonNormal;
+    }
+
+    if ( IsVisible() )
+    {
+        DrawNow();
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackButton::SetPressed
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackButton::SetPressed( TBool aPressed )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackButton::SetPressed() (%d)"), aPressed);
+
+    if ( aPressed && iPressedButton )
+    {
+        iState = EMPXButtonPressed;
+    }
+    else if ( iState == EMPXButtonPressed )
+    {
+        iState = EMPXButtonNormal;
+    }
+
+    if ( IsVisible() )
+    {
+        DrawDeferred();
+    }
+}
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/src/mpxvideoplaybackbuttonbar.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,684 @@
+/*
+* 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: Button bar control
+*
+*/
+
+
+// Version : %version: ou1cpsw#21 %
+
+
+// INCLUDE FILES
+#include <eikenv.h>
+#include <barsread.h>
+#include <AknUtils.h>
+#include <AknIconUtils.h>
+#include <StringLoader.h>
+#include <AknsDrawUtils.h>
+
+#include <mpxvideoplaybackcontrols.mbg>
+
+#include "mpxvideoplaybackbutton.h"
+#include "mpxcommonvideoplaybackview.hrh"
+#include "mpxvideoplaybackbuttonbar.h"
+#include "mpxvideoplaybackcontrolscontroller.h"
+
+#ifdef RD_TACTILE_FEEDBACK
+#include <touchfeedback.h>
+#endif //RD_TACTILE_FEEDBACK
+
+#include <AknTasHook.h> // for testability hooks
+
+// CONSTANTS
+const TInt KMPXLongPressInterval = 800000;
+const TInt KMPXTactileInterval = 200000;
+
+// ============================ MEMBER FUNCTIONS ===================================================
+
+CMPXVideoPlaybackButtonBar::CMPXVideoPlaybackButtonBar(
+    CMPXVideoPlaybackControlsController* aController )
+    : iButtons( EMPXButtonCount )
+    , iController( aController )
+    , iSeeking( EFalse )
+    , iButtonPressed( EMPXNotPressed )
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackButtonBar::ConstructL()
+// Symbian 2nd phase constructor can leave.
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackButtonBar::ConstructL( TRect aRect )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackButtonBar::ConstructL()"));
+
+    SetRect( TRect(0, 0, aRect.Width(), aRect.Height()) );
+
+    CreateButtonsL();
+
+    iSeekingTimer = CPeriodic::NewL( CActive::EPriorityStandard );
+
+#ifdef RD_TACTILE_FEEDBACK
+    iFeedback = MTouchFeedback::Instance();
+#endif //RD_TACTILE_FEEDBACK
+
+    AKNTASHOOK_ADDL( this, "CMPXVideoPlaybackButtonBar" );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackButtonBar::NewL()
+// Two-phased constructor.
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackButtonBar* CMPXVideoPlaybackButtonBar::NewL(
+    CMPXVideoPlaybackControlsController* aController, TRect aRect )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackButtonBar::NewL()"));
+
+    CMPXVideoPlaybackButtonBar* self = new ( ELeave ) CMPXVideoPlaybackButtonBar( aController );
+
+    CleanupStack::PushL( self );
+    self->ConstructL( aRect );
+    CleanupStack::Pop();
+    return self;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackButtonBar::~CMPXVideoPlaybackButtonBar()
+// Destructor.
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackButtonBar::~CMPXVideoPlaybackButtonBar()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackButtonBar::~CMPXVideoPlaybackButtonBar()"));
+
+    AKNTASHOOK_REMOVE();
+
+    if ( iSeekingTimer )
+    {
+        if ( iSeekingTimer->IsActive() )
+        {
+            iSeekingTimer->Cancel();
+        }
+
+        delete iSeekingTimer;
+        iSeekingTimer = NULL;
+    }
+
+    iButtons.ResetAndDestroy();
+
+#ifdef RD_TACTILE_FEEDBACK
+    if ( iFeedback )
+    {
+        iFeedback->RemoveFeedbackForControl(this);
+    }
+#endif //RD_TACTILE_FEEDBACK
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackButtonBar::CreateButtonsL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackButtonBar::CreateButtonsL()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackButtonBar::CreateButtonsL()"));
+
+    TFileName iconsPath;
+    iController->LocateBitmapFileL( iconsPath );
+
+    //
+    //  Since button bar has 3 visible buttons - divide the height of aRect by 3
+    //
+    TInt iconSize = Rect().Height() / 3;
+    TInt leftOffset = ( Rect().Width() - iconSize ) / 2 ;
+
+    //
+    // Create 3 buttons
+    //
+    for ( TInt i = 0 ; i < EMPXButtonCount -1 ; i++ )
+    {
+        CMPXVideoPlaybackButton* button =
+            CMPXVideoPlaybackButton::NewL( iController,
+                    TRect( leftOffset, iconSize * i, leftOffset + iconSize, iconSize * ( i + 1 ) ),
+                    iconsPath );
+
+        CleanupStack::PushL( button );
+        iButtons.AppendL( button );
+        CleanupStack::Pop( button );
+    }
+
+    //
+    // create pause button in same rect as paly button's
+    //
+    CMPXVideoPlaybackButton* button =
+        CMPXVideoPlaybackButton::NewL( iController, iButtons[EMPXButtonPlay]->Rect(), iconsPath );
+
+    CleanupStack::PushL( button );
+    iButtons.AppendL( button );
+    CleanupStack::Pop( button );
+
+    //
+    // Set touchable rect for top, middle, bottom button
+    //
+    iTopButtonRect =  iButtons[EMPXButtonFastForward]->Rect();
+    iMiddleButtonRect = iButtons[EMPXButtonPlay]->Rect();
+    iBottomButtonRect =  iButtons[EMPXButtonRewind]->Rect();
+
+    SkinChangeL();
+
+    UpdateStateOnButtonBar( iController->State() );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackButtonBar::SkinChangeL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackButtonBar::SkinChangeL()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackButtonBar::SkinChangeL()"));
+
+    //
+    // FF button
+    //
+    iButtons[EMPXButtonFastForward]->CreateDefaultButtonL(
+            KAknsIIDQgnPropImageTbNext,
+            EMbmMpxvideoplaybackcontrolsQgn_prop_fusionplayer_tb_next,
+            EMbmMpxvideoplaybackcontrolsQgn_prop_fusionplayer_tb_next_mask );
+
+    iButtons[EMPXButtonFastForward]->CreateDimmedButtonL(
+            KAknsIIDQgnPropImageTbNextDimmed,
+            EMbmMpxvideoplaybackcontrolsQgn_prop_fusionplayer_tb_next_dimmed,
+            EMbmMpxvideoplaybackcontrolsQgn_prop_fusionplayer_tb_next_dimmed_mask );
+
+    iButtons[EMPXButtonFastForward]->CreatePressedButtonL(
+            KAknsIIDQgnPropImageTbNextFocused,
+            EMbmMpxvideoplaybackcontrolsQgn_prop_fusionplayer_tb_next_focused,
+            EMbmMpxvideoplaybackcontrolsQgn_prop_fusionplayer_tb_next_focused_mask );
+
+    //
+    // Play button
+    //
+    iButtons[EMPXButtonPlay]->CreateDefaultButtonL(
+            KAknsIIDQgnPropImageTbPlay2,
+            EMbmMpxvideoplaybackcontrolsQgn_prop_image_tb_play2,
+            EMbmMpxvideoplaybackcontrolsQgn_prop_image_tb_play2_mask );
+
+    //
+    // Pause button
+    //
+    iButtons[EMPXButtonPause]->CreateDefaultButtonL(
+            KAknsIIDQgnPropImageTbPause,
+            EMbmMpxvideoplaybackcontrolsQgn_prop_image_tb_pause,
+            EMbmMpxvideoplaybackcontrolsQgn_prop_image_tb_pause_mask );
+
+    iButtons[EMPXButtonPause]->CreateDimmedButtonL(
+            KAknsIIDQgnPropImageTbPauseDimmed,
+            EMbmMpxvideoplaybackcontrolsQgn_prop_image_tb_pause_dimmed,
+            EMbmMpxvideoplaybackcontrolsQgn_prop_image_tb_pause_dimmed_mask );
+
+    //
+    // RW button
+    //
+    iButtons[EMPXButtonRewind]->CreateDefaultButtonL(
+            KAknsIIDQgnPropImageTbPrev,
+            EMbmMpxvideoplaybackcontrolsQgn_prop_fusionplayer_tb_prev,
+            EMbmMpxvideoplaybackcontrolsQgn_prop_fusionplayer_tb_prev_mask );
+
+    iButtons[EMPXButtonRewind]->CreateDimmedButtonL(
+            KAknsIIDQgnPropImageTbPrevDimmed,
+            EMbmMpxvideoplaybackcontrolsQgn_prop_fusionplayer_tb_prev_dimmed,
+            EMbmMpxvideoplaybackcontrolsQgn_prop_fusionplayer_tb_prev_dimmed_mask );
+
+    iButtons[EMPXButtonRewind]->CreatePressedButtonL(
+            KAknsIIDQgnPropImageTbPrevFocused,
+            EMbmMpxvideoplaybackcontrolsQgn_prop_fusionplayer_tb_prev_focused,
+            EMbmMpxvideoplaybackcontrolsQgn_prop_fusionplayer_tb_prev_focused_mask );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackButtonBar::HandleResourceChange()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackButtonBar::HandleResourceChange( TInt aType )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackProgressBar::HandleResourceChange(0x%X)"), aType);
+
+    if ( aType == KAknsMessageSkinChange )
+    {
+        TRAP_IGNORE( SkinChangeL() );
+    }
+
+    CCoeControl::HandleResourceChange( aType );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackButtonBar::SetContainerWindowL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackButtonBar::SetContainerWindowL( const CCoeControl& aContainer )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackButtonBar::SetContainerWindowL()"));
+
+    for ( TInt i = 0 ; i < EMPXButtonCount ; i++ )
+    {
+        iButtons[i]->SetContainerWindowL( aContainer );
+    }
+
+    CCoeControl::SetContainerWindowL( aContainer );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackButtonBar::HandlePointerEventL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackButtonBar::HandlePointerEventL( const TPointerEvent& aPointerEvent )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackButtonBar::HandlePointerEventL()"));
+
+    switch ( aPointerEvent.iType )
+    {
+        case TPointerEvent::EButton1Down:
+        {
+            HandleButtonDownEventL( aPointerEvent );
+            break;
+        }
+        case TPointerEvent::EButton1Up:
+        {
+            if ( iButtonPressed == EMPXTopButtonPressed ||
+                 ( iTopButtonRect.Contains( aPointerEvent.iPosition ) &&
+                   iButtonPressed == EMPXNotPressed ) )
+            {
+                HandleTopButtonUpEventL( aPointerEvent );
+            }
+            else if ( iButtonPressed == EMPXBottomButtonPressed ||
+                      ( iBottomButtonRect.Contains( aPointerEvent.iPosition ) &&
+                        iButtonPressed == EMPXNotPressed ) )
+            {
+                HandleBottomButtonUpEventL( aPointerEvent );
+            }
+            else if ( iButtonPressed == EMPXMiddleButtonPressed ||
+                      ( iMiddleButtonRect.Contains( aPointerEvent.iPosition ) &&
+                        iButtonPressed == EMPXNotPressed ) )
+            {
+                HandleMiddleButtonUpEventL();
+            }
+
+            iButtonPressed = EMPXNotPressed;
+            break;
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackButtonBar::HandleButtonDownEventL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackButtonBar::HandleButtonDownEventL( const TPointerEvent& aPointerEvent )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackButtonBar::HandleButtonDownEventL()"));
+
+    if ( iSeekingTimer->IsActive() )
+    {
+        iSeekingTimer->Cancel();
+    }
+
+    if ( iMiddleButtonRect.Contains( aPointerEvent.iPosition ) )
+    {
+        iButtonPressed = EMPXMiddleButtonPressed;
+    }
+    else if ( iTopButtonRect.Contains( aPointerEvent.iPosition ) &&
+              iButtons[EMPXButtonFastForward]->IsVisible() &&
+              ! iButtons[EMPXButtonFastForward]->IsDimmed() )
+    {
+        iButtons[EMPXButtonFastForward]->SetPressed( ETrue );
+
+        iSeekingTimer->Start(
+            KMPXLongPressInterval,
+            KMPXTactileInterval,
+            TCallBack( CMPXVideoPlaybackButtonBar::StartSeekingL, this ) );
+
+        iButtonPressed = EMPXTopButtonPressed;
+    }
+    else if( iBottomButtonRect.Contains( aPointerEvent.iPosition ) &&
+             iButtons[EMPXButtonRewind]->IsVisible() &&
+             ! iButtons[EMPXButtonRewind]->IsDimmed() )
+    {
+        iButtons[EMPXButtonRewind]->SetPressed( ETrue );
+
+        iSeekingTimer->Start(
+            KMPXLongPressInterval,
+            KMPXTactileInterval,
+            TCallBack( CMPXVideoPlaybackButtonBar::StartSeekingL, this ) );
+
+        iButtonPressed = EMPXBottomButtonPressed;
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackButtonBar::HandleTopButtonUpEventL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackButtonBar::HandleTopButtonUpEventL( const TPointerEvent& aPointerEvent )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackButtonBar::HandleTopButtonUpEventL()"));
+
+    if ( iSeekingTimer->IsActive() )
+    {
+        iSeekingTimer->Cancel();
+    }
+
+    if ( iButtons[EMPXButtonFastForward]->IsVisible() &&
+         ! iButtons[EMPXButtonFastForward]->IsDimmed() )
+    {
+        iButtons[EMPXButtonFastForward]->SetPressed( EFalse );
+
+        if ( iSeeking )
+        {
+#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
+
+            iController->HandleCommandL( EMPXPbvCmdEndSeek );
+            iSeeking = EFalse;
+        }
+        // short press
+        else
+        {
+            iController->HandleCommandL( EMPXPbvCmdShortPressForward );
+        }
+
+    }
+
+    iButtons[EMPXButtonFastForward]->HandlePointerEventL( aPointerEvent );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackButtonBar::HandleMiddleButtonUpEventL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackButtonBar::HandleMiddleButtonUpEventL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackButtonBar::HandleMiddleButtonUpEventL()"));
+
+    switch ( iController->State() )
+    {
+        case EPbStatePlaying:
+        {
+            if ( iButtons[EMPXButtonPause]->IsVisible() && ! iButtons[EMPXButtonPause]->IsDimmed() )
+            {
+#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
+                iController->HandleCommandL( EMPXPbvCmdPause );
+            }
+            break;
+        }
+        case EPbStatePaused:
+        case EPbStateStopped:
+        {
+            if ( iButtons[EMPXButtonPlay]->IsVisible() && ! iButtons[EMPXButtonPlay]->IsDimmed() )
+            {
+#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
+                iController->HandleCommandL( EMPXPbvCmdPlay );
+            }
+            break;
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackButtonBar::HandleBottomButtonUpEventL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackButtonBar::HandleBottomButtonUpEventL( const TPointerEvent& aPointerEvent )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackButtonBar::HandleBottomButtonUpEventL()"));
+
+    if ( iSeekingTimer->IsActive() )
+    {
+        iSeekingTimer->Cancel();
+    }
+
+    if ( iButtons[EMPXButtonRewind]->IsVisible() && ! iButtons[EMPXButtonRewind]->IsDimmed() )
+    {
+#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
+
+        iButtons[EMPXButtonRewind]->SetPressed( EFalse );
+
+        if ( iSeeking )
+        {
+            iController->HandleCommandL( EMPXPbvCmdEndSeek );
+            iSeeking = EFalse;
+        }
+        else
+        {
+            // Short press backward:
+            iController->HandleCommandL( EMPXPbvCmdShortPressBackward );
+        }
+    }
+
+    iButtons[EMPXButtonRewind]->HandlePointerEventL( aPointerEvent );
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackButtonBar::StartSeekingL()
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMPXVideoPlaybackButtonBar::StartSeekingL( TAny* aPtr )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackButtonBar::StartSeekingL()"));
+
+    static_cast<CMPXVideoPlaybackButtonBar*>(aPtr)->DoStartSeekingL();
+
+    return KErrNone;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackButtonBar::DoStartSeekingL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackButtonBar::DoStartSeekingL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackButtonBar::DoStartSeekingL()"));
+
+#ifdef RD_TACTILE_FEEDBACK
+    if (iFeedback)
+    {
+#ifdef SYMBIAN_BUILD_GCE
+        iFeedback->InstantFeedback( ETouchFeedbackBasicButton );
+#else
+        iFeedback->InstantFeedback( ETouchFeedbackSensitive );
+#endif //SYMBIAN_BUILD_GCE
+    }
+#endif //RD_TACTILE_FEEDBACK
+
+    if ( ! iSeeking )
+    {
+        if ( iButtonPressed == EMPXTopButtonPressed )
+        {
+            iController->HandleCommandL( EMPXPbvCmdSeekForward );
+        }
+        else if ( iButtonPressed == EMPXBottomButtonPressed )
+        {
+            iController->HandleCommandL( EMPXPbvCmdSeekBackward );
+        }
+        iSeeking = ETrue;
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackButtonBar::Draw()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackButtonBar::Draw( const TRect& aRect ) const
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackButtonBar::Draw()"));
+
+    CWindowGc& gc = SystemGc();
+    gc.SetClippingRect( aRect );
+
+    if ( Window().DisplayMode() == EColor16MAP )
+    {
+        gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha );
+        gc.SetBrushColor( TRgb::Color16MAP( 255 ) );
+        gc.Clear( aRect );
+    }
+    else if ( Window().DisplayMode() == EColor16MA )
+    {
+        gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha );
+        gc.SetBrushColor( TRgb::Color16MA( 0 ) );
+        gc.Clear( aRect );
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackButtonBar::CountComponentControls()
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMPXVideoPlaybackButtonBar::CountComponentControls() const
+{
+    return EMPXButtonCount;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackButtonBar::ComponentControl
+// -------------------------------------------------------------------------------------------------
+//
+CCoeControl* CMPXVideoPlaybackButtonBar::ComponentControl(TInt aIndex) const
+{
+    CCoeControl* control = NULL;
+
+    control = iButtons[ aIndex ];
+
+    return control;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackButtonBar::UpdateStateOnButtonBar()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackButtonBar::UpdateStateOnButtonBar( TMPXPlaybackState aState )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackButtonBar::UpdateStateOnButtonBar(%d)"), aState);
+
+    switch ( aState )
+    {
+        case EPbStatePlaying:
+        {
+            iButtons[EMPXButtonPlay]->MakeVisible( EFalse );
+            iButtons[EMPXButtonPause]->MakeVisible( ETrue );
+
+            break;
+        }
+        case EPbStatePaused:
+        {
+            iButtons[EMPXButtonPause]->MakeVisible( EFalse );
+            iButtons[EMPXButtonPlay]->MakeVisible( ETrue );
+
+            break;
+        }
+        case EPbStateNotInitialised:
+        case EPbStateInitialising:
+        {
+            iButtons[EMPXButtonFastForward]->MakeVisible( ETrue );
+            iButtons[EMPXButtonFastForward]->SetDimmed( ETrue );
+
+            iButtons[EMPXButtonRewind]->MakeVisible( ETrue );
+            iButtons[EMPXButtonRewind]->SetDimmed( ETrue );
+
+            iButtons[EMPXButtonPause]->MakeVisible( EFalse );
+            iButtons[EMPXButtonPlay]->MakeVisible( ETrue );
+
+            break;
+        }
+        case EPbStateStopped:
+        {
+            iButtons[EMPXButtonRewind]->SetDimmed( ETrue );
+            iButtons[EMPXButtonFastForward]->SetDimmed( ETrue );
+            break;
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackButtonBar::UpdateButtonBarState
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackButtonBar::UpdateButtonBarState( CMPXVideoPlaybackViewFileDetails* aDetails )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackButtonBar::UpdateButtonBarState"));
+
+    if ( aDetails->iSeekable )
+    {
+        iButtons[EMPXButtonRewind]->SetDimmed( EFalse );
+        iButtons[EMPXButtonFastForward]->SetDimmed( EFalse );
+    }
+
+    if ( ! aDetails->iPausableStream )
+    {
+        iButtons[EMPXButtonPause]->SetDimmed( ETrue );
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackButtonBar::Reset
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackButtonBar::Reset()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackButtonBar::Reset()"));
+
+    if ( iSeeking )
+    {
+        // Abandon the ongoing seek operation
+        TPointerEvent event;
+        event.iType = TPointerEvent::EButton1Up;
+        MPX_TRAPD( err, HandlePointerEventL(event) );
+    }
+}
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/src/mpxvideoplaybackcontrol.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,618 @@
+/*
+* 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:  Implementation of CMPXVideoPlaybackControl
+*
+*/
+
+
+// Version : %version: ou1cpsw#26 %
+
+
+// INCLUDE FILES
+#include <avkon.hrh>
+#include <e32std.h>
+#include <AknUtils.h>
+
+#include "mpxcommonvideoplaybackview.hrh"
+#include "mpxvideoplaybackcontrol.h"
+#include "mpxvideoplaybackvolumebar.h"
+#include "mpxvideoplaybackbuttonbar.h"
+#include "mpxvideoplaybackprogressbar.h"
+#include "mpxvideoplaybackcontrolscontroller.h"
+#include "mpxvideoplaybackviewfiledetails.h"
+#include "mpxvideoplaybackaspectratioicon.h"
+#include "mpxvideoplaybackbrandinganimation.h"
+#include "mpxvideoplaybackuserinputhandler.h"
+#include "mpxvideoplaybackcontainer.h"
+#include "mpxvideo_debug.h"
+
+#ifdef RD_TACTILE_FEEDBACK
+#include <touchfeedback.h>
+#endif //RD_TACTILE_FEEDBACK
+
+#include <AknTasHook.h> // For testability hooks
+
+// ================= MEMBER FUNCTIONS ==============================================================
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControl::CMPXVideoPlaybackControl()
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackControl::CMPXVideoPlaybackControl(
+        CMPXVideoPlaybackControlsController* aController,
+        CCoeControl* aControl,
+        TMPXVideoPlaybackControls aControlIndex,
+        TUint aProperties )
+    : iController( aController )
+    , iControl( aControl )
+    , iControlIndex( aControlIndex )
+    , iProperties( aProperties )
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControl::ConstructL()
+// Symbian 2nd phase constructor can leave.
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControl::ConstructL( TRect aRect )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControl::ConstructL()"));
+
+    CreateWindowL();
+
+    Window().SetTransparencyAlphaChannel();
+
+    EnableDragEvents();
+
+    iEikonEnv->EikAppUi()->AddToStackL( this, ECoeStackPriorityDefault );
+
+    SetRect( aRect );
+
+    iControl->SetContainerWindowL( *this );
+    iControl->SetRect( Rect() );
+    SetComponentsToInheritVisibility( ETrue );
+
+#ifdef RD_TACTILE_FEEDBACK
+    if ( iProperties & EMPXSoftkeyControl )
+    {
+        iFeedback = MTouchFeedback::Instance();
+    }
+#endif //RD_TACTILE_FEEDBACK
+
+    Window().SetNonFading( ETrue );
+
+    ActivateL();
+
+    AKNTASHOOK_ADDL( this, "CMPXVideoPlaybackControl" );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControl::NewL()
+// Two-phased constructor.
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackControl* CMPXVideoPlaybackControl::NewL(
+    CMPXVideoPlaybackControlsController* aController,
+    CCoeControl* aControl,
+    TRect aRect,
+    TMPXVideoPlaybackControls aControlIndex,
+    TUint aProperties )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControl::NewL()"));
+
+    CMPXVideoPlaybackControl* self =
+        new (ELeave) CMPXVideoPlaybackControl( aController, aControl, aControlIndex, aProperties );
+
+    CleanupStack::PushL(self);
+    self->ConstructL( aRect );
+    CleanupStack::Pop();
+
+    return self;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControl::~CMPXVideoPlaybackControlsController()
+// Destructor.
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackControl::~CMPXVideoPlaybackControl()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControl::~CMPXVideoPlaybackControl()"));
+
+    AKNTASHOOK_REMOVE();
+    
+    iEikonEnv->EikAppUi()->RemoveFromStack( this );
+
+#ifdef RD_TACTILE_FEEDBACK
+    if ( iFeedback )
+    {
+       iFeedback->RemoveFeedbackForControl( this );
+    }
+#endif //RD_TACTILE_FEEDBACK
+
+    if ( iControl )
+    {
+        delete iControl;
+        iControl = NULL;
+    }
+
+    CloseWindow();
+}
+
+// -------------------------------------------------------------------------------------------------
+// From CCoeControl
+// Gets the number of controls contained in a compound control.
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMPXVideoPlaybackControl::CountComponentControls() const
+{
+    return 1;
+}
+
+// -------------------------------------------------------------------------------------------------
+// From CCoeControl
+// Gets an indexed component of a compound control.
+// -------------------------------------------------------------------------------------------------
+//
+CCoeControl* CMPXVideoPlaybackControl::ComponentControl( TInt /*aIndex*/ ) const
+{
+    return iControl;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControl::Draw()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControl::Draw( const TRect& aRect ) const
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControl::Draw()"));
+
+    CWindowGc& gc = SystemGc();
+    gc.SetClippingRect( aRect );
+
+    if ( Window().DisplayMode() == EColor16MAP )
+    {
+        gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha );
+        gc.SetBrushColor( TRgb::Color16MAP( 255 ) );
+    }
+    else if ( Window().DisplayMode() == EColor16MA )
+    {
+        gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha );
+        gc.SetBrushColor( TRgb::Color16MA( 0 ) );
+    }
+
+    gc.Clear( aRect );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControl::HandlePointerEventL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControl::HandlePointerEventL( const TPointerEvent& aPointerEvent )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackControl::HandlePointerEventL()"),
+                   _L("iControlIndex = %d"), iControlIndex );
+
+    iController->iContainer->UserInputHandler()->ProcessPointerEventL( this,
+                                                                       aPointerEvent,
+                                                                       EMpxVideoPlaybackControl );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControl::DoHandlePointerEventL()
+// -------------------------------------------------------------------------------------------------
+//
+EXPORT_C void CMPXVideoPlaybackControl::DoHandlePointerEventL( const TPointerEvent& aPointerEvent)
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackControl::DoHandlePointerEventL()"),
+                   _L(" iControlIndex = %d, aPointerEvent.iType = %d"),
+                   iControlIndex, aPointerEvent.iType );
+
+    if ( AknLayoutUtils::PenEnabled() )
+    {
+        if ( aPointerEvent.iType == TPointerEvent::EButton1Down )
+        {
+            iController->ResetDisappearingTimers( EMPXTimerCancel );
+
+            //
+            //  Grab the pointer event for all controls so the events will not transfer to a
+            //  different control as a dragging event occurs
+            //
+            SetPointerCapture( ETrue );
+            ClaimPointerGrab( ETrue );
+        }
+        else if ( aPointerEvent.iType == TPointerEvent::EButton1Up )
+        {
+            iController->ResetDisappearingTimers( EMPXTimerReset );
+
+            SetPointerCapture( EFalse );
+            ClaimPointerGrab( EFalse );
+        }
+
+        switch( iControlIndex )
+        {
+            case EMPXProgressBar:
+            case EMPXVolumeBar:
+            case EMPXButtonBar:
+            case EMPXAspectRatioIcon:
+            case EMPXMediaDetailsViewer:
+            {
+                //
+                // Pass an event to controller
+                //
+                iControl->HandlePointerEventL( aPointerEvent );
+                break;
+            }
+            case EMPXSoftkeyDetails:
+            {
+                if ( aPointerEvent.iType == TPointerEvent::EButton1Up )
+                {
+#ifdef RD_TACTILE_FEEDBACK
+                    if ( iFeedback )
+                    {
+                        iFeedback->InstantFeedback( ETouchFeedbackBasic );
+                    }
+#endif //RD_TACTILE_FEEDBACK
+
+                    iController->HandleCommandL( EMPXPbvCmdShowFileDetails );
+                }
+                break;
+            }
+            case EMPXSoftkeyBack:
+            {
+                if ( aPointerEvent.iType == TPointerEvent::EButton1Up )
+                {
+#ifdef RD_TACTILE_FEEDBACK
+                    if ( iFeedback )
+                    {
+                        iFeedback->InstantFeedback( ETouchFeedbackBasic );
+                    }
+#endif //RD_TACTILE_FEEDBACK
+
+                    iController->HandleCommandL( EAknSoftkeyBack );
+                }
+                break;
+            }
+            case EMPXNoVideoBitmap:
+            case EMPXRealAudioBitmap:
+            case EMPXSoundBitmap:
+            case EMPXTitleLabel:
+            case EMPXArtistLabel:
+            case EMPXBrandingAnimation:
+            default:
+            {
+                //
+                //  Ignore pointer events for these controls
+                //
+                break;
+            }
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControl::SetVisibility()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControl::SetVisibility( TMPXPlaybackState aState )
+{
+    TBool visible = EFalse;
+
+    switch( aState )
+    {
+        case EPbStatePlaying:
+        {
+            if ( iProperties & EMPXShownWhenPlaying )
+            {
+                visible = ETrue;
+            }
+            break;
+        }
+        case EPbStatePaused:
+        {
+            if ( iProperties & EMPXShownWhenPaused )
+            {
+                visible = ETrue;
+            }
+            break;
+        }
+        case EPbStatePluginSeeking:
+        {
+            if ( iProperties & EMPXShownWhenSeeking )
+            {
+                visible = ETrue;
+            }
+            break;
+        }
+        case EPbStateInitialised:
+        case EPbStateBuffering:
+        {
+            if ( iProperties & EMPXBufferingControl )
+            {
+                visible = ETrue;
+            }
+            break;
+        }
+        case EPbStateStopped:
+        {
+            if ( iProperties & EMPXShownWhenStopped )
+            {
+                visible = ETrue;
+            }
+            break;
+        }
+        case EPbStateNotInitialised:
+        case EPbStateInitialising:
+        {
+            if ( iProperties & EMPXShownWhenInitializing )
+            {
+                visible = ETrue;
+            }
+            break;
+        }
+    }
+
+    MPX_DEBUG(_L("CMPXVideoPlaybackControl::SetVisibility(%d)"), visible);
+
+    MakeVisible( visible );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControl::ControlIndex()
+// -------------------------------------------------------------------------------------------------
+//
+TMPXVideoPlaybackControls CMPXVideoPlaybackControl::ControlIndex()
+{
+    return iControlIndex;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControl::VolumeChanged()
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoPlaybackControl::VolumeChanged( TInt aVolume )
+{
+    TBool changed = EFalse;
+
+    if ( iControlIndex == EMPXVolumeBar )
+    {
+        MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::VolumeChanged() [%d]"), aVolume);
+
+        static_cast<CMPXVideoPlaybackVolumeBar*>(iControl)->VolumeChanged( aVolume );
+
+        changed = ETrue;
+    }
+
+    return changed;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControl::DurationChangedL()
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoPlaybackControl::DurationChangedL( TInt aDuration )
+{
+    TBool changed = EFalse;
+
+    if ( iControlIndex == EMPXProgressBar )
+    {
+        MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::DurationChangedL() [%d]"), aDuration);
+
+        static_cast<CMPXVideoPlaybackProgressBar*>(iControl)->DurationChangedL( aDuration );
+
+        changed = ETrue;
+    }
+
+    return changed;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControl::PositionChangedL()
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoPlaybackControl::PositionChangedL( TInt aPosition )
+{
+    TBool changed = EFalse;
+
+    if ( iControlIndex == EMPXProgressBar )
+    {
+        MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::PositionChangedL() [%d]"), aPosition);
+
+        static_cast<CMPXVideoPlaybackProgressBar*>(iControl)->PositionChangedL( aPosition );
+
+        changed = ETrue;
+    }
+
+    return changed;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControl::AspectRatioChanged()
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoPlaybackControl::AspectRatioChanged( TInt aAspectRatio )
+{
+    TBool changed = EFalse;
+
+    if ( iControlIndex == EMPXAspectRatioIcon )
+    {
+        MPX_DEBUG(
+            _L("CMPXVideoPlaybackControlsController::AspectRatioChanged() [%d]"), aAspectRatio);
+
+        static_cast<CMPXVideoPlaybackAspectRatioIcon*>(iControl)->
+            AspectRatioChanged( aAspectRatio );
+
+        changed = ETrue;
+    }
+
+    return changed;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackControl::SetDownloadSize()
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoPlaybackControl::SetDownloadSize( TInt aSize )
+{
+    TBool changed = EFalse;
+
+    if ( iControlIndex == EMPXProgressBar )
+    {
+        MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::SetDownloadSize() [%d]"), aSize);
+
+        static_cast<CMPXVideoPlaybackProgressBar*>(iControl)->SetDownloadSize( aSize );
+
+        changed = ETrue;
+    }
+
+    return changed;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackControl::UpdateDownloadPosition()
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoPlaybackControl::UpdateDownloadPosition( TInt aSize )
+{
+    TBool changed = EFalse;
+
+    if ( iControlIndex == EMPXProgressBar )
+    {
+        MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::UpdateDownloadPosition() [%d]"), aSize);
+
+        static_cast<CMPXVideoPlaybackProgressBar*>(iControl)->UpdateDownloadPosition( aSize );
+
+        changed = ETrue;
+    }
+
+    return changed;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControl::UpdateStateOnButtonBar()
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoPlaybackControl::UpdateStateOnButtonBar( TMPXPlaybackState aState )
+{
+    TBool changed = EFalse;
+
+    if ( iControlIndex == EMPXButtonBar )
+    {
+        MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::UpdateStateOnButtonBar() [%d]"), aState);
+
+        static_cast<CMPXVideoPlaybackButtonBar*>(iControl)->UpdateStateOnButtonBar( aState );
+
+        changed = ETrue;
+    }
+
+    return changed;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControl::UpdateControlsWithFileDetailsL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControl::UpdateControlsWithFileDetailsL(
+        CMPXVideoPlaybackViewFileDetails* aDetails )
+{
+    iPlaybackMode = aDetails->iPlaybackMode;
+
+    //
+    //  Controls should be shown when if there is no video or the TV-Out is connected
+    //
+    if ( iControlIndex == EMPXButtonBar )
+    {
+        static_cast<CMPXVideoPlaybackButtonBar*>(iControl)->UpdateButtonBarState( aDetails );
+    }
+    else if ( iControlIndex == EMPXProgressBar )
+    {
+        static_cast<CMPXVideoPlaybackProgressBar*>(iControl)->UpdateProgressBarStateL( aDetails );
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControl::StopBrandingAnimationTimer()
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoPlaybackControl::StopBrandingAnimationTimer()
+{
+    TBool changed = EFalse;
+
+    if ( iControlIndex == EMPXBrandingAnimation )
+    {
+        MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::StopBrandingAnimationTimer()"));
+
+        static_cast<CMPXVideoPlaybackBrandingAnimation*>(iControl)->CancelBrandingTimer();
+
+        changed = ETrue;
+    }
+
+    return changed;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControl::UpdateTVOutStatusL()
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoPlaybackControl::UpdateTVOutStatusL( TBool aTvOutConnected)
+{
+    TBool changed = EFalse;
+
+    if ( iControlIndex == EMPXVolumeBar )
+    {
+        MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::UpdateTVOutStatus()"));
+
+        static_cast<CMPXVideoPlaybackVolumeBar*>(iControl)->UpdateTVOutStatusL( aTvOutConnected );
+
+        changed = ETrue;
+    }
+
+    return changed;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControl::ResetControl()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControl::ResetControl()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::ResetControl()"));
+
+    SetPointerCapture( EFalse );
+    ClaimPointerGrab( EFalse );
+
+    switch( iControlIndex )
+    {
+        case EMPXButtonBar:
+        {
+            static_cast<CMPXVideoPlaybackButtonBar*>(iControl)->Reset();
+            break;
+        }
+        case EMPXProgressBar:
+        {
+            static_cast<CMPXVideoPlaybackProgressBar*>(iControl)->Reset();
+            break;
+        }
+        case EMPXVolumeBar:
+        {
+             static_cast<CMPXVideoPlaybackVolumeBar*>(iControl)->Reset();
+             break;
+        }
+    }
+}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/src/mpxvideoplaybackcontrolconfiguration.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,349 @@
+/*
+* 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:  Implementation of MPXVideoPlaybackControlConfiguration
+*
+*/
+
+
+// Version : %version: 17 %
+
+
+// INCLUDE FILES
+#include <e32def.h>
+#include <e32base.h>
+#include <AknUtils.h>
+
+#include "mpxvideoplaybackcontrolconfiguration.h"
+#include "mpxvideoplaybackcontrolscontroller.h"
+#include "mpxvideoplaybackviewfiledetails.h"
+#include "mpxvideo_debug.h"
+
+// ================= MEMBER FUNCTIONS ==============================================================
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControlConfiguration::CMPXVideoPlaybackControlConfiguration()
+// C++ default constructor can NOT contain any code, that might leave.
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackControlConfiguration::CMPXVideoPlaybackControlConfiguration(
+    CMPXVideoPlaybackControlsController* aController)
+    : iControlsController( aController )
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControlConfiguration::ConstructL()
+// Symbian 2nd phase constructor can leave.
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControlConfiguration::ConstructL()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlConfiguration::ConstructL()"));
+
+    CreateControlListL();
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControlConfiguration::NewL()
+// Two-phased constructor.
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackControlConfiguration*
+CMPXVideoPlaybackControlConfiguration::NewL( CMPXVideoPlaybackControlsController* aController )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlConfiguration::NewL()"));
+
+    CMPXVideoPlaybackControlConfiguration* self =
+        new (ELeave) CMPXVideoPlaybackControlConfiguration( aController );
+
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControlConfiguration::~CMPXVideoPlaybackControlConfiguration()
+// Destructor.
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackControlConfiguration::~CMPXVideoPlaybackControlConfiguration()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlConfiguration::~CMPXVideoPlaybackControlConfiguration"));
+
+    iControlsList.Reset();
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControlConfiguration::CreateControlListL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControlConfiguration::CreateControlListL()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlConfiguration::CreateControlListL()"));
+
+    CMPXVideoPlaybackViewFileDetails* fileDetails = iControlsController->FileDetails();
+
+    if ( fileDetails->iPlaybackMode == EMPXVideoStreaming ||
+         fileDetails->iPlaybackMode == EMPXVideoLiveStreaming )
+    {
+        //
+        //  streaming mode, add branding animation control to show while initializing
+        //
+        iControlsList.AppendL( EMPXBrandingAnimation );
+    }
+
+    iControlsList.AppendL( EMPXSoftkeyDetails );
+    iControlsList.AppendL( EMPXSoftkeyBack );
+    iControlsList.AppendL( EMPXProgressBar );
+    iControlsList.AppendL( EMPXVolumeBar );
+    iControlsList.AppendL( EMPXBufferingLabel );
+
+    if ( AknLayoutUtils::PenEnabled() )
+    {
+        iControlsList.AppendL( EMPXButtonBar );
+    }
+    else
+    {
+        iControlsList.AppendL( EMPXVideoPausedIcon );
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControlConfiguration::ControlList
+// -------------------------------------------------------------------------------------------------
+//
+RArray<TMPXVideoPlaybackControls>& CMPXVideoPlaybackControlConfiguration::ControlList()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlConfiguration::ControlList()"));
+
+    return iControlsList;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControlConfiguration::UpdateControlListL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControlConfiguration::UpdateControlListL(
+    TMPXVideoPlaybackControlCommandIds aEvent, TBool aShowArIcon )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlConfiguration::UpdateControlListL(%d)"), aEvent);
+
+    //
+    //  This fuction will be getting called
+    //    - After Initialization complete
+    //    - When TV-out cable get connected/disconnected
+    //
+    switch ( aEvent )
+    {
+        case EMPXControlCmdSetDownloadPaused:
+        {
+            if ( ! iDownloadPausedAdded )
+            {
+                iControlsList.AppendL( EMPXDownloadPausedIcon );
+
+                iDownloadPausedAdded = ETrue;
+            }
+
+            break;
+        }
+        case EMPXControlCmdClearDownloadPaused:
+        {
+            if ( iDownloadPausedAdded )
+            {
+                DeleteControlFromList( EMPXDownloadPausedIcon );
+
+                iDownloadPausedAdded = EFalse;
+            }
+
+            break;
+        }
+        case EMPXControlCmdTvOutConnected:
+        {
+            if ( ! iTitleArtistIndicatorsAdded )
+            {
+                iControlsList.AppendL( EMPXTitleLabel );
+                iControlsList.AppendL( EMPXArtistLabel );
+
+                iTitleArtistIndicatorsAdded = ETrue;
+            }
+
+            if ( iAspectRatioIconAdded )
+            {
+                DeleteControlFromList( EMPXAspectRatioIcon );
+                iAspectRatioIconAdded = EFalse;
+            }
+
+            break;
+        }
+        case EMPXControlCmdTvOutDisconnected:
+        {
+            if ( iControlsController->FileDetails()->iVideoEnabled )
+            {
+                if ( iTitleArtistIndicatorsAdded )
+                {
+                    DeleteControlFromList( EMPXTitleLabel );
+                    DeleteControlFromList( EMPXArtistLabel );
+
+                    iTitleArtistIndicatorsAdded = EFalse;
+                }
+
+                if ( ! iAspectRatioIconAdded && aShowArIcon )
+                {
+                    iControlsList.AppendL( EMPXAspectRatioIcon );
+                    iAspectRatioIconAdded = ETrue;
+                }
+            }
+            break;
+        }
+        case EMPXControlCmdPluginInitialized:
+        {
+            if ( iControlsController->FileDetails()->iPlaybackMode == EMPXVideoStreaming ||
+                 iControlsController->FileDetails()->iPlaybackMode == EMPXVideoLiveStreaming )
+            {
+                iControlsController->StopBrandingAnimation();
+            }
+
+            break;
+        }
+        case EMPXControlCmdCreateAspectRatioIcon:
+        {
+            if ( ! iAspectRatioIconAdded )
+            {
+                iControlsList.AppendL( EMPXAspectRatioIcon );
+                iAspectRatioIconAdded = ETrue;
+            }
+
+            break;
+        }
+        case EMPXControlCmdDeleteAspectRatioIcon:
+        {
+            if ( iAspectRatioIconAdded )
+            {
+                DeleteControlFromList( EMPXAspectRatioIcon );
+                iAspectRatioIconAdded = EFalse;
+            }
+
+            break;
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControlConfiguration::DeleteControlFromList
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControlConfiguration::DeleteControlFromList(
+        TMPXVideoPlaybackControls aControl )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlConfiguration::DeleteControlFromList(%d)"), aControl);
+
+    TInt index = iControlsList.Find( aControl );
+
+    if ( index != KErrNotFound )
+    {
+        iControlsList.Remove( index );
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControlConfiguration::UpdateControlsWithFileDetailsL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControlConfiguration::UpdateControlsWithFileDetailsL()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlConfiguration::UpdateControlsWithFileDetailsL()"));
+
+    CMPXVideoPlaybackViewFileDetails* fileDetails = iControlsController->FileDetails();
+
+    if ( fileDetails->iVideoEnabled )
+    {
+        if ( iAudioOnlyIndicatorsAdded )
+        {
+            DeleteControlFromList( EMPXRealAudioBitmap );
+            DeleteControlFromList( EMPXSoundBitmap );
+            DeleteControlFromList( EMPXNoVideoBitmap );
+
+            iAudioOnlyIndicatorsAdded = EFalse;
+        }
+
+        if ( fileDetails->iTvOutConnected )
+        {
+            if ( ! iTitleArtistIndicatorsAdded )
+            {
+                iControlsList.AppendL( EMPXTitleLabel );
+                iControlsList.AppendL( EMPXArtistLabel );
+
+                iTitleArtistIndicatorsAdded = ETrue;
+            }
+        }
+        else
+        {
+            if ( iTitleArtistIndicatorsAdded )
+            {
+                DeleteControlFromList( EMPXTitleLabel );
+                DeleteControlFromList( EMPXArtistLabel );
+
+                iTitleArtistIndicatorsAdded = EFalse;
+            }
+        }
+    }
+    else
+    {
+        //
+        //  No video for this clip
+        //
+
+        //
+        //  Remove the Real One bitmap and show the audio only bitmaps
+        //
+        iControlsController->SetRealOneBitmapVisibility( EFalse );
+
+        if ( ! iAudioOnlyIndicatorsAdded )
+        {
+            if ( iControlsController->IsRealMediaFormat() )
+            {
+                iControlsList.AppendL( EMPXRealAudioBitmap );
+            }
+
+            //
+            //  this media clip doesn't have a supported video stream,
+            //  display "No Video" bitmap instead of
+            //  the generic "Sound" bitmap
+            //
+            if ( fileDetails->iPartialPlayback )
+            {
+                iControlsList.AppendL( EMPXNoVideoBitmap );
+            }
+            else
+            {
+                iControlsList.AppendL( EMPXSoundBitmap );
+            }
+
+            iAudioOnlyIndicatorsAdded = ETrue;
+        }
+
+        if ( ! iTitleArtistIndicatorsAdded )
+        {
+            iControlsList.AppendL( EMPXTitleLabel );
+            iControlsList.AppendL( EMPXArtistLabel );
+
+            iTitleArtistIndicatorsAdded = ETrue;
+        }
+    }
+}
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/src/mpxvideoplaybackcontrolpdl.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,89 @@
+/*
+* 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:  Implementation of CMPXVideoPlaybackControlPdl
+*
+*/
+
+// Version : %version: 4 %
+
+
+
+// INCLUDE FILES
+
+#include "mpxvideoplaybackcontrolpdl.h"
+#include "mpxvideo_debug.h"
+#include "mpxvideoplaybackcontrolscontroller.h"
+
+// ================= MEMBER FUNCTIONS ==============================================================
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackControlPdl::CMPXVideoPlaybackControlPdl()
+//   C++ default constructor can NOT contain any code, that might leave.
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackControlPdl::CMPXVideoPlaybackControlPdl(
+    CMPXVideoPlaybackControlsController* aController,
+    CCoeControl* aControl,
+    TMPXVideoPlaybackControls aControlIndex,
+    TUint aProperties )
+    : CMPXVideoPlaybackControl( aController, aControl, aControlIndex, aProperties )
+{
+}
+
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControlPdl::NewL()
+// Two-phased constructor.
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackControlPdl* CMPXVideoPlaybackControlPdl::NewL(
+    CMPXVideoPlaybackControlsController* aController,
+    CCoeControl* aControl,
+    TRect aRect,
+    TMPXVideoPlaybackControls aControlIndex,
+    TUint aProperties )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlPdl::NewL()"));
+
+    CMPXVideoPlaybackControlPdl* self = new (ELeave) CMPXVideoPlaybackControlPdl( aController, aControl, aControlIndex, aProperties );
+
+    CleanupStack::PushL( self );
+    self->ConstructL( aRect );
+    CleanupStack::Pop();
+
+    return self;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackControlPdl::~CMPXVideoPlaybackControlPdl()
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackControlPdl::~CMPXVideoPlaybackControlPdl()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlPdl::~CMPXVideoPlaybackControlPdl()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackControlPdl::MakeVisible()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControlPdl::MakeVisible( TBool aVisible )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlPdl::MakeVisible(%d)"), aVisible);
+
+    CCoeControl::MakeVisible( EFalse );
+    CCoeControl::MakeVisible( ETrue );
+}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/src/mpxvideoplaybackcontrolpolicy.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,169 @@
+/*
+* 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:  Implementation of MPXVideoPlaybackControlPolicy
+*
+*/
+
+
+// Version : %version: 10 %
+
+
+// INCLUDE FILES
+
+#include "mpxvideo_debug.h"
+#include "mpxvideoplaybackviewfiledetails.h"
+#include "mpxvideoplaybackcontrolpolicy.h"
+
+// ================= MEMBER FUNCTIONS ==============================================================
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControlPolicy::CMPXVideoPlaybackControlPolicy()
+// C++ default constructor can NOT contain any code, that might leave.
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackControlPolicy::CMPXVideoPlaybackControlPolicy()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlPolicy::CMPXVideoPlaybackControlPolicy()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControlPolicy::ConstructL()
+// Symbian 2nd phase constructor can leave.
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControlPolicy::ConstructL()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlPolicy::ConstructL()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControlPolicy::NewL()
+// Two-phased constructor.
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackControlPolicy* CMPXVideoPlaybackControlPolicy::NewL()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlPolicy::NewL()"));
+
+    CMPXVideoPlaybackControlPolicy* self = new (ELeave) CMPXVideoPlaybackControlPolicy();
+
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControlPolicy::~CMPXVideoPlaybackControlPolicy()
+// Destructor.
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackControlPolicy::~CMPXVideoPlaybackControlPolicy()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlPolicy::~CMPXVideoPlaybackControlPolicy()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControlPolicy::SetControlProperties()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControlPolicy::SetControlProperties(
+                                         TMPXVideoPlaybackControls aControlIndex,
+                                         TUint& aProperties,
+                                         CMPXVideoPlaybackViewFileDetails* aDetails )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlPolicy::SetControlProperties()"));
+
+    aProperties = 0;
+
+    switch ( aControlIndex )
+    {
+        case EMPXSoftkeyBack:
+        {
+            //
+            //  Transitory Buffering states will be filtered out by the View
+            //
+            aProperties = EMPXBufferingControl | EMPXShownWhenInitializing;
+        }
+        case EMPXSoftkeyDetails:
+        {
+            aProperties += EMPXSoftkeyControl |
+                           EMPXShownWhenPlaying |
+                           EMPXShownWhenPaused |
+                           EMPXShownWhenStopped |
+                           EMPXShownWhenSeeking;
+            break;
+        }
+        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:
+        case EMPXArtistLabel:
+        {
+            aProperties = EMPXBufferingControl;
+        }
+        case EMPXButtonBar:
+        case EMPXProgressBar:
+        case EMPXVolumeBar:
+        case EMPXAspectRatioIcon:
+        {
+            aProperties += EMPXShownWhenPlaying |
+                           EMPXShownWhenPaused |
+                           EMPXShownWhenStopped |
+                           EMPXShownWhenSeeking;
+            break;
+        }
+        case EMPXNoVideoBitmap:
+        case EMPXRealAudioBitmap:
+        case EMPXSoundBitmap:
+        {
+            aProperties = EMPXBufferingControl |
+                          EMPXShownWhenPlaying |
+                          EMPXShownWhenPaused |
+                          EMPXShownWhenStopped |
+                          EMPXShownWhenSeeking;
+            break;
+        }
+        case EMPXDownloadPausedIcon:
+        {
+            aProperties = EMPXAllProperties;
+            break;
+        }
+        case EMPXVideoPausedIcon:
+        {
+            aProperties = EMPXShownWhenPaused;
+            break;
+        }
+        case EMPXBrandingAnimation:
+        {
+            aProperties = EMPXShownWhenInitializing;
+            break;
+        }
+    }
+}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/src/mpxvideoplaybackcontrolscontroller.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,2041 @@
+/*
+* 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:  Implementation of MPXVideoPlaybackControlsController
+*
+*/
+
+
+// Version : %version: 46 %
+
+
+// INCLUDE FILES
+#include <fbs.h>
+#include <coecntrl.h>
+#include <gulicon.h>
+#include <bautils.h>
+#include <eiklabel.h>
+#include <eikimage.h>
+#include <AknUtils.h>
+#include <barsread.h>
+#include <AknIconUtils.h>
+#include <StringLoader.h>
+#include <AknsDrawUtils.h>
+#include <AknsSkinInstance.h>
+#include <AknBitmapAnimation.h>
+#include <AknsBasicBackgroundControlContext.h>
+#include <f32file.h>
+
+#include <aknlayoutscalable_apps.cdl.h>
+#include <data_caging_path_literals.hrh>
+
+#include <mpxvideoplaybackcontrols.rsg>
+#include <mpxvideoplaybackcontrols.mbg>
+
+#include <avkondomainpskeys.h>
+
+#ifdef RD_TACTILE_FEEDBACK
+#include <touchfeedback.h>
+#endif //RD_TACTILE_FEEDBACK
+
+#include "mpxvideoplaybackcontrol.h"
+#include "mpxvideoplaybackcontrolpdl.h"
+#include "mpxvideoplaybackbuttonbar.h"
+#include "mpxvideoplaybackvolumebar.h"
+#include "mpxvideoplaybackprogressbar.h"
+#include "mpxvideoplaybackcontainer.h"
+#include "mpxvideoplaybackcontrolpolicy.h"
+#include "mpxvideoplaybackviewfiledetails.h"
+#include "mpxvideoplaybackcontrolscontroller.h"
+#include "mpxvideoplaybackcontrolconfiguration.h"
+#include "mpxvideoplaybackaspectratioicon.h"
+#include "mpxvideoplaybackbrandinganimation.h"
+#include "mpxvideoplaybackmediadetailsviewer.h"
+#include "mpxcommonvideoplaybackview.hrh"
+
+using namespace AknLayoutScalable_Apps;
+using namespace AknLayoutScalable_Avkon;
+
+const TInt KMPXControlsTimeOut = 4000000;
+
+const TInt KMP4LayoutSet = 6;
+
+// ================= MEMBER FUNCTIONS ==============================================================
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControlsController::CMPXVideoPlaybackControlsController
+// C++ default constructor can NOT contain any code, that might leave.
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackControlsController::CMPXVideoPlaybackControlsController(
+    CMPXVideoPlaybackContainer* aContainer, TRect aRect )
+    : iControls( EMPXControlsCount ),
+      iRect( aRect ),
+      iContainer( aContainer )
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControlsController::ConstructL()
+// Symbian 2nd phase constructor can leave.
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControlsController::ConstructL( CMPXVideoPlaybackViewFileDetails* aDetails )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackControlsController::ConstructL()"));
+
+    User::LeaveIfError( iFs.Connect() );
+
+    _LIT( KMPXVideoPlaybackRscPath, "mpxvideoplaybackcontrols.rsc" );
+
+    TParse parse;
+    parse.Set( KMPXVideoPlaybackRscPath, &KDC_APP_RESOURCE_DIR, NULL );
+    TFileName resourceFile = parse.FullName();
+
+    //
+    //  Find the resource file.  It must be on the same drive as the DLL is installed
+    //
+    User::LeaveIfError( AddDllPath( resourceFile ) );
+
+    BaflUtils::NearestLanguageFile( iFs, resourceFile );
+
+    CCoeEnv* coeEnv = CCoeEnv::Static();
+
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::ConstructL() rsc file %S"), &resourceFile);
+
+    iVideoResourceOffset = coeEnv->AddResourceFileL( resourceFile );
+
+    iFileDetails = aDetails;
+    iTvOutConnected = iFileDetails->iTvOutConnected;
+
+    iRNFormat = IsRealFormatL( iFileDetails->iClipName->Des() );
+
+    if ( IsRealOneBitmapVisible() )
+    {
+        iShowControls  = EFalse;
+    }
+    else
+    {
+        iShowControls  = ETrue;
+    }
+
+    iControlsPolicy = CMPXVideoPlaybackControlPolicy::NewL();
+    iControlsConfig = CMPXVideoPlaybackControlConfiguration::NewL( this );
+
+    iControlsTimer = CPeriodic::NewL( CActive::EPriorityStandard );
+
+    CreateControlsL();
+
+#ifdef RD_TACTILE_FEEDBACK
+    iFeedback = MTouchFeedback::Instance();
+#endif //RD_TACTILE_FEEDBACK
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControlsController::NewL()
+// Two-phased constructor.
+// -------------------------------------------------------------------------------------------------
+//
+EXPORT_C CMPXVideoPlaybackControlsController* CMPXVideoPlaybackControlsController::NewL(
+        CMPXVideoPlaybackContainer* aContainer,
+        TRect aRect,
+        CMPXVideoPlaybackViewFileDetails* aDetails )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::NewL()"));
+
+    CMPXVideoPlaybackControlsController* self =
+        new (ELeave) CMPXVideoPlaybackControlsController( aContainer, aRect );
+
+    CleanupStack::PushL(self);
+    self->ConstructL( aDetails );
+    CleanupStack::Pop();
+
+    return self;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControlsController::~CMPXVideoPlaybackControlsController
+// Destructor.
+// -------------------------------------------------------------------------------------------------
+//
+EXPORT_C CMPXVideoPlaybackControlsController::~CMPXVideoPlaybackControlsController()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackControlsController::~CMPXVideoPlaybackControlsController"));
+
+    iFs.Close();
+
+#ifdef RD_TACTILE_FEEDBACK
+    if ( iFeedback )
+    {
+        iFeedback->RemoveFeedbackForControl( iContainer );
+    }
+#endif //RD_TACTILE_FEEDBACK
+
+    if ( iControlsPolicy )
+    {
+        delete iControlsPolicy;
+        iControlsPolicy = NULL;
+    }
+
+    if ( iControlsConfig )
+    {
+        delete iControlsConfig;
+        iControlsConfig = NULL;
+    }
+
+    if ( iControlsTimer )
+    {
+        iControlsTimer->Cancel();
+        delete iControlsTimer;
+        iControlsTimer = NULL;
+    }
+
+    iControls.ResetAndDestroy();
+
+    if ( iRealOneBitmap )
+    {
+        SetRealOneBitmapVisibility( EFalse );
+        delete iRealOneBitmap;
+        iRealOneBitmap = NULL ;
+    }
+
+    if ( iVideoResourceOffset )
+    {
+        (CCoeEnv::Static())->DeleteResourceFile( iVideoResourceOffset );
+    }
+
+    if ( iMediaDetailsViewerControl )
+    {
+        delete iMediaDetailsViewerControl;
+        iMediaDetailsViewerControl = NULL;
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControlsController::AddFileDetailsL()
+// -------------------------------------------------------------------------------------------------
+//
+EXPORT_C void CMPXVideoPlaybackControlsController::AddFileDetailsL(
+    CMPXVideoPlaybackViewFileDetails* aDetails )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackControlsController::AddFileDetailsL()"));
+
+    iFileDetails = aDetails;
+
+    iControlsConfig->UpdateControlsWithFileDetailsL();
+
+    ControlsListUpdatedL();
+
+    for ( TInt i = 0 ; i < iControls.Count() ; i++ )
+    {
+        iControls[i]->UpdateControlsWithFileDetailsL( iFileDetails );
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControlsController::HandleEventL
+// -------------------------------------------------------------------------------------------------
+//
+EXPORT_C void CMPXVideoPlaybackControlsController::HandleEventL(
+    TMPXVideoPlaybackControlCommandIds aEvent, TInt aValue )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::HandleEventL(%d)"), aEvent);
+
+    switch ( aEvent )
+    {
+        case EMPXControlCmdSetPosition:
+        {
+            MPX_DEBUG(_L("    [EMPXControlCmdSetPosition [%d]]"), aValue );
+
+            PositionChangedL( (TReal)aValue / (TReal)KPbMilliMultiplier);
+            break;
+        }
+        case EMPXControlCmdSetDuration:
+        {
+            MPX_DEBUG(_L("    [EMPXControlCmdSetDuration [%d]]"), aValue );
+
+            DurationChangedL( (TReal)aValue / (TReal)KPbMilliMultiplier );
+            break;
+        }
+        case EMPXControlCmdStateChanged:
+        {
+            MPX_DEBUG(_L("    [EMPXControlCmdStateChanged]"));
+
+            HandleStateChange( (TMPXPlaybackState)aValue );
+            break;
+        }
+        case EMPXControlCmdToggleVisibility:
+        {
+            MPX_DEBUG(_L("    [EMPXControlCmdToggleVisibility]"));
+
+            ToggleVisibility();
+            break;
+        }
+        case EMPXControlCmdSetVolume:
+        {
+            MPX_DEBUG(_L("    [EMPXControlCmdSetVolume [%d]]"), aValue );
+            VolumeChanged( aValue );
+            break;
+        }
+        case EMPXControlCmdSetAspectRatio:
+        {
+            MPX_DEBUG(_L("    [EMPXControlCmdSetAspectRatio %d]"), aValue);
+            AspectRatioChanged( aValue );
+            break;
+        }
+        case EMPXControlCmdSetDownloadSize:
+        {
+            MPX_DEBUG(_L("    [EMPXControlCmdSetDownloadSize [%d]]"), aValue );
+            SetDownloadSize( aValue );
+            break;
+        }
+        case EMPXControlCmdDownloadUpdated:
+        {
+            MPX_DEBUG(_L("    [EMPXControlCmdDownloadUpdated [%d]]"), aValue );
+            UpdateDownloadPosition( aValue );
+            break;
+        }
+        case EMPXControlCmdDownloadComplete:
+        {
+            MPX_DEBUG(_L("    [EMPXControlCmdDownloadComplete [%d]]"), aValue);
+            UpdateDownloadPosition( aValue );
+            break;
+        }
+        case EMPXControlCmdSetDownloadPaused:
+        case EMPXControlCmdClearDownloadPaused:
+        {
+            iControlsConfig->UpdateControlListL( aEvent );
+            ControlsListUpdatedL();
+            break;
+        }
+        case EMPXControlCmdTvOutConnected:
+        {
+            iTvOutConnected = ETrue;
+
+            //
+            //  Do not show the aspect ratio icon when TV Out is connected
+            //
+            HandleTvOutEventL( ETrue, aEvent, EFalse );
+            break;
+        }
+        case EMPXControlCmdTvOutDisconnected:
+        {
+            iTvOutConnected = EFalse;
+
+            //
+            //  Pass in the show aspect ratio flag from the event
+            //
+            HandleTvOutEventL( EFalse, aEvent, aValue );
+            break;
+        }
+        case EMPXControlCmdHandleBackgroundEvent:
+        {
+            MPX_DEBUG(_L("    [EMPXControlCmdHandleBackgroundEvent]"));
+
+            TBool keylock( EFalse );
+            RProperty::Get( KPSUidAvkonDomain, KAknKeyguardStatus, keylock );
+
+            //
+            //  Don't show controls when key is locked
+            //
+            if ( keylock )
+            {
+                iShowControls = EFalse;
+            }
+
+            ResetDisappearingTimers( EMPXTimerReset );
+
+            for ( TInt i = 0 ; i < iControls.Count() ; i++ )
+            {
+                iControls[i]->ResetControl();
+            }
+
+            break;
+        }
+        case EMPXControlCmdHandleForegroundEvent:
+        {
+            MPX_DEBUG(_L("    [EMPXControlCmdHandleForegroundEvent]"));
+
+            if ( ! IsRealOneBitmapVisible() )
+            {
+                iShowControls = ETrue;
+                UpdateControlsVisibility();
+            }
+
+            break;
+        }
+        case EMPXControlCmdHandleErrors:
+        {
+            MPX_DEBUG(_L("    [EMPXControlCmdHandleErrors]"));
+            HandleErrors();
+            break;
+        }
+        case EMPXControlCmdShowControls:
+        {
+            MPX_DEBUG(_L("    [EMPXControlCmdShowControls]"));
+            ShowControls();
+            break;
+        }
+        case EMPXControlCmdHideControls:
+        {
+            MPX_DEBUG(_L("    [EMPXControlCmdHideControls]"));
+            HideAllControls();
+            break;
+        }
+        case EMPXControlCmdSoftKeyPressed:
+        {
+            HandleSoftKeyPressedL( aValue );
+            break;
+        }
+        case EMPXControlCmdShowFileDetailsViewer:
+        {
+            ShowMediaDetailsViewerL();
+            break;
+        }
+        case EMPXControlCmdCloseFileDetailsViewer:
+        {
+            ShowControls();
+            break;
+        }
+        case EMPXControlCmdSurfaceCreated:
+        {
+            SetRealOneBitmapVisibility( EFalse );
+            break;
+        }
+        case EMPXControlCmdLoadingStarted:
+        {
+            HandleLoadingStarted();
+            break;
+        }
+        case EMPXControlCmdCreateAspectRatioIcon:
+        case EMPXControlCmdDeleteAspectRatioIcon:
+        {
+            //
+            //  Ignore the Aspect Ration commands for non touch devices and
+            //  when the TV-Out is connected.
+            //
+            if ( AknLayoutUtils::PenEnabled() && ! iTvOutConnected )
+            {
+                iControlsConfig->UpdateControlListL( aEvent );
+
+                //
+                //  Set the update visibility flag based on the visibility of the controls
+                //
+                ControlsListUpdatedL( IsVisible() );
+            }
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControlsController::HandleStateChange
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControlsController::HandleStateChange( TMPXPlaybackState aNewState )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackControlsController::HandleStateChange()"),
+                   _L("new state = %d"), aNewState );
+
+    //
+    // Somehow EPbStatePlaying, EPbStatePaused gets called twice continously
+    //
+    if ( aNewState != iState )
+    {
+        TBool hideControls( EFalse );
+
+        iState = aNewState;
+
+        switch ( aNewState )
+        {
+            case EPbStateInitialised:
+            {
+                //
+                //  remove branding control when the state is transitioned to Initialized
+                //
+                if ( iFileDetails->iPlaybackMode == EMPXVideoStreaming ||
+                     iFileDetails->iPlaybackMode == EMPXVideoLiveStreaming )
+                {
+                    TRAP_IGNORE(
+                        iControlsConfig->UpdateControlListL( EMPXControlCmdPluginInitialized );
+                        ControlsListUpdatedL();
+                        );
+                }
+
+                break;
+            }
+            case EPbStatePlaying:
+            {
+                if ( iFileDetails->iVideoEnabled && ! IsTvOutConnected() )
+                {
+                    //
+                    //  Hide controls when transitioning to Playing State
+                    //
+                    hideControls = ETrue;
+                }
+
+                //
+                //  Intentionally fall through
+                //
+            }
+            case EPbStateBuffering:
+            case EPbStateNotInitialised:
+            case EPbStateInitialising:
+            case EPbStatePaused:
+            case EPbStatePluginSeeking:
+            {
+                UpdateStateOnButtonBar();
+
+                //
+                //  Show all the controls
+                //
+                if ( hideControls )
+                {
+                    HideAllControls();
+                }
+                else
+                {
+                    UpdateControlsVisibility();
+                }
+
+                break;
+            }
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControlsController::CreateControlsL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControlsController::CreateControlsL()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::CreateControlsL()"));
+
+    //
+    //  Clean up old controls list and controls
+    //
+    iControls.ResetAndDestroy();
+
+    RArray<TMPXVideoPlaybackControls>& controlList = iControlsConfig->ControlList();
+
+    //
+    //  Iterate thru the controls list from view-config
+    //  and create controls that match items in the list
+    //
+    for ( TInt i = 0 ; i < controlList.Count() ; i++ )
+    {
+        AppendControlL( controlList[i] );
+    }
+
+    UpdateControlsVisibility();
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControlsController::CreateRealOneBitmapL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControlsController::CreateRealOneBitmapL()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::CreateRealOneBitmapL()"));
+
+    TFileName iconsPath;
+    LocateBitmapFileL( iconsPath );
+
+    iRealOneBitmap = CreateBitmapL( iconsPath,
+                                    EMbmMpxvideoplaybackcontrolsQgn_graf_realplayer_splash_01,
+                                    main_mp4_pane_g3( KMP4LayoutSet ).LayoutLine() );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControlsController::GetBitmap()
+// -------------------------------------------------------------------------------------------------
+//
+EXPORT_C CEikImage*
+CMPXVideoPlaybackControlsController::GetBitmap( TMPXVideoPlaybackControls aBitmap )
+{
+    CEikImage* bitmap = NULL;
+
+    switch( aBitmap )
+    {
+        case EMPXRealLogoBitmap:
+        {
+            bitmap = iRealOneBitmap;
+            break;
+        }
+    }
+
+    return bitmap;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControlsController::ControlsListUpdatedL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControlsController::ControlsListUpdatedL( TBool aUpdateVisibility )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackControlsController::ControlsListUpdatedL()"),
+                   _L("aUpdateVisibility = %d"), aUpdateVisibility );
+
+    RArray<TMPXVideoPlaybackControls>& updatedList = iControlsConfig->ControlList();
+
+    //
+    //  Create a copy of the control list
+    //
+    TMPXVideoPlaybackControls* data = (TMPXVideoPlaybackControls*)
+        User::AllocL( updatedList.Count() * sizeof( TMPXVideoPlaybackControls ) );
+
+    Mem::Copy( data, &(updatedList[0]), updatedList.Count()* sizeof(TMPXVideoPlaybackControls));
+
+    RArray<TMPXVideoPlaybackControls> myList( sizeof(TMPXVideoPlaybackControls),
+                                              data,
+                                              updatedList.Count() );
+
+    CleanupClosePushL( myList );
+
+    TInt controlCount = iControls.Count();
+
+    TInt i = 0 ;
+    TInt index = KErrNotFound;
+
+
+    for ( TInt iCnt = 0 ; iCnt < controlCount ; iCnt++ )
+    {
+        index = myList.Find( iControls[i]->ControlIndex() );
+
+        if ( index == KErrNotFound )
+        {
+            //
+            //  Delete control since it doesn't exist in new list
+            //
+            delete iControls[i];
+            iControls.Delete( i );
+        }
+        else
+        {
+            //
+            //  Control exists in new list.
+            //  Remove it from the new list.
+            //
+            myList.Remove( index );
+            i++;
+        }
+    }
+
+    //
+    //  The updated list will contain added controls only
+    //
+    for ( TInt j = 0 ; j < myList.Count() ; j++ )
+    {
+        AppendControlL( myList[j] );
+    }
+
+    if ( aUpdateVisibility )
+    {
+        UpdateControlsVisibility();
+    }
+
+    CleanupStack::PopAndDestroy();
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControlsController::AppendControlL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControlsController::AppendControlL( TMPXVideoPlaybackControls aControlIndex )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackControlsController::AppendControlL()"),
+                   _L("control index = %d"), aControlIndex );
+
+    TUint properties = 0;
+
+    iControlsPolicy->SetControlProperties( aControlIndex, properties, iFileDetails );
+
+    TFileName iconsPath;
+    LocateBitmapFileL( iconsPath );
+
+    switch ( aControlIndex )
+    {
+        case EMPXSoftkeyBack:
+        {
+            CreateFakeSoftKeyL( R_MPX_VIDEO_PLAYBACK_CONTROLS_FAKE_SK_BACK,
+                                ETrue,
+                                aControlIndex,
+                                properties );
+            break;
+        }
+        case EMPXButtonBar:
+        {
+            TAknLayoutRect buttonBarPaneRect;
+            buttonBarPaneRect.LayoutRect(
+                iRect,
+                AknLayoutScalable_Avkon::area_side_right_pane( 0 ).LayoutLine() );
+
+            TAknLayoutRect buttonBarRect;
+            buttonBarRect.LayoutRect( buttonBarPaneRect.Rect(),
+                                      grid_sctrl_middle_pane( 0 ).LayoutLine() );
+
+            TRect btBarRect( buttonBarRect.Rect() );
+            btBarRect.iBr.iY -= 25;
+            btBarRect.iTl.iY += 15;
+            CMPXVideoPlaybackButtonBar* buttonBar =
+                CMPXVideoPlaybackButtonBar::NewL( this, btBarRect );
+
+            CleanupStack::PushL( buttonBar );
+
+            CMPXVideoPlaybackControl* control =
+                CMPXVideoPlaybackControl::NewL( this,
+                                                buttonBar,
+                                                btBarRect,
+                                                aControlIndex,
+                                                properties );
+
+            CleanupStack::PushL( control );
+
+            iControls.AppendL( control );
+
+            CleanupStack::Pop( 2 ); // buttonBar, control
+
+            break;
+        }
+        case EMPXVolumeBar:
+        {
+            TAknLayoutRect volumeLayoutRect;
+            volumeLayoutRect.LayoutRect( iRect, popup_slider_window_cp02().LayoutLine() );
+            TRect rect = volumeLayoutRect.Rect();
+
+            CMPXVideoPlaybackVolumeBar* volBar = CMPXVideoPlaybackVolumeBar::NewL( this, rect );
+
+            CleanupStack::PushL( volBar );
+
+            CMPXVideoPlaybackControl* control = CMPXVideoPlaybackControl::NewL( this,
+                                                                                volBar,
+                                                                                rect,
+                                                                                aControlIndex,
+                                                                                properties );
+
+            CleanupStack::PushL( control );
+
+            iControls.AppendL( control );
+
+            CleanupStack::Pop( 2 ); // volBar, control
+
+            break;
+        }
+        case EMPXProgressBar:
+        {
+            TAknLayoutRect progressPaneRect;
+            progressPaneRect.LayoutRect( iRect, mp4_progress_pane( KMP4LayoutSet ).LayoutLine() );
+
+            TRect touchPaneRect( progressPaneRect.Rect().iTl.iX,
+                                 progressPaneRect.Rect().iTl.iY,
+                                 progressPaneRect.Rect().iBr.iX,
+                                 iRect.Height() );
+
+            CMPXVideoPlaybackProgressBar* progBar =
+                CMPXVideoPlaybackProgressBar::NewL( this, touchPaneRect );
+
+            CleanupStack::PushL( progBar );
+
+            CMPXVideoPlaybackControl* control = CMPXVideoPlaybackControl::NewL( this,
+                                                                                progBar,
+                                                                                touchPaneRect,
+                                                                                aControlIndex,
+                                                                                properties );
+
+            CleanupStack::PushL( control );
+
+            iControls.AppendL( control );
+
+            CleanupStack::Pop( 2 ); // progBar, control
+
+            break;
+        }
+        case EMPXSoftkeyDetails:
+        {
+            CreateFakeSoftKeyL( R_MPX_VIDEO_PLAYBACK_CONTROLS_FAKE_SK_DETAILS,
+                                EFalse,
+                                aControlIndex,
+                                properties );
+            break;
+        }
+        case EMPXBufferingLabel:
+        {
+            CreateTextLabelWithSpecificLayoutL( R_MPX_LOADING,
+                                                aControlIndex,
+                                                properties,
+                                                main_mp4_pane_t3( KMP4LayoutSet ) );
+            break;
+        }
+        case EMPXTitleLabel:
+        {
+            CreateTitleControlL( aControlIndex, properties );
+
+            break;
+        }
+        case EMPXArtistLabel:
+        {
+            if ( iFileDetails->iArtist && iFileDetails->iArtist->Length() )
+            {
+                CEikLabel* label = CreateTextLabelL( *(iFileDetails->iArtist) );
+
+                CleanupStack::PushL( label );
+
+                AknLayoutUtils::LayoutLabel( label,
+                                             iRect,
+                                             main_mp3_pane_t3().LayoutLine());
+
+                label->OverrideColorL( EColorLabelText, KRgbWhite );
+                label->OverrideColorL( EColorLabelTextEmphasis, KRgbWhite );
+
+                CMPXVideoPlaybackControl* control =
+                    CMPXVideoPlaybackControl::NewL( this,
+                                                    label,
+                                                    label->Rect(),
+                                                    aControlIndex,
+                                                    properties );
+
+                CleanupStack::PushL( control );
+
+                iControls.AppendL( control );
+
+                CleanupStack::Pop( 2 ); // label, control
+            }
+            break;
+        }
+        case EMPXRealAudioBitmap:
+        {
+            CreateAudioOnlyBitmapL( iconsPath,
+                                    EMbmMpxvideoplaybackcontrolsQgn_menu_rp,
+                                    EMbmMpxvideoplaybackcontrolsQgn_menu_rp_mask,
+                                    aControlIndex,
+                                    main_mp3_pane_g3(0).LayoutLine(),
+                                    properties );
+
+            break;
+        }
+        case EMPXSoundBitmap:
+        {
+            CreateAudioOnlyBitmapL( iconsPath,
+                                    EMbmMpxvideoplaybackcontrolsQgn_indi_onimage_audio,
+                                    EMbmMpxvideoplaybackcontrolsQgn_indi_onimage_audio_mask,
+                                    aControlIndex,
+                                    main_mp3_pane_g4(0).LayoutLine(),
+                                    properties );
+
+            break;
+        }
+        case EMPXNoVideoBitmap:
+        {
+            CreateAudioOnlyBitmapL( iconsPath,
+                                    EMbmMpxvideoplaybackcontrolsQgn_prop_video_corrupted,
+                                    EMbmMpxvideoplaybackcontrolsQgn_prop_video_corrupted_mask,
+                                    aControlIndex,
+                                    main_mp3_pane_g4(0).LayoutLine(),
+                                    properties );
+
+            break;
+        }
+        case EMPXDownloadPausedIcon:
+        {
+            //
+            //  Not added to the control list since it will always be visible
+            //
+            CEikImage* dlPausedBitmap =
+                CreateImageL( iconsPath,
+                              EMbmMpxvideoplaybackcontrolsQgn_indi_mp_ongoing_interrupt,
+                              EMbmMpxvideoplaybackcontrolsQgn_indi_mp_ongoing_interrupt_mask );
+
+            CleanupStack::PushL( dlPausedBitmap );
+
+            AknLayoutUtils::LayoutImage( dlPausedBitmap,
+                                         iRect,
+                                         AknLayoutScalable_Apps::main_mp4_pane_g6( KMP4LayoutSet ) );
+
+            TRect ctrlRect = dlPausedBitmap->Rect();
+
+            //
+            //  To make it aligned with AspectRatioIcon when touch is supported.
+            //
+            if ( AknLayoutUtils::PenEnabled() )
+            {
+                ctrlRect.iBr.iY += 10;
+                ctrlRect.iTl.iY += 10;
+            }
+
+            CMPXVideoPlaybackControl* control =
+                CMPXVideoPlaybackControlPdl::NewL( this,
+                                                   dlPausedBitmap,
+                                                   ctrlRect,
+                                                   aControlIndex,
+                                                   properties );
+
+            CleanupStack::PushL( control );
+
+            iControls.AppendL( control );
+
+            CleanupStack::Pop( 2 ); // dlPausedBitmap, control
+
+            break;
+        }
+        case EMPXAspectRatioIcon:
+        {
+
+            TAknLayoutRect aspectRatioPaneRect;
+            aspectRatioPaneRect.LayoutRect( iRect,
+                                            main_mp4_pane_g5( KMP4LayoutSet ).LayoutLine() );
+
+            //
+            // Set the touchable area for aspect ratio
+            //
+            TRect touchableArea = TRect( aspectRatioPaneRect.Rect().iTl.iX - 25,
+                                         aspectRatioPaneRect.Rect().iTl.iY - 10,
+                                         aspectRatioPaneRect.Rect().iBr.iX + 15,
+                                         aspectRatioPaneRect.Rect().iBr.iY + 30 );
+
+            CMPXVideoPlaybackAspectRatioIcon* aspectRatioIcon =
+                CMPXVideoPlaybackAspectRatioIcon::NewL( this, touchableArea );
+
+            CleanupStack::PushL( aspectRatioIcon );
+
+            CMPXVideoPlaybackControl* control =
+                CMPXVideoPlaybackControl::NewL( this,
+                                                aspectRatioIcon,
+                                                touchableArea,
+                                                aControlIndex,
+                                                properties );
+
+            control->MakeVisible( EFalse );
+
+            CleanupStack::PushL( control );
+
+            iControls.AppendL( control );
+
+            CleanupStack::Pop( 2 ); // aspectRatioIcon, control
+
+            break;
+        }
+        case EMPXBrandingAnimation:
+        {
+            TAknLayoutRect brandingPaneRect;
+            brandingPaneRect.LayoutRect( iRect, main_mp4_pane_g3( KMP4LayoutSet ).LayoutLine() );
+
+            // Decrease the size of BrandingAnimation to make it look better.
+            TRect brandingLogoRect(
+                    brandingPaneRect.Rect().iTl.iX+20,
+                    brandingPaneRect.Rect().iTl.iY+50,
+                    brandingPaneRect.Rect().iBr.iX-20,
+                    brandingPaneRect.Rect().iBr.iY-50 );
+            CMPXVideoPlaybackBrandingAnimation* brandingAnimation =
+                CMPXVideoPlaybackBrandingAnimation::NewL( this,
+                                                          brandingLogoRect,
+                                                          iRNFormat );
+
+            CleanupStack::PushL( brandingAnimation );
+
+            CMPXVideoPlaybackControl* control =
+                CMPXVideoPlaybackControl::NewL( this,
+                                                brandingAnimation,
+                                                brandingLogoRect,
+                                                aControlIndex,
+                                                properties );
+
+            CleanupStack::PushL( control );
+
+            iControls.AppendL( control );
+
+            CleanupStack::Pop( 2 ); // brandingAnimation, control
+
+            break;
+        }
+        case EMPXVideoPausedIcon:
+        {
+            CEikImage* pausedBitmap =
+                CreateImageL( iconsPath,
+                              EMbmMpxvideoplaybackcontrolsQgn_prop_image_tb_pause,
+                              EMbmMpxvideoplaybackcontrolsQgn_prop_image_tb_pause_mask );
+
+            CleanupStack::PushL( pausedBitmap );
+
+            AknLayoutUtils::LayoutImage( pausedBitmap,
+                                         iRect,
+                                         AknLayoutScalable_Apps::main_mp4_pane_g4( KMP4LayoutSet ) );
+
+            CMPXVideoPlaybackControl* control =
+                CMPXVideoPlaybackControl::NewL( this,
+                                                pausedBitmap,
+                                                pausedBitmap->Rect(),
+                                                aControlIndex,
+                                                properties );
+
+            CleanupStack::PushL( control );
+            iControls.AppendL( control );
+            CleanupStack::Pop( 2 ); // pausedBitmap, control
+            break;
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackControlsController::CreateTitleControlL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControlsController::CreateTitleControlL(
+        TMPXVideoPlaybackControls aControlIndex,
+        TUint aProperties )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackControlsController::CreateTitleControlL()"));
+
+    HBufC* displayedTitle;
+
+    //
+    //  If Title exists, use the title.  If title doesn't exitst, use the filename
+    //  excecpt when streaming functionality is hidden
+    //
+    if ( iFileDetails->iTitle )
+
+    {
+        displayedTitle = HBufC::NewL( iFileDetails->iTitle->Length() );
+        TPtr tempTitle( displayedTitle->Des() );
+        tempTitle.Append( iFileDetails->iTitle->Des() );
+    }
+    else
+    {
+        //
+        //  If title doesn't exitst, use the filename
+        //  excecpt when streaming functionality is hidden
+        //
+        //                 ! ( iFileDetails->iMode == EStreaming &&
+        //                     iFileDetails->iHideStreamingFunctionality ) )
+        //
+        TParse parse;
+        parse.Set( iFileDetails->iClipName->Des(), NULL, NULL);
+        displayedTitle = parse.Name().AllocL();
+    }
+
+    TAknTextComponentLayout layout = main_mp3_pane_t6();
+
+    if ( iFileDetails->iArtist )
+    {
+        layout = main_mp3_pane_t2();
+    }
+
+    CEikLabel* label = CreateTextLabelL( *displayedTitle );
+
+    CleanupStack::PushL( label );
+
+    delete displayedTitle;
+
+    AknLayoutUtils::LayoutLabel( label,
+                                 iRect,
+                                 layout.LayoutLine());
+
+    label->OverrideColorL( EColorLabelText, KRgbWhite );
+    label->OverrideColorL( EColorLabelTextEmphasis, KRgbWhite );
+
+    CMPXVideoPlaybackControl* control = CMPXVideoPlaybackControl::NewL( this,
+                                                                        label,
+                                                                        label->Rect(),
+                                                                        aControlIndex,
+                                                                        aProperties );
+
+    iControls.AppendL( control );
+
+    CleanupStack::Pop( label );
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackControlsController::CreateAudioOnlyBitmapL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControlsController::CreateAudioOnlyBitmapL(
+        TFileName& aIconsPath,
+        TInt aBitmapIndex,
+        TInt aBitmapMaskIndex,
+        TMPXVideoPlaybackControls aControlIndex,
+        const TAknWindowLineLayout& aLayout,
+        TUint aProperties )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackControlsController::CreateAudioOnlyBitmapL()"));
+
+    CEikImage* audioOnlyBitmap = CreateImageL( aIconsPath, aBitmapIndex, aBitmapMaskIndex );
+
+    CleanupStack::PushL( audioOnlyBitmap );
+
+    AknLayoutUtils::LayoutImage( audioOnlyBitmap, iRect, aLayout );
+
+    CMPXVideoPlaybackControl* control =
+        CMPXVideoPlaybackControl::NewL( this,
+                                        audioOnlyBitmap,
+                                        audioOnlyBitmap->Rect(),
+                                        aControlIndex,
+                                        aProperties );
+
+    iControls.AppendL( control );
+
+    CleanupStack::Pop( audioOnlyBitmap );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControlsController::CreateFakeSoftKeyL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControlsController::CreateFakeSoftKeyL(
+    TInt aResource,
+    TBool aTop,
+    TMPXVideoPlaybackControls aControlIndex,
+    TUint aProperties )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackControlsController::CreateFakeSoftKeyL"));
+
+    HBufC* text = StringLoader::LoadLC( aResource );
+    CEikLabel* label = CreateTextLabelL( text->Des() );
+    CleanupStack::PopAndDestroy( text );
+
+    CleanupStack::PushL( label );
+
+    TAknTextComponentLayout SKLayout;
+    TAknWindowComponentLayout softkeyPane;
+    TRect skRect;
+
+    if ( aTop )
+    {
+        SKLayout = main_mp4_pane_t2( KMP4LayoutSet );
+    }
+    else
+    {
+        SKLayout = main_mp4_pane_t1( KMP4LayoutSet );
+    }
+
+    AknLayoutUtils::LayoutLabel( label,
+                                 iRect,
+                                 SKLayout.LayoutLine() );
+
+    if ( AknLayoutUtils::PenEnabled() )
+    {
+        if ( aTop )
+        {
+            label->SetAlignment( EHRightVCenter );
+        }
+        else
+        {
+            label->SetAlignment( EHLeftVCenter );
+        }
+    }
+    else
+    {
+        if ( aTop )
+        {
+            //Default alignment is EHRightVTop
+        }
+        else
+        {
+            label->SetAlignment( EHRightVBottom );
+        }
+    }
+
+    skRect = label->Rect();
+
+    // Enlarge the button region to make it easy to be touched.
+    skRect.iTl.iY -= 26;
+    skRect.iBr.iY += 6;
+
+    CMPXVideoPlaybackControl* control = CMPXVideoPlaybackControl::NewL( this,
+                                                                        label,
+                                                                        skRect,
+                                                                        aControlIndex,
+                                                                        aProperties );
+
+    iControls.AppendL( control );
+
+    CleanupStack::Pop( label );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControlsController::CreateTextLabelWithSpecificLayoutL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControlsController::CreateTextLabelWithSpecificLayoutL(
+    TInt aResource,
+    TMPXVideoPlaybackControls aControlIndex,
+    TUint aProperties,
+    TAknTextComponentLayout aLayout )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::CreateTextLabelWithSpecificLayoutL()"));
+
+    HBufC* text = StringLoader::LoadLC( aResource );
+    CEikLabel* label = CreateTextLabelL( text->Des() );
+    CleanupStack::PopAndDestroy( text );
+
+    CleanupStack::PushL( label );
+
+    AknLayoutUtils::LayoutLabel( label,
+                                 iRect,
+                                 aLayout.LayoutLine());
+
+    CMPXVideoPlaybackControl* control = CMPXVideoPlaybackControl::NewL( this,
+                                                                        label,
+                                                                        label->Rect(),
+                                                                        aControlIndex,
+                                                                        aProperties );
+
+    iControls.AppendL( control );
+
+    CleanupStack::Pop( label );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControlsController::CreateTextLabelL()
+// -------------------------------------------------------------------------------------------------
+//
+CEikLabel* CMPXVideoPlaybackControlsController::CreateTextLabelL( const TDesC& aText )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::CreateTextLabelL()"));
+
+    CEikLabel* label = new (ELeave) CEikLabel;
+    label->SetContainerWindowL( *iContainer );
+    label->SetTextL( aText );
+    label->MakeVisible( EFalse );
+
+    return label;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControlsController::ToggleVisibility()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControlsController::ToggleVisibility()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::ToggleVisibility()"));
+
+    //
+    //  Toggle visibility only if:
+    //  (a) MediaDetailsViewer is not visble
+    //  (b) TV-Out is not connected and
+    //  (c) we are in playing or paused state
+    //
+    if ( ! IsMediaDetailsViewerVisible() &&
+         ! IsTvOutConnected() &&
+         ( iState == EPbStatePlaying || iState == EPbStatePaused ) )
+    {
+        //
+        //  Controls will remain visible for audio only clips
+        //
+        if ( iFileDetails->iVideoEnabled )
+        {
+#ifdef RD_TACTILE_FEEDBACK
+            if ( iFeedback )
+            {
+                MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::ToggleVisibility() tactile"));
+                iFeedback->InstantFeedback( ETouchFeedbackBasic );
+            }
+#endif //RD_TACTILE_FEEDBACK
+
+            if ( IsVisible() )
+            {
+                HideAllControls();
+            }
+            else
+            {
+                ShowControls();
+            }
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControlsController::ResetDisappearingTimers()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControlsController::ResetDisappearingTimers( TMPXTimerAction aTimerAction )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::ResetDisappearingTimers()"));
+
+    if ( iControlsTimer->IsActive() )
+    {
+        iControlsTimer->Cancel();
+    }
+
+    if ( aTimerAction == EMPXTimerReset && iState == EPbStatePlaying )
+    {
+        //
+        //  Do not start the time for Audio only clips or TV-Out is connected
+        //
+        if ( iFileDetails->iVideoEnabled && ! IsTvOutConnected() )
+        {
+            MPX_DEBUG(_L("    Starting Controls Timer"));
+
+            iControlsTimer->Start(
+                KMPXControlsTimeOut,
+                0,
+                TCallBack( CMPXVideoPlaybackControlsController::HandleControlsTimeout, this ) );
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackControlsController::HandleControlsTimeout
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMPXVideoPlaybackControlsController::HandleControlsTimeout( TAny* aPtr )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::HandleControlsTimeout()"));
+
+    static_cast<CMPXVideoPlaybackControlsController*>(aPtr)->HideAllControls();
+
+    return KErrNone;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackControlsController::HideAllControls()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControlsController::HideAllControls()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackControlsController::HideAllControls()"));
+
+    ResetDisappearingTimers( EMPXTimerCancel );
+
+    for ( TInt i = 0 ; i < iControls.Count() ; i++ )
+    {
+        iControls[i]->MakeVisible( EFalse );
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackControlsController::ShowControls()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControlsController::ShowControls()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackControlsController::ShowControls()"),
+                   _L("iState = %d"), iState );
+
+    if ( iShowControls )
+    {
+        CloseMediaDetailsViewer();
+
+        ResetDisappearingTimers( EMPXTimerReset );
+
+        for ( TInt i = 0 ; i < iControls.Count() ; i++ )
+        {
+            iControls[i]->SetVisibility( iState );
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackControlsController::IsVisible()
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoPlaybackControlsController::IsVisible()
+{
+    TBool visible = EFalse;
+
+    for ( TInt i = 0 ; i < iControls.Count() ; i++ )
+    {
+        if ( iControls[i]->ControlIndex() == EMPXSoftkeyBack )
+        {
+            if ( iControls[i]->IsVisible() )
+            {
+                visible = ETrue;
+            }
+
+            break;
+        }
+    }
+
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::IsVisible() [%d]"), visible);
+
+    return visible;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackControlsController::UpdateControlsVisibility()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControlsController::UpdateControlsVisibility()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackControlsController::UpdateControlsVisibility()"));
+
+    HideAllControls();
+    ShowControls();
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackControlsController::HandleCommandL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControlsController::HandleCommandL( TInt aCommand, TInt aValue )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::HandleCommandL(%d)"), aCommand);
+
+    iContainer->HandleCommandL( aCommand, aValue );
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackControlsController::VolumeChanged()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControlsController::VolumeChanged( TInt aVolume )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::VolumeChanged() [%d]"), aVolume);
+
+    for ( TInt i = 0 ; i < iControls.Count() ; i++ )
+    {
+        if ( iControls[i]->VolumeChanged( aVolume ) )
+        {
+            break;
+        }
+    }
+
+    ShowControls();
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackControlsController::DurationChangedL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControlsController::DurationChangedL( TInt aDuration )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::DurationChangedL() [%d]"), aDuration);
+
+    for ( TInt i = 0 ; i < iControls.Count() ; i++ )
+    {
+        if ( iControls[i]->DurationChangedL( aDuration ) )
+        {
+            break;
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackControlsController::PositionChangedL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControlsController::PositionChangedL( TInt aPosition )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::PositionChangedL() [%d]"), aPosition);
+
+    for ( TInt i = 0 ; i < iControls.Count() ; i++ )
+    {
+        if ( iControls[i]->PositionChangedL( aPosition ) )
+        {
+            break;
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackControlsController::AspectRatioChanged()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControlsController::AspectRatioChanged( TInt aAspectRatio )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::AspectRatioChanged() [%d]"), aAspectRatio);
+
+    iAspectRatio = (TMMFScalingType)aAspectRatio;
+
+    for ( TInt i = 0 ; i < iControls.Count() ; i++ )
+    {
+        if ( iControls[i]->AspectRatioChanged( aAspectRatio ) )
+        {
+            break;
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackControlsController::UpdateStateOnButtonBar()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControlsController::UpdateStateOnButtonBar()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::UpdateStateOnButtonBar() [%d]"), iState);
+
+    for ( TInt i = 0 ; i < iControls.Count() ; i++ )
+    {
+        if ( iControls[i]->UpdateStateOnButtonBar( iState ) )
+        {
+            break;
+        }
+    }
+}
+
+// ------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControlsController::CreateBitmap()
+// ------------------------------------------------------------------------------------------------
+//
+CEikImage*
+CMPXVideoPlaybackControlsController::CreateBitmapL( TFileName& aIconsPath,
+                                                    TInt aBitmapIndex,
+                                                    const TAknWindowLineLayout& aLayout )
+{
+    CEikImage* eikImage = new (ELeave) CEikImage();
+
+    CleanupStack::PushL( eikImage );
+
+    CFbsBitmap* imageBitmap = AknIconUtils::CreateIconL( aIconsPath, aBitmapIndex );
+
+    CleanupStack::PushL( imageBitmap );
+
+    eikImage->SetBitmap( imageBitmap );
+    eikImage->SetContainerWindowL( *iContainer );
+    eikImage->MakeVisible( EFalse );
+
+    AknLayoutUtils::LayoutImage( eikImage, iRect, aLayout );
+
+    CleanupStack::Pop( 2 ); // eikImage & imageBitmap
+
+    return eikImage;
+}
+
+// ------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControlsController::CreateImageL()
+// ------------------------------------------------------------------------------------------------
+//
+CEikImage*
+CMPXVideoPlaybackControlsController::CreateImageL( TFileName& aIconsPath,
+                                                   TInt aBitmapIndex,
+                                                   TInt aBitmapMaskIndex )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackControlsController::CreateImageL()"));
+
+    CFbsBitmap* bitmap = NULL;
+    CFbsBitmap* mask = NULL;
+    CEikImage* image = new (ELeave) CEikImage();
+
+    AknIconUtils::CreateIconLC( bitmap, mask, aIconsPath, aBitmapIndex, aBitmapMaskIndex );
+
+    image->SetPicture( bitmap, mask );             //  Ownership transferred
+    CleanupStack::Pop( 2 );                        // bitmap, mask
+    image->SetContainerWindowL( *iContainer );
+    image->MakeVisible( EFalse );
+
+    return image;
+}
+
+// ------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackControlsController::StopBrandingAnimation()
+// ------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControlsController::StopBrandingAnimation()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::StopBrandingAnimation()"));
+
+    for ( TInt i = 0 ; i < iControls.Count() ; i++ )
+    {
+        if ( iControls[i]->StopBrandingAnimationTimer() )
+        {
+            break;
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControlsController::IsRealFormatL()
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoPlaybackControlsController::IsRealFormatL( const TDesC& aDes )
+{
+    TBool realFormat = EFalse;
+
+    if ( aDes != KNullDesC && aDes.Length() )
+    {
+        if ( iFileDetails->iPlaybackMode == EMPXVideoStreaming ||
+             iFileDetails->iPlaybackMode == EMPXVideoLiveStreaming )
+        {
+            realFormat = RealFormatForStreamingL( aDes );
+        }
+        else
+        {
+            realFormat = RealFormatForLocalL();
+        }
+    }
+
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::IsRealFormatL() [%d]"), realFormat);
+
+    return realFormat;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControlsController::RealFormatForStreamingL()
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoPlaybackControlsController::RealFormatForStreamingL( const TDesC& aDes )
+{
+    TBool realFormat = EFalse;
+    TParse filePath;
+
+    _LIT(KMPXRMEXT, ".R" );
+
+    TInt err = filePath.Set( aDes, NULL, NULL );
+
+    //
+    // It is valid to have a "\" character in a url, but parsing fails,
+    // switch these characters to "/" for the local string and try parsing again.
+    //
+    if ( err == KErrBadName )
+    {
+        TInt backsashPos = aDes.LocateF('\\');
+
+        if( backsashPos != KErrNotFound )
+        {
+            HBufC* fileName = aDes.AllocL();
+
+            TInt count( fileName->Des().Length() );
+
+            for ( TInt j = backsashPos ; j < count; ++j )
+            {
+                if ( fileName->Des()[j]== '\\' )
+                {
+                    fileName->Des()[j]='/';
+                }
+            }
+            err = filePath.Set( fileName->Des(), NULL, NULL );
+
+            delete fileName;
+        }
+    }
+
+    if ( err == KErrNone )
+    {
+        //
+        // The requirement to support arguments with the extension in streaming links
+        // for-ex: /video.3gp?start=10&end=40 will have to supported
+        // as well. So just by doing p.Ext() would retrieve all the string
+        // after "." so by doing a Left(2) would retrieve only
+        // .3g or .rm and so on. This would help better
+        // interpret the extension and decide the branding accordingly
+        //
+        filePath.Set( filePath.NameAndExt(), NULL, NULL );
+        TPtrC extension = filePath.Ext().Left( 2 );
+
+        TBuf<2> buf;
+        buf.Format( extension );
+        buf.UpperCase();
+
+        // RealMedia Branding
+        if ( ! buf.Compare( KMPXRMEXT ) )
+        {
+            realFormat = ETrue;
+        }
+    }
+
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::RealFormatForStreamingL()[%d]"), realFormat);
+
+    return realFormat;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControlsController::RealFormatForLocalL()
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoPlaybackControlsController::RealFormatForLocalL()
+{
+    TBool realFormat = EFalse;
+
+    _LIT(KMPXReal, "real" );
+    _LIT(KMPXRN, "rn" );
+
+    if ( iFileDetails->iMimeType )
+    {
+        iFileDetails->iMimeType->Des().LowerCase();
+
+        if ( iFileDetails->iMimeType->Find( KMPXReal ) >= 0 ||
+             iFileDetails->iMimeType->Find( KMPXRN ) >= 0 )
+        {
+            //
+            // RN clip and local mode, add RN logo bitmap to show while initializing
+            //
+            CreateRealOneBitmapL();
+            SetRealOneBitmapVisibility( ETrue );
+            realFormat = ETrue;
+        }
+    }
+
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::RealFormatForLocalL() [%d]"), realFormat);
+
+    return realFormat;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControlsController::LocateBitmapFileL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControlsController::LocateBitmapFileL( TFileName& aFileName )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::LocateBitmapFileL()"));
+
+    if ( ! iBitmapFileName.Length() )
+    {
+        TParse parse;
+
+        //
+        //  This is done to ensure upgraded file is used first.
+        //  The drives from Y: to A: will be searched, then Z: last
+        //
+        TFindFile find( iFs );
+
+        //
+        //  Search for the MBM file
+        //
+        HBufC* mbmFileName = StringLoader::LoadLC( R_MPX_VIDEO_PLAYBACK_CONTROLS_ICONS_MBM_FILE );
+        parse.Set( mbmFileName->Des(), &KDC_APP_BITMAP_DIR, NULL );
+        TPtrC mbmPath = parse.FullName();
+
+        MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::LocateBitmapFileL() file %S"), &mbmPath);
+
+        TInt error = find.FindByDir( mbmPath, KNullDesC );
+
+        if ( error == KErrNone )
+        {
+            parse.Set( find.File(), NULL, NULL );
+        }
+        else
+        {
+            //
+            //  MBM file not found, search for the MIF file
+            //
+            HBufC* mifFileName = StringLoader::LoadLC( R_MPX_VIDEO_PLAYBACK_CONTROLS_ICONS_MIF_FILE );
+            parse.Set( mifFileName->Des(), &KDC_APP_BITMAP_DIR, NULL );
+            TPtrC mifPath = parse.FullName();
+            CleanupStack::PopAndDestroy( mifFileName );
+
+            MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::LocateBitmapFileL() file %S"), &mifPath);
+
+            //
+            //  If the MBM and the MIF file cannot be found, leave
+            //
+            User::LeaveIfError( find.FindByDir( mifPath, KNullDesC ) );
+
+            parse.Set( find.File(), NULL, NULL );
+        }
+
+        //
+        //  File Path must be to the MBM file
+        //
+        aFileName.Append( parse.Drive() );
+        aFileName.Append( KDC_APP_BITMAP_DIR );
+        aFileName.Append( mbmFileName->Des() );
+
+        CleanupStack::PopAndDestroy( mbmFileName );
+
+        //
+        //  Save this bitmap file name
+        //
+        iBitmapFileName = aFileName;
+
+    }
+    else
+    {
+        aFileName.Append( iBitmapFileName );
+    }
+
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::LocateBitmapFileL(%S)"),&aFileName);
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackControlsController::SetDownloadSize()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControlsController::SetDownloadSize( TInt aSize )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::SetDownloadSize() [%d]"), aSize);
+
+    for ( TInt i = 0 ; i < iControls.Count() ; i++ )
+    {
+        if ( iControls[i]->SetDownloadSize( aSize ) )
+        {
+            break;
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackControlsController::UpdateDownloadPosition()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControlsController::UpdateDownloadPosition( TInt aSize )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::UpdateDownloadPosition() [%d]"), aSize);
+
+    for ( TInt i = 0 ; i < iControls.Count() ; i++ )
+    {
+        if ( iControls[i]->UpdateDownloadPosition( aSize ) )
+        {
+            break;
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackControlsController::SetRealOneBitmapVisibility()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControlsController::SetRealOneBitmapVisibility( TBool aVisible )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::SetRealOneBitmapVisibility(%d)"), aVisible);
+
+    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;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControlsController::HandleErrors
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControlsController::HandleErrors()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackControlsController::HandleErrors()"),
+                   _L("iState = %d"), iState );
+
+    switch ( iState )
+    {
+        case EPbStateNotInitialised :
+        case EPbStateInitialising :
+        {
+            if ( iFileDetails->iPlaybackMode == EMPXVideoStreaming )
+            {
+                StopBrandingAnimation();
+            }
+
+            break;
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackControlsController::IsSoftKeyVisible()
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoPlaybackControlsController::IsSoftKeyVisible( TInt aValue )
+{
+    TBool visible = EFalse;
+    TInt softKeys;
+
+    if ( aValue == EStdKeyDevice0 )
+    {
+        softKeys = EMPXSoftkeyDetails;
+    }
+    else//EStdKeyDevice1
+    {
+        softKeys = EMPXSoftkeyBack;
+    }
+
+    for ( TInt i = 0 ; i < iControls.Count() ; i++ )
+    {
+        if ( iControls[i]->ControlIndex() == softKeys )
+        {
+            if ( iControls[i]->IsVisible() )
+            {
+                visible = ETrue;
+            }
+
+            break;
+        }
+    }
+
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::IsSoftKeyVisible() [%d]"), visible);
+
+    return visible;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackControlsController::HandleTvOutEventL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControlsController::HandleTvOutEventL(
+        TBool aConnected, TMPXVideoPlaybackControlCommandIds aEvent, TBool aShowArIcon )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackControlsController::HandleTvOutEventL()"));
+
+    iFileDetails->iTvOutConnected = aConnected;
+    iControlsConfig->UpdateControlListL( aEvent, aShowArIcon );
+    ControlsListUpdatedL();
+
+    for ( TInt i = 0 ; i < iControls.Count() ; i++ )
+    {
+        if ( iControls[i]->UpdateTVOutStatusL( aConnected ) )
+        {
+            break;
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackControlsController::HandleSoftKeyPressedL( TInt aValue )
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControlsController::HandleSoftKeyPressedL( TInt aValue )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::HandleSoftKeyPressedL() [%d]"), aValue);
+
+    if ( IsSoftKeyVisible( aValue ) )
+    {
+        if ( aValue == EStdKeyDevice0 )
+        {
+            iContainer->HandleCommandL( EMPXPbvCmdShowFileDetails );
+        }
+        else//EStdKeyDevice1
+        {
+            iContainer->HandleCommandL( EAknSoftkeyBack );
+        }
+    }
+    else
+    {
+        ShowControls();
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackControlsController::AddDllPath
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMPXVideoPlaybackControlsController::AddDllPath( TDes& aFileName )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackControlsController::AddDllPath()"),
+                   _L("aFileName = %S"), &aFileName);
+
+    //
+    //  Find drive for dll to search same drive for rsc
+    //
+    TFileName dllName;
+    Dll::FileName( dllName );
+
+    TPtrC driveAndPath = TParsePtrC( dllName ).DriveAndPath();
+
+    TParse parse;
+
+    TInt error = parse.Set( aFileName, &driveAndPath, NULL );
+
+    if ( error == KErrNone )
+    {
+        aFileName.Zero();
+        aFileName.Append( parse.FullName() );
+    }
+
+    return error;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackControlsController::ShowMediaDetailsViewerL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControlsController::ShowMediaDetailsViewerL()
+{
+    if ( ! iMediaDetailsViewerControl )
+    {
+        TUint properties = 0;
+
+        CMPXVideoPlaybackMediaDetailsViewer* detailsViewer =
+                                                CMPXVideoPlaybackMediaDetailsViewer::NewL( this );
+
+        CleanupStack::PushL( detailsViewer );
+
+        iMediaDetailsViewerControl = CMPXVideoPlaybackControl::NewL( this,
+                                                                     detailsViewer,
+                                                                     detailsViewer->ViewerRect(),
+                                                                     EMPXMediaDetailsViewer,
+                                                                     properties );
+
+        CleanupStack::Pop(); // detailsViewer
+    }
+
+    HideAllControls();
+    iMediaDetailsViewerControl->MakeVisible(ETrue);
+
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackControlsController::IsMediaDetailsViewerVisible
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoPlaybackControlsController::IsMediaDetailsViewerVisible()
+{
+    TBool result = EFalse;
+
+    if ( iMediaDetailsViewerControl )
+    {
+        result = iMediaDetailsViewerControl->IsVisible();
+    }
+
+    return result;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackControlsController::CloseMediaDetailsViewer
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControlsController::CloseMediaDetailsViewer()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackControlsController::CloseMediaDetailsViewer()"));
+
+    if ( iMediaDetailsViewerControl )
+    {
+        iMediaDetailsViewerControl->MakeVisible(EFalse);
+        delete iMediaDetailsViewerControl;
+        iMediaDetailsViewerControl = NULL;
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackControlsController::HandleLoadingStarted
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControlsController::HandleLoadingStarted()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackControlsController::HandleLoadingStarted()"));
+
+    if ( iState != EPbStateBuffering )
+    {
+        iState = EPbStateBuffering;
+        UpdateStateOnButtonBar();
+        UpdateControlsVisibility();
+    }
+}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/src/mpxvideoplaybackmediadetailsviewer.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,1023 @@
+/*
+* 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: Media Details Viewer
+*
+*/
+
+
+// Version : %version:  ou1cpsw#19 %
+
+
+// INCLUDE FILES
+#include <eikenv.h>
+#include <eiklabel.h>
+#include <AknUtils.h>
+#include <AknIconUtils.h>
+#include <StringLoader.h>
+#include <AknsDrawUtils.h>
+#include <gulicon.h>
+#include <gdi.h>
+#include <e32base.h>
+
+#include <mpxfiledetailscntlpluginif.h>
+#include <mpxvideoplaybackcontrols.rsg>
+#include <mpxvideoplaybackcontrols.mbg>
+#include <avkon.rsg>
+
+#include "mpxvideoplaybackcontrol.hrh"
+#include "mpxcommonvideoplaybackview.hrh"
+#include "mpxvideoplaybackmediadetailsviewer.h"
+#include "mpxvideoplaybackcontrolscontroller.h"
+#include "mpxvideoplaybackcontainer.h"
+
+#include <AknTasHook.h> // For testability hooks
+
+// Constants
+_LIT(KHeadingValueSeperator, ": ");
+_LIT(KWidthHeightSeparator, " \xd7 ");
+_LIT(KLeftMargin, " " );
+
+const TInt KMediaDetailsViewerMaxItems = 11;  // used to determine the height of each item
+const TInt KMediaDetailsViewerItemMargin = 3;
+const TInt KMediaDetailsViewerVisibleCharacters = 30;
+const TInt KMediaDetailsViewerFilenameMedium = 45;
+const TInt KMediaDetailsViewerOffsetDivisorMedium = 12;
+const TInt KMediaDetailsViewerOffsetDivisorMax = 20;
+const TInt KMediaDetailsViewerMaxBufLen = 255;
+
+// UID of this interface
+const TUid KFileDetailsCntlPluginUid = {0x2002A59D};
+
+const TUint32 KScrollTimerDelayTickCounts = 2000;   // 2000 milliseconds
+const TUint32 KInvalidTick = 0;
+
+// ============================ MEMBER FUNCTIONS ===================================================
+
+CMPXVideoPlaybackMediaDetailsViewer::CMPXVideoPlaybackMediaDetailsViewer(
+    CMPXVideoPlaybackControlsController* aController )
+    : iController( aController )
+    , iDrmDetailsLaunched( EFalse )
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackMediaDetailsViewer::ConstructL()
+// Symbian 2nd phase constructor can leave.
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackMediaDetailsViewer::ConstructL()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackMediaDetailsViewer::ConstructL()"));
+
+    iViewerRect = CalculateViewerRectL();
+    SetRect( TRect(0, 0, iViewerRect.Width(), iViewerRect.Height()) );
+
+    CreateLabelsL();
+    SkinChangeL();
+
+    iBackgroundBitmap = new ( ELeave ) CFbsBitmap();
+    TSize bitmapSize = Rect().Size();
+    User::LeaveIfError( iBackgroundBitmap->Create( bitmapSize, EColor16MA ) );
+
+    iScrollingTextTimer = CPeriodic::NewL( CActive::EPriorityStandard );
+    iScrollingTextTimer->Start(
+                0,
+                175000,
+                TCallBack( CMPXVideoPlaybackMediaDetailsViewer::ScrollTimer, this ) );
+
+    AKNTASHOOK_ADDL( this, "CMPXVideoPlaybackMediaDetailsViewer" );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackMediaDetailsViewer::NewL()
+// Two-phased constructor.
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackMediaDetailsViewer* CMPXVideoPlaybackMediaDetailsViewer::NewL(
+                                                CMPXVideoPlaybackControlsController* aController )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackMediaDetailsViewer::NewL()"));
+
+    CMPXVideoPlaybackMediaDetailsViewer* self = new ( ELeave ) CMPXVideoPlaybackMediaDetailsViewer( aController );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackMediaDetailsViewer::~CMPXVideoPlaybackMediaDetailsViewer()
+// Destructor.
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackMediaDetailsViewer::~CMPXVideoPlaybackMediaDetailsViewer()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackMediaDetailsViewer::~CMPXVideoPlaybackMediaDetailsViewer()"));
+
+    AKNTASHOOK_REMOVE();
+    
+    if ( iClipnameLabel )
+    {
+        delete iClipnameLabel;
+        iClipnameLabel = NULL;
+    }
+
+    if ( iTitleLabel )
+    {
+        delete iTitleLabel;
+        iTitleLabel = NULL;
+    }
+
+    if ( iArtistLabel )
+    {
+        delete iArtistLabel;
+        iArtistLabel = NULL;
+    }
+
+    if ( iFormatLabel )
+    {
+        delete iFormatLabel;
+        iFormatLabel = NULL;
+    }
+
+    if ( iResolutionLabel )
+    {
+        delete iResolutionLabel;
+        iResolutionLabel = NULL;
+    }
+
+    if ( iDurationLabel )
+    {
+        delete iDurationLabel;
+        iDurationLabel = NULL;
+    }
+
+    if ( iBitrateLabel )
+    {
+        delete iBitrateLabel;
+        iBitrateLabel = NULL;
+    }
+
+    if ( iLicenseLabel )
+    {
+        delete iLicenseLabel;
+        iLicenseLabel = NULL;
+    }
+
+    if ( iBackgroundBitmap )
+    {
+        delete iBackgroundBitmap;
+        iBackgroundBitmap = NULL;
+    }
+
+    if ( iScrollingTextTimer )
+    {
+        iScrollingTextTimer->Cancel();
+        delete iScrollingTextTimer;
+        iScrollingTextTimer = NULL;
+    }
+
+    if ( iAdditionalLabel )
+    {
+        delete iAdditionalLabel;
+        iAdditionalLabel = NULL;
+    }
+
+    if ( iAdditionalString )
+    {
+        delete iAdditionalString;
+        iAdditionalString = NULL;
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackMediaDetailsViewer::HandlePointerEventL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackMediaDetailsViewer::HandlePointerEventL( const TPointerEvent& aPointerEvent )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackMediaDetailsViewer::HandlePointerEventL()"));
+
+    switch ( aPointerEvent.iType )
+    {
+        case TPointerEvent::EButton1Down:
+        {
+            break;
+        }
+        case TPointerEvent::EButton1Up:
+        {
+            TRect expandedRect;  //make it a bit easier to click the License label
+
+            if ( iLicenseLabel )
+            {
+                expandedRect = TRect(iLicenseLabel->Rect().iTl,
+                                     TPoint(iLicenseLabel->Rect().iBr.iX,
+                                            iLicenseLabel->Rect().iBr.iY * 2 ) );
+            }
+
+            if ( iLicenseLabel && expandedRect.Contains(aPointerEvent.iPosition) )
+            {
+                LaunchDRMDetailsL();
+            }
+            else
+            {
+                iController->HandleEventL( EMPXControlCmdCloseFileDetailsViewer );
+            }
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackMediaDetailsViewer::LaunchDRMDetailsL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackMediaDetailsViewer::LaunchDRMDetailsL()
+{
+    if ( ! iDrmDetailsLaunched )
+    {
+        iDrmDetailsLaunched = ETrue;
+        iController->iContainer->HandleCommandL( EMPXPbvLaunchDRMDetails );
+        iDrmDetailsLaunched = EFalse;
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackMediaDetailsViewer::SkinChangeL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackMediaDetailsViewer::SkinChangeL()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackMediaDetailsViewer::Draw()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackMediaDetailsViewer::Draw( const TRect& aRect ) const
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackMediaDetailsViewer::Draw()"));
+
+    CWindowGc& gc = SystemGc();
+    gc.SetClippingRect( aRect );
+
+    this->DrawableWindow()->SetCornerType(EWindowCorner5);
+
+    TRAP_IGNORE( UpdateBackgroundBitmapL() );
+    gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha );
+    gc.BitBlt( Rect().iTl, iBackgroundBitmap );
+
+    TRAP_IGNORE( FormatLabelsL() );
+
+    gc.SetBrushStyle( CGraphicsContext::ENullBrush );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackMediaDetailsViewer::FormatLabelsL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackMediaDetailsViewer::FormatLabelsL() const
+{
+    // FORMAT LABELS
+
+
+    TInt labelWidth = Rect().iBr.iX;
+    TInt labelHeight = iController->iContainer->Rect().iBr.iY / KMediaDetailsViewerMaxItems;
+    TInt rowsAdded = 0;
+
+    // License
+    if ( iController->FileDetails()->iDrmProtected )
+    {
+        iLicenseLabel->SetExtent(
+                             TPoint(Rect().iTl.iX, Rect().iTl.iY + ( labelHeight * rowsAdded) ) ,
+                             TSize( labelWidth, labelHeight )
+                             );
+        HBufC* heading  = iEikonEnv->AllocReadResourceL( R_MPX_LICENSE_HEADING );
+        CleanupStack::PushL( heading );
+
+        TBuf<KMediaDetailsViewerMaxBufLen> licenseField;
+        licenseField.Append( KLeftMargin );
+        licenseField.Append( *heading );
+        iLicenseLabel->OverrideColorL( EColorLabelText, KRgbDarkBlue );
+        iLicenseLabel->SetTextL( licenseField );
+        iLicenseLabel->SetAllMarginsTo( KMediaDetailsViewerItemMargin );
+        iLicenseLabel->SetLabelAlignment( ELayoutAlignCenter );
+        iLicenseLabel->SetUnderlining( ETrue );
+        iLicenseLabel->MakeVisible( ETrue );
+        rowsAdded++;
+
+        CleanupStack::PopAndDestroy( heading );
+    }
+
+    // Title
+    HBufC* fileTitle = iController->FileDetails()->GenerateFileTitleL();
+
+    if ( fileTitle && fileTitle->Length() )
+    {
+        // Title gets populated by UpdateTitle method
+        iTitleLabel->SetExtent(
+                          TPoint( Rect().iTl.iX, Rect().iTl.iY + ( labelHeight * rowsAdded ) ) ,
+                          TSize( labelWidth, labelHeight )
+                          );
+        iTitleLabel->SetAllMarginsTo( KMediaDetailsViewerItemMargin );
+        iTitleLabel->MakeVisible( ETrue );
+        rowsAdded++;
+    }
+
+    delete fileTitle;
+
+    // Filename
+    HBufC* fileName = iController->FileDetails()->GenerateFileNameL();
+
+    if ( fileName && fileName->Length() )
+    {
+        // file name gets populated by UpdateFilename method
+        iClipnameLabel->SetExtent(
+                             TPoint( Rect().iTl.iX, Rect().iTl.iY + ( labelHeight * rowsAdded ) ) ,
+                             TSize( labelWidth, labelHeight )
+                             );
+        iClipnameLabel->SetAllMarginsTo( KMediaDetailsViewerItemMargin );
+        iClipnameLabel->MakeVisible( ETrue );
+        rowsAdded++;
+    }
+
+    delete fileName;
+
+    // Mime Type (Format)
+    if ( iController->FileDetails()->iMimeType && iController->FileDetails()->iMimeType->Length() )
+    {
+        iFormatLabel->SetExtent(
+                          TPoint( Rect().iTl.iX, Rect().iTl.iY + ( labelHeight * rowsAdded ) ) ,
+                          TSize( labelWidth, labelHeight )
+                          );
+        HBufC* heading  = iEikonEnv->AllocReadResourceL( R_MPX_FORMAT_HEADING );
+        CleanupStack::PushL( heading );
+
+        TBuf<KMediaDetailsViewerMaxBufLen> formatField;
+        formatField.Append( KLeftMargin );
+        formatField.Append( *heading );
+        formatField.Append( KHeadingValueSeperator );
+        TInt allowLen = KMediaDetailsViewerMaxBufLen-formatField.Length();
+        formatField.Append( ( iController->FileDetails()->iMimeType )->Left( allowLen ) );
+        iFormatLabel->SetTextL( formatField );
+        iFormatLabel->SetAllMarginsTo( KMediaDetailsViewerItemMargin );
+        iFormatLabel->MakeVisible( ETrue );
+        rowsAdded++;
+
+        CleanupStack::PopAndDestroy( heading );
+    }
+
+    // Resolution
+    if ( iController->FileDetails()->iVideoHeight &&  iController->FileDetails()->iVideoWidth )
+    {
+        iResolutionLabel->SetExtent(
+                               TPoint( Rect().iTl.iX, Rect().iTl.iY + ( labelHeight * rowsAdded ) ) ,
+                               TSize( labelWidth, labelHeight )
+                               );
+        HBufC* heading  = iEikonEnv->AllocReadResourceL( R_MPX_RESOLUTION_HEADING );
+        CleanupStack::PushL( heading );
+
+        TBuf<KMediaDetailsViewerMaxBufLen> resolutionField;
+        resolutionField.Append( KLeftMargin );
+        resolutionField.Append( *heading );
+        resolutionField.Append( KHeadingValueSeperator );
+        resolutionField.AppendNum( iController->FileDetails()->iVideoWidth );
+        resolutionField.Append( KWidthHeightSeparator );
+        resolutionField.AppendNum( iController->FileDetails()->iVideoHeight);
+        AknTextUtils::DisplayTextLanguageSpecificNumberConversion( resolutionField );
+
+        iResolutionLabel->SetTextL( resolutionField );
+        iResolutionLabel->SetAllMarginsTo(KMediaDetailsViewerItemMargin);
+        iResolutionLabel->MakeVisible( ETrue );
+        rowsAdded++;
+
+        CleanupStack::PopAndDestroy( heading );
+    }
+
+    // Duration
+    if ( iController->FileDetails()->iDuration > 0 )
+    {
+        iDurationLabel->SetExtent(
+                             TPoint( Rect().iTl.iX, Rect().iTl.iY + ( labelHeight * rowsAdded) ) ,
+                             TSize( labelWidth, labelHeight )
+                             );
+        HBufC* heading  = iEikonEnv->AllocReadResourceL( R_MPX_DURATION_HEADING );
+        CleanupStack::PushL( heading );
+
+        TBuf<KMediaDetailsViewerMaxBufLen> durationField;
+        durationField.Append( KLeftMargin );
+        durationField.Append( *heading );
+        durationField.Append( KHeadingValueSeperator );
+
+        TInt64 durationInSeconds =  iController->FileDetails()->iDuration / 1000;
+
+        HBufC* unitFormatString;
+
+        if ( durationInSeconds < 3600 )  // one hour
+        {
+            unitFormatString = StringLoader::LoadLC(R_QTN_TIME_DURAT_MIN_SEC);
+        }
+        else
+        {
+            unitFormatString = StringLoader::LoadLC(R_QTN_TIME_DURAT_LONG);
+        }
+
+        TBuf<64> dur;
+        TTime durTime = TTime( durationInSeconds * 1000000 );
+        durTime.FormatL( dur, *unitFormatString );
+        AknTextUtils::DisplayTextLanguageSpecificNumberConversion( dur );
+
+        durationField.Append( dur );
+        iDurationLabel->SetTextL( durationField );
+        iDurationLabel->SetAllMarginsTo( KMediaDetailsViewerItemMargin );
+        iDurationLabel->MakeVisible( ETrue );
+        rowsAdded++;
+
+        CleanupStack::PopAndDestroy( unitFormatString ); // unitFormatString
+        CleanupStack::PopAndDestroy( heading );
+    }
+
+    // Bitrate
+    if ( iController->FileDetails()->iBitRate > 0 )
+    {
+        iBitrateLabel->SetExtent(
+                          TPoint( Rect().iTl.iX, Rect().iTl.iY + ( labelHeight * rowsAdded ) ) ,
+                          TSize( labelWidth, labelHeight )
+                          );
+        HBufC* heading  = iEikonEnv->AllocReadResourceL( R_MPX_BITRATE_HEADING );
+        CleanupStack::PushL( heading );
+
+        TBuf<KMediaDetailsViewerMaxBufLen> bitrateField;
+        bitrateField.Append( KLeftMargin );
+        bitrateField.Append( *heading );
+        bitrateField.Append( KHeadingValueSeperator );
+
+        HBufC* formattedBitrate =
+             StringLoader::LoadLC(R_MPX_BITRATE_UNITS,iController->FileDetails()->iBitRate / 1000 );
+
+        bitrateField.Append( *formattedBitrate );
+        iBitrateLabel->SetTextL( bitrateField );
+        iBitrateLabel->SetAllMarginsTo( KMediaDetailsViewerItemMargin );
+        iBitrateLabel->MakeVisible( ETrue );
+        rowsAdded++;
+
+        CleanupStack::PopAndDestroy( formattedBitrate ); // formattedBitrate
+        CleanupStack::PopAndDestroy( heading );
+    }
+
+    // Artist
+    if ( iController->FileDetails()->iArtist && iController->FileDetails()->iArtist->Length() )
+    {
+        iArtistLabel->SetExtent(
+                          TPoint( Rect().iTl.iX, Rect().iTl.iY + ( labelHeight * rowsAdded ) ) ,
+                          TSize( labelWidth, labelHeight )
+                          );
+        HBufC* heading  = iEikonEnv->AllocReadResourceL( R_MPX_ARTIST_HEADING );
+        CleanupStack::PushL( heading );
+
+        TBuf<KMediaDetailsViewerMaxBufLen> artistField;
+        artistField.Append( KLeftMargin );
+        artistField.Append( *heading );
+        artistField.Append( KHeadingValueSeperator );
+        TInt allowLen = KMediaDetailsViewerMaxBufLen-artistField.Length();
+        artistField.Append( ( iController->FileDetails()->iArtist )->Left( allowLen ) );
+        iArtistLabel->SetTextL( artistField );
+        iArtistLabel->SetAllMarginsTo( KMediaDetailsViewerItemMargin );
+        iArtistLabel->MakeVisible( ETrue );
+        rowsAdded++;
+
+        CleanupStack::PopAndDestroy( heading );
+    }
+
+    // Additional Label
+    if ( iAdditionalString && iAdditionalString->Length() )
+    {
+        iAdditionalLabel->SetExtent(
+                               TPoint( Rect().iTl.iX, Rect().iTl.iY + ( labelHeight * rowsAdded ) ) ,
+                               TSize( labelWidth, labelHeight )
+                               );
+
+        TBuf<KMediaDetailsViewerMaxBufLen> titleField;
+        titleField.Append( KLeftMargin );
+        TInt allowLen = KMediaDetailsViewerMaxBufLen-titleField.Length();
+        titleField.Append( iAdditionalString->Left( allowLen ) );
+        iAdditionalLabel->SetTextL( titleField );
+        iAdditionalLabel->SetAllMarginsTo( KMediaDetailsViewerItemMargin );
+        iAdditionalLabel->MakeVisible( ETrue );
+        rowsAdded++;
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackMediaDetailsViewer::CountComponentControls()
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMPXVideoPlaybackMediaDetailsViewer::CountComponentControls() const
+{
+    return 9;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackMediaDetailsViewer::ComponentControl
+// -------------------------------------------------------------------------------------------------
+//
+CCoeControl* CMPXVideoPlaybackMediaDetailsViewer::ComponentControl(TInt aIndex) const
+{
+    CCoeControl* control = NULL;
+
+    switch ( aIndex )
+    {
+        case 0:
+            control = iClipnameLabel;
+            break;
+        case 1:
+            control = iTitleLabel;
+            break;
+        case 2:
+            control = iArtistLabel;
+            break;
+        case 3:
+            control = iFormatLabel;
+            break;
+        case 4:
+            control = iResolutionLabel;
+            break;
+        case 5:
+            control = iDurationLabel;
+            break;
+        case 6:
+            control = iBitrateLabel;
+            break;
+        case 7:
+            control = iLicenseLabel;
+            break;
+        case 8:
+            control = iAdditionalLabel;
+            break;
+        default:
+            break;
+    }
+
+    return control;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackMediaDetailsViewer::Reset
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackMediaDetailsViewer::Reset()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackMediaDetailsViewer::CreateLabelsL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackMediaDetailsViewer::CreateLabelsL()
+{
+    // Licence / DRM
+    iLicenseLabel = new (ELeave) CEikLabel;
+    iLicenseLabel->SetContainerWindowL( *this );
+    iLicenseLabel->SetTextL( KNullDesC );
+
+    // Filename
+    iClipnameLabel = new (ELeave) CEikLabel;
+    iClipnameLabel->SetContainerWindowL( *this );
+    iClipnameLabel->SetTextL( KNullDesC );
+    iClipnameLabel->SetLabelAlignment( ELayoutAlignBidi );
+
+    // Title
+    iTitleLabel = new (ELeave) CEikLabel;
+    iTitleLabel->SetContainerWindowL( *this );
+    iTitleLabel->SetTextL( KNullDesC );
+    iTitleLabel->SetLabelAlignment( ELayoutAlignBidi );
+
+    // Artist
+    iArtistLabel = new (ELeave) CEikLabel;
+    iArtistLabel->SetContainerWindowL( *this );
+    iArtistLabel->SetTextL( KNullDesC );
+    iArtistLabel->SetLabelAlignment( ELayoutAlignBidi );
+
+    // Format
+    iFormatLabel = new (ELeave) CEikLabel;
+    iFormatLabel->SetContainerWindowL( *this );
+    iFormatLabel->SetTextL( KNullDesC );
+    iFormatLabel->SetLabelAlignment( ELayoutAlignBidi );
+
+    // Resolution
+    iResolutionLabel = new (ELeave) CEikLabel;
+    iResolutionLabel->SetContainerWindowL( *this );
+    iResolutionLabel->SetTextL( KNullDesC );
+    iResolutionLabel->SetLabelAlignment( ELayoutAlignBidi );
+
+    // Duration
+    iDurationLabel = new (ELeave) CEikLabel;
+    iDurationLabel->SetContainerWindowL( *this );
+    iDurationLabel->SetTextL( KNullDesC );
+    iDurationLabel->SetLabelAlignment( ELayoutAlignBidi );
+
+    // Bitrate
+    iBitrateLabel = new (ELeave) CEikLabel;
+    iBitrateLabel->SetContainerWindowL( *this );
+    iBitrateLabel->SetTextL( KNullDesC );
+    iBitrateLabel->SetLabelAlignment( ELayoutAlignBidi );
+
+    // Additional Labels
+    iAdditionalLabel = new (ELeave) CEikLabel;
+    iAdditionalLabel->SetContainerWindowL( *this );
+    iAdditionalLabel->SetTextL( KNullDesC );
+    iAdditionalLabel->SetLabelAlignment( ELayoutAlignBidi );
+}
+
+// -----------------------------------------------------------------------------
+// CMPXVideoPlaybackMediaDetailsViewer::UpdateBackgroundBitmapL
+// Update background bitmap
+// -----------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackMediaDetailsViewer::UpdateBackgroundBitmapL() const
+{
+    TSize bitmapSize = Rect().Size();
+
+    CFbsBitmapDevice* bgBitmapDevice = CFbsBitmapDevice::NewL( iBackgroundBitmap );
+    CleanupStack::PushL( bgBitmapDevice );
+
+    CFbsBitGc* bgBitGc( NULL );
+    User::LeaveIfError( bgBitmapDevice->CreateContext( bgBitGc ) );
+    CleanupStack::PushL( bgBitGc );
+
+    bgBitGc->SetBrushColor( TRgb(0x708090) );  // slate gray
+    bgBitGc->Clear();
+
+    CleanupStack::PopAndDestroy( bgBitGc );
+    CleanupStack::PopAndDestroy( bgBitmapDevice );
+
+    // Dither alpha channel for semitransparency
+    //
+    // Scan line length in 32-bit words
+    TInt scanLineLengthWord = CFbsBitmap::ScanLineLength( bitmapSize.iWidth, EColor16MA) / 4;
+
+    iBackgroundBitmap->LockHeap();
+    TUint32* dataAddr = reinterpret_cast<TUint32*>( iBackgroundBitmap->DataAddress() );
+
+    for ( TInt y = 0; y < bitmapSize.iHeight; y++ )
+    {
+        for ( TInt x = 0; x < bitmapSize.iWidth; x++ )
+        {
+            if ( ( y + x ) & 1 )
+            {
+                // Make this pixel transparent
+                dataAddr[y * scanLineLengthWord + x] = 0x00000000;
+            }
+        }
+    }
+
+    iBackgroundBitmap->UnlockHeap();
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackMediaDetailsViewer::ScrollTimer
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMPXVideoPlaybackMediaDetailsViewer::ScrollTimer( TAny* aPtr )
+{
+    TRAP_IGNORE(
+            static_cast<CMPXVideoPlaybackMediaDetailsViewer*>(aPtr)->HandleScrollTimerL()
+            );
+    return KErrNone;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackMediaDetailsViewer::HandleScrollTimerL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackMediaDetailsViewer::HandleScrollTimerL()
+{
+    MPX_ENTER_EXIT( _L( "CMPXVideoPlaybackMediaDetailsViewer::HandleScrollTimerL" ) );
+
+    if ( iFilenameScroller.IsUpdateNeeded() )
+    {
+        UpdateFilenameL();
+    }
+
+    if ( iTitleScroller.IsUpdateNeeded() )
+    {
+        UpdateTitleL();
+    }
+
+    if ( !iFilenameScroller.IsScrollNeeded() && !iTitleScroller.IsScrollNeeded() )
+    {
+        iScrollingTextTimer->Cancel();   // no need to keep the timer active
+    }
+
+    if ( iScrolledTextUpdated )
+    {
+        iScrolledTextUpdated = EFalse;
+        DrawNow();
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackMediaDetailsViewer::NumOfItemsShownInViewer
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMPXVideoPlaybackMediaDetailsViewer::NumOfItemsShownInViewerL()
+{
+    TInt numOfItems = 0;
+
+    if ( iController->FileDetails()->iDrmProtected )
+    {
+        numOfItems++;
+    }
+
+    if ( iController->FileDetails()->iClipName )
+    {
+        numOfItems++;
+    }
+
+    if ( iController->FileDetails()->iMimeType )
+    {
+        numOfItems++;
+    }
+
+    if ( iController->FileDetails()->iVideoHeight &&
+         iController->FileDetails()->iVideoWidth )
+    {
+        numOfItems++;
+    }
+
+    if ( iController->FileDetails()->iDuration > 0 )
+    {
+        numOfItems++;
+    }
+
+    if ( iController->FileDetails()->iBitRate > 0 )
+    {
+        numOfItems++;
+    }
+
+    HBufC* title = NULL;
+    TRAP_IGNORE ( title = iController->FileDetails()->GenerateFileTitleL() );
+
+    if ( title )
+    {
+        numOfItems++;
+        delete title;
+    }
+
+    if ( iController->FileDetails()->iArtist )
+    {
+        numOfItems++;
+    }
+
+    // Additional File Details
+    CMPXFileDetailsPlugin* addPlugin( NULL );
+
+    // Use the interface to load the ecom plugin
+    TRAPD ( err, addPlugin = CMPXFileDetailsPlugin::NewL( KFileDetailsCntlPluginUid ) );
+
+    // If plugin loaded successfully
+    if ( ! err )
+    {
+        TPtrC addLabel;
+        addLabel.Set( addPlugin->GetAdditionalLabelLC( iController->FileDetails()->iFourCCCode ) );
+        iAdditionalString = addLabel.AllocL();
+
+        if ( iAdditionalString->Length() )
+        {
+            numOfItems++;
+        }
+
+        CleanupStack::PopAndDestroy();  // addLabel
+    }
+
+    delete addPlugin;
+
+    return numOfItems;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackMediaDetailsViewer::CalculateViewerRect
+// -------------------------------------------------------------------------------------------------
+//
+TRect CMPXVideoPlaybackMediaDetailsViewer::CalculateViewerRectL()
+{
+    TInt numOfItems = NumOfItemsShownInViewerL();
+    TRect viewerRect;
+
+    // optimize viewer's width for the clipname
+    TInt horizontalOffset = 0;
+    TInt filenameLength = iController->FileDetails()->iClipName->Des().Length();
+
+    if ( filenameLength <= KMediaDetailsViewerFilenameMedium )
+    {
+        horizontalOffset =
+            iController->iContainer->Rect().iBr.iX / KMediaDetailsViewerOffsetDivisorMedium;
+    }
+    else
+    {
+        horizontalOffset =
+            iController->iContainer->Rect().iBr.iX / KMediaDetailsViewerOffsetDivisorMax;
+    }
+
+    TInt eachItemHeight = iController->iContainer->Rect().iBr.iY / KMediaDetailsViewerMaxItems;
+
+    TInt verticalHalf = iController->iContainer->Rect().iBr.iY / 2;
+
+    TInt tLX = (iController->iContainer->Rect().iTl.iX) + horizontalOffset;
+    TInt bRX = (iController->iContainer->Rect().iBr.iX) - horizontalOffset;
+
+    TInt tLY = verticalHalf - ( eachItemHeight * numOfItems/2 );
+
+    // pad for the margins on top and bottom of viewer
+    TInt bRY =
+        verticalHalf + ( eachItemHeight * numOfItems/2 ) + ( KMediaDetailsViewerItemMargin * 2 );
+
+    viewerRect = TRect( tLX, tLY, bRX, bRY );
+
+    return viewerRect;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackMediaDetailsViewer::UpdateFilenameL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackMediaDetailsViewer::UpdateFilenameL()
+{
+    MPX_ENTER_EXIT( _L( "CMPXVideoPlaybackMediaDetailsViewer::UpdateFilenameL" ) );
+
+    HBufC* fileName = iController->FileDetails()->GenerateFileNameL();
+    CleanupStack::PushL( fileName );
+
+    if ( fileName && fileName->Length() )
+    {
+        HBufC* heading  = iEikonEnv->AllocReadResourceL( R_MPX_FILENAME_HEADING );
+        CleanupStack::PushL( heading );
+
+        TBuf<KMediaDetailsViewerMaxBufLen> filenameField;
+        filenameField.Append( KLeftMargin );
+        filenameField.Append( *heading );
+        filenameField.Append( KHeadingValueSeperator );
+
+        iFilenameScroller.ScrollText( *fileName, filenameField );
+
+        iClipnameLabel->SetTextL( filenameField );
+
+        iScrolledTextUpdated = ETrue;
+
+        CleanupStack::PopAndDestroy( heading );
+    }
+
+    CleanupStack::PopAndDestroy( fileName );
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackMediaDetailsViewer::UpdateTitleL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackMediaDetailsViewer::UpdateTitleL()
+{
+    MPX_ENTER_EXIT( _L( "CMPXVideoPlaybackMediaDetailsViewer::UpdateTitleL" ) );
+
+    HBufC* fileTitle = iController->FileDetails()->GenerateFileTitleL();
+    CleanupStack::PushL( fileTitle );
+
+    if ( fileTitle && fileTitle->Length() )
+    {
+        HBufC* heading  = iEikonEnv->AllocReadResourceL( R_MPX_TITLE_HEADING );
+        CleanupStack::PushL( heading );
+
+        TBuf<KMediaDetailsViewerMaxBufLen> titleField;
+        titleField.Append( KLeftMargin );
+        titleField.Append( *heading );
+        titleField.Append( KHeadingValueSeperator );
+
+        iTitleScroller.ScrollText( *fileTitle, titleField );
+
+        iTitleLabel->SetTextL( titleField );
+
+        iScrolledTextUpdated = ETrue;
+
+        CleanupStack::PopAndDestroy( heading );
+    }
+
+    CleanupStack::PopAndDestroy( fileTitle );
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackMediaDetailsViewer::ViewerRect
+// -------------------------------------------------------------------------------------------------
+//
+TRect CMPXVideoPlaybackMediaDetailsViewer::ViewerRect()
+{
+    return iViewerRect;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackMediaDetailsViewer::TTextScroller::TTextScroller
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackMediaDetailsViewer::TTextScroller::TTextScroller()
+    : iDelayBeginningTick( KInvalidTick )
+    , iTextScrollPos( 0 )
+    , iDelay( EFalse )
+    , iScroll( ETrue )
+    , iSrcTextLen( 0 )
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackMediaDetailsViewer::TTextScroller::IsScrollNeeded
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoPlaybackMediaDetailsViewer::TTextScroller::IsScrollNeeded()
+{
+    return iScroll;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackMediaDetailsViewer::TTextScroller::IsUpdateNeeded
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoPlaybackMediaDetailsViewer::TTextScroller::IsUpdateNeeded()
+{
+    MPX_ENTER_EXIT( _L( "CMPXVideoPlaybackMediaDetailsViewer::TTextScroller::IsUpdateNeeded" ) );
+
+    // skip the scrolling operation if the loop for delay is going on
+    TBool skipForTimerDelay = EFalse;
+
+    // add a delay after each complete scrolling
+    if ( iScroll && iDelayBeginningTick != KInvalidTick )
+    {
+        if ( ( User::NTickCount() - iDelayBeginningTick ) >= KScrollTimerDelayTickCounts )
+        {
+            iDelayBeginningTick = KInvalidTick;
+        }
+        else
+        {
+            skipForTimerDelay = ETrue;
+        }
+    }
+
+    // start delay
+    if ( iScroll && !skipForTimerDelay && iDelay )
+    {
+        iDelay = EFalse;
+        iDelayBeginningTick = User::NTickCount();
+        skipForTimerDelay = ETrue;
+    }
+
+    return iScroll && !skipForTimerDelay;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackMediaDetailsViewer::TTextScroller::ScrollText
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackMediaDetailsViewer::TTextScroller::ScrollText(
+        const TDesC& aSrcText,
+        TDes& aDesText )
+{
+    MPX_ENTER_EXIT( _L( "CMPXVideoPlaybackMediaDetailsViewer::TTextScroller::ScrollText" ) );
+
+    if ( 0 == iSrcTextLen )
+    {
+        iSrcTextLen = aSrcText.Length();
+    }
+
+    ASSERT( aSrcText.Length() == iSrcTextLen );
+    if ( aSrcText.Length() >= KMediaDetailsViewerVisibleCharacters )
+    {
+        aDesText.Append( aSrcText.Mid( iTextScrollPos,
+                KMediaDetailsViewerVisibleCharacters ) );
+
+        if ( iTextScrollPos ==  ( iSrcTextLen - KMediaDetailsViewerVisibleCharacters ) )
+        {
+            iTextScrollPos = 0;
+            iDelay = ETrue;
+        }
+        else
+        {
+            iTextScrollPos++;
+        }
+        iScroll = ETrue;
+
+    }
+    else
+    {
+        aDesText.Append( aSrcText );
+        iScroll = EFalse;
+    }
+}
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/src/mpxvideoplaybackprogressbar.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,870 @@
+/*
+* 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: Progress bar control
+*
+*/
+
+
+// Version : %version: ou1cpsw#26 %
+
+
+// INCLUDE FILES
+#include <eikenv.h>
+#include <gulicon.h>
+#include <AknUtils.h>
+#include <eiklabel.h>
+#include <StringLoader.h>
+#include <AknsDrawUtils.h>
+#include <aknlayoutscalable_apps.cdl.h>
+#include <aknlayoutscalable_avkon.cdl.h>
+#include <data_caging_path_literals.hrh>
+
+#include <mpxvideoplaybackcontrols.rsg>
+#include <mpxvideoplaybackcontrols.mbg>
+
+#include "mpxcommonvideoplaybackview.hrh"
+#include "mpxvideoplaybackprogressbar.h"
+#include "mpxvideoplaybackcontrolscontroller.h"
+#include "mpxvideoplaybackviewfiledetails.h"
+#include "mpxvideo_debug.h"
+
+#ifdef RD_TACTILE_FEEDBACK
+#include <touchfeedback.h>
+#endif //RD_TACTILE_FEEDBACK
+
+#include <AknTasHook.h> // For testability hooks
+
+using namespace AknLayoutScalable_Apps;
+
+// CONSTANTS
+const TInt KMPXProgressSliderWidth = 20;
+const TInt KMPXSliderHeightOverProgresBar = 5;
+const TInt64 KMPXMicroSeconds = 1000000;
+const TInt KMPXOneHourInSeconds = 3600;
+
+const TInt KMPXProgressBarHeight = 41;
+
+// ============================ MEMBER FUNCTIONS ===================================================
+
+CMPXVideoPlaybackProgressBar::CMPXVideoPlaybackProgressBar(
+    CMPXVideoPlaybackControlsController* aController )
+    : iController( aController )
+    , iPlaybackRatio( 0.0 )
+    , iDownloadRatio( 0.0 )
+    , iDragging( EFalse )
+    , iPointerEventStarted( EFalse )
+    , iWasPlaying ( EFalse )
+    , iOldDLSize(0)
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackProgressBar::ConstructL()
+// Symbian 2nd phase constructor can leave.
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackProgressBar::ConstructL( TRect aRect )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackProgressBar::ConstructL()"));
+
+    SetRect( TRect(0, 0, aRect.Width(), aRect.Height()) );
+
+    SetLayoutL();
+    SkinChangeL();
+
+    //
+    //  Read time format strings from AVKON resource
+    //
+    iMinSecFormatString = iEikonEnv->AllocReadResourceL(R_QTN_TIME_DURAT_MIN_SEC);
+    iHourMinSecFormatString = iEikonEnv->AllocReadResourceL(R_QTN_TIME_DURAT_LONG);
+
+#ifdef RD_TACTILE_FEEDBACK
+    iFeedback = MTouchFeedback::Instance();
+#endif //RD_TACTILE_FEEDBACK
+
+    AKNTASHOOK_ADDL( this, "CMPXVideoPlaybackProgressBar" );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackProgressBar::NewL()
+// Two-phased constructor.
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackProgressBar* CMPXVideoPlaybackProgressBar::NewL(
+    CMPXVideoPlaybackControlsController* aController,
+    TRect aRect )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackProgressBar::NewL()"));
+
+    CMPXVideoPlaybackProgressBar* self =
+        new ( ELeave ) CMPXVideoPlaybackProgressBar( aController );
+
+    CleanupStack::PushL( self );
+    self->ConstructL( aRect );
+    CleanupStack::Pop();
+    return self;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackProgressBar::~CMPXVideoPlaybackProgressBar()
+// Destructor.
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackProgressBar::~CMPXVideoPlaybackProgressBar()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackProgressBar::~CMPXVideoPlaybackProgressBar()"));
+
+    AKNTASHOOK_REMOVE();
+    
+    if ( iMinSecFormatString )
+    {
+        delete iMinSecFormatString;
+        iMinSecFormatString = NULL;
+    }
+
+    if ( iHourMinSecFormatString )
+    {
+        delete iHourMinSecFormatString;
+        iHourMinSecFormatString = NULL;
+    }
+
+    if ( iLiveStreamingString )
+    {
+        delete iLiveStreamingString;
+        iLiveStreamingString = NULL;
+    }
+
+    if ( iFrameIcon )
+    {
+       delete iFrameIcon;
+       iFrameIcon = NULL;
+    }
+
+    if ( iPlaybackIcon )
+    {
+       delete iPlaybackIcon;
+       iPlaybackIcon = NULL;
+    }
+
+    if ( iDownloadIcon )
+    {
+       delete iDownloadIcon;
+       iDownloadIcon = NULL;
+    }
+
+    if ( iSliderIcon )
+    {
+       delete iSliderIcon;
+       iSliderIcon = NULL;
+    }
+
+    if ( iSelectedSliderIcon )
+    {
+       delete iSelectedSliderIcon;
+       iSelectedSliderIcon = NULL;
+    }
+
+    if ( iPositionLabel )
+    {
+        delete iPositionLabel;
+        iPositionLabel = NULL;
+    }
+
+    if ( iDurationLabel )
+    {
+        delete iDurationLabel;
+        iDurationLabel = NULL;
+    }
+
+#ifdef RD_TACTILE_FEEDBACK
+    if ( iFeedback )
+    {
+        iFeedback->RemoveFeedbackForControl( this );
+    }
+#endif //RD_TACTILE_FEEDBACK
+
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackProgressBar::HandleResourceChange()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackProgressBar::HandleResourceChange( TInt aType )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackProgressBar::HandleResourceChange(0x%X)"), aType);
+
+    if ( aType == KAknsMessageSkinChange )
+    {
+        TRAP_IGNORE( SkinChangeL() );
+    }
+
+    CCoeControl::HandleResourceChange( aType );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackProgressBar::SetLayout()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackProgressBar::SetLayoutL()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackProgressBar::SetLayoutL()"));
+
+    //
+    // Calculate icon rects
+    //
+    TRect progressRect = Rect();
+    TInt topMarginHeight = ( progressRect.iBr.iY - KMPXProgressBarHeight ) / 2 - 10;
+    progressRect.iTl.iY += topMarginHeight;
+    progressRect.iBr.iY = progressRect.iTl.iY + KMPXProgressBarHeight;
+
+    TAknLayoutRect seekBarFrameRect;
+    seekBarFrameRect.LayoutRect( progressRect, mup_progress_pane_cp04().LayoutLine() );
+
+    iFrameIconRect = seekBarFrameRect.Rect();
+
+    iSliderRect.iTl.iY = iFrameIconRect.iTl.iY - KMPXSliderHeightOverProgresBar;
+    iSliderRect.iBr.iY = iFrameIconRect.iBr.iY + KMPXSliderHeightOverProgresBar;
+
+    //
+    // Create labels
+    //
+    if ( iPositionLabel )
+    {
+        delete iPositionLabel;
+        iPositionLabel = NULL;
+    }
+
+    iPositionLabel = new (ELeave) CEikLabel;
+    AknLayoutUtils::LayoutLabel( iPositionLabel,
+                                 progressRect,
+                                 mp4_progress_pane_t1( 1 ).LayoutLine() ) ;
+
+    iPositionLabel->SetContainerWindowL( *this );
+    iPositionLabel->SetTextL( KNullDesC );
+    iPositionLabel->MakeVisible( ETrue );
+
+    if ( iDurationLabel )
+    {
+        delete iDurationLabel;
+        iDurationLabel = NULL;
+    }
+
+    iDurationLabel = new (ELeave) CEikLabel;
+
+    AknLayoutUtils::LayoutLabel( iDurationLabel,
+                                 progressRect,
+                                 mp4_progress_pane_t2( 1 ).LayoutLine() );
+
+    iDurationLabel->SetContainerWindowL( *this );
+    iDurationLabel->SetTextL( KNullDesC );
+    iDurationLabel->MakeVisible( ETrue );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackProgressBar::SkinChangeL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackProgressBar::SkinChangeL()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackProgressBar::SkinChangeL()"));
+
+    //
+    // Create icons
+    //
+    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+
+    TFileName iconsPath;
+    iController->LocateBitmapFileL( iconsPath );
+
+    delete iFrameIcon;
+    iFrameIcon = NULL;
+
+    iFrameIcon = AknsUtils::CreateGulIconL(
+        skin,
+        KAknsIIDQgnGrafMup2BarFrame,
+        iconsPath,
+        EMbmMpxvideoplaybackcontrolsQgn_graf_mup2_bar_frame,
+        EMbmMpxvideoplaybackcontrolsQgn_graf_mup2_bar_frame_mask);
+
+    if ( iFrameIcon )
+    {
+        AknIconUtils::SetSize( iFrameIcon->Bitmap(),
+                               iFrameIconRect.Size(),
+                               EAspectRatioNotPreserved );
+    }
+
+    delete iPlaybackIcon;
+    iPlaybackIcon = NULL;
+
+    iPlaybackIcon = AknsUtils::CreateGulIconL(
+        skin,
+        KAknsIIDQgnGrafMup2BarProgress2,
+        iconsPath,
+        EMbmMpxvideoplaybackcontrolsQgn_graf_mup2_bar_progress_2,
+        EMbmMpxvideoplaybackcontrolsQgn_graf_mup2_bar_progress_2_mask);
+
+    if ( iPlaybackIcon )
+    {
+        AknIconUtils::SetSize( iPlaybackIcon->Bitmap(),
+                               iFrameIconRect.Size(),
+                               EAspectRatioNotPreserved );
+    }
+
+    UpdateProgressBarStateL( iController->FileDetails() );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackProgressBar::HandlePointerEventL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackProgressBar::HandlePointerEventL( const TPointerEvent& aPointerEvent )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackProgressBar::HandlePointerEventL()"));
+
+    TMPXPlaybackState state = iController->State();
+
+    //
+    //  Block pointer events in the following cases:
+    //  - The clip is not seekable
+    //  - The state is not playing/paused
+    //  - If TV-Out is connected and the clip is DRM protected
+    //
+    if ( iController->FileDetails()->iSeekable &&
+         ( state == EPbStatePlaying || state == EPbStatePaused ) )
+    {
+        TReal ratio = (TReal) ( aPointerEvent.iPosition.iX - iFrameIconRect.iTl.iX )/
+                      (TReal)( iFrameIconRect.Width() - KMPXProgressSliderWidth );
+
+        if ( ratio > 1.0 )
+        {
+            ratio = 1.0;
+        }
+        else if ( ratio < 0.0 )
+        {
+            ratio = 0.0;
+        }
+
+        if ( aPointerEvent.iType == TPointerEvent::EButton1Down )
+        {
+            HandleButtonDownEventL( ratio );
+        }
+        else if ( aPointerEvent.iType == TPointerEvent::EDrag )
+        {
+            HandleDraggingEventL( ratio );
+        }
+        else if ( aPointerEvent.iType == TPointerEvent::EButton1Up )
+        {
+            HandleButtonUpEventL( ratio );
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackProgressBar::HandleButtonDownEventL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackProgressBar::HandleButtonDownEventL( TReal aRatio )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackProgressBar::HandleButtonDownEventL()"),
+                   _L("ratio = %f"), aRatio );
+
+    iPointerEventStarted = ETrue;
+    iWasPlaying = iController->State() == EPbStatePlaying ? ETrue : EFalse;
+
+    if ( iWasPlaying )
+    {
+        iController->HandleCommandL( EMPXPbvCmdCustomPause );
+    }
+
+#ifdef RD_TACTILE_FEEDBACK
+    if ( iFeedback )
+    {
+#ifdef SYMBIAN_BUILD_GCE
+        iFeedback->InstantFeedback( ETouchFeedbackSlider );
+#else
+        iFeedback->InstantFeedback( ETouchFeedbackBasic );
+#endif //SYMBIAN_BUILD_GCE
+    }
+#endif //RD_TACTILE_FEEDBACK
+
+    iDragging = EFalse;
+
+    //
+    //  Check for PDL using the download icon
+    //
+    if ( iDownloadIcon && ( aRatio > iDownloadRatio ) )
+    {
+        aRatio = iDownloadRatio;
+    }
+
+    PositionChangedL( aRatio * iDuration, ETrue );
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackProgressBar::HandleDraggingEventL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackProgressBar::HandleDraggingEventL( TReal aRatio )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackProgressBar::HandleDraggingEventL()"),
+                   _L("ratio = %f"), aRatio );
+
+#ifdef RD_TACTILE_FEEDBACK
+    if ( iFeedback )
+    {
+#ifdef SYMBIAN_BUILD_GCE
+        iFeedback->InstantFeedback( ETouchFeedbackSlider );
+#else
+        iFeedback->InstantFeedback( ETouchFeedbackSensitive );
+#endif //SYMBIAN_BUILD_GCE
+    }
+#endif //RD_TACTILE_FEEDBACK
+
+    iDragging = ETrue;
+
+    if ( iDownloadIcon && ( aRatio > iDownloadRatio ) )
+    {
+        aRatio = iDownloadRatio;
+    }
+
+    PositionChangedL( aRatio * iDuration, ETrue );
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackProgressBar::HandleButtonUpEventL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackProgressBar::HandleButtonUpEventL( TReal aRatio )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackProgressBar::HandleButtonUpEventL()"),
+                   _L("ratio = %f"), aRatio );
+
+    iDragging = EFalse;
+
+    if ( ( ! iDownloadIcon && aRatio == 1.0 ) ||
+         ( iDownloadIcon && aRatio == 1.0 && iDownloadRatio == 1.0 ) )
+    {
+        iController->HandleCommandL( EMPXPbvCmdEndOfClip );
+    }
+    else
+    {
+        if ( iDownloadIcon && ( aRatio >= iDownloadRatio ) )
+        {
+            aRatio = iDownloadRatio;
+        }
+
+        TInt position = (TInt)( aRatio * iDuration );
+
+        PositionChangedL( position, ETrue );
+
+        iController->HandleCommandL( EMPXPbvCmdSetPosition, position );
+
+        if ( iWasPlaying )
+        {
+            iWasPlaying = EFalse;
+            iController->HandleCommandL( EMPXPbvCmdCustomPlay );
+        }
+    }
+
+    iPointerEventStarted = EFalse;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackProgressBar::Draw()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackProgressBar::Draw( const TRect& aRect ) const
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackProgressBar::Draw()"));
+
+    CWindowGc& gc = SystemGc();
+    gc.SetClippingRect( aRect );
+
+    if ( Window().DisplayMode() == EColor16MAP )
+    {
+        gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha );
+        gc.SetBrushColor( TRgb::Color16MAP( 255 ) );
+        gc.Clear( aRect );
+    }
+    else if ( Window().DisplayMode() == EColor16MA )
+    {
+        gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha );
+        gc.SetBrushColor( TRgb::Color16MA( 0 ) );
+        gc.Clear( aRect );
+    }
+
+    //
+    // If it is live streaming, don't need to draw the progress bar
+    //
+    if ( ! iLiveStreamingString )
+    {
+        if ( iFrameIcon )
+        {
+            gc.BitBltMasked( iFrameIconRect.iTl,
+                             iFrameIcon->Bitmap(),
+                             TRect( iFrameIconRect.Size() ),
+                             iFrameIcon->Mask(),
+                             ETrue );
+        }
+
+        if ( iDownloadIcon && iDownloadRatio )
+        {
+            gc.BitBltMasked( iDownloadRect.iTl,
+                             iDownloadIcon->Bitmap(),
+                             TRect( iDownloadRect.Size() ),
+                             iDownloadIcon->Mask(),
+                             ETrue );
+        }
+
+        if ( iPlaybackIcon && iPlaybackRatio )
+        {
+            gc.BitBltMasked( iPlaybackRect.iTl,
+                             iPlaybackIcon->Bitmap(),
+                             TRect( iPlaybackRect.Size() ),
+                             iPlaybackIcon->Mask(),
+                             ETrue );
+        }
+
+        if ( iSliderIcon && iSelectedSliderIcon && iController->State() != EPbStateStopped )
+        {
+            if ( iDragging )
+            {
+                gc.BitBltMasked( iSliderRect.iTl,
+                                 iSelectedSliderIcon->Bitmap(),
+                                 TRect( iSliderRect.Size() ),
+                                 iSelectedSliderIcon->Mask(),
+                                 ETrue );
+            }
+            else
+            {
+                gc.BitBltMasked( iSliderRect.iTl,
+                                 iSliderIcon->Bitmap(),
+                                 TRect( iSliderRect.Size() ),
+                                 iSliderIcon->Mask(),
+                                 ETrue );
+            }
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackProgressBar::CountComponentControls()
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMPXVideoPlaybackProgressBar::CountComponentControls() const
+{
+    return 2;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackProgressBar::ComponentControl()
+// -------------------------------------------------------------------------------------------------
+//
+CCoeControl* CMPXVideoPlaybackProgressBar::ComponentControl( TInt aIndex ) const
+{
+    CCoeControl* control = NULL;
+
+    switch ( aIndex )
+    {
+        case 0:
+            control = iPositionLabel;
+            break;
+        case 1:
+            control = iDurationLabel;
+            break;
+        default:
+            break;
+    }
+
+    return control;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackProgressBar::DurationChangedL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackProgressBar::DurationChangedL( TInt aDuration )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackProgressBar::DurationChangedL() [%d]"), aDuration);
+
+    iDuration = aDuration;
+
+    //
+    //  In live streaming case,
+    //  Will show "live streaming" text instead of remaining time
+    //
+    if ( iLiveStreamingString )
+    {
+        iDurationLabel->SetTextL( iLiveStreamingString->Des() );
+    }
+    else
+    {
+        if ( iDuration > 0 )
+        {
+            SetTextLWithReadableTimeL( iDuration, iDurationLabel );
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackProgressBar::PositionChangedL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackProgressBar::PositionChangedL( TInt aPosition, TBool aUserChanged )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackProgressBar::PositionChangedL()"),
+                   _L("aPosition = %d, aUserChanged = %d"), aPosition, aUserChanged );
+
+    //
+    //  We will ignore position information which engine sent
+    //  after we issue SetPosition()
+    //
+    if ( aPosition == 0 ||
+         aUserChanged   ||
+         (! iPointerEventStarted && iController->State() != EPbStatePaused ) )
+    {
+        TReal position = aPosition;
+
+        if ( iDuration > 0 && position > iDuration )
+        {
+            position = iDuration;
+        }
+
+        SetTextLWithReadableTimeL( (TInt)position, iPositionLabel );
+
+        if ( ! iLiveStreamingString )
+        {
+            iPlaybackRatio = position / iDuration;
+            iPlaybackRect = iFrameIconRect;
+
+            if ( iSliderIcon )
+            {
+                iPlaybackRect.iBr.iX =
+                    KMPXProgressSliderWidth / 2 + iPlaybackRatio *
+                    ( iFrameIconRect.Width() - KMPXProgressSliderWidth );
+
+                iSliderRect.iTl.iX =
+                    iPlaybackRect.iBr.iX - KMPXProgressSliderWidth/2;
+                iSliderRect.iBr.iX =
+                    iPlaybackRect.iBr.iX + KMPXProgressSliderWidth/2;
+            }
+            else
+            {
+                iPlaybackRect.iBr.iX = iPlaybackRatio * iFrameIconRect.Width();
+            }
+        }
+
+        if ( IsVisible() )
+        {
+            DrawNow();
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackProgressBar::SetDownloadSize()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackProgressBar::SetDownloadSize( TInt aSize )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackProgressBar::SetDownloadSize() [%d]"), aSize );
+
+    iDownloadSize = aSize;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackProgressBar::UpdateDownloadPosition()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackProgressBar::UpdateDownloadPosition( TInt aSize )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackProgressBar::UpdateDownloadPosition() [%d]"), aSize );
+
+    if ( iDownloadSize  && ( aSize > iOldDLSize ) )
+    {
+        iOldDLSize = aSize;
+        iDownloadRatio = (TReal)aSize/(TReal)iDownloadSize;
+
+        iDownloadRect= iFrameIconRect;
+
+        if ( iDownloadIcon && iDownloadRatio > 0.0 )
+        {
+            iDownloadRect.iBr.iX = iDownloadRatio * iFrameIconRect.Width();
+        }
+
+        if ( IsVisible() )
+        {
+            DrawNow();
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackProgressBar::SetTextLWithReadableTimeL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackProgressBar::SetTextLWithReadableTimeL( TInt aTime, CEikLabel* aLabel )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackProgressBar::SetTextLWithReadableTimeL()"),
+                   _L("aTime = %d"), aTime );
+
+    TBuf<16> text;
+
+    TTime time = TTime( (TInt64)aTime * KMPXMicroSeconds );
+
+    if ( iDuration > 0 && iDuration < KMPXOneHourInSeconds )
+    {
+        // Format time to user readable format. (min:sec)
+        time.FormatL( text, *iMinSecFormatString );
+    }
+    else
+    {
+        // Format time to user readable format. (hour:min:sec)
+        time.FormatL( text, *iHourMinSecFormatString );
+    }
+
+    if ( AknTextUtils::DigitModeQuery( AknTextUtils::EDigitModeShownToUser ) )
+    {
+        AknTextUtils::DisplayTextLanguageSpecificNumberConversion( text );
+    }
+
+    aLabel->SetTextL( text );
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackProgressBar::UpdateProgressBarStateL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackProgressBar::UpdateProgressBarStateL( CMPXVideoPlaybackViewFileDetails* aDetails )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackProgressBar::UpdateProgressBarStateL()"));
+
+    //
+    //  Update the duration in case it has not been initialized yet
+    //
+    DurationChangedL( (TReal)aDetails->iDuration / (TReal)KPbMilliMultiplier );
+
+    TFileName iconsPath;
+    iController->LocateBitmapFileL( iconsPath );
+    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+
+    if ( aDetails->iPlaybackMode == EMPXVideoProgressiveDownload )
+    {
+        delete iDownloadIcon;
+        iDownloadIcon = NULL;
+
+        iDownloadIcon = AknsUtils::CreateGulIconL(
+            skin,
+            KAknsIIDQgnGrafMup2BarProgress,
+            iconsPath,
+            EMbmMpxvideoplaybackcontrolsQgn_graf_mup2_bar_progress,
+            EMbmMpxvideoplaybackcontrolsQgn_graf_mup2_bar_progress_mask );
+
+        if ( iDownloadIcon )
+        {
+            AknIconUtils::SetSize( iDownloadIcon->Bitmap(),
+                                   iFrameIconRect.Size(),
+                                   EAspectRatioNotPreserved );
+        }
+    }
+    else if ( aDetails->iPlaybackMode == EMPXVideoLiveStreaming &&
+              ! iLiveStreamingString )
+    {
+        iLiveStreamingString = iEikonEnv->AllocReadResourceL( R_MPX_LIVE_STREAMING );
+
+        //
+        //  update labels to show live streaming text
+        //
+        iDurationLabel->SetTextL( iLiveStreamingString->Des() );
+    }
+
+    if ( AknLayoutUtils::PenEnabled() && aDetails->iSeekable )
+    {
+        delete iSliderIcon;
+        iSliderIcon = NULL;
+
+        iSliderIcon = AknsUtils::CreateGulIconL(
+            skin,
+            KAknsIIDQgnGrafNsliderMarker,
+            iconsPath,
+            EMbmMpxvideoplaybackcontrolsQgn_graf_nslider_marker,
+            EMbmMpxvideoplaybackcontrolsQgn_graf_nslider_marker_mask );
+
+        delete iSelectedSliderIcon;
+        iSelectedSliderIcon = NULL;
+
+        iSelectedSliderIcon = AknsUtils::CreateGulIconL(
+            skin,
+            KAknsIIDQgnGrafNsliderMarkerSelected,
+            iconsPath,
+            EMbmMpxvideoplaybackcontrolsQgn_graf_nslider_marker_selected,
+            EMbmMpxvideoplaybackcontrolsQgn_graf_nslider_marker_selected_mask );
+
+        if ( iSliderIcon )
+        {
+            AknIconUtils::SetSize(
+                iSliderIcon->Bitmap(),
+                TSize( KMPXProgressSliderWidth,
+                       iFrameIconRect.Height() + KMPXSliderHeightOverProgresBar*2 ),
+                EAspectRatioNotPreserved );
+        }
+
+        if ( iSelectedSliderIcon )
+        {
+            AknIconUtils::SetSize(
+                iSelectedSliderIcon->Bitmap(),
+                TSize( KMPXProgressSliderWidth,
+                       iFrameIconRect.Height() + KMPXSliderHeightOverProgresBar*2 ),
+                EAspectRatioNotPreserved );
+        }
+    }
+    else
+    {
+        //
+        // for non-seekable media, disable iSliderIcon and iSelectedSliderIcon
+        //
+
+        if ( iSliderIcon )
+        {
+            delete iSliderIcon;
+            iSliderIcon = NULL;
+        }
+
+        if ( iSelectedSliderIcon )
+        {
+            delete iSelectedSliderIcon;
+            iSelectedSliderIcon = NULL;
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackProgressBar::Reset
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackProgressBar::Reset()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackProgressBar::Reset()"));
+
+    if ( iPointerEventStarted || iDragging )
+    {
+        TPointerEvent event;
+        event.iType = TPointerEvent::EButton1Up;
+        event.iPosition.iX = iSliderRect.iTl.iX;
+
+        MPX_TRAPD( err, HandlePointerEventL(event) );
+    }
+}
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/src/mpxvideoplaybackvolumebar.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,1052 @@
+/*
+* 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: Volume bar control
+*
+*/
+
+
+// Version : %version: ou1cpsw#28 %
+
+
+// INCLUDE FILES
+#include <eikenv.h>
+#include <gulicon.h>
+#include <gulfont.h>
+#include <AknUtils.h>
+#include <AknIconUtils.h>
+#include <StringLoader.h>
+#include <AknsDrawUtils.h>
+#include <data_caging_path_literals.hrh>
+#include <aknlayoutscalable_avkon.cdl.h>
+#include <aknlayoutscalable_apps.cdl.h>
+#include <mpxvideoplaybackcontrols.mbg>
+
+#include "mpxcommonvideoplaybackview.hrh"
+#include "mpxvideoplaybackvolumebar.h"
+#include "mpxvideoplaybackviewfiledetails.h"
+#include "mpxvideoplaybackcontrolscontroller.h"
+#include "mpxvideo_debug.h"
+
+#ifdef RD_TACTILE_FEEDBACK
+#include <touchfeedback.h>
+#endif //RD_TACTILE_FEEDBACK
+
+#include <AknTasHook.h> // For testability hooks
+
+// CONSTANTS
+const TInt KMPXSliderHeight = 30;
+const TInt KMPXSliderWidth = 18;
+const TInt KMPXVolumeDragEventTimeOut = 100000;
+const TInt KMPXPtrEventRepeatRequestTime = 200000;
+const TInt KDynamicSliderFeedbackTimeOut = 100000;
+const TInt KDynamicSliderFeedbackIntensity = 100;
+
+using namespace AknLayoutScalable_Apps;
+using namespace AknLayoutScalable_Avkon;
+
+// ============================ MEMBER FUNCTIONS ===================================================
+
+CMPXVideoPlaybackVolumeBar::CMPXVideoPlaybackVolumeBar(
+    CMPXVideoPlaybackControlsController* aController, TRect aRect )
+    : iOneVolumeIncrementHeight(0)
+    , iMuted(EFalse)
+    , iRect(aRect)
+    , iDragging(EVolumeNotDragging)
+    , iController(aController)
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackVolumeBar::ConstructL()
+// Symbian 2nd phase constructor can leave.
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackVolumeBar::ConstructL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackVolumeBar::ConstructL()"));
+
+    SetLayout();
+    SkinChangeL();
+
+    iDraggingHandlerTimer = CPeriodic::NewL( CActive::EPriorityStandard );
+
+#ifdef RD_TACTILE_FEEDBACK
+    iFeedback = MTouchFeedback::Instance();
+#endif //RD_TACTILE_FEEDBACK
+
+    AKNTASHOOK_ADDL( this, "CMPXVideoPlaybackVolumeBar" );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackVolumeBar::NewL()
+// Two-phased constructor.
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackVolumeBar* CMPXVideoPlaybackVolumeBar::NewL(
+    CMPXVideoPlaybackControlsController* aController, TRect aRect )
+{
+    CMPXVideoPlaybackVolumeBar* self =
+        new ( ELeave ) CMPXVideoPlaybackVolumeBar( aController, aRect );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackVolumeBar::~CMPXVideoPlaybackVolumeBar()
+// Destructor.
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackVolumeBar::~CMPXVideoPlaybackVolumeBar()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackVolumeBar::~CMPXVideoPlaybackVolumeBar()"));
+
+    AKNTASHOOK_REMOVE();
+    
+    if ( iDraggingHandlerTimer )
+    {
+        iDraggingHandlerTimer->Cancel();
+        delete iDraggingHandlerTimer;
+        iDraggingHandlerTimer = NULL;
+    }
+
+    if (iSpeakerIcon)
+    {
+       delete iSpeakerIcon;
+       iSpeakerIcon = NULL;
+    }
+
+    if (iSpeakerMuteIcon)
+    {
+       delete iSpeakerMuteIcon;
+       iSpeakerMuteIcon = NULL;
+    }
+
+    if (iSliderIcon)
+    {
+       delete iSliderIcon;
+       iSliderIcon = NULL;
+    }
+
+    if (iSliderSelectedIcon)
+    {
+       delete iSliderSelectedIcon;
+       iSliderSelectedIcon = NULL;
+    }
+
+    if (iVolumeUpIcon)
+    {
+       delete iVolumeUpIcon;
+       iVolumeUpIcon = NULL;
+    }
+
+    if (iVolumeDownIcon)
+    {
+       delete iVolumeDownIcon;
+       iVolumeDownIcon = NULL;
+    }
+
+    if (iVolumeFrameIconTop)
+    {
+        delete iVolumeFrameIconTop;
+        iVolumeFrameIconTop = NULL;
+    }
+
+    if (iVolumeFrameIconMiddle)
+    {
+        delete iVolumeFrameIconMiddle;
+        iVolumeFrameIconMiddle = NULL;
+    }
+
+    if (iVolumeFrameIconBottom)
+    {
+        delete iVolumeFrameIconBottom;
+        iVolumeFrameIconBottom = NULL;
+    }
+
+    if (iNoAudioIcon)
+    {
+       delete iNoAudioIcon;
+       iNoAudioIcon = NULL;
+    }
+
+#ifdef RD_TACTILE_FEEDBACK
+    if ( iFeedback )
+    {
+        iFeedback->RemoveFeedbackForControl(this);
+    }
+#endif //RD_TACTILE_FEEDBACK
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackVolumeBar::HandleResourceChange()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackVolumeBar::HandleResourceChange( TInt aType )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackVolumeBar::HandleResourceChange()"),
+                   _L("aType = 0x%X"), aType);
+
+    if ( aType == KAknsMessageSkinChange )
+    {
+        TRAP_IGNORE( SkinChangeL() );
+    }
+
+    CCoeControl::HandleResourceChange( aType );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackVolumeBar::SetLayout()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackVolumeBar::SetLayout()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackVolumeBar::SetLayout()"));
+
+    TAknLayoutRect tmpLayoutRect;
+
+    iRect = TRect( 0, 0, iRect.Width(), iRect.Height() );
+
+    tmpLayoutRect.LayoutRect( iRect, bg_popup_window_pane_cp19( 9 ).LayoutLine() );
+    iVolumeControlRect = tmpLayoutRect.Rect();
+
+
+    tmpLayoutRect.LayoutRect( iRect, aid_touch_area_slider( 6 ).LayoutLine() );
+    iVolumeBarRect = tmpLayoutRect.Rect();
+
+    tmpLayoutRect.LayoutRect( iRect, slider_pane( 6 ).LayoutLine() );
+    TRect sliderBarRect( tmpLayoutRect.Rect() );
+    TInt volumeBarEndHeight = sliderBarRect.Height() / 10;
+    iVolumeBarRectTop = TRect( sliderBarRect.iTl.iX,
+                               sliderBarRect.iTl.iY,
+                               sliderBarRect.iBr.iX,
+                               sliderBarRect.iTl.iY + volumeBarEndHeight );
+
+    iVolumeBarRectBottom = TRect( sliderBarRect.iTl.iX,
+                                  sliderBarRect.iBr.iY - volumeBarEndHeight,
+                                  sliderBarRect.iBr.iX,
+                                  sliderBarRect.iBr.iY );
+
+    iVolumeBarRectMiddle = TRect( iVolumeBarRectTop.iTl.iX,
+                                  iVolumeBarRectTop.iBr.iY,
+                                  iVolumeBarRectTop.iBr.iX,
+                                  iVolumeBarRectBottom.iTl.iY );
+
+    TInt volumeBarMiddleX = sliderBarRect.iTl.iX + sliderBarRect.Width() / 2;
+    iSliderRect = TRect( volumeBarMiddleX - KMPXSliderWidth / 2,
+                         sliderBarRect.iBr.iY - KMPXSliderHeight,
+                         volumeBarMiddleX + KMPXSliderWidth / 2,
+                         sliderBarRect.iBr.iY );
+
+    tmpLayoutRect.LayoutRect( iRect, aid_touch_area_increase( 6 ).LayoutLine() );
+    iVolumeUpControlRect = tmpLayoutRect.Rect();
+
+    tmpLayoutRect.LayoutRect( iRect, aid_touch_area_decrease( 6 ).LayoutLine() );
+    iVolumeDownControlRect = tmpLayoutRect.Rect();
+
+    tmpLayoutRect.LayoutRect( iRect, popup_slider_window_g4( 6 ).LayoutLine() );
+    iVolumeUpRect = tmpLayoutRect.Rect();
+
+    tmpLayoutRect.LayoutRect( iRect, popup_slider_window_g5( 6 ).LayoutLine() );
+    iVolumeDownRect = tmpLayoutRect.Rect();
+
+    tmpLayoutRect.LayoutRect( iRect, aid_touch_area_mute( 4 ).LayoutLine() );
+    iSpeakerControlRect = tmpLayoutRect.Rect();
+
+    tmpLayoutRect.LayoutRect( iRect, popup_slider_window_g6( 2 ).LayoutLine() );
+    iSpeakerRect = tmpLayoutRect.Rect();
+
+    iOneVolumeIncrementHeight = (TReal)( iVolumeBarRect.Height() - KMPXSliderHeight )
+                                / (TReal)KPbPlaybackVolumeLevelMax;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackVolumeBar::SkinChangeL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackVolumeBar::SkinChangeL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackVolumeBar::SkinChangeL()"));
+
+    //
+    // Create icons
+    //
+    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+
+    TFileName iconsPath;
+    iController->LocateBitmapFileL( iconsPath );
+
+    CreateSliderIconsL();
+    
+    delete iSpeakerIcon;
+    iSpeakerIcon = NULL;
+    iSpeakerIcon = AknsUtils::CreateGulIconL(
+            skin,
+            KAknsIIDQgnIndiNsliderUnmuted,
+            iconsPath,
+            EMbmMpxvideoplaybackcontrolsQgn_indi_nslider_unmuted,
+            EMbmMpxvideoplaybackcontrolsQgn_indi_nslider_unmuted_mask );
+
+    if ( iSpeakerIcon )
+    {
+        AknIconUtils::SetSize( iSpeakerIcon->Bitmap(),
+                               iSpeakerRect.Size(),
+                               EAspectRatioPreserved );
+    }
+
+    delete iSpeakerMuteIcon;
+    iSpeakerMuteIcon = NULL;
+    iSpeakerMuteIcon = AknsUtils::CreateGulIconL(
+            skin,
+            KAknsIIDQgnIndiNsliderMuted,
+            iconsPath,
+            EMbmMpxvideoplaybackcontrolsQgn_indi_nslider_muted,
+            EMbmMpxvideoplaybackcontrolsQgn_indi_nslider_muted_mask );
+
+
+    if ( iSpeakerMuteIcon )
+    {
+        AknIconUtils::SetSize( iSpeakerMuteIcon->Bitmap(),
+                               iSpeakerRect.Size(),
+                               EAspectRatioPreserved );
+    }
+
+    delete iNoAudioIcon;
+    iNoAudioIcon = NULL;
+    iNoAudioIcon = AknsUtils::CreateGulIconL(
+            skin,
+            KAknsIIDQgnGrafMupLstCorrupttrack,
+            iconsPath,
+            EMbmMpxvideoplaybackcontrolsQgn_graf_mup_lst_corrupttrack,
+            EMbmMpxvideoplaybackcontrolsQgn_graf_mup_lst_corrupttrack_mask );
+
+
+    if ( iNoAudioIcon )
+    {
+        AknIconUtils::SetSize( iNoAudioIcon->Bitmap(),
+                               iSpeakerRect.Size(),
+                               EAspectRatioPreserved );
+    }
+
+    delete iVolumeUpIcon;
+    iVolumeUpIcon = NULL;
+    iVolumeUpIcon = AknsUtils::CreateGulIconL(
+            skin,
+            KAknsIIDQgnIndiCam4ZoomMax,
+            iconsPath,
+            EMbmMpxvideoplaybackcontrolsQgn_indi_nslider_level_increase,
+            EMbmMpxvideoplaybackcontrolsQgn_indi_nslider_level_increase_mask );
+
+    if ( iVolumeUpIcon )
+    {
+        AknIconUtils::SetSize( iVolumeUpIcon->Bitmap(),
+                               iVolumeUpRect.Size(),
+                               EAspectRatioPreserved );
+    }
+
+    delete iVolumeDownIcon;
+    iVolumeDownIcon = NULL;
+    iVolumeDownIcon = AknsUtils::CreateGulIconL(
+            skin,
+            KAknsIIDQgnIndiCam4ZoomMin,
+            iconsPath,
+            EMbmMpxvideoplaybackcontrolsQgn_indi_nslider_level_decrease,
+            EMbmMpxvideoplaybackcontrolsQgn_indi_nslider_level_decrease_mask );
+
+    if ( iVolumeDownIcon )
+    {
+        AknIconUtils::SetSize( iVolumeDownIcon->Bitmap(),
+                               iVolumeDownRect.Size(),
+                               EAspectRatioPreserved );
+    }
+
+    delete iVolumeFrameIconTop;
+    iVolumeFrameIconTop = NULL;
+    iVolumeFrameIconTop = AknsUtils::CreateGulIconL(
+            skin,
+            KAknsIIDQgnIndiCam4ZoomTop,
+            iconsPath,
+            EMbmMpxvideoplaybackcontrolsQgn_graf_nslider_vertical_top,
+            EMbmMpxvideoplaybackcontrolsQgn_graf_nslider_vertical_top_mask );
+
+    if ( iVolumeFrameIconTop )
+    {
+        AknIconUtils::SetSize( iVolumeFrameIconTop->Bitmap(),
+                               TSize( iVolumeBarRectTop.Width(), iVolumeBarRectTop.Height() ),
+                               EAspectRatioNotPreserved );
+    }
+
+    delete iVolumeFrameIconMiddle;
+    iVolumeFrameIconMiddle = NULL;
+    iVolumeFrameIconMiddle = AknsUtils::CreateGulIconL(
+            skin,
+            KAknsIIDQgnIndiCam4ZoomMiddle,
+            iconsPath,
+            EMbmMpxvideoplaybackcontrolsQgn_graf_nslider_vertical_middle,
+            EMbmMpxvideoplaybackcontrolsQgn_graf_nslider_vertical_middle_mask );
+
+    if ( iVolumeFrameIconMiddle )
+    {
+        AknIconUtils::SetSize( iVolumeFrameIconMiddle->Bitmap(),
+                               TSize( iVolumeBarRectMiddle.Width(), iVolumeBarRectMiddle.Height() ),
+                               EAspectRatioNotPreserved );
+    }
+
+    delete iVolumeFrameIconBottom;
+    iVolumeFrameIconBottom = NULL;
+    iVolumeFrameIconBottom = AknsUtils::CreateGulIconL(
+            skin,
+            KAknsIIDQgnIndiCam4ZoomBottom,
+            iconsPath,
+            EMbmMpxvideoplaybackcontrolsQgn_graf_nslider_vertical_bottom,
+            EMbmMpxvideoplaybackcontrolsQgn_graf_nslider_vertical_bottom_mask );
+
+    if ( iVolumeFrameIconBottom )
+    {
+        AknIconUtils::SetSize( iVolumeFrameIconBottom->Bitmap(),
+                               TSize( iVolumeBarRectBottom.Width(), iVolumeBarRectBottom.Height() ),
+                               EAspectRatioNotPreserved );
+    }
+
+    // Calculate the X coordinate to center the icon of sliderbar
+    TRect volumeBarRectPart;
+    CGulIcon* volumeFrameIconPart = NULL;
+
+    if ( iVolumeFrameIconTop )
+    {
+        volumeFrameIconPart = iVolumeFrameIconTop;
+        volumeBarRectPart = iVolumeBarRectTop;
+    }
+    else if ( iVolumeFrameIconMiddle )
+    {
+        volumeFrameIconPart = iVolumeFrameIconMiddle;
+        volumeBarRectPart = iVolumeBarRectMiddle;
+    }
+    else if ( iVolumeFrameIconBottom )
+    {
+        volumeFrameIconPart = iVolumeFrameIconBottom;
+        volumeBarRectPart = iVolumeBarRectBottom;
+    }
+
+    if ( volumeFrameIconPart )
+    {
+        iCenteredSliderbarIconX = volumeBarRectPart.iTl.iX +
+            ( volumeBarRectPart.Width() -
+              volumeFrameIconPart->Bitmap()->SizeInPixels().iWidth ) / 2;
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackVolumeBar::HandleVolumeIncreaseL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackVolumeBar::HandleVolumeIncreaseL( const TPointerEvent& aPointerEvent )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackVolumeBar::HandleVolumeIncreaseL()"),
+                   _L("aPointerEvent.iType = %d"), aPointerEvent.iType);
+
+    switch ( aPointerEvent.iType )
+    {
+        case TPointerEvent::EButtonRepeat:
+        {
+#ifdef RD_TACTILE_FEEDBACK
+            if ( iFeedback && !iController->FileDetails()->iTvOutConnected )
+            {
+                iFeedback->InstantFeedback( ETouchFeedbackSlider );
+            }
+#endif //RD_TACTILE_FEEDBACK
+            iController->HandleCommandL( EMPXPbvCmdIncreaseVolume );
+            iDragging = EVolumeIncreaseDragging;
+
+        }
+        case TPointerEvent::EButton1Down:
+        {
+            Window().RequestPointerRepeatEvent(
+                         TTimeIntervalMicroSeconds32(KMPXPtrEventRepeatRequestTime)
+                         ,iVolumeUpControlRect);
+
+            break;
+        }
+        case TPointerEvent::EDrag:
+        {
+            iDragging = EVolumeIncreaseDragging;
+            break;
+        }
+        case TPointerEvent::EButton1Up:
+        {
+#ifdef RD_TACTILE_FEEDBACK
+            if ( iFeedback && !iController->FileDetails()->iTvOutConnected )
+            {
+                iFeedback->InstantFeedback( ETouchFeedbackSlider );
+            }
+#endif //RD_TACTILE_FEEDBACK
+
+            iController->HandleCommandL( EMPXPbvCmdIncreaseVolume );
+
+            iDragging = EVolumeNotDragging;
+
+            break;
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackVolumeBar::HandleVolumeDecreaseL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackVolumeBar::HandleVolumeDecreaseL( const TPointerEvent& aPointerEvent )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackVolumeBar::HandleVolumeDecreaseL()"),
+                   _L("aPointerEvent.iType = %d"), aPointerEvent.iType);
+
+    switch ( aPointerEvent.iType )
+    {
+        case TPointerEvent::EButtonRepeat:
+        {
+#ifdef RD_TACTILE_FEEDBACK
+            if ( iFeedback && !iController->FileDetails()->iTvOutConnected )
+            {
+                iFeedback->InstantFeedback( ETouchFeedbackSlider );
+            }
+#endif //RD_TACTILE_FEEDBACK
+            iController->HandleCommandL( EMPXPbvCmdDecreaseVolume );
+            iDragging = EVolumeDecreaseDragging;
+
+        }
+        case TPointerEvent::EButton1Down:
+        {
+            Window().RequestPointerRepeatEvent(
+                         TTimeIntervalMicroSeconds32(KMPXPtrEventRepeatRequestTime)
+                         ,iVolumeDownControlRect);
+
+            break;
+        }
+        case TPointerEvent::EDrag:
+        {
+            iDragging = EVolumeDecreaseDragging;
+            break;
+        }
+        case TPointerEvent::EButton1Up:
+        {
+#ifdef RD_TACTILE_FEEDBACK
+            if ( iFeedback && !iController->FileDetails()->iTvOutConnected )
+            {
+                iFeedback->InstantFeedback( ETouchFeedbackSlider );
+            }
+#endif //RD_TACTILE_FEEDBACK
+
+            iController->HandleCommandL( EMPXPbvCmdDecreaseVolume );
+
+            iDragging = EVolumeNotDragging;
+
+            break;
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackVolumeBar::HandleSpeakerControlEventL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackVolumeBar::HandleSpeakerControlEventL( const TPointerEvent& aPointerEvent )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackVolumeBar::HandleSpeakerControlEventL()"),
+                   _L("aPointerEvent.iType = %d"), aPointerEvent.iType);
+
+    switch ( aPointerEvent.iType )
+    {
+        case TPointerEvent::EButton1Up:
+        {
+#ifdef RD_TACTILE_FEEDBACK
+            if ( iFeedback )
+            {
+                iFeedback->InstantFeedback( ETouchFeedbackBasicButton );
+            }
+#endif //RD_TACTILE_FEEDBACK
+
+            if ( iMuted )
+            {
+                iController->HandleCommandL( EMPXPbvCmdUnMute );
+            }
+            else
+            {
+                iController->HandleCommandL( EMPXPbvCmdMute );
+            }
+
+            iDragging = EVolumeNotDragging;
+
+            break;
+        }
+        case TPointerEvent::EDrag:
+        {
+            iDragging = EVolumeSpeakerDragging;
+
+            break;
+        }
+        case TPointerEvent::EButton1Down:
+        {
+            iDragging = EVolumeNotDragging;
+
+            break;
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackVolumeBar::HandleVolumeBarEventL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackVolumeBar::HandleVolumeBarEventL( const TPointerEvent& aPointerEvent )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackVolumeBar::HandleVolumeBarEventL()"),
+                   _L("aPointerEvent.iType = %d"), aPointerEvent.iType);
+
+    TInt vol = 0;
+
+    //
+    //  Dynamic Slider Feedback should only be given when the slider is not at the top or bottom
+    //
+    TBool giveDynamicSliderFeedback = EFalse;
+
+    if ( aPointerEvent.iPosition.iY < iVolumeBarRect.iTl.iY + KMPXSliderHeight / 2 )
+    {
+        vol = KPbPlaybackVolumeLevelMax;
+    }
+    else if ( aPointerEvent.iPosition.iY > iVolumeBarRect.iBr.iY - KMPXSliderHeight / 2 )
+    {
+        vol = 0;
+    }
+    else
+    {
+        giveDynamicSliderFeedback = ETrue;
+
+        vol = ( iVolumeBarRect.iBr.iY - KMPXSliderHeight / 2 - aPointerEvent.iPosition.iY ) /
+              iOneVolumeIncrementHeight;
+    }
+
+    switch ( aPointerEvent.iType )
+    {
+        case TPointerEvent::EButton1Down:
+        {
+#ifdef RD_TACTILE_FEEDBACK
+            if ( iFeedback && !iController->FileDetails()->iTvOutConnected )
+            {
+                iFeedback->InstantFeedback( ETouchFeedbackSlider );
+            }
+#endif //RD_TACTILE_FEEDBACK
+
+            if ( ! iDraggingHandlerTimer->IsActive() )
+            {
+                iDraggingHandlerTimer->Start(
+                    KMPXVolumeDragEventTimeOut,
+                    KMPXVolumeDragEventTimeOut,
+                    TCallBack( CMPXVideoPlaybackVolumeBar::HandleVolumeDragEventTimeOut, this ) );
+            }
+
+            iDragging = EVolumeNotDragging;
+
+            break;
+        }
+        case TPointerEvent::EDrag:
+        {
+#ifdef RD_TACTILE_FEEDBACK
+            if ( iFeedback && giveDynamicSliderFeedback && 
+                 !iController->FileDetails()->iTvOutConnected )
+            {
+                iFeedback->StartFeedback( this,
+                                          ETouchDynamicSlider,
+                                          &aPointerEvent,
+                                          KDynamicSliderFeedbackIntensity,
+                                          KDynamicSliderFeedbackTimeOut );
+            }
+#endif //RD_TACTILE_FEEDBACK
+
+            iVolumeWhileDraggingEvent = vol;
+            iDragging = EVolumeBarDragging;
+
+            break;
+        }
+        case TPointerEvent::EButton1Up:
+        {
+            if ( iDraggingHandlerTimer->IsActive() )
+            {
+                iDraggingHandlerTimer->Cancel();
+            }
+
+            SetVolumeL( vol );
+
+            if ( iDragging == EVolumeBarDragging && vol == 0 )
+            {
+                //
+                // volume & mute levels are kept track in playbackplugin.
+                //
+                iController->HandleCommandL( EMPXPbvCmdMute );
+            }
+
+            iDragging = EVolumeNotDragging;
+
+            if ( IsVisible() )
+            {
+                DrawNow();
+            }
+
+            break;
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackVolumeBar::HandleVolumeDragEventTimeOut
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMPXVideoPlaybackVolumeBar::HandleVolumeDragEventTimeOut( TAny* aPtr )
+{
+    static_cast<CMPXVideoPlaybackVolumeBar*>(aPtr)->DoHandleVolumeDragEventTimeOut();
+    return KErrNone;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackVolumeBar::DoHandleVolumeDragEventTimeOut
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackVolumeBar::DoHandleVolumeDragEventTimeOut()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::DoHandleVolumeDragEventTimeOut()"));
+
+    if ( iDragging == EVolumeBarDragging )
+    {
+        MPX_TRAPD( err, SetVolumeL( iVolumeWhileDraggingEvent ) );
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackVolumeBar::HandlePointerEventL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackVolumeBar::HandlePointerEventL( const TPointerEvent& aPointerEvent )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackVolumeBar::HandlePointerEventL()"));
+
+    if ( iController->FileDetails()->iAudioEnabled )
+    {
+        //
+        //  Volume up
+        //
+        if ( iDragging == EVolumeIncreaseDragging ||
+             ( iVolumeUpControlRect.Contains( aPointerEvent.iPosition ) &&
+               iDragging == EVolumeNotDragging ) )
+        {
+            HandleVolumeIncreaseL( aPointerEvent );
+        }
+        //
+        // Volume down
+        //
+        else if ( iDragging == EVolumeDecreaseDragging ||
+                  ( iVolumeDownControlRect.Contains( aPointerEvent.iPosition ) &&
+                    iDragging == EVolumeNotDragging ) )
+        {
+            HandleVolumeDecreaseL( aPointerEvent );
+        }
+        //
+        // Speaker/Mute
+        //
+        else if ( iDragging == EVolumeSpeakerDragging ||
+                  ( iSpeakerControlRect.Contains( aPointerEvent.iPosition ) &&
+                    iDragging == EVolumeNotDragging ) )
+        {
+            HandleSpeakerControlEventL( aPointerEvent );
+        }
+        //
+        // Volume Bar
+        //
+        else
+        {
+            HandleVolumeBarEventL( aPointerEvent );
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackVolumeBar::Draw()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackVolumeBar::Draw( const TRect& aRect ) const
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackVolumeBar::Draw()"));
+
+    CWindowGc& gc = SystemGc();
+    gc.SetClippingRect( aRect );
+
+    if ( Window().DisplayMode() == EColor16MAP )
+    {
+        gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha );
+        gc.SetBrushColor( TRgb::Color16MAP( 255 ) );
+        gc.Clear( aRect );
+    }
+    else if ( Window().DisplayMode() == EColor16MA )
+    {
+        gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha );
+        gc.SetBrushColor( TRgb::Color16MA( 0 ) );
+        gc.Clear( aRect );
+    }
+
+    if ( ! iController->FileDetails()->iAudioEnabled || iMuted )
+    {
+        if ( iController->FileDetails()->iAudioEnabled )
+        {
+            //
+            // use "Mute" icon for media clip with audio supported
+            //
+            gc.BitBltMasked( iSpeakerRect.iTl,
+                             iSpeakerMuteIcon->Bitmap(),
+                             TRect(iSpeakerRect.Size()),
+                             iSpeakerMuteIcon->Mask(),
+                             ETrue );
+        }
+        else
+        {
+            //
+            // use "No Audio" icon instead of the generic "Mute" icon
+            // for media clip with audio not supported
+            //
+            gc.BitBltMasked( iSpeakerRect.iTl,
+                             iNoAudioIcon->Bitmap(),
+                             TRect(iSpeakerRect.Size()),
+                             iNoAudioIcon->Mask(),
+                             ETrue );
+        }
+    }
+    else
+    {
+        gc.BitBltMasked( iSpeakerRect.iTl,
+                         iSpeakerIcon->Bitmap(),
+                         TRect(iSpeakerRect.Size()),
+                         iSpeakerIcon->Mask(),
+                         ETrue );
+    }
+
+    if ( iVolumeUpIcon )
+    {
+        gc.BitBltMasked( iVolumeUpRect.iTl,
+                         iVolumeUpIcon->Bitmap(),
+                         TRect(iVolumeUpRect.Size()),
+                         iVolumeUpIcon->Mask(),
+                         ETrue );
+    }
+
+    if ( iVolumeDownIcon )
+    {
+        gc.BitBltMasked( iVolumeDownRect.iTl,
+                         iVolumeDownIcon->Bitmap(),
+                         TRect(iVolumeDownRect.Size()),
+                         iVolumeDownIcon->Mask(),
+                         ETrue );
+    }
+
+    TPoint srcPoint( iCenteredSliderbarIconX, 0 );
+    if ( iVolumeFrameIconTop )
+    {
+        srcPoint.iY = iVolumeBarRectTop.iTl.iY;
+        gc.BitBltMasked( srcPoint,
+                         iVolumeFrameIconTop->Bitmap(),
+                         TRect(iVolumeBarRectTop.Size()),
+                         iVolumeFrameIconTop->Mask(),
+                         ETrue );
+    }
+
+    if ( iVolumeFrameIconMiddle )
+    {
+        srcPoint.iY = iVolumeBarRectMiddle.iTl.iY;
+        gc.BitBltMasked( srcPoint,
+                         iVolumeFrameIconMiddle->Bitmap(),
+                         TRect(iVolumeBarRectMiddle.Size()),
+                         iVolumeFrameIconMiddle->Mask(),
+                         ETrue );
+    }
+
+    if ( iVolumeFrameIconBottom )
+    {
+        srcPoint.iY = iVolumeBarRectBottom.iTl.iY;
+        gc.BitBltMasked( srcPoint,
+                         iVolumeFrameIconBottom->Bitmap(),
+                         TRect(iVolumeBarRectBottom.Size()),
+                         iVolumeFrameIconBottom->Mask(),
+                         ETrue );
+    }
+
+    if ( iController->FileDetails() &&
+         iController->FileDetails()->iAudioEnabled &&
+         !iController->FileDetails()->iTvOutConnected &&
+         iSliderIcon &&
+         iSliderSelectedIcon )
+    {
+        if ( iDragging == EVolumeBarDragging )
+        {
+            gc.BitBltMasked( iSliderRect.iTl,
+                             iSliderSelectedIcon->Bitmap(),
+                             TRect(iSliderRect.Size()),
+                             iSliderSelectedIcon->Mask(),
+                             ETrue );
+        }
+        else
+        {
+            gc.BitBltMasked( iSliderRect.iTl,
+                             iSliderIcon->Bitmap(),
+                             TRect(iSliderRect.Size()),
+                             iSliderIcon->Mask(),
+                             ETrue );
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackVolumeBar::CountComponentControls()
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMPXVideoPlaybackVolumeBar::CountComponentControls() const
+{
+    return 0;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackVolumeBar::VolumeChanged()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackVolumeBar::VolumeChanged( TInt aVolume )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackVolumeBar::VolumeChanged() [%d]"), aVolume);
+
+    iMuted = (aVolume == 0)? ETrue:EFalse;
+
+    TReal volumeBarHeight = (TReal)iVolumeBarRect.iBr.iY -
+                            iOneVolumeIncrementHeight * (TReal)aVolume;
+
+    iSliderRect.iTl.iY = volumeBarHeight - KMPXSliderHeight;
+    iSliderRect.iBr.iY = volumeBarHeight;
+
+    if ( IsVisible() )
+    {
+        DrawNow();
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackVolumeBar::Reset
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackVolumeBar::Reset()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackVolumeBar::Reset()"));
+
+    if ( iDragging != EVolumeNotDragging )
+    {
+        TPointerEvent event;
+        event.iType = TPointerEvent::EButton1Up;
+        event.iPosition.iY = ( iSliderRect.iTl.iY + iSliderRect.iBr.iY ) / 2;
+
+        MPX_TRAPD( err, HandlePointerEventL(event) );
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackVolumeBar::SetVolumeL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackVolumeBar::SetVolumeL( TInt aVolume )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackVolumeBar::SetVolumeL()"),
+                   _L("aVolume = %d"), aVolume );
+
+    iController->HandleCommandL( EMPXPbvCmdSetVolume, aVolume );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackVolumeBar::UpdateTVOutStatus()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackVolumeBar::UpdateTVOutStatusL( TBool aConnected )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackVolumeBar::UpdateTVOutStatus()"));
+    
+    if ( aConnected )
+    {
+        if ( iSliderIcon )
+        {
+            delete iSliderIcon;
+            iSliderIcon = NULL;
+        }
+        
+        if ( iSliderSelectedIcon )
+        {
+            delete iSliderSelectedIcon;
+            iSliderSelectedIcon = NULL;
+        }
+    }
+    else
+    {
+        CreateSliderIconsL();
+    }  
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackVolumeBar::CreateSliderIconsL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackVolumeBar::CreateSliderIconsL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackVolumeBar::CreateSliderIconsL()"));
+    
+    //
+    // Create icons
+    //
+    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+    
+    TFileName iconsPath;
+    iController->LocateBitmapFileL( iconsPath );
+    
+    delete iSliderIcon;
+    iSliderIcon = NULL;
+    iSliderIcon = AknsUtils::CreateGulIconL(
+            skin,
+            KAknsIIDQgnGrafNsliderVerticalMarker,
+            iconsPath,
+            EMbmMpxvideoplaybackcontrolsQgn_graf_nslider_vertical_marker,
+            EMbmMpxvideoplaybackcontrolsQgn_graf_nslider_vertical_marker_mask );
+    
+    if ( iSliderIcon )
+    {
+        AknIconUtils::SetSize( iSliderIcon->Bitmap(),
+                               TSize(KMPXSliderWidth, KMPXSliderHeight),
+                               EAspectRatioNotPreserved );
+    }
+    
+    delete iSliderSelectedIcon;
+    iSliderSelectedIcon = NULL;
+    iSliderSelectedIcon = AknsUtils::CreateGulIconL(
+            skin,
+            KAknsIIDQgnGrafNsliderVerticalMarkerSelected,
+            iconsPath,
+            EMbmMpxvideoplaybackcontrolsQgn_graf_nslider_vertical_marker_selected,
+            EMbmMpxvideoplaybackcontrolsQgn_graf_nslider_vertical_marker_selected_mask );
+    
+    if ( iSliderSelectedIcon )
+    {
+        AknIconUtils::SetSize( iSliderSelectedIcon->Bitmap(),
+                               TSize(KMPXSliderWidth, KMPXSliderHeight),
+                               EAspectRatioNotPreserved );
+    }
+}
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/bwins/ui_videoplaybackcontrolstestu.def	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,11 @@
+EXPORTS
+	?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * LibEntryL(class CTestModuleIf &)
+	??1CMPXVideoPlaybackControlsController@@UAE@XZ @ 2 NONAME ; CMPXVideoPlaybackControlsController::~CMPXVideoPlaybackControlsController(void)
+	?AddFileDetailsL@CMPXVideoPlaybackControlsController@@QAEXPAVCMPXVideoPlaybackViewFileDetails@@@Z @ 3 NONAME ; void CMPXVideoPlaybackControlsController::AddFileDetailsL(class CMPXVideoPlaybackViewFileDetails *)
+	?DoHandlePointerEventL@CMPXVideoPlaybackControl@@QAEXABUTPointerEvent@@@Z @ 4 NONAME ; void CMPXVideoPlaybackControl::DoHandlePointerEventL(struct TPointerEvent const &)
+	?GetBitmap@CMPXVideoPlaybackControlsController@@QAEPAVCEikImage@@W4TMPXVideoPlaybackControls@@@Z @ 5 NONAME ; class CEikImage * CMPXVideoPlaybackControlsController::GetBitmap(enum TMPXVideoPlaybackControls)
+	?HandleEventL@CMPXVideoPlaybackControlsController@@QAEXW4TMPXVideoPlaybackControlCommandIds@@H@Z @ 6 NONAME ; void CMPXVideoPlaybackControlsController::HandleEventL(enum TMPXVideoPlaybackControlCommandIds, int)
+	?NewL@CMPXVideoPlaybackControlsController@@SAPAV1@PAVCMPXVideoPlaybackContainer@@VTRect@@PAVCMPXVideoPlaybackViewFileDetails@@@Z @ 7 NONAME ; class CMPXVideoPlaybackControlsController * CMPXVideoPlaybackControlsController::NewL(class CMPXVideoPlaybackContainer *, class TRect, class CMPXVideoPlaybackViewFileDetails *)
+	?GenerateFileNameL@CMPXVideoPlaybackViewFileDetails@@QAEPAVHBufC16@@XZ @ 8 NONAME ; class HBufC16 * CMPXVideoPlaybackViewFileDetails::GenerateFileNameL(void)
+	?GenerateFileTitleL@CMPXVideoPlaybackViewFileDetails@@QAEPAVHBufC16@@XZ @ 9 NONAME ; class HBufC16 * CMPXVideoPlaybackViewFileDetails::GenerateFileTitleL(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/conf/ui_videoplaybackcontrolstest.cfg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,855 @@
+[Define]
+EMPXPbvCmdShowFileDetails 8217
+EAknSoftkeyBack 3001
+EMPXPbvCmdPlay 8192
+EMPXPbvCmdPause 8193
+EMPXPbvCmdPlayPause 8194
+EMPXPbvCmdSetVolume 8197
+EMPXPbvCmdMute 8198
+EMPXPbvCmdUnMute 8199
+EMPXPbvCmdSetPosition 8200
+EMPXPbvCmdNaturalAspectRatio 8202
+EMPXPbvCmdZoomAspectRatio 8203
+EMPXPbvCmdStretchAspectRatio 8204
+EMPXPbvCmdSeekForward 8205
+EMPXPbvCmdSeekBackward 8206
+EMPXPbvCmdEndSeek 8207
+EMPXPbvCmdDecreaseVolume 8210
+EMPXPbvCmdIncreaseVolume 8211
+EMPXPbvCmdCustomPause 8219
+EMPXPbvCmdCustomPlay 8220
+
+EMPXControlCmdSetDownloadSize 14
+
+EPbStateInitialising 1
+EPbStatePlaying 2
+EPbStatePaused 3
+EPbStateBuffering 8
+EPbStateInitialised 10
+
+EMMFNatural 2
+
+EMPXVideoLocal 0
+EMPXVideoStreaming 1
+EMPXVideoLiveStreaming 2
+EMPXVideoProgressiveDownload 3
+
+EStdKeyDevice0 164
+EStdKeyDevice1 165
+
+[Enddefine]
+
+
+[Test]
+title [1]Tap on back softkey
+bringtoforeground
+create ui_videoplaybackcontrolstest ControlsTest
+ControlsTest CreateControls test.3gp EMPXVideoLocal
+pause 100
+ControlsTest AddDefaultFileDetails
+pause 100
+ControlsTest SetState EPbStatePlaying
+pause 100
+ControlsTest ShowControls
+pause 1000
+ControlsTest PointerEvent eventtype=EButton1Down x=600 y=325
+pause 100
+ControlsTest PointerEvent eventtype=EButton1Up x=600 y=325
+pause 100
+ControlsTest ExpectedResult EAknSoftkeyBack 0
+pause 100
+ControlsTest DeleteControls
+delete ControlsTest
+sendtobackground
+pause 2000
+[Endtest]
+
+[Test]
+title [2]Tap on details softkey
+bringtoforeground
+create ui_videoplaybackcontrolstest ControlsTest
+ControlsTest CreateControls test.3gp EMPXVideoLocal
+pause 100
+ControlsTest AddDefaultFileDetails
+pause 100
+ControlsTest SetState EPbStatePlaying
+pause 100
+ControlsTest ToggleVisibility
+pause 1000
+ControlsTest PointerEvent eventtype=EButton1Down x=60 y=325
+pause 100
+ControlsTest PointerEvent eventtype=EButton1Up x=60 y=325
+pause 100
+ControlsTest ExpectedResult EMPXPbvCmdShowFileDetails 0
+pause 100
+ControlsTest DeleteControls
+delete ControlsTest
+sendtobackground
+pause 2000
+[Endtest]
+
+[Test]
+title [3]Change aspect ratio
+bringtoforeground
+create ui_videoplaybackcontrolstest ControlsTest
+ControlsTest CreateControls test.3gp EMPXVideoLocal
+pause 100
+ControlsTest AddDefaultFileDetails
+ControlsTest SetAspectRatio EMMFNatural
+pause 100
+ControlsTest SetState EPbStatePlaying
+pause 100
+ControlsTest ShowControls
+pause 1000
+ControlsTest PointerEvent eventtype=EButton1Down x=70 y=30
+pause 100
+ControlsTest PointerEvent eventtype=EButton1Up x=70 y=30
+pause 100
+ControlsTest ExpectedResult EMPXPbvCmdStretchAspectRatio 0
+pause 100
+ControlsTest DeleteControls
+delete ControlsTest
+sendtobackground
+pause 2000
+[Endtest]
+
+[Test]
+title [4]Increase volume from 50 to 60 in live streaming mode
+bringtoforeground
+create ui_videoplaybackcontrolstest ControlsTest
+ControlsTest CreateControls rtsp:\/\/1.1.1.1/1.3gp EMPXVideoLiveStreaming
+pause 100
+ControlsTest AddDefaultFileDetails
+pause 100
+ControlsTest SetState EPbStatePlaying
+ControlsTest SetVolume 50
+pause 100
+ControlsTest ShowControls
+pause 1000
+ControlsTest PointerEvent eventtype=EButton1Down x=20 y=90
+pause 100
+ControlsTest PointerEvent eventtype=EButton1Up x=20 y=90
+pause 100
+ControlsTest ExpectedResult EMPXPbvCmdIncreaseVolume 0
+pause 100
+ControlsTest DeleteControls
+delete ControlsTest
+sendtobackground
+pause 2000
+[Endtest]
+
+[Test]
+title [5]Decrease volume from 50 to 40 in streaming mode
+bringtoforeground
+create ui_videoplaybackcontrolstest ControlsTest
+ControlsTest CreateControls rtsp:\/\/1.1.1.1/1.3gp EMPXVideoStreaming
+pause 100
+ControlsTest AddDefaultFileDetails
+pause 100
+ControlsTest SetState EPbStatePlaying
+ControlsTest SetVolume 50
+pause 100
+ControlsTest ShowControls
+pause 1000
+ControlsTest PointerEvent eventtype=EButton1Down x=20 y=230
+pause 100
+ControlsTest PointerEvent eventtype=EButton1Up x=20 y=230
+pause 100
+ControlsTest ExpectedResult EMPXPbvCmdDecreaseVolume 0
+pause 100
+ControlsTest DeleteControls
+delete ControlsTest
+sendtobackground
+pause 2000
+[Endtest]
+
+[Test]
+title [6]Mute / Unmute
+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=260
+pause 100
+ControlsTest PointerEvent eventtype=EButton1Up x=75 y=260
+pause 100
+ControlsTest ExpectedResult EMPXPbvCmdMute 0
+pause 100
+ControlsTest SetVolume 0
+pause 100
+ControlsTest PointerEvent eventtype=EButton1Down x=75 y=260
+pause 100
+ControlsTest PointerEvent eventtype=EButton1Up x=75 y=260
+pause 100
+ControlsTest ExpectedResult EMPXPbvCmdUnMute 0
+pause 100
+ControlsTest DeleteControls
+delete ControlsTest
+sendtobackground
+pause 2000
+[Endtest]
+
+[Test]
+title [7]SetPosition
+bringtoforeground
+create ui_videoplaybackcontrolstest ControlsTest
+ControlsTest CreateControls test.3gp EMPXVideoLocal
+pause 100
+ControlsTest AddDefaultFileDetails
+pause 100
+ControlsTest SetState EPbStatePaused
+pause 100
+ControlsTest SetDuration 100000
+pause 100
+ControlsTest PointerEvent eventtype=EButton1Down x=310 y=350
+pause 100
+ControlsTest PointerEvent eventtype=EDrag x=310 y=350
+pause 100
+ControlsTest PointerEvent eventtype=EButton1Up x=310 y=350
+pause 100
+ControlsTest ExpectedResult EMPXPbvCmdSetPosition 50
+pause 100
+ControlsTest DeleteControls
+delete ControlsTest
+sendtobackground
+pause 2000
+[Endtest]
+
+[Test]
+title [8]Audio only clip
+bringtoforeground
+create ui_videoplaybackcontrolstest ControlsTest
+ControlsTest CreateControls test.3gp EMPXVideoLocal
+pause 100
+ControlsTest AddAudioOnlyFileDetails
+pause 100
+ControlsTest SetState EPbStatePlaying
+pause 100
+ControlsTest PointerEvent eventtype=EButton1Down x=600 y=325
+pause 100
+ControlsTest PointerEvent eventtype=EButton1Up x=600 y=325
+pause 100
+ControlsTest ExpectedResult EAknSoftkeyBack 0
+pause 100
+ControlsTest DeleteControls
+delete ControlsTest
+sendtobackground
+pause 2000
+[Endtest]
+
+[Test]
+title [9]Play using Button bar
+bringtoforeground
+create ui_videoplaybackcontrolstest ControlsTest
+ControlsTest CreateControls test.3gp EMPXVideoLocal
+pause 100
+ControlsTest AddDefaultFileDetails
+pause 100
+ControlsTest SetState EPbStatePaused
+pause 100
+ControlsTest PointerEvent eventtype=EButton1Down x=570 y=180
+pause 100
+ControlsTest PointerEvent eventtype=EButton1Up x=570 y=180
+pause 100
+ControlsTest ExpectedResult EMPXPbvCmdPlay 0
+pause 100
+ControlsTest DeleteControls
+delete ControlsTest
+sendtobackground
+pause 2000
+[Endtest]
+
+[Test]
+title [10]Pause using Button bar
+bringtoforeground
+create ui_videoplaybackcontrolstest ControlsTest
+ControlsTest CreateControls test.3gp EMPXVideoLocal
+pause 100
+ControlsTest AddDefaultFileDetails
+pause 100
+ControlsTest SetState EPbStatePlaying
+pause 100
+ControlsTest ShowControls
+pause 1000
+ControlsTest PointerEvent eventtype=EButton1Down x=570 y=180
+pause 100
+ControlsTest PointerEvent eventtype=EButton1Up x=570 y=180
+pause 100
+ControlsTest ExpectedResult EMPXPbvCmdPause 0
+pause 100
+ControlsTest DeleteControls
+delete ControlsTest
+sendtobackground
+pause 2000
+[Endtest]
+
+[Test]
+title [11]FF using Button bar
+bringtoforeground
+create ui_videoplaybackcontrolstest ControlsTest
+ControlsTest CreateControls test.3gp EMPXVideoLocal
+pause 100
+ControlsTest AddDefaultFileDetails
+pause 100
+ControlsTest SetState EPbStateInitialised
+ControlsTest SetState EPbStatePaused
+pause 100
+ControlsTest PointerEvent eventtype=EButton1Down x=570 y=100
+pause 1000
+ControlsTest ExpectedResult EMPXPbvCmdSeekForward 0
+pause 100
+ControlsTest PointerEvent eventtype=EButton1Up x=570 y=100
+pause 100
+ControlsTest ExpectedResult EMPXPbvCmdEndSeek 0
+pause 100
+ControlsTest DeleteControls
+delete ControlsTest
+sendtobackground
+pause 2000
+[Endtest]
+
+[Test]
+title [12]RW using Button bar
+bringtoforeground
+create ui_videoplaybackcontrolstest ControlsTest
+ControlsTest CreateControls test.3gp EMPXVideoLocal
+pause 100
+ControlsTest AddDefaultFileDetails
+pause 100
+ControlsTest SetState EPbStatePlaying
+ControlsTest SetState EPbStatePaused
+pause 100
+ControlsTest PointerEvent eventtype=EButton1Down x=570 y=250
+pause 1000
+ControlsTest ExpectedResult EMPXPbvCmdSeekBackward 0
+pause 100
+ControlsTest PointerEvent eventtype=EButton1Up x=570 y=250
+pause 100
+ControlsTest ExpectedResult EMPXPbvCmdEndSeek 0
+pause 100
+ControlsTest DeleteControls
+delete ControlsTest
+sendtobackground
+pause 2000
+[Endtest]
+
+[Test]
+title [13]PDL SetDownLoadPostion
+bringtoforeground
+create ui_videoplaybackcontrolstest ControlsTest
+ControlsTest CreateControls test.3gp EMPXVideoProgressiveDownload
+pause 100
+ControlsTest AddDefaultFileDetails
+pause 100
+ControlsTest SetDuration 100000
+ControlsTest SetDownLoadSize 100
+ControlsTest SetState EPbStatePlaying
+pause 100
+ControlsTest ShowControls
+pause 1000
+ControlsTest SetDownLoadPostion 30000
+ControlsTest UpdateDownloadPosition 50
+pause 2000
+ControlsTest DeleteControls
+delete ControlsTest
+sendtobackground
+pause 2000
+[Endtest]
+
+[Test]
+title [14]PDL SetDownLoadPaused
+bringtoforeground
+create ui_videoplaybackcontrolstest ControlsTest
+ControlsTest CreateControls test.3gp EMPXVideoProgressiveDownload
+pause 100
+ControlsTest AddDefaultFileDetails
+pause 100
+ControlsTest SetState EPbStatePlaying
+pause 100
+ControlsTest SetDownLoadPaused
+pause 2000
+ControlsTest DeleteControls
+delete ControlsTest
+sendtobackground
+pause 2000
+[Endtest]
+
+[Test]
+title [15]PDL ClearDownLoadPaused
+bringtoforeground
+create ui_videoplaybackcontrolstest ControlsTest
+ControlsTest CreateControls test.3gp EMPXVideoProgressiveDownload
+pause 100
+ControlsTest AddDefaultFileDetails
+pause 100
+ControlsTest SetState EPbStatePlaying
+ControlsTest SetState EPbStatePaused
+pause 100
+ControlsTest SetDownLoadPaused
+pause 2000
+ControlsTest SetState EPbStatePlaying
+pause 1000
+ControlsTest ClearDownLoadPaused
+pause 2000
+ControlsTest DeleteControls
+delete ControlsTest
+sendtobackground
+pause 2000
+[Endtest]
+
+[Test]
+title [16]TV-Out
+bringtoforeground
+create ui_videoplaybackcontrolstest ControlsTest
+ControlsTest CreateControls test.3gp EMPXVideoLocal
+pause 100
+ControlsTest AddDefaultFileDetails
+pause 100
+ControlsTest SetState EPbStatePlaying
+pause 100
+ControlsTest TvOutConnected
+pause 2000
+ControlsTest TvOutDisconnected
+pause 100
+ControlsTest DeleteControls
+delete ControlsTest
+sendtobackground
+pause 2000
+[Endtest]
+
+[Test]
+title [17] RealMedia Streaming
+bringtoforeground
+create ui_videoplaybackcontrolstest ControlsTest
+ControlsTest CreateControls rtsp:\/\/1.1.1.1/1.rm EMPXVideoStreaming
+pause 100
+ControlsTest SetState EPbStateInitialising
+pause 10000
+ControlsTest SetState EPbStateInitialised
+pause 2000
+ControlsTest DeleteControls
+delete ControlsTest
+sendtobackground
+pause 2000
+[Endtest]
+
+[Test]
+title [18] 3GPP Streaming
+bringtoforeground
+create ui_videoplaybackcontrolstest ControlsTest
+ControlsTest CreateControls rtsp:\/\/1.1.1.1/1.3gp EMPXVideoStreaming
+pause 100
+ControlsTest SetState EPbStateInitialising
+pause 3000
+ControlsTest SetState EPbStateInitialised
+pause 2000
+ControlsTest DeleteControls
+delete ControlsTest
+sendtobackground
+pause 2000
+[Endtest]
+
+[Test]
+title [19] Error during Connecting
+bringtoforeground
+create ui_videoplaybackcontrolstest ControlsTest
+ControlsTest CreateControls test.rm EMPXVideoStreaming
+pause 100
+ControlsTest SetState EPbStateInitialising
+pause 3000
+ControlsTest HandleErrors
+pause 2000
+ControlsTest DeleteControls
+delete ControlsTest
+sendtobackground
+pause 2000
+[Endtest]
+
+[Test]
+title [20]Play/pause using enter key
+bringtoforeground
+create ui_videoplaybackcontrolstest ControlsTest
+ControlsTest CreateControls test.3gp EMPXVideoLocal
+pause 100
+ControlsTest AddDefaultFileDetails
+pause 100
+ControlsTest SetState EPbStatePlaying
+pause 100
+ControlsTest ShowControls
+pause 1000
+ControlsTest KeyEvent eventtype=EEventKeyDown scancode=3
+pause 1000
+ControlsTest KeyEvent eventtype=EEventKeyUp scancode=3
+pause 1000
+ControlsTest ExpectedResult EMPXPbvCmdPlayPause 0
+pause 100
+ControlsTest DeleteControls
+delete ControlsTest
+sendtobackground
+pause 2000
+[Endtest]
+
+[Test]
+title [21] Key input while FF via pointer event in progress
+bringtoforeground
+create ui_videoplaybackcontrolstest ControlsTest
+ControlsTest CreateControls test.3gp EMPXVideoLocal
+pause 100
+ControlsTest AddDefaultFileDetails
+pause 100
+ControlsTest SetState EPbStatePlaying
+ControlsTest SetState EPbStatePaused
+pause 100
+ControlsTest PointerEvent eventtype=EButton1Down x=570 y=100
+pause 1000
+ControlsTest ExpectedResult EMPXPbvCmdSeekForward 0
+pause 100
+ControlsTest KeyEvent eventtype=EEventKeyDown scancode=3
+pause 1000
+ControlsTest PointerEvent eventtype=EButton1Up x=570 y=100
+pause 100
+ControlsTest ExpectedResult EMPXPbvCmdEndSeek 0
+pause 100
+ControlsTest DeleteControls
+delete ControlsTest
+sendtobackground
+pause 2000
+[Endtest]
+
+[Test]
+title [22] Ptr input while key input being processed
+bringtoforeground
+create ui_videoplaybackcontrolstest ControlsTest
+ControlsTest CreateControls test.3gp EMPXVideoLocal
+pause 100
+ControlsTest AddDefaultFileDetails
+pause 100
+ControlsTest SetState EPbStatePlaying
+pause 100
+ControlsTest ShowControls
+pause 1000
+ControlsTest KeyEvent eventtype=EEventKeyDown scancode=3
+pause 1000
+ControlsTest PointerEvent eventtype=EButton1Down x=570 y=100
+pause 1000
+ControlsTest KeyEvent eventtype=EEventKeyUp scancode=3
+pause 1000
+ControlsTest PointerEvent eventtype=EButton1Up x=570 y=100
+pause 100
+ControlsTest ExpectedResult EMPXPbvCmdPlayPause 0
+pause 100
+ControlsTest DeleteControls
+delete ControlsTest
+sendtobackground
+pause 2000
+[Endtest]
+
+[Test]
+title [23] Press back key through offerkeyevent
+bringtoforeground
+create ui_videoplaybackcontrolstest ControlsTest
+ControlsTest CreateControls test.3gp EMPXVideoLocal
+pause 100
+ControlsTest AddDefaultFileDetails
+pause 100
+ControlsTest SetState EPbStatePlaying
+pause 100
+ControlsTest ShowControls
+pause 5000
+ControlsTest ShowControls
+pause 200
+ControlsTest SoftkeyPressed EStdKeyDevice1
+pause 100
+ControlsTest ExpectedResult EAknSoftkeyBack 0
+pause 100
+ControlsTest DeleteControls
+delete ControlsTest
+sendtobackground
+pause 2000
+[Endtest]
+
+[Test]
+title [24]Press details key through offerkeyevent
+bringtoforeground
+create ui_videoplaybackcontrolstest ControlsTest
+ControlsTest CreateControls test.3gp EMPXVideoLocal
+pause 100
+ControlsTest AddDefaultFileDetails
+pause 100
+ControlsTest SetState EPbStatePlaying
+pause 100
+ControlsTest ShowControls
+pause 100
+ControlsTest SoftkeyPressed EStdKeyDevice0
+pause 100
+ControlsTest ExpectedResult EMPXPbvCmdShowFileDetails 0
+pause 100
+ControlsTest DeleteControls
+delete ControlsTest
+sendtobackground
+pause 2000
+[Endtest]
+
+[Test]
+title [25]Send the view to background while FF using Button bar
+bringtoforeground
+create ui_videoplaybackcontrolstest ControlsTest
+ControlsTest CreateControls test.3gp EMPXVideoLocal
+pause 100
+ControlsTest AddDefaultFileDetails
+pause 100
+ControlsTest SetState EPbStatePlaying
+ControlsTest SetState EPbStatePaused
+pause 100
+ControlsTest PointerEvent eventtype=EButton1Down x=570 y=100
+pause 1000
+ControlsTest ExpectedResult EMPXPbvCmdSeekForward 0
+pause 100
+ControlsTest HandleBackgroundEvnet
+pause 100
+ControlsTest ExpectedResult EMPXPbvCmdEndSeek 0
+pause 100
+ControlsTest DeleteControls
+delete ControlsTest
+sendtobackground
+pause 2000
+[Endtest]
+
+[Test]
+title [26]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
+pause 100
+ControlsTest AddDefaultFileDetails
+pause 100
+ControlsTest SetState EPbStateBuffering
+pause 100
+ControlsTest PointerEvent eventtype=EButton1Down x=600 y=325
+pause 100
+ControlsTest PointerEvent eventtype=EButton1Up x=600 y=325
+pause 100
+ControlsTest ExpectedResult EAknSoftkeyBack 0
+pause 100
+ControlsTest DeleteControls
+delete ControlsTest
+sendtobackground
+pause 2000
+[Endtest]
+
+[Test]
+title [27]Timout for toggling control's visibility in playing state
+bringtoforeground
+create ui_videoplaybackcontrolstest ControlsTest
+ControlsTest CreateControls test.3gp EMPXVideoLocal
+pause 100
+ControlsTest AddDefaultFileDetails
+pause 100
+ControlsTest SetState EPbStatePlaying
+pause 100
+ControlsTest ShowControls
+pause 5000
+ControlsTest DeleteControls
+delete ControlsTest
+sendtobackground
+pause 2000
+[Endtest]
+
+[Test]
+title [28]SetPosition when playing
+bringtoforeground
+create ui_videoplaybackcontrolstest ControlsTest
+ControlsTest CreateControls test.3gp EMPXVideoLocal
+pause 100
+ControlsTest AddDefaultFileDetails
+pause 100
+ControlsTest SetState EPbStatePaused
+pause 100
+ControlsTest SetState EPbStatePlaying
+pause 100
+ControlsTest ShowControls
+pause 1000
+ControlsTest SetDuration 100000
+pause 100
+ControlsTest PointerEvent eventtype=EButton1Down x=251 y=350
+pause 100
+ControlsTest ExpectedResult EMPXPbvCmdCustomPause 0
+pause 100
+ControlsTest PointerEvent eventtype=EDrag x=251 y=350
+pause 100
+ControlsTest PointerEvent eventtype=EButton1Up x=251 y=350
+pause 100
+ControlsTest ExpectedResult EMPXPbvCmdCustomPlay 0
+pause 100
+ControlsTest DeleteControls
+delete ControlsTest
+sendtobackground
+pause 2000
+[Endtest]
+
+
+[Test]
+title [29] Open Close Media Details Viewer (no scrolling)
+bringtoforeground
+create ui_videoplaybackcontrolstest ControlsTest
+ControlsTest CreateControls test.3gp EMPXVideoLocal
+pause 100
+ControlsTest AddDefaultFileDetails
+pause 100
+ControlsTest SetState EPbStatePlaying
+pause 100
+ControlsTest ShowControls
+pause 1000
+ControlsTest ShowMediaDetailsViewer
+pause 3000
+ControlsTest CloseMediaDetailsViewer
+pause 100
+ControlsTest DeleteControls
+delete ControlsTest
+sendtobackground
+pause 2000
+[Endtest]
+
+
+[Test]
+title [30] Open Close Media Details Viewer w/Scrolling
+bringtoforeground
+create ui_videoplaybackcontrolstest ControlsTest
+ControlsTest CreateControls TestClipWithLongNameToTestScrollingInMediaDetailsViewer.3gp EMPXVideoLocal
+pause 100
+ControlsTest AddDefaultFileDetails
+pause 100
+ControlsTest SetState EPbStatePlaying
+pause 100
+ControlsTest ShowControls
+pause 1000
+ControlsTest ShowMediaDetailsViewer
+pause 3000
+ControlsTest CloseMediaDetailsViewer
+pause 100
+ControlsTest DeleteControls
+delete ControlsTest
+sendtobackground
+pause 2000
+[Endtest]
+
+
+[Test]
+title [31] Media Details Viewer (audio only)
+bringtoforeground
+create ui_videoplaybackcontrolstest ControlsTest
+ControlsTest CreateControls TestClipWithLongNameToTestScrollingInMediaDetailsViewer.3gp EMPXVideoLocal
+pause 100
+ControlsTest AddAudioOnlyFileDetails
+pause 100
+ControlsTest SetState EPbStatePlaying
+pause 100
+ControlsTest ShowControls
+pause 1000
+ControlsTest ShowMediaDetailsViewer
+pause 3000
+ControlsTest CloseMediaDetailsViewer
+pause 100
+ControlsTest DeleteControls
+delete ControlsTest
+sendtobackground
+pause 2000
+[Endtest]
+
+
+[Test]
+title [32] Media Details Viewer Streaming Link
+bringtoforeground
+create ui_videoplaybackcontrolstest ControlsTest
+ControlsTest CreateControls rtsp:\/\/1.1.1.1/1.3gp EMPXVideoStreaming
+pause 100
+ControlsTest AddAudioOnlyFileDetails
+pause 100
+ControlsTest SetState EPbStatePlaying
+pause 100
+ControlsTest ShowControls
+pause 1000
+ControlsTest ShowMediaDetailsViewer
+pause 2000
+ControlsTest CloseMediaDetailsViewer
+pause 100
+ControlsTest DeleteControls
+delete ControlsTest
+sendtobackground
+pause 2000
+[Endtest]
+
+[Test]
+title [33] Open Close Media Details Viewer (with long details)
+bringtoforeground
+create ui_videoplaybackcontrolstest ControlsTest
+ControlsTest CreateControls test.3gp EMPXVideoLocal
+pause 100
+ControlsTest AddLongFileDetails
+pause 100
+ControlsTest SetState EPbStatePlaying
+pause 100
+ControlsTest ShowControls
+pause 1000
+ControlsTest ShowMediaDetailsViewer
+pause 3000
+ControlsTest CloseMediaDetailsViewer
+pause 100
+ControlsTest DeleteControls
+delete ControlsTest
+sendtobackground
+pause 2000
+[Endtest]
+
+[Test]
+title [34] Hide aspect ratio
+bringtoforeground
+create ui_videoplaybackcontrolstest ControlsTest
+ControlsTest CreateControls test.3gp EMPXVideoLocal
+pause 100
+ControlsTest AddSameARFileDetails
+pause 100
+ControlsTest SetState EPbStatePlaying
+pause 100
+ControlsTest ShowControls
+pause 3000
+ControlsTest ShowMediaDetailsViewer
+pause 3000
+ControlsTest CloseMediaDetailsViewer
+pause 100
+ControlsTest DeleteControls
+delete ControlsTest
+sendtobackground
+pause 2000
+[Endtest]
+
+[Test]
+title [35] 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
+pause 100
+ControlsTest AddEmptyTitleFileDetails
+pause 100
+ControlsTest SetState EPbStatePlaying
+pause 100
+ControlsTest ShowControls
+pause 1000
+ControlsTest ShowMediaDetailsViewer
+pause 3000
+ControlsTest CloseMediaDetailsViewer
+pause 100
+ControlsTest DeleteControls
+delete ControlsTest
+sendtobackground
+pause 2000
+[Endtest]
+
+// End of file
Binary file videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/data/mmc/TestClipWithLongNameToTestScrollingInMediaDetailsViewer.3gp has changed
Binary file videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/data/mmc/test.3gp has changed
Binary file videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/data/mmc/test.rm has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/eabi/ui_videoplaybackcontrolstestu.def	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,41 @@
+EXPORTS
+	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
+	_ZN24CMPXVideoPlaybackControl21DoHandlePointerEventLERK13TPointerEvent @ 2 NONAME
+	_ZN35CMPXVideoPlaybackControlsController12HandleEventLE34TMPXVideoPlaybackControlCommandIdsi @ 3 NONAME
+	_ZN35CMPXVideoPlaybackControlsController15AddFileDetailsLEP32CMPXVideoPlaybackViewFileDetails @ 4 NONAME
+	_ZN35CMPXVideoPlaybackControlsController4NewLEP26CMPXVideoPlaybackContainer5TRectP32CMPXVideoPlaybackViewFileDetails @ 5 NONAME
+	_ZN35CMPXVideoPlaybackControlsController9GetBitmapE25TMPXVideoPlaybackControls @ 6 NONAME
+	_ZN35CMPXVideoPlaybackControlsControllerD0Ev @ 7 NONAME
+	_ZN35CMPXVideoPlaybackControlsControllerD1Ev @ 8 NONAME
+	_ZN35CMPXVideoPlaybackControlsControllerD2Ev @ 9 NONAME
+	_ZTI23CMPXVideoPlaybackButton @ 10 NONAME ; #<TI>#
+	_ZTI24CMPXVideoPlaybackControl @ 11 NONAME ; #<TI>#
+	_ZTI26CMPXVideoPlaybackButtonBar @ 12 NONAME ; #<TI>#
+	_ZTI26CMPXVideoPlaybackContainer @ 13 NONAME ; #<TI>#
+	_ZTI26CMPXVideoPlaybackVolumeBar @ 14 NONAME ; #<TI>#
+	_ZTI27CMPXVideoPlaybackControlPdl @ 15 NONAME ; #<TI>#
+	_ZTI28CMPXVideoPlaybackProgressBar @ 16 NONAME ; #<TI>#
+	_ZTI30CMPXVideoPlaybackControlPolicy @ 17 NONAME ; #<TI>#
+	_ZTI32CMPXVideoPlaybackAspectRatioIcon @ 18 NONAME ; #<TI>#
+	_ZTI33CMPXVideoPlaybackUserInputHandler @ 19 NONAME ; #<TI>#
+	_ZTI34CMPXVideoPlaybackBrandingAnimation @ 20 NONAME ; #<TI>#
+	_ZTI35CMPXVideoPlaybackControlsController @ 21 NONAME ; #<TI>#
+	_ZTI37CMPXVideoPlaybackControlConfiguration @ 22 NONAME ; #<TI>#
+	_ZTV23CMPXVideoPlaybackButton @ 23 NONAME ; #<VT>#
+	_ZTV24CMPXVideoPlaybackControl @ 24 NONAME ; #<VT>#
+	_ZTV26CMPXVideoPlaybackButtonBar @ 25 NONAME ; #<VT>#
+	_ZTV26CMPXVideoPlaybackContainer @ 26 NONAME ; #<VT>#
+	_ZTV26CMPXVideoPlaybackVolumeBar @ 27 NONAME ; #<VT>#
+	_ZTV27CMPXVideoPlaybackControlPdl @ 28 NONAME ; #<VT>#
+	_ZTV28CMPXVideoPlaybackProgressBar @ 29 NONAME ; #<VT>#
+	_ZTV30CMPXVideoPlaybackControlPolicy @ 30 NONAME ; #<VT>#
+	_ZTV32CMPXVideoPlaybackAspectRatioIcon @ 31 NONAME ; #<VT>#
+	_ZTV33CMPXVideoPlaybackUserInputHandler @ 32 NONAME ; #<VT>#
+	_ZTV34CMPXVideoPlaybackBrandingAnimation @ 33 NONAME ; #<VT>#
+	_ZTV35CMPXVideoPlaybackControlsController @ 34 NONAME ; #<VT>#
+	_ZTV37CMPXVideoPlaybackControlConfiguration @ 35 NONAME ; #<VT>#
+	_ZN32CMPXVideoPlaybackViewFileDetails17GenerateFileNameLEv @ 36 NONAME
+	_ZTI35CMPXVideoPlaybackMediaDetailsViewer @ 37 NONAME
+	_ZTV35CMPXVideoPlaybackMediaDetailsViewer @ 38 NONAME
+	_ZN32CMPXVideoPlaybackViewFileDetails18GenerateFileTitleLEv @ 39 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,45 @@
+/*
+* 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:  Build information file for project VideoPlaybackControlsTest.
+*
+*/
+
+// Version : %version: ou1cpsw#7 %
+
+
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+
+PRJ_TESTEXPORTS
+../conf/ui_videoplaybackcontrolstest.cfg        /epoc32/winscw/c/testframework/ui_videoplaybackcontrolstest.cfg
+../init/testframework.ini                       /epoc32/winscw/c/testframework/testframework.ini
+../data/mmc/test.3gp                            /epoc32/winscw/c/data/videos/test.3gp
+../data/mmc/test.rm                             /epoc32/winscw/c/data/videos/test.rm
+../data/mmc/TestClipWithLongNameToTestScrollingInMediaDetailsViewer.3gp                             /epoc32/winscw/c/data/videos/TestClipWithLongNameToTestScrollingInMediaDetailsViewer.3gp
+
+
+PRJ_EXPORTS
+
+
+PRJ_TESTMMPFILES
+videoplaybackcontrolstest.mmp
+
+
+PRJ_MMPFILES
+
+
+//  End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/group/videoplaybackcontrolstest.mmp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,95 @@
+/*
+* 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 VideoPlaybackViewControlsTest.
+*
+*/
+
+// Version : %version: ou1cpsw#11 %
+
+
+
+#include <bldvariant.hrh>
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+EPOCALLOWDLLDATA
+
+TARGET          ui_videoplaybackcontrolstest.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E3
+
+CAPABILITY      ALL -TCB
+
+APP_LAYER_SYSTEMINCLUDE
+
+USERINCLUDE     ../inc
+USERINCLUDE     ../../../inc
+USERINCLUDE     ../../../../inc
+USERINCLUDE     ../../../../../inc
+
+SOURCEPATH      ../src
+SOURCE          videoplaybackcontrolstest.cpp
+SOURCE          videoplaybackcontrolstestblocks.cpp
+SOURCE          mpxvpbc_stub.cpp
+SOURCE          mpxvpbvfd_stub.cpp
+SOURCE          mpxvpbuih_stub.cpp
+
+SOURCEPATH      ../../../src
+SOURCE          mpxvideoplaybackcontrol.cpp
+SOURCE          mpxvideoplaybackcontrolpolicy.cpp
+SOURCE          mpxvideoplaybackcontrolconfiguration.cpp
+SOURCE          mpxvideoplaybackcontrolscontroller.cpp
+SOURCE          mpxvideoplaybackbutton.cpp
+SOURCE          mpxvideoplaybackbuttonbar.cpp
+SOURCE          mpxvideoplaybackvolumebar.cpp
+SOURCE          mpxvideoplaybackprogressbar.cpp
+SOURCE          mpxvideoplaybackcontrolpdl.cpp
+SOURCE          mpxvideoplaybackaspectratioicon.cpp
+SOURCE          mpxvideoplaybackbrandinganimation.cpp
+SOURCE          mpxvideoplaybackmediadetailsviewer.cpp
+
+LIBRARY         ws32.lib
+LIBRARY         euser.lib
+LIBRARY         cone.lib
+LIBRARY         stiftestinterface.lib
+LIBRARY         stiftestengine.lib
+LIBRARY         avkon.lib
+LIBRARY         eikcoctl.lib
+LIBRARY         eikctl.lib
+LIBRARY         apgrfx.lib
+LIBRARY         aknskins.lib 
+LIBRARY         bafl.lib
+LIBRARY         aknskinsrv.lib
+LIBRARY         eikcore.lib
+LIBRARY         cdlengine.lib
+LIBRARY         estor.lib
+LIBRARY         aknicon.lib
+LIBRARY         bitgdi.lib
+LIBRARY         fbscli.lib
+LIBRARY         commonengine.lib 
+LIBRARY         efsrv.lib
+LIBRARY         gdi.lib
+LIBRARY         aknlayout2scalable.lib
+LIBRARY         aknlayout2.lib
+LIBRARY         egul.lib
+LIBRARY         touchfeedback.lib
+LIBRARY         bmpanim.lib
+LIBRARY         flogger.lib
+LIBRARY         playbackhelper.lib
+LIBRARY         remconinterfacebase.lib
+LIBRARY         remconcoreapi.lib
+LIBRARY         ecom.lib
+LIBRARY         inetprotutil.lib
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/group/videoplaybackcontrolstest.pkg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,48 @@
+;
+; 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 videoplaybackcontrols STIF test
+;
+; Version : %version: %
+;
+
+; Languages
+&EN
+
+; Provide value for uid
+#{"MPX Videoplayback Controls STIF"}, (0x101FB3E3), 1, 0, 1, TYPE=SA, RU
+
+
+; Series60 product id for S60 3.0
+[0x101F7961], 0, 0, 0, {"Series60ProductID"}
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+; Install files
+; Need to build videoplaybackcontrols first to have rsc and mif
+"/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"
+
+"../conf/ui_videoplaybackcontrolstest.cfg" - "c:/testframework/ui_videoplaybackcontrolstest.cfg"
+"../init/testframework.ini" - "c:/testframework/testframework.ini"
+
+"../data/mmc/test.3gp" - "e:/testing/data/test.3gp"
+"../data/mmc/test.rm" - "e:/testing/data/test.rm"
+"../data/mmc/TestClipWithLongNameToTestScrollingInMediaDetailsViewer.3gp" - "e:/testing/data/TestClipWithLongNameToTestScrollingInMediaDetailsViewer.3gp"
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/inc/mpxvpbc_stub.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,140 @@
+/*
+* 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:  Test Harness for VideoPlaybackControls
+*
+*/
+
+// Version : %version: e003sa33#11 %
+
+
+
+
+#ifndef VIDEOPLAYBACKTESTCONTAINER_H
+#define VIDEOPLAYBACKTESTCONTAINER_H
+
+//  INCLUDES
+#include <coecntrl.h>
+
+// CLASS DECLARATION
+class CMPXVideoPlaybackControlsController;
+class CVideoPlaybackControlsTest;
+class CMPXVideoPlaybackViewFileDetails;
+class CMPXVideoPlaybackUserInputHandler;
+
+class CMPXVideoPlaybackContainer: public CCoeControl
+{
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CMPXVideoPlaybackContainer* NewL( const TDesC& aFileName );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CMPXVideoPlaybackContainer();
+
+        void HandlePointerEventL( const TPointerEvent& aPointerEvent );
+        
+
+    private:
+    
+        /**
+        * C++ default constructor.
+        */
+        CMPXVideoPlaybackContainer();
+    
+        /**
+        * Symbian 2nd phase constructor.
+        */
+        void ConstructL( const TDesC& aFileName );
+
+    private:
+
+        virtual TInt CountComponentControls() const;
+
+    protected:
+
+        /**
+        * From CCoeControl,Draw.
+        * @param aRect drawable area.
+        */
+        void Draw(const TRect& aRect) const;
+       
+        TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
+
+    public:
+        /**
+        * Handle commands from control controller
+        * @return void
+        */
+        void HandleCommandL( TInt aCommand, TInt aValue = 0 );
+
+        /**
+        * Expected Values
+        */
+        void ExpectedResultL( TInt aCommand, TInt aValue );
+
+        /**
+        * Set a control's controller
+        */
+        void SetController( CMPXVideoPlaybackControlsController* aControlsController );
+
+        /**
+        * add default file details
+        */
+        void AddFileDetailsL( TBool aHasVideoTrack = ETrue );
+        
+        void DoHandleKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
+
+        /**
+        * Return default file details
+        */
+        CMPXVideoPlaybackViewFileDetails* FileDetails( TInt aMode );
+        
+        CMPXVideoPlaybackUserInputHandler* UserInputHandler();
+
+        /**
+        * add long file details
+        */
+        void AddLongFileDetailsL( TBool aHasVideoTrack = ETrue );
+
+        /**
+        * Add file details 
+        * and make sure aspect ratio equal to screen aspect ratio 
+        */
+        void AddSameARFileDetailsL( TBool aHasVideoTrack = ETrue );
+        
+        /**
+        * Add file details with empty title
+        * and make sure aspect ratio equal to screen aspect ratio 
+        */        
+        void AddEmptyTitleFileDetailsL( TBool aHasVideoTrack = ETrue );
+        
+    private:    
+        // Data
+        TInt                                 iCommand;
+        TInt                                 iValue;
+        CMPXVideoPlaybackControlsController* iControlsController;
+        CMPXVideoPlaybackViewFileDetails*    iFileDetails;
+        TKeyResponse                         iKeyResponse;    
+        
+        CMPXVideoPlaybackUserInputHandler*       iUserInputHandler;  // owned        
+
+};
+
+#endif      // VIDEOPLAYBACKTESTCONTAINER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/inc/mpxvpbuih_stub.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,90 @@
+/*
+* 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:  Implementation of MPXVideoPlaybackUserInputHandler
+*
+*/
+
+// Version : %version:  5 %
+
+
+#ifndef MPXVIDEOPLAYBACKUSERINPUTHANDLER_H_
+#define MPXVIDEOPLAYBACKUSERINPUTHANDLER_H_
+
+// INCLUDES
+#include <f32file.h>
+#include <coecntrl.h>
+#include <RemConCoreApiTargetObserver.h> // Side volume key
+
+#include "mpxvideoplaybackcontrol.hrh"
+#include "mpxvideoplaybackcontrol.h"
+#include "mpxvideoplaybackcontrolscontroller.h"
+#include "mpxvideo_debug.h"
+
+// FORWARD DECLARATIONS
+class CMPXVideoPlaybackControl;
+class CMPXVideoPlaybackControlsController;
+class CRemConInterfaceSelector; // Side volume key
+class CRemConCoreApiTarget;
+class CMPXVideoPlaybackContainer;
+
+// CLASS DECLARATION
+
+class CMPXVideoPlaybackUserInputHandler : public CBase,
+                                          public MRemConCoreApiTargetObserver
+{
+
+    public: // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CMPXVideoPlaybackUserInputHandler* NewL(CMPXVideoPlaybackContainer* iContainer);
+
+        /**
+        * Destructor.
+        */
+        virtual ~CMPXVideoPlaybackUserInputHandler();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CMPXVideoPlaybackUserInputHandler( CMPXVideoPlaybackContainer* iContainer );
+
+        /**
+        * Symbian 2nd phase constructor.
+        */
+        void ConstructL();
+
+    public:
+
+        void ProcessPointerEventL( CCoeControl* aControl,
+                                   const TPointerEvent& aPointerEvent,
+                                   TMPXVideoControlType aMPXControl );
+
+        void ProcessKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
+
+    private:
+
+        TMPXVideoUserInputType                  iProcessingInputType;     // the type of input being processed
+        TInt                                    iLastPressedKeyScanCode; // scancode of last key that sent EEventKeyDown
+
+        CMPXVideoPlaybackContainer*             iContainer;      // not owned
+};
+
+
+#endif /*MPXVIDEOPLAYBACKUSERINPUTHANDLER_H_*/
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/inc/videoplaybackcontrolstest.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,300 @@
+/*
+* 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:  Test Harness for VideoPlaybackControls
+*
+*/
+
+// Version : %version: e003sa33#11 %
+
+
+
+
+#ifndef VIDEOPLAYBACKCONTROLSTEST_H
+#define VIDEOPLAYBACKCONTROLSTEST_H
+
+//  INCLUDES
+#include <W32STD.H>
+#include <StifLogger.h>
+#include <StifTestModule.h>
+#include <TestScripterInternal.h>
+
+#include "mpxvpbc_stub.h"
+
+// MACROS
+#define TEST_CLASS_VERSION_MAJOR 0
+#define TEST_CLASS_VERSION_MINOR 0
+#define TEST_CLASS_VERSION_BUILD 0
+
+// Logging path
+#ifdef __WINSCW__
+_LIT( KVideoPlaybackControlsTestLogPath, 
+      "\\logs\\testframework\\VideoPlaybackViewControlsTest\\" );
+#else 
+_LIT( KVideoPlaybackControlsTestLogPath, 
+      "e:\\logs\\testframework\\VideoPlaybackViewControlsTest\\" );
+#endif
+
+// Log file
+_LIT( KVideoPlaybackControlsTestLogFile, 
+                    "VideoPlaybackControlsTest.txt" ); 
+_LIT( KVideoPlaybackControlsTestLogFileWithTitle, 
+                    "VideoPlaybackControlsTest_[%S].txt" );
+
+// FORWARD DECLARATIONS
+class CMPXVideoPlaybackControlsController;
+
+// CLASS DECLARATION
+
+/**
+*  CVideoPlaybackControlsTest test class for STIF Test Framework TestScripter.
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+NONSHARABLE_CLASS(CVideoPlaybackControlsTest) : public CScriptBase
+{
+public:  // Constructors and destructor
+
+    /**
+     * Two-phased constructor.
+     */
+    static CVideoPlaybackControlsTest* NewL( CTestModuleIf& aTestModuleIf );
+
+    /**
+     * Destructor.
+     */
+    virtual ~CVideoPlaybackControlsTest();
+
+public: // New functions
+
+    /**
+     * ?member_description.
+     * @param ?arg1 ?description
+     * @return ?description
+     */
+    //?type ?member_function( ?type ?arg1 );
+
+public: // Functions from base classes
+
+    /**
+     * From CScriptBase Runs a script line.
+     * @param aItem Script line containing method name and parameters
+     * @return Symbian OS error code
+     */
+    virtual TInt RunMethodL( CStifItemParser& aItem );
+
+protected:  // New functions
+
+    /**
+     * ?member_description.
+     * @param ?arg1 ?description
+     * @return ?description
+     */
+    //?type ?member_function( ?type ?arg1 );
+
+protected:  // Functions from base classes
+
+    /**
+     * From ?base_class ?member_description
+     */
+    //?type ?member_function();
+
+private:
+
+    /**
+     * C++ default constructor.
+     */
+    CVideoPlaybackControlsTest( CTestModuleIf& aTestModuleIf );
+
+    /**
+     * By default Symbian 2nd phase constructor is private.
+     */
+    void ConstructL();
+
+    // Prohibit copy constructor if not deriving from CBase.
+    // ?classname( const ?classname& );
+    // Prohibit assigment operator if not deriving from CBase.
+    // ?classname& operator=( const ?classname& );
+
+    /**
+    * Frees all resources allocated from test methods.
+    */
+    void Delete();
+
+    /**
+    * Method used to log version of test class
+    */
+    void SendTestClassVersion();
+
+    /**
+    * Create controls
+    * @return Symbian OS error code.
+    */
+    virtual TInt CreateControls( CStifItemParser&  aItem );
+
+    /**
+    * Delete controls
+    * @return Symbian OS error code.
+    */
+    virtual TInt DeleteControls();
+    /**
+    * Test HandleEventL(EMPXControlCmdSetAspectRatio)
+    * @return Symbian OS error code.
+    */
+    virtual TInt SetAspectRatio( CStifItemParser&  aItem );
+
+    /**
+    * Test HandleEventL(EMPXControlCmdSetVolume)
+    * @return Symbian OS error code.
+    */
+    virtual TInt SetVolume( CStifItemParser&  aItem );
+
+    /**
+    * Test HandleEventL(EMPXControlCmdSetDuration)
+    * @return Symbian OS error code.
+    */
+    virtual TInt SetDuration( CStifItemParser&  aItem );
+
+    /**
+    * Issue pointer event
+    * @return Symbian OS error code.
+    */
+    virtual TInt PointerEvent( CStifItemParser&  aItem );
+    
+    /**
+    * Issue pointer event
+    * @return Symbian OS error code.
+    */
+    virtual TInt KeyEvent( CStifItemParser&  aItem );    
+
+    /**
+    * Check return value is expected value or not
+    * @return Symbian OS error code.
+    */
+    virtual TInt ExpectedResult( CStifItemParser&  aItem );
+
+    /**
+    * Set state
+    * @return Symbian OS error code.
+    */
+    virtual TInt SetState( CStifItemParser&  aItem );
+
+    /**
+    * Add default file details
+    * @return Symbian OS error code.
+    */
+    virtual TInt AddDefaultFileDetails();
+
+    /**
+    * Add audio only file details
+    * @return Symbian OS error code.
+    */
+    virtual TInt AddAudioOnlyFileDetails();
+
+    /**
+    * Add long file details
+    * @return Symbian OS error code.
+    */
+    virtual TInt AddLongFileDetails();
+    
+    /**
+     * Add same AR file details
+     * @return symbian OS error code.
+     */
+    virtual TInt AddSameARFileDetails();
+        
+    /**
+     * Add empty title file details
+     * @return symbian OS error code.
+     */
+    virtual TInt AddEmptyTitleFileDetailsL();
+    
+    /**
+    * Create controller
+    */
+    void CreateController( const TDesC& aFileName, TInt aMode );
+
+    void TapOnScreen( TPointerEvent::TType aType, TPoint aPosition );
+
+    TInt ParseType( TDesC& aTypeName, TPointerEvent::TType& aType );
+
+    TFileName GetFileNameAndPath( TDesC& aFileName );
+
+    virtual TInt SetDownLoadSize(CStifItemParser&  aItem );
+    
+    virtual TInt SetDownLoadPostion(CStifItemParser&  aItem );
+
+    virtual TInt UpdateDownloadPosition( CStifItemParser&  aItem );
+
+    virtual TInt SetDownLoadPaused();
+    
+    virtual TInt ClearDownLoadPaused();
+    
+    virtual TInt TvOutConnected();
+    
+    virtual TInt TvOutDisconnected();
+    
+    virtual TInt HandleErrors();
+
+    virtual TInt SoftkeyPressed( CStifItemParser&  aItem );
+
+    virtual TInt ShowControls();
+
+    virtual TInt ToggleVisibility();
+
+    virtual TInt HandleBackgroundEvnet();
+    
+    virtual TInt ShowMediaDetailsViewer();
+    
+    virtual TInt CloseMediaDetailsViewer();
+
+    //[TestMethods] - Do not remove
+
+public:     
+    // Data
+    // ?one_line_short_description_of_data
+    //?data_declaration;
+
+protected:  
+    // Data
+    // ?one_line_short_description_of_data
+    //?data_declaration;
+
+private:    
+    // Data    
+    // ?one_line_short_description_of_data
+    //?data_declaration;
+
+    // Reserved pointer for future extension
+    //TAny* iReserved;
+
+public:     
+    // Friend classes
+    //?friend_class_declaration;
+    CMPXVideoPlaybackControlsController* iController;    
+
+protected:  
+    // Friend classes
+    //?friend_class_declaration;
+
+private:    
+    // Friend classes
+    //?friend_class_declaration;
+    CMPXVideoPlaybackContainer*          iContainer;
+    RWsSession                           iWsSession;
+};
+
+#endif      // VIDEOPLAYBACKCONTROLSTEST_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/init/testframework.ini	Thu Nov 04 11:16:56 2010 +0200
@@ -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'
+
+Timeout= 0                              # Default timeout value for each test case. In milliseconds
+UITestingSupport= 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\ui_videoplaybackcontrolstest.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:\LOGS\TestFramework\
+#EmulatorFormat= HTML         # Possible values: TXT or HTML
+#EmulatorOutput= FILE         # Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML         # 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/src/mpxvpbc_stub.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,459 @@
+/*
+* 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:  Test Harness for VideoPlaybackControls
+*
+*/
+
+// Version : %version: 16 %
+
+
+// INCLUDES
+#include <coeaui.h>
+#include <aknutils.h>
+#include <aknsutils.h>
+#include <aknviewappui.h>
+#include <aknsdrawutils.h>
+#include <aknsbasicbackgroundcontrolcontext.h>
+
+#include "mpxvideoplaybackviewfiledetails.h"
+#include "videoplaybackcontrolstest.h"
+#include "mpxvpbc_stub.h"
+#include "mpxvideoplaybackcontrolscontroller.h"
+#include "mpxhelixplaybackplugindefs.h"
+#include "mpxvpbuih_stub.h"
+#include "mpxcommonvideoplaybackview.hrh"
+#include "mpxvideo_debug.h"
+
+// CONSTANTS
+
+_LIT( KFileTitle, "asdfasdfasdfasdfasdfasd asdfasdfasdfasdfasdfasd" );
+
+const TInt KMaxFileTitleLength = 2048;
+
+
+// ============================ MEMBER FUNCTIONS ===================================================
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackContainer::CMPXVideoPlaybackContainer
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -------------------------------------------------------------------------------------------------
+//
+
+CMPXVideoPlaybackContainer::CMPXVideoPlaybackContainer()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackContainer::ConstructL()
+// Symbian 2nd phase constructor can leave.
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackContainer::ConstructL( const TDesC& aFileName )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackContainer::ConstructL()"));
+
+    iFileDetails = CMPXVideoPlaybackViewFileDetails::NewL();
+    iFileDetails->iClipName = HBufC::NewL( aFileName.Length() );
+    iFileDetails->iClipName->Des().Copy( aFileName );
+
+    CreateWindowL();
+
+    iUserInputHandler = CMPXVideoPlaybackUserInputHandler::NewL( this );
+
+    SetFocus( ETrue );
+
+    MakeVisible( ETrue );
+
+    ActivateL();
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackContainer::NewL()
+// Two-phased constructor.
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackContainer* CMPXVideoPlaybackContainer::NewL( const TDesC& aFileName )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackContainer::NewL( %S )"),&aFileName);
+
+    CMPXVideoPlaybackContainer* self = new (ELeave) CMPXVideoPlaybackContainer();
+
+
+    CleanupStack::PushL( self );
+    self->ConstructL( aFileName );
+    CleanupStack::Pop();
+
+    return self;
+}
+
+//
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackContainer::~CMPXVideoPlaybackContainer()
+// Destructor.
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackContainer::~CMPXVideoPlaybackContainer()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackContainer::~CMPXVideoPlaybackContainer()"));
+
+    if ( iFileDetails )
+    {
+        delete iFileDetails;
+        iFileDetails = NULL;
+    }
+
+    if ( iUserInputHandler )
+    {
+        delete iUserInputHandler;
+        iUserInputHandler = NULL;
+    }
+
+    CloseWindow();
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackContainer::CountComponentControls
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMPXVideoPlaybackContainer::CountComponentControls() const
+{
+    return 0;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackContainer::Draw
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackContainer::Draw(const TRect& aRect) const
+{
+    CWindowGc& gc = SystemGc();
+
+    gc.SetPenStyle( CGraphicsContext::ENullPen );
+    gc.SetBrushColor( KRgbBlack );
+    gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
+    gc.DrawRect( aRect );
+}
+
+//
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackContainer::HandleCommandL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackContainer::HandleCommandL( TInt aCommand, TInt aValue )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackContainer::HandleCommandL(aCommand=%d,aValue=%d)"),aCommand,aValue);
+
+    iCommand = aCommand;
+    iValue = aValue;
+}
+
+//
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackContainer::ExpectedResultL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackContainer::ExpectedResultL( TInt aCommand, TInt aValue )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackContainer::ExpectedResultL(aCommand=%d,aValue=%d)"),aCommand,aValue);
+
+    if ( aCommand == iCommand )
+    {
+        if ( iValue != aValue )
+        {
+            if ( aCommand == EMPXPbvCmdSetVolume )
+            {
+                if ( Abs( iValue - aValue ) > 6 )
+                {
+                    User::Leave( KErrGeneral );
+                }
+            }
+            else
+            {
+                User::Leave( KErrGeneral );
+            }
+        }
+    }
+    else
+    {
+
+        User::Leave( KErrGeneral );
+    }
+}
+
+//
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackContainer::SetController()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackContainer::SetController(
+    CMPXVideoPlaybackControlsController* aControlsController )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackContainer::SetController()"));
+
+    iControlsController = aControlsController;
+}
+
+//
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackContainer::AddFileDetailsL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackContainer::AddFileDetailsL( TBool aHasVideoTrack )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackContainer::AddFileDetailsL() "));
+
+    iFileDetails->iAudioEnabled = ETrue;
+    iFileDetails->iVideoEnabled = aHasVideoTrack;
+    iFileDetails->iSeekable = ETrue;
+
+    iFileDetails->iTitle    = _L("Test Title").Alloc();
+
+    if ( iFileDetails->iVideoEnabled )
+    {
+        iFileDetails->iVideoHeight = 176;
+        iFileDetails->iVideoWidth = 144;
+
+        iFileDetails->iBitRate = 8000;
+        iFileDetails->iMimeType = _L("video/3gp").Alloc();
+    }
+
+    if ( iFileDetails->iPlaybackMode == EMPXVideoLiveStreaming )
+    {
+        iFileDetails->iSeekable = EFalse;
+    }
+
+    iControlsController->AddFileDetailsL( iFileDetails );
+}
+
+//
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackContainer::AddFileDetailsL()
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackViewFileDetails*
+CMPXVideoPlaybackContainer::FileDetails( TInt aMode )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackContainer::AddFileDetailsL() "));
+
+    iFileDetails->iPlaybackMode = (TMPXVideoMode)aMode;
+
+    return iFileDetails;
+}
+
+// -------------------------------------------------------------------------------------------------
+// From CCoeControl
+// Handles key events.
+// -------------------------------------------------------------------------------------------------
+//
+TKeyResponse CMPXVideoPlaybackContainer::OfferKeyEventL( const TKeyEvent& aKeyEvent,
+                                                         TEventCode aType )
+{
+    iKeyResponse = EKeyWasNotConsumed;
+
+    iUserInputHandler->ProcessKeyEventL( aKeyEvent, aType );
+
+    return iKeyResponse;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackContainer::DoHandleKeyEventL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackContainer::DoHandleKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackContainer::DoHandleKeyEventL()"));
+
+    switch ( aKeyEvent.iScanCode )
+    {
+        case EStdKeyDevice3:        // rocker middle key
+        case EStdKeyEnter:          // enter key on a qwerty key board
+        {
+            HandleCommandL(EMPXPbvCmdPlayPause);
+            iKeyResponse = EKeyWasConsumed;
+            break;
+        }
+        case EStdKeyUpArrow:        // rocker up key
+        {
+            HandleCommandL(EMPXPbvCmdIncreaseVolume);
+            iKeyResponse = EKeyWasConsumed;
+            break;
+        }
+        case EStdKeyDownArrow:      // rocker down key
+        {
+            HandleCommandL( EMPXPbvCmdDecreaseVolume );
+            iKeyResponse = EKeyWasConsumed;
+            break;
+        }
+        case EStdKeyLeftArrow:      // rocker left key
+        {
+            if (aType == EEventKeyDown)
+            {
+                HandleCommandL(EMPXPbvCmdSeekBackward);
+            }
+            else if (aType == EEventKeyUp)
+            {
+                HandleCommandL(EMPXPbvCmdEndSeek);
+            }
+
+            iKeyResponse = EKeyWasConsumed;
+            break;
+        }
+        case EStdKeyRightArrow:     // rocker right key
+        {
+            if (aType == EEventKeyDown)
+            {
+                HandleCommandL(EMPXPbvCmdSeekForward);
+            }
+            else if (aType == EEventKeyUp)
+            {
+                HandleCommandL(EMPXPbvCmdEndSeek);
+            }
+
+            iKeyResponse = EKeyWasConsumed;
+            break;
+        }
+        case EStdKeyYes:            // green/send key
+        {
+            // in playback view we dont want to take any action
+            // just consume the key
+            iKeyResponse = EKeyWasConsumed;
+            break;
+        }
+        default:
+        {
+            break;
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackContainer::UserInputHandler()
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackUserInputHandler* CMPXVideoPlaybackContainer::UserInputHandler()
+{
+    return iUserInputHandler;
+}
+
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackContainer::AddLongFileDetailsL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackContainer::AddLongFileDetailsL( TBool aHasVideoTrack )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackContainer::AddFileDetailsL() "));
+
+    iFileDetails->iAudioEnabled = ETrue;
+    iFileDetails->iVideoEnabled = aHasVideoTrack;
+    iFileDetails->iSeekable = ETrue;
+
+    HBufC* temp = HBufC::NewLC(KMaxFileTitleLength);
+    TPtr fileTitlePtr = temp->Des();
+
+    const int loop = 10;
+    for ( int i=0; i<loop; i++ )
+    {
+        fileTitlePtr.Append( KFileTitle() );
+    }
+    iFileDetails->iTitle  = fileTitlePtr.Alloc();
+    CleanupStack::PopAndDestroy();  //temp
+
+    if ( iFileDetails->iVideoEnabled )
+    {
+        iFileDetails->iVideoHeight = 176;
+        iFileDetails->iVideoWidth = 144;
+
+        iFileDetails->iBitRate = 8000;
+        iFileDetails->iMimeType = _L("video/3gp").Alloc();
+    }
+
+    if ( iFileDetails->iPlaybackMode == EMPXVideoLiveStreaming )
+    {
+        iFileDetails->iSeekable = EFalse;
+    }
+
+    iControlsController->AddFileDetailsL( iFileDetails );
+}
+
+
+void CMPXVideoPlaybackContainer::HandlePointerEventL( const TPointerEvent& aPointerEvent )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackContainer::HandlePointerEventL()"));
+
+    MPX_DEBUG(_L("   iType = %d, iPosition = (%d,%d)"),
+       aPointerEvent.iType, aPointerEvent.iPosition.iX, aPointerEvent.iPosition.iY );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackContainer::AddSameARFileDetailsL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackContainer::AddSameARFileDetailsL( TBool aHasVideoTrack )
+{
+    MPX_ENTER_EXIT( _L( "CMPXVideoPlaybackContainer::AddSameARFileDetailsL() ") );
+
+    iFileDetails->iAudioEnabled = ETrue;
+    iFileDetails->iVideoEnabled = aHasVideoTrack;
+    iFileDetails->iSeekable = ETrue;
+
+    if ( iFileDetails->iVideoEnabled )
+    {
+        iFileDetails->iVideoHeight = this->Rect().Height();
+        iFileDetails->iVideoWidth = this->Rect().Width();
+
+        iFileDetails->iBitRate = 8000;
+        iFileDetails->iMimeType = _L("video/3gp").Alloc();
+    }
+
+    if ( iFileDetails->iPlaybackMode == EMPXVideoLiveStreaming )
+    {
+        iFileDetails->iSeekable = EFalse;
+    }
+
+    iControlsController->AddFileDetailsL( iFileDetails );
+}
+
+//
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackContainer::AddEmptyTitleFileDetailsL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackContainer::AddEmptyTitleFileDetailsL( TBool aHasVideoTrack )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackContainer::AddEmptyTitleFileDetailsL() "));
+
+    iFileDetails->iAudioEnabled = ETrue;
+    iFileDetails->iVideoEnabled = aHasVideoTrack;
+    iFileDetails->iSeekable = ETrue;
+
+    if ( iFileDetails->iVideoEnabled )
+    {
+        iFileDetails->iVideoHeight = 176;
+        iFileDetails->iVideoWidth = 144;
+
+        iFileDetails->iBitRate = 8000;
+        iFileDetails->iMimeType = _L("video/3gp").Alloc();
+    }
+
+    if ( iFileDetails->iPlaybackMode == EMPXVideoLiveStreaming )
+    {
+        iFileDetails->iSeekable = EFalse;
+    }
+
+    iControlsController->AddFileDetailsL( iFileDetails );
+}
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/src/mpxvpbuih_stub.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,184 @@
+/*
+* 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:  Implementation of playback view's input handler
+*
+*/
+
+// Version : %version: 8 %
+
+
+
+// INCLUDE FILES
+#include <w32std.h> // RWindowBase
+#include <e32base.h>
+#include <stringloader.h>
+#include <aknutils.h>
+#include <eikclbd.h>
+#include <aknconsts.h>
+#include <AknUtils.h>
+#include <AknIconUtils.h>  // SetSize for the icons
+#include <remconcoreapi.h>
+#include <RemConCoreApiTarget.h>
+#include <remconinterfaceselector.h> // Side volume key
+#include <mpxplaybackframeworkdefs.h>
+
+#include "mpxvpbc_stub.h"
+#include "mpxvideoplaybackcontrol.hrh"
+#include "mpxvpbuih_stub.h"
+
+#include <mpxvideoplaybackdefs.h>
+#include "mpxcommonvideoplaybackview.hrh"
+#include "mpxvideo_debug.h"
+
+
+// CONSTANTS
+
+// ======== MEMBER FUNCTIONS =======================================================================
+
+// -------------------------------------------------------------------------------------------------
+// MPXVideoPlaybackUserInputHandler::CMPXVideoPlaybackUserInputHandler()
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackUserInputHandler::CMPXVideoPlaybackUserInputHandler(CMPXVideoPlaybackContainer* aContainer)
+   : iContainer(aContainer)
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackUserInputHandler::NewL()
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackUserInputHandler* CMPXVideoPlaybackUserInputHandler::NewL(
+        CMPXVideoPlaybackContainer* aContainer)
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackUserInputHandler::NewL()"));
+
+    CMPXVideoPlaybackUserInputHandler* self = new (ELeave) CMPXVideoPlaybackUserInputHandler( aContainer );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackUserInputHandler::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackUserInputHandler::ConstructL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackUserInputHandler::ConstructL()"));
+
+    iProcessingInputType = EMpxVideoNone;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackUserInputHandler::~CMPXVideoPlaybackUserInputHandler()
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackUserInputHandler::~CMPXVideoPlaybackUserInputHandler()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackUserInputHandler::ProcessPointerEvent()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackUserInputHandler::ProcessPointerEventL( CCoeControl* aControl,
+                                                              const TPointerEvent& aPointerEvent,
+                                                              TMPXVideoControlType /*aMPXControl*/ )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackUserInputHandler::ProcessPointerEvent"));
+
+    MPX_DEBUG(_L("   iType = %d, iPosition = (%d,%d)"),
+       aPointerEvent.iType, aPointerEvent.iPosition.iX, aPointerEvent.iPosition.iY );
+
+    switch (iProcessingInputType)
+    {
+        case EMpxVideoNone:
+        {
+            if (aPointerEvent.iType == TPointerEvent::EButton1Down)
+            {
+                iProcessingInputType = EMpxVideoTouch;
+                static_cast<CMPXVideoPlaybackControl*>(aControl)->DoHandlePointerEventL( aPointerEvent );
+            }
+            break;
+        }
+        case EMpxVideoTouch:
+        {
+            if (aPointerEvent.iType != TPointerEvent::EButton1Down)
+            {
+                static_cast<CMPXVideoPlaybackControl*>(aControl)->DoHandlePointerEventL( aPointerEvent );
+
+                // reset the value only on pointer up event - but not on drag
+                if ( aPointerEvent.iType == TPointerEvent::EButton1Up )
+                {
+                    iProcessingInputType = EMpxVideoNone;
+                }
+            }
+            break;
+        }
+        default:
+        {
+            // user input is disallowed
+            break;
+        }
+    } // switch
+}
+
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackUserInputHandler::ProcessKeyEvent()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackUserInputHandler::ProcessKeyEventL( const TKeyEvent& aKeyEvent,
+                                                          TEventCode aType )
+{
+    MPX_DEBUG(_L("MPXVideoPlaybackUserInputHandler::ProcessKeyEvent"));
+
+    switch (iProcessingInputType)
+    {
+        case EMpxVideoNone:
+        {
+            if (aType == EEventKeyDown)
+            {
+                iProcessingInputType = EMpxVideoKeyboard;
+                iLastPressedKeyScanCode = aKeyEvent.iScanCode;
+                iContainer->DoHandleKeyEventL(aKeyEvent, aType);
+            }
+            break;
+        }
+        case EMpxVideoKeyboard:
+        {
+            if ( aKeyEvent.iScanCode == iLastPressedKeyScanCode )
+            {
+                iContainer->DoHandleKeyEventL( aKeyEvent, aType );
+
+                if ( aType == EEventKeyUp )
+                {
+                    iProcessingInputType = EMpxVideoNone;
+                }
+            }
+
+            break;
+        }
+        default:
+        {
+            // user input is disallowed
+            break;
+        }
+    } // switch
+}
+
+// EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/src/mpxvpbvfd_stub.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,181 @@
+/*
+* 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:  class for MPX Video File Details
+*
+*/
+
+// Version : %version: e003sa33#8 %
+
+
+//
+//  INCLUDE FILES
+//
+#include <f32file.h>
+#include <uri16.h>
+
+#include "mpxvideo_debug.h"
+#include "mpxvideoplaybackviewfiledetails.h"
+
+// ============================ MEMBER FUNCTIONS ===================================================
+
+CMPXVideoPlaybackViewFileDetails*
+CMPXVideoPlaybackViewFileDetails::NewL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackViewFileDetails::NewL()"));
+
+    CMPXVideoPlaybackViewFileDetails* p = new (ELeave) CMPXVideoPlaybackViewFileDetails();
+    CleanupStack::PushL(p);
+    p->ConstructL();
+    CleanupStack::Pop(p);
+    return p;
+}
+
+CMPXVideoPlaybackViewFileDetails::~CMPXVideoPlaybackViewFileDetails()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackViewFileDetails::~CMPXVideoPlaybackViewFileDetails()"));
+
+    ClearFileDetails();
+}
+
+void
+CMPXVideoPlaybackViewFileDetails::ConstructL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackViewFileDetails::ConstructL()"));
+    iPausableStream = ETrue;
+}
+
+void
+CMPXVideoPlaybackViewFileDetails::ClearFileDetails()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackViewFileDetails::ClearFileDetails()"));
+
+    if ( iMimeType )
+    {
+        delete iMimeType;
+        iMimeType = NULL;
+    }
+
+    if ( iTitle )
+    {
+        delete iTitle;
+        iTitle = NULL;
+    }
+
+    if ( iArtist )
+    {
+        delete iArtist;
+        iArtist = NULL;
+    }
+
+    if ( iClipName )
+    {
+        delete iClipName;
+        iClipName = NULL;
+    }
+
+    iSeekable = 0;
+
+    iAudioEnabled = 0;
+    iVideoEnabled = 0;
+
+    iDuration = 0;
+    iPausableStream = ETrue;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackViewFileDetails::GenerateFileNameL
+// -------------------------------------------------------------------------------------------------
+//
+EXPORT_C HBufC* CMPXVideoPlaybackViewFileDetails::GenerateFileNameL()
+{
+    MPX_ENTER_EXIT( _L( "CMPXVideoPlaybackViewFileDetails::GenerateFileNameL()" ) );
+    
+	HBufC* fileName = NULL;
+
+	if ( iClipName && iClipName->Length()
+			&& EMPXVideoStreaming != iPlaybackMode &&
+    		EMPXVideoLiveStreaming != iPlaybackMode )
+	{
+        //
+        // Get only file name for media details viewer 
+        //
+        TParsePtrC filePath( iClipName->Des() );
+        fileName = ( filePath.Name() ).AllocL();
+	}
+	
+    return fileName;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackViewFileDetails::GenerateFileTitleL
+// -------------------------------------------------------------------------------------------------
+//
+EXPORT_C HBufC* CMPXVideoPlaybackViewFileDetails::GenerateFileTitleL()
+{
+    MPX_ENTER_EXIT( _L( "CMPXVideoPlaybackViewFileDetails::GenerateFileTitleL()" ) );
+
+    HBufC* fileTitle = NULL;
+
+    if ( iTitle && iTitle->Length() )
+    {
+        //
+        // use file title in metadata as title cotent directly
+        //
+        fileTitle = iTitle->AllocL();
+    }
+    else if ( ( EMPXVideoStreaming == iPlaybackMode || EMPXVideoLiveStreaming == iPlaybackMode ) &&
+              iClipName && iClipName->Length() )
+    {
+        //
+        //  parse file name in URL
+        //
+        TUriParser parser;
+
+        if ( parser.Parse( iClipName->Des() ) == KErrNone )
+        {
+
+            MPX_DEBUG(
+                _L( "    streaming link: schema = %S, urihost = %S, uriPort = %S, uriPath = %S" ),
+                &( parser.Extract( EUriScheme ) ),
+                &( parser.Extract( EUriHost ) ),
+                &( parser.Extract( EUriPort ) ),
+                &( parser.Extract( EUriPath ) ) );
+
+            HBufC* nameAndTail = NULL;
+
+            MPX_TRAPD( err, nameAndTail = parser.GetFileNameL( EUriFileNameTail ) );
+
+            if ( KErrNone == err && nameAndTail )
+            {
+                CleanupStack::PushL( nameAndTail );
+                TInt extPos = nameAndTail->Des().LocateReverse( KExtDelimiter );
+
+                if ( extPos > 0 )
+                {
+                    fileTitle = ( nameAndTail->Des().Left( extPos ) ).AllocL();
+                }
+                else
+                {
+                    fileTitle = nameAndTail->Des().AllocL();
+                }
+
+                CleanupStack::PopAndDestroy( nameAndTail );
+            }
+        }
+    }
+
+    return fileTitle;
+}
+
+//  EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/src/videoplaybackcontrolstest.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,172 @@
+/*
+* 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:  Test Harness for VideoPlaybackControls
+*
+*/
+
+// Version : %version: ou1cpsw#4 %
+
+
+
+
+// INCLUDE FILES
+#include <aknutils.h>
+#include <aknviewappui.h> 
+#include <Stiftestinterface.h>
+#include <SettingServerClient.h>
+#include <akntoolbar.h>
+
+#include "videoplaybackcontrolstest.h"
+#include "mpxvideoplaybackcontrolscontroller.h"
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CVideoPlaybackControlsTest::CVideoPlaybackControlsTest
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CVideoPlaybackControlsTest::CVideoPlaybackControlsTest( 
+    CTestModuleIf& aTestModuleIf ):
+        CScriptBase( aTestModuleIf )
+{
+}
+
+// -----------------------------------------------------------------------------
+// CVideoPlaybackControlsTest::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CVideoPlaybackControlsTest::ConstructL()
+{
+    MPX_DEBUG(_L("CVideoPlaybackControlsTest::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(KVideoPlaybackControlsTestLogFileWithTitle, &title);
+    }
+    else
+    {
+        logFileName.Copy(KVideoPlaybackControlsTestLogFile);
+    }
+
+    iLog = CStifLogger::NewL( KVideoPlaybackControlsTestLogPath, 
+                          logFileName,
+                          CStifLogger::ETxt,
+                          CStifLogger::EFile,
+                          EFalse );
+    
+    SendTestClassVersion();
+
+    iAvkonViewAppUi->CurrentFixedToolbar()->SetToolbarVisibility( EFalse );
+
+    TInt err = iWsSession.Connect();
+}
+
+// -----------------------------------------------------------------------------
+// CVideoPlaybackControlsTest::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CVideoPlaybackControlsTest* CVideoPlaybackControlsTest::NewL( 
+    CTestModuleIf& aTestModuleIf )
+{
+    CVideoPlaybackControlsTest* self = 
+        new (ELeave) CVideoPlaybackControlsTest( aTestModuleIf );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+
+}
+
+// Destructor
+CVideoPlaybackControlsTest::~CVideoPlaybackControlsTest()
+{
+    iWsSession.Close();
+
+    // Delete resources allocated from test methods
+    Delete();
+
+    // Delete logger
+    delete iLog; 
+}
+
+//-----------------------------------------------------------------------------
+// CVideoPlaybackControlsTest::SendTestClassVersion
+// Method used to send version of test class
+//-----------------------------------------------------------------------------
+//
+void CVideoPlaybackControlsTest::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("ui_videoplaybackcontrolstest.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 ) // Backpointer to STIF Test Framework
+{
+
+    return ( CScriptBase* ) CVideoPlaybackControlsTest::NewL( aTestModuleIf );
+
+}
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/src/videoplaybackcontrolstestblocks.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,854 @@
+/*
+* 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:  Test Harness for VideoPlayControls
+*
+*/
+
+// Version : %version: 13 %
+
+
+// [INCLUDE FILES] - do not remove
+#include <e32svr.h>
+#include <e32std.h>
+#include <w32std.h>
+#include <coeaui.h>
+#include <aknutils.h>
+#include <aknviewappui.h>
+#include <StifParser.h>
+#include <Stiftestinterface.h>
+
+#include "mpxvideoplaybackviewfiledetails.h"
+#include "videoplaybackcontrolstest.h"
+#include "mpxcommonvideoplaybackview.hrh"
+#include "mpxvideoplaybackcontrolscontroller.h"
+#include "mpxvideoplaybackcontrol.hrh"
+#include "mpxvideo_debug.h"
+
+// CONSTANTS
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -------------------------------------------------------------------------------------------------
+// CVideoPlaybackControlsTest::Delete
+// Delete here all resources allocated and opened from test methods.
+// Called from destructor.
+// -------------------------------------------------------------------------------------------------
+//
+void CVideoPlaybackControlsTest::Delete()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// CVideoPlaybackControlsTest::RunMethodL
+// Run specified method. Contains also table of test mothods and their names.
+// -------------------------------------------------------------------------------------------------
+//
+TInt CVideoPlaybackControlsTest::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( "CreateControls", CVideoPlaybackControlsTest::CreateControls ),
+        ENTRY( "PointerEvent", CVideoPlaybackControlsTest::PointerEvent ),
+        ENTRY( "KeyEvent", CVideoPlaybackControlsTest::KeyEvent ),
+        ENTRY( "ExpectedResult",CVideoPlaybackControlsTest::ExpectedResult ),
+        ENTRY( "SetAspectRatio", CVideoPlaybackControlsTest::SetAspectRatio ),
+        ENTRY( "SetVolume", CVideoPlaybackControlsTest::SetVolume ),
+        ENTRY( "SetState", CVideoPlaybackControlsTest::SetState ),
+        ENTRY( "AddDefaultFileDetails", CVideoPlaybackControlsTest::AddDefaultFileDetails ),
+        ENTRY( "AddLongFileDetails", CVideoPlaybackControlsTest::AddLongFileDetails ),
+        ENTRY( "AddAudioOnlyFileDetails", CVideoPlaybackControlsTest::AddAudioOnlyFileDetails ),
+        ENTRY( "AddSameARFileDetails", CVideoPlaybackControlsTest::AddSameARFileDetails ),
+        ENTRY( "AddEmptyTitleFileDetails", CVideoPlaybackControlsTest::AddEmptyTitleFileDetailsL ),
+        ENTRY( "SetDuration", CVideoPlaybackControlsTest::SetDuration ),
+        ENTRY( "SoftkeyPressed", CVideoPlaybackControlsTest::SoftkeyPressed ),
+        ENTRY( "ShowControls", CVideoPlaybackControlsTest::ShowControls ),
+        ENTRY( "ToggleVisibility", CVideoPlaybackControlsTest::ToggleVisibility ),
+        ENTRY( "HandleBackgroundEvnet", CVideoPlaybackControlsTest::HandleBackgroundEvnet ),
+        ENTRY( "DeleteControls", CVideoPlaybackControlsTest::DeleteControls ),
+
+        // PDL test cases
+        ENTRY( "SetDownLoadSize", CVideoPlaybackControlsTest::SetDownLoadSize ),
+        ENTRY( "SetDownLoadPostion", CVideoPlaybackControlsTest::SetDownLoadPostion ),
+        ENTRY( "UpdateDownloadPosition", CVideoPlaybackControlsTest::UpdateDownloadPosition ),
+        ENTRY( "SetDownLoadPaused", CVideoPlaybackControlsTest::SetDownLoadPaused ),
+        ENTRY( "ClearDownLoadPaused", CVideoPlaybackControlsTest::ClearDownLoadPaused ),
+
+        // TV out cases
+        ENTRY( "TvOutConnected", CVideoPlaybackControlsTest::TvOutConnected ),
+        ENTRY( "TvOutDisconnected", CVideoPlaybackControlsTest::TvOutDisconnected ),
+
+        ENTRY( "HandleErrors", CVideoPlaybackControlsTest::HandleErrors ),
+
+        // Media Details Viewer
+        ENTRY( "ShowMediaDetailsViewer", CVideoPlaybackControlsTest::ShowMediaDetailsViewer ),
+        ENTRY( "CloseMediaDetailsViewer", CVideoPlaybackControlsTest::CloseMediaDetailsViewer )
+
+        //ADD NEW ENTRY HERE
+        // [test cases entries] - Do not remove
+    };
+
+    const TInt count = sizeof( KFunctions ) / sizeof( TStifFunctionInfo );
+
+    return RunInternalL( KFunctions, count, aItem );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CVideoPlaybackControlsTest::CreateController()
+// -------------------------------------------------------------------------------------------------
+//
+void CVideoPlaybackControlsTest::CreateController( const TDesC& aFileName, TInt aMode )
+{
+    MPX_DEBUG(_L("CVideoPlaybackControlsTest::CreateController( %S, %d )"), &aFileName, aMode );
+
+    TInt result = KErrGeneral;
+
+    if ( iAvkonViewAppUi->OrientationCanBeChanged() )
+    {
+        MPX_TRAPD( err, iAvkonViewAppUi->SetOrientationL( CAknAppUiBase::EAppUiOrientationLandscape ) );
+        MPX_DEBUG(_L("CVideoPlaybackControlsTest::CreateController() err = [%d]"), err);
+    }
+
+    TRect rect = iAvkonViewAppUi->ApplicationRect();
+
+    MPX_TRAP
+    (
+        result,
+        {
+            iContainer = CMPXVideoPlaybackContainer::NewL( aFileName );
+
+            iContainer->SetRect( rect );
+
+            CCoeEnv::Static()->AppUi()->AddToStackL( iContainer );
+
+            iController =
+                CMPXVideoPlaybackControlsController::NewL( iContainer,
+                                                           rect,
+                                                           iContainer->FileDetails( aMode ) );
+
+            iContainer->SetController( iController );
+        }
+    );
+
+    User::ResetInactivityTime();
+}
+
+// -------------------------------------------------------------------------------------------------
+// CVideoPlaybackControlsTest::DeleteControls()
+// -------------------------------------------------------------------------------------------------
+//
+TInt CVideoPlaybackControlsTest::DeleteControls()
+{
+    MPX_DEBUG(_L("CVideoPlaybackControlsTest::DeleteControls()"));
+
+    TInt err = KErrNone;
+
+    MPX_TRAP( err, iAvkonViewAppUi->SetOrientationL( CAknAppUiBase::EAppUiOrientationAutomatic ) );
+
+    if ( iController )
+    {
+        delete iController;
+        iController = NULL;
+    }
+
+    CCoeEnv::Static()->AppUi()->RemoveFromStack( iContainer );
+
+    if ( iContainer )
+    {
+        delete iContainer;
+        iContainer = NULL;
+    }
+
+    return err;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CVideoPlaybackControlsTest::CreateControls
+// -------------------------------------------------------------------------------------------------
+//
+TInt CVideoPlaybackControlsTest::CreateControls( CStifItemParser&  aItem )
+{
+    MPX_DEBUG(_L("CVideoPlaybackControlsTest::CreateControls()"));
+
+    TInt mode = 0;
+    TInt result = KErrNotFound;
+    TPtrC filename;
+
+    //
+    // get file name first
+    //
+    result = aItem.GetNextString( filename );
+
+    //
+    // get mode next
+    //
+    if ( result == KErrNone )
+    {
+        result = aItem.GetNextInt( mode );
+    }
+
+    //
+    // create controller
+    //
+    if ( result == KErrNone )
+    {
+        CreateController( GetFileNameAndPath( filename ), mode );
+        iContainer->DrawNow();
+    }
+
+    return result;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CVideoPlaybackControlsTest::SetAspectRatio
+// Test creation of a general playback command.
+// -------------------------------------------------------------------------------------------------
+//
+TInt CVideoPlaybackControlsTest::SetAspectRatio( CStifItemParser&  aItem )
+{
+    MPX_DEBUG(_L("CVideoPlaybackControlsTest::SetAspectRatio()"));
+
+    TInt aspectRatio = 0;
+    TInt result = aItem.GetNextInt( aspectRatio );
+
+    if ( result == KErrNone )
+    {
+        MPX_DEBUG(_L("CVideoPlaybackControlsTest::SetAspectRatio() [%d]"), aspectRatio);
+
+        MPX_TRAP(
+            result,
+            {
+                iController->HandleEventL( EMPXControlCmdSetAspectRatio, aspectRatio );
+                iController->HandleEventL( EMPXControlCmdCreateAspectRatioIcon );
+            } );
+    }
+
+    return result;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CVideoPlaybackControlsTest::SetVolume
+// Test creation of a general playback command.
+// -------------------------------------------------------------------------------------------------
+//
+TInt CVideoPlaybackControlsTest::SetVolume( CStifItemParser&  aItem )
+{
+    MPX_DEBUG(_L("CVideoPlaybackControlsTest::SetVolume()"));
+
+    TInt volume = 0;
+    TInt result = aItem.GetNextInt( volume );
+
+    if ( result == KErrNone )
+    {
+        MPX_DEBUG(_L("CVideoPlaybackControlsTest::SetVolume() [%d]"), volume);
+
+        MPX_TRAP( result, iController->HandleEventL( EMPXControlCmdSetVolume,
+                                                 (TInt64)volume ) );
+    }
+
+    return result;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CVideoPlaybackControlsTest::SetDuration
+// Test creation of a general playback command.
+// -------------------------------------------------------------------------------------------------
+//
+TInt CVideoPlaybackControlsTest::SetDuration( CStifItemParser&  aItem )
+{
+    TInt duration = 0;
+    TInt result = aItem.GetNextInt( duration );
+
+    MPX_DEBUG(_L("CVideoPlaybackControlsTest::SetDuration() [%d]"), duration);
+
+    if ( result == KErrNone )
+    {
+         MPX_TRAP( result, iController->HandleEventL( EMPXControlCmdSetDuration,
+                                                   (TInt64)duration ) );
+    }
+
+    return result;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CVideoPlaybackControlsTest::PointerEvent
+// -------------------------------------------------------------------------------------------------
+//
+TInt CVideoPlaybackControlsTest::PointerEvent( CStifItemParser&  aItem )
+{
+    MPX_DEBUG(_L("CVideoPlaybackControlsTest::PointerEvent()"));
+
+    _LIT( KEventTypeParameter, "eventtype=" );
+    _LIT( KPointerXParameter, "x=" );
+    _LIT( KPointerYParameter, "y=" );
+
+    TPointerEvent::TType type;
+    TPoint position;
+
+    TPtrC parameter;
+
+    TInt result = KErrNone;
+
+    while ( aItem.GetNextString( parameter ) == KErrNone )
+    {
+        if ( parameter.Find( KEventTypeParameter ) == 0 )
+        {
+            TPtrC parameterValue =
+                parameter.Right( parameter.Length() - KEventTypeParameter().Length() );
+
+            if ( ParseType( parameterValue, type ) != KErrNone )
+            {
+                result = KErrArgument;
+            }
+        }
+        else if ( parameter.Find( KPointerXParameter ) == 0 )
+        {
+            TPtrC parameterValue =
+                parameter.Right( parameter.Length() - KPointerXParameter().Length() );
+            TLex parameterValueParser( parameterValue );
+            if ( parameterValueParser.Val( position.iX ) != KErrNone )
+            {
+                result = KErrArgument;
+            }
+        }
+        else if ( parameter.Find( KPointerYParameter ) == 0 )
+        {
+            TPtrC parameterValue =
+                parameter.Right( parameter.Length() - KPointerYParameter().Length() );
+            TLex parameterValueParser( parameterValue );
+            if ( parameterValueParser.Val( position.iY ) != KErrNone )
+            {
+                result = KErrArgument;
+            }
+        }
+        else
+        {
+             result = KErrArgument;
+        }
+    }
+
+    TapOnScreen( type, position );
+
+    return result;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CVideoPlaybackControlsTest::KeyEvent
+// -------------------------------------------------------------------------------------------------
+//
+TInt CVideoPlaybackControlsTest::KeyEvent( CStifItemParser&  aItem )
+{
+    MPX_DEBUG(_L("CVideoPlaybackControlsTest::KeyEvent()"));
+
+    _LIT( KEventTypeParameter, "eventtype=" );
+    _LIT( KKeyScancode, "scancode=" );
+
+    _LIT( KKeyDown, "EEventKeyDown" );
+    _LIT( KKeyUp, "EEventKeyUp" );
+
+    TInt type = 0;
+    TInt scanCode = 0;
+    TPtrC parameter;
+
+    TInt result = KErrNone;
+
+    while ( aItem.GetNextString( parameter ) == KErrNone )
+    {
+        if ( parameter.Find( KEventTypeParameter ) == 0 )
+        {
+            TPtrC parameterValue =
+                parameter.Right( parameter.Length() - KEventTypeParameter().Length() );
+
+            if ( parameterValue.Compare(KKeyDown) == 0 )
+            {
+                type = EEventKeyDown;
+            }
+            else if ( parameterValue.Compare(KKeyUp) == 0 )
+            {
+                type = EEventKeyUp;
+            }
+
+        }
+        else if ( parameter.Find( KKeyScancode ) == 0 )
+        {
+            TPtrC parameterValue =
+                parameter.Right( parameter.Length() - KKeyScancode().Length() );
+            TLex parameterValueParser( parameterValue );
+            if ( parameterValueParser.Val( scanCode ) != KErrNone )
+            {
+                result = KErrArgument;
+            }
+        }
+        else
+        {
+             result = KErrArgument;
+        }
+    }
+
+
+    // Now send the key event
+
+    TRawEvent rawEvent;
+
+    if ( type == EEventKeyDown )
+    {
+        rawEvent.Set( TRawEvent::EKeyDown , scanCode );
+
+        iWsSession.SimulateRawEvent( rawEvent );
+        iWsSession.Flush();
+    }
+    else if ( type == EEventKeyUp )
+    {
+        rawEvent.Set( TRawEvent::EKeyUp, scanCode );
+
+        iWsSession.SimulateRawEvent( rawEvent );
+        iWsSession.Flush();
+    }
+
+    return result;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CVideoPlaybackControlsTest::ExpectedResult
+// -------------------------------------------------------------------------------------------------
+//
+TInt CVideoPlaybackControlsTest::ExpectedResult( CStifItemParser&  aItem )
+{
+    MPX_DEBUG(_L("CVideoPlaybackControlsTest::ExpectedResult()"));
+
+    TInt command = 0;
+    TInt value = 0 ;
+    TInt result = aItem.GetNextInt( command );
+
+    if ( result == KErrNone )
+    {
+        result = aItem.GetNextInt ( value );
+
+        if ( result == KErrNone  )
+        {
+            MPX_TRAP( result, iContainer->ExpectedResultL( command, value ) );
+        }
+    }
+
+    return result;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CVideoPlaybackControlsTest::SetState
+// -------------------------------------------------------------------------------------------------
+//
+TInt CVideoPlaybackControlsTest::SetState( CStifItemParser&  aItem )
+{
+    MPX_DEBUG(_L("CVideoPlaybackControlsTest::SetState()"));
+
+    TInt state = 0;
+    TInt result = aItem.GetNextInt( state );
+
+    if ( result == KErrNone )
+    {
+        MPX_TRAP( result, iController->HandleEventL( EMPXControlCmdStateChanged, state ) );
+    }
+
+    return result;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CVideoPlaybackControlsTest::AddDefaultFileDetails
+// -------------------------------------------------------------------------------------------------
+//
+TInt CVideoPlaybackControlsTest::AddDefaultFileDetails()
+{
+    MPX_DEBUG(_L("CVideoPlaybackControlsTest::AddDefaultFileDetails()"));
+
+    MPX_TRAPD( result, iContainer->AddFileDetailsL() );
+
+    return result;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CVideoPlaybackControlsTest::AddAudioOnlyFileDetails
+// -------------------------------------------------------------------------------------------------
+//
+TInt CVideoPlaybackControlsTest::AddAudioOnlyFileDetails()
+{
+    MPX_DEBUG(_L("CVideoPlaybackControlsTest::AddAudioOnlyFileDetails()"));
+
+    MPX_TRAPD( result, iContainer->AddFileDetailsL( EFalse ) );
+
+    return result;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CVideoPlaybackControlsTest::AddLongFileDetails
+// -------------------------------------------------------------------------------------------------
+//
+TInt CVideoPlaybackControlsTest::AddLongFileDetails()
+{
+    MPX_DEBUG(_L("CVideoPlaybackControlsTest::AddLongFileDetails()"));
+
+    MPX_TRAPD( result, iContainer->AddLongFileDetailsL() );
+
+    return result;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CVideoPlaybackControlsTest::AddSameARFileDetails
+// -------------------------------------------------------------------------------------------------
+//
+TInt CVideoPlaybackControlsTest::AddSameARFileDetails()
+{
+    MPX_ENTER_EXIT( _L( "CVideoPlaybackControlsTest::AddSameARFileDetails()" ) );
+
+    MPX_TRAPD( result, iContainer->AddSameARFileDetailsL() );
+
+    return result;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CVideoPlaybackControlsTest::AddEmptyTitleFileDetails
+// -------------------------------------------------------------------------------------------------
+//
+TInt CVideoPlaybackControlsTest::AddEmptyTitleFileDetailsL()
+{
+    MPX_ENTER_EXIT( _L( "CVideoPlaybackControlsTest::AddEmptyTitleFileDetailsL()" ) );
+
+    MPX_TRAPD( result, iContainer->AddEmptyTitleFileDetailsL() );
+
+    return result;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CVideoPlaybackControlsTest::ParseType
+// -------------------------------------------------------------------------------------------------
+//
+TInt CVideoPlaybackControlsTest::ParseType( TDesC& aTypeName,
+                                            TPointerEvent::TType& aType )
+{
+    MPX_DEBUG(_L("CVideoPlaybackControlsTest::ParseType()"));
+
+    TBool err = KErrNone;
+
+    _LIT( KButtonDown, "EButton1Down" );
+    _LIT( KButtonDrag, "EDrag" );
+    _LIT( KButtonUp, "EButton1Up" );
+
+    if ( aTypeName.Compare(KButtonDown) == 0 )
+    {
+        aType = TPointerEvent::EButton1Down;
+    }
+    else if( aTypeName.Compare(KButtonUp) == 0 )
+    {
+        aType = TPointerEvent::EButton1Up;
+    }
+    else if( aTypeName.Compare(KButtonDrag) == 0 )
+    {
+        aType = TPointerEvent::EDrag;
+    }
+    else
+    {
+        err = KErrNotFound;
+    }
+
+    return err;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CVideoPlaybackControlsTest::TapOnScreen
+// -------------------------------------------------------------------------------------------------
+//
+void CVideoPlaybackControlsTest::TapOnScreen( TPointerEvent::TType aType,
+                                              TPoint aPosition )
+{
+    MPX_DEBUG(_L("CVideoPlaybackControlsTest::TapOnScreen()"));
+
+    MPX_DEBUG(_L("   aType = %d, aPosition = (%d,%d)"), aType, aPosition.iX, aPosition.iY);
+
+    TPoint tapPoint( aPosition );
+
+#if !defined(__WINS__)
+
+    //
+    //  On the hardware, the window server is performing a rotation.
+    //  This calculation will adjust the points so the same touch point is received
+    //  on both the emulator and hardware
+    //
+    //  ix = ( ScreenWidth - 1 ) - oldPosition.iY - YOffset
+    //      I am not sure why they subtract 1 from the screen width, but they do
+    //      The YOffset can be read from the wsini.ini file
+    //
+    //  iy = oldPosition.iX
+    //
+    tapPoint.iX = ( 360 - 1 ) - aPosition.iY - 12;
+    tapPoint.iY = aPosition.iX;
+
+#endif
+
+    MPX_DEBUG(_L("   tapPosition = (%d,%d)"), tapPoint.iX, tapPoint.iY);
+
+    TRawEvent pointer;
+
+    if ( aType == TPointerEvent::EButton1Down )
+    {
+        pointer.Set( TRawEvent::EButton1Down, tapPoint.iX, tapPoint.iY );
+
+        iWsSession.SimulateRawEvent( pointer );
+        iWsSession.Flush();
+    }
+    else if ( aType == TPointerEvent::EButton1Up )
+    {
+        pointer.Set( TRawEvent::EButton1Up, tapPoint.iX, tapPoint.iY );
+
+        iWsSession.SimulateRawEvent( pointer );
+        iWsSession.Flush();
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CVideoPlaybackControlsTest::SetDownLoadSize
+// -------------------------------------------------------------------------------------------------
+//
+TInt CVideoPlaybackControlsTest::SetDownLoadSize( CStifItemParser& aItem )
+{
+    MPX_DEBUG(_L("CVideoPlaybackControlsTest::SetExpectedResult()"));
+
+    TInt size = 0;
+    TInt result = aItem.GetNextInt( size );
+
+    if ( result == KErrNone )
+    {
+        MPX_TRAP( result, iController->HandleEventL( EMPXControlCmdSetDownloadSize, size ) );
+    }
+
+    return result;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CVideoPlaybackControlsTest::SetDownLoadPostion
+// -------------------------------------------------------------------------------------------------
+//
+TInt CVideoPlaybackControlsTest::SetDownLoadPostion( CStifItemParser&  aItem )
+{
+    MPX_DEBUG(_L("CVideoPlaybackControlsTest::SetExpectedResult()"));
+
+    TInt position = 0;
+    TInt result = aItem.GetNextInt( position );
+
+    if ( result == KErrNone )
+    {
+        MPX_TRAP( result, iController->HandleEventL( EMPXControlCmdSetPosition, position ) );
+    }
+
+    return result;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CVideoPlaybackControlsTest::UpdateDownloadPosition
+// -------------------------------------------------------------------------------------------------
+//
+TInt CVideoPlaybackControlsTest::UpdateDownloadPosition( CStifItemParser&  aItem )
+{
+    MPX_DEBUG(_L("CVideoPlaybackControlsTest::UpdateDownloadPosition()"));
+
+    TInt position = 0;
+    TInt result = aItem.GetNextInt( position );
+
+    if ( result == KErrNone )
+    {
+        MPX_TRAP( result, iController->HandleEventL( EMPXControlCmdDownloadUpdated, position ) );
+    }
+
+    return result;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CVideoPlaybackControlsTest::SetDownLoadPaused
+// -------------------------------------------------------------------------------------------------
+//
+TInt CVideoPlaybackControlsTest::SetDownLoadPaused()
+{
+    MPX_DEBUG(_L("CVideoPlaybackControlsTest::SetDownLoadPaused()"));
+
+    MPX_TRAPD( result, iController->HandleEventL( EMPXControlCmdSetDownloadPaused) );
+
+    return result;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CVideoPlaybackControlsTest::ClearDownLoadPaused
+// -------------------------------------------------------------------------------------------------
+//
+TInt CVideoPlaybackControlsTest::ClearDownLoadPaused()
+{
+    MPX_DEBUG(_L("CVideoPlaybackControlsTest::ClearDownLoadPaused()"));
+
+    MPX_TRAPD( result, iController->HandleEventL( EMPXControlCmdClearDownloadPaused) );
+
+    return result;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CVideoPlaybackControlsTest::TvOutConnected
+// -------------------------------------------------------------------------------------------------
+//
+TInt CVideoPlaybackControlsTest::TvOutConnected()
+{
+    MPX_DEBUG(_L("CVideoPlaybackControlsTest::TvOutConnected()"));
+
+    MPX_TRAPD( result, iController->HandleEventL( EMPXControlCmdTvOutConnected ) );
+
+    return result;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CVideoPlaybackControlsTest::TvOutDisconnected
+// -------------------------------------------------------------------------------------------------
+//
+TInt CVideoPlaybackControlsTest::TvOutDisconnected()
+{
+    MPX_DEBUG(_L("CVideoPlaybackControlsTest::TvOutDisconnected()"));
+
+    MPX_TRAPD( result, iController->HandleEventL( EMPXControlCmdTvOutDisconnected ) );
+
+    return result;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CVideoPlaybackControlsTest::HandleErrors
+// -------------------------------------------------------------------------------------------------
+//
+TInt CVideoPlaybackControlsTest::HandleErrors()
+{
+    MPX_DEBUG(_L("CVideoPlaybackControlsTest::HandleErrors()"));
+
+    MPX_TRAPD( result, iController->HandleEventL( EMPXControlCmdHandleErrors ) );
+
+    return result;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CVideoPlaybackControlsTest::SoftkeyPressed
+// -------------------------------------------------------------------------------------------------
+//
+TInt CVideoPlaybackControlsTest::SoftkeyPressed( CStifItemParser&  aItem )
+{
+    MPX_DEBUG(_L("CVideoPlaybackControlsTest::SoftkeyPressed()"));
+
+    TInt key = 0;
+
+    TInt result = aItem.GetNextInt( key );
+
+    MPX_TRAP( result, iController->HandleEventL( EMPXControlCmdSoftKeyPressed, key ) );
+
+    return result;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CVideoPlaybackControlsTest::ShowControls
+// -------------------------------------------------------------------------------------------------
+//
+TInt CVideoPlaybackControlsTest::ShowControls()
+{
+    MPX_DEBUG(_L("CVideoPlaybackControlsTest::ShowControls()"));
+
+    MPX_TRAPD( result, iController->HandleEventL( EMPXControlCmdShowControls ) );
+
+    return result;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CVideoPlaybackControlsTest::ToggleVisibility
+// -------------------------------------------------------------------------------------------------
+//
+TInt CVideoPlaybackControlsTest::ToggleVisibility()
+{
+    MPX_DEBUG(_L("CVideoPlaybackControlsTest::ToggleVisibility()"));
+
+    MPX_TRAPD( result, iController->HandleEventL( EMPXControlCmdToggleVisibility ) );
+
+    return result;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CVideoPlaybackControlsTest::HandleBackgroundEvnet
+// -------------------------------------------------------------------------------------------------
+//
+TInt CVideoPlaybackControlsTest::HandleBackgroundEvnet()
+{
+    MPX_DEBUG(_L("CVideoPlaybackControlsTest::HandleBackgroundEvnet()"));
+
+    MPX_TRAPD( result, iController->HandleEventL( EMPXControlCmdHandleBackgroundEvent ) );
+
+    return result;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CVideoPlaybackControlsTest::GetFileNameAndPath
+// -------------------------------------------------------------------------------------------------
+//
+TFileName CVideoPlaybackControlsTest::GetFileNameAndPath( TDesC& aFileName )
+{
+    MPX_DEBUG(_L("CMpxVideoPlayer_AppUiEngineTester::GetFileNameAndPath()"));
+
+    TFileName fullPath;
+
+#ifdef __WINSCW__
+    _LIT( KVideoTestPath, "c:\\data\\Videos\\" );
+#else
+    _LIT( KVideoTestPath, "e:\\testing\\data\\" );
+#endif
+
+    _LIT( KStreamingPrefix, "rtsp:" );
+
+    if ( aFileName.Find( KStreamingPrefix ) < 0 )
+    {
+        fullPath.Append( KVideoTestPath );
+    }
+
+    fullPath.Append( aFileName );
+
+    return fullPath;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CVideoPlaybackControlsTest::ShowMediaDetailsViewer
+// -------------------------------------------------------------------------------------------------
+//
+TInt CVideoPlaybackControlsTest::ShowMediaDetailsViewer()
+{
+    MPX_DEBUG(_L("CVideoPlaybackControlsTest::ShowMediaDetailsViewer()"));
+
+    MPX_TRAPD( result, iController->HandleEventL( EMPXControlCmdShowFileDetailsViewer ) );
+
+    return result;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CVideoPlaybackControlsTest::CloseMediaDetailsViewer
+// -------------------------------------------------------------------------------------------------
+//
+TInt CVideoPlaybackControlsTest::CloseMediaDetailsViewer()
+{
+    MPX_DEBUG(_L("CVideoPlaybackControlsTest::CloseMediaDetailsViewer()"));
+
+    MPX_TRAPD( result, iController->HandleEventL( EMPXControlCmdCloseFileDetailsViewer ) );
+
+    return result;
+}
+
+// ========================== OTHER EXPORTED FUNCTIONS =============================================
+// None
+
+//  [End of File] - Do not remove
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviewplugin/data/200159ac.rss	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,82 @@
+/*
+* 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:  Resource definitions for project mpxvideoplaybackviewplugin
+*
+*/
+
+// Version : %version: 4 %
+
+
+
+
+// INCLUDES
+#include <ecom/registryinfo.rh>
+#include <mpxviewplugin.hrh>
+
+#include "mpxvideoplaybackuids.hrh"
+
+// RESOURCE DEFINITIONS 
+
+/**
+ * The opaque_data syntax is made up of three parts: 
+ * a list of Uids for resolving the view plugin, feature flags, priority.
+ * 
+ * <p>uid1;uid2;uid3</p>
+ *  uid*: uid of the supported Playback/Collection plugin.
+ *  E.g. if the view plugin supports Local Playback plugin, the list of
+ *  uids will be: 0x101FFC06
+ *
+ * <t>uid</t>
+ *  uid: plugin type uid.
+ *  E.g. if the view plugin supports playback type, uid will be: 0x101FFCA0
+ *
+ * <f>flags</f> [optional]
+ *  flags: sum of the required feature flags that listed in mpxviewplugin.hrh. 
+ *  E.g. if the view plugin needs to be pre-loaded and it's user-selectable,
+ *  then flags = KMPXVpFeaturePreLoaded + KMPXVpFeatureUserSelectable = 0x0003.
+ *
+ * <i>priority</i> [optional]
+ *  priority: a value of type TMPXViewPluginPriorities. This value determines
+ *  which view plugin will be resolved when several plugins can support the 
+ *  same set of Uids. 
+ *  Default value of this field is EMPXViewPluginPriorityNormal.
+ */
+RESOURCE REGISTRY_INFO theInfo
+    {
+    dll_uid = KMPXVIDEOPLAYBACKVIEWPLUGINUID;
+
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            interface_uid = KMPXViewPluginInterfaceUid;
+            implementations = 
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = KMPXVIDEOPLAYBACKVIEWPLUGINIMPLEMENTATIONUID;
+                    version_no = 1;
+                    display_name = "Video playback view plugin";
+                    default_data = "";
+                    opaque_data = "<p>0x10282551</p>"
+                                  "<t>0x101FFCA0</t>"
+                                  "<f>0x0002</f>"
+                                  "<i>"EMPXViewPluginPriorityHighest"</i>";
+                    }
+                };
+            }
+        };
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviewplugin/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* 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:  Build information file for project mpxvideoplaybackviewplugin.
+*
+*/
+
+// Version : %version: 5 %
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/mpxvideoplaybackviewplugin.iby      CORE_APP_LAYER_IBY_EXPORT_PATH(mpxvideoplaybackviewplugin.iby)
+
+PRJ_MMPFILES
+mpxvideoplaybackviewplugin.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviewplugin/group/mpxvideoplaybackviewplugin.mmp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,54 @@
+/*
+* 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 mpxvideoplaybackviewplugin.
+*
+*/
+
+// Version : %version: 6 %
+
+
+#include <data_caging_paths.hrh>
+#include <bldvariant.hrh>
+#include <platform_paths.hrh>
+
+TARGET              mpxvideoplaybackviewplugin.dll
+TARGETTYPE          PLUGIN
+UID                 0x10009D8D 0x200159AC
+
+CAPABILITY          CAP_ECOM_PLUGIN
+VENDORID            VID_DEFAULT
+
+SOURCEPATH          ../src
+
+SOURCE              mpxvideoplaybackviewplugin.cpp 
+SOURCE              mpxvideoplaybackviewpluginproxy.cpp
+
+START RESOURCE      ../data/200159ac.rss
+TARGET              mpxvideoplaybackviewplugin.rsc
+HEADER
+LANGUAGE_IDS 
+END // RESOURCE
+
+USERINCLUDE         ../inc
+USERINCLUDE         ../../inc
+USERINCLUDE         ../../../inc
+
+APP_LAYER_SYSTEMINCLUDE
+
+LIBRARY             euser.lib 
+LIBRARY             mpxviewplugin.lib 
+LIBRARY             mpxvideoplaybackviews.lib
+LIBRARY             flogger.lib
+
+// EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviewplugin/inc/mpxvideoplaybackviewplugin.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,63 @@
+/*
+* 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:  MPX Video playback view plugin definition.
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+// This file defines the API for mpxvideoplaybackviewplugin.dll
+
+#ifndef __VIDEOPLAYBACKVIEWPLUGIN_H__
+#define __VIDEOPLAYBACKVIEWPLUGIN_H__
+
+//  Include Files
+
+#include <e32base.h>
+#include <e32std.h>
+
+#include "mpxaknviewplugin.h"
+
+//  Constants
+
+
+//  Class Definitions
+
+NONSHARABLE_CLASS( CMPXVideoPlaybackViewPlugin ) : public CMPXAknViewPlugin
+{
+    public:
+        static CMPXVideoPlaybackViewPlugin* NewL();
+        static CMPXVideoPlaybackViewPlugin* NewLC();
+        ~CMPXVideoPlaybackViewPlugin();
+
+    public:
+        /*
+         * From CMPXAknViewPlugin
+         * Construct Avkon view.
+         *
+         * @since S60 v3.0
+         * @return Pointer to a newly created Avkon view.
+         */
+        CAknView* ConstructViewLC();
+
+    private: 
+        CMPXVideoPlaybackViewPlugin();
+        void ConstructL();
+};
+
+#endif  // __VIDEOPLAYBACKVIEWPLUGIN_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviewplugin/rom/mpxvideoplaybackviewplugin.iby	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,27 @@
+/*
+* 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: IBY for mpxvideoplaybackviewplugin.dll
+*
+*/
+
+// Version : %version: 2 %
+
+#ifndef __MPXVIDEOPLAYBACKVIEWPLUGIN_IBY__
+#define __MPXVIDEOPLAYBACKVIEWPLUGIN_IBY__
+
+#include <data_caging_paths_for_iby.hrh>
+
+ECOM_PLUGIN( mpxvideoplaybackviewplugin.dll, mpxvideoplaybackviewplugin.rsc )
+
+#endif // __MPXVIDEOPLAYBACKVIEWPLUGIN_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviewplugin/src/mpxvideoplaybackviewplugin.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,67 @@
+/*
+* 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:  Implementation of Video Playback view plugin
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+//  Include Files  
+
+#include "mpxvideoplaybackview.h"
+#include "mpxvideoplaybackviewplugin.h"
+
+//  Member Functions
+
+CMPXVideoPlaybackViewPlugin* CMPXVideoPlaybackViewPlugin::NewLC()
+{
+	CMPXVideoPlaybackViewPlugin* self = new (ELeave) CMPXVideoPlaybackViewPlugin;
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	return self;
+}
+
+CMPXVideoPlaybackViewPlugin* CMPXVideoPlaybackViewPlugin::NewL()
+{
+	CMPXVideoPlaybackViewPlugin* self = CMPXVideoPlaybackViewPlugin::NewLC();
+	CleanupStack::Pop(self);
+	return self;
+}
+
+CMPXVideoPlaybackViewPlugin::CMPXVideoPlaybackViewPlugin()
+// note, CBase initialises all member variables to zero
+{
+}
+
+void CMPXVideoPlaybackViewPlugin::ConstructL()
+{
+}
+
+CMPXVideoPlaybackViewPlugin::~CMPXVideoPlaybackViewPlugin()
+{
+}
+
+// ---------------------------------------------------------------------------
+// From CMPXAknViewPlugin
+// Construct Avkon view.
+// ---------------------------------------------------------------------------
+//
+CAknView* CMPXVideoPlaybackViewPlugin::ConstructViewLC()
+{
+    return CMPXVideoPlaybackView::NewLC();
+}
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviewplugin/src/mpxvideoplaybackviewpluginproxy.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,56 @@
+/*
+* 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:  Standard proxy of the ECOM plugin
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+// INCLUDE FILES
+#include <ecom/implementationproxy.h>
+
+#include "mpxvideoplaybackuids.hrh"
+#include "mpxvideoplaybackviewplugin.h"
+
+#if ( !defined IMPLEMENTATION_PROXY_ENTRY )
+typedef TAny* TProxyNewLPtr;
+#define IMPLEMENTATION_PROXY_ENTRY( aUid,aFuncPtr ) { { aUid }, ( TProxyNewLPtr )( aFuncPtr ) }
+#endif
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// The list of implementations
+// ---------------------------------------------------------------------------
+//
+const TImplementationProxy ImplementationTable[] = 
+{ 
+    IMPLEMENTATION_PROXY_ENTRY( KMPXVIDEOPLAYBACKVIEWPLUGINIMPLEMENTATIONUID,
+                                CMPXVideoPlaybackViewPlugin::NewL ) 
+};
+
+// ---------------------------------------------------------------------------
+// The proxy of implementations
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount )
+{
+    aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy );
+    return ImplementationTable;
+}
+
+// EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviews/bwins/mpxvideoplaybackviewsu.def	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,15 @@
+EXPORTS
+	?ProcessPointerEventL@CMPXVideoPlaybackUserInputHandler@@QAEXPAVCCoeControl@@ABUTPointerEvent@@W4TMPXVideoControlType@@@Z @ 1 NONAME ; void CMPXVideoPlaybackUserInputHandler::ProcessPointerEventL(class CCoeControl *, struct TPointerEvent const &, enum TMPXVideoControlType)
+	??1CMPXVideoPlaybackUserInputHandler@@UAE@XZ @ 2 NONAME ; CMPXVideoPlaybackUserInputHandler::~CMPXVideoPlaybackUserInputHandler(void)
+	?UserInputHandler@CMPXVideoPlaybackContainer@@QAEPAVCMPXVideoPlaybackUserInputHandler@@XZ @ 3 NONAME ; class CMPXVideoPlaybackUserInputHandler * CMPXVideoPlaybackContainer::UserInputHandler(void)
+	?NewL@CMPXVideoPdlPlaybackView@@SAPAV1@XZ @ 4 NONAME ; class CMPXVideoPdlPlaybackView * CMPXVideoPdlPlaybackView::NewL(void)
+	?DoHandlePointerEventL@CMPXVideoPlaybackContainer@@QAEXABUTPointerEvent@@@Z @ 5 NONAME ; void CMPXVideoPlaybackContainer::DoHandlePointerEventL(struct TPointerEvent const &)
+	?HandleCommandL@CMPXVideoPlaybackContainer@@QAEXHH@Z @ 6 NONAME ; void CMPXVideoPlaybackContainer::HandleCommandL(int, int)
+	?NewL@CMPXVideoPlaybackUserInputHandler@@SAPAV1@PAVCMPXVideoPlaybackContainer@@@Z @ 7 NONAME ; class CMPXVideoPlaybackUserInputHandler * CMPXVideoPlaybackUserInputHandler::NewL(class CMPXVideoPlaybackContainer *)
+	?NewLC@CMPXVideoPlaybackView@@SAPAV1@XZ @ 8 NONAME ; class CMPXVideoPlaybackView * CMPXVideoPlaybackView::NewLC(void)
+	?NewLC@CMPXVideoPdlPlaybackView@@SAPAV1@XZ @ 9 NONAME ; class CMPXVideoPdlPlaybackView * CMPXVideoPdlPlaybackView::NewLC(void)
+	?NewL@CMPXVideoPlaybackView@@SAPAV1@XZ @ 10 NONAME ; class CMPXVideoPlaybackView * CMPXVideoPlaybackView::NewL(void)
+	?DoHandleKeyEventL@CMPXVideoPlaybackContainer@@QAEXABUTKeyEvent@@W4TEventCode@@@Z @ 11 NONAME ; void CMPXVideoPlaybackContainer::DoHandleKeyEventL(struct TKeyEvent const &, enum TEventCode)
+	?GenerateFileNameL@CMPXVideoPlaybackViewFileDetails@@QAEPAVHBufC16@@XZ @ 12 NONAME ; class HBufC16 * CMPXVideoPlaybackViewFileDetails::GenerateFileNameL(void)
+	?GenerateFileTitleL@CMPXVideoPlaybackViewFileDetails@@QAEPAVHBufC16@@XZ @ 13 NONAME ; class HBufC16 * CMPXVideoPlaybackViewFileDetails::GenerateFileTitleL(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviews/data/mpxvideoplaybackviews.rss	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,319 @@
+/*
+* 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:  Resource definitions for project mpxvideoplaybackviews
+*
+*/
+
+// Version : %version: 8 %
+
+
+// RESOURCE NAME IDENTIFIER
+NAME    MVPV // 4 letter ID
+
+// INCLUDES
+#include <avkon.rsg>
+#include <avkon.rh>
+#include <avkon.loc>
+#include <eikon.rh>
+#include <avkon.mbg>
+#include <bldvariant.hrh>
+#include <mpxvideoplaybackviews.loc>
+
+#include "mpxcommonvideoplaybackview.hrh"
+
+//  CONSTANTS
+
+// RESOURCE IDENTIFIER
+RESOURCE RSS_SIGNATURE { }
+
+RESOURCE TBUF
+{
+    buf = "";
+}
+
+// -------------------------------------------------------------------------------------------------
+//
+//    r_mpx_video_playback_view_menu
+//
+// -------------------------------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_mpx_video_playback_view_menu
+{
+    items=
+    {
+        MENU_ITEM
+        {
+            command = EMPXPbvCmdChangeAspectRatio;
+            txt = qtn_mpx_video_option_change_asp_ratio;
+            cascade = r_mpx_aspectratio_cascade;
+        },
+        MENU_ITEM
+        {
+             command = EMPXPbvCmdShowFileDetails;
+             txt = qtn_mpx_video_option_show_file_details;
+        },
+        MENU_ITEM
+        {
+            command = EAknCmdExit;
+            txt = qtn_options_exit;
+        }
+    };
+}
+
+//--------------------------------------------------------------------------------------------------
+//
+//    r_mpx_aspectratio_cascade
+//
+//--------------------------------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_mpx_aspectratio_cascade
+{
+    items =
+    {
+        MENU_ITEM
+        {
+            command = EMPXPbvCmdNaturalAspectRatio;
+            txt = qtn_mpx_video_aspect_ratio_natural;
+        },
+        MENU_ITEM
+        {
+            command = EMPXPbvCmdStretchAspectRatio;
+            txt = qtn_mpx_video_aspect_ratio_stretch;
+        },
+        MENU_ITEM
+        {
+            command = EMPXPbvCmdZoomAspectRatio;
+            txt = qtn_mpx_video_aspect_ratio_zoom;
+        }
+    };
+}
+
+
+// -------------------------------------------------------------------------------------------------
+//
+//    r_mpx_video_playback_view_menubar
+//
+// -------------------------------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_mpx_video_playback_view_menubar
+{
+    titles =
+    {
+        MENU_TITLE
+        {
+            menu_pane = r_mpx_video_playback_view_menu;
+        }
+    };
+}
+
+// -------------------------------------------------------------------------------------------------
+//
+//    r_mpx_video_playback_view
+//
+// -------------------------------------------------------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_mpx_video_playback_view
+{
+    menubar = r_mpx_video_playback_view_menubar;
+}
+
+// -------------------------------------------------------------------------------------------------
+//
+//    r_mpx_video_playback_view_fake_sk_details
+//    Fake Soft Key label: Option
+//
+// -------------------------------------------------------------------------------------------------
+//
+RESOURCE TBUF r_mpx_video_playback_view_fake_sk_details
+{
+    buf = text_softkey_details;
+}
+
+// -------------------------------------------------------------------------------------------------
+//
+//    r_mpx_video_playback_view_fake_sk_back
+//    Fake Soft Key label: back
+//
+// -------------------------------------------------------------------------------------------------
+//
+RESOURCE TBUF r_mpx_video_playback_view_fake_sk_back
+{
+    buf = text_softkey_back;
+}
+
+// -------------------------------------------------------------------------------------------------
+//
+//    r_mpx_video_playback_view_fake_sk_cancel
+//    Fake Soft Key label: cancel
+//
+// -------------------------------------------------------------------------------------------------
+//
+RESOURCE TBUF r_mpx_video_playback_view_fake_sk_cancel
+{
+    buf = text_softkey_cancel;
+}
+
+// -------------------------------------------------------------------------------------------------
+//
+//    r_mpx_video_pdl_all_content_played_msg
+//
+// -------------------------------------------------------------------------------------------------
+//
+RESOURCE TBUF r_mpx_video_pdl_all_content_played_msg
+{
+    buf = qtn_mpx_video_pdl_played_all_dl_resume;
+}
+
+// -------------------------------------------------------------------------------------------------
+//
+//    r_mpx_video_pdl_wait_dl_complete_msg
+//
+// -------------------------------------------------------------------------------------------------
+//
+RESOURCE TBUF r_mpx_video_pdl_wait_dl_complete_msg
+{
+    buf = qtn_mpx_video_pdl_wait_download_complete;
+}
+
+// -------------------------------------------------------------------------------------------------
+//
+//    r_mpx_pdl_more_data_needed_msg
+//
+// -------------------------------------------------------------------------------------------------
+//
+RESOURCE TBUF r_mpx_pdl_more_data_needed_msg
+{
+    buf = qtn_mpx_video_pdl_more_data_needed;
+}
+// -------------------------------------------------------------------------------------------------
+//
+//    r_mpx_could_not_connect
+//
+// -------------------------------------------------------------------------------------------------
+//
+RESOURCE TBUF r_mpx_could_not_connect
+{
+    buf = qtn_mpx_video_unable_to_connect;
+}
+
+// -------------------------------------------------------------------------------------------------
+//
+//    r_mpx_video_invalid_clip
+//
+// -------------------------------------------------------------------------------------------------
+//
+RESOURCE TBUF r_mpx_video_invalid_clip
+{
+    buf = qtn_mpx_video_invalid_clip;
+}
+// -------------------------------------------------------------------------------------------------
+//
+//    r_mpx_low_bandwidth
+//
+// -------------------------------------------------------------------------------------------------
+//
+RESOURCE TBUF r_mpx_low_bandwidth
+{
+    buf = qtn_mpx_video_not_enough_bw;
+}
+
+// -------------------------------------------------------------------------------------------------
+//
+//    r_mpx_clip_not_found_in_server
+//
+// -------------------------------------------------------------------------------------------------
+//
+RESOURCE TBUF r_mpx_clip_not_found_in_server
+{
+    buf = qtn_mpx_video_file_not_found;
+}
+
+// -------------------------------------------------------------------------------------------------
+//
+//    r_mpx_invalid_url
+//
+// -------------------------------------------------------------------------------------------------
+//
+RESOURCE TBUF r_mpx_invalid_url
+{
+    buf = qtn_mpx_video_invalid_url;
+}
+
+// -------------------------------------------------------------------------------------------------
+//
+//    r_mpx_in_connection_timeout
+//
+// -------------------------------------------------------------------------------------------------
+//
+RESOURCE TBUF r_mpx_in_connection_timeout
+{
+    buf = qtn_mpx_video_connection_timeout;
+}
+
+// -------------------------------------------------------------------------------------------------
+//
+//    r_mpx_resource_lost
+//
+// -------------------------------------------------------------------------------------------------
+//
+RESOURCE TBUF r_mpx_resource_lost
+{
+    buf = qtn_mpx_video_resource_lost;
+}
+
+// -------------------------------------------------------------------------------------------------
+//
+//    r_mpx_video_call_ongoing
+//
+// -------------------------------------------------------------------------------------------------
+//
+RESOURCE TBUF r_mpx_video_call_ongoing
+{
+    buf = qtn_mpx_video_call_ongoing;
+}
+
+// -------------------------------------------------------------------------------------------------
+//
+//    r_mpx_video_drm_no_tv_out
+//
+// -------------------------------------------------------------------------------------------------
+//
+RESOURCE TBUF r_mpx_video_drm_no_tv_out
+{
+    buf = qtn_mpx_video_drm_no_tvout;
+}
+
+// -------------------------------------------------------------------------------------------------
+//
+//    r_mpx_video_play_over_2g_during_voice_call
+//
+// -------------------------------------------------------------------------------------------------
+//
+RESOURCE TBUF r_mpx_video_play_over_2g_during_voice_call
+{
+    buf = qtn_mpx_video_play_over_2g_during_voice_call;
+}
+
+//----------------------------------------------------
+//
+//    r_mpx_drm_rights_missing
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_mpx_drm_rights_missing
+{
+    buf = qtn_mpx_video_drm_no_rights;
+}
+
+// EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviews/eabi/mpxvideoplaybackviewsu.def	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,25 @@
+EXPORTS
+	_ZN21CMPXVideoPlaybackView4NewLEv @ 1 NONAME
+	_ZN21CMPXVideoPlaybackView5NewLCEv @ 2 NONAME
+	_ZN24CMPXVideoPdlPlaybackView4NewLEv @ 3 NONAME
+	_ZN24CMPXVideoPdlPlaybackView5NewLCEv @ 4 NONAME
+	_ZN26CMPXVideoPlaybackContainer14HandleCommandLEii @ 5 NONAME
+	_ZN26CMPXVideoPlaybackContainer17DoHandleKeyEventLERK9TKeyEvent10TEventCode @ 6 NONAME
+	_ZN26CMPXVideoPlaybackContainer21DoHandlePointerEventLERK13TPointerEvent @ 7 NONAME
+	_ZN33CMPXVideoPlaybackUserInputHandler20ProcessPointerEventLEP11CCoeControlRK13TPointerEvent20TMPXVideoControlType @ 8 NONAME
+	_ZTI21CMPXVideoPlaybackView @ 9 NONAME ; #<TI>#
+	_ZTI24CMPXVideoPdlPlaybackView @ 10 NONAME ; #<TI>#
+	_ZTI25CMPXVideoBasePlaybackView @ 11 NONAME ; #<TI>#
+	_ZTI26CMPXVideoPlaybackContainer @ 12 NONAME ; #<TI>#
+	_ZTI33CMPXVideoPlaybackUserInputHandler @ 13 NONAME ; #<TI>#
+	_ZTV21CMPXVideoPlaybackView @ 14 NONAME ; #<VT>#
+	_ZTV24CMPXVideoPdlPlaybackView @ 15 NONAME ; #<VT>#
+	_ZTV25CMPXVideoBasePlaybackView @ 16 NONAME ; #<VT>#
+	_ZTV26CMPXVideoPlaybackContainer @ 17 NONAME ; #<VT>#
+	_ZTV33CMPXVideoPlaybackUserInputHandler @ 18 NONAME ; #<VT>#
+	_ZN26CMPXVideoPlaybackContainer16UserInputHandlerEv @ 19 NONAME
+	_ZTI31CMPXVideoPlaybackDisplayHandler @ 20 NONAME ; #<TI>#
+	_ZTV31CMPXVideoPlaybackDisplayHandler @ 21 NONAME ; #<VT>#
+	_ZN32CMPXVideoPlaybackViewFileDetails17GenerateFileNameLEv @ 22 NONAME
+	_ZN32CMPXVideoPlaybackViewFileDetails18GenerateFileTitleLEv @ 23 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviews/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,33 @@
+/*
+* 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:  Build information file for project mpxvideoplaybackview.
+*
+*/
+
+// Version : %version: 5 %
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/mpxvideoplaybackviews.iby      CORE_APP_LAYER_IBY_EXPORT_PATH(mpxvideoplaybackviews.iby)
+../rom/mpxvideoplaybackviewsrsc.iby   LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(mpxvideoplaybackviewsrsc.iby)
+../loc/mpxvideoplaybackviews.loc      APP_LAYER_LOC_EXPORT_PATH(mpxvideoplaybackviews.loc)
+
+PRJ_MMPFILES
+mpxvideoplaybackviews.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviews/group/mpxvideoplaybackviews.mmp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,91 @@
+/*
+* 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 mpxvideoplaybackviews.
+*
+*/
+
+// Version : %version: e003sa33#16 %
+
+
+#include <data_caging_paths.hrh>
+#include <bldvariant.hrh>
+#include <platform_paths.hrh>
+
+TARGET              mpxvideoplaybackviews.dll
+TARGETTYPE          dll
+UID                 0x1000006C 0x200159AE
+
+CAPABILITY          CAP_GENERAL_DLL
+VENDORID            VID_DEFAULT
+
+SOURCEPATH          ../src
+
+START RESOURCE      ../data/mpxvideoplaybackviews.rss
+HEADER
+TARGETPATH          APP_RESOURCE_DIR
+LANGUAGE_IDS
+END // RESOURCE
+
+SOURCE              mpxvideobaseplaybackview.cpp
+SOURCE              mpxvideoplaybackview.cpp
+SOURCE              mpxvideopdlplaybackview.cpp
+SOURCE              mpxvideoplaybackcontainer.cpp
+SOURCE              mpxvideoplaybackviewfiledetails.cpp
+SOURCE              mpxvideoplaybackuserinputhandler.cpp
+SOURCE              mpxvideoplaybackdisplayhandler.cpp
+
+USERINCLUDE         ../inc
+USERINCLUDE         ../../inc
+USERINCLUDE         ../../../inc
+
+APP_LAYER_SYSTEMINCLUDE
+
+LIBRARY             euser.lib
+LIBRARY             avkon.lib
+LIBRARY             cone.lib
+LIBRARY             eikcore.lib
+LIBRARY             ws32.lib
+LIBRARY             mpxplaybackutility.lib
+LIBRARY             mpxcollectionutility.lib
+LIBRARY             mpxviewutility.lib
+LIBRARY             cdlengine.lib
+LIBRARY             bafl.lib
+LIBRARY             mpxcommon.lib
+LIBRARY             estor.lib
+LIBRARY             aknicon.lib
+LIBRARY             eikctl.lib
+LIBRARY             eikcoctl.lib
+LIBRARY             bitgdi.lib
+LIBRARY             fbscli.lib
+LIBRARY             commonengine.lib
+LIBRARY             efsrv.lib
+LIBRARY             gdi.lib
+LIBRARY             aknlayout2scalable.lib
+LIBRARY             aknlayout2.lib
+LIBRARY             remconcoreapi.lib
+LIBRARY             hlplch.lib
+LIBRARY             flogger.lib
+LIBRARY             mpxvideoplaybackcontrols.lib
+LIBRARY             remconinterfacebase.lib
+LIBRARY             apgrfx.lib
+LIBRARY             mpfiledetailsdialog.lib
+LIBRARY             sysutil.lib 
+LIBRARY             drmuihandling.lib
+LIBRARY             inetprotutil.lib
+
+#ifdef SYMBIAN_BUILD_GCE
+LIBRARY             mediaclientvideodisplay.lib
+#endif
+
+// EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviews/loc/mpxvideoplaybackviews.loc	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,171 @@
+/*
+* 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: loc file for mpxvideoplayabackviews
+*
+*/
+
+// Version : %version: 9 %
+
+//
+//  LOCALISATION STRINGS
+//
+
+//d:Command in Options Menu
+//d:Command name for "Change aspect ratio"
+//l:list_single_pane_t1_cp2
+//w:
+//r:5.2
+//
+#define qtn_mpx_video_option_change_asp_ratio "Change aspect ratio"
+
+//d:Natural Aspect Ratio text in full screen video playback mode
+//l:main_mp4_pane_t3
+//w:
+//r:5.2
+//
+#define qtn_mpx_video_aspect_ratio_natural "Natural"
+
+//d:Zoom Aspect Ratio text in full screen video playback mode
+//l:main_mp4_pane_t3
+//w:
+//r:5.2
+//
+#define qtn_mpx_video_aspect_ratio_zoom    "Zoom"
+
+//d:Stretch Aspect Ratio text in full screen video playback mode
+//l:main_mp4_pane_t3
+//w:
+//r:5.2
+//
+#define qtn_mpx_video_aspect_ratio_stretch     "Stretch"
+
+//d:Invalid clip information note.
+//d:Shown when media could not be opened.
+//l:popup_note_window
+//w:
+//r:5.2
+//
+#define qtn_mpx_video_invalid_clip "Invalid Clip. Operation canceled."
+
+//d:Note used to inform user that the file is not progressively playable
+//l:popup_note_window
+//w:
+//r:5.2
+//
+#define qtn_mpx_video_pdl_wait_download_complete "File cannot be played until download complete."
+
+
+//d:Note used to inform user that all downloaded content has been played
+//d:Download must be resumed before playback can continue
+//l:popup_note_window
+//w:
+//r:5.2
+//
+#define qtn_mpx_video_pdl_played_all_dl_resume "All downloaded content has been played. Try to resume download."
+
+
+//d:Note used to inform user that not enough of the file has been downloaded to play
+//l:popup_note_window
+//w:
+//r:5.2
+//
+#define qtn_mpx_video_pdl_more_data_needed "More data needed to attempt playback."
+
+//d:No TV-Out for DRM files information note.
+//l:popup_note_window
+//w:
+//r:5.2
+//
+#define qtn_mpx_video_drm_no_tvout "Protected clip, can not be played through TV-Out"
+
+//d:Unable to connect information note (Invalid URL).
+//d:Shown when connection cannot be established to server.
+//l:popup_note_window
+//w:
+//r:5.2
+//
+#define qtn_mpx_video_invalid_url "Unable to connect: Invalid URL"
+
+//d:Unable to connect information note.
+//d:Shown when connection cannot be established to server.
+//l:popup_note_window
+//w:
+//r:5.2
+//
+#define qtn_mpx_video_unable_to_connect "Unable to connect"
+
+//d:Unable to connect information note (Not enough bandwidth)
+//d:Shown when connection cannot be established to server.
+//l:popup_note_window
+//w:
+//r:5.2
+//
+#define qtn_mpx_video_not_enough_bw "Unable to connect: Not enough bandwidth"
+
+//d:Unable to connect information note (File not found in server).
+//d:Shown when connection cannot be established to server.
+//l:popup_note_window
+//w:
+//r:5.2
+//
+#define qtn_mpx_video_file_not_found "Unable to connect: File not found"
+
+//d:Unable to connect information note (Connection timeout).
+//d:Shown when connection cannot be established to server.
+//l:popup_note_window
+//w:
+//r:5.2
+//
+#define qtn_mpx_video_connection_timeout "Unable to connect: Connection timeout"
+
+//d:Resource lost information note.
+//d:Shown when a resource is lost.
+//l:popup_note_window
+//w:
+//r:5.2
+//
+#define qtn_mpx_video_resource_lost "Resource Lost"
+
+//d:Cannot be used note.
+//d:Shown when when the user tries to do something that is not possible during video call
+//l:popup_note_wait_window
+//w:
+//r:5.2
+//
+#define qtn_mpx_video_call_ongoing "Video playback is not allowed during video call"
+
+//d:Cannot be used note.
+//d:Shown when when the user tries to do something that is not possible during voice call
+//l:popup_note_wait_window
+//w:
+//r:5.2
+//
+#define qtn_mpx_video_play_over_2g_during_voice_call "Video playback is not allowed during voice call over 2G network"
+
+//d:Information note shown when the user attempts play a media file with expired or missing rights object
+//l:popup_note_window
+//w:
+//r:5.2
+//
+#define qtn_mpx_video_drm_no_rights "License has expired or it is missing"
+
+//d:Command in Options Menu
+//d:Command name for "View details"
+//l:list_single_pane_t1_cp2
+//w:
+//r:5.2
+//
+#define qtn_mpx_video_option_show_file_details  "View details"
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviews/rom/mpxvideoplaybackviews.iby	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,27 @@
+/*
+* 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: IBY for mpxvideoplaybackviews.dll
+*
+*/
+
+// Version : %version: 2 %
+
+#ifndef MPXVIDEOPLAYBACKVIEWS_IBY
+#define MPXVIDEOPLAYBACKVIEWS_IBY
+
+#include <data_caging_paths_for_iby.hrh>
+
+file=ABI_DIR\BUILD_DIR\mpxvideoplaybackviews.dll      SHARED_LIB_DIR\mpxvideoplaybackviews.dll
+
+#endif // MPXVIDEOPLAYBACKVIEWS_IBY
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviews/rom/mpxvideoplaybackviewsrsc.iby	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,27 @@
+/*
+* 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: IBY for mpxvideoplaybackviews.dll
+*
+*/
+
+// Version : %version: 2 %
+
+#ifndef MPXVIDEOPLAYBACKVIEWSRSC_IBY
+#define MPXVIDEOPLAYBACKVIEWSRSC_IBY
+
+#include <data_caging_paths_for_iby.hrh>
+
+data=DATAZ_\APP_RESOURCE_DIR\mpxvideoplaybackviews.rsc        APP_RESOURCE_DIR\mpxvideoplaybackviews.rsc
+
+#endif // MPXVIDEOPLAYBACKVIEWSRSC_IBY
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviews/src/mpxvideobaseplaybackview.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,2381 @@
+/*
+* 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:   Implementation of Video base playback view
+*
+*/
+
+
+// Version : %version: ou1cpsw#88.1.1 %
+
+
+//  Include Files
+
+#include <aknViewAppUi.h>
+#include <w32std.h>
+#include <eikenv.h>
+#include <bautils.h>
+#include <AknUtils.h>
+#include <coemain.h>
+#include <hlplch.h>
+#include <akntoolbar.h>
+#include <AknUtils.h>
+#include <data_caging_path_literals.hrh>
+
+#include <mpxplaybackcommanddefs.h>
+#include <mpxcommandgeneraldefs.h>
+#include <mpxcommand.h>
+#include <mpxmessagegeneraldefs.h>
+#include <mpxplaybackmessage.h>
+#include <mpxmediageneraldefs.h>
+#include <mpxplaybackutility.h>
+#include <mpxviewutility.h>
+#include <StringLoader.h>
+#include <aknnotewrappers.h>
+#include <mpxvideoplaybackviews.rsg>
+#include <textresolver.h>
+#include <mmf/common/mmferrors.h>
+#include <DRMHelper.h>
+#include <mpxcollectionutility.h>
+#include <mpxcollectionutility.h>
+#include <mpxcollectionplaylist.h>
+#include <mpxcollectionpath.h>
+#include <mpxmediageneralextdefs.h>
+#include <vcxmyvideosuids.h>
+
+#include <drmuihandling.h>
+#include <drmerrorhandling.h>
+
+#include "mpxvideobaseplaybackview.h"
+#include "mpxvideoplaybackcontainer.h"
+#include "mpxvideoplaybackcontrol.hrh"
+#include "mpxcommonvideoplaybackview.hrh"
+#include "mpxvideoplaybackviewfiledetails.h"
+#include "mpxvideoplaybackuids.hrh"
+#include "MPFileDetailsDialog.h"
+#include <mpxvideoplaybackdefs.h>
+#include "mpxmediavideodefs.h"
+#include "mpxvideo_debug.h"
+#include "mpxvideoplayercustomviewmsgconsts.h"
+
+//
+//  Set a constant for the information timeout of 5 seconds
+//
+const TInt KInformationNoteTimeout = 5000000;
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoBasePlaybackView::CMPXVideoBasePlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoBasePlaybackView::CMPXVideoBasePlaybackView()
+// note, CBase initialises all member variables to zero
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoBasePlaybackView::InitializeVideoPlaybackViewL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::InitializeVideoPlaybackViewL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::InitializeVideoPlaybackViewL()"));
+
+    _LIT( KMPXVideoPlaybackViewsRscPath, "mpxvideoplaybackviews.rsc" );
+
+    CCoeEnv* coeEnv = iEikonEnv;
+    TParse parse;
+    parse.Set( KMPXVideoPlaybackViewsRscPath, &KDC_APP_RESOURCE_DIR, NULL );
+    TFileName resourceFile = parse.FullName();
+    User::LeaveIfError( AddDllPath( resourceFile ) );
+    BaflUtils::NearestLanguageFile( coeEnv->FsSession(), resourceFile );
+
+    iVideoResourceOffset = coeEnv->AddResourceFileL( resourceFile );
+
+    //
+    //  Get an instance of view utility
+    //
+    iViewUtility = MMPXViewUtility::UtilityL();
+
+    //
+    //  Get an instance of collection utility
+    //  Used for the Collection Observer to get the MediaL callbacks
+    //
+    iCollectionUtility = MMPXCollectionUtility::NewL( this );
+
+    //
+    //  Create Active Object for closing player
+    //
+    iCloseAO = CIdle::NewL( CActive::EPriorityStandard );
+
+    BaseConstructL( R_MPX_VIDEO_PLAYBACK_VIEW );
+
+    iAknEventMonitor = static_cast<CAknAppUiBase*>(CCoeEnv::Static()->AppUi())->EventMonitor();
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoBasePlaybackView::~CMPXVideoBasePlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoBasePlaybackView::~CMPXVideoBasePlaybackView()
+{
+    MPX_DEBUG(_L("CMPXVideoBasePlaybackView::~CMPXVideoBasePlaybackView()"));
+
+    if ( iClipName )
+    {
+        delete iClipName;
+        iClipName = NULL;
+    }
+
+    if ( iCloseAO )
+    {
+        delete iCloseAO;
+        iCloseAO = NULL;
+    }
+
+    if ( iFileDetails )
+    {
+        delete iFileDetails;
+        iFileDetails = NULL;
+    }
+
+    if ( iDisplayHandler )
+    {
+        delete iDisplayHandler;
+        iDisplayHandler = NULL;
+    }
+    
+    ClearPlaybackUtility();
+    
+    if ( iViewUtility )
+    {
+        iViewUtility->Close();
+        iViewUtility = NULL;
+    }
+
+    if ( iCollectionUtility )
+    {
+        iCollectionUtility->Close();
+    }
+
+    if ( iVideoResourceOffset )
+    {
+        iEikonEnv->DeleteResourceFile( iVideoResourceOffset );
+    }
+
+    if ( iContainer )
+    {
+        AppUi()->RemoveFromStack( iContainer );
+        delete iContainer;
+        iContainer = NULL;
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoBasePlaybackView::CreateGeneralPlaybackCommandL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::CreateGeneralPlaybackCommandL( TMPXPlaybackCommand aCmd,
+                                                               TBool aDoSync )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::CreateGeneralPlaybackCommandL()"),
+                   _L("aCmd = %d, aDoSync, = %d"), aCmd, aDoSync );
+
+    CMPXCommand* cmd = CMPXCommand::NewL();
+    CleanupStack::PushL( cmd );
+
+    cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, aDoSync );
+    cmd->SetTObjectValueL<TBool>( KMPXCommandPlaybackGeneralNoBuffer, ETrue );
+    cmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId, KMPXCommandIdPlaybackGeneral );
+    cmd->SetTObjectValueL<TInt>( KMPXCommandPlaybackGeneralType, aCmd );
+
+    SendCustomMpxPlaybackUtilityCmdL( *cmd, this );
+    
+    CleanupStack::PopAndDestroy( cmd );
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoBasePlaybackView::HandleCommandL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::HandleCommandL( TInt aCommand )
+{
+    MPX_ENTER_EXIT(
+        _L("CMPXVideoBasePlaybackView::HandleCommandL()"),
+        _L("aCommand = %d"), aCommand );
+
+    switch ( aCommand )
+    {
+        case EMPXPbvCmdPlay:
+        {
+            IssuePlayCommandL();
+            break;
+        }
+        case EMPXPbvCmdPause:
+        {
+            MPX_DEBUG(_L("CMPXVideoBasePlaybackView::HandleCommandL() EMPXPbvCmdPause"));
+            CreateGeneralPlaybackCommandL( EPbCmdPause );
+            break;
+        }
+        case EAknSoftkeyClose:
+        case EMPXPbvCmdClose:
+        {
+            MPX_DEBUG(_L("CMPXVideoBasePlaybackView::HandleCommandL() EMPXPbvCmdClose"));
+            CreateGeneralPlaybackCommandL( EPbCmdClose, iSyncClose );
+            break;
+        }
+        case EMPXPbvCmdSeekForward:
+        {
+            MPX_DEBUG(_L("CMPXVideoBasePlaybackView::HandleCommandL() EMPXPbvCmdSeekForward"));
+            CreateVideoSpecificCmdL( EPbCmdStartVideoSeekingForward );
+            break;
+        }
+        case EMPXPbvCmdSeekBackward:
+        {
+            MPX_DEBUG(_L("CMPXVideoBasePlaybackView::HandleCommandL() EMPXPbvCmdSeekBackward"));
+            CreateVideoSpecificCmdL( EPbCmdStartVideoSeekingBackward );
+            break;
+        }
+        case EMPXPbvCmdEndSeek:
+        {
+            MPX_DEBUG(_L("CMPXVideoBasePlaybackView::HandleCommandL() EMPXPbvCmdEndSeek"));
+            CreateVideoSpecificCmdL( EPbCmdStopVideoSeeking );
+            break;
+        }
+        case EMPXPbvCmdPlayPause:
+        {
+            MPX_DEBUG(_L("CMPXVideoBasePlaybackView::HandleCommandL() EMPXPbvCmdPause"));
+            SendPlaybackCmdL( EPbCmdPlayPause );
+            break;
+        }
+        case EAknSoftkeyBack:
+        {
+            ClosePlaybackViewL();
+            break;
+        }
+        case EMPXPbvCmdStop:
+        {
+            MPX_DEBUG(_L("CMPXVideoBasePlaybackView::HandleCommandL() EMPXPbvCmdStop"));
+            CreateGeneralPlaybackCommandL( EPbCmdStop );
+            break;
+        }
+        case EMPXPbvCmdDecreaseVolume:
+        {
+            MPX_DEBUG(_L("CMPXVideoBasePlaybackView::HandleCommandL() EMPXPbvCmdDecreaseVolume"));
+            HandleVolumeCmdL( EPbCmdDecreaseVolume );
+            break;
+        }
+        case EMPXPbvCmdIncreaseVolume:
+        {
+            MPX_DEBUG(_L("CMPXVideoBasePlaybackView::HandleCommandL() EMPXPbvCmdIncreaseVolume"));
+            HandleVolumeCmdL( EPbCmdIncreaseVolume );
+            break;
+        }
+        case EMPXPbvCmdNaturalAspectRatio:
+        {
+            MPX_DEBUG(
+                _L("CMPXVideoBasePlaybackView::HandleCommandL() EMPXPbvCmdNaturalAspectRatio"));
+            SetAspectRatioL( EPbCmdNaturalAspectRatio );
+            break;
+        }
+        case EMPXPbvCmdZoomAspectRatio:
+        {
+            MPX_DEBUG(
+                _L("CMPXVideoBasePlaybackView::HandleCommandL() EMPXPbvCmdZoomAspectRatio"));
+            SetAspectRatioL( EPbCmdZoomAspectRatio );
+            break;
+        }
+        case EMPXPbvCmdStretchAspectRatio:
+        {
+            MPX_DEBUG(
+                _L("CMPXVideoBasePlaybackView::HandleCommandL() EMPXPbvCmdStretchAspectRatio"));
+            SetAspectRatioL( EPbCmdStretchAspectRatio );
+            break;
+        }
+        case EMPXPbvCmdMute:
+        {
+            MPX_DEBUG(_L("CMPXVideoBasePlaybackView::HandleCommandL() EMPXPbvCmdMute"));
+            HandleVolumeCmdL( EPbCmdMuteVolume );
+            break;
+        }
+        case EMPXPbvCmdUnMute:
+        {
+            MPX_DEBUG(_L("CMPXVideoBasePlaybackView::HandleCommandL() EMPXPbvCmdUnMute"));
+            HandleVolumeCmdL( EPbCmdUnMuteVolume );
+            break;
+        }
+        case EMPXPbvCmdShortPressBackward:
+        {
+            MPX_DEBUG(_L("CMPXVideoBasePlaybackView::HandleCommandL() EMPXPbvCmdShortPressBackward"));
+
+            HandleShortPressBackwardL();
+            break;
+        }
+        case EAknCmdHelp:
+        {
+            HlpLauncher::LaunchHelpApplicationL( iEikonEnv->WsSession(),
+                                                 AppUi()->AppHelpContextL() );
+            break;
+        }
+        case EMPXPbvCmdShowFileDetails:
+        {
+            if ( AknLayoutUtils::PenEnabled() )
+            {
+                iContainer->HandleEventL( EMPXControlCmdShowFileDetailsViewer );
+            }
+            else
+            {
+                ShowFileDetailsDialogL();
+            }
+            break;
+        }
+        case EMPXPbvCmdEndOfClip:
+        {
+            CreateVideoSpecificCmdL( EPbCmdEndofClipReached );
+            break;
+        }
+        case EMPXPbvCmdCustomPause:
+        {
+            CreateVideoSpecificCmdL( EPbCmdCustomPause );
+            break;
+        }
+        case EMPXPbvCmdCustomPlay:
+        {
+            CreateVideoSpecificCmdL( EPbCmdCustomPlay );
+            break;
+        }
+        case EMPXPbvLaunchDRMDetails:
+        {
+            LaunchDRMDetailsL();
+            break;
+        }
+        case KMpxVideoPlaybackPdlReloading:
+        {
+            iPdlReloading = ETrue;
+            iMediaRequested = EFalse;
+            break;
+        }
+        case KMpxVideoPlaybackPdlReloadComplete:
+        {
+            HandlePdlReloadComplete();
+            break;
+        }
+        case EMPXPbvCmdRealOneBitmapTimeout:
+        {
+            HandleRealOneBitmapTimeoutL();
+            break;
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoBasePlaybackView::ProcessCommandL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::ProcessCommandL( TInt aCommand )
+{
+    MPX_ENTER_EXIT(
+        _L("CMPXVideoBasePlaybackView::ProcessCommandL()"),
+        _L("aCommand = %d"), aCommand );
+
+    if ( aCommand == EAknCmdExit )
+    {
+        MPX_DEBUG(_L("CMPXVideoBasePlaybackView::ProcessCommandL() EAknCmdExit"));
+
+        if ( MenuBar() )
+        {
+            MenuBar()->StopDisplayingMenuBar();
+        }
+    }
+
+    CAknView::ProcessCommandL( aCommand );
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoBasePlaybackView::HandleStatusPaneSizeChange()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::HandleStatusPaneSizeChange()
+{
+    MPX_DEBUG(_L("CMPXVideoBasePlaybackView::HandleStatusPaneSizeChange()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoBasePlaybackView::DoActivateL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::DoActivateL( const TVwsViewId& /* aPrevViewId */,
+                                             TUid /* aCustomMessageId */,
+                                             const TDesC8& /* aCustomMessage */ )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::DoActivateL()"));
+
+    //
+    //  Initialize the playback state
+    //
+    iPlaybackState = PlaybackUtilityL().StateL();
+
+    //
+    //  Observe the View Framework when the view is active
+    //
+    iViewUtility->AddObserverL( this );
+
+    //
+    //  Disable tool bar in playback view
+    //
+    AppUi()->CurrentFixedToolbar()->SetToolbarVisibility( EFalse );
+
+    if ( ! iContainer )
+    {
+        AppUi()->SetOrientationL( CAknAppUiBase::EAppUiOrientationLandscape );
+
+        iContainer = CMPXVideoPlaybackContainer::NewL( this );
+
+        AppUi()->AddToStackL( *this, iContainer );
+
+        iContainer->GetWindow().SetVisible( ETrue );
+
+        //
+        //  Create Video Playback Display Handler
+        //
+        iDisplayHandler = CMPXVideoPlaybackDisplayHandler::NewL( iPlaybackUtility, iContainer );
+    }
+
+    //
+    //  Register for window visibility changes
+    //
+    iContainer->GetWindow().EnableVisibilityChangeEvents();
+
+    iKeyboardInFocus = ETrue;
+    iAknEventMonitor->Enable( ETrue );
+    iAknEventMonitor->AddObserverL( this );
+
+    //
+    //  Determine if the playback is from a playlist on view activation
+    //
+    MMPXSource* s = PlaybackUtilityL().Source();
+    CMPXCollectionPlaylist* playlist = s->PlaylistL();
+    iPlaylistView = (playlist) ? ETrue : EFalse;
+    delete playlist;
+
+    //
+    //  Retrieve PDL information for container
+    //
+    RetrievePdlInformationL();
+
+    //
+    //  Request the needed Media from the Playback Plugin
+    //
+    RequestMediaL();
+}
+
+// -------------------------------------------------------------------------------------------------
+// From CAknView
+// View deactivation function.
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::DoDeactivate()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::DoDeactivate()"));
+
+    //
+    //  Close the playback plugin to release all references to previous clip
+    //
+    MPX_TRAPD( err, HandleCommandL( EMPXPbvCmdClose ) );
+
+    iAknEventMonitor->Enable( EFalse );
+    iAknEventMonitor->RemoveObserver( this );
+    iKeyboardInFocus = EFalse;
+
+    //
+    //  Delete the display handler when the view is deactivated
+    //
+    if ( iDisplayHandler )
+    {
+        delete iDisplayHandler;
+        iDisplayHandler = NULL;
+    }
+
+    ClearPlaybackUtility();    
+
+    //
+    //  Stop observing the view framework when this view is deactivated
+    //
+    iViewUtility->RemoveObserver( this );
+
+    if ( iContainer )
+    {
+        iContainer->GetWindow().SetVisible( EFalse );
+        AppUi()->RemoveFromStack( iContainer );
+        delete iContainer;
+        iContainer = NULL;
+    }
+
+    iMediaRequested = EFalse;
+    iPlaybackState = EPbStateNotInitialised;
+
+    if ( iClipName )
+    {
+        delete iClipName;
+        iClipName = NULL;
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoBasePlaybackView::HandleForegroundEventL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::HandleForegroundEventL( TBool aForeground )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::HandleForegroundEventL()"),
+                   _L("aForeground = %d"), aForeground );
+
+    if ( aForeground )
+    {
+        iContainer->HandleEventL( EMPXControlCmdHandleForegroundEvent );
+        iKeyboardInFocus = ETrue;
+
+        SendWindowCommandL( EPbCmdHandleForeground );
+    }
+    else
+    {
+        iContainer->HandleEventL( EMPXControlCmdHandleBackgroundEvent );
+        iKeyboardInFocus = EFalse;
+
+        SendWindowCommandL( EPbCmdHandleBackground );
+    }
+
+    CAknView::HandleForegroundEventL( aForeground );
+}
+
+// -------------------------------------------------------------------------------------------------
+// From MEikMenuObserver
+// Dynamically initialises a menu pane.
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::DynInitMenuPaneL()"));
+
+    if ( aResourceId == R_MPX_VIDEO_PLAYBACK_VIEW_MENU  )
+    {
+        //
+        //  Make EMPXPbvCmdChangeAspectRatio menu dimmed in the followings cases:
+        //  -  support touch
+        //  -  a mmf controller is not prepared
+        //  -  clip doesn't have a video track
+        //  -  TV-out cable gets connected
+        //
+        if ( AknLayoutUtils::PenEnabled() ||
+             ! iFileDetails ||
+             ! iFileDetails->iVideoEnabled ||
+             iFileDetails->iVideoHeight <= 0 ||
+             iFileDetails->iVideoWidth <= 0 )
+        {
+            aMenuPane->SetItemDimmed( EMPXPbvCmdChangeAspectRatio, ETrue );
+        }
+    }
+}
+
+void CMPXVideoBasePlaybackView::HandleViewActivation( const TUid& aCurrentViewType,
+                                                      const TUid& aPreviousViewType )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::HandleViewActivation()"),
+                   _L("aCurrentViewType = 0x%08x, aPreviousViewType = 0x%08x"),
+                   aCurrentViewType.iUid, aPreviousViewType.iUid );
+
+    //
+    //  This view is active since we are receiving the callback.
+    //  Some new view is being activated so remove surface, stop playback and
+    //  return to automatic orientation
+    //
+    iDisplayHandler->RemoveDisplayWindow();
+
+    TRAP_IGNORE( HandleCommandL( EMPXPbvCmdStop );
+                 AppUi()->SetOrientationL( CAknAppUiBase::EAppUiOrientationAutomatic ) );
+}
+
+// -------------------------------------------------------------------------------------------------
+// From MMPXPlaybackObserver
+// Handle playback message.
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::HandlePlaybackMessage( CMPXMessage* aMessage, TInt aError )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::HandlePlaybackMessage()"),
+                   _L("aError = %d"), aError );
+
+    if ( aError )
+    {
+        MPX_TRAPD( err, DoHandleErrorPlaybackMessageL( aError ) );
+    }
+    else if ( aMessage )
+    {
+        MPX_TRAPD( err, DoHandlePlaybackMessageL( aMessage ) );
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoBasePlaybackView::IsInMemoryPlugin
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoBasePlaybackView::IsInMemoryPlugin()
+{
+    TBool retVal( EFalse );
+
+    MMPXCollection& collectionPlugin = iCollectionUtility->Collection();
+
+    TUid collectionUid;
+    TUid inMemoryPluginUid = TUid::Uid( KMpxInMemoryPluginUid );
+
+    MPX_TRAPD( error, collectionUid = collectionPlugin.UidL() );
+
+    if ( ! error )
+    {
+        MPX_DEBUG(_L("CMPXVideoBasePlaybackView::IsInMemoryPlugin() collectionUid = 0x%08x"),
+            collectionUid.iUid );
+
+        if ( collectionUid == inMemoryPluginUid )
+        {
+            retVal = ETrue;
+        }
+    }
+
+    MPX_DEBUG(_L("CMPXVideoBasePlaybackView::IsInMemoryPlugin(%d)"), retVal );
+
+    return retVal;
+}
+
+// -------------------------------------------------------------------------------------------------
+// Request for the media object
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::RequestMediaL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::RequestMediaL()"));
+
+    if ( ! iMediaRequested && iPlaybackState == EPbStateInitialised )
+    {
+        iMediaRequested = ETrue;
+
+        if ( iPlaylistView && IsInMemoryPlugin() )
+        {
+            // Get the media attributes from the collection plugin
+            RequestCollectionMediaL();
+        }
+        else
+        {
+            // Get the file details from playback plugin
+            RequestPlaybackMediaL();
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// Request for the media object
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::RequestPlaybackMediaL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::RequestPlaybackMediaL()"));
+
+    //
+    //  Request the volume for the controls
+    //
+    PlaybackUtilityL().PropertyL( *this, EPbPropertyVolume );
+
+    //
+    //  Request the clip's meta data
+    //
+    MMPXSource* s = PlaybackUtilityL().Source();
+
+    if ( s )
+    {
+        RArray<TMPXAttribute> attrs;
+        CleanupClosePushL(attrs);
+
+        //
+        //  General Media Attributes
+        //
+        attrs.Append( KMPXMediaGeneralUri |
+                      KMPXMediaGeneralDuration |
+                      KMPXMediaGeneralTitle |
+                      KMPXMediaGeneralMimeType );
+
+        //
+        //  Video specific Attributes
+        //
+        attrs.Append( KMPXMediaVideoAll );
+
+        // Set the attribute to always route the media call to playback plugin
+        CMPXAttributeSpecs* specs = CMPXAttributeSpecs::NewL();
+        CleanupStack::PushL( specs );
+
+        specs->SetTObjectValueL<TBool>(KMPXMediaGeneralExtMediaRedirect, ETrue);
+
+        s->MediaL( attrs.Array(), *this, specs);
+
+        CleanupStack::PopAndDestroy( specs );
+        CleanupStack::PopAndDestroy( &attrs );
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// Request for the media object
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::RequestCollectionMediaL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::RequestCollectionMediaL()"));
+
+    //  Request the clip's meta data
+    MMPXSource* s = PlaybackUtilityL().Source();
+
+    if ( s )
+    {
+        RArray<TMPXAttribute> attrs;
+        CleanupClosePushL(attrs);
+
+        //  General Media Attributes
+        attrs.Append( KMPXMediaGeneralExtVideoSeekable );
+
+        s->MediaL( attrs.Array(), *this );
+
+        // Set the falg to indicate that media was reuqested from collection FW
+        iCollectionMediaRequested = ETrue;
+
+        CleanupStack::PopAndDestroy( &attrs );
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoBasePlaybackView::DoHandlePlaybackMessageL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::DoHandlePlaybackMessageL( CMPXMessage* aMessage )
+{
+    TMPXMessageId id( *(aMessage->Value<TMPXMessageId>(KMPXMessageGeneralId)) );
+
+    MPX_ENTER_EXIT(
+        _L("CMPXVideoBasePlaybackView::DoHandlePlaybackMessageL()"),
+        _L("id = 0x%08x"), id );
+
+    if ( KMPXMessageGeneral == id )
+    {
+        HandleGeneralPlaybackMessageL( aMessage );
+    }
+    else if ( KMPXMediaIdVideoPlayback == id )
+    {
+        HandleVideoPlaybackMessage( aMessage );
+    }
+    else if ( KMPXMediaIdVideoDisplayMessage == id )
+    {
+        if ( iDisplayHandler )
+        {
+            iDisplayHandler->HandleVideoDisplayMessageL( aMessage );
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoBasePlaybackView::HandleGeneralPlaybackMessageL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::HandleGeneralPlaybackMessageL( CMPXMessage* aMessage )
+{
+    TInt event( *aMessage->Value<TInt>( KMPXMessageGeneralEvent ) );
+    TInt type( *aMessage->Value<TInt>( KMPXMessageGeneralType ) );
+    TInt data( *aMessage->Value<TInt>( KMPXMessageGeneralData ) );
+
+    MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::HandleGeneralPlaybackMessageL()"),
+                   _L("event = %d type = %d value = %d"), event, type, data );
+
+    switch ( event )
+    {
+        case TMPXPlaybackMessage::EStateChanged:
+        {
+            DoHandleStateChangeL( type );
+            break;
+        }
+        case TMPXPlaybackMessage::EPropertyChanged:
+        {
+            TMPXPlaybackProperty property( static_cast<TMPXPlaybackProperty>( type ) );
+
+            HandlePropertyL( property, data, KErrNone );
+            break;
+        }
+        case TMPXPlaybackMessage::EDownloadPositionChanged:
+        {
+            if ( iContainer )
+            {
+                iContainer->HandleEventL( EMPXControlCmdDownloadUpdated, data );
+            }
+
+            break;
+        }
+        case TMPXPlaybackMessage::EDownloadStateChanged:
+        {
+            HandlePdlStateChangeL( data );
+
+            break;
+        }
+        case TMPXPlaybackMessage::EReachedEndOfPlaylist:
+        {
+            HandleCommandL( EAknSoftkeyBack );
+            break;
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoBasePlaybackView::HandleVideoPlaybackMessage()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::HandleVideoPlaybackMessage( CMPXMessage* aMessage )
+{
+    TMPXVideoPlaybackCommand message =
+        ( *(aMessage->Value<TMPXVideoPlaybackCommand>(KMPXMediaVideoPlaybackCommand)) );
+
+    MPX_DEBUG(
+      _L("CMPXVideoBasePlaybackView::HandleVideoPlaybackMessage() message = %d"), message );
+
+    switch ( message )
+    {
+        case EPbCmdPluginError:
+        {
+            TInt error( *aMessage->Value<TInt>( KMPXMediaVideoError ) );
+
+            MPX_TRAPD( err, HandlePluginErrorL( error ) );
+            break;
+        }
+        case EPbCmdTvOutEvent:
+        {
+            TMPXVideoPlaybackControlCommandIds cmdId = EMPXControlCmdTvOutDisconnected;
+
+            TBool tvOutConnected( *aMessage->Value<TInt>( KMPXMediaVideoTvOutConnected ) );
+
+            if ( tvOutConnected )
+            {
+                cmdId = EMPXControlCmdTvOutConnected;
+            }
+
+            if ( iContainer )
+            {
+                MPX_TRAPD( err,
+                    iContainer->HandleEventL( cmdId, iDisplayHandler->ShowAspectRatioIcon() ) );
+            }
+
+            break;
+        }
+        case EPbCmdLoadingStarted:
+        {
+            if ( iContainer )
+            {
+                MPX_TRAPD( err, iContainer->HandleEventL( EMPXControlCmdLoadingStarted ) );
+            }
+
+            break;
+        }
+        case EPbCmdHideControls:
+        {
+            if ( iContainer )
+            {
+                MPX_TRAPD( err, iContainer->HandleEventL( EMPXControlCmdHideControls ) );
+            }
+            break;
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoBasePlaybackView::HandleClosePlaybackViewL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::HandleClosePlaybackViewL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::HandleClosePlaybackViewL()"));
+
+    iPlaybackState = EPbStateStopped;
+
+    if ( IsMultiItemPlaylist() )
+    {
+        SendPlaybackCmdL( EPbCmdNext );
+    }
+    else
+    {
+        ClosePlaybackViewL();
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoBasePlaybackView::HandlePluginErrorL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::HandlePluginErrorL( TInt aError )
+{
+    MPX_DEBUG(
+      _L("CMPXVideoBasePlaybackView::HandlePluginErrorL() aError = %d"), aError );
+
+    switch ( aError )
+    {
+        case KErrPathNotFound:
+        case KErrNotFound:
+        {
+            DisplayErrorMessageL( R_MPX_CLIP_NOT_FOUND_IN_SERVER );
+            HandleClosePlaybackViewL();
+            break;
+        }
+        case KErrCancel:
+        {
+            HandleClosePlaybackViewL();
+            break;
+        }
+        case KErrMMDRMNotAuthorized:
+        case KErrCANoRights:
+        case KErrCANoPermission:
+        case KErrCAPendingRights:
+        {
+            HandleDrmErrorsL( aError );
+            break;
+        }
+        case KMPXVideoCallOngoingError:
+        {
+            DisplayInfoMessageL( R_MPX_VIDEO_CALL_ONGOING, ETrue );
+            break;
+        }
+        default:
+        {
+            //
+            //  TextResolver instance for error resolving.
+            //
+            CTextResolver* textresolver = CTextResolver::NewLC();
+
+            //
+            //  Resolve the error text
+            //
+            TPtrC text;
+            text.Set( textresolver->ResolveErrorString( aError ) );
+
+            CAknErrorNote* dlg = new (ELeave) CAknErrorNote( ETrue );
+
+            dlg->ExecuteLD( text );
+
+            CleanupStack::PopAndDestroy( textresolver );
+
+            HandleClosePlaybackViewL();
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   Handle playback state changes
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::DoHandleStateChangeL( TInt aNewState )
+{
+    MPX_ENTER_EXIT(
+        _L("CMPXVideoBasePlaybackView::DoHandleStateChangeL()"),
+        _L("aNewState = %d, currentState = %d"), aNewState, iPlaybackState );
+
+    if ( aNewState != iPlaybackState )
+    {
+        TBool stateChange( ETrue );
+
+        TMPXPlaybackState oldState = iPlaybackState;
+        iPlaybackState = (TMPXPlaybackState)aNewState;
+
+        switch ( aNewState )
+        {
+            case EPbStateInitialising:
+            {
+                HandleInitializingStateL( oldState );
+                break;
+            }
+            case EPbStateBuffering:
+            {
+                TInt bufferingPercentage( 0 );
+
+                //
+                //  If buffering percentage is 100, buffering is a transition state anc
+                //  can be ignored
+                //
+                MPX_TRAPD( err, bufferingPercentage = RetrieveBufferingPercentageL() );
+
+                if ( bufferingPercentage == 100 )
+                {
+                    stateChange = EFalse;
+                }
+                else
+                {
+                    HandleBufferingStateL();
+                }
+
+                break;
+            }
+            case EPbStatePluginSeeking:
+            {
+                // no-op
+                break;
+            }
+            case EPbStateStopped:
+            {
+                HandleStoppedStateL();
+                break;
+            }
+            case EPbStateInitialised:
+            {
+                RequestMediaL();
+                break;
+            }
+            default:
+            {
+                break;
+            }
+        }
+
+        if ( iContainer && stateChange )
+        {
+            iContainer->HandleEventL( EMPXControlCmdStateChanged, aNewState );
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// Handle playback error message.
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::DoHandleErrorPlaybackMessageL( TInt aError )
+{
+    MPX_ENTER_EXIT( _L("CMPXVideoBasePlaybackView::DoHandleErrorPlaybackMessageL()"),
+                    _L("aError = %d"), aError );
+
+    iContainer->HandleCommandL( EMPXPbvCmdResetControls );
+    HandlePluginErrorL( aError );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoBasePlaybackView::HandlePlaybackCommandComplete()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::HandlePlaybackCommandComplete( CMPXCommand* /*aCommandResult*/,
+                                                               TInt /*aError*/ )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::HandlePlaybackCommandComplete()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoBasePlaybackView::ParseMetaDataL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::ParseMetaDataL( const CMPXMessage& aMedia )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::ParseMetaDataL()"));
+
+    //
+    //  Clip Name
+    //
+    if ( aMedia.IsSupported( KMPXMediaGeneralUri ) )
+    {
+        TPtrC uri( aMedia.ValueText( KMPXMediaGeneralUri ) );
+        iFileDetails->iClipName = uri.AllocL();
+    }
+
+    //
+    //  Title
+    //
+    if ( aMedia.IsSupported( KMPXMediaGeneralTitle ) )
+    {
+        TPtrC title( aMedia.ValueText( KMPXMediaGeneralTitle ) );
+        iFileDetails->iTitle = title.AllocL();
+    }
+
+    //
+    //  Artist
+    //
+    if ( aMedia.IsSupported( KMPXMediaVideoArtist ) )
+    {
+        TPtrC artist( aMedia.ValueText( KMPXMediaVideoArtist ) );
+        iFileDetails->iArtist = artist.AllocL();
+    }
+
+    //
+    //  Mime Type
+    //
+    if ( aMedia.IsSupported( KMPXMediaGeneralMimeType ) )
+    {
+        TPtrC mimeType( aMedia.ValueText( KMPXMediaGeneralMimeType ) );
+        iFileDetails->iMimeType = mimeType.AllocL();
+    }
+
+    //
+    //  Duration
+    //
+    if ( aMedia.IsSupported( KMPXMediaGeneralDuration ) )
+    {
+        iFileDetails->iDuration = aMedia.ValueTObjectL<TInt>( KMPXMediaGeneralDuration );
+    }
+
+    //
+    //  Audio Enabled
+    //
+    if ( aMedia.IsSupported( KMPXMediaVideoAudioEnabled ) )
+    {
+        iFileDetails->iAudioEnabled = aMedia.ValueTObjectL<TInt>( KMPXMediaVideoAudioEnabled );
+    }
+
+    //
+    //  Video Enabled
+    //
+    if ( aMedia.IsSupported( KMPXMediaVideoVideoEnabled ) )
+    {
+        iFileDetails->iVideoEnabled = aMedia.ValueTObjectL<TInt>( KMPXMediaVideoVideoEnabled );
+    }
+
+    //
+    //  Partial Playback
+    //
+    if ( aMedia.IsSupported( KMPXMediaVideoPartialPlayback ) )
+    {
+        iFileDetails->iPartialPlayback =
+            aMedia.ValueTObjectL<TInt>( KMPXMediaVideoPartialPlayback );
+    }
+
+    //
+    //  Playback Mode
+    //
+    if ( aMedia.IsSupported( KMPXMediaVideoPlaybackMode ) )
+    {
+        iFileDetails->iPlaybackMode =
+            (TMPXVideoMode)aMedia.ValueTObjectL<TInt>( KMPXMediaVideoPlaybackMode );
+    }
+
+    //
+    //  Seekable
+    //
+    if ( aMedia.IsSupported( KMPXMediaVideoSeekable ) )
+    {
+        iFileDetails->iSeekable = aMedia.ValueTObjectL<TBool>( KMPXMediaVideoSeekable );
+    }
+
+    //
+    //  Pausable
+    //
+    if ( aMedia.IsSupported( KMPXMediaVideoPausableStream ) )
+    {
+        iFileDetails->iPausableStream = aMedia.ValueTObjectL<TBool>( KMPXMediaVideoPausableStream );
+    }
+
+    //
+    //  Video Height
+    //
+    if ( aMedia.IsSupported( KMPXMediaVideoHeight ) )
+    {
+        iFileDetails->iVideoHeight = aMedia.ValueTObjectL<TInt>( KMPXMediaVideoHeight );
+    }
+
+    //
+    //  Video Width
+    //
+    if ( aMedia.IsSupported( KMPXMediaVideoWidth ) )
+    {
+        iFileDetails->iVideoWidth = aMedia.ValueTObjectL<TInt>( KMPXMediaVideoWidth );
+    }
+
+    //
+    //  TV-Out Connected
+    //
+    if ( aMedia.IsSupported( KMPXMediaVideoTvOutConnected ) )
+    {
+        iFileDetails->iTvOutConnected = aMedia.ValueTObjectL<TInt>( KMPXMediaVideoTvOutConnected );
+    }
+
+    //
+    //  Video BitRate
+    //
+    if ( aMedia.IsSupported( KMPXMediaVideoBitRate ) )
+    {
+        iFileDetails->iBitRate = aMedia.ValueTObjectL<TInt>( KMPXMediaVideoBitRate );
+    }
+
+    //
+    //  ForCC Code
+    //
+    if ( aMedia.IsSupported( KMPXMediaFourCCCode ) )
+    {
+        iFileDetails->iFourCCCode = aMedia.ValueTObjectL<TUint32>( KMPXMediaFourCCCode );
+    }
+
+    //
+    //  Drm Protected
+    //
+    if ( aMedia.IsSupported( KMPXMediaVideoDrmProtected ) )
+    {
+        iFileDetails->iDrmProtected = aMedia.ValueTObjectL<TInt>( KMPXMediaVideoDrmProtected );
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// Handle media properties.
+// Notes: The client is responsible for delete the object of aProperties.
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::DoHandleMediaL( const CMPXMessage& aMedia, TInt aError )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::DoHandleMediaL()"),
+                   _L("aError = %d"), aError );
+
+    if ( aError == KErrNone )
+    {
+        if ( iFileDetails )
+        {
+            iFileDetails->ClearFileDetails();
+        }
+        else
+        {
+            iFileDetails = CMPXVideoPlaybackViewFileDetails::NewL();
+        }
+
+        //
+        //  Read in the media data
+        //
+        ParseMetaDataL( aMedia );
+
+        //
+        //  Create controls since file details are available
+        //
+        iContainer->AddFileDetailsL( iFileDetails );
+
+        if ( iFileDetails->iVideoEnabled )
+        {
+            //
+            //  Calculate the aspect ratio and setup the display hanlder with the display window
+            //  Aspect ratio should be calculated 1st so the auto scale will be set when
+            //  the display window is created.
+            //
+            iDisplayHandler->CreateDisplayWindowL( *(CCoeEnv::Static()->ScreenDevice()),
+                                                   iContainer->GetWindow(),
+                                                   iFileDetails );
+        }
+        else
+        {
+            //
+            //  Remove the display window so the surface can be released
+            //
+            iDisplayHandler->RemoveDisplayWindow();
+        }
+
+        //
+        //  Delay the play command while the Real One Bitmap is being shown
+        //
+        if ( iContainer->IsRealOneBitmapTimerActive() )
+        {
+            iRealOneDelayedPlay = ETrue;
+        }
+        else
+        {
+            CreateGeneralPlaybackCommandL( EPbCmdPlay );
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoBasePlaybackView::UpdatePbPluginMedia()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::UpdatePbPluginMediaL( TBool aSeek)
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::UpdatePbPluginMediaL()"),
+                   _L("aSeek = %d"), aSeek );
+
+    CMPXCommand* cmd = CMPXCommand::NewL();
+    CleanupStack::PushL( cmd );
+
+    cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
+
+    cmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId, KMPXMediaIdVideoPlayback );
+
+    cmd->SetTObjectValueL<TMPXVideoPlaybackCommand>( KMPXMediaVideoPlaybackCommand,
+                                                     EPbCmdUpdateSeekable );
+
+    cmd->SetTObjectValueL<TBool>( KMPXMediaGeneralExtVideoSeekable, aSeek );
+
+    SendCustomMpxPlaybackUtilityCmdL( *cmd );
+
+    CleanupStack::PopAndDestroy( cmd );
+}
+
+// -------------------------------------------------------------------------------------------------
+// From MMPXPlaybackCallback
+// Handle media event.
+// Notes: The client is responsible for delete the object of aProperties.
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::HandleMediaL( const CMPXMedia& aMedia, TInt aError)
+{
+    MPX_ENTER_EXIT(_L( "CMPXVideoBasePlaybackView::HandleMediaL()" ));
+
+    if ( iCollectionMediaRequested )
+    {
+        TBool seek;
+        iCollectionMediaRequested = EFalse;
+
+        if ( aMedia.IsSupported( KMPXMediaGeneralExtVideoSeekable ) )
+        {
+            seek = aMedia.ValueTObjectL<TBool>( KMPXMediaGeneralExtVideoSeekable );
+            UpdatePbPluginMediaL( seek );
+        }
+
+        // request for media from playbackplugin
+        RequestPlaybackMediaL();
+    }
+    else
+    {
+        //
+        //  Retreive the clip name for all use cases
+        //
+        if ( aMedia.IsSupported( KMPXMediaGeneralUri ) )
+        {
+            if ( iClipName )
+            {
+                delete iClipName;
+                iClipName = NULL;
+            }
+
+            TPtrC uri( aMedia.ValueText( KMPXMediaGeneralUri ) );
+            iClipName = uri.AllocL();
+        }
+
+        if ( aMedia.IsSupported( KMPXMediaVideoError ) )
+        {
+            TInt error = aMedia.ValueTObjectL<TInt>( KMPXMediaVideoError );
+
+            iMediaRequested = EFalse;
+            HandlePluginErrorL( error );
+        }
+        else
+        {
+            DoHandleMediaL( aMedia, aError );
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoBasePlaybackView::SetPropertyL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::SetPropertyL( TMPXPlaybackProperty aProperty, TInt aValue )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::SetPropertyL"),
+                   _L("aProperty = %d, aValue = %d"), aProperty, aValue );
+
+    PlaybackUtilityL().SetL( aProperty, aValue );
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoBasePlaybackView::HandlePropertyL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::HandlePropertyL( TMPXPlaybackProperty aProperty,
+                                                 TInt aValue,
+                                                 TInt aError )
+{
+    MPX_DEBUG(_L("CMPXVideoBasePlaybackView::HandlePropertyL - Error(%d)"), aError );
+
+    if ( aError == KErrNone )
+    {
+        switch ( aProperty  )
+        {
+            case EPbPropertyPosition:
+            {
+                MPX_DEBUG(_L("CMPXVideoBasePlaybackView::HandlePropertyL position(%d)"), aValue );
+
+                if ( iContainer )
+                {
+                    iContainer->HandleEventL( EMPXControlCmdSetPosition, aValue );
+                }
+
+                break;
+            }
+            case EPbPropertyDuration:
+            {
+                MPX_DEBUG(_L("CMPXVideoBasePlaybackView::HandlePropertyL duration(%d)"), aValue );
+
+                if ( iContainer )
+                {
+                    iContainer->HandleEventL( EMPXControlCmdSetDuration, aValue );
+                }
+
+                break;
+            }
+            case EPbPropertyMaxVolume:
+            {
+                MPX_DEBUG(_L("CMPXVideoBasePlaybackView::HandlePropertyL max volume(%d)"), aValue );
+
+                break;
+            }
+            case EPbPropertyVolume:
+            {
+                MPX_DEBUG(_L("CMPXVideoBasePlaybackView::HandlePropertyL volume(%d)"), aValue );
+
+                if ( iContainer )
+                {
+                    iContainer->HandleEventL( EMPXControlCmdSetVolume, aValue );
+                }
+
+                break;
+            }
+            case EPbPropertyMute:
+            {
+                MPX_DEBUG(_L("CMPXVideoBasePlaybackView::HandlePropertyL muted(%d)"), aValue );
+
+                if ( iContainer && aValue )
+                {
+                    iContainer->HandleEventL( EMPXControlCmdSetVolume, 0 );
+                }
+
+                break;
+            }
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoBasePlaybackView::DisplayInfoMessageL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::DisplayInfoMessageL( TInt aResourceId, TBool aWaitingDialog )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::DisplayInfoMessageL()"),
+                   _L("resource = %08x"), aResourceId );
+
+    HBufC* text = StringLoader::LoadLC( aResourceId );
+
+    CAknInformationNote* dlg = new (ELeave) CAknInformationNote( aWaitingDialog );
+    dlg->SetTimeout( (CAknNoteDialog::TTimeout) KInformationNoteTimeout );
+    dlg->ExecuteLD( *text );
+    CleanupStack::PopAndDestroy( text );
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoBasePlaybackView::DisplayErrorMessageL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::DisplayErrorMessageL( TInt aResourceId )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::DisplayErrorMessageL()"),
+                   _L("resource = %08x"), aResourceId );
+
+    HBufC* text = StringLoader::LoadLC( aResourceId );
+
+    CAknErrorNote* eDlg = new (ELeave) CAknErrorNote( ETrue );
+    eDlg->ExecuteLD( *text );
+    CleanupStack::PopAndDestroy( text );
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoBasePlaybackView::RetrieveFileNameAndModeL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::RetrieveFileNameAndModeL( CMPXCommand* aCmd )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::RetrieveFileNameAndModeL()"));
+
+    //
+    //  set attributes on the command
+    //
+    aCmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
+    aCmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId, KMPXMediaIdVideoPlayback );
+    aCmd->SetTObjectValueL<TMPXVideoPlaybackCommand>( KMPXMediaVideoPlaybackCommand,
+                                                      EPbCmdInitView );
+
+    SendCustomMpxPlaybackUtilityCmdL( *aCmd );
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoBasePlaybackView::ActivateClosePlayerActiveObject
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::ActivateClosePlayerActiveObject()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::ActivateClosePlayerActiveObject()"));
+
+    if ( ! iCloseAO->IsActive() )
+    {
+        iCloseAO->Start( TCallBack( CMPXVideoBasePlaybackView::ClosePlayerL, this ) );
+    }
+}
+
+// -----------------------------------------------------------------------------
+//   CMPXVideoBasePlaybackView::ClosePlayerL
+// -----------------------------------------------------------------------------
+//
+TInt CMPXVideoBasePlaybackView::ClosePlayerL( TAny* aPtr )
+{
+    MPX_DEBUG(_L("CMPXVideoBasePlaybackView::ClosePlayerL()"));
+
+    static_cast<CMPXVideoBasePlaybackView*>(aPtr)->DoClosePlayerL();
+    return KErrNone;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoBasePlaybackView::DoClosePlayerL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::DoClosePlayerL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::DoClosePlayerL()"));
+
+    if ( iExitPlayer )
+    {
+        AppUi()->HandleCommandL( EAknCmdExit );
+    }
+    else
+    {
+        AppUi()->HandleCommandL( EAknSoftkeyBack );
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoBasePlaybackView::IssuePlayCommandL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::IssuePlayCommandL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::IssuePlayCommandL()"));
+    CreateGeneralPlaybackCommandL( EPbCmdPlay );
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoBasePlaybackView::RetrievePdlInformationL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::RetrievePdlInformationL()
+{
+    MPX_DEBUG(_L("CMPXVideoBasePlaybackView::RetrievePdlInformationL()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoBasePlaybackView::HandleBufferingStateL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::HandleBufferingStateL()
+{
+    MPX_DEBUG(_L("CMPXVideoBasePlaybackView::HandleBufferingStateL()"));
+
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoBasePlaybackView::CreateVideoSpecificCmdL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::CreateVideoSpecificCmdL( TMPXVideoPlaybackCommand aCmd )
+{
+    MPX_DEBUG(_L("CMPXVideoBasePlaybackView::CreateVideoSpecificCmdL(%d)"), aCmd );
+
+    //
+    //  create command to pass to playback plugin
+    //
+    CMPXCommand* cmd = CMPXCommand::NewL();
+    CleanupStack::PushL( cmd );
+
+    cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
+
+    cmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId, KMPXMediaIdVideoPlayback );
+
+    cmd->SetTObjectValueL<TMPXVideoPlaybackCommand>( KMPXMediaVideoPlaybackCommand, aCmd );
+
+    SendCustomMpxPlaybackUtilityCmdL( *cmd );
+
+    CleanupStack::PopAndDestroy( cmd );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoBasePlaybackView::SetAspectRatioL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::SetAspectRatioL( TMPXVideoPlaybackCommand aCmd )
+{
+    MPX_DEBUG(_L("CMPXVideoBasePlaybackView::SetAspectRatioL()"));
+
+    iDisplayHandler->SetAspectRatioL( aCmd );
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoBasePlaybackView::IsAppInFrontL()
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoBasePlaybackView::IsAppInFrontL()
+{
+    TBool ret = EFalse;
+    RWsSession wsSession;
+
+    User::LeaveIfError( wsSession.Connect() );
+    CleanupClosePushL( wsSession );
+
+    if ( wsSession.Handle() )
+    {
+        CArrayFixFlat<TInt>* wgList =
+            new (ELeave) CArrayFixFlat<TInt>( wsSession.NumWindowGroups() );
+
+        if ( wsSession.WindowGroupList( 0, wgList ) == KErrNone )
+        {
+            //
+            //  If this window group is at the start of the window group array,
+            //  this application is in the front
+            //
+            ret = ( iCoeEnv->RootWin().Identifier() == wgList->At(0) );
+        }
+
+        delete wgList;
+    }
+
+    CleanupStack::PopAndDestroy(); //wsSession
+
+    MPX_DEBUG(_L("CMPXVideoBasePlaybackView::IsAppInFrontL (%d)" ), ret);
+
+    return ret;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoBasePlaybackView::ClosePlaybackViewL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::ClosePlaybackViewL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::ClosePlaybackViewL()"));
+
+    if ( iFileDetailsDialog )
+    {
+        iFileDetailsDialog->Close();
+    }
+
+    //
+    //  The View Utility may have deactivated this view already.
+    //  Check if we are the active view
+    //
+    if ( iViewUtility->ActiveViewImplementationUid() == ViewImplementationId() )
+    {
+        if ( iViewUtility->ViewHistoryDepth() > 1 )
+        {
+            iViewUtility->ActivatePreviousViewL();
+
+            //
+            //  Hide controls and window since view will be deactivated.
+            //  This prevents black boxes on the view switching
+            //
+            iContainer->HandleEventL( EMPXControlCmdHideControls );
+        }
+        else
+        {
+            CloseEmbeddedPlaybackViewL();
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoBasePlaybackView::HandleVolumeCmdL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::HandleVolumeCmdL( TMPXPlaybackCommand aCmd )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::HandleVolumeCmdL()"));
+
+    //
+    // In case user try to change the volume via media key, rocker key or etc
+    // We need to show the controls though the volume level doesn't get changed
+    // For examples : - try to change the volume with a clip without audio track
+    //                - try to reduce the volume with volume level 0
+    //                - try to increase the volume with max volume level
+    //
+    iContainer->HandleEventL( EMPXControlCmdShowControls );
+
+    switch( aCmd )
+    {
+        case EPbCmdDecreaseVolume:
+        {
+            CreateVideoSpecificCmdL( EPbCmdHandleDecreaseVolume );
+            break;
+        }
+        case EPbCmdIncreaseVolume:
+        {
+            CreateVideoSpecificCmdL( EPbCmdHandleIncreaseVolume );
+            break;
+        }
+        default:
+        {
+            SendPlaybackCmdL( aCmd );
+            break;
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoBasePlaybackView::HandleShortPressBackwardL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::HandleShortPressBackwardL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::HandleShortPressBackwardL()"));
+
+    SetPropertyL( EPbPropertyPosition, 0);
+}
+
+TInt CMPXVideoBasePlaybackView::AddDllPath( TDes& aFileName )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::AddDllPath()"),
+                   _L("aFileName = %S"), &aFileName);
+
+    //
+    //  Find drive for dll to search same drive for rsc
+    //
+    TFileName dllName;
+    Dll::FileName( dllName );
+
+    TPtrC driveAndPath = TParsePtrC( dllName ).DriveAndPath();
+
+    TParse parse;
+
+    TInt error = parse.Set( aFileName, &driveAndPath, NULL );
+
+    if ( error == KErrNone )
+    {
+        aFileName.Zero();
+        aFileName.Append( parse.FullName() );
+    }
+
+    return error;
+}
+
+void CMPXVideoBasePlaybackView::ShowFileDetailsDialogL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::ShowFileDetailsDialogL()"));
+
+    iFileDetailsDialog = CMPFileDetailsDialog::NewL();
+
+    CMPFileDetails* fileDetailsDialogParams = new (ELeave) CMPFileDetails();
+    CleanupStack::PushL( fileDetailsDialogParams );
+
+    HBufC* fileName = iFileDetails->GenerateFileNameL();
+
+    if ( fileName && fileName->Length() )
+    {
+        fileDetailsDialogParams->iFileName = fileName;
+    }
+
+    if ( iFileDetails->iTitle && iFileDetails->iTitle->Length() )
+    {
+        fileDetailsDialogParams->iTitle = iFileDetails->iTitle->AllocL();
+    }
+
+    if ( iFileDetails->iArtist && iFileDetails->iArtist->Length() )
+    {
+        fileDetailsDialogParams->iArtist = iFileDetails->iArtist->AllocL();
+    }
+
+    if ( iFileDetails->iMimeType && iFileDetails->iMimeType->Length() )
+    {
+        fileDetailsDialogParams->iFormat = iFileDetails->iMimeType->AllocL();
+    }
+
+    if ( iFileDetails->iVideoHeight && iFileDetails->iVideoWidth )
+    {
+        fileDetailsDialogParams->iResolutionHeight = iFileDetails->iVideoHeight;
+        fileDetailsDialogParams->iResolutionWidth = iFileDetails->iVideoWidth;
+    }
+
+    if ( iFileDetails->iDuration > 0 )
+    {
+        fileDetailsDialogParams->iDurationInSeconds = iFileDetails->iDuration / KPbMilliMultiplier;
+    }
+
+    if (iFileDetails->iBitRate > 0 )
+    {
+        fileDetailsDialogParams->iBitrate = iFileDetails->iBitRate;
+    }
+
+    if ( iFileDetails->iDrmProtected )
+    {
+        fileDetailsDialogParams->iDrmProtected = iFileDetails->iDrmProtected;
+        fileDetailsDialogParams->iFilePath = iFileDetails->iClipName->AllocL();
+
+        TInt openError = KErrNone;
+
+        //
+        // based on SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API flag,
+        // fileDetailsDialogParams->iDetailsFileHandle uses either RFile64 or RFile handle,
+        // therefore, we need to handle it in the same manner here
+        //
+
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+        RFile64 tempFileHandle;
+        CleanupClosePushL( tempFileHandle );
+        openError = OpenDrmFileHandle64L( tempFileHandle );
+
+#else // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+        RFile tempFileHandle;
+        CleanupClosePushL( tempFileHandle );
+        openError = OpenDrmFileHandleL( tempFileHandle );
+
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+        if ( ! openError )
+        {
+            fileDetailsDialogParams->iDetailsFileHandle.Duplicate( tempFileHandle );
+        }
+
+        CleanupStack::PopAndDestroy();  // tempFileHandle
+    }
+
+    TRAP_IGNORE( iFileDetailsDialog->ExecuteLD( fileDetailsDialogParams ) );
+
+    CleanupStack::PopAndDestroy(); // fileDetailsDialogParams;
+    iFileDetailsDialog = NULL;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoBasePlaybackView::HandleDrmErrorsL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::HandleDrmErrorsL( TInt aError )
+{
+    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
+    //  and close the playback
+    //
+    if ( IsMultiItemPlaylist() || iPlaybackState != EPbStateInitialised )
+
+    {
+        DisplayErrorMessageL( R_MPX_DRM_RIGHTS_MISSING  );
+    }
+    else
+    {
+        TInt openError = KErrNotFound;
+        RFile fileHandle;
+        CleanupClosePushL( fileHandle );
+
+        MPX_TRAPD( err, openError = OpenDrmFileHandleL( fileHandle ) );
+
+        if ( err == KErrNone && openError == KErrNone )
+        {
+            DRM::CDrmUiHandling* drmUiHandling = DRM::CDrmUiHandling::NewL( iCoeEnv );
+            CleanupStack::PushL( drmUiHandling );
+
+            MPX_TRAP( drmUiError,
+                      drmUiHandling->GetErrorHandler().HandleErrorL( fileHandle,
+                                                                     ContentAccess::EPlay,
+                                                                     aError,
+                                                                     NULL ) );
+
+            CleanupStack::PopAndDestroy( drmUiHandling );
+        }
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+        else if ( err == KErrNone && openError == KErrTooBig )
+        {
+            RFile64 fileHandle64;
+            CleanupClosePushL( fileHandle64 );
+
+            MPX_TRAPD( err, openError = OpenDrmFileHandle64L( fileHandle64 ) );
+
+            if ( err == KErrNone && openError == KErrNone )
+            {
+                DRM::CDrmUiHandling* drmUiHandling = DRM::CDrmUiHandling::NewL( iCoeEnv );
+                CleanupStack::PushL( drmUiHandling );
+
+                MPX_TRAP( drmUiError,
+                          drmUiHandling->GetErrorHandler().HandleErrorL( fileHandle64,
+                                                                         ContentAccess::EPlay,
+                                                                         aError,
+                                                                         NULL ) );
+
+                CleanupStack::PopAndDestroy( drmUiHandling );
+            }
+            else
+            {
+                DisplayErrorMessageL( R_MPX_DRM_RIGHTS_MISSING  );
+            }
+
+            CleanupStack::PopAndDestroy();  // fileHandle64
+        }
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+        else
+        {
+            DisplayErrorMessageL( R_MPX_DRM_RIGHTS_MISSING  );
+        }
+
+        CleanupStack::PopAndDestroy();  // fileHandle
+    }
+
+    if ( KErrNone == drmUiError )
+    {
+        HandleClosePlaybackViewL();
+    }
+    else if ( KLeaveExit == drmUiError )
+    {
+        iExitPlayer = ETrue;
+        ActivateClosePlayerActiveObject();
+    }
+    else
+    {
+        User::Leave( drmUiError );
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoBasePlaybackView::IsMultiItemPlaylist()
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoBasePlaybackView::IsMultiItemPlaylist()
+{
+    TInt numItems = 1;
+    MMPXSource* s = PlaybackUtilityL().Source();
+
+    if ( s )
+    {
+        CMPXCollectionPlaylist* playlist = NULL;
+
+        MPX_TRAPD( err, playlist = s->PlaylistL() );
+
+        if ( err == KErrNone && playlist )
+        {
+            numItems = playlist->Count();
+            delete playlist;
+        }
+    }
+
+    TBool retVal = ( numItems > 1 );
+
+    MPX_DEBUG(_L("CMPXVideoBasePlaybackView::IsMultiItemPlaylist(%d)"), retVal);
+
+    return retVal;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoBasePlaybackView::OpenDrmFileHandleL()
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMPXVideoBasePlaybackView::OpenDrmFileHandleL( RFile& aFile )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::OpenDrmFileHandleL()"));
+
+    TInt openError = KErrNotFound;
+    RFs& fs = iCoeEnv->FsSession();
+
+    if ( iPlaylistView && iClipName )
+    {
+        openError = aFile.Open( fs,
+                                iClipName->Des(),
+                                EFileRead | EFileShareReadersOrWriters );
+    }
+    else
+    {
+        MMPXSource* s = PlaybackUtilityL().Source();
+
+        if ( s )
+        {
+            RFile* tempFile = s->FileL();
+
+            if ( tempFile && tempFile->SubSessionHandle() )
+            {
+                //
+                //  File Handle from the framework is valid, use it
+                //
+                openError = aFile.Duplicate( *tempFile );
+            }
+            else
+            {
+                //
+                //  File Handle not valid, get URI and open file
+                //
+                HBufC* tempFileName = s->UriL();
+
+                if ( tempFileName )
+                {
+                    openError = aFile.Open( fs,
+                                            tempFileName->Des(),
+                                            EFileRead | EFileShareReadersOrWriters );
+
+                    delete tempFileName;
+                }
+            }
+        }
+    }
+
+    return openError;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoBasePlaybackView::LaunchDRMDetailsL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::LaunchDRMDetailsL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::LaunchDRMDetailsL()"));
+
+    TInt openError = KErrNotFound;
+    RFile fileHandle;
+    CleanupClosePushL( fileHandle );
+
+    MPX_TRAPD( err, openError = OpenDrmFileHandleL( fileHandle ) );
+
+    if ( err == KErrNone )
+    {
+        DRM::CDrmUiHandling* drmUiHandling = DRM::CDrmUiHandling::NewL();
+        CleanupStack::PushL( drmUiHandling );
+
+        if ( openError == KErrNone )
+        {
+            MPX_TRAPD( err, drmUiHandling->ShowDetailsViewL( fileHandle ) );
+
+            if ( KLeaveExit == err )
+            {
+                User::Leave( err );
+            }
+        }
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+        else if ( openError == KErrTooBig )
+        {
+            RFile64 fileHandle64;
+            CleanupClosePushL( fileHandle64 );
+            MPX_TRAPD( err, openError = OpenDrmFileHandle64L( fileHandle64 ) );
+
+            if ( err == KErrNone && openError == KErrNone )
+            {
+                MPX_TRAPD( err, drmUiHandling->ShowDetailsViewL( fileHandle64 ) );
+
+                if ( KLeaveExit == err )
+                {
+                    User::Leave( err );
+                }
+            }
+            CleanupStack::PopAndDestroy(); // fileHandle64
+        }
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+        CleanupStack::PopAndDestroy( drmUiHandling );
+    }
+
+    CleanupStack::PopAndDestroy();  // fileHandle
+
+    //
+    //  User inputs should not be blocked when user close DRM details view
+    //
+    ResetPdlUserInputs();
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoBasePlaybackView::RetrieveBufferingPercentageL()
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMPXVideoBasePlaybackView::RetrieveBufferingPercentageL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::RetrieveBufferingPercentageL()"));
+
+    //
+    //  create command to pass to playback plugin
+    //
+    CMPXCommand* cmd = CMPXCommand::NewL();
+    CleanupStack::PushL( cmd );
+
+    cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
+    cmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId, KMPXMediaIdVideoPlayback );
+    cmd->SetTObjectValueL<TMPXVideoPlaybackCommand>( KMPXMediaVideoPlaybackCommand,
+                                                     EPbCmdRetrieveBufferingPercentage );
+
+    SendCustomMpxPlaybackUtilityCmdL( *cmd );
+
+    TInt buffPercentage = cmd->ValueTObjectL<TInt>( KMPXMediaVideoBufferingPercentage );
+
+    CleanupStack::PopAndDestroy( cmd );
+
+    return buffPercentage;
+}
+
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoBasePlaybackView::OpenDrmFileHandle64L()
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMPXVideoBasePlaybackView::OpenDrmFileHandle64L( RFile64& aFile )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::OpenDrmFileHandle64L()"));
+
+    TInt openError = KErrNotFound;
+    RFs& fs = iCoeEnv->FsSession();
+
+    if ( iPlaylistView && iClipName )
+    {
+        openError = aFile.Open( fs,
+                                iClipName->Des(),
+                                EFileRead | EFileShareReadersOrWriters );
+    }
+    else
+    {
+        MMPXSource* s = PlaybackUtilityL().Source();
+
+        if ( s )
+        {
+
+            RFile64* tempFile = s->File64L();
+
+            if ( tempFile && tempFile->SubSessionHandle() )
+            {
+                //
+                //  File Handle from the framework is valid, use it
+                //
+                openError = aFile.Duplicate( *tempFile );
+            }
+            else
+            {
+                //
+                //  File Handle not valid, get URI and open file
+                //
+                HBufC* tempFileName = s->UriL();
+
+                if ( tempFileName )
+                {
+                    openError = aFile.Open( fs,
+                                            tempFileName->Des(),
+                                            EFileRead | EFileShareReadersOrWriters );
+
+                    delete tempFileName;
+                }
+            }
+        }
+    }
+
+    return openError;
+}
+
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoBasePlaybackView::HandleRealOneBitmapTimeoutL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::HandleRealOneBitmapTimeoutL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::HandleRealOneBitmapTimeoutL()"));
+
+    //
+    //  Check if this clip has video
+    //  If video exists, setup the display window
+    //  If the video is not enabled, redraw container to remove Real One Bitmap
+    //
+    if ( iFileDetails && iFileDetails->iVideoEnabled )
+    {
+        if ( iDisplayHandler )
+        {
+            iDisplayHandler->DoHandleRealOneBitmapTimeoutL();
+        }
+    }
+    else
+    {
+        iContainer->DrawNow();
+    }
+
+    if ( iRealOneDelayedPlay )
+    {
+        CreateGeneralPlaybackCommandL( EPbCmdPlay );
+        iRealOneDelayedPlay = EFalse;
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoBasePlaybackView::HandleWsEventL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::HandleWsEventL( const TWsEvent& aEvent,
+                                                CCoeControl* /*aDestination*/ )
+{
+    //
+    //  Fg/Bg events aren't received when the view has lost keyboard focus
+    //  If we are sent to full background, sent a background command to the playback plugin
+    //
+    if ( ! iKeyboardInFocus && aEvent.Type() == EEventWindowVisibilityChanged )
+    {
+        MPX_DEBUG(_L("CMPXVideoBasePlaybackView::HandleWsEventL() EEventWindowVisibilityChanged"));
+
+        TUint visible = aEvent.VisibilityChanged()->iFlags;
+
+        if ( visible & TWsVisibilityChangedEvent::ENotVisible )
+        {
+            MPX_DEBUG(_L("CMPXVideoBasePlaybackView::HandleWsEventL() ENotVisible"));
+            SendWindowCommandL( EPbCmdHandleBackground );
+        }
+        else if ( ! IsAppInFrontL() )
+        {
+            MPX_DEBUG(_L("CMPXVideoBasePlaybackView::HandleWsEventL() App in Background"));
+            SendWindowCommandL( EPbCmdHandleBackground );
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoBasePlaybackView::SendWindowCommandL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::SendWindowCommandL( TMPXVideoPlaybackCommand aCmd )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::SendWindowCommandL()"),
+                   _L("aCmd = %d"), aCmd );
+
+    //
+    //  create command to pass to playback plugin
+    //
+    CMPXCommand* cmd = CMPXCommand::NewL();
+    CleanupStack::PushL( cmd );
+
+    cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
+    cmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId, KMPXMediaIdVideoPlayback );
+    cmd->SetTObjectValueL<TMPXVideoPlaybackCommand>( KMPXMediaVideoPlaybackCommand, aCmd );
+    cmd->SetTObjectValueL<TBool>( KMPXMediaVideoAppForeground, IsAppInFrontL() );
+
+    SendCustomMpxPlaybackUtilityCmdL( *cmd );
+    CleanupStack::PopAndDestroy( cmd );
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoBasePlaybackView::DoHandleInitializingStateL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::DoHandleInitializingStateL( TMPXPlaybackState aLastState )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::DoHandleInitializingStateL()"),
+                   _L("aLastState = %d"), aLastState );
+
+    if ( iContainer )
+    {
+        //
+        //  If transitioning from Not Initialized to Initialising there is
+        //  no need to update the playback information that was gathered
+        //  when the container was created
+        //
+        if ( aLastState != EPbStateNotInitialised )
+        {
+            iMediaRequested = EFalse;
+
+            //
+            //  Refresh the screen by removing the surface and resetting the controls
+            //
+            iDisplayHandler->RemoveDisplayWindow();
+            iContainer->HandleCommandL( EMPXPbvCmdResetControls );
+
+            if ( iFileDetails )
+            {
+                if ( iFileDetailsDialog )
+                {
+                    iFileDetailsDialog->Close();
+                }
+
+                iFileDetails->ClearFileDetails();
+            }
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoBasePlaybackView::HandlePdlReloadComplete()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::HandlePdlReloadComplete()
+{
+    MPX_DEBUG(_L("CMPXVideoBasePlaybackView::HandlePdlReloadComplete()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoBasePlaybackView::ResetPdlUserInputs()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoBasePlaybackView::ResetPdlUserInputs()
+{
+    MPX_DEBUG(_L("CMPXVideoBasePlaybackView::ResetPdlUserInputs()"));
+}
+
+// ---------------------------------------------------------------------------
+//   Sends command to playback utility
+// ---------------------------------------------------------------------------
+// 
+void CMPXVideoBasePlaybackView::SendCustomMpxPlaybackUtilityCmdL( CMPXCommand& aCmd,
+                                                MMPXPlaybackCallback* aCallback )
+    {
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::SendCustomMpxPlaybackUtilityCmdL( CMPXCommand )"));
+    
+    TRAPD( err, PlaybackUtilityL().CommandL( aCmd, aCallback ) );
+    
+    if( err )
+        {
+		// Sending failed, we dont know what is wrong or how to fix it. Close pb.
+        ClosePlaybackViewL();
+        }        
+    }
+
+// ---------------------------------------------------------------------------
+//   Sends command to playback utility
+// ---------------------------------------------------------------------------
+// 
+void CMPXVideoBasePlaybackView::SendPlaybackCmdL( TMPXPlaybackCommand aCmd )
+    {
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::SendPlaybackCmdL( TMPXPlaybackCommand )"));
+            
+    TRAPD( err, PlaybackUtilityL().CommandL( aCmd ) );
+    
+    if( err )
+        {
+		// Sending failed, we dont know what is wrong or how to fix it. Close pb.
+        ClosePlaybackViewL();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+//   CMPXVideoBasePlaybackView::PlaybackUtilityL
+// -----------------------------------------------------------------------------
+//
+MMPXPlaybackUtility& CMPXVideoBasePlaybackView::PlaybackUtilityL()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::PlaybackUtilityL()"));
+
+    if ( ! iPlaybackUtility )
+    {
+        iPlaybackUtility = MMPXPlaybackUtility::UtilityL( EMPXCategoryVideo, KPbModeDefault );
+        iPlaybackUtility->AddObserverL( *this );
+        iPlaybackUtility->SetPrimaryClientL();
+    }
+    return *iPlaybackUtility;
+}
+
+// ---------------------------------------------------------------------------
+//   Clears playbackutility
+// ---------------------------------------------------------------------------
+// 
+void CMPXVideoBasePlaybackView::ClearPlaybackUtility()
+    {
+    MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::ClearPlaybackUtility()"));
+    
+    if( iPlaybackUtility )
+        {        
+        TRAP_IGNORE( iPlaybackUtility->RemoveObserverL( *this ) );
+        iPlaybackUtility->Close();
+        iPlaybackUtility = NULL;
+        }    
+    }
+
+    
+    
+// EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviews/src/mpxvideopdlplaybackview.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,578 @@
+/*
+* 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:  Implementation of Video playback view
+*
+*/
+
+
+// Version : %version: 30 %
+
+
+//  Include Files
+#include <aknViewAppUi.h>
+#include <mpxplaybackutility.h>
+#include <mpxviewutility.h>
+#include <mpxcommandgeneraldefs.h>
+#include <mpxvideoplaybackviews.rsg>
+#include <mmf/common/mmferrors.h>
+#include <eikmenup.h>
+#include <AknTaskList.h>
+
+#include "mpxcommonvideoplaybackview.hrh"
+#include "mpxvideoplaybackuids.hrh"
+#include "mpxvideopdlplaybackview.h"
+#include "mpxvideoplaybackcontainer.h"
+#include "mpxvideoplaybackviewfiledetails.h"
+#include "mpxvideoplaybackuserinputhandler.h"
+#include <mpxvideoplaybackdefs.h>
+#include "mpxvideo_debug.h"
+
+//  Member Functions
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPdlPlaybackView::NewLC()
+// -------------------------------------------------------------------------------------------------
+//
+EXPORT_C CMPXVideoPdlPlaybackView* CMPXVideoPdlPlaybackView::NewLC()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPdlPlaybackView::NewLC()"));
+
+    CMPXVideoPdlPlaybackView* self = new (ELeave) CMPXVideoPdlPlaybackView();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPdlPlaybackView::NewL()
+// -------------------------------------------------------------------------------------------------
+//
+EXPORT_C CMPXVideoPdlPlaybackView* CMPXVideoPdlPlaybackView::NewL()
+{
+    CMPXVideoPdlPlaybackView* self = CMPXVideoPdlPlaybackView::NewLC();
+    CleanupStack::Pop( self );
+    return self;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPdlPlaybackView::CMPXVideoPdlPlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPdlPlaybackView::CMPXVideoPdlPlaybackView()
+// note, CBase initialises all member variables to zero
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPdlPlaybackView::ConstructL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPdlPlaybackView::ConstructL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPdlPlaybackView::ConstructL()"));
+
+    InitializeVideoPlaybackViewL();
+
+    iBlockInputsTimer = CPeriodic::NewL( CActive::EPriorityStandard );
+
+    iSyncClose = ETrue;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPdlPlaybackView::~CMPXVideoPdlPlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPdlPlaybackView::~CMPXVideoPdlPlaybackView()
+{
+    MPX_DEBUG(_L("CMPXVideoPdlPlaybackView::~CMPXVideoPdlPlaybackView()"));
+
+    if ( iBlockInputsTimer )
+    {
+        iBlockInputsTimer->Cancel();
+        delete iBlockInputsTimer;
+        iBlockInputsTimer = NULL;
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPdlPlaybackView::Id()
+// -------------------------------------------------------------------------------------------------
+//
+TUid CMPXVideoPdlPlaybackView::Id() const
+{
+    return TUid::Uid( KMPXVIDEOPDLPLAYBACKVIEWUID );
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPdlPlaybackView::ViewImplementationIdId()
+// -------------------------------------------------------------------------------------------------
+//
+TUid CMPXVideoPdlPlaybackView::ViewImplementationId() const
+{
+    return TUid::Uid( KMPXVIDEOPDLPLAYBACKVIEWPLUGINIMPLEMENTATIONUID );
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPdlPlaybackView::CloseEmbeddedPlaybackViewL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPdlPlaybackView::CloseEmbeddedPlaybackViewL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPdlPlaybackView::CloseEmbeddedPlaybackViewL()"),
+                   _L("iPlaybackState = %d"), iPlaybackState );
+
+    //
+    //  If playback state is playing, pause playback
+    //  If playback state is stopped, close the plugin so file will be moved
+    //
+    if ( iPlaybackState == EPbStatePlaying )
+    {
+        HandleCommandL( EMPXPbvCmdPause );
+    }
+    else if ( iPlaybackState == EPbStateStopped )
+    {
+        ActivateClosePlayerActiveObject();
+    }
+
+    //
+    //  Embedded PDL
+    //  If we are in the foreground, bring the browser to the foreground
+    //
+    if ( ! BringUpBrowserL() )
+    {
+        //
+        //  Browser cannot be found, exit application
+        //
+        AppUi()->RunAppShutter();
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPdlPlaybackView::BringUpBrowserL
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoPdlPlaybackView::BringUpBrowserL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPdlPlaybackView::BringUpBrowserL()"));
+
+    TBool browserFound( EFalse );
+
+    RWsSession& wsSession=iEikonEnv->WsSession();
+    CAknTaskList* taskList = CAknTaskList::NewL( wsSession );
+    TApaTask task = taskList->FindRootApp( TUid::Uid( KBROWSERUID ) );
+
+    delete taskList;
+
+    if ( task.Exists() )
+    {
+        task.BringToForeground();
+        browserFound = ETrue;
+    }
+
+    return browserFound;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPdlPlaybackView::RetrievePdlInformationL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPdlPlaybackView::RetrievePdlInformationL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPdlPlaybackView::RetrievePdlInformationL()"));
+
+    CMPXCommand* cmd( CMPXCommand::NewL() );
+    CleanupStack::PushL( cmd );
+
+    cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
+    cmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId, KMPXCommandIdPlaybackPD );
+    cmd->SetTObjectValueL<TMPXPlaybackPdCommand>( KMPXCommandPlaybackGeneralType,
+                                                  EPbCmdGetPdStatus );
+
+    iPlaybackUtility->CommandL( *cmd );
+
+    //
+    //  Parse the PDL information
+    //
+    iPdlState = cmd->ValueTObjectL<TMPXPlaybackPdDownloadState>( KMPXCommandPlaybackPDState );
+    TInt downloadedBytes = cmd->ValueTObjectL<TInt>( KMPXCommandPlaybackPDDownloadedBytes );
+    iDownloadSize = cmd->ValueTObjectL<TInt>( KMPXCommandPlaybackPDTotalBytes );
+
+    MPX_DEBUG(_L("    PDL State = %d, current size = %d, total size = %d"),
+        iPdlState, downloadedBytes, iDownloadSize );
+
+    CleanupStack::PopAndDestroy( cmd );
+
+    if ( iContainer )
+    {
+        //
+        //  Check for a saved download.
+        //  The download size and downloaded bytes will be set to 100 so
+        //  the download progress bar will show 100%
+        //
+        if ( iPdlState == EPbDlStateNotDownloading || iPdlState == EPbDlStateDownloadCompleted )
+        {
+            iDownloadSize   = 100;
+            downloadedBytes = 100;
+        }
+
+        iContainer->HandleEventL( EMPXControlCmdSetDownloadSize, iDownloadSize );
+        iContainer->HandleEventL( EMPXControlCmdDownloadUpdated, downloadedBytes );
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPdlPlaybackView::HandlePluginErrorL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPdlPlaybackView::HandlePluginErrorL( TInt aError )
+{
+    MPX_DEBUG(
+      _L("CMPXVideoPdlPlaybackView::HandlePluginErrorL() aError = %d"), aError );
+
+    switch ( aError )
+    {
+        case KErrAbort:
+        {
+            //
+            //  For progressive download mode, this indicates that the file
+            //  could not be played until the entire file is downloaded.
+            //
+            DisplayInfoMessageL( R_MPX_VIDEO_PDL_WAIT_DL_COMPLETE_MSG, ETrue );
+            ClosePlaybackViewWithErrorL();
+
+            break;
+        }
+        case KErrEof:
+        {
+            //
+            //  For progressive download mode, this indicates that the file
+            //  has timed out waiting for more data to be downloaded
+            //
+            DisplayErrorMessageL( R_MPX_VIDEO_PDL_ALL_CONTENT_PLAYED_MSG );
+            ClosePlaybackViewWithErrorL();
+
+            break;
+        }
+        case KErrNotSupported:
+        case KErrUnknown:
+        case KErrMMDecoder:
+        case KErrCorrupt:
+        case KErrTooBig:
+        {
+            //
+            //  We have received an error for an invalid clip.
+            //  If the download is complete, display the invalid
+            //  clip message.  If the download is in progress,
+            //  we do not know if the clip is invalid yet.
+            //  Show message to wait for more data.
+            //
+            if ( iPdlState >= EPbDlStateNotDownloading )
+            {
+                DisplayErrorMessageL( R_MPX_PDL_MORE_DATA_NEEDED_MSG );
+            }
+            else
+            {
+                DisplayErrorMessageL( R_MPX_VIDEO_INVALID_CLIP );
+            }
+
+            ClosePlaybackViewWithErrorL();
+
+            break;
+        }
+        default:
+        {
+            CMPXVideoBasePlaybackView::HandlePluginErrorL( aError );
+        }
+    }
+}
+
+// -----------------------------------------------------------------------------
+//   CMPXVideoPdlPlaybackView::HandlePdlStateChangeL
+// -----------------------------------------------------------------------------
+//
+void CMPXVideoPdlPlaybackView::HandlePdlStateChangeL( TInt aState )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPdlPlaybackView::HandlePdlStateChangeL()"),
+                   _L("aState = %d"), aState );
+
+    TMPXPlaybackPdDownloadState prevPdlState = iPdlState;
+    iPdlState = (TMPXPlaybackPdDownloadState)aState;
+
+    switch ( aState )
+    {
+        case EPbDlStateDownloadError:
+        case EPbDlStateDownloadCanceled:
+        {
+            HandleCommandL( EMPXPbvCmdStop );
+            ClosePlaybackViewWithErrorL();
+            break;
+        }
+        case EPbDlStateDownloading:
+        {
+            if ( prevPdlState == EPbDlStateDownloadPaused )
+            {
+                if ( iContainer )
+                {
+                    iContainer->HandleEventL( EMPXControlCmdClearDownloadPaused );
+                }
+            }
+
+            break;
+        }
+        case EPbDlStateDownloadPaused:
+        {
+            //
+            //  If we are buffering, display information message and pause
+            //
+            if ( iPlaybackState == EPbStateBuffering  )
+            {
+                HandleCommandL( EMPXPbvCmdPause );
+
+                DisplayInfoMessageL( R_MPX_VIDEO_PDL_ALL_CONTENT_PLAYED_MSG, ETrue );
+                HandleCommandL( EAknSoftkeyBack );
+            }
+            else
+            {
+                //
+                //  Download has been paused, let container show
+                //  the download paused icon
+                //
+                if ( iContainer )
+                {
+                    iContainer->HandleEventL( EMPXControlCmdSetDownloadPaused );
+                }
+            }
+
+            break;
+        }
+        case EPbDlStateDownloadCompleted:
+        {
+            if ( iContainer )
+            {
+                iContainer->HandleEventL( EMPXControlCmdDownloadComplete, iDownloadSize );
+            }
+
+            break;
+        }
+        case EPbDlStateNotDownloading:
+        {
+            break;
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPdlPlaybackView::HandleStoppedStateL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPdlPlaybackView::HandleStoppedStateL()
+{
+    MPX_DEBUG(_L("CMPXVideoPdlPlaybackView::HandleStoppedStateL()"));
+
+    if ( iPdlReloading )
+    {
+        iPdlReloading = EFalse;
+    }
+    else
+    {
+        ClosePlaybackViewL();
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPdlPlaybackView::HandleBufferingStateL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPdlPlaybackView::HandleBufferingStateL()
+{
+    MPX_DEBUG(_L("CMPXVideoPdlPlaybackView::HandleBufferingStateL()"));
+
+    //
+    //  If the download is paused and the state is buffering,
+    //  display information message
+    //
+    if ( iPdlState == EPbDlStateDownloadPaused  )
+    {
+        HandleCommandL( EMPXPbvCmdPause );
+
+        DisplayInfoMessageL( R_MPX_VIDEO_PDL_ALL_CONTENT_PLAYED_MSG, ETrue );
+        HandleCommandL( EAknSoftkeyBack );
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPdlPlaybackView::SendPdlCustomCommandL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPdlPlaybackView::SendPdlCustomCommandL( TMPXPlaybackPdCommand aCustomCmd )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPdlPlaybackView::SendPdlCustomCommandL"),
+                   _L("aCustomCmd = %d"), aCustomCmd );
+
+    CMPXCommand* cmd = CMPXCommand::NewL();
+    CleanupStack::PushL( cmd );
+
+    cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
+    cmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId, KMPXCommandIdPlaybackPD );
+    cmd->SetTObjectValueL<TMPXPlaybackPdCommand>( KMPXCommandPlaybackGeneralType, aCustomCmd );
+
+    iPlaybackUtility->CommandL( *cmd );
+
+    CleanupStack::PopAndDestroy( cmd );
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPdlPlaybackView::ClosePlaybackViewWithErrorL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPdlPlaybackView::ClosePlaybackViewWithErrorL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPdlPlaybackView::ClosePlaybackViewWithErrorL"));
+
+    //
+    //  An error has been processed, set the playback state to Stopped and close the view
+    //
+    iPlaybackState = EPbStateStopped;
+
+    ClosePlaybackViewL();
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPdlPlaybackView::HandleInitializingStateL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPdlPlaybackView::HandleInitializingStateL( TMPXPlaybackState aLastState )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPdlPlaybackView::HandleInitializingStateL()"),
+                   _L("aLastState = %d"), aLastState );
+
+    //
+    //  For PDL view, reset the container and controls for new download
+    //
+    DoHandleInitializingStateL( aLastState );
+
+    //
+    //  User inputs should not be blocked since the new download is initializing
+    //
+    ResetPdlUserInputs();
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPdlPlaybackView::SendWindowCommandL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPdlPlaybackView::SendWindowCommandL( TMPXVideoPlaybackCommand aCmd )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPdlPlaybackView::SendWindowCommandL()"),
+                   _L("aCmd = %d"), aCmd );
+
+    CMPXVideoBasePlaybackView::SendWindowCommandL( aCmd );
+
+    if ( aCmd == EPbCmdHandleForeground )
+    {
+        //
+        //  If user inputs are blocked, start timer to unblock them
+        //
+        if ( iUserInputsBlocked )
+        {
+            if ( iBlockInputsTimer->IsActive() )
+            {
+                iBlockInputsTimer->Cancel();
+            }
+
+            //
+            //  Set timer to unblock user inputs after 1 second
+            //  The message from the download manager should take less than 1 second
+            //
+            iBlockInputsTimer->Start(
+                1000000,
+                0,
+                TCallBack( CMPXVideoPdlPlaybackView::HandleBlockInputsTimeOut, this ) );
+        }
+    }
+    else if ( aCmd == EPbCmdHandleBackground && ! IsAppInFrontL() )
+    {
+        //
+        //  Block all inputs when PDL view is sent to full background
+        //  Commands will be enabled when new command is received from LWP
+        //
+        iUserInputsBlocked = ETrue;
+        iContainer->UserInputHandler()->BlockPdlUserInputs( iUserInputsBlocked );
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPdlPlaybackView::HandlePdlReloadComplete()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPdlPlaybackView::HandlePdlReloadComplete()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPdlPlaybackView::HandlePdlReloadComplete()"));
+
+    //
+    //  User inputs should not be blocked since the new PDL command is complete
+    //
+    ResetPdlUserInputs();
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPdlPlaybackView::ResetPdlUserInputs()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPdlPlaybackView::ResetPdlUserInputs()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPdlPlaybackView::ResetPdlUserInputs()"));
+
+    iUserInputsBlocked = EFalse;
+    iContainer->UserInputHandler()->BlockPdlUserInputs( iUserInputsBlocked );
+
+    if ( iBlockInputsTimer->IsActive() )
+    {
+        iBlockInputsTimer->Cancel();
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPdlPlaybackView::HandleBlockInputsTimeOut()
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMPXVideoPdlPlaybackView::HandleBlockInputsTimeOut( TAny* aPtr )
+{
+    MPX_DEBUG(_L("CMPXVideoPdlPlaybackView::HandleBlockInputsTimeOut()"));
+
+    static_cast<CMPXVideoPdlPlaybackView*>(aPtr)->DoHandleBlockInputsTimeOut();
+    return KErrNone;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPdlPlaybackView::DoHandleBlockInputsTimeOut()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPdlPlaybackView::DoHandleBlockInputsTimeOut()
+{
+    //
+    //  Check if we are reloading due to the message from the Download Manager
+    //  If we are still reloading, keep the user inputs blocked.
+    //  If not, unblock the user inputs
+    //
+    if ( ! iPdlReloading )
+    {
+        //
+        //  Reload message not received, unblock inputs
+        //
+        ResetPdlUserInputs();
+    }
+}
+
+// EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviews/src/mpxvideoplaybackcontainer.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,669 @@
+/*
+* 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:  Implementation of Video playback view's container.
+*
+*/
+
+
+// Version : %version: 30 %
+
+
+// INCLUDE FILES
+
+#include <w32std.h> // RWindowBase
+#include <e32base.h>
+#include <StringLoader.h>
+#include <AknUtils.h>
+#include <eikclbd.h>
+#include <aknconsts.h>
+#include <AknUtils.h>
+#include <AknIconUtils.h>  // SetSize for the icons
+#include <remconcoreapi.h>
+#include <remconcoreapitarget.h>
+#include <remconinterfaceselector.h> // Side volume key
+#include <data_caging_path_literals.hrh> // KDC_APP_BITMAP_DIR
+#include <aknlayoutscalable_apps.cdl.h>
+#include <aknlayoutscalable_avkon.cdl.h>
+#include <mpxvideoplaybackviews.rsg>
+
+#include "mpxcommonvideoplaybackview.hrh"
+#include "mpxvideoplaybackview.h"
+#include "mpxvideoplaybackviewfiledetails.h"
+#include "mpxvideoplaybackcontainer.h"
+#include "mpxvideoplaybackcontrolscontroller.h"
+#include "mpxvideoplaybackuserinputhandler.h"
+#include <mpxvideoplaybackdefs.h>
+#include "mpxvideo_debug.h"
+
+using namespace AknLayoutScalable_Apps;
+
+//
+//  CONSTANTS
+//
+const TInt KMPXRealOneLogoTimeOut = 600000;
+
+// ======== MEMBER FUNCTIONS =======================================================================
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackContainer::CMPXVideoPlaybackContainer()
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackContainer::CMPXVideoPlaybackContainer( CMPXVideoBasePlaybackView* aView )
+    : iView( aView )
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackContainer::NewL()
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackContainer* CMPXVideoPlaybackContainer::NewL( CMPXVideoBasePlaybackView* aView )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackContainer::NewL()"));
+
+    CMPXVideoPlaybackContainer* self = new (ELeave) CMPXVideoPlaybackContainer( aView );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPNormalScreenPlaybackContainer::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackContainer::ConstructL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackContainer::ConstructL()"));
+
+    SetMopParent( iView );
+    CreateWindowL();
+
+    TAknWindowLineLayout screenLayout = AknLayout::screen();
+    TRect screenRect = screenLayout.Rect();
+
+    SetRect( screenRect );
+
+    CreateControlsL();
+
+    iUserInputHandler =
+        CMPXVideoPlaybackUserInputHandler::NewL( this );
+
+    ActivateL();
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackContainer::~CMPXVideoPlaybackContainer()
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackContainer::~CMPXVideoPlaybackContainer()
+{
+    if ( iRealOneBitmapTimer )
+    {
+        iRealOneBitmapTimer->Cancel();
+        delete iRealOneBitmapTimer;
+        iRealOneBitmapTimer = NULL;
+    }
+
+    if ( iFileDetails )
+    {
+        delete iFileDetails;
+        iFileDetails = NULL;
+    }
+
+    if ( iControlsController )
+    {
+        delete iControlsController;
+        iControlsController = NULL;
+    }
+
+    if ( iUserInputHandler )
+    {
+        delete iUserInputHandler;
+        iUserInputHandler = NULL;
+    }
+
+    CloseWindow();
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackContainer::AddFileDetailsL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackContainer::AddFileDetailsL( CMPXVideoPlaybackViewFileDetails* aDetails )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackContainer::AddFileDetailsL()"));
+
+    //
+    //  If clip is audio only Real Media, delay adding the file details until the
+    //  Real One bitmap has been shown.
+    //
+    if ( iRealOneBitmapTimer && iRealOneBitmapTimer->IsActive() && ! aDetails->iVideoEnabled )
+    {
+        MPX_DEBUG(_L("CMPXVideoPlaybackContainer::AddFileDetailsL() file details delayed"));
+
+        iDelayedFileDetails = aDetails;
+    }
+    else
+    {
+        iControlsController->AddFileDetailsL( aDetails );
+
+        //
+        //  Delete the temp file details since plugin initialization is complete
+        //
+        if ( iFileDetails )
+        {
+            delete iFileDetails;
+            iFileDetails = NULL;
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackContainer::GetWindow()
+// -------------------------------------------------------------------------------------------------
+//
+RWindow& CMPXVideoPlaybackContainer::GetWindow() const
+{
+    return Window();
+}
+
+// -------------------------------------------------------------------------------------------------
+// From CCoeControl
+// Handles key events.
+// -------------------------------------------------------------------------------------------------
+//
+TKeyResponse CMPXVideoPlaybackContainer::OfferKeyEventL( const TKeyEvent& aKeyEvent,
+                                                         TEventCode aType )
+{
+    MPX_ENTER_EXIT(
+        _L("CMPXVideoPlaybackContainer::OfferKeyEventL()"),
+        _L("aKeyEvent = (%d,%d), aType = %d"), aKeyEvent.iCode, aKeyEvent.iScanCode, aType );
+
+    iKeyResponse = EKeyWasNotConsumed;
+
+    iUserInputHandler->ProcessKeyEventL( aKeyEvent, aType );
+
+    return iKeyResponse;
+}
+
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackContainer::DoHandleKeyEventL()
+// -------------------------------------------------------------------------------------------------
+//
+EXPORT_C void
+CMPXVideoPlaybackContainer::DoHandleKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackContainer::DoHandleKeyEventL()"));
+
+    switch ( aKeyEvent.iScanCode )
+    {
+        case EStdKeyDevice3:        // rocker middle key
+        case EStdKeyEnter:          // enter key on a qwerty key board
+        {
+            HandleRockerMiddleKeyL( aKeyEvent, aType );
+            iKeyResponse = EKeyWasConsumed;
+            break;
+        }
+        case EStdKeyUpArrow:        // rocker up key
+        {
+            if ( aType != EEventKeyUp )
+            {
+                HandleCommandL( EMPXPbvCmdIncreaseVolume );
+                iKeyResponse = EKeyWasConsumed;
+            }
+
+            break;
+        }
+        case EStdKeyDownArrow:      // rocker down key
+        {
+            if ( aType != EEventKeyUp )
+            {
+                HandleCommandL( EMPXPbvCmdDecreaseVolume );
+                iKeyResponse = EKeyWasConsumed;
+            }
+
+            break;
+        }
+        case EStdKeyLeftArrow:      // rocker left key
+        {
+            HandleSeekBackL( aType );
+            iKeyResponse = EKeyWasConsumed;
+            break;
+        }
+        case EStdKeyRightArrow:     // rocker right key
+        {
+            HandleSeekFwdL( aType );
+            iKeyResponse = EKeyWasConsumed;
+            break;
+        }
+        case EStdKeyDevice0:    // LSK
+        case EStdKeyDevice1:    // RSK
+        {
+            if ( aType == EEventKeyUp )
+            {
+                iControlsController->HandleEventL( EMPXControlCmdSoftKeyPressed,
+                                                   aKeyEvent.iScanCode );
+            }
+
+            iKeyResponse = EKeyWasConsumed;
+            break;
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// Handles rocker's middle key =>  Toggles between play & pause
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackContainer::HandleRockerMiddleKeyL( const TKeyEvent& aKeyEvent,
+                                                         TEventCode aType )
+{
+    if ( aKeyEvent.iCode == EKeyNull && aType == EEventKeyDown  )
+    {
+        iView->HandleCommandL( EMPXPbvCmdPlayPause );
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// Starts/Stops Seeking Forward
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackContainer::HandleSeekFwdL( TEventCode aType )
+{
+    if ( aType == EEventKeyDown )
+    {
+        iView->HandleCommandL( EMPXPbvCmdSeekForward );
+    }
+    else if ( aType == EEventKeyUp )
+    {
+        iView->HandleCommandL( EMPXPbvCmdEndSeek );
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// Starts/Stops Seeking Backward
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackContainer::HandleSeekBackL( TEventCode aType )
+{
+    if ( aType == EEventKeyDown )
+    {
+        iView->HandleCommandL(EMPXPbvCmdSeekBackward);
+    }
+    else if ( aType == EEventKeyUp )
+    {
+        iView->HandleCommandL( EMPXPbvCmdEndSeek );
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// From CCoeControl
+// Handles a change to the control's resources.
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackContainer::HandleResourceChange( TInt aType )
+{
+    CCoeControl::HandleResourceChange( aType );
+}
+
+// -------------------------------------------------------------------------------------------------
+// From CCoeControl
+// Gets the control's help context.
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackContainer::GetHelpContext( TCoeHelpContext& /*aContext*/ ) const
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// From CCoeControl
+// Gets the number of controls contained in a compound control.
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMPXVideoPlaybackContainer::CountComponentControls() const
+{
+    TInt count = 0;
+
+    if ( iRealOneBitmap )
+    {
+        count = 1;
+    }
+
+    return count;
+}
+
+// -------------------------------------------------------------------------------------------------
+// From CCoeControl
+// Gets an indexed component of a compound control.
+// -------------------------------------------------------------------------------------------------
+//
+CCoeControl* CMPXVideoPlaybackContainer::ComponentControl( TInt aIndex ) const
+{
+    CCoeControl* control = NULL;
+
+    switch ( aIndex )
+    {
+        case 0:
+        {
+            control = iRealOneBitmap;
+            break;
+        }
+    }
+
+    return control;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackContainer::HandlePointerEventL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackContainer::HandlePointerEventL( const TPointerEvent& aPointerEvent )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackContainer::HandlePointerEventL()"));
+
+    iUserInputHandler->ProcessPointerEventL( this, aPointerEvent, EMpxVideoPlaybackContainer );
+}
+
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackContainer::DoHandlePointerEventL()
+//
+// Gets called from the Controls Controller
+// only if if OK to handle pointer events
+// -------------------------------------------------------------------------------------------------
+//
+EXPORT_C
+void CMPXVideoPlaybackContainer::DoHandlePointerEventL( const TPointerEvent& aPointerEvent )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackContainer::DoHandlePointerEventL()"),
+                   _L("aPointerEvent.iType = %d"), aPointerEvent.iType );
+
+    if ( AknLayoutUtils::PenEnabled() )
+    {
+        if ( aPointerEvent.iType == TPointerEvent::EButton1Up )
+        {
+            iControlsController->HandleEventL( EMPXControlCmdToggleVisibility );
+
+            SetPointerCapture( EFalse );
+            ClaimPointerGrab( EFalse );
+        }
+        else if ( aPointerEvent.iType == TPointerEvent::EButton1Down )
+        {
+            SetPointerCapture( ETrue );
+            ClaimPointerGrab( ETrue );
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackContainer::Draw()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackContainer::Draw( const TRect& aRect ) const
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackContainer::Draw()"));
+
+    CWindowGc& gc = SystemGc();
+
+    gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
+    gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha );
+
+    if ( Window().DisplayMode() == EColor16MAP )
+    {
+        gc.SetBrushColor( TRgb::Color16MAP(255) );
+    }
+    else if ( Window().DisplayMode() == EColor16MA )
+    {
+        gc.SetBrushColor( TRgb::Color16MA(0) );
+    }
+
+    gc.Clear( aRect );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackContainer::HandleEventL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackContainer::HandleEventL( TMPXVideoPlaybackControlCommandIds aEvent,
+                                               TInt aValue )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackContainer::HandleEventL()"));
+
+    if ( aEvent == EMPXControlCmdHandleBackgroundEvent )
+    {
+        iUserInputHandler->SetForeground(EFalse);
+    }
+    else if ( aEvent == EMPXControlCmdHandleForegroundEvent )
+    {
+        iUserInputHandler->SetForeground(ETrue);
+    }
+
+    iControlsController->HandleEventL( aEvent, aValue );
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackContainer::HandleCommandL()
+// -------------------------------------------------------------------------------------------------
+//
+EXPORT_C void CMPXVideoPlaybackContainer::HandleCommandL( TInt aCommand, TInt aValue )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackContainer::HandleCommandL()"),
+                   _L("aCommand = %d  aValue = %d"), aCommand, aValue );
+
+    switch ( aCommand )
+    {
+        case EMPXPbvCmdSetPosition:
+        {
+            iView->SetPropertyL( EPbPropertyPosition, (TInt)aValue * KPbMilliMultiplier );
+            break;
+        }
+        case EMPXPbvCmdResetControls:
+        {
+            if ( iRealOneBitmapTimer )
+            {
+                iRealOneBitmapTimer->Cancel();
+                delete iRealOneBitmapTimer;
+                iRealOneBitmapTimer = NULL;
+            }
+
+            //
+            //  Recreate the controls with the new clip
+            //
+            CreateControlsL();
+
+            //
+            //  Retrieve the PDL information for container
+            //
+            iView->RetrievePdlInformationL();
+
+            break;
+        }
+        case EAknSoftkeyOptions:
+        {
+            static_cast<CAknView*>(iView)->ProcessCommandL( EAknSoftkeyOptions );
+            break;
+        }
+        case EMPXPbvCmdSetVolume:
+        {
+            iView->SetPropertyL( EPbPropertyVolume, aValue );
+            break;
+        }
+        case EMPXPbvSurfaceCreated:
+        {
+            iControlsController->HandleEventL( EMPXControlCmdSurfaceCreated );
+            DrawNow();
+            break;
+        }
+        case EMPXPbvSurfaceRemoved:
+        {
+            iControlsController->HandleEventL( EMPXControlCmdSurfaceRemoved );
+            DrawNow();
+            break;
+        }
+        default:
+        {
+            iView->HandleCommandL( aCommand );
+            break;
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackContainer::CreateControlsL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackContainer::CreateControlsL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackContainer::CreateControlsL()"));
+
+    //
+    //  Query playback plugin for filename and mode
+    //
+    CMPXCommand* cmd = CMPXCommand::NewL();
+    CleanupStack::PushL( cmd );
+
+    iView->RetrieveFileNameAndModeL( cmd );
+
+    //
+    //  Create a temporary file details that is populated with the
+    //  file name and playback mode.  This will be delete when
+    //  plugin initialization is complete
+    //
+    if ( iFileDetails )
+    {
+        delete iFileDetails;
+        iFileDetails = NULL;
+    }
+
+    iFileDetails = CMPXVideoPlaybackViewFileDetails::NewL();
+
+    TPtrC fileName( cmd->ValueText( KMPXMediaVideoPlaybackFileName ) );
+    iFileDetails->iClipName = fileName.AllocL();
+
+    iFileDetails->iPlaybackMode = (TMPXVideoMode) cmd->ValueTObjectL<TInt>( KMPXMediaVideoMode );
+
+    iFileDetails->iTvOutConnected   = cmd->ValueTObjectL<TInt>( KMPXMediaVideoTvOutConnected );
+
+    TPtrC mimeType( cmd->ValueText( KMPXMediaVideoRecognizedMimeType ) );
+    iFileDetails->iMimeType = mimeType.AllocL();
+
+    CleanupStack::PopAndDestroy( cmd );
+
+    if ( iControlsController )
+    {
+        delete iControlsController;
+        iControlsController = NULL;
+    }
+
+    iControlsController = CMPXVideoPlaybackControlsController::NewL( this, Rect(), iFileDetails );
+
+    //
+    //  Retrieve the Real One Logo bitmap
+    //
+    iRealOneBitmap = iControlsController->GetBitmap( EMPXRealLogoBitmap );
+
+    if ( iRealOneBitmap )
+    {
+        //
+        //  Start timer since Real One bitmap is created
+        //
+        iRealOneBitmapTimer = CPeriodic::NewL( CActive::EPriorityStandard );
+
+        iRealOneBitmapTimer->Start(
+            KMPXRealOneLogoTimeOut,
+            0,
+            TCallBack( CMPXVideoPlaybackContainer::HandleRealOneBitmapTimeout, this ) );
+
+        DrawNow();
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackContainer::UserInputHandler()
+// -------------------------------------------------------------------------------------------------
+//
+EXPORT_C CMPXVideoPlaybackUserInputHandler* CMPXVideoPlaybackContainer::UserInputHandler()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackContainer::UserInputHandler()"));
+    return iUserInputHandler;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackContainer::IsRealOneBitmapTimerActive()
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoPlaybackContainer::IsRealOneBitmapTimerActive()
+{
+    TBool timerActive( EFalse );
+
+    if ( iRealOneBitmapTimer )
+    {
+        timerActive = iRealOneBitmapTimer->IsActive();
+    }
+
+    MPX_DEBUG(_L("CMPXVideoPlaybackContainer::IsRealOneBitmapTimerActive(%d)"), timerActive);
+
+    return timerActive;
+}
+
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackContainer::HandleRealOneBitmapTimeout
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMPXVideoPlaybackContainer::HandleRealOneBitmapTimeout( TAny* aPtr )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackContainer::HandleRealOneBitmapTimeout()"));
+    static_cast<CMPXVideoPlaybackContainer*>(aPtr)->DoHandleRealOneBitmapTimeout();
+    return KErrNone;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackContainer::DoHandleRealOneBitmapTimeout
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackContainer::DoHandleRealOneBitmapTimeout()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackContainer::DoHandleRealOneBitmapTimeout()"));
+
+    if ( iDelayedFileDetails )
+    {
+        MPX_TRAPD( err, iControlsController->AddFileDetailsL( iDelayedFileDetails ) );
+
+        //
+        //  Delete the temp file details since plugin initialization is complete
+        //
+        if ( iFileDetails )
+        {
+            delete iFileDetails;
+            iFileDetails = NULL;
+        }
+
+        iDelayedFileDetails = NULL;
+    }
+
+    if ( iRealOneBitmapTimer->IsActive() )
+    {
+        iRealOneBitmapTimer->Cancel();
+        delete iRealOneBitmapTimer;
+        iRealOneBitmapTimer = NULL;
+    }
+
+    MPX_TRAPD( err, iView->HandleCommandL( EMPXPbvCmdRealOneBitmapTimeout ) );
+}
+
+// EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviews/src/mpxvideoplaybackdisplayhandler.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,725 @@
+/*
+* 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:   Implementation of video playback display handler
+*
+*/
+
+
+// Version : %version: 18 %
+
+
+#include <sysutil.h>
+#include <s32file.h>
+#include <mpxcommand.h>
+#include <mpxcommandgeneraldefs.h>
+#include <mpxplaybackutility.h>
+#include <mpxvideoplaybackdefs.h>
+
+#include "mpxvideoplaybackdisplayhandler.h"
+#include "mpxvideoregion.h"
+#include "mpxvideoplaybackviewfiledetails.h"
+#include "mpxvideoplaybackcontainer.h"
+#include "mpxcommonvideoplaybackview.hrh"
+
+
+_LIT( KAspectRatioFile, "c:\\private\\200159b2\\mpxvideoplayer_aspect_ratio.dat" );
+
+
+CMPXVideoPlaybackDisplayHandler::CMPXVideoPlaybackDisplayHandler(
+                                     MMPXPlaybackUtility* aPlayUtil,
+                                     CMPXVideoPlaybackContainer* aContainer)
+    : iPlaybackUtility( aPlayUtil )
+    , iContainer( aContainer )
+    , iScaleWidth( 100.0f )
+    , iScaleHeight( 100.0f )
+    , iHorizontalPosition( EHorizontalAlignCenter )
+    , iVerticalPosition( EVerticalAlignCenter )
+    , iRotation( EVideoRotationNone )
+    , iAutoScale( EAutoScaleBestFit )
+{
+}
+
+CMPXVideoPlaybackDisplayHandler::~CMPXVideoPlaybackDisplayHandler()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::~CMPXVideoPlaybackDisplayHandler()"));
+
+    MPX_TRAPD( error, SaveAspectRatioL() );
+
+    iAspectRatioArray.Close();
+
+    if ( iVideoDisplay )
+    {
+        delete iVideoDisplay;
+        iVideoDisplay = NULL;
+    }
+
+    iSurfaceId = TSurfaceId::CreateNullId();
+}
+
+CMPXVideoPlaybackDisplayHandler*
+CMPXVideoPlaybackDisplayHandler::NewL( MMPXPlaybackUtility* aPlayUtil,
+                                       CMPXVideoPlaybackContainer* aContainer )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::NewL()"));
+
+    CMPXVideoPlaybackDisplayHandler* self =
+        new(ELeave) CMPXVideoPlaybackDisplayHandler( aPlayUtil, aContainer );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackDisplayHandler::ConstructL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackDisplayHandler::ConstructL()
+{
+    LoadAspectRatioL();
+
+    TRect displayRect = iContainer->Rect();
+    iDisplayAspectRatio = (TReal32)displayRect.Width() / (TReal32)displayRect.Height();
+
+    MPX_DEBUG(_L("CMPXVideoPlaybackDisplayHandler::ConstructL() iDisplayAspectRatio = %f"),
+        iDisplayAspectRatio );
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackDisplayHandler::CreateDisplayWindowL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackDisplayHandler::CreateDisplayWindowL(
+                                           CWsScreenDevice& aScreenDevice,
+                                           RWindow& aWin,
+                                           CMPXVideoPlaybackViewFileDetails* aFileDetails )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::CreateDisplayWindowL()"));
+
+    //
+    //  Save off the video aspect ratio
+    //
+    iVideoHeight = aFileDetails->iVideoHeight;
+    iVideoWidth  = aFileDetails->iVideoWidth;
+
+    MPX_DEBUG(
+        _L("CMPXVideoPlaybackDisplayHandler::CreateDisplayWindowL() clip size (%d,%d)"),
+                iVideoHeight, iVideoWidth );
+
+    AddDisplayWindowL( aScreenDevice, aWin, &aWin );
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackDisplayHandler::RemoveDisplayWindow()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackDisplayHandler::RemoveDisplayWindow()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::RemoveDisplayWindow()"));
+
+    if ( iVideoDisplay )
+    {
+        //
+        //  Surface is being removed, signal the container so it can reset the background
+        //
+        if ( iContainer )
+        {
+            MPX_TRAPD( err, iContainer->HandleCommandL( EMPXPbvSurfaceRemoved ) );
+        }
+
+        delete iVideoDisplay;
+        iVideoDisplay = NULL;
+    }
+
+    iSurfaceId = TSurfaceId::CreateNullId();
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackDisplayHandler::HandleVideoDisplayMessageL()
+// -------------------------------------------------------------------------------------------------
+//
+void
+CMPXVideoPlaybackDisplayHandler::HandleVideoDisplayMessageL( CMPXMessage* aMessage )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::HandleVideoDisplayMessageL()"));
+
+    TMPXVideoDisplayCommand message =
+        ( *(aMessage->Value<TMPXVideoDisplayCommand>(KMPXMediaVideoDisplayCommand)) );
+
+    switch ( message )
+    {
+        case EPbMsgVideoSurfaceCreated:
+        {
+            SurfaceCreatedL( aMessage );
+            break;
+        }
+        case EPbMsgVideoSurfaceChanged:
+        {
+            SurfaceChangedL( aMessage );
+            break;
+        }
+        case EPbMsgVideoSurfaceRemoved:
+        {
+            SurfaceRemoved();
+            break;
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackDisplayHandler::CalculateAspectRatioL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackDisplayHandler::CalculateAspectRatioL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::CalculateAspectRatioL()"));
+
+    if ( iVideoHeight > 0 && iVideoWidth > 0 )
+    {
+        TMMFScalingType scalingType = EMMFNatural;
+
+        TReal videoAspectRatio = CalculateVideoAspectRatio();
+
+        MPX_DEBUG(_L("CMPXVideoPlaybackDisplayHandler::CalculateAspectRatioL() displayAR = %f videoAR = %f)"),
+            iDisplayAspectRatio, videoAspectRatio );
+
+        TInt cnt = iAspectRatioArray.Count();
+        TInt i = 0;
+
+        //
+        //  check whether dat file has the information about (videoRatio + screenRatio)
+        //
+        for ( ; i < cnt ; i++ )
+        {
+            if ( IsAspectRatioEqual( iAspectRatioArray[i].videoRatio, videoAspectRatio ) &&
+                 IsAspectRatioEqual( iAspectRatioArray[i].screenRatio, iDisplayAspectRatio ) &&
+                 ( scalingType = iAspectRatioArray[i].scalingType ) > 0 )
+            {
+                MPX_DEBUG(_L("CMPXVideoPlaybackDisplayHandler::CalculateAspectRatioL() ratio found)"));
+                break;
+            }
+        }
+
+        //
+        //  if can't find out match aspect ratio in dat file,
+        //  choose the scaling type through the rule
+        //      aspectRatioDiff =  videoAspectRatio - aDisplayAspectRatio
+        //      aspectRatioDiff ==  0        ==> natural
+        //      aspectRatioDiff > 0.1        ==> zoom
+        //      aspectRatioDiff < - 0.3      ==> natural
+        //      aspectRatioDiff >= - 0.3 and <= 0.1   ==> stretch
+        //
+        if ( i == cnt )
+        {
+            if ( videoAspectRatio - iDisplayAspectRatio > 0.1 )
+            {
+                scalingType = EMMFZoom;
+            }
+            else if ( ( ! IsAspectRatioEqual( videoAspectRatio, iDisplayAspectRatio ) ) &&
+                      ( videoAspectRatio - iDisplayAspectRatio > (- 0.3) ) )
+            {
+                scalingType = EMMFStretch;
+            }
+
+            TMPXAspectRatio ratio;
+
+            ratio.videoRatio = videoAspectRatio;
+            ratio.screenRatio = iDisplayAspectRatio;
+            ratio.scalingType = scalingType;
+
+            iAspectRatioArray.Append( ratio );
+        }
+
+        iCurrentIndexForAspectRatio = i;
+
+        TMPXVideoPlaybackCommand aspectRatioCmd = EPbCmdNaturalAspectRatio;
+
+        if ( scalingType == EMMFZoom )
+        {
+            aspectRatioCmd = EPbCmdZoomAspectRatio;
+        }
+        else if ( scalingType == EMMFStretch )
+        {
+            aspectRatioCmd = EPbCmdStretchAspectRatio;
+        }
+
+        SetAspectRatioL( aspectRatioCmd );
+
+        //
+        //  If the screen aspect ratio and the video aspect ratio are not equal,
+        //  signal the controls controller to create the aspect ratio icon
+        //
+        if ( ShowAspectRatioIcon() )
+        {
+            iContainer->HandleEventL( EMPXControlCmdCreateAspectRatioIcon );
+        }
+        else
+        {
+            iContainer->HandleEventL( EMPXControlCmdDeleteAspectRatioIcon );
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackDisplayHandler::SaveAspectRatioL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackDisplayHandler::SaveAspectRatioL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::SaveAspectRatioL"));
+
+    RFs fs;
+    TInt err = fs.Connect();
+    CleanupClosePushL<RFs>( fs );
+
+    TBool canSave = EFalse;
+
+    TRAP_IGNORE( canSave = ! SysUtil::FFSSpaceBelowCriticalLevelL(
+                                 &fs, sizeof(TMPXAspectRatio) * iAspectRatioArray.Count()) );
+
+    if ( canSave )
+    {
+        // save list to disk
+        RFileWriteStream out;
+
+        TInt err( out.Replace( fs, KAspectRatioFile, EFileWrite ) );
+
+        if ( err == KErrPathNotFound )
+        {
+            fs.MkDirAll( KAspectRatioFile );
+            err = out.Create( fs, KAspectRatioFile, EFileWrite );
+        }
+
+        if ( ! err )
+        {
+            TInt cnt = iAspectRatioArray.Count();
+
+            MPX_TRAP( err,
+            {
+                for ( TInt i = 0 ; i < cnt ; i++ )
+                {
+                    //
+                    //  Save (videoRatio + screenRatio + scalingType)
+                    //
+                    out.WriteReal32L( iAspectRatioArray[i].videoRatio );
+                    out.WriteReal32L( iAspectRatioArray[i].screenRatio );
+                    out.WriteInt8L( iAspectRatioArray[i].scalingType );
+                }
+            } );
+
+            out.Close();
+        }
+    }
+
+    CleanupStack::PopAndDestroy();
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackDisplayHandler::LoadAspectRatioL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackDisplayHandler::LoadAspectRatioL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::LoadAspectRatioL()"));
+
+    RFs fs;
+    RFileReadStream in;
+
+    TInt err = fs.Connect();
+    CleanupClosePushL<RFs>( fs );
+
+    if ( ! err && in.Open( fs, KAspectRatioFile, EFileRead ) == KErrNone )
+    {
+        TMPXAspectRatio ratio;
+
+        MPX_TRAP( err,
+        {
+            for ( err = KErrNone ; err == KErrNone ; )
+            {
+                //
+                //  Read (videoRatio + screenRatio + scalingType)
+                //
+                ratio.videoRatio = in.ReadReal32L();
+                ratio.screenRatio = in.ReadReal32L();
+                ratio.scalingType = (TMMFScalingType)in.ReadInt8L();
+
+                iAspectRatioArray.Append( ratio );
+            }
+        } );
+
+        in.Close();
+    }
+
+    CleanupStack::PopAndDestroy();
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackDisplayHandler::AddDisplayWindowL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackDisplayHandler::AddDisplayWindowL( CWsScreenDevice& aScreenDevice,
+                                                         RWindowBase& aWindowBase,
+                                                         RWindow* aWin )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::AddDisplayWindowL()"));
+
+    TInt displayId = aScreenDevice.GetScreenNumber();
+
+    MPX_DEBUG(_L("CMPXVideoPlaybackDisplayHandler::AddDisplayWindowL() displayId %d"), displayId);
+
+    CMediaClientVideoDisplay* tempDisplay = iVideoDisplay;
+
+    iVideoDisplay = CMediaClientVideoDisplay::NewL( displayId );
+
+    delete tempDisplay;
+
+    TRect cropRect = TRect( aWin->Size() );
+
+    MPX_DEBUG(
+        _L("CMPXVideoPlaybackDisplayHandler::AddDisplayWindowL() cropRect (%d, %d), (%d, %d)"),
+        cropRect.iTl.iX, cropRect.iTl.iY, cropRect.iBr.iX, cropRect.iBr.iY);
+
+    MPX_TRAPD( dispError,
+        iVideoDisplay->AddDisplayWindowL( &aWindowBase,
+                                          cropRect,
+                                          cropRect,
+                                          cropRect,
+                                          iScaleWidth,
+                                          iScaleHeight,
+                                          iRotation,
+                                          iAutoScale,
+                                          iHorizontalPosition,
+                                          iVerticalPosition,
+                                          aWin );
+    );
+
+    MPX_DEBUG(_L("CMPXVideoPlaybackDisplayHandler::AddDisplayWindowL() Display Added"));
+
+    //
+    //  Check if surface was created before window was ready
+    //
+    if ( iSurfaceCached && ! iContainer->IsRealOneBitmapTimerActive() )
+    {
+        AttachNewSurfaceToWindowL();
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackDisplayHandler::SurfaceCreatedL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackDisplayHandler::SurfaceCreatedL( CMPXMessage* aMessage )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::SurfaceCreatedL()"));
+
+    TSurfaceId oldSurfaceId = iSurfaceId;
+
+    //
+    //  Extract the surface parameters from the message
+    //
+    iSurfaceId = aMessage->ValueTObjectL<TSurfaceId>( KMPXMediaVideoDisplayTSurfaceId );
+    iCropRect = aMessage->ValueTObjectL<TRect>( KMPXMediaVideoDisplayCropRect );
+    iAspectRatio = aMessage->ValueTObjectL<TVideoAspectRatio>( KMPXMediaVideoDisplayAspectRatio );
+
+    MPX_DEBUG(_L("CMPXVideoPlaybackDisplayHandler::SurfaceCreatedL iCropRect[(%d,%d),(%d,%d)] iAspectRatio = (%d,%d)"),
+        iCropRect.iTl.iX, iCropRect.iTl.iY, iCropRect.iBr.iX, iCropRect.iBr.iY,
+        iAspectRatio.iNumerator, iAspectRatio.iDenominator );
+
+    //
+    //  Add the surface unless the video display hasn't been created or
+    //  the Real One bitmap is being shown.
+    //
+    if ( iVideoDisplay && ! iContainer->IsRealOneBitmapTimerActive() )
+    {
+        //
+        //  Remove old surface if one exists
+        //
+        if ( ! oldSurfaceId.IsNull() )
+        {
+            iVideoDisplay->RemoveSurface();
+        }
+
+        AttachNewSurfaceToWindowL();
+    }
+    else
+    {
+        //
+        //  Save the surface information to add it when the display is ready
+        //
+        iSurfaceCached = ETrue;
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackDisplayHandler::SurfaceChangedL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackDisplayHandler::SurfaceChangedL( CMPXMessage* aMessage )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::SurfaceChangedL()"));
+
+    TVideoAspectRatio oldAspectRatio = iAspectRatio;
+
+    //
+    //  Extract the surface parameters from the message
+    //
+    iSurfaceId = aMessage->ValueTObjectL<TSurfaceId>( KMPXMediaVideoDisplayTSurfaceId );
+    iCropRect = aMessage->ValueTObjectL<TRect>( KMPXMediaVideoDisplayCropRect );
+    iAspectRatio = aMessage->ValueTObjectL<TVideoAspectRatio>( KMPXMediaVideoDisplayAspectRatio );
+
+    //
+    //  Check if the surface has been cached
+    //  If surface has been cached, exit since the surface parameters have been saved
+    //
+    if ( ! iSurfaceCached && iVideoDisplay )
+    {
+        //
+        //  Add new surface
+        //
+        iVideoDisplay->SurfaceParametersChanged( iSurfaceId, iCropRect, iAspectRatio );
+        iVideoDisplay->RedrawWindows( iCropRect );
+
+        //
+        //  Update the Aspect Ratio if it changed on the surface
+        //
+        if ( oldAspectRatio != iAspectRatio )
+        {
+            CalculateAspectRatioL();
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackDisplayHandler::RemoveSurfaceFromPlaybackPluginL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackDisplayHandler::RemoveSurfaceFromPlaybackPluginL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::RemoveSurfaceFromPlaybackPluginL()"));
+
+    CMPXCommand* cmd = CMPXCommand::NewL();
+    CleanupStack::PushL( cmd );
+
+    cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
+    cmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId, KMPXMediaIdVideoPlayback );
+    cmd->SetTObjectValueL<TMPXVideoPlaybackCommand>( KMPXMediaVideoPlaybackCommand,
+                                                     EPbCmdSurfaceRemovedFromWindow );
+    cmd->SetTObjectValueL<TSurfaceId>( KMPXMediaVideoDisplayTSurfaceId, iSurfaceId );
+
+    iPlaybackUtility->CommandL( *cmd );
+    CleanupStack::PopAndDestroy( cmd );
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackDisplayHandler::SurfaceRemoved()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackDisplayHandler::SurfaceRemoved()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::SurfaceRemoved()"));
+
+    if ( iVideoDisplay )
+    {
+        if ( iContainer )
+        {
+            MPX_TRAPD( err, iContainer->HandleCommandL( EMPXPbvSurfaceRemoved ) );
+        }
+
+        iVideoDisplay->RemoveSurface();
+
+        //
+        // Signal the playback plugin to remove the surface from Helix
+        //
+        MPX_TRAPD( err2, RemoveSurfaceFromPlaybackPluginL() );
+    }
+
+    iSurfaceId = TSurfaceId::CreateNullId();
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackDisplayHandler::SetAspectRatioL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackDisplayHandler::SetAspectRatioL( TMPXVideoPlaybackCommand aCmd )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::SetAspectRatioL()"),
+                   _L("aCmd = %d"), aCmd);
+
+    TInt aspectRatio = EMMFNatural;
+
+    switch ( aCmd )
+    {
+        case EPbCmdNaturalAspectRatio:
+        {
+            iAutoScale = EAutoScaleBestFit;
+            aspectRatio = EMMFNatural;
+            break;
+        }
+        case EPbCmdZoomAspectRatio:
+        {
+            iAutoScale = EAutoScaleClip;
+            aspectRatio = EMMFZoom;
+            break;
+        }
+        case EPbCmdStretchAspectRatio:
+        {
+            iAutoScale = EAutoScaleStretch;
+            aspectRatio = EMMFStretch;
+            break;
+        }
+    }
+
+    if ( iVideoDisplay && ! iSurfaceId.IsNull() )
+    {
+        iVideoDisplay->SetAutoScaleL( iAutoScale,
+                                      iHorizontalPosition,
+                                      iVerticalPosition,
+                                      iCropRect );
+    }
+
+    //
+    //  Update the controls controller with the new aspect ratio
+    //
+    if ( iContainer )
+    {
+        iContainer->HandleEventL( EMPXControlCmdSetAspectRatio, aspectRatio );
+    }
+
+    //
+    //  Update the aspect ratio in the array
+    //
+    TInt count = iAspectRatioArray.Count();
+
+    if ( count > 0 && count > iCurrentIndexForAspectRatio )
+    {
+        iAspectRatioArray[iCurrentIndexForAspectRatio].scalingType = (TMMFScalingType)aspectRatio;
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackDisplayHandler::DoHandleRealOneBitmapTimeoutL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackDisplayHandler::DoHandleRealOneBitmapTimeoutL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::DoHandleRealOneBitmapTimeoutL()"));
+
+    //
+    //  Check if surface was created before window was ready
+    //
+    if ( iSurfaceCached && iVideoDisplay )
+    {
+        AttachNewSurfaceToWindowL();
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackDisplayHandler::AttachNewSurfaceToWindowL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackDisplayHandler::AttachNewSurfaceToWindowL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::AttachNewSurfaceToWindowL()"));
+
+    //
+    //  Calculate the video aspect ratio and set the proper value on the video display
+    //  before attaching the surface
+    //
+    CalculateAspectRatioL();
+
+    iVideoDisplay->SurfaceCreated( iSurfaceId, iCropRect, iAspectRatio, iCropRect );
+
+    if ( iContainer )
+    {
+        iContainer->HandleCommandL( EMPXPbvSurfaceCreated );
+    }
+
+    iSurfaceCached = EFalse;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackDisplayHandler::ShowAspectRatioIcon()
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoPlaybackDisplayHandler::ShowAspectRatioIcon()
+{
+    TBool showAspectRatio = ETrue;
+
+    TReal videoAspectRatio = CalculateVideoAspectRatio();
+
+    if ( IsAspectRatioEqual( videoAspectRatio, iDisplayAspectRatio ) )
+    {
+        showAspectRatio = EFalse;
+    }
+
+    MPX_DEBUG(_L("CMPXVideoPlaybackDisplayHandler::ShowAspectRatioIcon(%d)"), showAspectRatio);
+
+    return showAspectRatio;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackDisplayHandler::IsAspectRatioEqual()
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoPlaybackDisplayHandler::IsAspectRatioEqual( TReal aRatio1, TReal aRatio2 )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackDisplayHandler::IsAspectRatioEqual() ar1 = %f ar2 = %f)"),
+            aRatio1, aRatio2 );
+
+    TBool valuesEqual = EFalse;
+    TReal arDiff = aRatio1 - aRatio2;
+
+    if ( arDiff < 0.01 && arDiff > -0.01 )
+    {
+        valuesEqual = ETrue;
+    }
+
+    MPX_DEBUG(_L("CMPXVideoPlaybackDisplayHandler::IsAspectRatioEqual(%d)"), valuesEqual);
+
+    return valuesEqual;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackDisplayHandler::CalculateVideoAspectRatio()
+// -------------------------------------------------------------------------------------------------
+//
+TReal CMPXVideoPlaybackDisplayHandler::CalculateVideoAspectRatio()
+{
+    TReal videoAspectRatio = 0.0;
+
+    if ( iVideoHeight > 0 && iVideoWidth > 0 )
+    {
+        videoAspectRatio = (TReal32)iVideoWidth / (TReal32)iVideoHeight;
+
+        //
+        //  If the pixel aspect ratio is valid, use it to modify the videoAspectRatio
+        //
+        if ( iAspectRatio.iDenominator )
+        {
+            MPX_DEBUG(_L("CMPXVideoPlaybackDisplayHandler::CalculateVideoAspectRatio() iAspectRatio = (%d,%d)"),
+                iAspectRatio.iNumerator, iAspectRatio.iDenominator );
+
+            TReal32 par = (TReal32)iAspectRatio.iNumerator / (TReal32)iAspectRatio.iDenominator;
+
+            videoAspectRatio *= par;
+        }
+    }
+
+    MPX_DEBUG(_L("CMPXVideoPlaybackDisplayHandler::CalculateVideoAspectRatio(%f)"), videoAspectRatio );
+
+    return videoAspectRatio;
+}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviews/src/mpxvideoplaybackuserinputhandler.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,623 @@
+/*
+* 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:  Implementation of playback view's input handler
+*
+*/
+
+
+// Version : %version: 20 %
+
+
+// INCLUDE FILES
+#include <w32std.h> // RWindowBase
+#include <e32base.h>
+#include <StringLoader.h>
+#include <AknUtils.h>
+#include <eikclbd.h>
+#include <aknconsts.h>
+#include <AknUtils.h>
+#include <AknIconUtils.h>  // SetSize for the icons
+#include <remconcoreapi.h>
+#include <remconcoreapitarget.h>
+#include <remconinterfaceselector.h> // Side volume key
+#include <mpxplaybackframeworkdefs.h>
+
+#include <e32std.h>
+
+#ifdef __USERINPUTHANDLERSTIF__
+#include "videoplaybackcontainer_stub.h"
+#include "videoplaybackcontrol_stub.h"
+#include "hal_stub.h"
+#else
+#include "mpxvideoplaybackcontainer.h"
+#include "mpxvideoplaybackcontrol.h"
+#endif
+
+#include "mpxvideoplaybackcontrol.hrh"
+#include "mpxvideoplaybackuserinputhandler.h"
+
+#include <mpxvideoplaybackdefs.h>
+#include "mpxcommonvideoplaybackview.hrh"
+#include "mpxvideo_debug.h"
+
+
+// ======== MEMBER FUNCTIONS =======================================================================
+
+// -------------------------------------------------------------------------------------------------
+// MPXVideoPlaybackUserInputHandler::CMPXVideoPlaybackUserInputHandler()
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackUserInputHandler::CMPXVideoPlaybackUserInputHandler(
+        CMPXVideoPlaybackContainer* aContainer)
+   : iProcessingInputType(EMpxVideoNone),
+     iForeground(ETrue),
+     iBlockPdlInputs(EFalse),
+     iContainer(aContainer)
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackUserInputHandler::NewL()
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackUserInputHandler* CMPXVideoPlaybackUserInputHandler::NewL(
+        CMPXVideoPlaybackContainer* aContainer )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackUserInputHandler::NewL()"));
+
+    CMPXVideoPlaybackUserInputHandler* self =
+        new (ELeave) CMPXVideoPlaybackUserInputHandler( aContainer );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackUserInputHandler::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackUserInputHandler::ConstructL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackUserInputHandler::ConstructL()"));
+
+    iVolumeRepeatTimer = CPeriodic::NewL( CActive::EPriorityStandard );
+
+    iInterfaceSelector = CRemConInterfaceSelector::NewL();
+    iCoreTarget = CRemConCoreApiTarget::NewL( *iInterfaceSelector, *this );
+
+    // not detrimental if Media Keys dont work - so ignore any errors here
+    TRAP_IGNORE( iInterfaceSelector->OpenTargetL() );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackUserInputHandler::~CMPXVideoPlaybackUserInputHandler()
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackUserInputHandler::~CMPXVideoPlaybackUserInputHandler()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackUserInputHandler::~CMPXVideoPlaybackUserInputHandler()"));
+
+    if ( iVolumeRepeatTimer )
+    {
+        iVolumeRepeatTimer->Cancel();
+        delete iVolumeRepeatTimer;
+    }
+
+    if ( iInterfaceSelector )
+    {
+        delete iInterfaceSelector;
+        iCoreTarget = NULL;
+        iInterfaceSelector = NULL;
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackUserInputHandler::MrccatoPlay()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackUserInputHandler::MrccatoPlay( TRemConCoreApiPlaybackSpeed /*aSpeed*/,
+                                                     TRemConCoreApiButtonAction aButtonAct )
+{
+    MPX_ENTER_EXIT(
+        _L("CMPXVideoPlaybackUserInputHandler::MrccatoPlay"),
+        _L("aButtonAct = %d"), aButtonAct );
+
+    ProcessMediaKey( ERemConCoreApiPlay, aButtonAct );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackUserInputHandler::MrccatoCommand()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackUserInputHandler::MrccatoCommand( TRemConCoreApiOperationId aOperationId,
+                                                        TRemConCoreApiButtonAction aButtonAct )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackUserInputHandler::MrccatoCommand"));
+
+    ProcessMediaKey( aOperationId, aButtonAct );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackUserInputHandler::DoHandleMediaKey()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackUserInputHandler::DoHandleMediaKey( TRemConCoreApiOperationId aOperationId,
+                                                          TRemConCoreApiButtonAction aButtonAct )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackUserInputHandler::DoHandleMediaKey()"),
+                   _L("aOperationId = %d"), aOperationId );
+
+    switch ( aOperationId )
+    {
+        case ERemConCoreApiStop:
+        {
+            if ( aButtonAct == ERemConCoreApiButtonClick )
+            {
+                //
+                //  When the stop key is pressed from the remote control interface,
+                //  issue a softkey back so all views will exit the playback view.
+                //
+                TRAP_IGNORE( iContainer->HandleCommandL( EAknSoftkeyBack ) );
+            }
+            break;
+        }
+        case ERemConCoreApiRewind:
+        {
+            HandleRewind( aButtonAct );
+            break;
+        }
+        case ERemConCoreApiFastForward:
+        {
+            HandleFastForward( aButtonAct );
+            break;
+        }
+        case ERemConCoreApiVolumeUp:
+        {
+            HandleVolumeUp( aButtonAct );
+            break;
+        }
+        case ERemConCoreApiVolumeDown:
+        {
+            HandleVolumeDown( aButtonAct );
+            break;
+        }
+        case ERemConCoreApiPausePlayFunction:
+        {
+            if ( aButtonAct == ERemConCoreApiButtonClick )
+            {
+                TRAP_IGNORE(iContainer->HandleCommandL( EMPXPbvCmdPlayPause ));
+            }
+            break;
+        }
+        case ERemConCoreApiPause:
+        {
+            TRAP_IGNORE( iContainer->HandleCommandL(EMPXPbvCmdPause) );
+            break;
+        }
+        case ERemConCoreApiPlay:
+        {
+            if ( aButtonAct == ERemConCoreApiButtonClick )
+            {
+                TRAP_IGNORE( iContainer->HandleCommandL( EMPXPbvCmdPlay ) );
+            }
+            break;
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackUserInputHandler::HandleFastForward()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackUserInputHandler::HandleFastForward( TRemConCoreApiButtonAction aButtonAct )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackUserInputHandler::HandleFastForward()"));
+
+    if ( aButtonAct == ERemConCoreApiButtonPress )
+    {
+        TRAP_IGNORE( iContainer->HandleCommandL( EMPXPbvCmdSeekForward ) );
+    }
+    else if ( aButtonAct == ERemConCoreApiButtonRelease )
+    {
+        TRAP_IGNORE( iContainer->HandleCommandL( EMPXPbvCmdEndSeek ) );
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackUserInputHandler::HandleRewind()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackUserInputHandler::HandleRewind( TRemConCoreApiButtonAction aButtonAct )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackUserInputHandler::HandleFastForward()"));
+
+    if ( aButtonAct == ERemConCoreApiButtonPress )
+    {
+        TRAP_IGNORE( iContainer->HandleCommandL( EMPXPbvCmdSeekBackward ) );
+    }
+    else if ( aButtonAct == ERemConCoreApiButtonRelease )
+    {
+        TRAP_IGNORE( iContainer->HandleCommandL( EMPXPbvCmdEndSeek ) );
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackUserInputHandler::HandleVolumeUp()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackUserInputHandler::HandleVolumeUp( TRemConCoreApiButtonAction aButtonAct )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackUserInputHandler::HandleVolumeUp()"),
+                   _L("aButtonAct = %d"), aButtonAct );
+
+    switch ( aButtonAct )
+    {
+        case ERemConCoreApiButtonPress:
+        {
+            // Volume Up - Pressed
+            if ( iVolumeRepeatTimer->IsActive() )
+            {
+                iVolumeRepeatTimer->Cancel();
+            }
+
+            iVolumeRepeatUp = ETrue;
+
+            iVolumeRepeatTimer->Start(
+                KAknStandardKeyboardRepeatRate,
+                KAknStandardKeyboardRepeatRate,
+                TCallBack(
+                    CMPXVideoPlaybackUserInputHandler::HandleVolumeRepeatTimeoutL,
+                    this ) );
+
+            break;
+        }
+        case ERemConCoreApiButtonRelease:
+        {
+            // Volume Up - Released
+            iVolumeRepeatTimer->Cancel();
+            break;
+        }
+        case ERemConCoreApiButtonClick:
+        {
+            // Volume Up - Clicked
+            TRAP_IGNORE( iContainer->HandleCommandL( EMPXPbvCmdIncreaseVolume ) );
+            break;
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackUserInputHandler::HandleVolumeDown()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackUserInputHandler::HandleVolumeDown( TRemConCoreApiButtonAction aButtonAct )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackUserInputHandler::HandleVolumeDown()"));
+
+    switch ( aButtonAct )
+    {
+        case ERemConCoreApiButtonPress:
+        {
+            // Volume Up - Pressed
+            if ( iVolumeRepeatTimer->IsActive() )
+            {
+                iVolumeRepeatTimer->Cancel();
+            }
+
+            iVolumeRepeatUp = EFalse;
+
+            iVolumeRepeatTimer->Start(
+                KAknStandardKeyboardRepeatRate,
+                KAknStandardKeyboardRepeatRate,
+                TCallBack(
+                    CMPXVideoPlaybackUserInputHandler::HandleVolumeRepeatTimeoutL,
+                    this ) );
+
+            break;
+        }
+        case ERemConCoreApiButtonRelease:
+        {
+            // Volume Up - Released
+            iVolumeRepeatTimer->Cancel();
+            break;
+        }
+        case ERemConCoreApiButtonClick:
+        {
+            // Volume Down - Clicked
+            TRAP_IGNORE( iContainer->HandleCommandL( EMPXPbvCmdDecreaseVolume ) );
+            break;
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackUserInputHandler::ProcessPointerEvent()
+// -------------------------------------------------------------------------------------------------
+//
+EXPORT_C void
+CMPXVideoPlaybackUserInputHandler::ProcessPointerEventL( CCoeControl* aControl,
+                                                         const TPointerEvent& aPointerEvent,
+                                                         TMPXVideoControlType aMPXControl )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackUserInputHandler::ProcessPointerEvent()"),
+                   _L("iProcessingInputType = %d, aPointerEvent.iType = %d"),
+                   iProcessingInputType, aPointerEvent.iType );
+
+    switch ( iProcessingInputType )
+    {
+        case EMpxVideoNone:
+        {
+            if ( aPointerEvent.iType == TPointerEvent::EButton1Down && IsUserInputAllowed() )
+            {
+                iProcessingInputType = EMpxVideoTouch;
+
+                //
+                //  Save the active controls pointer to reroute invalid pointer events
+                //
+                iActiveControlPtr = aControl;
+                iActiveControlType = aMPXControl;
+
+                ReRoutePointerEventL( aControl, aPointerEvent, aMPXControl );
+            }
+
+            break;
+        }
+        case EMpxVideoTouch:
+        {
+            if ( aControl == iActiveControlPtr )
+            {
+                //
+                //  Event is from the active control, process pointer event normally
+                //
+                if ( aPointerEvent.iType != TPointerEvent::EButton1Down )
+                {
+                    ReRoutePointerEventL( aControl, aPointerEvent, aMPXControl );
+
+                    //
+                    //  reset the value only on pointer up event - but not on drag
+                    //
+                    if ( aPointerEvent.iType == TPointerEvent::EButton1Up )
+                    {
+                        iProcessingInputType = EMpxVideoNone;
+                        iActiveControlPtr = NULL;
+                    }
+                }
+            }
+            else
+            {
+                //
+                //  Event is from non active control
+                //  This should not happen, but if event is a button up event,
+                //  end the current active control pointer processing
+                //
+                if ( aPointerEvent.iType == TPointerEvent::EButton1Up )
+                {
+                    //
+                    //  Reroute button up event to active control and end current
+                    //  control processing
+                    //
+                    ReRoutePointerEventL( iActiveControlPtr, aPointerEvent, iActiveControlType );
+                    iProcessingInputType = EMpxVideoNone;
+                    iActiveControlPtr = NULL;
+                }
+            }
+
+            break;
+        }
+    } // switch
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackUserInputHandler::ReRoutePointerEventL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackUserInputHandler::ReRoutePointerEventL( CCoeControl* aControl,
+                                                              const TPointerEvent& aPointerEvent,
+                                                              TMPXVideoControlType aMPXControl )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackUserInputHandler::ReRoutePointerEventL()"),
+                   _L("aMPXControl = %d"), aMPXControl );
+
+    if ( aMPXControl == EMpxVideoPlaybackContainer )
+    {
+        iContainer->DoHandlePointerEventL( aPointerEvent );
+    }
+    else if ( aMPXControl == EMpxVideoPlaybackControl )
+    {
+        static_cast<CMPXVideoPlaybackControl*>(aControl)->DoHandlePointerEventL( aPointerEvent );
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackUserInputHandler::ProcessKeyEvent()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackUserInputHandler::ProcessKeyEventL( const TKeyEvent& aKeyEvent,
+                                                          TEventCode aType )
+{
+    MPX_ENTER_EXIT(_L("MPXVideoPlaybackUserInputHandler::ProcessKeyEvent()"),
+                   _L("iProcessingInputType = %d, aType = %d"), iProcessingInputType, aType );
+
+    switch ( iProcessingInputType )
+    {
+        case EMpxVideoNone:
+        {
+            if ( aType == EEventKeyDown && IsUserInputAllowed() )
+            {
+                iProcessingInputType = EMpxVideoKeyboard;
+                iLastPressedKeyScanCode = aKeyEvent.iScanCode;
+
+                iContainer->DoHandleKeyEventL( aKeyEvent, aType );
+            }
+            break;
+        }
+        case EMpxVideoKeyboard:
+        {
+            MPX_DEBUG(_L("aKeyEvent.iScanCode = %d, iLastPressedKeyScanCode = %d"),
+                aKeyEvent.iScanCode, iLastPressedKeyScanCode );
+
+            //
+            //  Only handle events for the key being handled
+            //
+            if ( aKeyEvent.iScanCode == iLastPressedKeyScanCode )
+            {
+                iContainer->DoHandleKeyEventL( aKeyEvent, aType );
+
+                if ( aType == EEventKeyUp )
+                {
+                    iProcessingInputType = EMpxVideoNone;
+                }
+            }
+
+            break;
+        }
+    } // switch
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackUserInputHandler::ProcessMediaKey()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackUserInputHandler::ProcessMediaKey( TRemConCoreApiOperationId aOperationId,
+                                                         TRemConCoreApiButtonAction aButtonAct )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackUserInputHandler::ProcessMediaKey()"),
+                   _L("iProcessingInputType = %d, aButtonAct = %d"),
+                       iProcessingInputType, aButtonAct );
+
+    switch ( iProcessingInputType )
+    {
+        case EMpxVideoNone:
+        {
+            if ( IsUserInputAllowed() )
+            {
+                if ( aButtonAct == ERemConCoreApiButtonPress )
+                {
+                    iProcessingInputType = EMpxVideoMediaKeys;
+                    iLastMediaKeyPressed = aOperationId;
+                    DoHandleMediaKey( aOperationId, aButtonAct );
+                }
+                else if ( aButtonAct == ERemConCoreApiButtonClick )
+                {
+                    DoHandleMediaKey( aOperationId, aButtonAct );
+                    // reset on click AND/OR release
+                    iProcessingInputType = EMpxVideoNone;
+                }
+            }
+            break;
+        }
+        case EMpxVideoMediaKeys:
+        {
+            if ( aButtonAct == ERemConCoreApiButtonRelease )
+            {
+                //
+                //  Handle only if this release is for media-key being currently handled
+                //  Ignore spurious media key presses
+                //
+                if ( iLastMediaKeyPressed == aOperationId )
+                {
+                    DoHandleMediaKey( aOperationId, aButtonAct );
+
+                    iProcessingInputType = EMpxVideoNone;
+                }
+            }
+            break;
+        }
+    } // switch
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackUserInputHandler::HandleVolumeRepeatTimeoutL()
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMPXVideoPlaybackUserInputHandler::HandleVolumeRepeatTimeoutL( TAny* aPtr )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackUserInputHandler::HandleVolumeRepeatTimeoutL()"));
+
+    static_cast<CMPXVideoPlaybackUserInputHandler*>(aPtr)->HandleVolumeRepeatL();
+
+    return KErrNone;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackUserInputHandler::HandleVolumeRepeatL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackUserInputHandler::HandleVolumeRepeatL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackUserInputHandler::HandleVolumeRepeatL()"));
+
+    TMPXVideoPlaybackViewCommandIds command = EMPXPbvCmdDecreaseVolume;
+
+    if ( iVolumeRepeatUp )
+    {
+        command = EMPXPbvCmdIncreaseVolume;
+    }
+
+    iContainer->HandleCommandL( command );
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackUserInputHandler::SetForeground()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackUserInputHandler::SetForeground( TBool aForeground )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackUserInputHandler::SetForeground()"),
+                   _L("aForeground = %d"), aForeground );
+
+    iForeground = aForeground;
+
+    if ( ! iForeground )
+    {
+        //
+        //  Keyboard focus has been lost
+        //  Reset input type and clear volume timer if necessary
+        //
+        iProcessingInputType = EMpxVideoNone;
+
+        if ( iVolumeRepeatTimer->IsActive() )
+        {
+            iVolumeRepeatTimer->Cancel();
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackUserInputHandler::BlockPdlUserInputs()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackUserInputHandler::BlockPdlUserInputs( TBool aBlockInputs )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackUserInputHandler::BlockPdlUserInputs(%d)"), aBlockInputs);
+
+    iBlockPdlInputs = aBlockInputs;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackUserInputHandler::IsUserInputAllowed()
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoPlaybackUserInputHandler::IsUserInputAllowed()
+{
+    TBool allowInput = ( iForeground && ! iBlockPdlInputs );
+
+    MPX_DEBUG(_L("CMPXVideoPlaybackUserInputHandler::IsUserInputAllowed(%d)"), allowInput);
+
+    return allowInput;
+}
+
+// EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviews/src/mpxvideoplaybackview.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,237 @@
+/*
+* 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:  Implementation of Video playback view
+*
+*/
+
+
+// Version : %version: 22 %
+
+
+//  Include Files
+#include <aknViewAppUi.h>
+#include <mpxplaybackutility.h>
+#include <mpxviewutility.h>
+#include <mpxcollectionutility.h>
+#include <mpxvideoplaybackviews.rsg>
+#include <eikmenup.h>
+#include <mmf/common/mmferrors.h>
+
+#include "mpxcommonvideoplaybackview.hrh"
+#include "mpxvideoplaybackuids.hrh"
+#include "mpxvideoplaybackview.h"
+#include "mpxvideoplaybackviewfiledetails.h"
+#include "mpxvideoplaybackcontainer.h"
+#include "mpxvideo_debug.h"
+
+//  Member Functions
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackView::NewLC()
+// -------------------------------------------------------------------------------------------------
+//
+EXPORT_C CMPXVideoPlaybackView* CMPXVideoPlaybackView::NewLC()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackView::NewLC()"));
+
+    CMPXVideoPlaybackView* self = new (ELeave) CMPXVideoPlaybackView();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackView::NewL()
+// -------------------------------------------------------------------------------------------------
+//
+EXPORT_C CMPXVideoPlaybackView* CMPXVideoPlaybackView::NewL()
+{
+    CMPXVideoPlaybackView* self = CMPXVideoPlaybackView::NewLC();
+    CleanupStack::Pop( self );
+    return self;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackView::CMPXVideoPlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackView::CMPXVideoPlaybackView()
+// note, CBase initialises all member variables to zero
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackView::ConstructL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackView::ConstructL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackView::ConstructL()"));
+
+    InitializeVideoPlaybackViewL();
+
+    iSyncClose = EFalse;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackView::~CMPXVideoPlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackView::~CMPXVideoPlaybackView()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackView::~CMPXVideoPlaybackView()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+//   From CAknView
+//   CMPXVideoPlaybackView::Id() const
+// -------------------------------------------------------------------------------------------------
+//
+TUid CMPXVideoPlaybackView::Id() const
+{
+    return TUid::Uid( KMPXVIDEOPLAYBACKVIEWUID );
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackView::ViewImplementationIdId()
+// -------------------------------------------------------------------------------------------------
+//
+TUid CMPXVideoPlaybackView::ViewImplementationId() const
+{
+    return TUid::Uid( KMPXVIDEOPLAYBACKVIEWPLUGINIMPLEMENTATIONUID );
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackView::CloseEmbeddedPlaybackViewL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackView::CloseEmbeddedPlaybackViewL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackView::CloseEmbeddedPlaybackViewL()"));
+
+    ActivateClosePlayerActiveObject();
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackView::HandlePluginErrorL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackView::HandlePluginErrorL( TInt aError )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackView::HandlePluginErrorL() aError = %d"), aError );
+
+    //
+    // error, stop branding animation
+    //
+    if ( iContainer )
+    {
+        iContainer->HandleEventL( EMPXControlCmdHandleErrors, iPlaybackState );
+    }
+
+    switch( aError )
+    {
+        case KErrNotSupported:
+        case KErrUnknown:
+        case KErrMMDecoder:
+        case KErrCorrupt:
+        case KErrTooBig:
+        {
+            DisplayErrorMessageL( R_MPX_VIDEO_INVALID_CLIP );
+            HandleClosePlaybackViewL();
+            break;
+        }
+        case KErrMMInvalidProtocol:
+        case KErrMMInvalidURL:
+        case KErrArgument:
+        {
+            DisplayErrorMessageL(R_MPX_INVALID_URL);
+            HandleClosePlaybackViewL();
+            break;
+        }
+        case KErrSessionClosed:
+        {
+            DisplayErrorMessageL( R_MPX_RESOURCE_LOST );
+            HandleClosePlaybackViewL();
+            break;
+        }
+        case KErrTimedOut:
+        {
+            DisplayErrorMessageL( R_MPX_IN_CONNECTION_TIMEOUT );
+            HandleClosePlaybackViewL();
+            break;
+        }
+        case KErrMMNotEnoughBandwidth:
+        {
+            DisplayErrorMessageL( R_MPX_LOW_BANDWIDTH );
+            HandleClosePlaybackViewL();
+            break;
+        }
+        case KErrDisconnected:
+        case KErrMMProxyServer:
+        case KErrCouldNotConnect:
+        case KErrAbort:
+        {
+            DisplayErrorMessageL( R_MPX_COULD_NOT_CONNECT );
+            HandleClosePlaybackViewL();
+            break;
+        }
+        case KMPXVideoPlayOver2GDuringVoiceCallError:
+        {
+            DisplayInfoMessageL(R_MPX_VIDEO_PLAY_OVER_2G_DURING_VOICE_CALL);
+            break;
+        }
+        default:
+        {
+            CMPXVideoBasePlaybackView::HandlePluginErrorL( aError );
+            break;
+        }
+    }
+}
+
+// -----------------------------------------------------------------------------
+//   CMPXVideoPlaybackView::HandlePdlStateChangeL
+// -----------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackView::HandlePdlStateChangeL( TInt /*aState*/ )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackView::HandlePdlStateChangeL()"));
+}
+
+// -----------------------------------------------------------------------------
+//   CMPXVideoPlaybackView::HandleStoppedStateL
+// -----------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackView::HandleStoppedStateL()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackView::HandleStoppedStateL()"));
+
+    if ( ! iPlaylistView || ( ! IsAppInFrontL() && ! iFileDetails->iPausableStream ) )
+    {
+        HandleCommandL( EAknSoftkeyBack );
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoPlaybackView::HandleInitializingStateL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackView::HandleInitializingStateL( TMPXPlaybackState aLastState )
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackView::HandleInitializingStateL()"),
+                   _L("aLastState = %d"), aLastState );
+
+    DoHandleInitializingStateL( aLastState );
+}
+
+// EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviews/src/mpxvideoplaybackviewfiledetails.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,190 @@
+/*
+* 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:  class for MPX Video File Details
+*
+*/
+
+// Version : %version: 12 %
+
+
+//
+//  INCLUDE FILES
+//
+#include <f32file.h>
+#include <uri16.h>
+
+#include "mpxvideo_debug.h"
+#include "mpxvideoplaybackviewfiledetails.h"
+
+// ============================ MEMBER FUNCTIONS ===================================================
+
+CMPXVideoPlaybackViewFileDetails*
+CMPXVideoPlaybackViewFileDetails::NewL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackViewFileDetails::NewL()"));
+
+    CMPXVideoPlaybackViewFileDetails* p = new (ELeave) CMPXVideoPlaybackViewFileDetails();
+    CleanupStack::PushL(p);
+    p->ConstructL();
+    CleanupStack::Pop(p);
+    return p;
+}
+
+CMPXVideoPlaybackViewFileDetails::~CMPXVideoPlaybackViewFileDetails()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackViewFileDetails::~CMPXVideoPlaybackViewFileDetails()"));
+
+    ClearFileDetails();
+}
+
+void
+CMPXVideoPlaybackViewFileDetails::ConstructL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackViewFileDetails::ConstructL()"));
+    iSeekable = ETrue;
+}
+
+void
+CMPXVideoPlaybackViewFileDetails::ClearFileDetails()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackViewFileDetails::ClearFileDetails()"));
+
+    if ( iMimeType )
+    {
+        delete iMimeType;
+        iMimeType = NULL;
+    }
+
+    if ( iTitle )
+    {
+        delete iTitle;
+        iTitle = NULL;
+    }
+
+    if ( iArtist )
+    {
+        delete iArtist;
+        iArtist = NULL;
+    }
+
+    if ( iClipName )
+    {
+        delete iClipName;
+        iClipName = NULL;
+    }
+
+    iPlaybackMode = EMPXVideoLocal;
+    iSeekable = ETrue;
+    iAudioEnabled = EFalse;
+    iVideoEnabled = EFalse;
+    iPartialPlayback = EFalse;
+
+    iDuration = 0;
+    iTvOutConnected   = EFalse;
+    iDrmProtected = EFalse;
+
+    iVideoHeight = 0;
+    iVideoWidth  = 0;
+    iBitRate = 0;
+    iFourCCCode = 0;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackViewFileDetails::GenerateFileNameL
+// -------------------------------------------------------------------------------------------------
+//
+EXPORT_C HBufC* CMPXVideoPlaybackViewFileDetails::GenerateFileNameL()
+{
+    MPX_ENTER_EXIT( _L( "CMPXVideoPlaybackViewFileDetails::GenerateFileNameL()" ) );
+
+    HBufC* fileName = NULL;
+
+    if ( iClipName &&
+         iClipName->Length() &&
+         EMPXVideoStreaming != iPlaybackMode &&
+         EMPXVideoLiveStreaming != iPlaybackMode )
+    {
+        //
+        //  Get only file name for media details viewer
+        //
+        TParse parse;
+        parse.Set( iClipName->Des(), NULL, NULL );
+        fileName = ( parse.Name() ).AllocL();
+    }
+
+    return fileName;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackViewFileDetails::GenerateFileTitleL
+// -------------------------------------------------------------------------------------------------
+//
+EXPORT_C HBufC* CMPXVideoPlaybackViewFileDetails::GenerateFileTitleL()
+{
+    MPX_ENTER_EXIT( _L( "CMPXVideoPlaybackViewFileDetails::GenerateFileTitleL()" ) );
+
+    HBufC* fileTitle = NULL;
+
+    if ( iTitle && iTitle->Length() )
+    {
+        //
+        // use file title in metadata as title cotent directly
+        //
+        fileTitle = iTitle->AllocL();
+    }
+    else if ( ( EMPXVideoStreaming == iPlaybackMode || EMPXVideoLiveStreaming == iPlaybackMode ) &&
+              iClipName && iClipName->Length() )
+    {
+        //
+        //  parse file name in URL
+        //
+        TUriParser parser;
+
+        if ( parser.Parse( iClipName->Des() ) == KErrNone )
+        {
+
+            MPX_DEBUG(
+                _L( "    streaming link: schema = %S, urihost = %S, uriPort = %S, uriPath = %S" ),
+                &( parser.Extract( EUriScheme ) ),
+                &( parser.Extract( EUriHost ) ),
+                &( parser.Extract( EUriPort ) ),
+                &( parser.Extract( EUriPath ) ) );
+
+            HBufC* nameAndTail = NULL;
+
+            MPX_TRAPD( err, nameAndTail = parser.GetFileNameL( EUriFileNameTail ) );
+
+            if ( KErrNone == err && nameAndTail )
+            {
+                CleanupStack::PushL( nameAndTail );
+                TInt extPos = nameAndTail->Des().LocateReverse( KExtDelimiter );
+
+                if ( extPos > 0 )
+                {
+                    fileTitle = ( nameAndTail->Des().Left( extPos ) ).AllocL();
+                }
+                else
+                {
+                    fileTitle = nameAndTail->Des().AllocL();
+                }
+
+                CleanupStack::PopAndDestroy( nameAndTail );
+            }
+        }
+    }
+
+    return fileTitle;
+}
+
+//  EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviews/tsrc/ut_userinputhandlertest/bwins/ui_userinputhandlertestu.def	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,6 @@
+EXPORTS
+	?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * LibEntryL(class CTestModuleIf &)
+	??1CMPXVideoPlaybackUserInputHandler@@UAE@XZ @ 2 NONAME ; CMPXVideoPlaybackUserInputHandler::~CMPXVideoPlaybackUserInputHandler(void)
+	?NewL@CMPXVideoPlaybackUserInputHandler@@SAPAV1@PAVCMPXVideoPlaybackContainer@@@Z @ 3 NONAME ; class CMPXVideoPlaybackUserInputHandler * CMPXVideoPlaybackUserInputHandler::NewL(class CMPXVideoPlaybackContainer *)
+	?ProcessPointerEventL@CMPXVideoPlaybackUserInputHandler@@QAEXPAVCCoeControl@@ABUTPointerEvent@@W4TMPXVideoControlType@@@Z @ 4 NONAME ; void CMPXVideoPlaybackUserInputHandler::ProcessPointerEventL(class CCoeControl *, struct TPointerEvent const &, enum TMPXVideoControlType)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviews/tsrc/ut_userinputhandlertest/conf/ui_userinputhandlertest.cfg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,2398 @@
+[Define]
+EMPXPbvCmdPlay 8192
+EMPXPbvCmdPause 8193
+EMPXPbvCmdPlayPause 8194
+EMPXPbvCmdStop 8195
+EMPXPbvCmdSeekForward 8205
+EMPXPbvCmdSeekBackward 8206
+EMPXPbvCmdEndSeek 8207
+EMPXPbvCmdDecreaseVolume 8210
+EMPXPbvCmdIncreaseVolume 8211
+EMPCmdNone 9000
+EMPXControlCmdSoftKeyPressed 18
+
+EAknSoftkeyBack 3001
+
+
+
+[Enddefine]
+
+
+/////////////////////////////////////////////////////////
+//
+// Media Key 'Stop'
+//	- handle if it's a 'Clicked' event
+//	- ignore if it's a 'Pressed' event
+//
+/////////////////////////////////////////////////////////
+
+[Test]
+title A1. Click media key 'Stop'
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=69 buttonaction=2
+pause 100
+UserInputHandlerTest CheckExpectedCommand EAknSoftkeyBack
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title A2. Press media key 'Stop'
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=69 buttonaction=0
+pause 1000
+UserInputHandlerTest CheckExpectedCommand EMPCmdNone
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title A3. Press & release media key 'Stop'
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=69 buttonaction=0
+pause 1000
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=69 buttonaction=1
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPCmdNone
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title A4. Click & release media key 'Stop'
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=69 buttonaction=2
+pause 1000
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=69 buttonaction=1
+pause 100
+UserInputHandlerTest CheckExpectedCommand EAknSoftkeyBack
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title A5. Click media key 'Stop' while key event 'Seek Backward' is in progress
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=14 code=2 controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=69 buttonaction=2
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventKeyDown scancode=14
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdSeekBackward
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title A6. Click media key 'Stop' after key event 'Seek Backward' is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=14 code=1
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyUp scancode=14 code=1
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=69 buttonaction=2
+pause 100
+UserInputHandlerTest CheckExpectedCommand EAknSoftkeyBack
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title A7. Click media key 'Stop' while container pointer event is in progress
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=69 buttonaction=2
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer ptrtype=EButton1Down
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPCmdNone
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title A8. Click media key 'Stop' after container pointer event is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Up controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=69 buttonaction=2
+pause 100
+UserInputHandlerTest CheckExpectedCommand EAknSoftkeyBack
+delete UserInputHandlerTest
+[Endtest]
+
+
+/////////////////////////////////////////////////////////
+//
+// Media Key 'Rewind'
+//	- handle if it's a 'Pressed' event
+//	- ignore if it's a 'Clicked' event
+//
+/////////////////////////////////////////////////////////
+
+[Test]
+title B1. Click media key 'Rewind'
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=72 buttonaction=2
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPCmdNone
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title B2. Press media key 'Rewind'
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=72 buttonaction=0
+pause 1000
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdSeekBackward
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title B3. Press & release media key 'Rewind'
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=72 buttonaction=0
+pause 1000
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=72 buttonaction=1
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdEndSeek
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title B4. Click & release media key 'Rewind'
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=72 buttonaction=2
+pause 1000
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=72 buttonaction=1
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPCmdNone
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title B5. Press media key 'Rewind' while key event 'Seek Forward' is in progress
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=15 code=3
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=72 buttonaction=0
+pause 1000
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventKeyDown scancode=15
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdSeekForward
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title B6. Press media key 'Rewind' after key event 'Seek Forward' is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=15 code=2
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyUp scancode=15 code=2
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=72 buttonaction=0
+pause 1000
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdSeekBackward
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title B7. Press media key 'Rewind' while container pointer event is in progress
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=72 buttonaction=0
+pause 1000
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer ptrtype=EButton1Down
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPCmdNone
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title B8. Press media key 'Rewind' after container pointer event is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Up controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=72 buttonaction=0
+pause 1000
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdSeekBackward
+delete UserInputHandlerTest
+[Endtest]
+
+
+/////////////////////////////////////////////////////////
+//
+// Media Key 'Fast Forward'
+//	- handle if it's a 'Pressed' event
+//	- ignore if it's a 'Clicked' event
+//
+/////////////////////////////////////////////////////////
+
+[Test]
+title C1. Click media key 'Fast Forward'
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=73 buttonaction=2
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPCmdNone
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title C2. Press media key 'Fast Forward'
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=73 buttonaction=0
+pause 1000
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdSeekForward
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title C3. Press & release media key 'Fast Forward'
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=73 buttonaction=0
+pause 1000
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=73 buttonaction=1
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdEndSeek
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title C4. Click & release media key 'Fast Forward'
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=73 buttonaction=2
+pause 1000
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=73 buttonaction=1
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPCmdNone
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title C5. Press media key 'Fast Forward' while key event 'Seek Backward' is in progress
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=14 code=4
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=73 buttonaction=0
+pause 1000
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventKeyDown scancode=14
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdSeekBackward
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title C6. Press media key 'Fast Forward' after key event 'Seek Backward' is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=14 code=3
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyUp scancode=14 code=3
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=73 buttonaction=0
+pause 1000
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdSeekForward
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title C7. Press media key 'Fast Forward' while container pointer event is in progress
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=73 buttonaction=0
+pause 1000
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer ptrtype=EButton1Down
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPCmdNone
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title C8. Press media key 'Fast Forward' after container pointer event is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Up controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=73 buttonaction=0
+pause 1000
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdSeekForward
+delete UserInputHandlerTest
+[Endtest]
+
+////////////////////////////////////////////////////////////////////////////
+//
+// Media Key 'Volume Up'
+//	- handle both 'Pressed' and 'Clicked' events
+//
+////////////////////////////////////////////////////////////////////////////
+
+[Test]
+title D1. Click media key 'Volume Up'
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=65 buttonaction=2
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdIncreaseVolume
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title D2. Press media key 'Volume Up'
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=65 buttonaction=0
+pause 1000
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdIncreaseVolume
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title D3. Press & release media key 'Volume Up'
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=65 buttonaction=0
+pause 1000
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=65 buttonaction=1
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdIncreaseVolume
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title D4. Click & release media key 'Volume Up'
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=65 buttonaction=2
+pause 1000
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=65 buttonaction=1
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdIncreaseVolume
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title D5. Press media key 'Volume Up' while key event 'Seek Backward' is in progress
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=14 code=5
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=65 buttonaction=0
+pause 1000
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventKeyDown scancode=14
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdSeekBackward
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title D6. Press media key 'Volume Up' after key event 'Seek Backward' is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=14 code=4
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyUp scancode=14 code=4
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=65 buttonaction=0
+pause 1000
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdIncreaseVolume
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title D7. Press media key 'Volume Up' while container pointer event is in progress
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=65 buttonaction=0
+pause 1000
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer ptrtype=EButton1Down
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPCmdNone
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title D8. Press media key 'Volume Up' after container pointer event is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Up controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=65 buttonaction=0
+pause 1000
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdIncreaseVolume
+delete UserInputHandlerTest
+[Endtest]
+
+
+////////////////////////////////////////////////////////////////////////////
+//
+// Media Key 'Volume Down'
+//	- handle both 'Pressed' and 'Clicked' events
+//
+////////////////////////////////////////////////////////////////////////////
+
+[Test]
+title E1. Click media key 'Volume Down'
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=66 buttonaction=2
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdDecreaseVolume
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title E2. Press media key 'Volume Down'
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=66 buttonaction=0
+pause 1000
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdDecreaseVolume
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title E3. Press & release media key 'Volume Down'
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=66 buttonaction=0
+pause 1000
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=66 buttonaction=1
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdDecreaseVolume
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title E4. Click & release media key 'Volume Down'
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=66 buttonaction=2
+pause 1000
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=66 buttonaction=1
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdDecreaseVolume
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title E5. Press media key 'Volume Down' while key event 'Seek Forward' is in progress
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=15 code=6
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=66 buttonaction=0
+pause 1000
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventKeyDown scancode=15
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdSeekForward
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title E6. Press media key 'Volume Down' after key event 'Seek Forward' is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=15 code=5
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyUp scancode=15 code=5
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=66 buttonaction=0
+pause 1000
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdDecreaseVolume
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title E7. Press media key 'Volume Down' while container pointer event is in progress
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=66 buttonaction=0
+pause 1000
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer ptrtype=EButton1Down
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPCmdNone
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title E8. Press media key 'Volume Down' after container pointer event is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Up controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=66 buttonaction=0
+pause 1000
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdDecreaseVolume
+delete UserInputHandlerTest
+[Endtest]
+
+
+/////////////////////////////////////////////////////////
+//
+// Media Key 'PausePlay'
+//	- handle if it's a 'Clicked' event
+//	- ignore if it's a 'Pressed' event
+//
+/////////////////////////////////////////////////////////
+
+
+[Test]
+title F1. Click media key 'PausePlay'
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=97 buttonaction=2
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdPlayPause
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title F2. Press media key 'PausePlay'
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=97 buttonaction=0
+pause 1000
+UserInputHandlerTest CheckExpectedCommand EMPCmdNone
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title F3. Press & release media key 'PausePlay'
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=97 buttonaction=0
+pause 1000
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=97 buttonaction=1
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPCmdNone
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title F4. Click & release media key 'PausePlay'
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=97 buttonaction=2
+pause 1000
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=97 buttonaction=1
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdPlayPause
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title F5. Click media key 'PausePlay' while key event 'Volume Down' is in progress
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=17 code=7
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=97 buttonaction=2
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventKeyDown scancode=17
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdDecreaseVolume
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title F6. Click media key 'PausePlay' after key event 'Volume Down' is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=17 code=6
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyUp scancode=17 code=6
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=97 buttonaction=2
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdPlayPause
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title F7. Click media key 'PausePlay' while container pointer event is in progress
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=97 buttonaction=2
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer ptrtype=EButton1Down
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPCmdNone
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title F8. Click media key 'PausePlay' after container pointer event is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Up controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=97 buttonaction=2
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdPlayPause
+delete UserInputHandlerTest
+[Endtest]
+
+
+////////////////////////////////////////////////////////////////////////////
+//
+// Media Key 'Pause'
+//	- handle both 'Pressed' and 'Clicked' events
+//
+////////////////////////////////////////////////////////////////////////////
+
+
+[Test]
+title G1. Click media key 'Pause'
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=70 buttonaction=2
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdPause
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title G2. Press media key 'Pause'
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=70 buttonaction=0
+pause 1000
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdPause
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title G3. Press & release media key 'Pause'
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=70 buttonaction=0
+pause 1000
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=70 buttonaction=1
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdPause
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title G4. Click & release media key 'Pause'
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=70 buttonaction=2
+pause 1000
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=70 buttonaction=1
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdPause
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title G5. Click media key 'Pause' while key event 'Volume Up' is in progress
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=16 code=8
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=70 buttonaction=2
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdIncreaseVolume
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title G6. Click media key 'Pause' after key event 'Volume Up' is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=16 code=7
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyUp scancode=16 code=7
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=70 buttonaction=2
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdPause
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title G7. Click media key 'Pause' while container pointer event is in progress
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=70 buttonaction=2
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer ptrtype=EButton1Down
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPCmdNone
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title G8. Click media key 'Pause' after container pointer event is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Up controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=70 buttonaction=2
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdPause
+delete UserInputHandlerTest
+[Endtest]
+
+
+/////////////////////////////////////////////////////////
+//
+// Media Key 'Play'
+//	- handle it if it's a 'Clicked' event
+//	- ignore it if it's a 'Pressed' events
+//
+/////////////////////////////////////////////////////////
+
+[Test]
+title H1. Click media key 'Play'
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoPlay buttonaction=2
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdPlay
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title H2. Press media key 'Play'
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoPlay buttonaction=0
+pause 1000
+UserInputHandlerTest CheckExpectedCommand EMPCmdNone
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title H3. Press & release media key 'Play'
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoPlay buttonaction=0
+pause 1000
+UserInputHandlerTest MediaKeyEvent command=MrccatoPlay buttonaction=1
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPCmdNone
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title H4. Click & release media key 'Play'
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoPlay buttonaction=2
+pause 1000
+UserInputHandlerTest MediaKeyEvent command=MrccatoPlay buttonaction=1
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdPlay
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title H5. Click media key 'Play' while key event 'Volume Down' is in progress
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=17 code=9
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoPlay buttonaction=2
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventKeyDown scancode=17
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdDecreaseVolume
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title H6. Click media key 'Play' after key event 'Volume Down' is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=17 code=8
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyUp scancode=17 code=8
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoPlay buttonaction=2
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdPlay
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title H7. Click media key 'Play' while pointer event is in progress
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoPlay buttonaction=2
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer ptrtype=EButton1Down
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPCmdNone
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title H8. Click media key 'Play' after pointer event is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Up controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoPlay buttonaction=2
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdPlay
+delete UserInputHandlerTest
+[Endtest]
+
+
+///////////////////////////////////////////////////////////////////
+//
+// Foreground
+//	- block all inputs while in background
+//
+///////////////////////////////////////////////////////////////////
+
+
+[Test]
+title I1. Container pointer (ButtonDown) input while UI in background
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest SetForeground foreground=0
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer ptrtype=EPtrEventNull
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title I2. Container Pointer (Drag) input while UI in background
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest SetForeground foreground=0
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EDrag controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer ptrtype=EPtrEventNull
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title I3. Control Pointer (ButtonDown) input while UI in background
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest SetForeground foreground=0
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackControl
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackControl ptrtype=EPtrEventNull
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title I4. Control Pointer (Drag) input while UI in background
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest SetForeground foreground=0
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EDrag controltype=EMpxVideoPlaybackControl
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackControl ptrtype=EPtrEventNull
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title I5. Media key 'Stop' while UI in background
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest SetForeground foreground=0
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=69 buttonaction=2
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPCmdNone
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title I6. Media key 'Rewind' while UI in background
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest SetForeground foreground=0
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=72 buttonaction=0
+pause 1000
+UserInputHandlerTest CheckExpectedCommand EMPCmdNone
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title I7. Media key 'Fast Forward' while UI in background
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest SetForeground foreground=0
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=73 buttonaction=0
+pause 1000
+UserInputHandlerTest CheckExpectedCommand EMPCmdNone
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title I8. Media key 'Volume Up' while UI in background
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest SetForeground foreground=0
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=65 buttonaction=0
+pause 1000
+UserInputHandlerTest CheckExpectedCommand EMPCmdNone
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title I9. Media key 'Volume Down' while UI in background
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest SetForeground foreground=0
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=66 buttonaction=0
+pause 1000
+UserInputHandlerTest CheckExpectedCommand EMPCmdNone
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title I10. Media key 'PausePlay' while UI in background
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest SetForeground foreground=0
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=97 buttonaction=2
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPCmdNone
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title I10. Media key 'Pause' while UI in background
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest SetForeground foreground=0
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=70 buttonaction=2
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPCmdNone
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title I11. Media key 'Play' while UI in background
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest SetForeground foreground=0
+pause 100
+UserInputHandlerTest MediaKeyEvent command=MrccatoCommand operationid=68 buttonaction=2
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPCmdNone
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title I12. Key event 'PlayPause' input while UI in background
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest SetForeground foreground=0
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=167 code=0
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPCmdNone
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title I13. Key event 'Enter Key' input while UI in background
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest SetForeground foreground=0
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=3 code=0
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPCmdNone
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title I14. Key event 'Volume Up' input while UI in background
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest SetForeground foreground=0
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=16 code=10
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPCmdNone
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title I15. Key event 'Volume Down' input while UI in background
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest SetForeground foreground=0
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=17 code=11
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPCmdNone
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title I16. Key event 'Seek Backward' input while UI in background
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest SetForeground foreground=0
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=14 code=12
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPCmdNone
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title I17. Key event 'Seek Forward' input while UI in background
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest SetForeground foreground=0
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=15 code=13
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPCmdNone
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title I18. Key event 'Green/Send Key' input while UI in background
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest SetForeground foreground=0
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=196 code=16
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPCmdNone
+delete UserInputHandlerTest
+[Endtest]
+
+
+///////////////////////////////////////////////////////////////////
+//
+// Key Inputs
+//
+///////////////////////////////////////////////////////////////////
+
+[Test]
+title J1. Key event 'Rocker Middle Key' input - valid iCode
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=167 code=0
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdPlayPause
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title J2. Key event 'Rocker Middle Key' input - invalid iCode
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=167 code=13
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPCmdNone
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title J3. Key event 'Enter Key' input 
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=3 code=0
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdPlayPause
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title J4. Key event 'Enter Key' input - invalid iCode
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=3 code=127
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPCmdNone
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title J5. Key event 'Volume Up' input
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=16 code=17
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdIncreaseVolume
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title J6. Key event 'Volume Down' input
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=17
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdDecreaseVolume
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title J7. Key event 'Seek Backward' input
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=14
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdSeekBackward
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title J8. Key event 'Seek Backward & Release' input
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=14 code=9
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyUp scancode=14 code=9
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdEndSeek
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title J9. Key event 'Seek Forward' input
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=15 code=18
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdSeekForward
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title J10. Key event 'Seek Forward & Release' input
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=15 code=10
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyUp scancode=15 code=10
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdEndSeek
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title J11. Key event 'Green/Send Key' input
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=196 code=19
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPCmdNone
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title J12. Key event 'Enter Key' input  - invalid type
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyUp scancode=3 code=0
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPCmdNone
+[Endtest]
+
+[Test]
+title J13. Key event 'EStdKeyDevice0'  - valid type
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=164 code=25
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXControlCmdSoftKeyPressed
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title J14. Key event 'EStdKeyDevice0'  - invalid type
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyUp scancode=164 code=25
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPCmdNone
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title J15. Key event 'EStdKeyDevice1'  - valid type
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=165 code=26
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXControlCmdSoftKeyPressed
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title J16. Key event 'EStdKeyDevice1'  - invalid type
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyUp scancode=165 code=26
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPCmdNone
+delete UserInputHandlerTest
+[Endtest]
+
+///////////////////////////////////////////////////////////////////
+//
+// Pointer Inputs
+//
+///////////////////////////////////////////////////////////////////
+
+[Test]
+title K1. Container Pointer Down input
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer ptrtype=EButton1Down 
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title K2. Container Pointer Down & Up input
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Up controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer ptrtype=EButton1Up 
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title K3. Container Pointer Drag input
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EDrag controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer ptrtype=EPtrEventNull 
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title K4. Container Pointer Drag & Up input
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EDrag controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Up controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer ptrtype=EPtrEventNull 
+delete UserInputHandlerTest
+[Endtest]
+
+///////////////////////////////////////////////////////////////////
+//
+// Handling of multiple inputs simultaneously
+//
+///////////////////////////////////////////////////////////////////
+
+[Test]
+title L1. Key input (Enter Key) while container pointer event is in progress
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=3 code=0
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer ptrtype=EButton1Down 
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventNull scancode=0
+pause 100
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L2. Key input (Enter Key) after container pointer event is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Up controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=3 code=0
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventKeyDown scancode=3
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdPlayPause
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L3. Key input (Rocker Middle Key) while container pointer event is in progress
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=167 code=0
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer ptrtype=EButton1Down 
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventNull scancode=0
+pause 100
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L4. Key input (Rocker Middle Key) after container pointer event is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Up controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=167 code=0
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventKeyDown scancode=167
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdPlayPause
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L5. Key input (Volume Up) while container pointer event is in progress
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=16 code=20
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer ptrtype=EButton1Down 
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventNull scancode=0
+pause 100
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L6. Key input (Volume Up) after container pointer event is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Up controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=16 code=21
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventKeyDown scancode=16
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdIncreaseVolume
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L7. Key input (Volume Down) while container pointer event is in progress
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=17 code=22
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer ptrtype=EButton1Down 
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventNull scancode=0
+pause 100
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L8. Key input (Volume Down) after container pointer event is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Up controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=17 code=23
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventKeyDown scancode=17
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdDecreaseVolume
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L9. Key input (Seek Backward) while container pointer event is in progress
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=14 code=24
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer ptrtype=EButton1Down 
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventNull scancode=0
+pause 100
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L10. Key input (Seek Backward) after container pointer event is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Up controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=14 code=25
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventKeyDown scancode=14
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdSeekBackward
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L11. Key input (Seek Backward) after container pointer event is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Up controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=14 code=11
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyUp scancode=14 code=11
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventKeyUp scancode=14
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdEndSeek
+delete UserInputHandlerTest
+[Endtest]
+
+
+[Test]
+title L12. Key input (Seek Forward) while container pointer event is in progress
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=15 code=26
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer ptrtype=EButton1Down 
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventNull scancode=0
+pause 100
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L13. Key input (Seek Forward) after container pointer event is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Up controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=15 code=27
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventKeyDown scancode=15
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdSeekForward
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L14. Key input (Seek Forward) after container pointer event is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Up controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=15 code=12
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyUp scancode=15 code=12
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventKeyUp scancode=15
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdEndSeek
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L15. Key input (Enter Key) while container pointer event is in progress
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=196 code=28
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer ptrtype=EButton1Down 
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventNull scancode=0
+pause 100
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L16. Key input (Green/Send Key) after container pointer event is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Up controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=196 code=13
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyUp scancode=196 code=13
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventKeyUp scancode=196
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPCmdNone
+delete UserInputHandlerTest
+[Endtest]
+
+
+[Test]
+title L17. Key input (Enter Key) while control pointer event is in progress
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackControl
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=3 code=0
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackControl ptrtype=EButton1Down 
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventNull scancode=0
+pause 100
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L18. Key input (Enter Key) after control pointer event is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackControl
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Up controltype=EMpxVideoPlaybackControl
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=3 code=0
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventKeyDown scancode=3
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdPlayPause
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L19. Key input (Rocker Middle Key) while control pointer event is in progress
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackControl
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=167 code=0
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackControl ptrtype=EButton1Down 
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventNull scancode=0
+pause 100
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L20. Key input (Rocker Middle Key) after control pointer event is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackControl
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Up controltype=EMpxVideoPlaybackControl
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=167 code=0
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventKeyDown scancode=167
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdPlayPause
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L21. Key input (Volume Up) while control pointer event is in progress
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackControl
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=16 code=1
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackControl ptrtype=EButton1Down 
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventNull scancode=0
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPCmdNone
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L22. Key input (Volume Up) after control pointer event is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackControl
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Up controltype=EMpxVideoPlaybackControl
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=16
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventKeyDown scancode=16
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdIncreaseVolume
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L23. Key input (Volume Down) while control pointer event is in progress
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackControl
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=17 code=2
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackControl ptrtype=EButton1Down 
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventNull scancode=0
+pause 100
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L24. Key input (Volume Down) after control pointer event is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackControl
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Up controltype=EMpxVideoPlaybackControl
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=17 code=3
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventKeyDown scancode=17
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdDecreaseVolume
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L25. Key input (Seek Backward) while control pointer event is in progress
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackControl
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=14 code=4
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackControl ptrtype=EButton1Down 
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventNull scancode=0
+pause 100
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L26. Key input (Seek Backward) after control pointer event is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackControl
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Up controltype=EMpxVideoPlaybackControl
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=14 code=5
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventKeyDown scancode=14
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdSeekBackward
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L27. Key input (Seek Backward) after control pointer event is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackControl
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Up controltype=EMpxVideoPlaybackControl
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=14 code=14
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyUp scancode=14 code=14
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventKeyUp scancode=14
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdEndSeek
+delete UserInputHandlerTest
+[Endtest]
+
+
+[Test]
+title L28. Key input (Seek Forward) while control pointer event is in progress
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackControl
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=15 code=6
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackControl ptrtype=EButton1Down 
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventNull scancode=0
+pause 100
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L29. Key input (Seek Forward) after control pointer event is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackControl
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Up controltype=EMpxVideoPlaybackControl
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=15 code=7
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventKeyDown scancode=15
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdSeekForward
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L30. Key input (Seek Forward) after control pointer event is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackControl
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Up controltype=EMpxVideoPlaybackControl
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=15 code=15
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyUp scancode=15 code=15
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventKeyUp scancode=15
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdEndSeek
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L31. Key input (Enter Key) while control pointer event is in progress
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackControl
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=196 code=8
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackControl ptrtype=EButton1Down 
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventNull scancode=0
+pause 100
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L32. Key input (Green/Send Key) after control pointer event is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackControl
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Up controltype=EMpxVideoPlaybackControl
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=196 code=16
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyUp scancode=196 code=16
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventKeyUp scancode=196
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPCmdNone
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L33. Container pointer input while key event (Enter Key) is being processed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=3 code=0
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventKeyDown scancode=3
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer ptrtype=EPtrEventNull
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdPlayPause
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L34. Container pointer input after key event (Enter Key) is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=3 code=0
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyUp scancode=3 code=0
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer ptrtype=EButton1Down
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L35. Container pointer input while key event (Rocker Middle Key) is being processed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=167 code=0
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventKeyDown scancode=167
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer ptrtype=EPtrEventNull
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdPlayPause
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L36. Container pointer input after key event (Rocker Middle Key) is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=167 code=0
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyUp scancode=167 code=0
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer ptrtype=EButton1Down
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L37. Container pointer input while key event (Volume Up) is being processed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=16 code=9
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventKeyDown scancode=16
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer ptrtype=EPtrEventNull
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdIncreaseVolume
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L38. Container pointer input after key event (Volume Up) is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=16 code=17
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyUp scancode=16 code=17
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer ptrtype=EButton1Down
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L39. Container pointer input while key event (Volume Down) is being processed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=17 code=10
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventKeyDown scancode=17
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer ptrtype=EPtrEventNull
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdDecreaseVolume
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L40. Container pointer input after key event (Volume Down) is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=17 code=18
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyUp scancode=17 code=18
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer ptrtype=EButton1Down
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L41. Container pointer input while key event (Seek Backward) is being processed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=14 code=11
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventKeyDown scancode=14
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer ptrtype=EPtrEventNull
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdSeekBackward
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L42. Container pointer input after key event (Seek Backward) is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=14 code=19
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyUp scancode=14 code=19
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer ptrtype=EButton1Down
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L43. Container pointer input while key event (Seek Forward) is being processed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=15 code=12
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventKeyDown scancode=15
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer ptrtype=EPtrEventNull
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdSeekForward
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L44. Container pointer input after key event (Seek Forward) is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=15 code=20
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyUp scancode=15 code=20
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer ptrtype=EButton1Down
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L45. Container pointer input while key event (Green/Send Key) is being processed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=196 code=13
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventKeyDown scancode=196
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer ptrtype=EPtrEventNull
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPCmdNone
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L46. Container pointer input after key event (Green/Send Key) is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=196 code=21
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyUp scancode=196 code=21
+pause 100
+UserInputHandlerTest PointerEvent ptrtype=EButton1Down controltype=EMpxVideoPlaybackContainer
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer ptrtype=EButton1Down
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L47. Key input (Hash Key) while key event (Volume Up) is being processed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=16 code=14
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=127 code=15
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventKeyDown scancode=16
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdIncreaseVolume
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L48. Key input (Rocker Middle Key) while key event (Volume Up) is being processed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=16 code=16
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=167 code=0
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventKeyDown scancode=16
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdIncreaseVolume
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L49. Key input (Rocker Middle Key) after key event (Volume Up) is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=16 code=22
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyUp scancode=16 code=22
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=167 code=0
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventKeyDown scancode=167
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdPlayPause
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L50. Key input (Seek Backward) while key event (Volume Down) is being processed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=17 code=18
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=14 code=19
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventKeyDown scancode=17
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdDecreaseVolume
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L51. Key input (Seek Backward) after key event (Volume Down) is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=17 code=23
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyUp scancode=17 code=23
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=14 code=24
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventKeyDown scancode=14
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdSeekBackward
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L52. Key input (Volume Down) while key event (Seek Forward) is being processed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=15 code=25
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=17 code=23
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventKeyDown scancode=15
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdSeekForward
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L53. Key input (Volume Down) after key event (Seek Forward) is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=15 code=24
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyUp scancode=15 code=24
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=17 code=25
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventKeyDown scancode=17
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdDecreaseVolume
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L54. Key input (EStdKeyDevice0) while key event (Seek Forward) is being processed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=15 code=25
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=164 code=23
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventKeyDown scancode=15
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdSeekForward
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L55. Key input (EStdKeyDevice0) after key event (Seek Forward) is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=15 code=25
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyUp scancode=15 code=25
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=164 code=23
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventKeyDown scancode=164
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXControlCmdSoftKeyPressed
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L56. Key input (EStdKeyDevice1) while key event (Seek Forward) is being processed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=15 code=25
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=165 code=24
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventKeyDown scancode=15
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXPbvCmdSeekForward
+delete UserInputHandlerTest
+[Endtest]
+
+[Test]
+title L57. Key input (EStdKeyDevice1) after key event (Seek Forward) is completed
+create ui_userinputhandlertest UserInputHandlerTest
+UserInputHandlerTest CreateStubsL
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=15 code=25
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyUp scancode=15 code=25
+pause 100
+UserInputHandlerTest KeyEvent keytype=EEventKeyDown scancode=165 code=24
+pause 100
+UserInputHandlerTest CheckExpectedResult controltype=EMpxVideoPlaybackContainer keytype=EEventKeyDown scancode=165
+pause 100
+UserInputHandlerTest CheckExpectedCommand EMPXControlCmdSoftKeyPressed
+delete UserInputHandlerTest
+[Endtest]
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviews/tsrc/ut_userinputhandlertest/eabi/ui_userinputhandlertestu.def	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,12 @@
+EXPORTS
+	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
+	_ZN33CMPXVideoPlaybackUserInputHandler20ProcessPointerEventLEP11CCoeControlRK13TPointerEvent20TMPXVideoControlType @ 2 NONAME
+	_ZTI10CHWRMLight @ 3 NONAME
+	_ZTI24CMPXVideoPlaybackControl @ 4 NONAME
+	_ZTI26CMPXVideoPlaybackContainer @ 5 NONAME
+	_ZTI33CMPXVideoPlaybackUserInputHandler @ 6 NONAME
+	_ZTV10CHWRMLight @ 7 NONAME
+	_ZTV24CMPXVideoPlaybackControl @ 8 NONAME
+	_ZTV26CMPXVideoPlaybackContainer @ 9 NONAME
+	_ZTV33CMPXVideoPlaybackUserInputHandler @ 10 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviews/tsrc/ut_userinputhandlertest/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,37 @@
+/*
+* 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 STIF Video Playback User Input Handler
+*
+*/
+
+// Version : %version: ou1cpsw#2 %
+
+
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_TESTEXPORTS
+../conf/ui_userinputhandlertest.cfg	/epoc32/winscw/c/testframework/ui_userinputhandlertest.cfg
+../init/testframework.ini		/epoc32/winscw/c/testframework/testframework.ini
+
+PRJ_EXPORTS
+
+PRJ_TESTMMPFILES
+userinputhandlertest.mmp
+
+PRJ_MMPFILES
+
+//  End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviews/tsrc/ut_userinputhandlertest/group/userinputhandlertest.mmp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,85 @@
+/*
+* 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 Video Playback User Input Test.
+*
+*/
+
+// Version : %version: ou1cpsw#5 %
+
+
+
+#include <platform_paths.hrh>
+
+EPOCALLOWDLLDATA
+
+TARGET          ui_userinputhandlertest.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E3
+
+CAPABILITY      ALL -TCB
+
+DEFFILE         ui_userinputhandlertest.def
+
+USERINCLUDE     ../inc
+USERINCLUDE     ../../../inc
+USERINCLUDE     ../../../../inc
+USERINCLUDE     ../../../../../inc
+
+SOURCEPATH      ../src
+
+SOURCE          userinputhandlertest.cpp
+SOURCE          userinputhandlertestBlocks.cpp
+SOURCE          videoplaybackcontrol_stub.cpp
+SOURCE          videoplaybackcontainer_stub.cpp
+SOURCE          hal_stub.cpp
+
+SOURCEPATH      ../../../src
+SOURCE		mpxvideoplaybackuserinputhandler.cpp
+
+APP_LAYER_SYSTEMINCLUDE
+
+SYSTEMINCLUDE   /epoc32/include/ecom
+
+LIBRARY         ws32.lib
+LIBRARY         euser.lib
+LIBRARY         cone.lib
+LIBRARY         stiftestinterface.lib
+LIBRARY         stiftestengine.lib
+LIBRARY         avkon.lib
+LIBRARY         eikcoctl.lib
+LIBRARY         eikctl.lib
+LIBRARY         apgrfx.lib
+LIBRARY         aknskins.lib 
+LIBRARY         bafl.lib
+LIBRARY         aknskinsrv.lib
+LIBRARY         eikcore.lib
+LIBRARY         remconinterfacebase.lib
+LIBRARY         remconcoreapi.lib
+LIBRARY         efsrv.lib
+LIBRARY         flogger.lib
+LIBRARY         charconv.lib
+LIBRARY         mpxcommon.lib
+LIBRARY         libstdcpp.lib
+LIBRARY         libc.lib
+LIBRARY         libglib.lib
+LIBRARY         libpthread.lib
+LIBRARY         servicehandler.lib
+LIBRARY         ecom.lib
+LIBRARY         estor.lib
+LIBRARY         centralrepository.lib // for backlight timeout value
+
+LANG            SC
+
+MACRO       	__USERINPUTHANDLERSTIF__
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviews/tsrc/ut_userinputhandlertest/group/userinputhandlertest.pkg	Thu Nov 04 11:16:56 2010 +0200
@@ -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
+#{"UserInputHandler STIF Test Application"}, (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/ui_userinputhandlertest.dll" - "c:/sys/bin/ui_userinputhandlertest.dll"
+
+"../conf/ui_userinputhandlertest.cfg" - "c:/testframework/ui_userinputhandlertest.cfg"
+"../init/testframework.ini" - "c:/testframework/testframework.ini"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviews/tsrc/ut_userinputhandlertest/inc/hal_stub.h	Thu Nov 04 11:16:56 2010 +0200
@@ -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:  Test Harness for Video Playback Views
+ *
+ */
+
+// Version : %version: 3 %
+
+#ifndef __HAL_STUB_H__
+#define __HAL_STUB_H__
+
+#include <e32base.h>
+
+enum TLightStatus
+            {
+            ELightStatusUnknown = 0,
+            ELightOn,              
+            ELightOff,             
+            ELightBlink            
+            };
+
+static TLightStatus  iBacklightState = ELightOn;
+
+/**
+@publishedPartner
+@released
+
+A set of static functions to get and set HAL attributes.
+
+@see CHWRMLight
+*/
+class CHWRMLight : public CBase
+{
+    public:
+
+       enum TLightTarget
+            {
+            ENoTarget                    = 0x0,    
+            EPrimaryDisplay              = 0x1,     
+            ESystemTarget                = 0x80000000  
+		    };
+
+    public:
+
+        static CHWRMLight* NewL();
+
+        void ConstructL(); 
+
+        CHWRMLight();
+
+        ~CHWRMLight();
+
+    public: 
+        void ReserveLightL(TInt aTarget);
+
+        void ReleaseLight(TInt aTarget);
+
+        void LightOnL(TInt aTarget);
+
+   	    void LightOffL(TInt aTarget);
+
+        TLightStatus LightStatus(TInt aTarget) const;
+
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviews/tsrc/ut_userinputhandlertest/inc/userinputhandlertest.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,176 @@
+/*
+* 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: ou1cpsw#4 %
+
+#ifndef USERINPUTHANDLER_TEST_H
+#define USERINPUTHANDLER_TEST_H
+
+//  INCLUDES
+#include <StifLogger.h>
+#include <TestScripterInternal.h>
+#include <StifTestModule.h>
+#include <TestclassAssert.h>
+#include <e32base.h>
+#include <e32def.h>
+#include <StifItemParser.h>
+#include <W32STD.H>
+
+#include "mpxvideoplaybackcontrol.hrh"
+#include "mpxcommonvideoplaybackview.hrh"
+
+
+// CLASS DECLARATION
+class CMPXVideoPlaybackUserInputHandler;
+class CMPXVideoPlaybackContainer; 
+class CMPXVideoPlaybackControl;
+
+// DATA
+
+// CONSTANTS
+
+
+// MACROS
+#define TEST_CLASS_VERSION_MAJOR 0
+#define TEST_CLASS_VERSION_MINOR 0
+#define TEST_CLASS_VERSION_BUILD 0
+
+// Logging path
+_LIT( KUserinputhandlertest_LogPath, "\\logs\\testframework\\userinputhandlertest\\" );
+
+// Log file
+_LIT( KUserinputhandlertest_LogFile, "userinputhandlertest.txt" );
+_LIT( KUserinputhandlertest_LogFileWithTitle, "userinputhandlertest_[%S].txt" );
+
+
+/**
+*  CUserinputhandlertest class for STIF Test Framework TestScripter.
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+NONSHARABLE_CLASS(CUserinputhandlertest) : public CScriptBase
+{
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CUserinputhandlertest* NewL( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CUserinputhandlertest();
+
+    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.
+        */
+        CUserinputhandlertest( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        /**
+        * Frees all resources allocated from test methods.
+        * @since ?Series60_version
+        */
+        void Delete();
+
+        /**
+        * Create stubs
+        */
+        virtual TInt CreateStubsL( CStifItemParser&  aItem );
+
+        /**
+         * Method used to log version of test class
+         */
+        void SendTestClassVersion();
+
+		/**
+		* Issue pointer event
+		* @return Symbian OS error code.
+		*/
+		virtual TInt PointerEvent( CStifItemParser&  aItem );
+    
+		/**
+		* Issue pointer event
+		* @return Symbian OS error code.
+		*/
+		virtual TInt KeyEvent( CStifItemParser&  aItem );    
+
+        /**
+        * Issue media key event
+        * @return Symbian OS error code.
+        */
+		virtual TInt MediaKeyEvent( CStifItemParser&  aItem );
+		
+        /**
+        * Issue foreground/background event
+        * @return Symbian OS error code.
+        */
+		virtual TInt SetForeground( CStifItemParser&  aItem );
+		
+        /**
+        * Parse inputs
+        * @return Symbian OS error code.
+        */
+        TInt ParseInputs( CStifItemParser&  aItem, 
+                          TMPXVideoControlType& aControlType,
+                          TPointerEvent& aEventType, 
+                          TEventCode& aEventCode,
+                          TKeyEvent& aKeyEvent );
+        
+        /**
+        * Check expected result
+        * @return Symbian OS error code.
+        */
+        TInt CheckExpectedResult( CStifItemParser&  aItem );
+        
+        /**
+        * Check expected command
+        * @return Symbian OS error code.
+        */
+        TInt CheckExpectedCommand( CStifItemParser&  aItem );
+ 
+        
+    private:    
+
+        CMPXVideoPlaybackContainer*          iContainer; 
+        CMPXVideoPlaybackControl*            iControl;
+        CMPXVideoPlaybackUserInputHandler*   iUserInputHandler;
+        
+};
+
+#endif      // USERINPUTHANDLER_TEST_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviews/tsrc/ut_userinputhandlertest/inc/videoplaybackcontainer_stub.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,78 @@
+/*
+* 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:  STUB file for STIF Video Playback Views.
+*
+*/
+
+// Version : %version: ou1cpsw#2 %
+
+
+
+
+#ifndef __CVIDEOPLAYBACKCONTAINER_STUB_H__
+#define __CVIDEOPLAYBACKCONTAINER_STUB_H__
+
+
+/**
+ *  Stub Container class.
+ *
+ */
+class CMPXVideoPlaybackContainer: public CBase
+{
+    public:
+
+        /**
+        * Two-phased constructor.
+        */
+        static CMPXVideoPlaybackContainer* NewL();
+
+        /**
+        * Destructor.
+        */
+        virtual ~CMPXVideoPlaybackContainer();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CMPXVideoPlaybackContainer();
+    
+        /**
+        * Symbian 2nd phase constructor.
+        */
+        void ConstructL();
+
+    public:
+
+        void HandleCommandL( TInt aCommand, TInt aValue = 0 );
+        void DoHandleKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
+        void DoHandlePointerEventL( const TPointerEvent& aPointerEvent );
+        
+    private:
+        
+        TKeyEvent       iKeyEvent;
+        TEventCode      iEventCode;
+        TPointerEvent   iPointerEvent;
+        TInt            iCommand;
+        
+    public:     // Friend class
+        
+        friend class CUserinputhandlertest;
+
+};
+
+#endif  // __CVIDEOPLAYBACKCONTAINER_STUB_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviews/tsrc/ut_userinputhandlertest/inc/videoplaybackcontrol_stub.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,105 @@
+/*
+* 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:  STUB file for project STIF Video Playback Controls.
+*
+*/
+
+// Version : %version: ou1cpsw#2 %
+
+
+
+
+#ifndef __CVIDEOPLAYBACKCONTROL_STUB_H__
+#define __CVIDEOPLAYBACKCONTROL_STUB_H__
+
+
+// INCLUDES
+#include <coecntrl.h>
+
+/**
+ *  Control class for video playback
+ *
+ */
+class CMPXVideoPlaybackControl : public CCoeControl
+{
+
+    public: // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CMPXVideoPlaybackControl* NewL();
+
+        /**
+        * Destructor.
+        */
+        virtual ~CMPXVideoPlaybackControl();
+
+    protected:
+
+        /**
+        * C++ default constructor.
+        */
+        CMPXVideoPlaybackControl();
+
+        /**
+        * Symbian 2nd phase constructor.
+        */
+        void ConstructL();
+
+    protected:
+
+        /**
+        * From CCoeControl.
+        * Gets the number of controls contained in a compound control.
+        *
+        * @return The number of component controls contained by this control.
+        */
+        TInt CountComponentControls() const;
+
+        /**
+        * From CCoeControl.
+        * Gets an indexed component of a compound control.
+        *
+        * @param aIndex The index of the control.
+        * @return The component control with an index of aIndex.
+        */
+        CCoeControl* ComponentControl( TInt aIndex ) const;
+        
+        /**
+        * From CCoeControl,Draw.
+        * @param aRect drawable area.
+        */
+        void Draw(const TRect& aRect) const;        
+        
+    public:
+    
+        void DoHandleKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
+        void DoHandlePointerEventL( const TPointerEvent& aPointerEvent );
+        
+    private:
+        
+        TKeyEvent       iKeyEvent;
+        TEventCode      iEventCode;        
+        TPointerEvent   iPointerEvent;
+        
+    public:     // Friend class
+        
+        friend class CUserinputhandlertest;
+        
+};
+
+#endif  // __CVIDEOPLAYBACKCONTROL_STUB_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviews/tsrc/ut_userinputhandlertest/init/testframework.ini	Thu Nov 04 11:16:56 2010 +0200
@@ -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_uihtest
+
+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\ui_userinputhandlertest.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:\LOGS\TestFramework\
+#EmulatorFormat= HTML         # Possible values: TXT or HTML
+#EmulatorOutput= FILE         # Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML         # 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviews/tsrc/ut_userinputhandlertest/src/hal_stub.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,90 @@
+/*
+* 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:  Implementation of HAL stub for STIF
+*
+*/
+
+// Version : %version: 3 %
+
+
+// INCLUDE FILES
+#include <e32std.h>
+
+#include "hal_stub.h"
+#include "mpxvideo_debug.h"
+
+
+// ================= MEMBER FUNCTIONS ==============================================================
+
+// -------------------------------------------------------------------------------------------------
+// CHWRMLight::CHWRMLight()
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -------------------------------------------------------------------------------------------------
+//
+CHWRMLight::CHWRMLight()
+{
+}
+
+CHWRMLight::~CHWRMLight()
+{
+    MPX_DEBUG(_L("CHWRMLight::~CHWRMLight()"));
+}
+
+CHWRMLight* CHWRMLight::NewL()
+{
+    MPX_DEBUG(_L("CHWRMLight::NewL()"));
+
+    CHWRMLight* self = new (ELeave) CHWRMLight();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+}
+
+void CHWRMLight::ConstructL()
+{
+	 MPX_DEBUG(_L("CHWRMLight::ConstructL()"));
+}
+
+void CHWRMLight::ReserveLightL(TInt aTarget)
+{
+	MPX_DEBUG(_L("CHWRMLight::ReserveLightL()"));
+}
+
+void CHWRMLight::ReleaseLight(TInt aTarget)
+{
+	MPX_DEBUG(_L("CHWRMLight::ReleaseLight()"));
+}
+
+void CHWRMLight::LightOnL(TInt aTarget)
+{
+	MPX_DEBUG(_L("CHWRMLight::LightOnL()"));
+	iBacklightState = ELightOn;	
+}
+void CHWRMLight::LightOffL(TInt aTarget)
+{
+	MPX_DEBUG(_L("CHWRMLight::LightOffL()"));
+	iBacklightState = ELightOff;
+}
+
+TLightStatus CHWRMLight::LightStatus(TInt aTarget) const
+{
+	MPX_DEBUG(_L("CHWRMLight::LightStatus()"));
+	return iBacklightState;
+}
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviews/tsrc/ut_userinputhandlertest/src/userinputhandlertest.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,153 @@
+/*
+* 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: ou1cpsw#2 %
+
+
+// INCLUDE FILES
+#include <Stiftestinterface.h>
+#include <ecom.h>
+#include <SettingServerClient.h>
+#include "userinputhandlertest.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CUserinputhandlertest::CUserinputhandlertest
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CUserinputhandlertest::CUserinputhandlertest( CTestModuleIf& aTestModuleIf )
+    : CScriptBase( aTestModuleIf )
+{
+}
+
+// -----------------------------------------------------------------------------
+// CUserinputhandlertest::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CUserinputhandlertest::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(KUserinputhandlertest_LogFileWithTitle, &title);
+    }
+    else
+    {
+        logFileName.Copy(KUserinputhandlertest_LogFile);
+    }
+
+    iLog = CStifLogger::NewL( KUserinputhandlertest_LogPath, 
+                              logFileName,
+                              CStifLogger::ETxt,
+                              CStifLogger::EFile,
+                              EFalse );
+    
+    SendTestClassVersion();
+}
+
+// -----------------------------------------------------------------------------
+// CUserinputhandlertest::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CUserinputhandlertest* CUserinputhandlertest::NewL( CTestModuleIf& aTestModuleIf )
+{
+CUserinputhandlertest* self = new (ELeave) CUserinputhandlertest( aTestModuleIf );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+}
+
+// Destructor
+CUserinputhandlertest::~CUserinputhandlertest()
+{ 
+    // Delete resources allocated from test methods
+    Delete();
+
+    // Delete logger
+    delete iLog; 
+    
+    REComSession::FinalClose();
+}
+
+//-----------------------------------------------------------------------------
+// CUserinputhandlertest::SendTestClassVersion
+// Method used to send version of test class
+//-----------------------------------------------------------------------------
+//
+void CUserinputhandlertest::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("ui_userinputhandlertest.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* ) CUserinputhandlertest::NewL( aTestModuleIf );
+}
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviews/tsrc/ut_userinputhandlertest/src/userinputhandlertestBlocks.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,553 @@
+/*
+* 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: ou1cpsw#7 %
+
+
+// [INCLUDE FILES] - do not remove
+#include <e32svr.h>
+#include <e32std.h>
+#include <w32std.h>
+#include <coeaui.h>
+#include <aknutils.h>
+#include <aknviewappui.h>
+#include <StifParser.h>
+#include <Stiftestinterface.h>
+#include "userinputhandlertest.h"
+#include "videoplaybackcontainer_stub.h"
+#include "videoplaybackcontrol_stub.h"
+#include "mpxvideoplaybackuserinputhandler.h"
+#include "mpxvideo_debug.h"
+#include "hal_stub.h"
+
+//
+// pre-define
+//
+_LIT( KPtrTypeParameter, "ptrtype=" );
+_LIT( KKeyTypeParameter, "keytype=" );
+_LIT( KControlTypeParameter, "controltype=" );
+_LIT( KVideoPlaybackContainer, "EMpxVideoPlaybackContainer" );
+_LIT( KVideoPlaybackControl, "EMpxVideoPlaybackControl" );
+_LIT( KButtonDown, "EButton1Down" );
+_LIT( KButtonUp, "EButton1Up" );
+_LIT( KButtonDrag, "EDrag" );
+_LIT( KPointerEventNull, "EPtrEventNull" );
+_LIT( KKeyScancode, "scancode=" );
+_LIT( KKeyCode, "code=" );
+_LIT( KKeyDown, "EEventKeyDown" );
+_LIT( KKeyUp, "EEventKeyUp" );
+_LIT( KKeyNull, "EEventNull" );
+
+//
+// extension of TPointerEvent::TType in w32std.h
+//
+TInt KPtrEventNull = 20;
+
+//
+// extension of TMPXVideoPlaybackViewCommandIds in
+// mpxcommonvideoplaybackview.hrh
+//
+TInt KCommandNone = 9000;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CUserinputhandlertest::Delete
+// Delete here all resources allocated and opened from test methods.
+// Called from destructor.
+// -----------------------------------------------------------------------------
+//
+void CUserinputhandlertest::Delete()
+{
+    if ( iControl )
+    {
+        delete iControl;
+        iControl = NULL;
+    }
+
+    if ( iUserInputHandler )
+    {
+        delete iUserInputHandler;
+        iUserInputHandler = NULL;
+    }
+
+    if ( iContainer )
+    {
+        delete iContainer;
+        iContainer = NULL;
+    }
+}
+
+// -----------------------------------------------------------------------------
+// CUserinputhandlertest::RunMethodL
+// Run specified method. Contains also table of test mothods and their names.
+// -----------------------------------------------------------------------------
+//
+TInt CUserinputhandlertest::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( "CreateStubsL", CUserinputhandlertest::CreateStubsL ),
+        ENTRY( "PointerEvent", CUserinputhandlertest::PointerEvent ),
+        ENTRY( "KeyEvent", CUserinputhandlertest::KeyEvent ),
+        ENTRY( "MediaKeyEvent", CUserinputhandlertest::MediaKeyEvent ),
+        ENTRY( "SetForeground", CUserinputhandlertest::SetForeground ),
+        ENTRY( "CheckExpectedResult",CUserinputhandlertest::CheckExpectedResult ),
+        ENTRY( "CheckExpectedCommand",CUserinputhandlertest::CheckExpectedCommand ),      
+    };
+
+    const TInt count = sizeof( KFunctions ) / sizeof( TStifFunctionInfo );
+
+    return RunInternalL( KFunctions, count, aItem );
+}
+
+// -----------------------------------------------------------------------------
+//   CUserinputhandlertest::CreateStubs
+// -----------------------------------------------------------------------------
+//
+TInt CUserinputhandlertest::CreateStubsL( CStifItemParser&  aItem )
+{
+
+    //
+    // Stubs
+    //
+    iContainer = CMPXVideoPlaybackContainer::NewL();
+    iControl = CMPXVideoPlaybackControl::NewL();
+
+    //
+    // Class to be unit-tested
+    //
+
+    iUserInputHandler = CMPXVideoPlaybackUserInputHandler::NewL( iContainer );
+
+    return KErrNone;
+}
+
+
+// -------------------------------------------------------------------------------------------------
+// CUserinputhandlertest::PointerEvent
+// -------------------------------------------------------------------------------------------------
+//
+TInt CUserinputhandlertest::PointerEvent( CStifItemParser&  aItem )
+{
+    MPX_DEBUG(_L("CUserinputhandlertest::PointerEvent()"));
+
+    TInt result = KErrNone;
+    TMPXVideoControlType controlType;
+    TPointerEvent eventType;
+    TEventCode eventCode;
+    TKeyEvent keyEvent;
+
+    //
+    // Parse inputs
+    //
+    ParseInputs( aItem, controlType, eventType, eventCode, keyEvent );
+
+    //
+    // send pointer event to UserInputHandler class
+    //
+    iUserInputHandler->ProcessPointerEventL( static_cast<CCoeControl*> (iControl), eventType, controlType );
+
+    return result;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CUserinputhandlertest::KeyEvent
+// -------------------------------------------------------------------------------------------------
+//
+TInt CUserinputhandlertest::KeyEvent( CStifItemParser&  aItem )
+{
+    MPX_DEBUG(_L("CUserinputhandlertest::KeyEvent()"));
+
+    TInt result = KErrNone;
+    TMPXVideoControlType controlType;
+    TPointerEvent eventType;
+    TEventCode eventCode;
+    TKeyEvent keyEvent;
+
+    //
+    // Parse inputs
+    //
+    ParseInputs( aItem, controlType, eventType, eventCode, keyEvent );
+
+    //
+    // send key event to UserInputHandler class
+    //
+    iUserInputHandler->ProcessKeyEventL( keyEvent, eventCode );
+
+    return result;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CUserinputhandlertest::MediaKeyEvent
+// -------------------------------------------------------------------------------------------------
+//
+TInt CUserinputhandlertest::MediaKeyEvent( CStifItemParser&  aItem )
+{
+    MPX_DEBUG(_L("CUserinputhandlertest::MediaKeyEvent()"));
+
+    _LIT( KCommandParameter, "command=" );
+    _LIT( KOperationIdParameter, "operationid=" );
+    _LIT( KButtonActionParameter, "buttonaction=" );
+    _LIT( KMrccatoPlay, "MrccatoPlay" );
+    _LIT( KMrccatoCommand, "MrccatoCommand" );
+
+    TPtrC parameter;
+    TInt value;
+    TBool isMrccatoPlay;
+
+    TRemConCoreApiButtonAction buttonAction;
+    TRemConCoreApiOperationId operationId;
+
+    TInt result = KErrNone;
+
+    while ( aItem.GetNextString( parameter ) == KErrNone )
+    {
+        if ( parameter.Find( KCommandParameter ) == 0 )
+        {
+            //
+            // get command (MrccatoPlay or MrccatoCommand)
+            //
+            TPtrC parameterValue =
+                parameter.Right( parameter.Length() - KCommandParameter().Length() );
+
+            if ( parameterValue.Compare(KMrccatoPlay) == 0 )
+            {
+                isMrccatoPlay = ETrue;
+            }
+            else if ( parameterValue.Compare(KMrccatoCommand) == 0 )
+            {
+                isMrccatoPlay = EFalse;
+            }
+        }
+        else if ( parameter.Find( KOperationIdParameter ) == 0 )
+        {
+            //
+            // get operation id (listed in remconcoreapi.h)
+            //
+            TPtrC parameterValue =
+                parameter.Right( parameter.Length() - KOperationIdParameter().Length() );
+            TLex parameterValueParser( parameterValue );
+            if ( parameterValueParser.Val( value ) == KErrNone )
+            {
+                operationId = static_cast<TRemConCoreApiOperationId> (value);
+            }
+            else
+            {
+                result = KErrArgument;
+            }
+        }
+        else if ( parameter.Find( KButtonActionParameter ) == 0 )
+        {
+            //
+            // get button action (listed in remconcoreapi.h)
+            //
+            TPtrC parameterValue =
+                parameter.Right( parameter.Length() - KButtonActionParameter().Length() );
+            TLex parameterValueParser( parameterValue );
+            if ( parameterValueParser.Val( value ) == KErrNone )
+            {
+                buttonAction = static_cast<TRemConCoreApiButtonAction> (value);
+            }
+            else
+            {
+                result = KErrArgument;
+            }
+        }
+        else
+        {
+             result = KErrArgument;
+        }
+    }
+
+    if ( isMrccatoPlay )
+    {
+        //
+        // send Media Key Play event to UserInputHandler class
+        //
+		iUserInputHandler->MrccatoPlay( ERemConCoreApiPlaybackSpeedNextFrame, buttonAction );
+    }
+    else
+    {
+        //
+        // send Media Key Command event to UserInputHandler class
+        //
+        iUserInputHandler->MrccatoCommand( operationId, buttonAction );
+    }
+
+    return result;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CUserinputhandlertest::SetForeground()
+// -------------------------------------------------------------------------------------------------
+//
+TInt CUserinputhandlertest::SetForeground( CStifItemParser&  aItem )
+{
+    MPX_DEBUG(_L("CUserinputhandlertest::SetForeground()"));
+
+    _LIT( KForegroundParameter, "foreground=" );
+
+    TInt value;
+    TPtrC parameter;
+
+    TInt result = KErrNone;
+
+    while ( aItem.GetNextString( parameter ) == KErrNone )
+    {
+        if ( parameter.Find( KForegroundParameter ) == 0 )
+        {
+            //
+            // get foreground value
+            //
+            TPtrC parameterValue =
+                parameter.Right( parameter.Length() - KForegroundParameter().Length() );
+
+            TLex parameterValueParser( parameterValue );
+            if ( parameterValueParser.Val( value ) != KErrNone )
+            {
+                result = KErrArgument;
+            }
+
+        }
+        else
+        {
+             result = KErrArgument;
+        }
+    }
+
+    //
+    // send foreground event to UserInputHandler class
+    //
+    iUserInputHandler->SetForeground( value );
+
+    return result;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CUserinputhandlertest::ParseInputs
+// -------------------------------------------------------------------------------------------------
+//
+TInt CUserinputhandlertest::ParseInputs( CStifItemParser&  aItem,
+                                         TMPXVideoControlType& aControlType,
+                                         TPointerEvent& aEventType,
+                                         TEventCode& aEventCode,
+                                         TKeyEvent& aKeyEvent )
+{
+    TPtrC parameter;
+    TInt result = KErrNone;
+
+    while ( aItem.GetNextString( parameter ) == KErrNone )
+    {
+        if ( parameter.Find( KControlTypeParameter ) == 0 )
+        {
+            //
+            // obtain control type (Container or Control)
+            //
+            TPtrC parameterValue =
+                parameter.Right( parameter.Length() - KControlTypeParameter().Length() );
+
+            if ( parameterValue.Compare(KVideoPlaybackContainer) == 0 )
+            {
+                aControlType = EMpxVideoPlaybackContainer;
+            }
+            else if ( parameterValue.Compare(KVideoPlaybackControl) == 0 )
+            {
+                aControlType = EMpxVideoPlaybackControl;
+            }
+        }
+        else if ( parameter.Find( KPtrTypeParameter ) == 0 )
+        {
+            //
+            // obtain pointer type (Button Down, Up, Drag, or Null)
+            //
+            TPtrC parameterValue =
+                parameter.Right( parameter.Length() - KPtrTypeParameter().Length() );
+
+            if ( parameterValue.Compare(KButtonDown) == 0 )
+            {
+                aEventType.iType = TPointerEvent::EButton1Down;
+            }
+            else if ( parameterValue.Compare(KButtonUp) == 0 )
+            {
+                aEventType.iType = TPointerEvent::EButton1Up;
+            }
+            else if ( parameterValue.Compare(KButtonDrag) == 0 )
+            {
+                aEventType.iType = TPointerEvent::EDrag;
+            }
+            else if ( parameterValue.Compare(KPointerEventNull) == 0 )
+            {
+                aEventType.iType = (TPointerEvent::TType) KPtrEventNull;
+            }
+        }
+        else if ( parameter.Find( KKeyTypeParameter ) == 0 )
+        {
+            //
+            // obtain key type (Key Down, Up, or Null)
+            //
+            TPtrC parameterValue =
+                parameter.Right( parameter.Length() - KKeyTypeParameter().Length() );
+
+            if ( parameterValue.Compare(KKeyDown) == 0 )
+            {
+                aEventCode = EEventKeyDown;
+            }
+            else if ( parameterValue.Compare(KKeyUp) == 0 )
+            {
+                aEventCode = EEventKeyUp;
+            }
+            else if ( parameterValue.Compare(KKeyNull) == 0 )
+            {
+                aEventCode = EEventNull;
+            }
+        }
+        else if ( parameter.Find( KKeyScancode ) == 0 )
+        {
+            //
+            // obtain iScanCode
+            //
+            TPtrC parameterValue =
+                parameter.Right( parameter.Length() - KKeyScancode().Length() );
+            TLex parameterValueParser( parameterValue );
+            if ( parameterValueParser.Val( aKeyEvent.iScanCode ) != KErrNone )
+            {
+                result = KErrArgument;
+            }
+        }
+        else if ( parameter.Find( KKeyCode ) == 0 )
+        {
+            //
+            // obtain iCode
+            //
+            TPtrC parameterValue =
+                parameter.Right( parameter.Length() - KKeyCode().Length() );
+            TLex parameterValueParser( parameterValue );
+            if ( parameterValueParser.Val( aKeyEvent.iCode ) != KErrNone )
+            {
+                result = KErrArgument;
+            }
+        }
+        else
+        {
+             result = KErrArgument;
+        }
+    }
+
+    return result;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CUserinputhandlertest::CheckExpectedResult
+// -------------------------------------------------------------------------------------------------
+//
+TInt CUserinputhandlertest::CheckExpectedResult( CStifItemParser&  aItem )
+{
+    MPX_DEBUG(_L("CUserinputhandlertest::CheckExpectedResult()"));
+
+    TInt result = KErrGeneral;
+    TMPXVideoControlType expectedControlType;
+    TPointerEvent expectedEventType;
+    TEventCode expectedEventCode;
+    TKeyEvent expectedKeyEvent;
+
+    //
+    // Parse expected inputs
+    //
+    ParseInputs( aItem,
+                 expectedControlType,
+                 expectedEventType,
+                 expectedEventCode,
+                 expectedKeyEvent );
+
+    if ( expectedControlType == EMpxVideoPlaybackContainer )
+    {
+        //
+        // Compare expected result and actual result in Playback Container
+        //
+        if ( ( expectedEventType.iType == iContainer->iPointerEvent.iType ) ||
+             ( expectedEventCode  == iContainer->iEventCode &&
+               expectedKeyEvent.iScanCode == iContainer->iKeyEvent.iScanCode ) )
+        {
+            result = KErrNone;
+        }
+        else
+        {
+            MPX_DEBUG(_L("Container FAILED: expected [type=%d,evenCode=%d,scanCode=%d]"),
+                    expectedEventType.iType, expectedEventCode, expectedKeyEvent.iScanCode );
+            MPX_DEBUG(_L("Container FAILED: actual   [type=%d,evenCode=%d,scanCode=%d]"),
+                    iContainer->iPointerEvent.iType, iContainer->iEventCode, iContainer->iKeyEvent.iScanCode );
+        }
+    }
+    else if ( expectedControlType == EMpxVideoPlaybackControl )
+    {
+        //
+        // Compare expected result and actual result in Playback Control
+        //
+        if ( ( expectedEventType.iType == iControl->iPointerEvent.iType ) ||
+             ( expectedEventCode  == iControl->iEventCode &&
+               expectedKeyEvent.iScanCode == iControl->iKeyEvent.iScanCode ) )
+        {
+            result = KErrNone;
+        }
+        else
+        {
+            MPX_DEBUG(_L("Control FAILED: expected [type=%d,evenCode=%d,scanCode=%d]"),
+                    expectedEventType.iType, expectedEventCode, expectedKeyEvent.iScanCode );
+            MPX_DEBUG(_L("Control FAILED: actual   [type=%d,evenCode=%d,scanCode=%d]"),
+                    iControl->iPointerEvent.iType, iControl->iEventCode, iControl->iKeyEvent.iScanCode );
+        }
+    }
+
+
+    return result;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CUserinputhandlertest::CheckExpectedCommand
+// -------------------------------------------------------------------------------------------------
+//
+TInt CUserinputhandlertest::CheckExpectedCommand( CStifItemParser& aItem )
+{
+    MPX_DEBUG(_L("CUserinputhandlertest::CheckExpectedCommand()"));
+
+    TInt command = 0;
+    TInt result = aItem.GetNextInt( command );
+
+    if ( result == KErrNone && command == iContainer->iCommand )
+    {
+        result = KErrNone;
+    }
+    else
+    {
+        MPX_DEBUG(_L("Command FAILED: expectedCommand=%d, actualCommand=%d]"),
+                          command, iContainer->iCommand );
+
+        result = KErrArgument;
+    }
+
+    return result;
+}
+
+
+
+//  [End of File] - Do not remove
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviews/tsrc/ut_userinputhandlertest/src/videoplaybackcontainer_stub.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,221 @@
+/*
+ * 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:  Test Harness for Video Playback Views
+ *
+ */
+
+// Version : %version: ou1cpsw#3 %
+
+
+// INCLUDES
+#include <coeaui.h>
+#include <aknutils.h>
+#include <aknsutils.h>
+#include <aknviewappui.h>
+#include <aknsdrawutils.h>
+#include <aknsbasicbackgroundcontrolcontext.h>
+#include <RemConCoreApiTarget.h>
+#include <remconinterfaceselector.h> // Side volume key
+
+#include "videoplaybackcontainer_stub.h"
+#include "mpxhelixplaybackplugindefs.h"
+#include "mpxvideoplaybackuserinputhandler.h"
+#include "mpxcommonvideoplaybackview.hrh"
+#include "mpxvideo_debug.h"
+
+//
+// extension of TPointerEvent::TType in w32std.h
+//
+TInt KContainerPtrEventNull = 20;
+
+//
+// extension of TMPXVideoPlaybackViewCommandIds in
+// mpxcommonvideoplaybackview.hrh
+//
+TInt KCmdNone = 9000;
+
+// ============================ MEMBER FUNCTIONS ===================================================
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackContainer::CMPXVideoPlaybackContainer
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -------------------------------------------------------------------------------------------------
+//
+
+CMPXVideoPlaybackContainer::CMPXVideoPlaybackContainer()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackContainer::ConstructL()
+// Symbian 2nd phase constructor can leave.
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackContainer::ConstructL()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackContainer::ConstructL()"));
+
+    //
+    // pre-set defaults
+    //
+    iKeyEvent.iScanCode = EStdKeyNull;
+    iEventCode = EEventNull;
+    iPointerEvent.iType = (TPointerEvent::TType) KContainerPtrEventNull;
+    iCommand = KCmdNone;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackContainer::NewL()
+// Two-phased constructor.
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackContainer* CMPXVideoPlaybackContainer::NewL()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackContainer::NewL()"));
+
+    CMPXVideoPlaybackContainer* self =
+            new (ELeave) CMPXVideoPlaybackContainer();
+
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+}
+
+//
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackContainer::~CMPXVideoPlaybackContainer()
+// Destructor.
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackContainer::~CMPXVideoPlaybackContainer()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackContainer::~CMPXVideoPlaybackContainer()"));
+}
+
+//
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackContainer::HandleCommandL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackContainer::HandleCommandL( TInt aCommand,
+                                                 TInt /* aValue */ )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackContainer::HandleCommandL()"));
+    iCommand = aCommand;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackContainer::DoHandleKeyEventL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackContainer::DoHandleKeyEventL(
+        const TKeyEvent& aKeyEvent, TEventCode aType)
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackContainer::DoHandleKeyEventL()"));
+
+    iKeyEvent = aKeyEvent;
+    iEventCode = aType;
+
+    switch ( aKeyEvent.iScanCode )
+    {
+        case EStdKeyDevice3:        // rocker middle key
+        case EStdKeyEnter:          // enter key on a qwerty key board
+        {
+            if ( aKeyEvent.iCode == EKeyNull && aType == EEventKeyDown )
+            {
+                iCommand = EMPXPbvCmdPlayPause;
+            }
+            break;
+        }
+        case EStdKeyUpArrow:        // rocker up key
+        {
+            if (aType == EEventKeyDown)
+            {
+            iCommand = EMPXPbvCmdIncreaseVolume;
+            }
+            break;
+        }
+        case EStdKeyDownArrow:      // rocker down key
+        {
+            if (aType == EEventKeyDown)
+            {
+            iCommand = EMPXPbvCmdDecreaseVolume;
+            }
+            break;
+        }
+        case EStdKeyLeftArrow:      // rocker left key
+        {
+            if (aType == EEventKeyDown)
+            {
+                iCommand = EMPXPbvCmdSeekBackward;
+            }
+            else if (aType == EEventKeyUp)
+            {
+                iCommand = EMPXPbvCmdEndSeek;
+            }
+            break;
+        }
+        case EStdKeyRightArrow:     // rocker right key
+        {
+            if (aType == EEventKeyDown)
+            {
+                iCommand = EMPXPbvCmdSeekForward;
+            }
+            else if (aType == EEventKeyUp)
+            {
+                iCommand = EMPXPbvCmdEndSeek;
+            }
+            break;
+        }
+        case EStdKeyYes:            // green/send key
+        {
+            // in playback view we dont want to take any action
+            // just consume the key
+            iCommand = KCmdNone;
+            break;
+        }
+        case EStdKeyDevice0:
+        case EStdKeyDevice1:
+        {
+            if (aType == EEventKeyDown)
+            {
+                iCommand = EMPXControlCmdSoftKeyPressed;
+            }
+            break;
+        }
+        default:
+            break;
+    }
+
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackContainer::DoHandlePointerEventL()
+//
+// Gets called from the Controls Controller
+// only if if OK to handle pointer events
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackContainer::DoHandlePointerEventL(
+        const TPointerEvent& aPointerEvent)
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackContainer::DoHandlePointerEventL()"));
+
+    iPointerEvent = aPointerEvent;
+}
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviews/tsrc/ut_userinputhandlertest/src/videoplaybackcontrol_stub.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,143 @@
+/*
+* 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:  Implementation of STIF Video Playback Control
+*
+*/
+
+// Version : %version: ou1cpsw#3 %
+
+
+// INCLUDE FILES
+#include <avkon.hrh>
+#include <e32std.h>
+#include <aknutils.h>
+
+#include "videoplaybackcontrol_stub.h"
+#include "mpxvideo_debug.h"
+
+//
+// extension of TPointerEvent::TType in w32std.h
+//
+TInt KControlPtrEventNull = 20;
+
+// ================= MEMBER FUNCTIONS ==============================================================
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControl::CMPXVideoPlaybackControl()
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackControl::CMPXVideoPlaybackControl()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControl::ConstructL()
+// Symbian 2nd phase constructor can leave.
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControl::ConstructL()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControl::ConstructL()"));
+
+    //
+    // pre-set defaults
+    //
+    iKeyEvent.iScanCode = EStdKeyNull;
+    iEventCode = EEventNull;
+    iPointerEvent.iType = (TPointerEvent::TType) KControlPtrEventNull;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControl::NewL()
+// Two-phased constructor.
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackControl* CMPXVideoPlaybackControl::NewL()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControl::NewL()"));
+
+    CMPXVideoPlaybackControl* self =
+        new (ELeave) CMPXVideoPlaybackControl();
+
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControl::~CMPXVideoPlaybackControl()
+// Destructor.
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackControl::~CMPXVideoPlaybackControl()
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControl::~CMPXVideoPlaybackControl()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// From CCoeControl
+// Gets the number of controls contained in a compound control.
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMPXVideoPlaybackControl::CountComponentControls() const
+{
+    return 0;
+}
+
+// -------------------------------------------------------------------------------------------------
+// From CCoeControl
+// Gets an indexed component of a compound control.
+// -------------------------------------------------------------------------------------------------
+//
+CCoeControl* CMPXVideoPlaybackControl::ComponentControl( TInt /*aIndex*/ ) const
+{
+    return NULL;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControl::Draw()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControl::Draw(const TRect& /* aRect */ ) const
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControl::Draw()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControl::DoHandlePointerEventL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControl::DoHandlePointerEventL( const TPointerEvent& aPointerEvent )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControl::DoHandlePointerEventL()"));
+    iPointerEvent = aPointerEvent;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControl::DoHandleKeyEventL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackControl::DoHandleKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType )
+{
+    MPX_DEBUG(_L("CMPXVideoPlaybackControl::DoHandleKeyEventL()"));
+
+    iKeyEvent = aKeyEvent;
+    iEventCode = aType;
+}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,32 @@
+/*
+* 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 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:  Main build file for platform APIs*
+*/
+
+
+
+#include "../videoplayer_startup_api/group/bld.inf"
+#include "../video_player_file_details_dialog_api/group/bld.inf"
+#include "../videocollection_api/group/bld.inf"
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+PRJ_MMPFILES
+
+PRJ_TESTMMPFILES
+
+PRJ_TESTEXPORTS
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/video_player_file_details_dialog_api/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2006-2009 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:  File that exports the files belonging to 
+*               Video Player File Details Dialog API
+*
+*/
+
+
+// Version : %version: da1mmcf#4 %
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/MPFileDetailsDialog.h            APP_LAYER_PLATFORM_EXPORT_PATH(MPFileDetailsDialog.h)
+../inc/MPFileDetails.h                  APP_LAYER_PLATFORM_EXPORT_PATH(MPFileDetails.h)
+../inc/filedetailspluginif.hrh          APP_LAYER_PLATFORM_EXPORT_PATH(filedetailspluginif.hrh)
+../inc/filedetailspluginif.h            APP_LAYER_PLATFORM_EXPORT_PATH(filedetailspluginif.h)
+../inc/filedetailspluginif.inl          APP_LAYER_PLATFORM_EXPORT_PATH(filedetailspluginif.inl)
+../inc/mpxfiledetailscntlpluginif.h     APP_LAYER_PLATFORM_EXPORT_PATH(mpxfiledetailscntlpluginif.h)
+../inc/mpxfiledetailscntlpluginif.inl   APP_LAYER_PLATFORM_EXPORT_PATH(mpxfiledetailscntlpluginif.inl)
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/video_player_file_details_dialog_api/inc/MPFileDetails.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,152 @@
+/*
+* Copyright (c) 2002 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:   Container for file details*
+*/
+
+
+// Version : %version: 3 %
+
+
+
+
+#ifndef MPFILEDETAILS_H
+#define MPFILEDETAILS_H
+
+//  INCLUDES
+#include <f32file.h>
+#include <e32base.h>
+
+// FORWARD DECLARATIONS
+class CMPVideoPlayerUIController;
+
+
+enum TMediaPlayerExpireConstraint
+    {
+    EMediaPlayerNone,
+    EMediaPlayerCount,
+    EMediaPlayerTime,
+    EMediaPlayerCountAndTime,
+    EMediaPlayerAccumulatedTime
+    };
+
+enum TMediaPlayerRightsStatus 
+    {
+    EMediaPlayerFull,
+    EMediaPlayerMissing,
+    EMediaPlayerRestricted,
+    EMediaPlayerExpired,
+    EMediaPlayerPreview,
+    KMediaPlayerWmdrmValid,
+    KMediaPlayerWmdrmExpired
+    }; 
+
+
+// CLASS DECLARATION
+
+/**
+*  CMPFileDetails 
+*  Container class for file details
+*
+*  @lib MPEngine.lib
+*  @since 2.0
+*/
+NONSHARABLE_CLASS(CMPFileDetails) : public CBase
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C CMPFileDetails();
+        
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CMPFileDetails();
+
+    public:    // Data
+
+        HBufC* iTitle;
+        HBufC* iFileName;
+		HBufC* iFilePath;
+        HBufC* iUrl;
+        HBufC* iFormat;
+        HBufC* iCopyright;      
+        HBufC* iArtist;
+        HBufC* iAlbum;
+        HBufC* iYear;
+
+        HBufC* iOriginalArtist; 
+        HBufC* iAlbumTrack;
+        HBufC* iGenre;
+        HBufC* iComposer;
+        HBufC* iAudioFileWebPage;
+        HBufC* iComment;
+        HBufC* iProvider;
+        HBufC* iDescription;
+
+        // For X-pcs Metadata
+        HBufC* iArtistXpcs;
+        HBufC* iTitleXpcs;
+        HBufC* iAlbumXpcs;
+        HBufC* iInfoXpcs;
+        
+        TInt   iResolutionWidth;
+        TInt   iResolutionHeight;
+        TInt   iBitrate;
+        TInt   iSamplerate;
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+        TInt64 iSize;
+#else
+        TInt   iSize;
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+        TInt   iMaxVolume;
+ 
+        TInt64 iDurationInSeconds;
+    
+        TTime  iTime;
+        
+        TBool  iLiveStream;
+        TBool  iSeekable;
+        TBool  iAudioTrack;
+        TBool  iVideoTrack;
+
+        // Drm stuff
+        TBool   iDrmProtected;
+        TMediaPlayerRightsStatus iDRMRightsStatus;
+        TMediaPlayerExpireConstraint iDRMExpireConstraint;
+        TBool   iDRMForwardLocked;
+        TUint32 iDRMCountsLeft;
+
+        TBool   iDRMFileHasInterval;
+        TBool   iDRMIntervalActive;
+        TTimeIntervalSeconds iDRMInterval;
+        TTimeIntervalSeconds iDRMAccumulatedTime;
+
+        TTime   iDRMValidFrom;
+        TTime   iDRMValidUntil;
+        
+        TBool   iDRMhasInfoURL;
+        HBufC*  iDRMInfoURL; //DRM2
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+        RFile64 iDetailsFileHandle; 
+#else
+        RFile   iDetailsFileHandle; 
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+        TBool   iReadingDCFOnly;  //True when just DCF header info needs to be read
+    };
+
+#endif      // MPFILEDETAILS_H  
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/video_player_file_details_dialog_api/inc/MPFileDetailsDialog.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,554 @@
+/*
+* Copyright (c) 2002 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:   Declares media file details dialog*
+*/
+
+
+// Version : %version: 8 %
+
+
+
+
+#ifndef MPFILEDETAILSDIALOG_H
+#define MPFILEDETAILSDIALOG_H
+
+//  INCLUDES
+#include <aknPopup.h>
+#ifdef SYMBIAN_BUILD_GCE
+#include <videoplayer2.h>
+#else
+#include <videoplayer.h>
+#endif //SYMBIAN_BUILD_GCE
+#include <mdaaudiosampleplayer.h>
+#include <MPFileDetails.h>
+
+// FORWARD DECLARATIONS
+class CAknDoublePopupMenuStyleListBox;
+class CMPPopupList;
+
+
+// CLASS DECLARATIONS
+
+/**
+*  CMPFileDetailsDialog
+*
+*  @lib MPFileDetailsDialog.lib
+*  @since 2.0
+*/
+class CMPFileDetailsDialog : public CBase, public MMdaAudioPlayerCallback,
+                             public MVideoPlayerUtilityObserver
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CMPFileDetailsDialog* NewL();
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CMPFileDetailsDialog();
+
+    public: // New functions
+
+        /**
+        * Shows file details to user in dialog.
+        * @since 2.0
+        * @param aFileName Media file which details are shown to user.
+        * @leaves Leaves with KErrNotSupported if file is not valid media file.
+        * @return void
+        */
+        IMPORT_C void ExecuteLD(const TDesC& aFileName);
+
+        /**
+        * Shows file details to user in dialog.
+        * @since 2.0
+        * @param aFileDetails File details which are shown to user.
+        * @return void
+        */
+        IMPORT_C void ExecuteLD(CMPFileDetails* aFileDetails);
+        
+        /** 
+        * Attempts to force the dialog to close 
+        * @since 5.0 
+        * @return void 
+        */ 
+        IMPORT_C void Close(); 
+
+    public: // Functions from MMdaAudioPlayerCallback
+
+        /** @see MMdaAudioPlayerCallback::MapcInitComplete() */
+        void MapcInitComplete(TInt aError,
+                const TTimeIntervalMicroSeconds& aDuration);
+
+        /** @see MMdaAudioPlayerCallback::MapcPlayComplete */
+        void MapcPlayComplete(TInt aError);
+
+    public: // Functions from MVideoPlayerUtilityObserver
+
+        /** @see MVideoPlayerUtilityObserver::MvpuoOpenComplete */
+        void MvpuoOpenComplete(TInt aError);
+
+        /** @see MVideoPlayerUtilityObserver::MvpuoPrepareComplete */
+        void MvpuoPrepareComplete(TInt aError);
+
+        /** @see MVideoPlayerUtilityObserver::MvpuoFrameReady */
+        void MvpuoFrameReady(CFbsBitmap& aFrame,TInt aError);
+
+        /** @see MVideoPlayerUtilityObserver::MvpuoPlayComplete */
+        void MvpuoPlayComplete(TInt aError);
+
+        /** @see MVideoPlayerUtilityObserver::MvpuoEvent */
+        void MvpuoEvent(const TMMFEvent& aEvent);
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CMPFileDetailsDialog();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+    private: // New functions
+
+        /**
+        * Loads MPFileDetails.rsc resource file.
+        * @since 2.0
+        * @return void
+        */
+        void LoadResourcesL();
+
+        /**
+        * Unloads MPFileDetails.rsc resource file.
+        * @since 2.0
+        * @return void
+        */
+        void UnLoadResources();
+
+        /**
+        * Sets title for CAknPopupList.
+        * @since 2.0
+        * @param aPopupList CAknPopupList which title is modified
+        * @return void
+        */
+        void SetTitleL( CAknPopupList* aPopupList );
+
+        /**
+        * Fills listbox with file details information.
+        * @since 2.0
+        * @param aFileDetails File details
+        * @return void
+        */
+        void FillListBoxL( CMPFileDetails* aFileDetails );
+
+        /**
+        * Adds header and value to list.
+        * @since 2.0
+        * @param aHeading Heading
+        * @param aValue Value
+        * @param aItemArray Array where value and header are added.
+        * @return void
+        */
+        void AddItemToListBoxL( const TDesC& aHeading, const TDesC& aValue,
+                CDesCArray* aItemArray );
+
+        /**
+        * Constructs clip title item.
+        * @since 2.0
+        * @param aItemArray Array where constructed item is put.
+        * @param aFileDetails File details.
+        * @return void
+        */
+        void MakeTitleItemL( CDesCArray* aItemArray,
+                CMPFileDetails* aFileDetails );
+
+        /**
+        * Constructs clip url item.
+        * @since 2.0
+        * @param aItemArray Array where constructed item is put.
+        * @param aFileDetails File details.
+        * @return void
+        */
+        void MakeUrlItemL( CDesCArray* aItemArray,
+                CMPFileDetails* aFileDetails );
+
+        /**
+        * Constructs media format item.
+        * @since 2.0
+        * @param aItemArray Array where constructed item is put.
+        * @param aFileDetails File details.
+        * @return void
+        */
+        void MakeFormatItemL( CDesCArray* aItemArray,
+                CMPFileDetails* aFileDetails );
+
+        /**
+        * Constructs video resolution item.
+        * @since 2.0
+        * @param aItemArray Array where constructed item is put.
+        * @param aFileDetails File details.
+        * @return void
+        */
+        void MakeResolutionItemL( CDesCArray* aItemArray,
+                CMPFileDetails* aFileDetails );
+
+        /**
+        * Constructs media duration item.
+        * @since 2.0
+        * @param aItemArray Array where constructed item is put.
+        * @param aFileDetails File details.
+        * @return void
+        */
+        void MakeDurationItemL( CDesCArray* aItemArray,
+                CMPFileDetails* aFileDetails );
+
+        /**
+        * Constructs bitrate item.
+        * @since 2.0
+        * @param aItemArray Array where constructed item is put.
+        * @param aFileDetails File details.
+        * @return void
+        */
+        void MakeBitrateItemL( CDesCArray* aItemArray,
+                CMPFileDetails* aFileDetails );
+
+        /**
+        * Constructs samplerate item.
+        * @since 2.0
+        * @param aItemArray Array where constructed item is put.
+        * @param aFileDetails File details.
+        * @return void
+        */
+        void MakeSamplerateItemL( CDesCArray* aItemArray,
+                CMPFileDetails* aFileDetails );
+
+        /**
+        * Constructs file size item.
+        * @since 2.0
+        * @param aItemArray Array where constructed item is put.
+        * @param aFileDetails File details.
+        * @return void
+        */
+        void MakeSizeItemL( CDesCArray* aItemArray,
+                CMPFileDetails* aFileDetails );
+
+        /**
+        * Constructs date item.
+        * @since 2.0
+        * @param aItemArray Array where constructed item is put.
+        * @param aFileDetails File details.
+        * @return void
+        */
+        void MakeDateItemL( CDesCArray* aItemArray,
+                CMPFileDetails* aFileDetails );
+
+        /**
+        * Constructs time item.
+        * @since 2.0
+        * @param aItemArray Array where constructed item is put.
+        * @param aFileDetails File details.
+        * @return void
+        */
+        void MakeTimeItemL( CDesCArray* aItemArray,
+                CMPFileDetails* aFileDetails );
+
+        /**
+        * Constructs upload status item.
+        * @since 2.8
+        * @param aItemArray Array where constructed item is put.
+        * @param aFileDetails File details.
+        * @return void
+        */
+        void MakeUploadStatusL( CDesCArray* aItemArray,
+                CMPFileDetails* aFileDetails );
+
+        /**
+        * Constructs copyright item.
+        * @since 2.0
+        * @param aItemArray Array where constructed item is put.
+        * @param aFileDetails File details.
+        * @return void
+        */
+        void MakeCopyrightItemL( CDesCArray* aItemArray,
+                CMPFileDetails* aFileDetails );
+
+        /**
+        * Constructs original artist of the track item.
+        * @since 3.0
+        * @param aItemArray Array where constructed item is put.
+        * @param aFileDetails File details.
+        * @return void
+        */
+        void MakeOriginalArtistItemL( CDesCArray* aItemArray,
+                CMPFileDetails* aFileDetails );
+
+        /**
+        * Constructs track position in the album to which
+        * the track belongs item.
+        * @since 3.0
+        * @param aItemArray Array where constructed item is put.
+        * @param aFileDetails File details.
+        * @return void
+        */
+        void MakeAlbumTrackItemL( CDesCArray* aItemArray,
+                CMPFileDetails* aFileDetails );
+
+        /**
+        * Constructs Genre information item.
+        * @since 3.0
+        * @param aItemArray Array where constructed item is put.
+        * @param aFileDetails File details.
+        * @return void
+        */
+        void MakeGenreItemL( CDesCArray* aItemArray,
+                CMPFileDetails* aFileDetails );
+
+        /**
+        * Constructs Composer information item.
+        * @since 3.0
+        * @param aItemArray Array where constructed item is put.
+        * @param aFileDetails File details.
+        * @return void
+        */
+        void MakeComposerItemL( CDesCArray* aItemArray,
+                CMPFileDetails* aFileDetails );
+
+        /**
+        * Constructs URL from which more information about
+        * the track can be found item.
+        * @since 3.0
+        * @param aItemArray Array where constructed item is put.
+        * @param aFileDetails File details.
+        * @return void
+        */
+        void MakeAudioFileWebPageItemL( CDesCArray* aItemArray,
+                CMPFileDetails* aFileDetails );
+
+        /**
+        * Constructs comment someone has added about the track item.
+        * @since 3.0
+        * @param aItemArray Array where constructed item is put.
+        * @param aFileDetails File details.
+        * @return void
+        */
+        void MakeCommentItemL( CDesCArray* aItemArray,
+                CMPFileDetails* aFileDetails );
+
+        /**
+        * Constructs Artist item.
+        * @since 2.0
+        * @param aItemArray Array where constructed item is put.
+        * @param aFileDetails File details.
+        * @return void
+        */
+        void MakeArtistItemL( CDesCArray* aItemArray,
+                CMPFileDetails* aFileDetails );
+
+        /**
+        * Constructs Album item.
+        * @since 2.0
+        * @param aItemArray Array where constructed item is put.
+        * @param aFileDetails File details.
+        * @return void
+        */
+        void MakeAlbumItemL( CDesCArray* aItemArray,
+                CMPFileDetails* aFileDetails );
+
+        /**
+        * Constructs Year item.
+        * @since 2.0
+        * @param aItemArray Array where constructed item is put.
+        * @param aFileDetails File details.
+        * @return void
+        */
+        void MakeYearItemL( CDesCArray* aItemArray,
+                CMPFileDetails* aFileDetails );
+
+        /**
+        * Converts between arabic-indic digits and european digits.
+        * @since 2.0
+        * @param aText numbers to be converted.
+        * @return void
+        */
+        void LanguageSpecificNumberConversion( TDes& aText) const;
+
+        /**
+        * Fetches file details from the meta data.
+        * @since 2.1
+        * @param aFileName Name of the audio file.
+        * @param aFileDetails Pointer to the details to be fetched.
+        * @return void
+        */
+        void FetchMetaDataL( const TDesC& aFileName,
+                CMPFileDetails* aFileDetails );
+
+        /**
+        * Fetches drm file details.
+        * @since 2.6
+        * @param aFileName Name of the audio file.
+        * @param aFileDetails Pointer to the details to be fetched.
+        * @return void
+        */
+        void FetchDrmDataL( const TDesC& aFileName,
+                CMPFileDetails* aFileDetails );
+
+        /**
+        * Display DRM heading info
+        * @since 9.1
+        * @param aItemArray Array where constructed item is put.
+        * @return void
+        */
+        void DisplayDrmHeadingInfoL( CDesCArray* aItemArray );
+
+        /**
+        * Makes provider item.
+        * @since 3.0
+        * @param aItemArray Array where constructed item is put.
+        * @param aFileDetails File details.
+        * @return void
+        */
+        void MakeProviderItemL( CDesCArray* aItemArray,
+                CMPFileDetails* aFileDetails );
+
+        /**
+        * Makes description item.
+        * @since 3.0
+        * @param aItemArray Array where constructed item is put.
+        * @param aFileDetails File details.
+        * @return void
+        */
+        void MakeDescriptionItemL( CDesCArray* aItemArray,
+                CMPFileDetails* aFileDetails );
+
+        /**
+        * Fetches additional meta data.
+        * @since 3.0
+        * @param aFileName Name of the audio file.
+        * @param aFileDetails Pointer to the details to be fetched.
+        * @return None
+        */
+        void FetchAdditionalMetaDataL( const TDesC& aFileName,
+                CMPFileDetails* aFileDetails );
+
+        /**
+        * Fetches DCF meta data.
+        * @since 3.0
+        * @param aFileName Name of the audio file.
+        * @param aFileDetails Pointer to the details to be fetched.
+        * @return None
+        */
+        void FetchDCFHeaderDataL( const TDesC& aFileName,
+                CMPFileDetails* aFileDetails );
+
+        /**
+        * Checks whether file is a 3gp/mp4 file.
+        * @param    aFileName: Name of the file
+        * @param    aFileDetails Pointer to the details to be fetched.
+        * @return   ETrue if file is 3gp file
+        */
+        TBool Is3gpFile( const TDesC& aFileName,
+                         CMPFileDetails* aFileDetails );
+
+        /**
+        * Sets file detail in buffer.
+        * @param    aBuf: Buffer where to store
+        * @param    aDetail: Details which to store
+        */
+        void SetFileDetailL( HBufC*& aBuf, const TDesC& aDetail );
+        void SetFileDetailL( HBufC*& aBuf, const TDesC8& aDetail );
+
+    private:    // Data
+        CAknDoublePopupMenuStyleListBox* iListBox;
+        CDesCArrayFlat* iGenres;
+        CMPPopupList* iPopupList;
+
+        TInt iResourceFileOffset;
+        CActiveSchedulerWait iWait;
+        TInt iResult;        
+    };
+
+
+/**
+*  CMPDummyController
+*  Dummy controller for CVideoPlayerUtility.
+*  Absorbs all the key presses while opening video clip.
+*
+*  @lib MPFileDetailsDialog.lib
+*  @since 2.0
+*/
+class CMPDummyController : public CCoeControl
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CMPDummyController* NewLC();
+
+        /**
+        * Destructor.
+        */
+        virtual ~CMPDummyController();
+
+    public: // New functions
+
+        /**
+        * Controls window handle.
+        * @since 2.0
+        * @return Controllers RWindow
+        */
+        inline RWindow& GetClientWindow();
+
+        /**
+        * Controls WsSession.
+        * @since 2.0
+        * @return Controllers RWsSession
+        */
+        inline RWsSession& GetClientWsSession();
+
+        /**
+        * Controls ScreenDevice
+        * @since 2.0
+        * @return Controllers CWsScreenDevice
+        */
+        inline CWsScreenDevice& GetScreenDevice();
+
+    private: // Functions from CCoeControl
+
+        /** @see CCoeControl::OfferKeyEventL() */
+        virtual TKeyResponse OfferKeyEventL( const TKeyEvent& /*aKeyEvent*/,
+                TEventCode /*aType*/ );
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CMPDummyController();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+    };
+
+#endif      // MPFILEDETAILSDIALOG_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/video_player_file_details_dialog_api/inc/filedetailspluginif.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,71 @@
+/*
+* 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 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:   Interface for filedetails plugin.*
+*/
+
+
+
+#ifndef FILEDETAILSPLUGINIF_H
+#define FILEDETAILSPLUGINIF_H
+
+#include <e32std.h>
+#include <e32base.h>
+#include <e32def.h>
+
+#include "filedetailspluginif.hrh"
+
+class CMPXMedia;
+
+/**
+ * ECom plugin interface definition.
+ */
+class CFileDetailsPluginIF : public CBase
+    {
+public:
+    /**
+    * Construction method.
+    * @return   Created object.
+    */
+    static CFileDetailsPluginIF* NewL( );
+
+    /**
+    * Destructor
+    */    
+    virtual ~CFileDetailsPluginIF();
+    
+    /**
+    * Shows file details based on given mpx media
+    * @param    aDetails  Already constructed details to be shown    
+    * @return   None
+    */  
+    virtual void ShowFileDetailsL( const CMPXMedia& aMedia ) = 0; 
+    
+protected:    
+    /**
+    * Instance identifier key. When instance of an
+    * implementation is created by ECOM framework, the
+    * framework will assign UID for it. The UID is used in
+    * destructor to notify framework that this instance is
+    * being destroyed and resources can be released.
+    */    
+    TUid iDtorIDKey;
+
+    };
+
+
+
+#include <ecom/ecom.h>
+#include "filedetailspluginif.inl"
+
+#endif //FILEDETAILSPLUGINIF_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/video_player_file_details_dialog_api/inc/filedetailspluginif.hrh	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,27 @@
+/*
+* 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 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: File details dialog interface constants.
+*/
+
+
+
+#ifndef FILEDETAILSPLUGINIF_HRH
+#define FILEDETAILSPLUGINIF_HRH
+
+/**
+ * Plugin interface UID
+ */
+#define KFileDetailsPluginInterfaceUid 0x20029FC9
+
+#endif // FILEDETAILSPLUGINIF_HRH
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/video_player_file_details_dialog_api/inc/filedetailspluginif.inl	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,48 @@
+/*
+* 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 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:  File details plugin inlines.
+*
+*/
+
+
+
+#ifndef FILEDETAILSPLUGINIF_INL
+#define FILEDETAILSPLUGINIF_INL
+
+// -----------------------------------------------------------------------------
+// Instantiates appropriate plugin implementation.
+// -----------------------------------------------------------------------------
+//
+inline CFileDetailsPluginIF* CFileDetailsPluginIF::NewL( )
+    {        
+    TEComResolverParams resolverParams;    
+    TAny* interface = REComSession::CreateImplementationL( 
+        TUid::Uid( KFileDetailsPluginInterfaceUid ),
+        _FOFF ( CFileDetailsPluginIF, iDtorIDKey ), 
+	resolverParams );
+    return static_cast<CFileDetailsPluginIF*> ( interface );          
+    }
+
+// -----------------------------------------------------------------------------
+// Interface's destructor
+// -----------------------------------------------------------------------------
+//
+inline CFileDetailsPluginIF::~CFileDetailsPluginIF()
+    {
+    // Inform the ECOM framework that this specific instance of the
+    // interface has been destroyed.
+    REComSession::DestroyedImplementation( iDtorIDKey );
+    }
+
+#endif //FILEDETAILSPLUGINIF_INL
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/video_player_file_details_dialog_api/inc/mpxfiledetailscntlpluginif.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,46 @@
+/*
+* 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 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:   Interface for filedetails cntl plugin.*
+*/
+
+// Version : %version: 1 %
+
+
+#ifndef __FILEDETAILSCNTLPLUGINIF_H__
+#define __FILEDETAILSCNTLPLUGINIF_H__
+
+#include <e32base.h>
+
+
+class CMPXFileDetailsPlugin : public CBase
+{
+public:
+	static CMPXFileDetailsPlugin* NewL(const TUid& aImplementationUid);
+
+	virtual ~CMPXFileDetailsPlugin();
+	
+	virtual TPtrC GetAdditionalLabelLC(TUint32 aFourCCCode) = 0;
+
+protected:
+    CMPXFileDetailsPlugin();
+
+
+private:
+	TUid iDtorKey;
+};
+	
+#include <ecom/ecom.h>
+#include "mpxfiledetailscntlpluginif.inl"
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/video_player_file_details_dialog_api/inc/mpxfiledetailscntlpluginif.inl	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,34 @@
+/*
+* 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 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:   Interface for filedetails cntl plugin.*
+*/
+
+// Version : %version: 1 %
+
+inline CMPXFileDetailsPlugin* CMPXFileDetailsPlugin::NewL(const TUid& aImplementationUid)
+{
+	TAny* any = REComSession::CreateImplementationL(aImplementationUid, _FOFF(CMPXFileDetailsPlugin, iDtorKey));
+	CMPXFileDetailsPlugin* object = REINTERPRET_CAST(CMPXFileDetailsPlugin*, any);
+	return object;
+}
+
+inline CMPXFileDetailsPlugin::~CMPXFileDetailsPlugin()
+{
+	REComSession::DestroyedImplementation(iDtorKey);
+}
+
+inline CMPXFileDetailsPlugin::CMPXFileDetailsPlugin()
+{
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/video_player_file_details_dialog_api/media_player_file_details_dialog_api.metaxml	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,18 @@
+<?xml version="1.0" ?>
+<api id="f67d2450d8bcb644c6ba99a84a7ba248" dataversion="2.0">
+  <name>Media Player File Details Dialog API</name>
+  <description>Provides media file details dialog to Media Gallery </description>
+  <type>c++</type>
+  <collection>mediaplayer</collection>
+  <libs>
+    <lib name="MPFileDetailsDialog.lib" />
+  </libs>
+  <release category="platform"/>
+  <attributes>
+     <!-- This indicates wether the api provedes separate html documentation -->
+     <!-- or is the additional documentation generated from headers. -->
+     <!-- If you are unsuere then the value is "no" -->
+     <htmldocprovided>no</htmldocprovided>
+     <adaptation>no</adaptation>
+  </attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/video_player_file_details_dialog_api/tsrc/Bmarm/ui_FileDetailsDialogtestU.DEF	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/video_player_file_details_dialog_api/tsrc/Bwins/ui_FileDetailsDialogtestU.DEF	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/video_player_file_details_dialog_api/tsrc/EABI/ui_FileDetailsDialogtestU.def	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,11 @@
+EXPORTS
+	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
+	_ZTI13CVcxTestTimer @ 2 NONAME ; #<TI>#
+	_ZTI17CEdwinTestControl @ 3 NONAME ; #<TI>#
+	_ZTI20CVcxTestControlEvent @ 4 NONAME ; #<TI>#
+	_ZTI25CVcxTestControlEventQueue @ 5 NONAME ; #<TI>#
+	_ZTV13CVcxTestTimer @ 6 NONAME ; #<VT>#
+	_ZTV17CEdwinTestControl @ 7 NONAME ; #<VT>#
+	_ZTV20CVcxTestControlEvent @ 8 NONAME ; #<VT>#
+	_ZTV25CVcxTestControlEventQueue @ 9 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/video_player_file_details_dialog_api/tsrc/conf/atsconf.txt	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,14 @@
+;Run \vado\videoplayer\internal\testing\tools\genATSdrop.pl from 
+;the tsrc folder to create ATS3 drop.
+[DROP]
+NAME VaDo - videoplayer_plat - video_player_file_details_dialog_api
+DEVICE Ivalo
+FLASH \\oucifs1\cp_sw\programs\video_applications_stream\iptv\flash_images\ivalo\wk12\RM-505_52.50.2009.12_rnd.core.C00
+FLASH \\oucifs1\cp_sw\programs\video_applications_stream\iptv\flash_images\ivalo\wk12\RM-505_52.50.2009.12_rnd.variant.V01
+FLASH \\oucifs1\cp_sw\programs\video_applications_stream\iptv\flash_images\ivalo\wk12\RM-505_52.50.2009.12.udaerase.fpsx
+SIS \VideoApp_Domain\videoplayer\videoplayerapp\mpxvideoplayer\sis\VideoPlayer.sisx
+PKG group\ui_FileDetailsDialogtest.pkg
+INI init\TestFramework.ini 300
+EMAIL ext-Petri.Senbom@nokia.com;ext-Janne.Tikkanen@nokia.com
+RUN
+[ENDDROP]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/video_player_file_details_dialog_api/tsrc/conf/ui_FileDetailsDialogtest.cfg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,257 @@
+[Define]
+
+//
+// From w32std.h
+//
+EButton1Down 0
+///** Button 1 or pen up. */
+EButton1Up 1
+///** Button 2 down.
+//This is the middle button of a 3 button mouse. */
+EButton2Down 2
+///** Button 2 up.
+//This is the middle button of a 3 button mouse. */
+EButton2Up 3
+///** Button 3 down. */
+EButton3Down 4
+///** Button 3 up. */
+EButton3Up 5
+///** Drag event.
+//ese events are only received when button 1 is down. */
+EDrag 6
+///** Move event.
+//These events are only received when button 1 is up and the XY input mode is not pen. */
+EMove 7
+///** Button repeat event. */
+EButtonRepeat 8
+///** Switch on event caused by a screen tap. */
+ESwitchOn 9
+
+//
+// From e32event.h
+//
+EKeyDown 3
+EKeyUp 4
+
+//
+// Key code mappings
+// 
+// LSK
+TFileDetailsTestKeyCode_EKeyDevice0 0 
+// RSK
+TFileDetailsTestKeyCode_EKeyDevice1 1
+// EndCall
+TFileDetailsTestKeyCode_EKeyNo 2
+TFileDetailsTestKeyCode_EKeyEscape 3
+
+CONTROLEVENTDELAY 5000
+
+[Enddefine]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 1: DetailsDialog - Create and Delete
+create ui_FileDetailsDialogtest FileDetails
+FileDetails CreateNewDialog
+delete FileDetails
+pause 1000
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core,error
+#------------------------------------------------------------------------------------
+[Test]
+title 2-1: DetailsDialog - ExecuteLD local video file
+bringtoforeground
+create ui_FileDetailsDialogtest FileDetails
+FileDetails CreateNewDialog
+FileDetails AddKeyEvent 100 TFileDetailsTestKeyCode_EKeyDevice0 EKeyDown
+FileDetails AddKeyEvent 100 TFileDetailsTestKeyCode_EKeyDevice0 EKeyUp
+FileDetails EnableControlEvents CONTROLEVENTDELAY 
+FileDetails ExecuteLDFromMedia video_18kb.3gp
+pause 1000
+delete FileDetails
+sendtobackground
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 2-2: DetailsDialog - ExecuteLD local ram file
+bringtoforeground
+create ui_FileDetailsDialogtest FileDetails
+FileDetails CreateNewDialog
+FileDetails AddKeyEvent 100 TFileDetailsTestKeyCode_EKeyDevice0 EKeyDown
+FileDetails AddKeyEvent 100 TFileDetailsTestKeyCode_EKeyDevice0 EKeyUp
+FileDetails EnableControlEvents CONTROLEVENTDELAY 
+FileDetails ExecuteLDFromMedia RAM-1kB.ram
+pause 1000
+delete FileDetails
+sendtobackground
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 2-3: DetailsDialog - ExecuteLD local audio file
+bringtoforeground
+create ui_FileDetailsDialogtest FileDetails
+FileDetails CreateNewDialog
+FileDetails AddKeyEvent 100 TFileDetailsTestKeyCode_EKeyDevice0 EKeyDown
+FileDetails AddKeyEvent 100 TFileDetailsTestKeyCode_EKeyDevice0 EKeyUp
+FileDetails EnableControlEvents CONTROLEVENTDELAY 
+FileDetails ExecuteLDFromMedia mpxtest1.mp3
+pause 1000
+delete FileDetails
+sendtobackground
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 2-4: DetailsDialog - ExecuteLD not supported file
+bringtoforeground
+create ui_FileDetailsDialogtest FileDetails
+FileDetails CreateNewDialog
+FileDetails AddKeyEvent 100 TFileDetailsTestKeyCode_EKeyDevice0 EKeyDown
+FileDetails AddKeyEvent 100 TFileDetailsTestKeyCode_EKeyDevice0 EKeyUp
+FileDetails EnableControlEvents CONTROLEVENTDELAY 
+allownextresult -28 // KErrBadName
+FileDetails ExecuteLDFromMedia "c:\testframework\testframework.ini"
+pause 1000
+delete FileDetails
+sendtobackground
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 2-5: DetailsDialog - ExecuteLD not found file
+bringtoforeground
+create ui_FileDetailsDialogtest FileDetails
+FileDetails CreateNewDialog
+FileDetails AddKeyEvent 100 TFileDetailsTestKeyCode_EKeyDevice0 EKeyDown
+FileDetails AddKeyEvent 100 TFileDetailsTestKeyCode_EKeyDevice0 EKeyUp
+FileDetails EnableControlEvents CONTROLEVENTDELAY 
+allownextresult -28 // KErrBadName
+FileDetails ExecuteLDFromMedia "c:\data\asdf.3gp"
+pause 1000
+delete FileDetails
+sendtobackground
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 2-6: DetailsDialog - ExecuteLD URL
+bringtoforeground
+create ui_FileDetailsDialogtest FileDetails
+FileDetails CreateNewDialog
+FileDetails AddKeyEvent 100 TFileDetailsTestKeyCode_EKeyDevice0 EKeyDown
+FileDetails AddKeyEvent 100 TFileDetailsTestKeyCode_EKeyDevice0 EKeyUp
+FileDetails EnableControlEvents CONTROLEVENTDELAY 
+allownextresult -28 // KErrBadName
+FileDetails ExecuteLDFromMedia "rtsp:\/\/vishnu.wipsl.com/StarWreck_256.3gp"
+pause 1000
+delete FileDetails
+sendtobackground
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 3: DetailsDialog - ExecuteLDFromDetails
+bringtoforeground
+create ui_FileDetailsDialogtest FileDetails
+FileDetails CreateNewDialog
+FileDetails CreateNewFileDetails american_wedding.ram
+FileDetails AddKeyEvent 100 TFileDetailsTestKeyCode_EKeyDevice0 EKeyDown
+FileDetails AddKeyEvent 100 TFileDetailsTestKeyCode_EKeyDevice0 EKeyUp
+FileDetails EnableControlEvents CONTROLEVENTDELAY 
+FileDetails ExecuteLDFromDetails
+pause 1000
+delete FileDetails
+sendtobackground
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 4: DetailsDialog - ExecuteLDFromDetails, NULL details
+bringtoforeground
+create ui_FileDetailsDialogtest FileDetails
+FileDetails CreateNewDialog
+FileDetails CreateNewFileDetails american_wedding.ram
+FileDetails AddKeyEvent 100 TFileDetailsTestKeyCode_EKeyDevice0 EKeyDown
+FileDetails AddKeyEvent 100 TFileDetailsTestKeyCode_EKeyDevice0 EKeyUp
+FileDetails EnableControlEvents CONTROLEVENTDELAY 
+FileDetails ExecuteLDFromDetails
+pause 1000
+delete FileDetails
+sendtobackground
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#------------------------------------------------------------------------------------
+[Test]
+title 5-2: DetailsDialog - ExecuteLD local ram file, press end call
+bringtoforeground
+create ui_FileDetailsDialogtest FileDetails
+FileDetails CreateNewDialog
+FileDetails AddKeyEvent 100 TFileDetailsTestKeyCode_EKeyEscape EKeyDown
+FileDetails AddKeyEvent 100 TFileDetailsTestKeyCode_EKeyEscape EKeyUp
+FileDetails EnableControlEvents CONTROLEVENTDELAY 
+FileDetails ExecuteLDFromMedia RAM-1kB.ram
+pause 1000
+delete FileDetails
+sendtobackground
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+#------------------------------------------------------------------------------------
+[Test]
+title 5-2: DetailsDialog - ExecuteLDFromDetails, press end call
+bringtoforeground
+create ui_FileDetailsDialogtest FileDetails
+FileDetails CreateNewDialog
+FileDetails CreateNewFileDetails american_wedding.ram
+FileDetails AddKeyEvent 100 TFileDetailsTestKeyCode_EKeyEscape EKeyDown
+FileDetails AddKeyEvent 100 TFileDetailsTestKeyCode_EKeyEscape EKeyUp
+FileDetails EnableControlEvents CONTROLEVENTDELAY 
+FileDetails ExecuteLDFromDetails
+pause 1000
+delete FileDetails
+sendtobackground
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 10-1: FileDetails - Create and Delete
+create ui_FileDetailsDialogtest FileDetails
+FileDetails CreateNewFileDetails beer440503.wmv
+delete FileDetails
+pause 1000
+[Endtest]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/video_player_file_details_dialog_api/tsrc/conf/ui_FileDetailsDialogtestManual.cfg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,166 @@
+//
+// Same stuff as in ui_FileDetailsDialogtest.cfg but EnablePointerEvents is commented out.
+//
+
+[Define]
+
+//
+// From w32std.h
+//
+EButton1Down 0
+///** Button 1 or pen up. */
+EButton1Up 1
+///** Button 2 down.
+//This is the middle button of a 3 button mouse. */
+EButton2Down 2
+///** Button 2 up.
+//This is the middle button of a 3 button mouse. */
+EButton2Up 3
+///** Button 3 down. */
+EButton3Down 4
+///** Button 3 up. */
+EButton3Up 5
+///** Drag event.
+//ese events are only received when button 1 is down. */
+EDrag 6
+///** Move event.
+//These events are only received when button 1 is up and the XY input mode is not pen. */
+EMove 7
+///** Button repeat event. */
+EButtonRepeat 8
+///** Switch on event caused by a screen tap. */
+ESwitchOn 9
+[Enddefine]
+
+[Test]
+title 1: DetailsDialog - Create and Delete
+create ui_FileDetailsDialogtest FileDetails
+FileDetails CreateNewDialog
+delete FileDetails
+pause 1000
+[Endtest]
+
+[Test]
+title 2-1: DetailsDialog - ExecuteLD local video file
+bringtoforeground
+create ui_FileDetailsDialogtest FileDetails
+FileDetails CreateNewDialog
+FileDetails AddPointerEvent 100 EButton1Down 0 620
+FileDetails AddPointerEvent 100 EButton1Up 0 620
+//FileDetails EnablePointerEvents 6000
+FileDetails ExecuteLDFromMedia video_18kb.3gp
+pause 1000
+delete FileDetails
+sendtobackground
+[Endtest]
+
+[Test]
+title 2-2: DetailsDialog - ExecuteLD local ram file
+bringtoforeground
+create ui_FileDetailsDialogtest FileDetails
+FileDetails CreateNewDialog
+FileDetails AddPointerEvent 100 EButton1Down 0 620
+FileDetails AddPointerEvent 100 EButton1Up 0 620
+//FileDetails EnablePointerEvents 6000
+FileDetails ExecuteLDFromMedia RAM-1kB.ram
+pause 1000
+delete FileDetails
+sendtobackground
+[Endtest]
+
+[Test]
+title 2-3: DetailsDialog - ExecuteLD local audio file
+bringtoforeground
+create ui_FileDetailsDialogtest FileDetails
+FileDetails CreateNewDialog
+FileDetails AddPointerEvent 100 EButton1Down 0 620
+FileDetails AddPointerEvent 100 EButton1Up 0 620
+//FileDetails EnablePointerEvents 6000
+FileDetails ExecuteLDFromMedia mpxtest1.mp3
+pause 1000
+delete FileDetails
+sendtobackground
+[Endtest]
+
+[Test]
+title 2-4: DetailsDialog - ExecuteLD not supported file
+bringtoforeground
+create ui_FileDetailsDialogtest FileDetails
+FileDetails CreateNewDialog
+FileDetails AddPointerEvent 100 EButton1Down 0 620
+FileDetails AddPointerEvent 100 EButton1Up 0 620
+//FileDetails EnablePointerEvents 6000
+allownextresult -28 // KErrBadName
+FileDetails ExecuteLDFromMedia "c:\testframework\testframework.ini"
+pause 1000
+delete FileDetails
+sendtobackground
+[Endtest]
+
+[Test]
+title 2-5: DetailsDialog - ExecuteLD not found file
+bringtoforeground
+create ui_FileDetailsDialogtest FileDetails
+FileDetails CreateNewDialog
+FileDetails AddPointerEvent 100 EButton1Down 0 620
+FileDetails AddPointerEvent 100 EButton1Up 0 620
+//FileDetails EnablePointerEvents 6000
+allownextresult -28 // KErrBadName
+FileDetails ExecuteLDFromMedia "c:\data\asdf.3gp"
+pause 1000
+delete FileDetails
+sendtobackground
+[Endtest]
+
+[Test]
+title 2-6: DetailsDialog - ExecuteLD URL
+bringtoforeground
+create ui_FileDetailsDialogtest FileDetails
+FileDetails CreateNewDialog
+FileDetails AddPointerEvent 100 EButton1Down 0 620
+FileDetails AddPointerEvent 100 EButton1Up 0 620
+//FileDetails EnablePointerEvents 6000
+allownextresult -28 // KErrBadName
+FileDetails ExecuteLDFromMedia "rtsp:\/\/vishnu.wipsl.com/StarWreck_256.3gp"
+pause 1000
+delete FileDetails
+sendtobackground
+[Endtest]
+
+[Test]
+title 3: DetailsDialog - ExecuteLDFromDetails
+bringtoforeground
+create ui_FileDetailsDialogtest FileDetails
+FileDetails CreateNewDialog
+FileDetails CreateNewFileDetails american_wedding.ram
+FileDetails AddPointerEvent 100 EButton1Down 0 620
+FileDetails AddPointerEvent 100 EButton1Up 0 620
+//FileDetails EnablePointerEvents 6000
+FileDetails ExecuteLDFromDetails
+pause 1000
+delete FileDetails
+sendtobackground
+[Endtest]
+
+[Test]
+title 4: DetailsDialog - ExecuteLDFromDetails, NULL details
+bringtoforeground
+create ui_FileDetailsDialogtest FileDetails
+FileDetails CreateNewDialog
+FileDetails CreateNewFileDetails american_wedding.ram
+FileDetails AddPointerEvent 100 EButton1Down 0 620
+FileDetails AddPointerEvent 100 EButton1Up 0 620
+//FileDetails EnablePointerEvents 6000
+FileDetails ExecuteLDFromDetails
+pause 1000
+delete FileDetails
+sendtobackground
+[Endtest]
+
+[Test]
+title 10-1: FileDetails - Create and Delete
+create ui_FileDetailsDialogtest FileDetails
+FileDetails CreateNewFileDetails beer440503.wmv
+delete FileDetails
+pause 1000
+[Endtest]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/video_player_file_details_dialog_api/tsrc/custom/postrun_custom.xml	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,64 @@
+<step name="Fetch Test module Report" harness="STIF" enabled="true" passrate="100" significant="false">
+       <command>fetch-log</command>
+       <params>
+	    <param type="text"/>
+	    <param delete="true"/>
+	    <param path="C:\Logs\TestFramework\*"/>
+       </params>
+</step>
+<step name="Fetch Fusion logs" harness="STIF" enabled="true" passrate="100" significant="false">
+       <command>fetch-log</command>
+       <params>
+	    <param type="text"/>
+	    <param delete="true"/>
+	    <param path="c:\logs\Fusion\*"/>
+       </params>
+</step>
+<step name="Fetch Livetv logs" harness="STIF" enabled="true" passrate="100" significant="false">
+       <command>fetch-log</command>
+       <params>
+	    <param type="text"/>
+	    <param delete="true"/>
+	    <param path="c:\logs\Livetv\*"/>
+       </params>
+</step>
+<step name="Fetch IPTV logs" harness="STIF" enabled="true" passrate="100" significant="false">
+       <command>fetch-log</command>
+       <params>
+	    <param type="text"/>
+	    <param delete="true"/>
+	    <param path="c:\logs\iptv\*"/>
+       </params>
+</step>
+<step name="Fetch verify files" harness="STIF" enabled="true" passrate="100" significant="false">
+       <command>fetch-log</command>
+       <params>
+	    <param type="text"/>
+	    <param delete="true"/>
+	    <param path="c:\testing\data\verifynew\*"/>
+       </params>
+</step>
+<step name="Fetch TestScripter logs" harness="STIF" enabled="true" passrate="100" significant="false">
+       <command>fetch-log</command>
+       <params>
+	    <param type="text"/>
+	    <param delete="true"/>
+	    <param path="C:\Logs\TestFramework\TestScripter\*"/>
+       </params>
+</step>
+<step name="Fetch Testengine logs" harness="STIF" enabled="true" passrate="100" significant="false">
+       <command>fetch-log</command>
+       <params>
+	    <param type="text"/>
+	    <param delete="true"/>
+	    <param path="C:\Logs\TestFramework\Testengine\*"/>
+       </params>
+</step>
+<step name="Fetch Testserver logs" harness="STIF" enabled="true" passrate="100" significant="false">
+       <command>fetch-log</command>
+       <params>
+	    <param type="text"/>
+	    <param delete="true"/>
+	    <param path="C:\Logs\TestFramework\Testserver\*"/>
+       </params>
+</step>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/video_player_file_details_dialog_api/tsrc/custom/prerun_custom.xml	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,54 @@
+<step name="Create log directory for testmodule" harness="STIF" enabled="true" passrate="100" significant="false">
+    	<command>makedir</command>
+    	<params>
+        <param dir="c:\logs\testframework"/>
+    	</params>
+</step>
+<step name="Create log directory for fusion" harness="STIF" enabled="true" passrate="100" significant="false">
+    	<command>makedir</command>
+    	<params>
+        <param dir="c:\logs\Fusion"/>
+    	</params>
+</step>
+<step name="Create log directory for livetv" harness="STIF" enabled="true" passrate="100" significant="false">
+    	<command>makedir</command>
+    	<params>
+        <param dir="c:\logs\Livetv"/>
+    	</params>
+</step>
+<step name="Create log directory for iptv" harness="STIF" enabled="true" passrate="100" significant="false">
+    	<command>makedir</command>
+    	<params>
+        <param dir="c:\logs\iptv"/>
+    	</params>
+</step>
+<step name="Create directory for verify files" harness="STIF" enabled="true" passrate="100" significant="false">
+    	<command>makedir</command>
+    	<params>
+        <param dir="c:\testing\data\verifyzip"/>
+    	</params>
+</step>
+<step name="Create directory for verify files" harness="STIF" enabled="true" passrate="100" significant="false">
+    	<command>makedir</command>
+    	<params>
+        <param dir="c:\testing\data\verifynew"/>
+    	</params>
+</step>
+<step name="Create directory for TestScripter logs" harness="STIF" enabled="true" passrate="100" significant="false">
+    	<command>makedir</command>
+    	<params>
+        <param dir="c:\logs\testframework\TestScripter"/>
+    	</params>
+</step>
+<step name="Create directory for Testengine logs" harness="STIF" enabled="true" passrate="100" significant="false">
+    	<command>makedir</command>
+    	<params>
+        <param dir="c:\logs\testframework\Testengine"/>
+    	</params>
+</step>
+<step name="Create directory for Testserver logs" harness="STIF" enabled="true" passrate="100" significant="false">
+    	<command>makedir</command>
+    	<params>
+        <param dir="c:\logs\testframework\Testserver"/>
+    	</params>
+</step>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/video_player_file_details_dialog_api/tsrc/data/mmc/RAM-1kB.ram	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,1 @@
+rtsp://nokia.com
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/video_player_file_details_dialog_api/tsrc/data/mmc/american_wedding.ram	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,2 @@
+rtsp://195.255.249.80/funkyvideo/american_wedding.3gp
+rtsp://195.255.249.80/funkyvideo/2_fast_2_furious-1.rm
Binary file videoplayer_plat/video_player_file_details_dialog_api/tsrc/data/mmc/beer440503.wmv has changed
Binary file videoplayer_plat/video_player_file_details_dialog_api/tsrc/data/mmc/mpxtest1.mp3 has changed
Binary file videoplayer_plat/video_player_file_details_dialog_api/tsrc/data/mmc/video_18kb.3gp has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/video_player_file_details_dialog_api/tsrc/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2002 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:   STIF for filedetailsdialog*
+*/
+
+
+// Version : %version: 4 %
+
+PRJ_PLATFORMS
+
+DEFAULT
+
+PRJ_TESTEXPORTS
+../conf/ui_FileDetailsDialogtest.cfg              /epoc32/winscw/c/testframework/ui_FileDetailsDialogtest.cfg
+../data/mmc/mpxtest1.mp3                          /epoc32/winscw/c/testing/data/mpxtest1.mp3
+../data/mmc/american_wedding.ram                  /epoc32/winscw/c/testing/data/american_wedding.ram
+../data/mmc/RAM-1kB.ram                           /epoc32/winscw/c/testing/data/RAM-1kB.ram
+../data/mmc/beer440503.wmv                        /epoc32/winscw/c/testing/data/beer440503.wmv
+../data/mmc/video_18kb.3gp                        /epoc32/winscw/c/testing/data/video_18kb.3gp
+
+PRJ_EXPORTS
+
+PRJ_TESTMMPFILES
+ui_FileDetailsDialogtest.mmp
+
+PRJ_MMPFILES
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/video_player_file_details_dialog_api/tsrc/group/ui_FileDetailsDialogtest.mmp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,97 @@
+/*
+* 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:   STIF for filedetailsdialog*
+*/
+
+
+// Version : %version: 9 %
+
+
+
+#if defined(__S60_)
+// To get the OS_LAYER_SYSTEMINCLUDE-definition
+#include <platform_paths.hrh>
+#endif
+
+TARGET          ui_filedetailsdialogtest.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E3
+
+CAPABILITY      ALL -TCB
+/* Remove comments and replace 0x00000000 with correct vendor id */
+// VENDORID     0x00000000
+/* Remove comments and replace 0x00000000 with correct secure id */
+// SECUREID     0x00000000
+
+//TARGETPATH      ?target_path
+DEFFILE         ui_FileDetailsDialogtest.def
+
+USERINCLUDE     ../inc
+USERINCLUDE     ../../../../tsrc/VCXTestCommon/inc
+
+APP_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH      ../src
+SOURCE          ui_FileDetailsDialogtest.cpp
+SOURCE          ui_FileDetailsDialogtestBlocks.cpp 
+SOURCE          EdwinTestControl.cpp 
+SOURCE          VCXTestTimer.cpp 
+SOURCE          VcxTestControlEventQueue.cpp
+
+LIBRARY         euser.lib
+LIBRARY         stiftestinterface.lib
+LIBRARY         stiftestengine.lib 
+LIBRARY         mpfiledetailsdialog.lib 
+LIBRARY         avkon.lib
+LIBRARY         cone.lib 
+LIBRARY         ws32.lib 
+LIBRARY         eikcoctl.lib 
+LIBRARY         eikctl.lib 
+LIBRARY         bafl.lib 
+LIBRARY         apgrfx.lib 
+LIBRARY         aknskins.lib 
+LIBRARY         aknskinsrv.lib 
+LIBRARY         aknswallpaperutils.lib 
+LIBRARY         eikcore.lib
+LIBRARY         centralrepository.lib
+LIBRARY         hwrmlightclient.lib 
+LIBRARY         flogger.lib
+
+LANG            SC
+
+/*
+START WINS      
+?wins_specific_information
+END
+
+START MARM
+?marm_specific_information
+END
+*/
+// Other possible keywords:
+ 
+// DOCUMENT     ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes)
+/*
+START BITMAP ?target
+TARGETPATH   ?emulated_path_on_target_machine
+HEADER
+SOURCE       ?color_depth ?source_bitmap
+END
+*/
+// DEFFILE ?filename
+// AIF ?filename
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/video_player_file_details_dialog_api/tsrc/group/ui_FileDetailsDialogtest.pkg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,61 @@
+;
+; 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 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:  Package file for file details dialog API STIF tests;
+
+; Languages
+&EN
+
+; Package header
+#{"MPFiledetailsdialogTest"},(0x101F7961),0,0,0
+
+; Localised Vendor name
+%{"Nokia EN"}
+
+; Unique Vendor name
+:"Nokia"
+
+; Logo
+; None
+
+; Package signature - Optional
+; None
+
+; Start of Package body
+
+; Condition blocks
+; None
+
+; Options list
+; None
+
+; Install files
+  "\epoc32\release\armv5\udeb\ui_FileDetailsDialogtest.dll"   -   "!:\Sys\Bin\ui_FileDetailsDialogtest.dll"
+  "..\conf\ui_FileDetailsDialogtest.cfg"                      -   "c:\TestFramework\ui_FileDetailsDialogtest.cfg"
+  "..\init\TestFramework.ini"                                 -   "c:\TestFramework\TestFramework.ini"
+  "..\data\mmc\mpxtest1.mp3"                                  -   "e:\testing\data\mpxtest1.mp3"
+  "..\data\mmc\american_wedding.ram"                          -   "e:\testing\data\american_wedding.ram"
+  "..\data\mmc\RAM-1kB.ram"                                   -   "e:\testing\data\RAM-1kB.ram"
+  "..\data\mmc\beer440503.wmv"                                -   "e:\testing\data\beer440503.wmv"
+  "..\data\mmc\video_18kb.3gp"                                -   "e:\testing\data\video_18kb.3gp"
+  
+; Embedded SIS
+; None
+
+; End of Package body
+
+; PKG dependencies
+; None
+
+; PKG capabilities
+; None
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/video_player_file_details_dialog_api/tsrc/inc/EdwinTestControl.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,52 @@
+/*
+* 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:   STIF for filedetailsdialog*
+*/
+
+
+// Version : %version: 2 %
+
+
+
+#ifndef EDWINTESTCONTROL_H_
+#define EDWINTESTCONTROL_H_
+
+#include <eikedwin.h>
+
+class CAknsBasicBackgroundControlContext;
+
+class CEdwinTestControl : public CCoeControl, public MCoeControlObserver
+    {
+public:
+	static CEdwinTestControl* NewL(void);
+	virtual ~CEdwinTestControl();
+protected:
+	TTypeUid::Ptr MopSupplyObject(TTypeUid aId); // 
+private:
+	virtual void SizeChanged();
+	virtual void HandleResourceChange(TInt aType);
+	virtual TInt CountComponentControls() const;
+	virtual CCoeControl* ComponentControl(TInt aIndex) const;
+    void ConstructL(void);
+	void Draw(const TRect& aRect) const;
+	
+	void HandleControlEventL( CCoeControl* aControl, TCoeEvent aEventType);
+	TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType );	
+private:
+	CAknsBasicBackgroundControlContext*	iBgContext; 
+	CEikEdwin* iEditWin;
+};
+
+
+#endif /*EDWINTESTCONTROL_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/video_player_file_details_dialog_api/tsrc/inc/VcxTestControlEventQueue.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,149 @@
+/*
+* 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 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:  STIF testclass declaration*
+*/
+
+
+#ifndef VCXTESTCONTROLEVENTQUEUE_H
+#define VCXTESTCONTROLEVENTQUEUE_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <w32std.h>
+#include <e32keys.h>
+#include <e32event.h>
+#include "VcxTestTimer.h"
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+class CStifLogger;
+
+// CLASS DECLARATION
+
+class CVcxTestControlEvent
+    {
+    public: // New functions
+        
+        /**
+         * Two-phased constructor.
+         * @param aDelay delay before next event
+         * @param aType type of pointer event
+         * @param aPos position of event
+         */
+        static CVcxTestControlEvent* NewL();
+    
+        /**
+         * Destructor.
+         */
+        virtual ~CVcxTestControlEvent();
+   
+        /**
+         * C++ default constructor.
+         */
+        CVcxTestControlEvent();
+    
+        /**
+         * By default Symbian 2nd phase constructor is private.
+         */
+        void ConstructL();
+        
+        /**
+         * Sets this object as a pointer event. 
+         */
+        void SetPointerEvent( TInt aDelay, TPointerEvent::TType aType, TPoint aPos );
+        
+        /**
+         * Sets this object as a key event. 
+         */
+        void SetKeyEvent( TInt aDelay, TStdScanCode aKeyCode, TRawEvent::TType aType );
+        
+        TPoint Position() { return iPosition; }
+        
+        TPointerEvent::TType PointerEventType() { return iPointerEventType; }
+        
+        TInt Delay() { return iDelay; }
+        
+        TStdScanCode KeyCode() { return iKeyCode; }
+        
+        TRawEvent::TType KeyEventType() { return iKeyEventType; }
+        
+    private: // Data
+        
+        // If keycode is EStdKeyNull then this is a pointer event.
+        TStdScanCode iKeyCode;
+        TRawEvent::TType iKeyEventType;
+        
+        TPointerEvent::TType iPointerEventType;
+        TPoint iPosition;
+        
+        TInt iDelay;
+    };
+
+class CVcxTestControlEventQueue : public CBase, 
+                                  public MVcxTestTimerObserver
+    {
+    public: // Constructors and destructor
+    
+        /**
+         * Two-phased constructor.
+         */
+        static CVcxTestControlEventQueue* NewL( CStifLogger* aLog );
+    
+        /**
+         * Destructor.
+         */
+        virtual ~CVcxTestControlEventQueue();
+    
+    private: // New functions
+    
+        /**
+         * C++ default constructor.
+         */
+        CVcxTestControlEventQueue();
+    
+        /**
+         * By default Symbian 2nd phase constructor is private.
+         */
+        void ConstructL( CStifLogger* aLog );
+
+        void TapOnScreen( TPointerEvent::TType aType, TPoint aPosition );
+        
+        void SendKeyEvent( TStdScanCode aKeyCode, TRawEvent::TType aType );
+    
+    public: // New functions
+        
+        void EnableControlEvents( TInt aDelay );
+        
+        void DisableControlEvents();
+        
+        void AddControlEvent( CVcxTestControlEvent* aEvent );
+        
+        void ResetControlEvents();
+        
+    public: // Functions from base classes
+        
+        /**
+         * From MVcxTestTimerObserver.
+         */
+        void TimerComplete( TInt aTimerId, TInt aError );
+    
+    private: // Data
+        CVcxTestTimer* iTimer;
+        RWsSession iWsSession;
+        RPointerArray<CVcxTestControlEvent> iEvents;
+        CStifLogger* iLog;
+    };
+
+#endif /* VCXTESTCONTROLEVENTQUEUE_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/video_player_file_details_dialog_api/tsrc/inc/VcxTestTimer.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,99 @@
+/*
+* 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 VCXTESTTIMER_H
+#define VCXTESTTIMER_H
+
+//  INCLUDES
+#include <e32base.h>
+
+// CONSTANTS
+
+// MACROS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+class MVcxTestTimerObserver;
+
+// CLASS DECLARATION
+
+
+/**
+* MVcxTestTimerObserver
+*  @since
+*/
+class MVcxTestTimerObserver
+    {
+    public:
+		virtual void TimerComplete(TInt aTimerId, TInt aError) = 0;
+
+    };
+
+/**
+* CVcxTestTimer
+*  @since
+*/
+class CVcxTestTimer : public CActive
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CVcxTestTimer* NewL( MVcxTestTimerObserver& aObserver, TInt aId );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CVcxTestTimer();
+
+    public: // New functions
+		void After(TTimeIntervalMicroSeconds32 aInterval);
+		void CancelTimer( );
+
+    protected: //from base classes
+	    void RunL();
+	    void DoCancel();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CVcxTestTimer(MVcxTestTimerObserver& aObserver, TInt aId);
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+    private:    // Data
+	    RTimer iTimer;
+	    MVcxTestTimerObserver& iObserver;
+	    TBool iIsRunning;
+	    TInt  iId;
+	    TBool iRestartAfterCancel;
+	    TTimeIntervalMicroSeconds32 iInterval;
+    };
+
+#endif      // VCXTESTTIMER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/video_player_file_details_dialog_api/tsrc/inc/ui_FileDetailsDialogtest.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,211 @@
+/*
+* Copyright (c) 2002 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:   STIF for filedetailsdialog*
+*/
+
+
+// Version : %version: 8 %
+
+#ifndef UI_FILEDETAILSDIALOGTEST_H
+#define UI_FILEDETAILSDIALOGTEST_H
+
+//  INCLUDES
+#include <StifLogger.h>
+#include <TestScripterInternal.h>
+#include <StifTestModule.h>
+#include <TestclassAssert.h>
+#include <MPFileDetails.h>
+#include <MPFileDetailsDialog.h>
+#include "VcxTestControlEventQueue.h"
+#include <HWRMLight.h>
+#include "VcxTestTimer.h"
+
+// CONSTANTS
+
+// MACROS
+#define TEST_CLASS_VERSION_MAJOR 0
+#define TEST_CLASS_VERSION_MINOR 0
+#define TEST_CLASS_VERSION_BUILD 0
+
+// Logging path
+
+#ifdef __WINSCW__
+// Logging path
+_LIT( Kui_FileDetailsDialogtestLogPath, "C:\\logs\\testframework\\ui_FileDetailsDialogtest\\" ); 
+// Log file
+_LIT( Kui_FileDetailsDialogtestLogFile, "ui_FileDetailsDialogtest.txt" ); 
+_LIT( Kui_FileDetailsDialogtestLogFileWithTitle, "ui_FileDetailsDialogtest_[%S].txt" );
+_LIT( Kui_FileDetailsDialogtest_testPath, "C:\\testing\\data\\" );
+_LIT( Kui_FileDetailsDialogtest_videoTestPath, "C:\\testing\\data\\video_18kb.3gp" );
+_LIT( Kui_FileDetailsDialogtest_videoPath, "C:\\data\\Videos\\" );
+#else
+_LIT( Kui_FileDetailsDialogtestLogPath, "C:\\logs\\testframework\\ui_FileDetailsDialogtest\\" ); 
+// Log file
+_LIT( Kui_FileDetailsDialogtestLogFile, "ui_FileDetailsDialogtest.txt" ); 
+_LIT( Kui_FileDetailsDialogtestLogFileWithTitle, "ui_FileDetailsDialogtest_[%S].txt" );
+_LIT( Kui_FileDetailsDialogtest_testPath, "E:\\testing\\data\\" );
+_LIT( Kui_FileDetailsDialogtest_videoTestPath, "E:\\testing\\data\\video_18kb.3gp" );
+_LIT( Kui_FileDetailsDialogtest_videoPath, "E:\\data\\Videos\\" );
+#endif
+
+// FORWARD DECLARATIONS
+class Cui_FileDetailsDialogtest;
+class CMPFileDetailsDialog;
+class CMPFileDetails;
+class CCoeControl;
+
+// DATA TYPES
+// Used to map the keys in e32keys.h to values used in STIF script. 
+enum TFileDetailsTestKeyCodeMap
+    {
+    TFileDetailsTestKeyCode_EKeyDevice0,
+    TFileDetailsTestKeyCode_EKeyDevice1
+    };
+
+// CLASS DECLARATION
+
+/**
+*  Cui_FileDetailsDialogtest test class for STIF Test Framework TestScripter.
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+NONSHARABLE_CLASS(Cui_FileDetailsDialogtest) : public CScriptBase,
+                                               public MHWRMLightObserver,
+                                               public MVcxTestTimerObserver
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static Cui_FileDetailsDialogtest* NewL( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * Destructor.
+        */
+        virtual ~Cui_FileDetailsDialogtest();
+
+    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 );
+        
+        virtual void LightStatusChanged(TInt aTarget, 
+                                        CHWRMLight::TLightStatus aStatus);        
+        
+        /**
+         * From MVcxTestTimerObserver.
+         */
+        void TimerComplete( TInt aTimerId, TInt aError );
+        
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        Cui_FileDetailsDialogtest( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        /**
+        * Frees all resources allocated from test methods.
+        * @since ?Series60_version
+        */
+        void Delete();
+
+        /**
+        * Test methods are listed below. 
+        */
+
+        //Test methods for the header "MPFileDetailsDialog.h"
+        TInt CreateNewDialog( CStifItemParser& aItem );
+        TInt ExecuteLDFromMedia( CStifItemParser& aItem );
+        TInt ExecuteLDFromDetails( CStifItemParser& aItem );
+        
+        //Test methods for the header "MPFileDetails.h"
+        TInt CreateNewFileDetails( CStifItemParser& aItem );
+        
+        // Test Methods for pointer events
+        
+        /**
+         * Adds pointer event to queue.
+         * @param delay milliseconds before next event is run. 
+         * @param TPointerEvent::TType
+         * @param X position
+         * @param Y position
+         */
+        virtual TInt AddPointerEventL( CStifItemParser& aItem );
+        
+        /**
+         * Adds key event to queue.
+         * @param delay milliseconds before next event is run. 
+         * @param TKeyCode
+         * @param TEventCode
+         */
+        virtual TInt AddKeyEventL( CStifItemParser& aItem );        
+        
+        /**
+         * Enables the running of pointer events.
+         * @param aDelay milliseconds before events start.
+         */
+        virtual TInt EnableControlEvents( CStifItemParser& aItem );
+        
+        /**
+         * Disables the running of pointer events.
+         */        
+        virtual TInt DisableControlEvents( CStifItemParser& aItem );
+        
+        /**
+         * Resets pointer events.
+         */
+        virtual TInt ResetControlEvents( CStifItemParser& aItem );
+        
+        /**
+         * Method used to log version of test class
+         */
+        void SendTestClassVersion();
+
+        //ADD NEW METHOD DEC HERE
+        //[TestMethods] - Do not remove
+
+    private: // New methods
+        
+    private:    // Data
+        
+    	CMPFileDetailsDialog* iMPFileDetailsDialog;
+    	CMPFileDetails* iMPFileDetails;
+    	CCoeControl* iEdwinTestControl;
+    	CVcxTestControlEventQueue* iControlEventQueue;
+    	TBool iControlEventsEnabled;
+    	
+    	CHWRMLight* iHwLight;
+    	CHWRMLight::TLightTarget iTarget;
+    	
+    	CVcxTestTimer* iTimer;
+    	TInt iError;
+    };
+
+#endif      // UI_FILEDETAILSDIALOGTEST_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/video_player_file_details_dialog_api/tsrc/init/TestFramework.ini	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,165 @@
+#
+# This is STIFTestFramework 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.
+
+[Engine_Defaults]
+
+TestReportMode= FullReport    # Possible values are: 
+                              # 'Summary', 'Environment', 'TestCases' or 'FullReport'
+
+CreateTestReport= YES         # Possible values: YES or NO
+
+TestReportFilePath= C:\Logs\Fusion\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT         # Possible values: TXT or HTML
+TestReportOutput= FILE        # Possible values: FILE or RDEBUG
+TestReportFileCreationMode= APPEND # Possible values: OVERWRITE or APPEND
+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\ui_FileDetailsDialogtest.cfg
+[End_Module]
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework 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)'#' 
+
+CreateLogDirectories= YES    # Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML         # Possible values: TXT or HTML
+#EmulatorOutput= FILE         # Possible values: FILE or RDEBUG
+
+#HardwareBasePath=  C:\
+#HardwareFormat= TXT			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+FileCreationMode= APPEND  # 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
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/video_player_file_details_dialog_api/tsrc/init/manual/TestFramework.ini	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,165 @@
+#
+# This is STIFTestFramework 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.
+
+[Engine_Defaults]
+
+TestReportMode= FullReport    # Possible values are: 
+                              # 'Summary', 'Environment', 'TestCases' or 'FullReport'
+
+CreateTestReport= YES         # Possible values: YES or NO
+
+TestReportFilePath= C:\Logs\Fusion\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT         # Possible values: TXT or HTML
+TestReportOutput= FILE        # Possible values: FILE or RDEBUG
+TestReportFileCreationMode= APPEND # Possible values: OVERWRITE or APPEND
+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\ui_FileDetailsDialogtestManual.cfg
+[End_Module]
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework 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)'#' 
+
+CreateLogDirectories= YES    # Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML         # Possible values: TXT or HTML
+#EmulatorOutput= FILE         # Possible values: FILE or RDEBUG
+
+#HardwareBasePath=  C:\
+#HardwareFormat= TXT			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+FileCreationMode= APPEND  # 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
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/video_player_file_details_dialog_api/tsrc/src/EdwinTestControl.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,148 @@
+/*
+* 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:   STIF for filedetailsdialog*
+*/
+
+
+// Version : %version: 3 %
+
+
+#include "EdwinTestControl.h"
+#include <eikenv.h>
+#include <aknsutils.h> 
+#include <aknsdrawutils.h> 
+#include <aknutils.h> 
+#include <aknsbasicbackgroundcontrolcontext.h>
+
+CEdwinTestControl::~CEdwinTestControl()
+    {
+    delete iEditWin;
+    iEditWin = NULL;
+    delete iBgContext;
+    iBgContext = NULL;
+    }
+
+CEdwinTestControl* CEdwinTestControl::NewL(void)
+    {
+    CEdwinTestControl* self = new (ELeave) CEdwinTestControl();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+void CEdwinTestControl::ConstructL()
+    {
+    CreateWindowL();
+
+    iEditWin = new (ELeave) CEikEdwin();
+    iEditWin->ConstructL(0, 100, 100, 1);
+    iEditWin->SetContainerWindowL(*this);
+    iEditWin->CreateTextViewL();
+    //    iEditWin->SetInputCapabilitiesL( TCoeInputCapabilities::EAllText );
+
+    // make first with no size at all
+    iBgContext = CAknsBasicBackgroundControlContext::NewL(
+            KAknsIIDQsnBgScreen, TRect(0, 0, 1, 1), ETrue);
+    // Setting rect will cause SizeChanged to be called
+    // and iBgContext size & position is updated accordingly.
+    SetRect(CEikonEnv::Static()->EikAppUi()->ClientRect());
+
+    ActivateL();
+    DrawNow();
+    }
+
+void CEdwinTestControl::SizeChanged()
+    {
+    if (iBgContext)
+        {
+        iBgContext->SetRect(Rect());
+
+        if (&Window())
+            {
+            iBgContext->SetParentPos(PositionRelativeToScreen());
+            }
+        }
+    if (iEditWin)
+        {
+        iEditWin->SetRect(Rect());
+        }
+    }
+
+void CEdwinTestControl::HandleResourceChange(TInt aType)
+    {
+    TRect rect;
+
+    if (aType == KEikDynamicLayoutVariantSwitch)
+        {
+        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, rect);
+        SetRect(rect);
+        }
+
+    CCoeControl::HandleResourceChange(aType);
+    }
+
+TTypeUid::Ptr CEdwinTestControl::MopSupplyObject(TTypeUid aId)
+    {
+    if (iBgContext)
+        {
+        return MAknsControlContext::SupplyMopObject(aId, iBgContext);
+        }
+
+    return CCoeControl::MopSupplyObject(aId);
+    }
+
+void CEdwinTestControl::Draw(const TRect& aRect) const
+    {
+    CWindowGc& gc = SystemGc();
+
+    // draw background skin first.
+    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+    AknsDrawUtils::Background(skin, iBgContext, this, gc, aRect);
+    }
+
+TInt CEdwinTestControl::CountComponentControls() const
+    {
+    return 1;
+    }
+
+CCoeControl* CEdwinTestControl::ComponentControl(TInt aIndex) const
+    {
+    switch (aIndex)
+        {
+        case 0:
+            return iEditWin;
+        default:
+            return 0;
+        }
+    }
+
+void CEdwinTestControl::HandleControlEventL(CCoeControl* /*aControl*/,
+        TCoeEvent /*aEventType*/)
+    {
+    // Add your control event handler code here
+    }
+
+TKeyResponse CEdwinTestControl::OfferKeyEventL(const TKeyEvent& aKeyEvent,
+        TEventCode aType)
+    {
+    if (iEditWin)
+        {
+        return iEditWin->OfferKeyEventL(aKeyEvent, aType);
+        }
+    else
+        {
+        return EKeyWasNotConsumed;
+        }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/video_player_file_details_dialog_api/tsrc/src/VcxTestControlEventQueue.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,260 @@
+/*
+* 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 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:  This file contains testclass implementation.*
+*/
+
+
+// [INCLUDE FILES]
+
+#include "VcxTestControlEventQueue.h"
+#include <STIFLogger.h>
+#include "VCXTestLog.h"
+#include <EIKENV.H>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// ----------------------------------------------------------------------------
+// CVcxTestControlEvent::NewL
+// ----------------------------------------------------------------------------
+//
+CVcxTestControlEvent* CVcxTestControlEvent::NewL()
+    {
+    CVcxTestControlEvent* self = new ( ELeave ) CVcxTestControlEvent();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxTestControlEvent::~CVcxTestControlEvent
+// ----------------------------------------------------------------------------
+//
+CVcxTestControlEvent::~CVcxTestControlEvent()
+    {
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxTestControlEvent::CVcxTestControlEvent
+// ----------------------------------------------------------------------------
+//
+CVcxTestControlEvent::CVcxTestControlEvent()
+    {
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxTestControlEvent::CVcxTestControlEvent
+// ----------------------------------------------------------------------------
+//
+void CVcxTestControlEvent::ConstructL()
+    {
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxTestControlEvent::CVcxTestControlEvent
+// ----------------------------------------------------------------------------
+//
+void CVcxTestControlEvent::SetPointerEvent( TInt aDelay, TPointerEvent::TType aType, TPoint aPos )
+    {
+    iKeyCode = EStdKeyNull;
+    iPointerEventType = aType;
+    iPosition = aPos;
+    iDelay = aDelay;
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxTestControlEvent::CVcxTestControlEvent
+// ----------------------------------------------------------------------------
+//
+void CVcxTestControlEvent::SetKeyEvent( TInt aDelay, TStdScanCode aKeyCode, TRawEvent::TType aType )
+    {
+    iDelay = aDelay;
+    iKeyCode = aKeyCode;
+    iKeyEventType = aType;
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxTestControlEventQueueQueue::NewL
+// ----------------------------------------------------------------------------
+//
+CVcxTestControlEventQueue* CVcxTestControlEventQueue::NewL( CStifLogger* aLog )
+    {
+    VCXLOGLO1(">>>CVcxTestControlEventQueue::NewL");
+    CVcxTestControlEventQueue* self = new ( ELeave ) CVcxTestControlEventQueue();
+    CleanupStack::PushL(self);
+    self->ConstructL( aLog );
+    CleanupStack::Pop(self);
+    VCXLOGLO1("<<<CVcxTestControlEventQueue::NewL");
+    return self;
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxTestControlEventQueue::~CVcxTestControlEventQueue
+// ----------------------------------------------------------------------------
+//
+CVcxTestControlEventQueue::~CVcxTestControlEventQueue()
+    {
+    VCXLOGLO1(">>>CVcxTestControlEventQueue::~CVcxTestControlEventQueue");
+    
+    delete iTimer;
+    iTimer = NULL;
+    
+    iWsSession.Close();
+    
+    iEvents.ResetAndDestroy();
+    VCXLOGLO1("<<<CVcxTestControlEventQueue::~CVcxTestControlEventQueue");
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxTestControlEventQueue::CVcxTestControlEventQueue
+// ----------------------------------------------------------------------------
+//
+CVcxTestControlEventQueue::CVcxTestControlEventQueue()
+    {
+
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxTestControlEventQueue::CVcxTestControlEventQueue
+// ----------------------------------------------------------------------------
+//
+void CVcxTestControlEventQueue::ConstructL( CStifLogger* aLog )
+    { 
+    VCXLOGLO1(">>>CVcxTestControlEventQueue::ConstructL");
+    iTimer = CVcxTestTimer::NewL( *this, 0 );
+    User::LeaveIfError( iWsSession.Connect() );
+    iLog = aLog;
+    VCXLOGLO1("<<<CVcxTestControlEventQueue::ConstructL");
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxTestControlEventQueue::EnableControlEvents
+// ----------------------------------------------------------------------------
+//
+void CVcxTestControlEventQueue::EnableControlEvents( TInt aDelay )
+    {
+    VCXLOGLO1(">>>CVcxTestControlEventQueue::EnableControlEvents");
+    iTimer->After( aDelay );
+    VCXLOGLO1("<<<CVcxTestControlEventQueue::EnableControlEvents");
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxTestControlEventQueue::DisableControlEvents
+// ----------------------------------------------------------------------------
+//
+void CVcxTestControlEventQueue::DisableControlEvents()
+    {
+    VCXLOGLO1(">>>CVcxTestControlEventQueue::DisableControlEvents");
+    iTimer->Cancel();
+    VCXLOGLO1("<<<CVcxTestControlEventQueue::DisableControlEvents");
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxTestControlEventQueue::AddControlEvent
+// ----------------------------------------------------------------------------
+//
+void CVcxTestControlEventQueue::AddControlEvent( CVcxTestControlEvent* aEvent )
+    {
+    VCXLOGLO1(">>>CVcxTestControlEventQueue::AddControlEvent");
+    iEvents.Append( aEvent );
+    VCXLOGLO1("<<<CVcxTestControlEventQueue::AddControlEvent");
+    }
+
+// ----------------------------------------------------------------------------
+// CVcxTestControlEventQueue::ResetControlEvents
+// ----------------------------------------------------------------------------
+//
+void CVcxTestControlEventQueue::ResetControlEvents()
+    {
+    VCXLOGLO1(">>>CVcxTestControlEventQueue::TimerComplete");
+    iEvents.ResetAndDestroy();
+    VCXLOGLO1("<<<CVcxTestControlEventQueue::TimerComplete");
+    }
+
+// -----------------------------------------------------------------------------
+//  CVcxTestControlEventQueue::TimerComplete
+// -----------------------------------------------------------------------------
+void CVcxTestControlEventQueue::TimerComplete( TInt aTimerId, TInt /* aError */ )
+    {
+    VCXLOGLO1(">>>CVcxTestControlEventQueue::TimerComplete");
+    if( aTimerId == 0 )
+        {
+        if( iEvents.Count() > 0 )
+            {
+            CVcxTestControlEvent* event = iEvents[0];
+            iEvents.Remove( 0 );
+
+            if( event->KeyCode() == EStdKeyNull )
+                {
+                TapOnScreen( event->PointerEventType(), event->Position() );
+                }
+            else
+                {
+                SendKeyEvent( event->KeyCode(), event->KeyEventType() );
+                }
+            
+            iTimer->After( event->Delay() );            
+            delete event;
+            }
+        }
+    VCXLOGLO1("<<<CVcxTestControlEventQueue::TimerComplete");
+    }
+
+// -------------------------------------------------------------------------------------------------
+// CVcxTestControlEventQueue::TapOnScreen
+// -------------------------------------------------------------------------------------------------
+void CVcxTestControlEventQueue::TapOnScreen( TPointerEvent::TType aType,
+        TPoint aPosition )
+    {
+    VCXLOGLO1(">>>CVcxTestControlEventQueue::TapOnScreen");
+    
+    TRawEvent pointer;
+    
+    VCXLOGLO4("CVcxTestControlEventQueue::X: %d Y: %d, type: %d", aPosition.iX, aPosition.iY, aType);
+    
+    if (aType == TPointerEvent::EButton1Down)
+        {
+        pointer.Set( TRawEvent::EButton1Down, aPosition.iX, aPosition.iY );
+
+        iWsSession.SimulateRawEvent( pointer );
+        iWsSession.Flush();
+        }
+    else
+        {
+        if (aType == TPointerEvent::EButton1Up)
+            {
+            pointer.Set( TRawEvent::EButton1Up, aPosition.iX, aPosition.iY );
+
+            iWsSession.SimulateRawEvent( pointer );
+            iWsSession.Flush();
+            }
+        }
+    
+    VCXLOGLO1("<<<CVcxTestControlEventQueue::TapOnScreen");
+    }
+
+// -------------------------------------------------------------------------------------------------
+// CVcxTestControlEventQueue::SendKeyEvent
+// -------------------------------------------------------------------------------------------------
+void CVcxTestControlEventQueue::SendKeyEvent( TStdScanCode aKeyCode, TRawEvent::TType aType )
+    {
+    VCXLOGLO1(">>>CVcxTestControlEventQueue::SendKeyEvent");
+    
+    TRawEvent rawEvent;
+    rawEvent.Set( aType, aKeyCode );
+    iWsSession.SimulateRawEvent( rawEvent );
+    iWsSession.Flush();
+    
+    VCXLOGLO1("<<<CVcxTestControlEventQueue::SendKeyEvent");
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/video_player_file_details_dialog_api/tsrc/src/VcxTestTimer.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,168 @@
+/*
+* 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 "VcxTestTimer.h"
+
+// EXTERNAL DATA STRUCTURES
+
+// EXTERNAL FUNCTION PROTOTYPES
+
+// CONSTANTS
+
+// MACROS
+
+// LOCAL CONSTANTS AND MACROS
+
+// MODULE DATA STRUCTURES
+
+// LOCAL FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CVcxTestTimer::
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CVcxTestTimer* CVcxTestTimer::NewL(MVcxTestTimerObserver& aObserver, TInt aId)
+    {
+    CVcxTestTimer* self = new (ELeave) CVcxTestTimer(aObserver, aId);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxTestTimer::~CVcxTestTimer
+// destructor
+// -----------------------------------------------------------------------------
+//
+CVcxTestTimer::~CVcxTestTimer()
+    {
+    iRestartAfterCancel = EFalse;
+    Cancel();
+    iTimer.Close();
+
+   	if( IsAdded() )
+        {
+        Deque(); // calls also Cancel()
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxTestTimer::~CVcxTestTimer
+// destructor
+// -----------------------------------------------------------------------------
+//
+void CVcxTestTimer::CancelTimer()
+    {
+    if( iIsRunning )
+    	{
+    	iRestartAfterCancel = EFalse;
+    	iIsRunning = EFalse;
+    	DoCancel( );
+    	}
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxTestTimer::CVcxTestTimer
+//
+// -----------------------------------------------------------------------------
+//
+CVcxTestTimer::CVcxTestTimer(MVcxTestTimerObserver& aObserver, TInt aId) : CActive(EPriorityStandard), iObserver(aObserver),
+	iIsRunning(EFalse), iId(aId)
+    {
+    CActiveScheduler::Add(this);
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxTestTimer::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+void CVcxTestTimer::ConstructL()
+    {
+    User::LeaveIfError(iTimer.CreateLocal());
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxTestTimer::After
+//
+// -----------------------------------------------------------------------------
+//
+void CVcxTestTimer::After(TTimeIntervalMicroSeconds32 aInterval)
+    {
+    iInterval = aInterval;
+
+    if( !IsActive() )
+    	{
+	    iTimer.After(iStatus, aInterval);
+	    iIsRunning = ETrue;
+	    SetActive();
+	    iRestartAfterCancel = EFalse;
+    	}
+	else
+		{
+		// Cancel and start again when cancel is done.
+    	CancelTimer();
+    	iRestartAfterCancel = ETrue;
+		}
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxTestTimer::RunL
+//
+// -----------------------------------------------------------------------------
+//
+void CVcxTestTimer::RunL()
+    {
+    TInt status = iStatus.Int();
+
+    if( iIsRunning )
+        {
+        iObserver.TimerComplete( iId, status );
+        }
+
+    if( status == KErrCancel && iRestartAfterCancel )
+        {
+        iRestartAfterCancel = EFalse;
+        iTimer.After( iStatus, iInterval );
+        iIsRunning = ETrue;
+        SetActive();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxTestTimer::DoCancel
+//
+// -----------------------------------------------------------------------------
+//
+void CVcxTestTimer::DoCancel()
+    {
+    iTimer.Cancel();
+    iIsRunning = EFalse;
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/video_player_file_details_dialog_api/tsrc/src/ui_FileDetailsDialogtest.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,154 @@
+/*
+* Copyright (c) 2002 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:   STIF for filedetailsdialog*
+*/
+
+
+// Version : %version: 4 %
+
+// INCLUDE FILES
+#include <Stiftestinterface.h>
+#include "ui_FileDetailsDialogtest.h"
+#include <SettingServerClient.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// Cui_FileDetailsDialogtest::Cui_FileDetailsDialogtest
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+Cui_FileDetailsDialogtest::Cui_FileDetailsDialogtest( 
+    CTestModuleIf& aTestModuleIf ):
+        CScriptBase( aTestModuleIf )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// Cui_FileDetailsDialogtest::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void Cui_FileDetailsDialogtest::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(Kui_FileDetailsDialogtestLogFileWithTitle, &title);
+        }
+    else
+        {
+        logFileName.Copy(Kui_FileDetailsDialogtestLogFile);
+        }
+
+    iLog = CStifLogger::NewL( Kui_FileDetailsDialogtestLogPath, 
+                          logFileName,
+                          CStifLogger::ETxt,
+                          CStifLogger::EFile,
+                          EFalse );
+    
+    iControlEventQueue = CVcxTestControlEventQueue::NewL( iLog );
+    
+    SendTestClassVersion();
+    }
+
+// -----------------------------------------------------------------------------
+// Cui_FileDetailsDialogtest::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+Cui_FileDetailsDialogtest* Cui_FileDetailsDialogtest::NewL( 
+    CTestModuleIf& aTestModuleIf )
+    {
+    Cui_FileDetailsDialogtest* self = new (ELeave) Cui_FileDetailsDialogtest( aTestModuleIf );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+// Destructor
+Cui_FileDetailsDialogtest::~Cui_FileDetailsDialogtest()
+    { 
+    // Delete resources allocated from test methods
+    Delete();
+
+    // Delete logger
+    delete iLog; 
+
+    delete iControlEventQueue;
+    iControlEventQueue = NULL;
+    }
+
+//-----------------------------------------------------------------------------
+// Cui_FileDetailsDialogtest::SendTestClassVersion
+// Method used to send version of test class
+//-----------------------------------------------------------------------------
+//
+void Cui_FileDetailsDialogtest::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("ui_FileDetailsDialogtest.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 ) // Backpointer to STIF Test Framework
+    {
+
+    return ( CScriptBase* ) Cui_FileDetailsDialogtest::NewL( aTestModuleIf );
+
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/video_player_file_details_dialog_api/tsrc/src/ui_FileDetailsDialogtestBlocks.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,467 @@
+/*
+* Copyright (c) 2002 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:   STIF for filedetailsdialog*
+*/
+
+
+// Version : %version: 9 %
+
+// [INCLUDE FILES] - do not remove
+#include <e32svr.h>
+#include <StifParser.h>
+#include <Stiftestinterface.h>
+#include "ui_FileDetailsDialogtest.h"
+#include <coeaui.h>
+#include "EdwinTestControl.h"
+#include <EIKENV.H>
+#include <e32des16.h>
+#include "VCXTestLog.h"
+#include <ScreenSaverInternalPSKeys.h>
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// Cui_FileDetailsDialogtest::Delete
+// Delete here all resources allocated and opened from test methods. 
+// Called from destructor. 
+// -----------------------------------------------------------------------------
+//
+void Cui_FileDetailsDialogtest::Delete()
+    {
+    VCXLOGLO1(">>>Cui_FileDetailsDialogtest::Delete");
+    
+    VCXLOGLO1("Cui_FileDetailsDialogtest:: delete hwlight");
+    delete iHwLight;
+    iHwLight = NULL;
+    
+    VCXLOGLO1("Cui_FileDetailsDialogtest:: delete testcontrol");
+    
+    if( iEdwinTestControl )
+        {
+        CCoeEnv::Static()->AppUi()->RemoveFromStack( iEdwinTestControl );    
+        delete iEdwinTestControl;
+        iEdwinTestControl = NULL;
+        }
+
+    delete iMPFileDetails;
+    iMPFileDetails = NULL;
+    
+    VCXLOGLO1("Cui_FileDetailsDialogtest:: delete queue");
+    delete iControlEventQueue;
+    iControlEventQueue = NULL;
+    
+    delete iTimer;
+    iTimer = NULL;
+    
+    VCXLOGLO1("<<<Cui_FileDetailsDialogtest::Delete");
+    }
+
+// -----------------------------------------------------------------------------
+// Cui_FileDetailsDialogtest::RunMethodL
+// Run specified method. Contains also table of test mothods and their names.
+// -----------------------------------------------------------------------------
+//
+TInt Cui_FileDetailsDialogtest::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. 
+
+            // [test cases entries] - Do not remove
+            // test cases for the header "MPFileDetailsDialog.h"
+            ENTRY( "CreateNewDialog", Cui_FileDetailsDialogtest::CreateNewDialog ),
+            ENTRY( "ExecuteLDFromMedia", Cui_FileDetailsDialogtest::ExecuteLDFromMedia ),
+            ENTRY( "ExecuteLDFromDetails", Cui_FileDetailsDialogtest::ExecuteLDFromDetails ),
+            // test cases for the header "MPFileDetails.h"
+            ENTRY( "CreateNewFileDetails", Cui_FileDetailsDialogtest::CreateNewFileDetails ),
+            
+            // Test methods for pointer events.
+            ENTRY( "AddPointerEvent", Cui_FileDetailsDialogtest::AddPointerEventL ),
+            ENTRY( "AddKeyEvent", Cui_FileDetailsDialogtest::AddKeyEventL ),
+            ENTRY( "EnableControlEvents", Cui_FileDetailsDialogtest::EnableControlEvents ),
+            ENTRY( "DisableControlEvents", Cui_FileDetailsDialogtest::DisableControlEvents ),
+            ENTRY( "ResetControlEvents", Cui_FileDetailsDialogtest::ResetControlEvents ),
+            };
+
+const TInt count = sizeof( KFunctions ) /
+sizeof( TStifFunctionInfo );
+
+return RunInternalL( KFunctions, count, aItem );
+}
+
+// ---------------------------------------------------------------------------
+// Cui_FileDetailsDialogtest::CreateNewDialog
+// ---------------------------------------------------------------------------
+//
+TInt Cui_FileDetailsDialogtest::CreateNewDialog(CStifItemParser& /*aItem*/)
+    {
+    VCXLOGLO1(">>>Cui_FileDetailsDialogtest::CreateNewDialog");
+        
+    CRepository* cenRep( NULL );
+    TRAPD( err, cenRep = CRepository::NewL( KPSUidScreenSaver ) );
+    if( err == KErrNone && cenRep )
+        {
+        err = cenRep->Set( KScreenSaverAllowScreenSaver, 1 );
+        if( err != KErrNone )
+            {
+            VCXLOGLO2("Cui_FileDetailsDialogtest:: cenrep set for KScreenSaverAllowScreenSaver failed: %d", err);
+            }
+        }
+    else
+        {
+        VCXLOGLO2("Cui_FileDetailsDialogtest:: CRepository::NewL( KPSUidScreenSaver ) failed: %d", err);
+        }
+    
+    if ( !iHwLight )
+        {
+        TRAP( err, iHwLight = CHWRMLight::NewL( this ) );
+        }
+
+    if ( err == KErrNone && iHwLight )
+        {
+        iTarget = CHWRMLight::EPrimaryDisplay;
+
+        // KErrNotReady is get from ReserveLightL, if the application is currently
+        // on the background.
+        TRAP( err, iHwLight->ReserveLightL( iTarget );
+            iHwLight->LightOnL( iTarget ) );
+        if ( err != KErrNone )
+            {
+            VCXLOGLO2("Cui_FileDetailsDialogtest:: Light activation for CHWRMLight failed: %d", err);
+            }
+        }
+    else
+        {
+        VCXLOGLO2("Cui_FileDetailsDialogtest:: CHWRMLight::NewL failed: %d", err);
+        }
+    
+    iEdwinTestControl = CEdwinTestControl::NewL();
+    CleanupStack::PushL(iEdwinTestControl);
+
+    CCoeEnv::Static()->AppUi()->AddToStackL(iEdwinTestControl);
+    
+    iEdwinTestControl->MakeVisible(ETrue);
+    CleanupStack::Pop(iEdwinTestControl);
+    TRAP(err, iMPFileDetailsDialog = CMPFileDetailsDialog::NewL());
+    if (err != KErrNone)
+        {
+        VCXLOGLO2("Cui_FileDetailsDialogtest:: CMPFileDetailsDialog::NewL failed: %d", err);
+        }
+
+    VCXLOGLO1("<<<Cui_FileDetailsDialogtest::CreateNewDialog");
+    return err;
+    }
+
+//
+// -----------------------------------------------------------------------------
+// Cui_FileDetailsDialogtest::ExecuteLDFromMedia
+// -----------------------------------------------------------------------------
+//
+TInt Cui_FileDetailsDialogtest::ExecuteLDFromMedia(CStifItemParser& aItem)
+    {
+    VCXLOGLO1(">>>Cui_FileDetailsDialogtest::ExecuteLDFromMedia");
+    
+    TInt err = KErrNotFound;
+    TPtrC string;
+    if ( (err = aItem.GetNextString(string) ) == KErrNone )
+        {
+        TBuf<120> KMediaFile;
+        
+        // If it's not full path then search from default location.
+        if( string.FindF( _L(":\\") ) == KErrNotFound ) 
+            {
+            KMediaFile.Append(Kui_FileDetailsDialogtest_testPath);
+            }
+        KMediaFile.Append(string);
+
+        // Start timeout timer.
+        if( iControlEventsEnabled ) 
+            {
+            if( !iTimer )
+                {
+                iTimer = CVcxTestTimer::NewL( *this, 0 );
+                }
+            iTimer->After( 1000000 * 60 * 2 ); // 2 minutes.
+            }
+        
+        TRAP(err, iMPFileDetailsDialog->ExecuteLD( KMediaFile ));
+
+        if (err != KErrNone)
+            {
+            if (err == KErrNotSupported)
+                {
+                VCXLOGLO2("Cui_FileDetailsDialogtest:: File is not valid media file: %d", err);
+                }
+            else
+                {
+                VCXLOGLO2("Cui_FileDetailsDialogtest:: ExecuteLD returned with err: %d", err);
+                }
+            }
+        
+        err = ( err != KErrNone ? err : iError );
+        if( iTimer )
+            {
+            iTimer->CancelTimer();
+            }
+        }
+    else
+        {
+        VCXLOGLO1("Cui_FileDetailsDialogtest:: Parameter missing");
+        }
+    
+    VCXLOGLO1("<<<Cui_FileDetailsDialogtest::ExecuteLDFromMedia");
+    return err;
+    }
+
+// -----------------------------------------------------------------------------
+// Cui_FileDetailsDialogtest::ExecuteLDFromDetails
+// -----------------------------------------------------------------------------
+//
+TInt Cui_FileDetailsDialogtest::ExecuteLDFromDetails(CStifItemParser& /*aItem*/)
+    {
+    VCXLOGLO1(">>>Cui_FileDetailsDialogtest::ExecuteLDFromDetails");
+    
+    TInt err = KErrNotReady;
+
+    if ( iMPFileDetails)
+        {
+        // Start timeout timer.
+        if( iControlEventsEnabled ) 
+            {
+            if( !iTimer )
+                {
+                iTimer = CVcxTestTimer::NewL( *this, 0 );
+                }
+            iTimer->After( 1000000 * 60 * 2 ); // 2 minutes.
+            }
+        
+        TRAP(err, iMPFileDetailsDialog->ExecuteLD(iMPFileDetails));
+
+        if (err != KErrNone)
+            {
+            if (err == KErrNotSupported)
+                {
+                VCXLOGLO2("Cui_FileDetailsDialogtest:: File is not valid media file %d", err);
+                }
+            else
+                {
+                VCXLOGLO2("Cui_FileDetailsDialogtest:: ExecuteLD returned with err: %d", err);
+                }
+            }
+            
+        err = ( err != KErrNone ? err : iError );
+
+        if( iTimer )
+            {
+            iTimer->CancelTimer();
+            }
+        
+        }
+    
+    VCXLOGLO1("<<<Cui_FileDetailsDialogtest::ExecuteLDFromDetails");
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// Cui_FileDetailsDialogtest::CreateNewFileDetails
+// ---------------------------------------------------------------------------
+//
+TInt Cui_FileDetailsDialogtest::CreateNewFileDetails(CStifItemParser& aItem)
+    {
+    VCXLOGLO1(">>>Cui_FileDetailsDialogtest::CreateNewFileDetails");
+    
+    TInt err = KErrNone;
+    TPtrC string;
+
+    if ( (err = aItem.GetNextString(string) ) == KErrNone)
+        {
+        do
+            {
+            TBuf<120> KMediaFilePath;
+            TBuf<120> KMediaFileName;
+
+            KMediaFilePath.Append( Kui_FileDetailsDialogtest_videoTestPath );
+
+            delete iMPFileDetails;
+            iMPFileDetails = NULL;
+
+            iMPFileDetails = new (ELeave) CMPFileDetails();
+            iMPFileDetails->iFilePath = KMediaFilePath.AllocL();
+            iMPFileDetails->iFileName = string.AllocL();
+            }
+        while (aItem.GetNextString(string) == KErrNone);
+        }
+    
+    VCXLOGLO1("<<<Cui_FileDetailsDialogtest::CreateNewFileDetails");
+    return err;
+    }
+
+// -----------------------------------------------------------------------------
+//  Cui_FileDetailsDialogtest::AddPointerEventL
+// -----------------------------------------------------------------------------
+//
+TInt Cui_FileDetailsDialogtest::AddPointerEventL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>Cui_FileDetailsDialogtest::AddPointerEventL");
+    
+    TInt err( KErrNone );
+    
+    TInt delay;
+    User::LeaveIfError( aItem.GetNextInt( delay ) );
+    
+    TInt type;
+    User::LeaveIfError( aItem.GetNextInt( type ) );
+    
+    TInt x;
+    User::LeaveIfError( aItem.GetNextInt( x ) );
+    
+    TInt y;
+    User::LeaveIfError( aItem.GetNextInt( y ) );
+    
+    CVcxTestControlEvent* event = CVcxTestControlEvent::NewL();
+    event->SetPointerEvent( delay*1000, static_cast<TPointerEvent::TType>(type), TPoint(x, y) );
+    
+    iControlEventQueue->AddControlEvent( event );
+    
+    VCXLOGLO1("<<<Cui_FileDetailsDialogtest::AddPointerEventL");
+    return err;
+    }
+
+// -----------------------------------------------------------------------------
+//  Cui_FileDetailsDialogtest::AddKeyEventL
+// -----------------------------------------------------------------------------
+//
+TInt Cui_FileDetailsDialogtest::AddKeyEventL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>Cui_FileDetailsDialogtest::AddKeyEventL");
+    
+    TInt err( KErrNone );
+    
+    TInt delay;
+    User::LeaveIfError( aItem.GetNextInt( delay ) );
+    
+    TInt keyCodeMapping;
+    User::LeaveIfError( aItem.GetNextInt( keyCodeMapping ) );
+    
+    TStdScanCode keyCode( EStdKeyNull );
+    switch( keyCodeMapping )
+        {
+        case TFileDetailsTestKeyCode_EKeyDevice0:
+            {
+            keyCode = EStdKeyDevice0; 
+            }
+            break;
+         
+        case TFileDetailsTestKeyCode_EKeyDevice1:
+            {
+            keyCode = EStdKeyDevice1; 
+            }
+            break;
+            
+        default:
+            break;
+        }
+    
+    TInt eventCode;
+    User::LeaveIfError( aItem.GetNextInt( eventCode ) );
+    
+    CVcxTestControlEvent* event = CVcxTestControlEvent::NewL();
+    event->SetKeyEvent( delay*1000, 
+            keyCode, static_cast<TRawEvent::TType>( eventCode ) );
+    
+    iControlEventQueue->AddControlEvent( event );
+    
+    VCXLOGLO1("<<<Cui_FileDetailsDialogtest::AddKeyEventL");
+    return err;
+    }
+
+// -----------------------------------------------------------------------------
+//  Cui_FileDetailsDialogtest::EnableControlEvents
+// -----------------------------------------------------------------------------
+//
+TInt Cui_FileDetailsDialogtest::EnableControlEvents( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>Cui_FileDetailsDialogtest::EnableControlEvents");
+    
+    TInt err( KErrNone );
+    
+    TInt delay;
+    User::LeaveIfError( aItem.GetNextInt( delay ) );
+      
+    iControlEventQueue->EnableControlEvents( delay*1000 );
+    iControlEventsEnabled = ETrue;
+    
+    VCXLOGLO1("<<<Cui_FileDetailsDialogtest::EnableControlEvents");
+    return err;
+    }
+
+// -----------------------------------------------------------------------------
+//  Cui_FileDetailsDialogtest::DisableControlEvents
+// -----------------------------------------------------------------------------
+//
+TInt Cui_FileDetailsDialogtest::DisableControlEvents( CStifItemParser& /* aItem */ )
+    {
+    VCXLOGLO1(">>>Cui_FileDetailsDialogtest::DisableControlEvents");
+    
+    TInt err( KErrNone );    
+    iControlEventQueue->DisableControlEvents();
+    iControlEventsEnabled = EFalse;
+    
+    VCXLOGLO1("<<<Cui_FileDetailsDialogtest::DisableControlEvents");
+    return err;
+    }
+
+// -----------------------------------------------------------------------------
+//  Cui_FileDetailsDialogtest::ResetControlEvents
+// -----------------------------------------------------------------------------
+//
+TInt Cui_FileDetailsDialogtest::ResetControlEvents( CStifItemParser& /* aItem */ )
+    {
+    VCXLOGLO1(">>>Cui_FileDetailsDialogtest::ResetControlEvents");
+    TInt err( KErrNone );
+    iControlEventQueue->ResetControlEvents();    
+    VCXLOGLO1("<<<Cui_FileDetailsDialogtest::ResetControlEvents");    
+    return err;
+    }
+
+// -----------------------------------------------------------------------------
+//  Cui_FileDetailsDialogtest::LightStatusChanged
+// -----------------------------------------------------------------------------
+//
+void Cui_FileDetailsDialogtest::LightStatusChanged(TInt /* aTarget */, CHWRMLight::TLightStatus /* aStatus */ )
+    {
+    
+    }   
+
+// -----------------------------------------------------------------------------
+//  Cui_FileDetailsDialogtest::TimerComplete
+// -----------------------------------------------------------------------------
+//
+void Cui_FileDetailsDialogtest::TimerComplete( TInt aTimerId, TInt aError )
+    {
+    // Calls to CMPFileDetailsDialog are blocking.
+    if( iMPFileDetailsDialog )
+        {
+        VCXLOGLO1("Cui_FileDetailsDialogtest:: Timeout!");
+        iMPFileDetailsDialog->Close();
+        iError = KErrTimedOut;
+        }
+    }   
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+// None
+
+//  [End of File] - Do not remove
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/videocollection_api/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,32 @@
+/*
+* 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 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:      Build file for videocollection_api*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../inc/myvideosindicator.hrh  APP_LAYER_PLATFORM_EXPORT_PATH( myvideosindicator.hrh )
+../inc/myvideosindicator.h    APP_LAYER_PLATFORM_EXPORT_PATH( myvideosindicator.h )
+../inc/myvideosindicator.inl  APP_LAYER_PLATFORM_EXPORT_PATH( myvideosindicator.inl )
+
+PRJ_MMPFILES
+
+PRJ_TESTMMPFILES
+
+PRJ_TESTEXPORTS
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/videocollection_api/inc/myvideosindicator.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,73 @@
+/*
+* 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 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:  My Videos indicator ECom plugin interface.*
+*/
+
+
+
+#ifndef MYVIDEOSINDICATOR_H
+#define MYVIDEOSINDICATOR_H
+
+#include <e32base.h>
+#include "myvideosindicator.hrh"
+
+class CGulIcon;
+class CMPXMedia;
+
+/**
+ * ECom plugin interface definition.
+ */
+class CMyVideosIndicator : public CBase
+    {
+    public:
+
+        /**
+         * Wraps ECom object instantitation.
+         */
+        static CMyVideosIndicator* NewL();
+        
+        /**
+         * Wraps ECom object destruction.
+         */
+        virtual ~CMyVideosIndicator();
+        
+        /**
+         * Returns overlay indicator. Ownership is transferred.
+         *
+         * @return Pointer to an icon.
+         */
+        virtual CGulIcon* VideoOverlayIndicatorL() = 0;
+
+        /**
+         * Tells whether to show the overlay indicator for a given media object.
+         * 
+         * @param aMedia The media object.
+         * @return Whether to show the indicator (true/false).
+         */
+        virtual TBool IsIndicatorShown( const CMPXMedia& aMedia ) = 0;
+
+    private:
+
+        /** 
+         * Instance identifier key.
+         */
+        TUid iDtor_ID_Key;
+
+    };
+
+#include <ecom/ecom.h>
+#include "myvideosindicator.inl" // Our own base implementations for ECOM
+
+#endif // MYVIDEOSINDICATOR_H
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/videocollection_api/inc/myvideosindicator.hrh	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,26 @@
+/*
+* 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 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:  My Videos indicator interface constants.*
+*/
+
+
+#ifndef MYVIDEOSINDICATOR_HRH
+#define MYVIDEOSINDICATOR_HRH
+
+/**
+ * Plugin interface UID
+ */
+#define KMyVideosIndicatorInterfaceUid 0x20029FC4
+
+#endif // MYVIDEOSINDICATOR_HRH
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/videocollection_api/inc/myvideosindicator.inl	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,50 @@
+/*
+* 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 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:    My Videos indicator plugin inlines.*
+*/
+
+
+
+#ifndef MYVIDEOSINDICATOR_INL
+#define MYVIDEOSINDICATOR_INL
+
+// -----------------------------------------------------------------------------
+// Instantiates appropriate plugin implementation.
+// -----------------------------------------------------------------------------
+//
+inline CMyVideosIndicator* CMyVideosIndicator::NewL()
+    {
+    TEComResolverParams resolverParams;
+    TAny* ext = REComSession::CreateImplementationL( 
+        TUid::Uid( KMyVideosIndicatorInterfaceUid ), 
+        _FOFF( CMyVideosIndicator, iDtor_ID_Key ),
+        resolverParams );
+
+    CMyVideosIndicator* result = reinterpret_cast<CMyVideosIndicator*>( ext );
+
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
+// Interface's destructor
+// -----------------------------------------------------------------------------
+//
+inline CMyVideosIndicator::~CMyVideosIndicator()
+    {
+    // Inform the ECOM framework that this specific instance of the
+    // interface has been destroyed.
+    REComSession::DestroyedImplementation( iDtor_ID_Key );
+    }
+
+#endif // MYVIDEOSINDICATOR_INL
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/videocollection_api/videocollection_api.metaxml	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,17 @@
+<?xml version="1.0" ?>
+<api id="d2d2646887d216bb93266dee956796dc" dataversion="2.0">
+  <name>Video Collection API</name>
+  <description>Provides constants and enumerations for utilizing video collection indicator ECom plugin</description>
+  <type>c++</type>
+  <collection>videocollection</collection>
+  <libs>
+  </libs>
+  <release category="platform"/>
+  <attributes>
+     <!-- This indicates wether the api provedes separate html documentation -->
+     <!-- or is the additional documentation generated from headers. -->
+     <!-- If you are unsuere then the value is "no" -->
+     <htmldocprovided>no</htmldocprovided>
+     <adaptation>no</adaptation>
+  </attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/videoplayer_startup_api/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* 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:      Build file for videoplayer_startup_api*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../inc/videoplayeractivationmessage.h    APP_LAYER_PLATFORM_EXPORT_PATH( videoplayeractivationmessage.h )
+../inc/videoplayercustommessage.h        APP_LAYER_PLATFORM_EXPORT_PATH( videoplayercustommessage.h )
+
+PRJ_MMPFILES
+
+PRJ_TESTMMPFILES
+
+PRJ_TESTEXPORTS
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/videoplayer_startup_api/inc/videoplayeractivationmessage.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,165 @@
+/*
+* Copyright (c) 2006-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:   Defines activation message for videoplayer application.
+
+*
+*/
+
+
+
+#ifndef VIDEOPLAYERACTIVATIONMESSAGE_H
+#define VIDEOPLAYERACTIVATIONMESSAGE_H
+
+// INCLUDES
+
+#include <e32base.h>
+
+// CONSTANTS
+
+/**
+ * Minimum length of this object in bytes, can be used to check length of 
+ * parameter string that is passed to applications and should be this object.
+ */
+const TInt KVideoPlayerActivationMessageMinLength = 20;
+
+/**
+ * Max length of path.
+ */
+const TInt KVideoPlayerMsgMaxPath = 255;   
+
+/**
+ * Custom Uid when sending activation message.
+ */
+const TInt KVideoPlayerVodStartPlayer = 10500; 
+
+/**
+ * Custom Uid when sending activation message to make progressive download.
+ */
+const TInt KVideoPlayerStartPDlPlayer = 10501; 
+
+// CLASS DECLARATION
+
+/**
+ * Data class for VideoPlayer activation message.
+ *
+ * @lib IptvUtil.dll
+ * @since R4
+ */
+class TVideoPlayerActivationMessage
+    {
+    public: // Data types.
+
+        /**
+         * Message types.
+         */ 
+        enum TMessageType
+            {
+            ENoType = 0,
+            ELaunchVideoToPlayer,
+            ELaunchLastWatchedVideo,
+            EOpenVideoStorage,
+            EOpenInternetVideos,
+            ELaunchServiceById,
+            EOpenServiceCatalogue,
+            EOpenVideoShop,
+            ELiveTVMessage,
+            EOpenRecordingsCategory,
+            EOpenVCSettings,
+            EOpenVCSettingsFeedSubscriptions,
+            EOpenVCSettingsAddFeed,
+            ELiveTVMessageLastWatched,
+            EOpenVCSettingsLiveTVSubscriptions,
+            EOpenVCSettingsEditFeed
+            };
+
+        /**
+         * Message sender.
+         */
+        enum TMessageSender
+            {
+            ENoSender = 0,
+            ENotification,
+            EActiveSpace,
+            EIptvMainLastWatched,
+            EMatrixMenu
+            };       
+
+    public: // Common data members
+
+        /**        
+         * TMessageType
+         */
+        TMessageType                         iMsgType;
+        
+        /**        
+         * TMessageSender
+         */        
+        TMessageSender                       iMsgSender;
+        
+        /**        
+         * Service Id
+         */        
+        TUint32                              iServiceId;
+        
+        /**        
+         * Group Id
+         */        
+        TUint32                              iGroupId;
+
+#if !defined(__SERIES60_30__) && !defined(__SERIES60_31__) && !defined(__SERIES60_32__)
+        /**        
+         * Channel Id
+         */        
+        TInt64                               iChannelId;
+#endif
+
+        /**
+         * Application Uid of message sender.
+         */
+        TUid                                 iSenderUid;
+        
+    public: // Vod data members.
+
+        /**
+         * Deprecated. Do not use.
+         */
+        TUid                                 iUid;
+
+        /**
+         * Deprecated. Do not use.
+         */
+        TInt32                               iActive;
+
+        /**
+         * Deprecated. Do not use.
+         */
+        TBool                                iSingle;
+
+        /**
+         * File Id (Global file Id 1/2).
+         */
+        TUint32                              iFileId;
+
+        /**        
+         * Drive Id, see TDriveNumber (Global file Id 2/2).
+         */
+        TInt                                 iDrive;  
+
+        /**        
+         * Full path to video.
+         */
+        TBuf<KVideoPlayerMsgMaxPath>                iFullPath;
+    };
+
+#endif // XVIDEOPLAYERACTIVATIONMESSAGE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/videoplayer_startup_api/inc/videoplayercustommessage.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,72 @@
+/*
+* Copyright (c) 2006-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:   Defines custom message for videoplayer application.
+*
+*
+*/
+
+
+
+#ifndef VIDEOPLAYERCUSTOMMESSAGE_H
+#define VIDEOPLAYERCUSTOMMESSAGE_H
+
+// INCLUDES
+
+#include <e32base.h>
+
+// CONSTANTS
+
+/**
+ * Minimum length of this object in bytes, can be used to check length of 
+ * parameter string that is passed to applications and should be this object.
+ */
+const TInt KVideoPlayerCustomMessageMinLength = 20;
+
+/**
+ * Max length of name.
+ */
+const TInt KVideoPlayerMsgMaxName = 255;   
+
+/**
+ * Max length of path.
+ */
+const TInt KVideoPlayerMaxPath( 2048 );
+
+// CLASS DECLARATION
+
+/**
+ * Data class for VideoPlayer custom message.
+ */
+class TVideoPlayerCustomMessage
+    {
+    public: // Data types.
+
+        /**        
+         * Video name
+         */
+        TBuf<KVideoPlayerMsgMaxName>    iName;
+           
+        /** 
+         * Path to the thumbnail or icon for the video 
+         */
+        TBuf<KMaxPath>                  iIcon;
+  
+        /** 
+         * Where the video content is located. URL or filename ( including path ) 
+         */
+        TBuf<KVideoPlayerMaxPath>       iContent;
+        
+    };
+
+#endif // VIDEOPLAYERCUSTOMMESSAGE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/videoplayer_startup_api/tsrc/Bmarm/VideoPlayerStartupApiTestU.DEF	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/videoplayer_startup_api/tsrc/Bwins/VideoPlayerStartupApiTestU.DEF	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/videoplayer_startup_api/tsrc/EABI/VideoPlayerStartupApiTestU.def	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/videoplayer_startup_api/tsrc/conf/atsconf.txt	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,14 @@
+;Run \vado\videoplayer\tsrc\testing\tools\genATSdrop.pl from 
+;the tsrc folder to create ATS3 drop.
+[DROP]
+NAME VaDo - videoplayer_plat - videoplayer_startup_api
+DEVICE INSERT_DEVICE
+FLASH INSERT_FLASH_IMAGE
+FLASH INSERT_FLASH_IMAGE
+FLASH INSERT_FLASH_IMAGE
+SIS \VideoApp_Domain\videoplayer\videoplayerapp\mpxvideoplayer\sis\VideoPlayer.sisx
+PKG group\VideoPlayerStartupApiTest.pkg
+INI init\TestFramework.ini 300
+EMAIL INSERT_EMAIL
+RUN
+[ENDDROP]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/videoplayer_startup_api/tsrc/conf/ui_VideoPlayerStartupApiTest.cfg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,979 @@
+[Define]
+// From videoplayeractivationmessage.h
+ENoType 0
+ELaunchVideoToPlayer 1
+ELaunchLastWatchedVideo 2
+EOpenVideoStorage 3
+EOpenInternetVideos 4
+ELaunchServiceById 5
+EOpenServiceCatalogue 6
+EOpenVideoShop 7
+ELiveTVMessage 8
+EOpenRecordingsCategory 9
+EOpenVCSettings 10
+EOpenVCSettingsFeedSubscriptions 11
+EOpenVCSettingsAddFeed 12
+ELiveTVMessageLastWatched 13
+EOpenVCSettingsLiveTVSubscriptions 14
+EOpenVCSettingsEditFeed 15
+
+ENoSender 0
+ENotification 1
+EActiveSpace 2
+EIptvMainLastWatcher 3
+EMatrixMenu 4
+[Enddefine]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title Setup
+
+create VCXTestUtilModule Util
+// Copies some known 3G AP to "Internet" destination with "Internet" name for the AP.
+Util CopyMethod "Internet" "Internet" "Internet"
+// Disable connection dialog for "Internet" destination.
+Util SetConnectionMethodIntAttribute "Internet" "Internet" 507 2 // 507 is ECmSeamlessnessLevel
+delete Util
+
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+#[Test]
+#title 0 ELaunchVideoToPlayer - ENoSender
+#create VideoPlayerStartupApiTest test
+#test ActivationMessage ELaunchVideoToPlayer ENoSender 0
+#pause 5000
+#test KillFusion
+#delete test
+#[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+#[Test]
+#title 1 ELaunchVideoToPlayer - ENotification
+#create VideoPlayerStartupApiTest test
+#test ActivationMessage ELaunchVideoToPlayer ENotification 0
+#pause 5000
+#test KillFusion
+#delete test
+#[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+#[Test]
+#title 2 ELaunchVideoToPlayer - EActiveSpace
+#create VideoPlayerStartupApiTest test
+#test ActivationMessage ELaunchVideoToPlayer EActiveSpace 0
+#pause 5000
+#test KillFusion
+#delete test
+#[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+#[Test]
+#title 3 ELaunchVideoToPlayer - EIptvMainLastWatcher
+#create VideoPlayerStartupApiTest test
+#test ActivationMessage ELaunchVideoToPlayer EIptvMainLastWatcher 0
+#pause 5000
+#test KillFusion
+#delete test
+#[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+#[Test]
+#title 4 ELaunchVideoToPlayer - EMatrixMenu
+#create VideoPlayerStartupApiTest test
+#test ActivationMessage ELaunchVideoToPlayer EMatrixMenu 0
+#pause 5000
+#test KillFusion
+#delete test
+#[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+#[Test]
+#title 5 ELaunchVideoToPlayer - EMatrixMenu, no file defined
+#create VideoPlayerStartupApiTest test
+#test ActivationMessage ELaunchVideoToPlayer EMatrixMenu
+#pause 5000
+#test KillFusion
+#delete test
+#[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 6 ELaunchVideoToPlayer - EMatrixMenu, file is not found
+create VideoPlayerStartupApiTest test
+allowerrorcodes -1
+test ActivationMessage ELaunchVideoToPlayer EMatrixMenu 10000
+pause 5000
+allowerrorcodes -1
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 7 EOpenVideoStorage - ENoSender
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenVideoStorage ENoSender
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 8 EOpenVideoStorage - ENotification
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenVideoStorage ENotification
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 9 EOpenVideoStorage - EActiveSpace
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenVideoStorage EActiveSpace
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 10 EOpenVideoStorage - EIptvMainLastWatcher
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenVideoStorage EIptvMainLastWatcher
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 11 EOpenVideoStorage - EMatrixMenu
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenVideoStorage EMatrixMenu
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 12 EOpenInternetVideos - ENoSender
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenInternetVideos ENoSender
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 13 EOpenInternetVideos - ENotification
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenInternetVideos ENotification
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 14 EOpenInternetVideos - EActiveSpace
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenInternetVideos EActiveSpace
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 15 EOpenInternetVideos - EIptvMainLastWatcher
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenInternetVideos EIptvMainLastWatcher
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 16 EOpenInternetVideos - EMatrixMenu
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenInternetVideos EMatrixMenu
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+#[Test]
+#title 17 ELaunchServiceById - ENoSender
+#create VideoPlayerStartupApiTest test
+#test ActivationMessage ELaunchServiceById ENoSender
+#pause 3000
+#test KillFusion
+#delete test
+#[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+#[Test]
+#title 18 ELaunchServiceById - ENotification
+#create VideoPlayerStartupApiTest test
+#test ActivationMessage ELaunchServiceById ENotification
+#pause 3000
+#test KillFusion
+#delete test
+#[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+#[Test]
+#title 19 ELaunchServiceById - EActiveSpace
+#create VideoPlayerStartupApiTest test
+#test ActivationMessage ELaunchServiceById EActiveSpace
+#pause 3000
+#test KillFusion
+#delete test
+#[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+#[Test]
+#title 20 ELaunchServiceById - EIptvMainLastWatcher
+#create VideoPlayerStartupApiTest test
+#test ActivationMessage ELaunchServiceById EIptvMainLastWatcher
+#pause 3000
+#test KillFusion
+#delete test
+#[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+#[Test]
+#title 21 ELaunchServiceById - EMatrixMenu
+#create VideoPlayerStartupApiTest test
+#test ActivationMessage ELaunchServiceById EMatrixMenu
+#pause 3000
+#test KillFusion
+#delete test
+#[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 22 EOpenServiceCatalogue - ENoSender
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenServiceCatalogue ENoSender
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 23 EOpenServiceCatalogue - ENotification
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenServiceCatalogue ENotification
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 24 EOpenServiceCatalogue - EActiveSpace
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenServiceCatalogue EActiveSpace
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 25 EOpenServiceCatalogue - EIptvMainLastWatcher
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenServiceCatalogue EIptvMainLastWatcher
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 26 EOpenServiceCatalogue - EMatrixMenu
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenServiceCatalogue EMatrixMenu
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 27 EOpenVideoShop - ENoSender
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenVideoShop ENoSender
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 28 EOpenVideoShop - ENotification
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenVideoShop ENotification
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 29 EOpenVideoShop - EActiveSpace
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenVideoShop EActiveSpace
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 30 EOpenVideoShop - EIptvMainLastWatcher
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenVideoShop EIptvMainLastWatcher
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 31 EOpenVideoShop - EMatrixMenu
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenVideoShop EMatrixMenu
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 32 ELiveTVMessage - ENoSender
+create VideoPlayerStartupApiTest test
+test ActivationMessage ELiveTVMessage ENoSender
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 33 ELiveTVMessage - ENotification
+create VideoPlayerStartupApiTest test
+test ActivationMessage ELiveTVMessage ENotification
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 34 ELiveTVMessage - EActiveSpace
+create VideoPlayerStartupApiTest test
+test ActivationMessage ELiveTVMessage EActiveSpace
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 35 ELiveTVMessage - EIptvMainLastWatcher
+create VideoPlayerStartupApiTest test
+test ActivationMessage ELiveTVMessage EIptvMainLastWatcher
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 36 ELiveTVMessage - EMatrixMenu
+create VideoPlayerStartupApiTest test
+test ActivationMessage ELiveTVMessage EMatrixMenu
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 37 EOpenRecordingsCategory - ENoSender
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenRecordingsCategory ENoSender
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 38 EOpenRecordingsCategory - ENotification
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenRecordingsCategory ENotification
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 39 EOpenRecordingsCategory - EActiveSpace
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenRecordingsCategory EActiveSpace
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 40 EOpenRecordingsCategory - EIptvMainLastWatcher
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenRecordingsCategory EIptvMainLastWatcher
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 41 EOpenRecordingsCategory - EMatrixMenu
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenRecordingsCategory EMatrixMenu
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 42 EOpenVCSettings - ENoSender
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenVCSettings ENoSender
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 43 EOpenVCSettings - ENotification
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenVCSettings ENotification
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 44 EOpenVCSettings - EActiveSpace
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenVCSettings EActiveSpace
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 45 EOpenVCSettings - EIptvMainLastWatcher
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenVCSettings EIptvMainLastWatcher
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 46 EOpenVCSettings - EMatrixMenu
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenVCSettings EMatrixMenu
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 47 EOpenVCSettingsFeedSubscriptions - ENoSender
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenVCSettingsFeedSubscriptions ENoSender
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 48 EOpenVCSettingsFeedSubscriptions - ENotification
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenVCSettingsFeedSubscriptions ENotification
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 49 EOpenVCSettingsFeedSubscriptions - EActiveSpace
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenVCSettingsFeedSubscriptions EActiveSpace
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 50 EOpenVCSettingsFeedSubscriptions - EIptvMainLastWatcher
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenVCSettingsFeedSubscriptions EIptvMainLastWatcher
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 51 EOpenVCSettingsFeedSubscriptions - EMatrixMenu
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenVCSettingsFeedSubscriptions EMatrixMenu
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 52 EOpenVCSettingsAddFeed - ENoSender
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenVCSettingsAddFeed ENoSender
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 53 EOpenVCSettingsAddFeed - ENotification
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenVCSettingsAddFeed ENotification
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 54 EOpenVCSettingsAddFeed - EActiveSpace
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenVCSettingsAddFeed EActiveSpace
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 55 EOpenVCSettingsAddFeed - EIptvMainLastWatcher
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenVCSettingsAddFeed EIptvMainLastWatcher
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 56 EOpenVCSettingsAddFeed - EMatrixMenu
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenVCSettingsAddFeed EMatrixMenu
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 57 ELiveTVMessageLastWatched - ENoSender
+create VideoPlayerStartupApiTest test
+test ActivationMessage ELiveTVMessageLastWatched ENoSender
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 58 ELiveTVMessageLastWatched - ENotification
+create VideoPlayerStartupApiTest test
+test ActivationMessage ELiveTVMessageLastWatched ENotification
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 59 ELiveTVMessageLastWatched - EActiveSpace
+create VideoPlayerStartupApiTest test
+test ActivationMessage ELiveTVMessageLastWatched EActiveSpace
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 60 ELiveTVMessageLastWatched - EIptvMainLastWatcher
+create VideoPlayerStartupApiTest test
+test ActivationMessage ELiveTVMessageLastWatched EIptvMainLastWatcher
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 61 ELiveTVMessageLastWatched - EMatrixMenu
+create VideoPlayerStartupApiTest test
+test ActivationMessage ELiveTVMessageLastWatched EMatrixMenu
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 62 EOpenVCSettingsLiveTVSubscriptions - ENoSender
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenVCSettingsLiveTVSubscriptions ENoSender
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 63 EOpenVCSettingsLiveTVSubscriptions - ENotification
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenVCSettingsLiveTVSubscriptions ENotification
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 64 EOpenVCSettingsLiveTVSubscriptions - EActiveSpace
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenVCSettingsLiveTVSubscriptions EActiveSpace
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 65 EOpenVCSettingsLiveTVSubscriptions - EIptvMainLastWatcher
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenVCSettingsLiveTVSubscriptions EIptvMainLastWatcher
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 66 EOpenVCSettingsLiveTVSubscriptions - EMatrixMenu
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenVCSettingsLiveTVSubscriptions EMatrixMenu
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 67 EOpenVCSettingsEditFeed - ENoSender
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenVCSettingsEditFeed ENoSender
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 68 EOpenVCSettingsEditFeed - ENotification
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenVCSettingsEditFeed ENotification
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 69 EOpenVCSettingsEditFeed - EActiveSpace
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenVCSettingsEditFeed EActiveSpace
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 70 EOpenVCSettingsEditFeed - EIptvMainLastWatcher
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenVCSettingsEditFeed EIptvMainLastWatcher
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 71 EOpenVCSettingsEditFeed - EMatrixMenu
+create VideoPlayerStartupApiTest test
+test ActivationMessage EOpenVCSettingsEditFeed EMatrixMenu
+pause 3000
+test KillFusion
+delete test
+[Endtest]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/videoplayer_startup_api/tsrc/conf/ui_VideoPlayerStartupApiTest2.cfg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,295 @@
+[Define]
+// From videoplayeractivationmessage.h
+ENoType 0
+ELaunchVideoToPlayer 1
+EOpenVideoStorage 2
+EOpenInternetVideos 3
+ELaunchServiceById 4
+EOpenServiceCatalogue 5
+EOpenVideoShop 6
+ELiveTVMessage 7
+EOpenRecordingsCategory 8
+EOpenVCSettings 9
+EOpenVCSettingsFeedSubscriptions 10
+EOpenVCSettingsAddFeed 11
+ELiveTVMessageLastWatched 12
+EOpenVCSettingsLiveTVSubscriptions 13
+EOpenVCSettingsEditFeed 14
+
+ENoSender 0
+ENotification 1
+EActiveSpace 2
+EIptvMainLastWatcher 3
+EMatrixMenu 4
+[Enddefine]
+
+[Test]
+title Setup
+
+create VCXTestUtilModule Util
+// Copies some known 3G AP to "Internet" destination with "Internet" name for the AP.
+Util CopyMethod "Internet" "Internet" "Internet"
+// Disable connection dialog for "Internet" destination.
+Util SetConnectionMethodIntAttribute "Internet" "Internet" 507 2 // 507 is ECmSeamlessnessLevel
+delete Util
+
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 100 ELaunchVideoToPlayer - ENotification, while playing
+create VideoPlayerStartupApiTest test
+test ActivationMessage ELaunchVideoToPlayer ENotification 0
+pause 3000
+test ActivationMessage ELaunchVideoToPlayer ENotification 0
+pause 2000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 101 ELaunchVideoToPlayer - EMatrixMenu, while playing
+create VideoPlayerStartupApiTest test
+test ActivationMessage ELaunchVideoToPlayer ENotification 0
+pause 3000
+test ActivationMessage ELaunchVideoToPlayer EMatrixMenu 0
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 102 ELaunchVideoToPlayer - EIptvMainLastWatcher, while playing
+create VideoPlayerStartupApiTest test
+test ActivationMessage ELaunchVideoToPlayer ENotification 0
+pause 3000
+test ActivationMessage ELaunchVideoToPlayer EIptvMainLastWatcher 0
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 103 EOpenVideoStorage - EMatrixMenu, while playing
+create VideoPlayerStartupApiTest test
+test ActivationMessage ELaunchVideoToPlayer ENotification 0
+pause 3000
+test ActivationMessage EOpenVideoStorage EMatrixMenu
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 104 EOpenInternetVideos - EMatrixMenu, while playing
+create VideoPlayerStartupApiTest test
+test ActivationMessage ELaunchVideoToPlayer ENotification 0
+pause 3000
+test ActivationMessage EOpenInternetVideos EMatrixMenu
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 105 ELaunchServiceById - EMatrixMenu, while playing
+create VideoPlayerStartupApiTest test
+test ActivationMessage ELaunchVideoToPlayer ENotification 0
+pause 3000
+test ActivationMessage ELaunchServiceById EMatrixMenu
+pause 3000
+test KillFusion
+delete test
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+#[Test]
+#title 106 EOpenServiceCatalogue - EMatrixMenu, while playing
+#create VideoPlayerStartupApiTest test
+#test ActivationMessage ELaunchVideoToPlayer ENotification 0
+#pause 3000
+#test ActivationMessage EOpenServiceCatalogue EMatrixMenu
+#pause 3000
+#test KillFusion
+#delete test
+#[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+#[Test]
+#title 107 EOpenVideoShop - EMatrixMenu, while playing
+#create VideoPlayerStartupApiTest test
+#test ActivationMessage ELaunchVideoToPlayer ENotification 0
+#pause 3000
+#test ActivationMessage EOpenVideoShop EMatrixMenu
+#pause 3000
+#test KillFusion
+#delete test
+#[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+#[Test]
+#title 108 ELiveTVMessage - EMatrixMenu, while playing
+#create VideoPlayerStartupApiTest test
+#test ActivationMessage ELaunchVideoToPlayer ENotification 0
+#pause 3000
+#test ActivationMessage ELiveTVMessage EMatrixMenu
+#pause 3000
+#test KillFusion
+#delete test
+#[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+#[Test]
+#title 109 EOpenRecordingsCategory - EMatrixMenu, while playing
+#create VideoPlayerStartupApiTest test
+#test ActivationMessage ELaunchVideoToPlayer ENotification 0
+#pause 3000
+#test ActivationMessage EOpenRecordingsCategory EMatrixMenu
+#pause 3000
+#test KillFusion
+#delete test
+#[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+#[Test]
+#title 110 EOpenVCSettings - EMatrixMenu, while playing
+#create VideoPlayerStartupApiTest test
+#test ActivationMessage ELaunchVideoToPlayer ENotification 0
+#pause 3000
+#test ActivationMessage EOpenVCSettings EMatrixMenu
+#pause 3000
+#test KillFusion
+#delete test
+#[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+#[Test]
+#title 111 EOpenVCSettingsFeedSubscriptions - EMatrixMenu, while playing
+#create VideoPlayerStartupApiTest test
+#test ActivationMessage ELaunchVideoToPlayer ENotification 0
+#pause 3000
+#test ActivationMessage EOpenVCSettingsFeedSubscriptions EMatrixMenu
+#pause 3000
+#test KillFusion
+#delete test
+#[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+#[Test]
+#title 112 EOpenVCSettingsAddFeed - EMatrixMenu, while playing
+#create VideoPlayerStartupApiTest test
+#test ActivationMessage ELaunchVideoToPlayer ENotification 0
+#pause 3000
+#test ActivationMessage EOpenVCSettingsAddFeed EMatrixMenu
+#pause 3000
+#test KillFusion
+#delete test
+#[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+#[Test]
+#title 113 ELiveTVMessageLastWatched - EMatrixMenu, while playing
+#create VideoPlayerStartupApiTest test
+#test ActivationMessage ELaunchVideoToPlayer ENotification 0
+#pause 3000
+#test ActivationMessage ELiveTVMessageLastWatched EMatrixMenu
+#pause 3000
+#test KillFusion
+#delete test
+#[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+#[Test]
+#title 114 EOpenVCSettingsLiveTVSubscriptions - EMatrixMenu, while playing
+#create VideoPlayerStartupApiTest test
+#test ActivationMessage ELaunchVideoToPlayer ENotification 0
+#pause 3000
+#test ActivationMessage EOpenVCSettingsLiveTVSubscriptions EMatrixMenu
+#pause 3000
+#test KillFusion
+#delete test
+#[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+#[Test]
+#title 115 EOpenVCSettingsEditFeed - EMatrixMenu, while playing
+#create VideoPlayerStartupApiTest test
+#test ActivationMessage ELaunchVideoToPlayer ENotification 0
+#pause 3000
+#test ActivationMessage EOpenVCSettingsEditFeed EMatrixMenu
+#pause 3000
+#test KillFusion
+#delete test
+#[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# CaseClass: core
+#------------------------------------------------------------------------------------
+[Test]
+title 116 ELaunchVideoToPlayer - EMatrixMenu, file is not found, play again
+create VideoPlayerStartupApiTest test
+allowerrorcodes -1 // Fusion process might be ended because file is not found.
+test ActivationMessage ELaunchVideoToPlayer EMatrixMenu c:\testing\data\asdf.3gp
+pause 2000
+allowerrorcodes -1
+test KillFusion
+pause 3000
+test ActivationMessage ELaunchVideoToPlayer EMatrixMenu 0
+test KillFusion
+delete test
+[Endtest]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/videoplayer_startup_api/tsrc/custom/postrun_custom.xml	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,64 @@
+<step name="Fetch Test module Report" harness="STIF" enabled="true" passrate="100" significant="false">
+       <command>fetch-log</command>
+       <params>
+	    <param type="text"/>
+	    <param delete="true"/>
+	    <param path="C:\Logs\TestFramework\*"/>
+       </params>
+</step>
+<step name="Fetch Fusion logs" harness="STIF" enabled="true" passrate="100" significant="false">
+       <command>fetch-log</command>
+       <params>
+	    <param type="text"/>
+	    <param delete="true"/>
+	    <param path="c:\logs\Fusion\*"/>
+       </params>
+</step>
+<step name="Fetch Livetv logs" harness="STIF" enabled="true" passrate="100" significant="false">
+       <command>fetch-log</command>
+       <params>
+	    <param type="text"/>
+	    <param delete="true"/>
+	    <param path="c:\logs\Livetv\*"/>
+       </params>
+</step>
+<step name="Fetch IPTV logs" harness="STIF" enabled="true" passrate="100" significant="false">
+       <command>fetch-log</command>
+       <params>
+	    <param type="text"/>
+	    <param delete="true"/>
+	    <param path="c:\logs\iptv\*"/>
+       </params>
+</step>
+<step name="Fetch verify files" harness="STIF" enabled="true" passrate="100" significant="false">
+       <command>fetch-log</command>
+       <params>
+	    <param type="text"/>
+	    <param delete="true"/>
+	    <param path="c:\testing\data\verifynew\*"/>
+       </params>
+</step>
+<step name="Fetch TestScripter logs" harness="STIF" enabled="true" passrate="100" significant="false">
+       <command>fetch-log</command>
+       <params>
+	    <param type="text"/>
+	    <param delete="true"/>
+	    <param path="C:\Logs\TestFramework\TestScripter\*"/>
+       </params>
+</step>
+<step name="Fetch Testengine logs" harness="STIF" enabled="true" passrate="100" significant="false">
+       <command>fetch-log</command>
+       <params>
+	    <param type="text"/>
+	    <param delete="true"/>
+	    <param path="C:\Logs\TestFramework\Testengine\*"/>
+       </params>
+</step>
+<step name="Fetch Testserver logs" harness="STIF" enabled="true" passrate="100" significant="false">
+       <command>fetch-log</command>
+       <params>
+	    <param type="text"/>
+	    <param delete="true"/>
+	    <param path="C:\Logs\TestFramework\Testserver\*"/>
+       </params>
+</step>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/videoplayer_startup_api/tsrc/custom/prerun_custom.xml	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,54 @@
+<step name="Create log directory for testmodule" harness="STIF" enabled="true" passrate="100" significant="false">
+    	<command>makedir</command>
+    	<params>
+        <param dir="c:\logs\testframework"/>
+    	</params>
+</step>
+<step name="Create log directory for fusion" harness="STIF" enabled="true" passrate="100" significant="false">
+    	<command>makedir</command>
+    	<params>
+        <param dir="c:\logs\Fusion"/>
+    	</params>
+</step>
+<step name="Create log directory for livetv" harness="STIF" enabled="true" passrate="100" significant="false">
+    	<command>makedir</command>
+    	<params>
+        <param dir="c:\logs\Livetv"/>
+    	</params>
+</step>
+<step name="Create log directory for iptv" harness="STIF" enabled="true" passrate="100" significant="false">
+    	<command>makedir</command>
+    	<params>
+        <param dir="c:\logs\iptv"/>
+    	</params>
+</step>
+<step name="Create directory for verify files" harness="STIF" enabled="true" passrate="100" significant="false">
+    	<command>makedir</command>
+    	<params>
+        <param dir="c:\testing\data\verifyzip"/>
+    	</params>
+</step>
+<step name="Create directory for verify files" harness="STIF" enabled="true" passrate="100" significant="false">
+    	<command>makedir</command>
+    	<params>
+        <param dir="c:\testing\data\verifynew"/>
+    	</params>
+</step>
+<step name="Create directory for TestScripter logs" harness="STIF" enabled="true" passrate="100" significant="false">
+    	<command>makedir</command>
+    	<params>
+        <param dir="c:\logs\testframework\TestScripter"/>
+    	</params>
+</step>
+<step name="Create directory for Testengine logs" harness="STIF" enabled="true" passrate="100" significant="false">
+    	<command>makedir</command>
+    	<params>
+        <param dir="c:\logs\testframework\Testengine"/>
+    	</params>
+</step>
+<step name="Create directory for Testserver logs" harness="STIF" enabled="true" passrate="100" significant="false">
+    	<command>makedir</command>
+    	<params>
+        <param dir="c:\logs\testframework\Testserver"/>
+    	</params>
+</step>
Binary file videoplayer_plat/videoplayer_startup_api/tsrc/data/c/prettyfu_startup.3gp has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/videoplayer_startup_api/tsrc/group/VideoPlayerStartupApiTest.mmp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,111 @@
+/*
+* 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 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:  MMP file for STIF Test Framework's TestScripter*
+*/
+
+
+#include <platform_paths.hrh>
+
+TARGET          videoplayerstartupapitest.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E3
+
+CAPABILITY      ALL -TCB
+/* Remove comments and replace 0x00000000 with correct vendor id */
+// VENDORID     0x00000000
+/* Remove comments and replace 0x00000000 with correct secure id */
+// SECUREID     0x00000000
+
+//TARGETPATH      ?target_path
+DEFFILE         VideoPlayerStartupApiTest.def
+
+USERINCLUDE     ../inc
+USERINCLUDE     ../../inc
+USERINCLUDE     ../../../../tsrc/VCXTestCommon/inc
+USERINCLUDE     ../../../../tsrc/VCXTestMyVideosCollectionClient/inc
+USERINCLUDE     ../../../../videofeeds/clientapi/inc
+USERINCLUDE     ../../../../videofeeds/utils/inc
+USERINCLUDE     ../../../../videofeeds/vccommon/conf
+USERINCLUDE     ../../../../videofeeds/server/server/inc
+USERINCLUDE     ../../../../videofeeds/server/IptvNetworkSelection/inc
+
+APP_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   /epoc32/include/ecom
+
+SOURCEPATH      ../src
+
+SOURCE          VideoPlayerStartupApiTest.cpp
+SOURCE          VideoPlayerStartupApiTestBlocks.cpp
+
+//RESOURCE        resource_file
+//RESOURCE        resource_file2
+
+LIBRARY         euser.lib
+LIBRARY         stiftestinterface.lib
+LIBRARY         stiftestengine.lib
+LIBRARY         apparc.lib
+LIBRARY         cone.lib
+LIBRARY         eikcore.lib
+LIBRARY         avkon.lib
+LIBRARY         fbscli.lib
+LIBRARY         efsrv.lib
+LIBRARY         ws32.lib
+LIBRARY         estor.lib
+LIBRARY         etext.lib
+LIBRARY         apgrfx.lib
+LIBRARY         aknskins.lib
+LIBRARY         aknnotify.lib
+LIBRARY         bafl.lib
+LIBRARY         commdb.lib
+LIBRARY         eikcoctl.lib
+LIBRARY         eikctl.lib
+LIBRARY         egul.lib
+LIBRARY         gdi.lib
+LIBRARY         http.lib
+LIBRARY         inetprotutil.lib
+LIBRARY         insock.lib
+LIBRARY         esock.lib
+LIBRARY         sendui.lib
+LIBRARY         flogger.lib
+LIBRARY         ecom.lib
+LIBRARY         vcxtestmyvideoscollectionclient.lib
+LIBRARY         vcxtestcommon.lib
+LIBRARY         mpxcommon.lib
+LIBRARY         mpxcollectionutility.lib
+
+LANG            SC
+
+/*
+START WINS
+?wins_specific_information
+END
+
+START MARM
+?marm_specific_information
+END
+*/
+// Other possible keywords:
+
+// DOCUMENT     ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes)
+/*
+START BITMAP ?target
+TARGETPATH   ?emulated_path_on_target_machine
+HEADER
+SOURCE       ?color_depth ?source_bitmap
+END
+*/
+// DEFFILE ?filename
+// AIF ?filename
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/videoplayer_startup_api/tsrc/group/VideoPlayerStartupApiTest.pkg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,64 @@
+;
+; 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 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:  Package file for Video player startup API STIF tests;
+
+; Languages
+&EN
+
+; Provide value for uid
+#{"VideoPlayerStartupApiTest"},(0x00000000),1,1,0,TYPE=SA
+
+; 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
+"\epoc32\release\armv5\udeb\VideoPlayerStartupApiTest.dll"         -   "!:\Sys\Bin\VideoPlayerStartupApiTest.dll"
+"\epoc32\release\armv5\udeb\VCXTestCommon.dll"                     -   "!:\Sys\Bin\VCXTestCommon.dll"
+"\epoc32\release\armv5\udeb\VCXTestUtilModule.dll"                 -   "!:\Sys\Bin\VCXTestUtilModule.dll"
+"\epoc32\release\armv5\udeb\VCXTestMyVideosCollectionClient.dll"   -   "!:\Sys\Bin\VCXTestMyVideosCollectionClient.dll"
+"..\data\c\prettyfu_startup.3gp"                                   -   "c:\testing\data\prettyfu_startup.3gp"
+"..\conf\ui_VideoPlayerStartupApiTest.cfg"                         -   "c:\testframework\ui_VideoPlayerStartupApiTest.cfg"
+"..\conf\ui_VideoPlayerStartupApiTest2.cfg"                        -   "c:\testframework\ui_VideoPlayerStartupApiTest2.cfg"
+"..\init\TestFramework.ini"                                        -   "c:\testframework\TestFramework.ini"
+
+; Embedded SIS
+; None
+
+; End of Package body
+
+; PKG dependencies
+; None
+
+; PKG capabilities
+; None
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/videoplayer_startup_api/tsrc/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,34 @@
+/*
+* 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 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: 
+*
+*/
+
+
+PRJ_PLATFORMS
+	DEFAULT
+
+PRJ_TESTEXPORTS
+../conf/ui_VideoPlayerStartupApiTest.cfg                 /epoc32/winscw/c/testframework/ui_VideoPlayerStartupApiTest.cfg
+../conf/ui_VideoPlayerStartupApiTest2.cfg                /epoc32/winscw/c/testframework/ui_VideoPlayerStartupApiTest2.cfg
+../data/c/prettyfu_startup.3gp                           /epoc32/winscw/c/testing/data/prettyfu_startup.3gp
+
+PRJ_EXPORTS
+
+PRJ_TESTMMPFILES
+VideoPlayerStartupApiTest.mmp
+
+PRJ_MMPFILES
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/videoplayer_startup_api/tsrc/inc/VideoPlayerStartupApiTest.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,177 @@
+/*
+* 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 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:  STIF testclass declaration*
+*/
+
+
+#ifndef VIDEOPLAYERSTARTUPAPITEST_H
+#define VIDEOPLAYERSTARTUPAPITEST_H
+
+//  INCLUDES
+#include <StifLogger.h>
+#include <TestScripterInternal.h>
+#include <StifTestModule.h>
+#include <TestclassAssert.h>
+
+#include "videoplayeractivationmessage.h"
+#include "videoplayercustommessage.h"
+
+#include "VCXTestMessageWait.h"
+#include "VCXTestMyVideosObserver.h"
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+#define TEST_CLASS_VERSION_MAJOR 0
+#define TEST_CLASS_VERSION_MINOR 0
+#define TEST_CLASS_VERSION_BUILD 0
+
+// Logging path
+_LIT( KVideoPlayerStartupApiTestLogPath, "\\logs\\testframework\\VideoPlayerStartupApiTest\\" ); 
+// Log file
+_LIT( KVideoPlayerStartupApiTestLogFile, "VideoPlayerStartupApiTest.txt" ); 
+_LIT( KVideoPlayerStartupApiTestLogFileWithTitle, "VideoPlayerStartupApiTest_[%S].txt" );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+class CVideoPlayerStartupApiTest;
+class CVCXTestMyVideosCollectionClient;
+
+// DATA TYPES
+//enum ?declaration
+//typedef ?declaration
+//extern ?data_type;
+
+// CLASS DECLARATION
+
+class CTestProcess 
+    {
+    public:
+        static CTestProcess* NewL() { CTestProcess* p = new (ELeave) CTestProcess(); return p; };
+
+        CTestProcess() {};
+        virtual ~CTestProcess() { iProcess.Close(); delete iName; };
+        
+    public: // Data
+        RProcess iProcess;
+        HBufC* iName;
+    };
+
+/**
+*  CVideoPlayerStartupApiTest test class for STIF Test Framework TestScripter.
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+NONSHARABLE_CLASS(CVideoPlayerStartupApiTest) : public CScriptBase,
+                                                public MVCXTestMyVideosObserver,
+                                                public MVCXTestMessageWaitObserver
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CVideoPlayerStartupApiTest* NewL( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CVideoPlayerStartupApiTest();
+
+    private: // New functions
+
+        /**
+         * Sends activation message to video player. 
+         */
+        void SendActivationMessageL( TVideoPlayerActivationMessage& aMessage );
+        
+        /**
+         * Gets list of process names.
+         */        
+        void GetAllProcessNames( RPointerArray<HBufC>& aArray );
+        
+        /**
+         * Gets processes for processes that do not exist in aExistingProcesses.
+         */
+        void GetHandlesForNewProcessesL( RPointerArray<HBufC>& aExistingProcesses, RPointerArray<CTestProcess>& aHandles );
+    
+        /**
+         * Checks the exit status of process handles in aHandles array.
+         */
+        TInt CheckProcessExits( RPointerArray<CTestProcess>& aHandles );
+        
+    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 );
+
+        void VideoEventL( TVCXTestVideoEvent aEvent, TUint32 aParam1, TUint32 aParam2, TInt aError );        
+        
+        void MessageWaitComplete( TInt aError );
+        
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CVideoPlayerStartupApiTest( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        /**
+        * Frees all resources allocated from test methods.
+        * @since ?Series60_version
+        */
+        void Delete();
+
+        /**
+        * Test methods are listed below. 
+        */
+       
+        virtual TInt ActivationMessageL( CStifItemParser& aItem );
+        
+        virtual TInt KillFusionL( CStifItemParser& aItem );
+        
+        /**
+         * Method used to log version of test class
+         */
+        void SendTestClassVersion();
+
+        //ADD NEW METHOD DEC HERE
+        //[TestMethods] - Do not remove
+
+    private:    // Data
+        
+        RPointerArray<CTestProcess> iProcessHandles;
+        
+        CVCXTestMyVideosCollectionClient* iMyVideosCollectionClient;
+        CVCXTestMessageWait* iMessageWait;
+        TInt iCollectionError;
+    };
+
+#endif      // VIDEOPLAYERSTARTUPAPITEST_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/videoplayer_startup_api/tsrc/init/TestFramework.ini	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,166 @@
+#
+# This is STIFTestFramework 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.
+
+[Engine_Defaults]
+
+TestReportMode= FullReport    # Possible values are: 
+                              # 'Summary', 'Environment', 'TestCases' or 'FullReport'
+
+CreateTestReport= YES         # Possible values: YES or NO
+
+TestReportFilePath= C:\Logs\Fusion\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT         # Possible values: TXT or HTML
+TestReportOutput= FILE        # Possible values: FILE or RDEBUG
+TestReportFileCreationMode= APPEND # Possible values: OVERWRITE or APPEND
+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\ui_VideoPlayerStartupApiTest.cfg
+TestCaseFile= c:\testframework\ui_VideoPlayerStartupApiTest2.cfg
+[End_Module]
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework 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)'#' 
+
+CreateLogDirectories= YES    # Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML         # Possible values: TXT or HTML
+#EmulatorOutput= FILE         # Possible values: FILE or RDEBUG
+
+#HardwareBasePath=  C:\
+#HardwareFormat= TXT			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+FileCreationMode= APPEND  # 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
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/videoplayer_startup_api/tsrc/src/VideoPlayerStartupApiTest.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,201 @@
+/*
+* 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 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:  This file contains testclass implementation.*
+*/
+
+
+// INCLUDE FILES
+#include <Stiftestinterface.h>
+#include <bautils.h>
+#include <SettingServerClient.h>
+
+#include "VideoPlayerStartupApiTest.h"
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CVideoPlayerStartupApiTest::CVideoPlayerStartupApiTest
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CVideoPlayerStartupApiTest::CVideoPlayerStartupApiTest( 
+    CTestModuleIf& aTestModuleIf ):
+        CScriptBase( aTestModuleIf )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoPlayerStartupApiTest::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CVideoPlayerStartupApiTest::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(KVideoPlayerStartupApiTestLogFileWithTitle, &title);
+        }
+    else
+        {
+        logFileName.Copy(KVideoPlayerStartupApiTestLogFile);
+        }
+
+    iLog = CStifLogger::NewL( KVideoPlayerStartupApiTestLogPath, 
+                          logFileName,
+                          CStifLogger::ETxt,
+                          CStifLogger::EFile,
+                          EFalse );
+        
+    SendTestClassVersion();
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoPlayerStartupApiTest::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CVideoPlayerStartupApiTest* CVideoPlayerStartupApiTest::NewL( 
+    CTestModuleIf& aTestModuleIf )
+    {
+    CVideoPlayerStartupApiTest* self = new (ELeave) CVideoPlayerStartupApiTest( aTestModuleIf );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+
+    }
+
+// Destructor
+CVideoPlayerStartupApiTest::~CVideoPlayerStartupApiTest()
+    { 
+
+    // Delete resources allocated from test methods
+    Delete();
+
+    // Delete logger
+    delete iLog; 
+    }
+
+//-----------------------------------------------------------------------------
+// CVideoPlayerStartupApiTest::SendTestClassVersion
+// Method used to send version of test class
+//-----------------------------------------------------------------------------
+//
+void CVideoPlayerStartupApiTest::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("VideoPlayerStartupApiTest.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 ) // Backpointer to STIF Test Framework
+    {
+
+    return ( CScriptBase* ) CVideoPlayerStartupApiTest::NewL( aTestModuleIf );
+
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/videoplayer_startup_api/tsrc/src/VideoPlayerStartupApiTestBlocks.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,555 @@
+/*
+* 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 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:  This file contains testclass implementation.*
+*/
+
+
+// [INCLUDE FILES] - do not remove
+#include <e32svr.h>
+#include <StifParser.h>
+#include <Stiftestinterface.h>
+
+#include <apgcli.h>    // RApaLsSession
+#include <bautils.h>
+#include <apacmdln.h>  // CApaCommandLine
+#include <w32std.h>    // RWsSession
+#include <apgtask.h>   // TApaTask*
+
+#include <mpxcollectionutility.h>
+#include <mpxmediacontainerdefs.h>
+#include <mpxmediageneraldefs.h>
+
+#include "VideoPlayerStartupApiTest.h"
+#include "VCXTestLog.h"
+#include "VCXTestMyVideosCollectionClient.h"
+
+// CONSTANTS
+const TUid KFusionUid = { 0x200159B2 };
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CVideoPlayerStartupApiTest::Delete
+// Delete here all resources allocated and opened from test methods. 
+// Called from destructor. 
+// -----------------------------------------------------------------------------
+//
+void CVideoPlayerStartupApiTest::Delete() 
+    {
+    iProcessHandles.ResetAndDestroy(); 
+    
+    delete iMyVideosCollectionClient;
+    iMyVideosCollectionClient = NULL;
+    
+    delete iMessageWait;
+    iMessageWait = NULL;    
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoPlayerStartupApiTest::RunMethodL
+// Run specified method. Contains also table of test mothods and their names.
+// -----------------------------------------------------------------------------
+//
+TInt CVideoPlayerStartupApiTest::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( "ActivationMessage", CVideoPlayerStartupApiTest::ActivationMessageL ),
+        ENTRY( "KillFusion", CVideoPlayerStartupApiTest::KillFusionL ),
+        //ADD NEW ENTRY HERE
+        // [test cases entries] - Do not remove
+
+        };
+
+    const TInt count = sizeof( KFunctions ) / 
+                        sizeof( TStifFunctionInfo );
+
+    return RunInternalL( KFunctions, count, aItem );
+
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoPlayerStartupApiTest::ActivationMessageL
+// -----------------------------------------------------------------------------
+//
+TInt CVideoPlayerStartupApiTest::ActivationMessageL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVideoPlayerStartupApiTest::ActivationMessageL");
+    // Print to UI
+    _LIT( KVideoPlayerStartupApiTest, "VideoPlayerStartupApiTest" );
+    _LIT( KWhere, "In ActivationMessageL" );
+    TestModuleIf().Printf( 0, KVideoPlayerStartupApiTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+    aItem.SetParsingType(CStifItemParser::EQuoteStyleParsing);
+    
+    if( iMessageWait == NULL )
+        {
+        iMessageWait = CVCXTestMessageWait::NewL( this );
+        }
+    
+    if( iMyVideosCollectionClient == NULL )
+        {
+        iMyVideosCollectionClient = CVCXTestMyVideosCollectionClient::NewL( this );
+
+        // Wait for video list to open.
+        iMessageWait->WaitForMessageL( EVCXTestVideoListRefreshed, 30, ETrue );
+        }
+    
+    if( iCollectionError == KErrNone )
+        {
+        // Refresh collection.
+        iMyVideosCollectionClient->RefreshCollectionL();
+        iMessageWait->AddMessage( EVCXTestVideoListRefreshed );
+        iMessageWait->WaitForAllL( 10, ETrue );
+        }
+    
+    if( iCollectionError != KErrNone )
+        {
+        VCXLOGLO2("CVideoPlayerStartupApiTest::ActivationMessageL: Something failed with my videos collection plugin, err: %d", iCollectionError);
+        VCXLOGLO1("<<<CVideoPlayerStartupApiTest::ActivationMessageL");
+        return iCollectionError;
+        }
+    
+    TVideoPlayerActivationMessage message;
+    
+    TInt msgTypeInt;
+    User::LeaveIfError( aItem.GetNextInt( msgTypeInt ) );
+
+    TInt msgSenderInt;
+    User::LeaveIfError( aItem.GetNextInt( msgSenderInt ) );
+
+    TVideoPlayerActivationMessage::TMessageType msgType = 
+        static_cast<TVideoPlayerActivationMessage::TMessageType>( msgTypeInt );
+    
+    TVideoPlayerActivationMessage::TMessageSender msgSender = 
+        static_cast<TVideoPlayerActivationMessage::TMessageSender>( msgSenderInt );
+    
+    message.iMsgType   = msgType;
+    message.iMsgSender = msgSender;
+    
+    switch( msgType )
+        {
+        case TVideoPlayerActivationMessage::ENoType:
+            {
+            VCXLOGLO1("CVideoPlayerStartupApiTest:: msgType: ENoType");
+            }
+            break;
+            
+        case TVideoPlayerActivationMessage::ELaunchVideoToPlayer:
+            {
+            VCXLOGLO1("CVideoPlayerStartupApiTest:: msgType: ELaunchVideoToPlayer");
+            
+            TInt videoNum;
+            if( aItem.GetNextInt( videoNum ) == KErrNone )
+                {
+                CMPXMedia* media;
+                
+                TRAPD( err, media = iMyVideosCollectionClient->GetVideoL( videoNum ) );
+                
+                if( err == KErrNone )
+                    {
+                    TMPXItemId itemId = *(media->Value<TMPXItemId>( KMPXMediaGeneralId ));
+                    
+                    if( media->IsSupported( KMPXMediaGeneralUri ) )
+                        {
+                        const TDesC& path = media->ValueText( KMPXMediaGeneralUri );
+                        message.iFullPath = path;
+                        VCXLOGLO2("CVideoPlayerStartupApiTest:: video file: %S", &path);
+                        }
+                    
+                    message.iServiceId = itemId.iId1;
+                    }
+                else
+                    {
+                    message.iFullPath = _L("c:\\");
+                    message.iServiceId = 60060;
+                    }
+                }
+            }
+            break;
+            
+        case TVideoPlayerActivationMessage::EOpenVideoStorage:
+            {
+            VCXLOGLO1("CVideoPlayerStartupApiTest:: msgType: EOpenVideoStorage");
+            }
+            break;
+            
+        case TVideoPlayerActivationMessage::EOpenInternetVideos:
+            {
+            VCXLOGLO1("CVideoPlayerStartupApiTest:: msgType: EOpenInternetVideos");
+            message.iServiceId = 0;
+            message.iActive = 1;
+            message.iSingle = ETrue;
+            message.iFileId = 0;
+            message.iDrive = 0;
+            message.iFullPath = KNullDesC;
+            }
+            break;
+            
+        case TVideoPlayerActivationMessage::ELaunchServiceById:
+            {
+            VCXLOGLO1("CVideoPlayerStartupApiTest:: msgType: ELaunchServiceById");
+            }
+            break;
+            
+        case TVideoPlayerActivationMessage::EOpenServiceCatalogue:
+            {
+            VCXLOGLO1("CVideoPlayerStartupApiTest:: msgType: EOpenServiceCatalogue");
+            }
+            break;
+            
+        case TVideoPlayerActivationMessage::EOpenVideoShop:
+            {
+            VCXLOGLO1("CVideoPlayerStartupApiTest:: msgType: EOpenVideoShop");
+            }
+            break;
+            
+        case TVideoPlayerActivationMessage::ELiveTVMessage:
+            {
+            VCXLOGLO1("CVideoPlayerStartupApiTest:: msgType: ELiveTVMessage");
+            }
+            break;
+            
+        case TVideoPlayerActivationMessage::EOpenRecordingsCategory:
+            {
+            VCXLOGLO1("CVideoPlayerStartupApiTest:: msgType: EOpenRecordingsCategory");
+            }
+            break;
+            
+        case TVideoPlayerActivationMessage::EOpenVCSettings:
+            {
+            VCXLOGLO1("CVideoPlayerStartupApiTest:: msgType: EOpenVCSettings");
+            }
+            break;
+            
+        case TVideoPlayerActivationMessage::EOpenVCSettingsFeedSubscriptions:
+            {
+            VCXLOGLO1("CVideoPlayerStartupApiTest:: msgType: EOpenVCSettingsFeedSubscriptions");
+            }
+            break;
+            
+        case TVideoPlayerActivationMessage::EOpenVCSettingsAddFeed:
+            {
+            VCXLOGLO1("CVideoPlayerStartupApiTest:: msgType: EOpenVCSettingsAddFeed");
+            }
+            break;
+            
+        case TVideoPlayerActivationMessage::ELiveTVMessageLastWatched:
+            {
+            VCXLOGLO1("CVideoPlayerStartupApiTest:: msgType: ELiveTVMessageLastWatched");
+            }
+            break;
+            
+        case TVideoPlayerActivationMessage::EOpenVCSettingsLiveTVSubscriptions:
+            {
+            VCXLOGLO1("CVideoPlayerStartupApiTest:: msgType: EOpenVCSettingsLiveTVSubscriptions");
+            }
+            break;
+            
+        case TVideoPlayerActivationMessage::EOpenVCSettingsEditFeed:
+            {
+            VCXLOGLO1("CVideoPlayerStartupApiTest:: msgType: EOpenVCSettingsEditFeed");
+            }
+            break;
+        default:
+            break;
+        }
+    
+    TRAPD( err, SendActivationMessageL( message ) );
+    
+    VCXLOGLO1("<<<CVideoPlayerStartupApiTest::ActivationMessageL");
+    return err;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoPlayerStartupApiTest::KillFusionL
+// -----------------------------------------------------------------------------
+//
+TInt CVideoPlayerStartupApiTest::KillFusionL( CStifItemParser& aItem )
+    {
+    VCXLOGLO1(">>>CVideoPlayerStartupApiTest::KillFusionL");
+    // Print to UI
+    _LIT( KVideoPlayerStartupApiTest, "VideoPlayerStartupApiTest" );
+    _LIT( KWhere, "In KillFusionL" );
+    TestModuleIf().Printf( 0, KVideoPlayerStartupApiTest, KWhere );
+    // Print to log file
+    iLog->Log( KWhere );
+    
+    aItem.SetParsingType(CStifItemParser::EQuoteStyleParsing);
+
+    RWsSession session;
+    User::LeaveIfError( session.Connect() );
+    TApaTaskList taskList( session );    
+    TApaTask task = taskList.FindApp( KFusionUid );
+
+    if( task.Exists() )
+        {
+        VCXLOGLO1("CVideoPlayerStartupApiTest:: Ending task.");  
+        task.EndTask();
+        User::After( 3000000 );
+        if( task.Exists() )
+            {
+            VCXLOGLO1("CVideoPlayerStartupApiTest:: Killing task.");
+            task.KillTask();
+            }
+        }
+
+    session.Close();
+
+    // Check the exit reasons for processes.
+    TInt err = CheckProcessExits( iProcessHandles );
+    
+    iProcessHandles.ResetAndDestroy();
+    
+    VCXLOGLO1("<<<CVideoPlayerStartupApiTest::KillFusionL");
+    return err;
+    }
+
+// ----------------------------------------------------------------------------
+// CVideoPlayerStartupApiTest::SendActivationMessageL
+// ----------------------------------------------------------------------------
+//
+void CVideoPlayerStartupApiTest::SendActivationMessageL( TVideoPlayerActivationMessage& aMessage )
+    {
+    VCXLOGLO1(">>>CVideoPlayerStartupApiTest::SendActivationMessageL");
+    TPckg<TVideoPlayerActivationMessage> message( aMessage );
+    
+    RWsSession session;
+    User::LeaveIfError( session.Connect() );
+    TApaTaskList taskList( session );
+    TApaTask task = taskList.FindApp( KFusionUid );
+
+    RPointerArray<HBufC> processesBeforeMessage;
+
+    if( processesBeforeMessage.Count() == 0 )
+        {
+        // Get list of processes before launch
+        GetAllProcessNames( processesBeforeMessage );
+        }
+    
+    TInt err( KErrNone );
+    
+    if( task.Exists() )
+        {
+        VCXLOGLO1( "CVideoPlayerStartupApiTest:: Task exists, bringing to fore." );
+        iLog->Log( _L("CVideoPlayerStartupApiTest:: Task exists, bringing to fore.") );
+        
+        task.BringToForeground();
+
+        TUid play = TUid::Uid( KVideoPlayerVodStartPlayer );
+        TInt error = task.SendMessage( play, message );
+        }
+    else
+        {                                
+        VCXLOGLO1( "CVideoPlayerStartupApiTest:: Starting app." );
+        iLog->Log( _L("CVideoPlayerStartupApiTest:: Starting app.") );
+        
+        RApaLsSession lsSession;
+        User::LeaveIfError( lsSession.Connect() );
+
+        VCXLOGLO1( "CVideoPlayerStartupApiTest:: Session ok." );
+        iLog->Log( _L("CVideoPlayerStartupApiTest:: Session ok.") );
+
+        TApaAppInfo appInfo;
+        
+        err = lsSession.GetAppInfo( appInfo, KFusionUid );
+
+        if ( err == KErrNone )
+            {
+            CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
+            cmdLine->SetExecutableNameL( appInfo.iFullName );                            
+            cmdLine->SetTailEndL( message );
+
+            VCXLOGLO1( "CVideoPlayerStartupApiTest:: Start it." );
+            iLog->Log( _L("CVideoPlayerStartupApiTest:: Start it.") );
+
+            User::LeaveIfError( lsSession.StartApp( *cmdLine ) );
+            CleanupStack::PopAndDestroy( cmdLine );
+            }
+        else
+            {
+            VCXLOGLO2( "CVideoPlayerStartupApiTest:: GetAppInfo ret: %d.", err );
+            iLog->Log( _L("CVideoPlayerStartupApiTest:: GetAppInfo ret: %d."), err );
+            }
+        
+        lsSession.Close();
+        }
+    
+    session.Close();
+    
+    // Get process handles for the new processes
+    GetHandlesForNewProcessesL( processesBeforeMessage, iProcessHandles );
+    
+    processesBeforeMessage.ResetAndDestroy();
+    
+    if( iProcessHandles.Count() < 1 )
+        {
+        VCXLOGLO1("CVideoPlayerStartupApiTest:: ERROR, No new processes detected.");
+        iLog->Log( _L("CVideoPlayerStartupApiTest:: ERROR, No new processes detected.") );
+        User::Leave( KErrNotFound );
+        }
+    
+    User::LeaveIfError( err );
+    VCXLOGLO1("<<<CVideoPlayerStartupApiTest::SendActivationMessageL");
+    }
+
+// ----------------------------------------------------------------------------
+// CVideoPlayerStartupApiTest::GetAllProcessNames
+// ----------------------------------------------------------------------------
+//
+void CVideoPlayerStartupApiTest::GetAllProcessNames( RPointerArray<HBufC>& aArray )
+    {
+    VCXLOGLO1(">>>CVideoPlayerStartupApiTest::GetAllProcessNames");
+    
+    TFindProcess findProcess;
+    TFullName result;
+    
+    // Process count zero, populate array
+    if( aArray.Count() <= 0 )
+        {
+        while( findProcess.Next(result) == KErrNone )
+            {
+            TRAP_IGNORE( 
+                aArray.Append( result.AllocL() );
+                );
+            VCXLOGLO2("CVideoPlayerStartupApiTest: process: %S", &result);
+            iLog->Log( _L("CVideoPlayerStartupApiTest: process: %S"), &result );
+            }    
+        }
+    
+    VCXLOGLO1("<<<CVideoPlayerStartupApiTest::GetAllProcessNames");
+    }
+
+// ----------------------------------------------------------------------------
+// CVideoPlayerStartupApiTest::GetHandlesForNewProcessesL
+// ----------------------------------------------------------------------------
+//
+void CVideoPlayerStartupApiTest::GetHandlesForNewProcessesL( RPointerArray<HBufC>& aExistingProcesses,
+    RPointerArray<CTestProcess>& aHandles )
+    {
+    VCXLOGLO1(">>>CVideoPlayerStartupApiTest::GetHandlesForNewProcessesL");
+    
+    TFindProcess findProcess;
+    TFullName processName;
+       
+    while( findProcess.Next( processName ) == KErrNone )
+        {
+        TInt found = EFalse;
+        for( TInt i = 0; i < aExistingProcesses.Count(); i++ )
+            {
+            if( aExistingProcesses[i]->Des().CompareF( processName ) == KErrNone )
+                {
+                found = ETrue;
+                }
+            }
+            
+        if( !found )
+            {
+            CTestProcess* p = CTestProcess::NewL();
+            TInt err = p->iProcess.Open( processName );
+            if( err == KErrNone )
+                {
+                CleanupStack::PushL( p );
+                p->iName = processName.AllocL();
+                CleanupStack::Pop( p );
+                aHandles.Append( p );
+                }
+            VCXLOGLO3("CVideoPlayerStartupApiTest:: new process: '%S, open result: %d", &processName, err );
+            }
+        }
+
+    VCXLOGLO1("<<<CVideoPlayerStartupApiTest::GetHandlesForNewProcessesL");
+    }
+
+// ----------------------------------------------------------------------------
+// CVideoPlayerStartupApiTest::CheckProcessExits
+// ----------------------------------------------------------------------------
+//
+TInt CVideoPlayerStartupApiTest::CheckProcessExits( RPointerArray<CTestProcess>& aHandles )
+    {
+    VCXLOGLO1(">>>CVideoPlayerStartupApiTest::CheckProcessExits");
+    
+    TInt err( KErrNone );
+   
+    for( TInt i=0; i<aHandles.Count(); i++ )
+        {
+        CTestProcess* p = aHandles[i];
+        if( p )
+            {
+            VCXLOGLO2("CVideoPlayerStartupApiTest:: Process: %S", p->iName );
+            
+            TInt exitType =  p->iProcess.ExitType();
+            TInt exitReason = p->iProcess.ExitReason();
+            TExitCategoryName exitCatName = p->iProcess.ExitCategory();
+            
+            VCXLOGLO2("CVideoPlayerStartupApiTest:: Exit type: %d", exitType);
+            VCXLOGLO2("CVideoPlayerStartupApiTest:: Exit reason: %d", exitReason );
+            VCXLOGLO2("CVideoPlayerStartupApiTest:: Exit category: %S", &exitCatName);
+            
+            iLog->Log(_L("CVideoPlayerStartupApiTest:: Exit type: %d"), exitType);
+            iLog->Log(_L("CVideoPlayerStartupApiTest:: Exit reason: %d"), exitReason );
+            iLog->Log(_L("CVideoPlayerStartupApiTest:: Exit category: %S"), &exitCatName);
+            
+            if( exitReason != KErrNone || (exitType != EExitPending && exitType != EExitKill) )
+                {
+                err = ( exitReason != KErrNone ) ? exitReason : exitType;   
+                VCXLOGLO2("CVideoPlayerStartupApiTest:: Error with the process: %d.", err);
+                iLog->Log( _L("CVideoPlayerStartupApiTest:: Error with the process: %d."), err );
+                }
+            }
+        }
+    
+    VCXLOGLO1("<<<CVideoPlayerStartupApiTest::CheckProcessExits");
+    return err;
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoPlayerStartupApiTest::VideoEventL
+// -----------------------------------------------------------------------------
+//
+void CVideoPlayerStartupApiTest::VideoEventL( TVCXTestVideoEvent aEvent, 
+        TUint32 aParam1, TUint32 aParam2, TInt aError )
+    {
+    VCXLOGLO1(">>>CVideoPlayerStartupApiTest::VideoEventL");
+    
+    VCXLOGLO5("CVideoPlayerStartupApiTest::VideoEventL: aEvent: %d, aParam1: %d, aParam2: %d, aError: %d", aEvent, aParam1, aParam2, aError);
+    iMessageWait->ReceiveMessage( aEvent, aError );
+    
+    VCXLOGLO1("<<<CVideoPlayerStartupApiTest::VideoEventL");
+    }
+
+
+// -----------------------------------------------------------------------------
+// CVideoPlayerStartupApiTest::MessageWaitComplete
+// -----------------------------------------------------------------------------
+//
+void CVideoPlayerStartupApiTest::MessageWaitComplete( TInt aError )
+    {
+    if( aError != KErrNone )
+        {
+        VCXLOGLO1("CVideoPlayerStartupApiTest:: Message wait TIMEOUT!");
+        iCollectionError = aError;
+        }
+    }
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+// None
+
+//  [End of File] - Do not remove
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayer_plat/videoplayer_startup_api/videoplayer_startup_api.metaxml	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,17 @@
+<?xml version="1.0" ?>
+<api id="ecf886ae0f92194cb5b95ad2258fcdc8" dataversion="2.0">
+  <name>Videoplayer Startup API</name>
+  <description>Defines types that can be used in custom message when starting video player</description>
+  <type>c++</type>
+  <collection>videoplayerapp</collection>
+  <libs>
+  </libs>
+  <release category="platform"/>
+  <attributes>
+     <!-- This indicates wether the api provedes separate html documentation -->
+     <!-- or is the additional documentation generated from headers. -->
+     <!-- If you are unsuere then the value is "no" -->
+     <htmldocprovided>no</htmldocprovided>
+     <adaptation>no</adaptation>
+  </attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,28 @@
+/*
+* 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:  This file provides the information required for building the
+*               videoplayerapp collection
+*
+*/
+
+// Version : %version: ou1cpsw#4 %
+
+
+
+#include <platform_paths.hrh>
+
+#include "../lwplayer/group/bld.inf"
+#include "../mpxvideoplayer/group/bld.inf"
+
+// EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/lwplayer/data/lwplayer.rss	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,110 @@
+/*
+* 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 "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:  This file contains all the resources for the lwplayer.exe
+ *
+*/
+
+// Version : %version: 3 %
+
+
+
+//  
+//  RESOURCE IDENTIFIER
+//
+NAME    AWIZ // 4 letter ID
+
+//  
+//  INCLUDES
+//
+#include <eikon.rh>
+#include <avkon.rsg>
+#include <avkon.mbg>
+#include <avkon.rh>
+#include <avkon.loc>
+#include <appinfo.rh>
+
+#include <lwplayer.loc>
+
+//----------------------------------------------------
+//
+//    RSS_SIGNATURE
+//
+//----------------------------------------------------
+RESOURCE RSS_SIGNATURE { }
+
+//----------------------------------------------------
+//   
+//    TBUF
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF { buf="lwplayer"; }
+
+//----------------------------------------------------
+//
+//    EIK_APP_INFO
+//
+//----------------------------------------------------
+RESOURCE EIK_APP_INFO
+    {
+    status_pane = r_lwplayer_status_pane;
+    }
+
+
+// ---------------------------------------------------
+//
+//    r_lwp_localisable_app_info 
+//
+// ---------------------------------------------------
+//
+RESOURCE LOCALISABLE_APP_INFO r_lwp_localisable_app_info
+    {
+    caption_and_icon = 
+    CAPTION_AND_ICON_INFO
+        {
+        number_of_icons = 0;
+        };
+    }
+
+//----------------------------------------------------
+//
+//    r_lwplayer_status_pane
+//
+//----------------------------------------------------
+RESOURCE STATUS_PANE_APP_MODEL r_lwplayer_status_pane
+    {
+    layout = R_AVKON_STATUS_PANE_LAYOUT_EMPTY;
+    }
+
+// ---------------------------------------------------
+//
+//    r_lwp_clip_missing
+//
+// ---------------------------------------------------
+RESOURCE TBUF r_lwp_clip_missing
+    {
+    buf = qtn_lwp_note_missing;
+    }
+
+// ---------------------------------------------------
+//
+//    r_lwp_invalid_clip
+//
+// ---------------------------------------------------
+RESOURCE TBUF r_lwp_invalid_clip
+    {
+    buf = qtn_lwp_note_invalid_clip;
+    }
+
+// EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/lwplayer/data/lwplayer_reg.rss	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2006 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: This file contains all the resources for the lwplayer.exe
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+#include <appinfo.rh>
+#include <data_caging_paths_strings.hrh>
+#include <lwplayer.rsg>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x102824CD
+
+RESOURCE APP_REGISTRATION_INFO
+    {
+    app_file = "LWPlayer";
+    localisable_resource_file = APP_RESOURCE_DIR"\\lwplayer";
+    localisable_resource_id = R_LWP_LOCALISABLE_APP_INFO;
+    hidden=KAppIsHidden;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/lwplayer/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,38 @@
+/*
+* 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 "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:  This file provides the information required for building the Lightweight Player
+*
+*/
+
+// Version : %version: 6 %
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+//
+//  Export the loc and iby files for S60 5.0
+//
+../loc/lwplayer.loc             APP_LAYER_LOC_EXPORT_PATH(lwplayer.loc)
+../rom/lwplayer.iby             CORE_APP_LAYER_IBY_EXPORT_PATH(lwplayer.iby)
+../rom/lwplayerresources.iby    LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(lwplayerresources.iby)
+
+PRJ_MMPFILES
+lwplayer.mmp
+
+// EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/lwplayer/group/lwplayer.mmp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,70 @@
+/*
+* Copyright (c) 2002-2007 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:  Makefile for MediaPlayer.app
+*
+*/
+
+// Version : %version: 6 %
+
+
+#include <data_caging_paths.hrh>
+#include <bldvariant.hrh>
+#include <platform_paths.hrh>
+
+TARGET            lwplayer.exe
+TARGETTYPE        exe
+UID               0x100039CE 0x102824CD
+EPOCSTACKSIZE     0x5000
+
+
+CAPABILITY      CAP_APPLICATION DRM DiskAdmin MultimediaDD
+VENDORID        VID_DEFAULT
+
+SOURCEPATH      ../src
+SOURCE          lwplayerapp.cpp
+SOURCE          lwplayerappui.cpp
+SOURCE          lwplayerdocument.cpp
+
+USERINCLUDE ../inc
+USERINCLUDE  ../../../inc
+
+APP_LAYER_SYSTEMINCLUDE
+
+START RESOURCE  ../data/lwplayer.rss
+TARGETPATH      APP_RESOURCE_DIR
+HEADER
+LANGUAGE_IDS
+END
+
+START RESOURCE  ../data/lwplayer_reg.rss
+DEPENDS lwplayer.rsg
+TARGETPATH      /private/10003a3f/apps
+END
+
+LIBRARY apgrfx.lib
+LIBRARY apmime.lib
+LIBRARY apparc.lib
+LIBRARY avkon.lib
+LIBRARY commonui.lib
+LIBRARY commonengine.lib
+LIBRARY cone.lib
+LIBRARY efsrv.lib
+LIBRARY estor.lib
+LIBRARY euser.lib
+LIBRARY eikcore.lib
+LIBRARY flogger.lib
+LIBRARY servicehandler.lib
+LIBRARY ws32.lib
+
+// EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/lwplayer/inc/lwplayerapp.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,51 @@
+/*
+* 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 "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:  Declares Application for LWPlayer.
+ *
+*/
+
+// Version : %version: 3 %
+
+
+
+#ifndef _LWPLAYERAPP_H_
+#define _LWPLAYERAPP_H_
+
+#include <aknapp.h>
+
+/*
+ * CLWPlayerApp application class.
+ * Provides factory to create concrete document object.
+ * 
+ */
+
+class CLWPlayerApp : public CAknApplication
+{
+    private:
+        /*
+         * From CApaApplication, creates CLWPlayerDocument document object.
+         * @return A pointer to the created document object.
+         */
+        CApaDocument* CreateDocumentL();
+
+        /*
+         * From CApaApplication, returns application's UID (KUidLWPlayer).
+         * @return The value of KUidLWPlayer.
+         */
+        TUid AppDllUid() const;
+};
+
+#endif // _LWPLAYERAPP_H_
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/lwplayer/inc/lwplayerappui.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,191 @@
+/*
+* Copyright (c) 2002 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:  Declares UI class for LWPlayer application.
+ *
+*/
+
+// Version : %version: 5 %
+
+
+
+#ifndef _LWPLAYERAPPUI_H_
+#define _LWPLAYERAPPUI_H_
+
+#include <aknViewAppUi.h>
+#include <AknServerApp.h>
+
+//
+//  FORWARD DECLARATIONS
+//
+class CDocumentHandler;
+class CAiwGenericParamList;
+
+/*
+ * Application UI class.
+ * Provides support for the following features:
+ * - EIKON control architecture
+ */
+
+class CLWPlayerAppUi : public CAknViewAppUi,
+                       public MAknServerAppExitObserver
+{
+    public:
+        /*
+         * EPOC default constructor.
+         */
+        void ConstructL();
+
+        /*
+         * Destructor.
+         */
+        virtual ~CLWPlayerAppUi();
+
+        // ----------------------------------------------------
+        //  New Methods added for Progressive Download
+        // ----------------------------------------------------
+
+        /*
+         * Process Commandline Parameters
+         */
+        TBool ProcessCommandParametersL( CApaCommandLine& aCommandLine );
+
+        /*
+         * Extract Generic Parameters
+         */
+        void ExtractGenericParamsL( const TDesC8& aParams );
+
+        /*
+         * Handle DlMgr Message
+         */
+        MCoeMessageObserver::TMessageResponse HandleMessageL(
+                TUint32 aClientHandleOfTWG,
+                TUid aMessageUid,
+                const TDesC8& aMessageParameters);
+
+        /*
+         * From MAknServerAppExitObserver.
+         */
+        void HandleServerAppExit(TInt aReason);
+
+    private:
+        /*
+         * From CEikAppUi, takes care of command handling.
+         * @param aCommand command to be handled
+         */
+        void HandleCommandL( TInt aCommand );
+
+        /*
+         * From CEikAppUi, takes care of error handling.
+         * @param aCommand command to be handled
+         */
+        void HandleErrorL( TInt aError );
+
+        /*
+         *  LaunchMediaPlayerL
+         *
+         *  Uses the document handler framework to open a file
+         *  Used to create the embedded media player
+         *
+         *  @since S60 3.2
+         *  @param afilename   filename of clip to be opened
+         *  @param aparamList  list of parameters for progressive download
+         *  @return error code
+         */
+        TInt LaunchMediaPlayerL( const TDesC& afilename,
+                                 const CAiwGenericParamList* aparamList );
+
+
+        /*
+         *  SendMessageL
+         *
+         *  Finds the embedded media player and forwards the message
+         *  from the browser to the embedded Media Player
+         *
+         *  @since S60 3.2
+         *  @param aMessageParameters   list of parameters for prog. download
+         *  @return error code
+         */
+        TInt SendMessageL(const TDesC8& aMessageParameters);
+
+        /*
+         *  DocumentHandlerL
+         *
+         *  Returns a reference to the Document Handler.
+         *  Sets this class as an exit observer
+         *
+         *  @since S60 3.2
+         *  @return reference to the document handler
+         */
+        CDocumentHandler& DocumentHandlerL();
+
+        /*
+         *  ActivateClosePlayerActiveObject
+         *
+         *  Starts an active object to close the LWPlayer.
+         *
+         *  @since S60 9.2
+         */
+        void ActivateClosePlayerActiveObject();
+
+        /*
+         *  Called to stop and exit the LWPlayer
+         *  @since 3.2
+         *  @return void
+         */
+        virtual void DoCloseLWPlayerL();
+
+        /*
+         *  Provides the static function for the callback to close the LWPlayer
+         *  Called by CIdle iIdle
+         *  @since 3.2
+         *  @param aPtr Pointer to callback class
+         *  @return KErrNone
+         */
+        static TInt CloseLWPlayerL( TAny* aPtr );
+
+        /*
+         *  Handles the Block Events Timer Timout
+         *  @since 9.2
+         *  @param aPtr Pointer to callback class
+         *  @return KErrNone
+         */
+        static TInt HandleBlockEventsTimeout( TAny* aPtr );
+
+        /*
+         *  Called to unblock events
+         *  @since 9.2
+         *  @return void
+         */
+        void UnblockEvents();
+
+        /*
+         *  Called to block events
+         *  @since 9.2
+         *  @return void
+         */
+        void BlockEvents();
+
+        //
+        //  Member Variables
+        //
+        CDocumentHandler*      iDocHandler;
+        TBool                  iEmbeddedMPCreated;
+        TBool                  iAllowEvents;
+        CIdle*                 iCloseAO;
+        CPeriodic*             iBlockEventsTimer;
+};
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/lwplayer/inc/lwplayerdocument.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,74 @@
+/*
+* Copyright (c) 2002 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:  Declares document for LWPLayer application
+ *
+*/
+
+// Version : %version: 3 %
+
+
+
+#ifndef _LWPLAYERDOCUMENT_H_
+#define _LWPLAYERDOCUMENT_H_
+
+#include <GenericParamConsumer.h>
+
+//
+//  FORWARD DECLARATIONS
+//
+class CEikAppUi;
+class CApaWindowGroupName;
+
+/*
+ *  CLWPlayerDocument application class.
+ */
+
+class CLWPlayerDocument : public CAiwGenericParamConsumer
+{
+    public:
+        /*
+         * Two-phased constructor.
+         */
+        static CLWPlayerDocument* NewL(CEikApplication& aApp);
+
+        /*
+         * Destructor.
+         */
+        virtual ~CLWPlayerDocument();
+
+    private:
+        /*
+         * EPOC default constructor.
+         */
+        CLWPlayerDocument(CEikApplication& aApp);
+
+        /*
+         * Two-phased constructor.
+         */
+        void ConstructL();
+
+        /*
+         * From CEikDocument, create CLWPlayerAppUi "App UI" object.
+         */
+        CEikAppUi* CreateAppUiL();
+
+        /*
+         * From CEikDocument, used to hide icon from task list
+         */
+        void UpdateTaskNameL(CApaWindowGroupName* aWgName);
+};
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/lwplayer/inc/lwpuids.hrh	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,33 @@
+/*
+* 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:  Resource headers for video UIDs
+ *
+*/
+
+// Version : %version: 3 %
+
+
+
+
+#ifndef __LWPUIDS_HRH__
+#define __LWPUIDS_HRH__
+
+// CONSTANTS
+
+const TUid KLWPLAYERUID = { 0x102824CD };
+const TUid KFUSIONPLAYERUID = { 0x200159B2 };
+
+#endif  // __LWPUIDS_HRH__
+
+// EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/lwplayer/loc/lwplayer.loc	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,32 @@
+/*
+* 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 "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:  Localisation strings for lwplayer app.
+*
+*/
+
+// Version : %version: 4 %
+
+
+
+// d:Missing clip information note.
+// d:Shown when media clip is not found.
+// l:popup_note_window
+// r:5.2
+#define qtn_lwp_note_missing "File missing"
+
+// d:Invalid clip information note.
+// d:Shown when media could not be opened.
+// l:popup_note_window
+// r:5.2
+#define qtn_lwp_note_invalid_clip "Invalid Clip. Operation canceled."
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/lwplayer/rom/lwplayer.iby	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,33 @@
+/*
+* 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 "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:  IBY for lwplayer.exe
+*
+*/
+
+// Version : %version: 4 %
+
+
+#ifndef __LWPLAYER_IBY__
+#define __LWPLAYER_IBY__
+
+#ifdef RD_BROWSER_PROGRESSIVE_DOWNLOAD
+
+REM Light Weight Player
+
+S60_APP_EXE(lwplayer)
+data = ZPRIVATE\10003a3f\apps\lwplayer_reg.rsc          PRIVATE\10003a3f\import\apps\lwplayer_reg.rsc
+
+#endif // RD_BROWSER_PROGRESSIVE_DOWNLOAD
+
+#endif //__LWPLAYER_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/lwplayer/rom/lwplayerresources.iby	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,32 @@
+/*
+* 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 "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:  IBY for lwplayer.exe
+*
+*/
+
+// Version : %version: 3 %
+
+
+#ifndef __LWPLAYERRESOURCES_IBY__
+#define __LWPLAYERRESOURCES_IBY__
+
+#ifdef RD_BROWSER_PROGRESSIVE_DOWNLOAD
+
+REM Light Weight Player
+
+data = DATAZ_\APP_RESOURCE_DIR\lwplayer.rsc     APP_RESOURCE_DIR\lwplayer.rsc
+
+#endif // RD_BROWSER_PROGRESSIVE_DOWNLOAD
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/lwplayer/src/lwplayerapp.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,80 @@
+/*
+* 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:  Implementation of CLWPLayerApp
+ *
+*/
+
+// Version : %version: 4 %
+
+
+#include <eikstart.h>
+
+#include "lwplayerapp.h"
+#include "lwplayerdocument.h"
+#include "lwpuids.hrh"
+#include "mpxvideo_debug.h"
+
+
+// -----------------------------------------------------------------------------
+// CLWPlayerApp::AppDllUid()
+// Returns application UID
+// -----------------------------------------------------------------------------
+//
+TUid CLWPlayerApp::AppDllUid() const
+{
+    MPX_DEBUG(_L("CLWPlayerApp::AppDllUid()"));
+
+    return KLWPLAYERUID;
+}
+
+// -----------------------------------------------------------------------------
+// CLWPlayerApp::CreateDocumentL()
+// Creates CLWPlayerDocument object
+// -----------------------------------------------------------------------------
+//
+CApaDocument* CLWPlayerApp::CreateDocumentL()
+{
+    MPX_DEBUG(_L("CLWPlayerApp::CreateDocumentL()"));
+
+    return CLWPlayerDocument::NewL( *this );
+}
+
+// ========================= OTHER EXPORTED FUNCTIONS ==========================
+//
+// -----------------------------------------------------------------------------
+// NewApplication()
+// Constructs CLWPlayerApp
+// Returns: created application object
+// -----------------------------------------------------------------------------
+//
+LOCAL_C CApaApplication* NewApplication()
+{
+    MPX_DEBUG(_L("CLWPlayerApp NewApplication()"));
+
+    return new CLWPlayerApp;
+}
+
+// -----------------------------------------------------------------------------
+// E32Main
+// An entry point
+// -----------------------------------------------------------------------------
+//
+GLDEF_C TInt E32Main()
+{
+    MPX_DEBUG(_L("CLWPlayerApp E32Main()"));
+
+    return EikStart::RunApplication(NewApplication);
+}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/lwplayer/src/lwplayerappui.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,528 @@
+/*
+* 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:  Implementation of CLWPLayerAppUi
+ *
+*/
+
+// Version : %version: 8 %
+
+
+#include <DocumentHandler.h>
+#include <s32mem.h>
+#include <AiwGenericParam.h>
+#include <apgwgnam.h>
+#include <lwplayer.rsg>
+#include <aknappui.h>
+#include <StringLoader.h>
+#include <aknnotewrappers.h>
+#include <videoplayeractivationmessage.h>
+
+#include "lwplayerappui.h"
+#include "lwpuids.hrh"
+#include "mpxvideo_debug.h"
+
+const TInt KEVENTBLOCKTIMEOUT = 1000000;
+
+// -----------------------------------------------------------------------------
+//  CLWPlayerAppUi::ConstructL
+//  Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CLWPlayerAppUi::ConstructL()
+{
+    MPX_DEBUG(_L("CLWPlayerAppUi::ConstructL()"));
+
+    BaseConstructL( EAknEnableSkin );
+
+    iEmbeddedMPCreated = EFalse;
+
+    iAllowEvents = ETrue;
+
+    iCloseAO = CIdle::NewL( CActive::EPriorityStandard );
+
+    iBlockEventsTimer = CPeriodic::NewL( CActive::EPriorityStandard );
+}
+
+// -----------------------------------------------------------------------------
+//  CLWPlayerAppUi::~CLWPlayerAppUi()
+//  Destructor
+//  Frees reserved resources
+// -----------------------------------------------------------------------------
+//
+CLWPlayerAppUi::~CLWPlayerAppUi()
+{
+    MPX_DEBUG(_L("CLWPlayerAppUi::~CLWPlayerAppUi()"));
+
+    delete iDocHandler;
+
+    if ( iCloseAO )
+    {
+        delete iCloseAO;
+        iCloseAO = NULL;
+    }
+
+    if ( iBlockEventsTimer )
+    {
+        iBlockEventsTimer->Cancel();
+        delete iBlockEventsTimer;
+        iBlockEventsTimer = NULL;
+    }
+}
+
+// -----------------------------------------------------------------------------
+// CLWPlayerAppUi::HandleCommandL
+// -----------------------------------------------------------------------------
+//
+void CLWPlayerAppUi::HandleCommandL(TInt aCommand)
+{
+    MPX_DEBUG(_L("CLWPlayerAppUi::HandleCommandL(%d)"), aCommand);
+
+    switch ( aCommand )
+    {
+        case EAknSoftkeyBack:
+        case EEikCmdExit:
+            Exit();
+            break;
+        default:
+            break;
+    }
+}
+
+// -----------------------------------------------------------------------------
+//  New Methods added for Progressive Download
+// -----------------------------------------------------------------------------
+
+// -----------------------------------------------------------------------------
+//  CLWPlayerAppUi::ProcessCommandParametersL
+//
+//  When Prog Download is started, RApaLsSession creates
+//  this Document and calls ProcessCommandParametersL.
+// -----------------------------------------------------------------------------
+//
+TBool CLWPlayerAppUi::ProcessCommandParametersL( CApaCommandLine& aCommandLine )
+{
+    MPX_DEBUG(_L("CLWPlayerAppUi::ProcessCommandParametersL()"));
+
+    //
+    //  Since download manager can send multiple events with the same data
+    //  Block events from Download Manager for a short time
+    //
+    BlockEvents();
+
+    //
+    //  Convert aFilename to 8-bit and convert to generic params
+    //
+    TPtrC param = aCommandLine.DocumentName();
+
+    if ( param.Length() )
+    {
+        HBufC8* param8 = HBufC8::NewLC( param.Length() );
+        param8->Des().Copy( param );
+        ExtractGenericParamsL( *param8 );
+        CleanupStack::PopAndDestroy( param8 );
+    }
+
+    return ETrue;
+}
+
+// -----------------------------------------------------------------------------
+// CLWPlayerAppUi::HandleMessageL
+// -----------------------------------------------------------------------------
+//
+MCoeMessageObserver::TMessageResponse
+CLWPlayerAppUi::HandleMessageL( TUint32 aClientHandleOfTWG,
+                                TUid aMessageUid,
+                                const TDesC8& aMessageParameters )
+{
+    MPX_DEBUG(_L("CLWPlayerAppUi::HandleMessageL()"));
+
+    if ( iAllowEvents && iEmbeddedMPCreated )
+    {
+        //
+        //  pass the message to Media Player
+        //
+        SendMessageL( aMessageParameters );
+
+        //
+        //  Since download manager can send multiple events with the same data
+        //  Block events from Download Manager for a short time
+        //
+        BlockEvents();
+    }
+
+    return CAknAppUi::HandleMessageL( aClientHandleOfTWG,
+                                      aMessageUid,
+                                      aMessageParameters );
+}
+
+// -----------------------------------------------------------------------------
+// CLWPlayerAppUi::ExtractGenericParamsL
+// -----------------------------------------------------------------------------
+//
+void CLWPlayerAppUi::ExtractGenericParamsL( const TDesC8& aParams )
+{
+    MPX_DEBUG(_L("CLWPlayerAppUi::ExtractGenericParamsL()"));
+
+    CBufFlat* paramBuf = CBufFlat::NewL( /*anExpandSize*/1 );
+    CleanupStack::PushL( paramBuf );
+    paramBuf->InsertL( 0, aParams );
+    RBufReadStream readStream( *paramBuf );
+
+    CAiwGenericParamList* genParList = CAiwGenericParamList::NewLC(readStream);
+
+    TInt index = 0;
+
+    //
+    //  Unpack fileName
+    //
+    const TAiwGenericParam* paramFileName =
+        genParList->FindFirst( index, EGenericParamFile, EVariantTypeDesC );
+
+    TPtrC fileName;
+
+    //
+    //  If the parameter was not found, KErrNotFound is returned
+    //
+    if ( index == KErrNotFound )
+    {
+        //
+        //  Invalid parameter listing.  Set error so message will
+        //  be displayed and LWP will exit
+        //
+        HandleErrorL( KErrArgument );
+    }
+    else
+    {
+        fileName.Set( paramFileName->Value().AsDes() );
+
+        MPX_DEBUG(_L("    filename = %S"), &fileName);
+
+        if ( ! iEmbeddedMPCreated )
+        {
+            //
+            //  Launch the Media Player for ProgDL playback
+            //  Ignore the errors since the Media Player is
+            //  responsible for all error messages once launched.
+            //
+            MPX_TRAPD( err, LaunchMediaPlayerL( fileName, genParList ) );
+
+            if ( err != KErrNone )
+            {
+                ActivateClosePlayerActiveObject();
+            }
+        }
+    }
+
+    CleanupStack::PopAndDestroy( genParList );
+    CleanupStack::PopAndDestroy( paramBuf );
+}
+
+TInt
+CLWPlayerAppUi::LaunchMediaPlayerL( const TDesC& afilename,
+                                    const CAiwGenericParamList* aparamList )
+{
+    MPX_ENTER_EXIT(_L("CLWPlayerAppUi::LaunchMediaPlayerL()"),
+                   _L("afilename = %S"), &afilename );
+
+    //
+    //  The download manager has already performed recognition on the file
+    //  using the cenrep keys.  The LW Player should always launch the MP in
+    //  embedded mode.  Using the MP UID to ensure that it is used.
+    //
+    TDataType datatype( KFUSIONPLAYERUID );
+
+    CDocumentHandler& handler = DocumentHandlerL();
+
+    RFile file;
+
+    //
+    //  Call the document handler to open the file
+    //  It will leave if the filename is not present
+    //
+    MPX_TRAPD( err, handler.OpenTempFileL( afilename, file ));
+
+    if ( err == KErrNotFound )
+    {
+        HandleErrorL( err );
+    }
+    else if ( err != KErrNone )
+    {
+        User::Leave( err );
+    }
+    else
+    {
+        CleanupClosePushL( file );
+
+        MPX_TRAPD( err, handler.OpenFileEmbeddedL( file, datatype, *aparamList ) );
+
+        //
+        //  ignore some document handler errors
+        //
+        if ( err == KErrServerTerminated )
+        {
+            //
+            //  Document handler leaves with -15 if end key is pressed when
+            //  embedded application is not fully started or embedded
+            //  application panics in start up.  So we can only close the
+            //  App in this point and hope that user is press end key
+            //
+            ActivateClosePlayerActiveObject();
+        }
+        else if ( err != KErrNone )
+        {
+            //  Reset error since it was handled here and
+            //  the program will exit
+            //
+            User::Leave( err );
+        }
+
+        iEmbeddedMPCreated = ETrue;
+
+        CleanupStack::PopAndDestroy( &file ); // file.Close()
+    }
+
+    return KErrNone;
+}
+
+CDocumentHandler& CLWPlayerAppUi::DocumentHandlerL()
+{
+    MPX_DEBUG(_L("CLWPlayerAppUi::DocumentHandlerL()"));
+
+    if ( !iDocHandler )
+    {
+        iDocHandler = CDocumentHandler::NewL();
+    }
+
+    iDocHandler->SetExitObserver( this );
+
+    return *iDocHandler;
+}
+
+// -----------------------------------------------------------------------------
+// CLWPlayerAppUi::NotifyExit
+// Called when user exits
+// -----------------------------------------------------------------------------
+//
+void CLWPlayerAppUi::HandleServerAppExit(TInt aReason)
+{
+    MPX_DEBUG(_L("CLWPlayerAppUi::HandleServerAppExit(%d)"), aReason);
+
+    //
+    //  should exit here - MP terminated, if MP BACK it will bring up Browser
+    //
+    ActivateClosePlayerActiveObject();
+}
+
+// -----------------------------------------------------------------------------
+// CLWPlayerAppUi::SendMessageL
+// -----------------------------------------------------------------------------
+//
+TInt CLWPlayerAppUi::SendMessageL(const TDesC8& aMessageParameters)
+{
+    MPX_DEBUG(_L("CLWPlayerAppUi::SendMessageL()"));
+
+    TInt ret = KErrNone;
+
+    //
+    //  find the task number of the Media Player which is playing
+    //  the ProgDL
+    //
+    RArray<RWsSession::TWindowGroupChainInfo> wgs;
+    User::LeaveIfError(iCoeEnv->WsSession().WindowGroupList(0, &wgs));
+    TBool progDLWindowGroup = EFalse;
+    TInt count = wgs.Count();
+    TInt LWPwgId=0;
+
+    CApaWindowGroupName::FindByAppUid( KLWPLAYERUID ,
+                                       iCoeEnv->WsSession(),
+                                       LWPwgId );
+
+    TApaTask task( iCoeEnv->WsSession() );
+
+    //
+    //  initialise task to non-existant task
+    //
+    task.SetWgId( 0 );
+
+    //
+    //  wgId = 0 tells FindAppByUid to start looking for apps
+    //
+    TInt wgId = 0;
+
+    while ( ( wgId != KErrNotFound ) && ! progDLWindowGroup )
+    {
+        CApaWindowGroupName::FindByAppUid( KFUSIONPLAYERUID,
+                                           iCoeEnv->WsSession(),
+                                           wgId );
+
+        for ( TInt i=0 ; i<count ; i++ )
+        {
+            const RWsSession::TWindowGroupChainInfo& info = wgs[i];
+
+            // find the window group id and check that it's parent id is LWP
+            if ( info.iId == wgId && info.iParentId == LWPwgId )
+            {
+                progDLWindowGroup = ETrue;
+                break;
+            }
+        }
+    };
+
+    wgs.Close();
+
+    if ( progDLWindowGroup )
+    {
+        task.SetWgId(wgId);
+    }
+
+    if ( task.Exists() )
+    {
+        task.BringToForeground();
+
+        //
+        //  8-bit buffer is required.
+        //  Uid is not used
+        //
+        ret = task.SendMessage( TUid::Uid( KVideoPlayerStartPDlPlayer ), aMessageParameters );
+    }
+
+    return ret;
+}
+
+// -----------------------------------------------------------------------------
+//  CLWPlayerAppUi::HandleErrorL
+// -----------------------------------------------------------------------------
+//
+void CLWPlayerAppUi::HandleErrorL( TInt aError )
+{
+    MPX_DEBUG(_L("CLWPlayerAppUi::HandleErrorL(%d)"), aError);
+
+    HBufC* text;
+
+    switch ( aError )
+    {
+        case KErrNotFound:
+        {
+            text = StringLoader::LoadLC( R_LWP_CLIP_MISSING );
+            break;
+        }
+        case KErrArgument:
+        default:
+        {
+            text = StringLoader::LoadLC( R_LWP_INVALID_CLIP );
+            break;
+        }
+    }
+
+    CAknInformationNote* dlg = new (ELeave) CAknInformationNote(ETrue);
+    dlg->ExecuteLD( text->Des() );
+    CleanupStack::PopAndDestroy(text);
+
+    //
+    //  After the error message, Exit the Light Weight Player
+    //
+    ActivateClosePlayerActiveObject();
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CLWPlayerAppUi::ActivateClosePlayerActiveObject
+// -------------------------------------------------------------------------------------------------
+//
+void CLWPlayerAppUi::ActivateClosePlayerActiveObject()
+{
+    MPX_ENTER_EXIT(_L("CLWPlayerAppUi::ActivateClosePlayerActiveObject()"));
+
+    if ( ! iCloseAO->IsActive() )
+    {
+        iCloseAO->Start( TCallBack( CLWPlayerAppUi::CloseLWPlayerL, this ) );
+    }
+}
+
+// -----------------------------------------------------------------------------
+//   CLWPlayerAppUi::ClosePlayerL
+// -----------------------------------------------------------------------------
+//
+TInt CLWPlayerAppUi::CloseLWPlayerL( TAny* aPtr )
+{
+    MPX_DEBUG(_L("CLWPlayerAppUi::ClosePlayerL()"));
+
+    static_cast<CLWPlayerAppUi*>(aPtr)->DoCloseLWPlayerL();
+    return KErrNone;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CLWPlayerAppUi::DoClosePlayerL
+// -------------------------------------------------------------------------------------------------
+//
+void CLWPlayerAppUi::DoCloseLWPlayerL()
+{
+    MPX_ENTER_EXIT(_L("CLWPlayerAppUi::DoClosePlayerL()"));
+
+    HandleCommandL( EEikCmdExit );
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CLWPlayerAppUi::HandleBlockEventsTimeout
+// -------------------------------------------------------------------------------------------------
+//
+TInt CLWPlayerAppUi::HandleBlockEventsTimeout( TAny* aPtr )
+{
+    MPX_DEBUG(_L("CLWPlayerAppUi::HandleEventBlockTimeout()"));
+
+    static_cast<CLWPlayerAppUi*>(aPtr)->UnblockEvents();
+
+    return KErrNone;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CLWPlayerAppUi::BlockEvents
+// -------------------------------------------------------------------------------------------------
+//
+void CLWPlayerAppUi::BlockEvents()
+{
+    MPX_DEBUG(_L("CLWPlayerAppUi::BlockEvents()"));
+
+    //
+    //  Message received from Browser
+    //  Block other messages for 1 second to prevent double click errors
+    //
+    iAllowEvents = EFalse;
+
+    if ( iBlockEventsTimer->IsActive() )
+    {
+        iBlockEventsTimer->Cancel();
+    }
+
+    iBlockEventsTimer->Start( KEVENTBLOCKTIMEOUT,
+                              0,
+                              TCallBack( CLWPlayerAppUi::HandleBlockEventsTimeout, this ) );
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CLWPlayerAppUi::UnblockEvents
+// -------------------------------------------------------------------------------------------------
+//
+void CLWPlayerAppUi::UnblockEvents()
+{
+    MPX_DEBUG(_L("CLWPlayerAppUi::UnblockEvents()"));
+
+    iAllowEvents = ETrue;
+
+    if ( iBlockEventsTimer->IsActive() )
+    {
+        iBlockEventsTimer->Cancel();
+    }
+}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/lwplayer/src/lwplayerdocument.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,100 @@
+/*
+* 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:  Implementation of CLWPlayerDocument
+ *
+*/
+
+// Version : %version: 4 %
+
+
+#include <apgwgnam.h>
+#include <AiwGenericParam.h>
+#include "lwplayerdocument.h"
+#include "lwplayerappui.h"
+#include "mpxvideo_debug.h"
+
+// -----------------------------------------------------------------------------
+//  CLWPlayerDocument::CLWPlayerDocument
+//  C++ default constructor can NOT contain any code, that
+//  might leave.
+// -----------------------------------------------------------------------------
+//
+CLWPlayerDocument::CLWPlayerDocument(CEikApplication& aApp)
+    : CAiwGenericParamConsumer(aApp)
+{
+    MPX_DEBUG(_L("CLWPlayerDocument::CLWPlayerDocument()"));
+}
+
+// -----------------------------------------------------------------------------
+// CLWPlayerDocument::~CLWPlayerDocument
+// Destructor
+// Frees reserved resources
+// -----------------------------------------------------------------------------
+//
+CLWPlayerDocument::~CLWPlayerDocument()
+{
+    MPX_DEBUG(_L("CLWPlayerDocument::~CLWPlayerDocument()"));
+}
+
+// -----------------------------------------------------------------------------
+// CLWPlayerDocument::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void
+CLWPlayerDocument::ConstructL()
+{
+    MPX_DEBUG(_L("CLWPlayerDocument::ConstructL()"));
+}
+
+// -----------------------------------------------------------------------------
+// CLWPlayerDocument::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CLWPlayerDocument* CLWPlayerDocument::NewL(CEikApplication& aApp)
+{
+    MPX_DEBUG(_L("CLWPlayerDocument::NewL()"));
+
+    CLWPlayerDocument* self = new (ELeave) CLWPlayerDocument( aApp );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+}
+
+// -----------------------------------------------------------------------------
+// CLWPlayerDocument::CreateAppUiL()
+// constructs CLWPlayerAppUi
+// -----------------------------------------------------------------------------
+//
+CEikAppUi* CLWPlayerDocument::CreateAppUiL()
+{
+    MPX_DEBUG(_L("CLWPlayerDocument::CreateAppUiL()"));
+
+    return new (ELeave) CLWPlayerAppUi;
+}
+
+// -----------------------------------------------------------------------------
+// CLWPlayerDocument::UpdateTaskNameL()
+// Hides the icon from the task list
+// -----------------------------------------------------------------------------
+//
+void CLWPlayerDocument::UpdateTaskNameL(CApaWindowGroupName* aWgName)
+{
+    CEikDocument::UpdateTaskNameL(aWgName);
+    aWgName->SetHidden(ETrue);
+}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/data/mpxvideoplayer.rss	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,90 @@
+/*
+* 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: MPX Video Player Resource file
+*
+*/
+
+// Version : %version: 9 %
+
+//  RESOURCE IDENTIFIER
+NAME    FUSN // 4 letter ID
+
+//  INCLUDES
+#include <mpxvideoplayer.loc>
+
+#include <eikon.rh>
+#include <eikon.hrh>
+#include <avkon.hrh> 
+#include <avkon.rsg>
+#include <avkon.rh>
+#include <avkon.mbg>
+#include <aknmemorycardui.mbg>
+#include <avkon.loc>
+#include <appinfo.rh>
+#include <data_caging_paths_strings.hrh>
+#include <CommonDialogs.rh>
+#include <pathconfiguration.hrh>
+
+
+//  RESOURCE DEFINITIONS 
+
+// -----------------------------------------------------------------------------
+// Resource file signature
+// -----------------------------------------------------------------------------
+//
+RESOURCE RSS_SIGNATURE 
+    { 
+    }
+
+// -----------------------------------------------------------------------------
+//   
+// Default document name
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF 
+    { 
+    buf = ""; 
+    }
+
+// -----------------------------------------------------------------------------
+//   
+// Application info
+// Defines default menu and CBA key.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE EIK_APP_INFO
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_mpxvideoplayer_localisable_app_info
+// Localisable application info resource definition
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE LOCALISABLE_APP_INFO r_mpxvideoplayer_localisable_app_info
+    {
+    short_caption = qtn_mpxvideoplayer_short_caption;
+    caption_and_icon = 
+    CAPTION_AND_ICON_INFO
+        {
+        caption = qtn_mpxvideoplayer_caption;
+        number_of_icons = 1;
+        icon_file = APP_BITMAP_DIR"\\mpxvideoplayer_aif.mif";
+        };
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/data/mpxvideoplayer_reg.rss	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,72 @@
+/*
+* 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:  Resource definitions for mpxvideoplayer
+*
+*/
+
+// Version : %version:  da1mmcf#14 %
+
+//  INCLUDES
+#include <appinfo.rh>
+#include <mpxvideoplayer.rsg>
+#include <data_caging_paths_strings.hrh>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x200159B2 // MPXVideoPlayer application UID
+
+//  RESOURCE DEFINITIONS
+
+// -----------------------------------------------------------------------------
+//
+// Application registration info.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE APP_REGISTRATION_INFO
+    {
+    app_file = "MPXVideoPlayer";
+    localisable_resource_file = APP_RESOURCE_DIR"\\MpxVideoPlayer";
+    localisable_resource_id = R_MPXVIDEOPLAYER_LOCALISABLE_APP_INFO;
+    embeddability = KAppEmbeddable;
+
+    datatype_list =
+        {
+        DATATYPE { priority=EDataTypePrioritySystem; type="video/avi"; },
+        DATATYPE { priority=EDataTypePrioritySystem; type="video/msvideo"; },
+        DATATYPE { priority=EDataTypePrioritySystem; type="application/x-msvideo"; },
+
+        DATATYPE { priority=EDataTypePrioritySystem; type="video/x-pn-realvideo"; },
+        DATATYPE { priority=EDataTypePrioritySystem; type="audio/x-pn-realaudio"; },
+        DATATYPE { priority=EDataTypePrioritySystem; type="video/vnd.rn-realvideo"; },
+        DATATYPE { priority=EDataTypePrioritySystem; type="application/vnd.rn-realmedia"; },
+        DATATYPE { priority=EDataTypePrioritySystem; type="application/x-pn-realmedia"; },
+        DATATYPE { priority=EDataTypePrioritySystem; type="audio/x-pn-realaudio-plugin"; },
+        DATATYPE { priority=EDataTypePrioritySystem; type="video/x-matroska"; },
+
+#ifdef __WINDOWS_MEDIA
+        DATATYPE { priority=EDataTypePriorityHigh; type="video/x-ms-wmv"; },
+        DATATYPE { priority=EDataTypePriorityHigh; type="video/x-ms-asf"; },
+#endif
+        DATATYPE { priority=EDataTypePriorityHigh; type="video/3gp"; },
+        DATATYPE { priority=EDataTypePriorityHigh; type="video/3gpp2"; },
+        DATATYPE { priority=EDataTypePriorityHigh; type="video/3gpp"; },
+        DATATYPE { priority=EDataTypePriorityHigh; type="video/mp4"; },
+        DATATYPE { priority=EDataTypePriorityHigh; type="video/x-m4v"; },
+        DATATYPE { priority=EDataTypePriorityHigh; type="video/mpeg4"; },
+        DATATYPE { priority=EDataTypePriorityHigh; type="application/ram"; },
+        DATATYPE { priority=EDataTypePriorityHigh; type="application/sdp"; }
+        };
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,44 @@
+/*
+* 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: bld.inf for mpx video player*
+*
+*/
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXTENSIONS
+  START EXTENSION s60/mifconv
+    OPTION TARGETFILE mpxvideoplayer_aif.mif
+    OPTION SOURCES -c8,8 qgn_menu_video
+  END
+#ifdef MARM  
+  START EXTENSION app-services/buildstubsis
+    OPTION SRCDIR ../sis
+    OPTION SISNAME videoplayer_stub
+  END
+#endif
+
+PRJ_MMPFILES
+mpxvideoplayer.mmp
+
+PRJ_EXPORTS
+../loc/mpxvideoplayer.loc             APP_LAYER_LOC_EXPORT_PATH( mpxvideoplayer.loc )
+../rom/mpxvideoplayer.iby             CORE_APP_LAYER_IBY_EXPORT_PATH( mpxvideoplayer.iby )
+../rom/mpxvideoplayerresources.iby    LANGUAGE_APP_LAYER_IBY_EXPORT_PATH( mpxvideoplayerresources.iby )
+
+PRJ_TESTMMPFILES
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/group/mpxvideoplayer.mmp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,88 @@
+/*
+* 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 mpxvideoplayer
+*
+*/
+
+// Version : %version: 29 %
+
+#include <platform_paths.hrh>
+#include <data_caging_paths.hrh>
+
+TARGET          mpxvideoplayer.exe
+EPOCSTACKSIZE   0x12000 // Maximum is 80KB (0x14000)
+EPOCHEAPSIZE    0x1000 0x1000000
+TARGETTYPE      exe
+UID             0x100039CE 0x200159B2
+
+// VID_DEFAULT is Nokia VID (0x101FB657)
+VENDORID        VID_DEFAULT
+
+CAPABILITY      CAP_APPLICATION NetworkControl WriteUserData
+
+SOURCEPATH      ../src
+SOURCE          mpxvideoplayerapplication.cpp
+SOURCE          mpxvideoplayerdocument.cpp
+SOURCE          mpxvideoplayerappui.cpp
+SOURCE          mpxvideoplayerappuiengine.cpp
+SOURCE          mpxvideoembeddedpdlhandler.cpp
+SOURCE          mpxvideoplayeriadupdate.cpp
+
+START RESOURCE  ../data/mpxvideoplayer.rss
+HEADER
+TARGETPATH      APP_RESOURCE_DIR
+LANGUAGE_IDS
+END
+
+START RESOURCE  ../data/mpxvideoplayer_reg.rss
+DEPENDS mpxvideoplayer.rsg
+TARGETPATH      /private/10003a3f/apps
+END
+
+USERINCLUDE     ../inc
+USERINCLUDE     ../../../inc
+
+APP_LAYER_SYSTEMINCLUDE
+
+OS_LAYER_LIBC_SYSTEMINCLUDE
+OS_LAYER_STDCPP_SYSTEMINCLUDE
+OS_LAYER_BOOST_SYSTEMINCLUDE
+
+
+LIBRARY         euser.lib
+LIBRARY         apparc.lib
+LIBRARY         cone.lib
+LIBRARY         eikcore.lib
+LIBRARY         ws32.lib
+LIBRARY         efsrv.lib
+LIBRARY         bafl.lib
+LIBRARY         avkon.lib
+LIBRARY         hlplch.lib
+LIBRARY         commonui.lib
+LIBRARY         servicehandler.lib
+LIBRARY         commonengine.lib
+LIBRARY         estor.lib
+LIBRARY         apgrfx.lib
+LIBRARY         playbackhelper.lib
+LIBRARY         mpxviewutility.lib      // MPX view utility
+LIBRARY         mpxplaybackutility.lib    // MPX playback utility
+LIBRARY         mpxcollectionutility.lib
+LIBRARY         mpxcollectionhelper.lib
+LIBRARY         mpxcommon.lib
+LIBRARY         flogger.lib
+LIBRARY         videoplaylistutility.lib
+LIBRARY         featmgr.lib
+LIBRARY         iaupdateapi.lib
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/inc/mpxvideoembeddedpdlhandler.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,100 @@
+/*
+* 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:  Handles Embbeded PDL playback
+ *
+*/
+
+// Version : %version: 5 %
+
+
+#ifndef __CMPXVIDEOEMBEDDEDPDLHANDLER_H__
+#define __CMPXVIDEOEMBEDDEDPDLHANDLER_H__
+
+//
+//  INCLUDES
+//
+#include <e32base.h>
+
+#include <mpxplaybackframeworkdefs.h>
+#include <mpxplaybackcommanddefs.h>
+
+//
+//  FORWARD DECLARATIONS
+//
+class CMpxVideoPlayerAppUiEngine;
+
+//
+//  CLASS DECLARATION
+//
+
+/*
+ *  Process PDL commands passed in by other applications.
+ *
+ *  @lib mpxvideo.exe
+ *  @since 9.2 time box
+ */
+class CMpxVideoEmbeddedPdlHandler : public CBase
+{
+    public:  // Constructors and destructor
+
+        /*
+         * Two-phased constructor.
+         *
+         * @since 9.2
+         * @param aPlaybackUtility Playback utility to use.
+         * @return Pointer to newly created object.
+         */
+        static CMpxVideoEmbeddedPdlHandler* NewL( CMpxVideoPlayerAppUiEngine* aAppUiEngine );
+
+        /*
+         *  Destructor.
+         */
+        virtual ~CMpxVideoEmbeddedPdlHandler();
+
+    public:
+
+        void ConnectToEmbeddedDownloadL( TInt aDlId, TDesC& aFileName );
+        void ConnectToCollectionDownloadL( TInt aDlId, TDesC& aFileName );
+        void ClearPdlInformation();
+
+    private:
+
+        /*
+         *  C++ Constructor
+         */
+        CMpxVideoEmbeddedPdlHandler( CMpxVideoPlayerAppUiEngine* aAppUiEngine );
+
+        /*
+         *  By default Symbian 2nd phase constructor is private.
+         */
+        void ConstructL();
+
+    private:  // New functions
+
+        void SendPdlCustomCommandL( TMPXPlaybackPdCommand aCustomCmd, TInt aData );
+
+        void StartNewDownloadL( TInt aDlId, TDesC& aFileName );
+
+    private:
+
+        CMpxVideoPlayerAppUiEngine*   iAppUiEngine;
+
+        TInt                          iDownloadId;
+        HBufC*                        iDownloadFileName;
+        TBool                         iEmbeddedPdlCase;
+};
+
+#endif // __CMPXVIDEOEMBEDDEDPDLHANDLER_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/inc/mpxvideoplayeraiwparamextractor.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,69 @@
+/*
+* 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:  Application class
+*
+*/
+
+// Version : %version: da1mmcf#3 %
+
+#ifndef MPXVIDEOPLAYERAIWPARAMEXTRACTOR_H_
+#define MPXVIDEOPLAYERAIWPARAMEXTRACTOR_H_
+
+class CAiwGenericParamList;
+
+/**
+*  CMpxVideoPlayerAiwParamExtractor
+*  Extracts parameters from generic paramater list
+*
+*  @lib mpxvideoplayer.exe 
+*  @since MpxVideoPlayer 0.1
+*/
+class CMpxVideoPlayerAiwParamExtractor : public CBase
+    {
+    public:        // Constructors and destructor
+        static CMpxVideoPlayerAiwParamExtractor* NewL( );        
+           
+        /**
+        * Destructor.
+        */
+        virtual ~CMpxVideoPlayerAiwParamExtractor();
+           
+        /**
+        * Extracts parameters from given generic parameter list.
+        */
+        void  ExtractParameters( const CAiwGenericParamList& aParamList );
+           
+        /**
+        * Returns download id extracted previously from generic parameter list
+        */
+        TInt32  DlId( );
+        
+    private:
+        /**
+         * Constructor
+         */
+        CMpxVideoPlayerAiwParamExtractor( );
+         
+        /**
+         * By default Symbian 2nd phase constructor is private.
+         */
+        void ConstructL();
+        
+        /**
+         * DlId found from paramaters
+         */
+        TInt32 iDlId;
+    };
+
+#endif /*MPXVIDEOPLAYERAIWPARAMEXTRACTOR_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/inc/mpxvideoplayerapplication.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,50 @@
+/*
+* 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:  Application class
+*
+*/
+
+// Version : %version: da1mmcf#4 %
+
+
+#ifndef CMPXVIDEOPLAYERAPPLICATION_H
+#define CMPXVIDEOPLAYERAPPLICATION_H
+
+#include <aknapp.h>                    // CAknApplication
+
+/**
+*  Application class.
+*  Creates concrete document object.
+*
+*  @lib mpxvideoplayer.exe 
+*  @since MpxVideoPlayer 0.1
+*/
+class CMpxVideoPlayerApplication : public CAknApplication
+    {
+    private:
+
+        /**
+        * From CApaApplication, creates document object.
+        * @return A pointer to the created document object.
+        */
+        CApaDocument* CreateDocumentL();
+        
+        /**
+        * From CApaApplication, returns application's UID.
+        * @return The value of KUidMacFwApplication.
+        */
+        TUid AppDllUid() const;
+    };
+
+#endif       // CMPXVIDEOPLAYERAPPLICATION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/inc/mpxvideoplayerappui.h	Thu Nov 04 11:16:56 2010 +0200
@@ -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 "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:  App UI
+*
+*/
+
+// Version : %version: 15 %
+
+
+#ifndef CMPXVIDEOPLAYERAPPUI_H
+#define CMPXVIDEOPLAYERAPPUI_H
+
+#include <aknViewAppUi.h>
+
+
+// FORWARD DECLARATIONS
+class CAiwGenericParamList;
+class CMpxVideoPlayerMediaKeyHandler;
+class CMpxVideoPlayerRemConListener;
+class CMpxVideoPlayerAppUiEngine;
+
+/**
+*  Application UI class.
+*
+*  @lib mpxvideoplayer.exe
+*  @since MpxVideoPlayer 0.1
+*/
+class CMpxVideoPlayerAppUi : public CAknViewAppUi
+{
+    public:        // Constructors and destructor
+
+        /**
+        * Default constructor
+        */
+        CMpxVideoPlayerAppUi();
+
+        /**
+        * Destructor.
+        */
+        ~CMpxVideoPlayerAppUi();
+
+    public:       // New functions
+
+        /**
+        * Exit
+        */
+        void HandleExit();
+
+        /**
+        * From CEikAppUi, processes shell commands.
+        * @param aCommand
+        * @param aDocumentName
+        * @param aTail
+        *  @return  ETrue if document name exists        
+        */
+        TBool ProcessCommandParametersL( TApaCommand aCommand,
+                                         TFileName& aDocumentName,
+                                         const TDesC8& aTail );
+
+        /**
+         * From CEikAppUi
+         * handle window server events.
+         *
+         * @param aEvent The window server event to be handled.
+         * @param aDestination The control associated with the event.
+         */
+        void HandleWsEventL( const TWsEvent& aEvent, CCoeControl* aDestination );
+
+        /**
+        * Command handling
+        * @param aCmd Command ID
+        */
+        void HandleCommandL( TInt aCommand );
+
+        /**
+         * This function is used for querying whether the application
+         * is launched in embedded mode or not.
+         * @since 3.1
+         * @return ETrue:  The application is launched in embedded mode.
+         *         EFalse: The application is launched in standalone mode.
+         */
+        TBool IsEmbedded() const;
+
+        /**
+         * Opens the specified file in response.
+         * @since 3.1
+         * @param aFile      File handle to open
+         * @param aParams    Generic parameter list from document handler
+         */
+        void OpenFileL( RFile& aFile, const CAiwGenericParamList* aParams );
+        
+        /**
+         * Returns the active view.
+         * Ownership is not transferred.
+         *
+         * @return Active akn view or NULL if no views.
+         */
+        CAknView* View();
+        
+    private:
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+        
+        /**
+         * Checks if the stored wg id is the same as the current wg id of embedded player.
+		 * If it is clears it.
+         * @since 3.1         
+         */
+        void DoWgIdUpkeep();
+
+        /**
+         * From CEikAppUi
+         * Receives closing notification from video storage
+         *
+         * @param aClientHandleOfTargetWindowGroup Target window group (this app).
+         * @param aMessageUid The TUid type of the message
+         * @param aMessageParameters A reference to constant descriptor of optional parameters
+         */
+        MCoeMessageObserver::TMessageResponse HandleMessageL(
+                                                    TUint32 aClientHandleOfTargetWindowGroup,
+                                                    TUid aMessageUid,
+                                                    const TDesC8 &aMessageParameters);
+
+        /**
+         * From CEikAppUi
+         * opens the specified file in response to a corresponding message.
+         *
+         * @param aFileName File to be opened.
+         */
+        void OpenFileL( const TDesC& aFileName );
+
+        /**
+         * From CCoeAppUi
+         * called when event occurs of type EEventFocusLost or EEventFocusGained.
+         *
+         * @param aForeground ETrue if the application is in the foreground,
+         *                    otherwise EFalse.
+         */
+        void HandleForegroundEventL( TBool aForeground );
+
+    private:       // data
+
+        // own
+        CMpxVideoPlayerAppUiEngine* iAppUiEngine;
+
+};
+
+#endif             // CMPXVIDEOPLAYERAPPUI_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/inc/mpxvideoplayerappuiengine.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,375 @@
+/*
+* 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:  App UI engine
+*
+*/
+
+
+// Version : %version: 37 %
+
+
+#ifndef CMPXVIDEOPLAYERAPPUIENGINE_H
+#define CMPXVIDEOPLAYERAPPUIENGINE_H
+
+#include <e32base.h>
+#include <mpxplaybackutility.h>
+#include <mpxviewutility.h>
+#include <mpxcollectionutility.h>
+#include <mpxmessage2.h>
+#include <mpxcollectionplaylist.h>
+#include <mediarecognizer.h>
+#include <mpxviewactivationobserver.h>
+#include <mpxcollectionobserver.h>
+#include <mpxcollectionuihelperobserver.h>
+
+#ifdef __APPUIENGINESTIF__
+#include "mpxvideoplayerappui_stub.h"
+#else
+#include "mpxvideoplayerappui.h"
+#endif
+
+class CMpxVideoEmbeddedPdlHandler;
+class MMPXCollectionUiHelper;
+class CAiwGenericParamList;
+class CVideoPlaylistUtility;
+class CMpxVideoPlayerIadUpdate;
+
+/**
+*  Application UI class.
+*
+*  @lib mpxvideoplayer.exe
+*  @since MpxVideoPlayer 0.1
+*/
+class CMpxVideoPlayerAppUiEngine : public CBase,
+                                   public MMPXViewActivationObserver,
+                                   public MMPXCollectionObserver ,
+                                   public MMPXCHelperEmbeddedOpenObserver
+{
+    public:        // Constructors and destructor
+        static CMpxVideoPlayerAppUiEngine* NewL( CMpxVideoPlayerAppUi* aAppUi );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CMpxVideoPlayerAppUiEngine();
+
+    public:
+
+        /*
+         *  Retrieves playback utility and creates it if needed
+         */
+        MMPXPlaybackUtility& PlaybackUtilityL();
+
+        /**
+         * Opens the specified file in response to a corresponding message.
+         *
+         * @param aFile File to be opened.
+         * @param aParams aiw generic parameters for the file
+         */
+        void OpenFileL( RFile& aFile, const CAiwGenericParamList* aParams );
+
+        /**
+         * Opens the specified file in response to a corresponding message.
+         *
+         * @param aFile File to be opened.
+         */
+        void OpenFileL( const TDesC& aFileName );
+
+        /**
+         * Opens the specified mpx media object.
+         *
+         * @param aMedia Media to be opened.
+         */
+        void OpenMediaL( const CMPXMedia& aMedia );
+
+        /*
+         *  Activate the proper playback view
+         */
+        void ActivatePlaybackViewL();
+
+        /**
+         * Sets AppUiEngine in stand alone "mode"
+         */
+        void StartStandAloneL();
+
+        /**
+         * Handle media properties.
+         */
+        void DoHandleCollectionMediaL( const CMPXMedia& aMedia );
+
+        /**
+         * Steps one level up in collection path
+         */
+        void StepBackCollectionPathL();
+
+        /*
+         * Handle embedded playback message
+         * @param aMessageUid message identification uid
+         * @param aMessageParameters  aiw generic parameters
+         */
+        TBool HandleMessageL( TUid aMessageUid,
+                              const TDesC8& aMessageParameters );
+
+        /**
+         * From MMPXViewActivationObserver
+         * Handle view activation.
+         *
+         * @since 3.1
+         * @param aCurrentViewType Current view type Uid.
+         * @param aPreviousViewType Previous view type Uid.
+         */
+        void HandleViewActivation( const TUid& aCurrentViewType, const TUid& aPreviousViewType );
+
+
+        /**
+         *  From MPXCollectionObserver
+         *  @since S60 3.2.3
+         *  @param aMessage collection message, ownership not transferred.
+         *         Please check aMsg is not NULL before using it. If aErr is not
+         *         KErrNone, plugin might still call back with more info in the aMsg.
+         *  @param aErr system error code
+         */
+        void HandleCollectionMessage( CMPXMessage* aMsg, TInt /*aErr*/ );
+
+        /**
+         * From MMPXCollectionObserver
+         * Handle media properties.
+         *
+         * @since 3.1
+         * @param aMedia  media properties.
+         * @param aError Error code.
+         */
+        void HandleCollectionMediaL( const CMPXMedia& aMedia, TInt aError );
+
+         /**
+         * From MMPXCollectionObserver
+         * Handles the collection entries being opened.
+         *
+         * @since 3.1
+         * @param aEntries Collection entries opened.
+         * @param aIndex Focused entry.
+         * @param aComplete ETrue no more entries. EFalse more entries
+         *                  expected.
+         * @param aError Error code.
+         */
+        void HandleOpenL( const CMPXMedia& aEntries,
+                          TInt aIndex,
+                          TBool aComplete,
+                          TInt aError );
+
+        /**
+         * From MMPXCollectionObserver
+         * Handles the item being opened.
+         *
+         * @since 3.1
+         * @param aPlaylist Collection playlist, owner ship is transfered.
+         * @param aError Error code.
+         */
+        void HandleOpenL( const CMPXCollectionPlaylist& aPlaylist, TInt aError);
+
+        // from base class MMPXCHelperEmbeddedOpenObserver
+            /**
+            * From MMPXCHelperEmbeddedOpenObserver
+            * Handles errors from opening in embedded mode
+            *
+            * @since 3.1
+            * @param aErr Error code
+            * @param aCategory Type of item to be opened.
+            */
+        void HandleEmbeddedOpenL( TInt aErr, TMPXGeneralCategory aCategory  );
+
+        void PreLoadPdlPlaybackViewL();
+
+        /*
+         * Handles the "back" button.
+         */
+        void HandleSoftKeyBackL();
+
+        /*
+         *  Processes shell commands.
+         *  @param aCommand
+         *  @param aDocumentName
+         *  @param aTail
+         *  @return  ETrue if document name exists
+         */
+        TBool ProcessCommandParametersL( TApaCommand aCommand,
+                                         TFileName& aDocumentName,
+                                         const TDesC8& aTail );
+
+        /*
+         *  Provides the static function for the callback to exit the application
+         *  Called by CIdle iIdle
+         *  @since 9.2
+         *  @param aPtr Pointer to callback class
+         *  @return KErrNone
+         */
+        static TInt ExitApplicationL( TAny* aPtr );
+
+        /*
+         * returns the viewdepth from the viewutlity
+         */
+        TInt ViewHistoryDepth();
+
+        void ClearPdlInformation();
+
+        void InitializeFileL( const TDesC& aFileName );
+
+        void ClosePlaybackPluginL();
+
+        void SendMessageToPdlViewL( TInt aMsg );
+
+        /*
+         *  Activates an active object to finish the
+         *  initialization of the standalone application
+         */
+        void ActivateLateConstructTimerL();
+                
+        /**
+         * Clears internal playbackutility pointer
+         */
+        void ClearPlaybackUtility();
+        
+        /**
+         * Sends given command to playback utility 
+         * @since 9.2
+         * @param aCmd reference to command
+         */
+        void SendCustomMpxPlaybackUtilityCmdL( CMPXCommand& aCmd );
+        
+        /**
+         * Sends given command to playback utility 
+         * @since 9.2
+         * @param aCmd reference to command
+         */
+        void SendMpxPlaybackCmdL( TMPXPlaybackCommand aCmd );
+
+    private:
+        /**
+         * Constructor
+         */
+        CMpxVideoPlayerAppUiEngine( CMpxVideoPlayerAppUi* aAppUi );
+
+        /**
+         * Default constructor
+         */
+        CMpxVideoPlayerAppUiEngine( );
+
+        /**
+         * By default Symbian 2nd phase constructor is private.
+         */
+        void ConstructL();
+
+
+        void HandleMultiLinksFileL( const TDesC& aFileName,
+                                    CMediaRecognizer::TMediaType aMediaType );
+
+        void HandleMultiLinksFileL( RFile& aFile,
+                                    CMediaRecognizer::TMediaType aMediaType );
+
+        void DoHandleMultiLinksFileL( CVideoPlaylistUtility* aPlaylistUtil,
+                                      TBool aSingleLink,
+                                      TBool aLocalFile );
+
+        TPtrC GetLinkLC( const TDesC& aFileName,
+                         CMediaRecognizer::TMediaType aMediaType,
+                         TBool aUseFileHandle = EFalse );
+
+        TInt HandleAiwGenericParamListL( const CAiwGenericParamList* aParams );
+
+        /**
+        * Handle collection message
+        *
+        * @param aMessage collection message
+        */
+       void DoHandleCollectionMessageL( CMPXMessage* aMessage );
+
+       void CreateCollectionUtilityMemberVariablesL();
+
+       void CreateRemoteControlListenerL();
+
+       /*
+        *  Activates an active object to exit the application
+        *  @since 5.0
+        */
+       void ActivateExitActiveObject();
+
+       /*
+        *  Called to stop and exit the application
+        *  @since 9.2
+        *  @return void
+        */
+       virtual void DoExitApplicationL();
+
+       /*
+       * used to send media info to plugin
+       */
+       void UpdatePbPluginMediaL();
+
+       void InitializeStreamingLinkL( const TDesC& aUri );
+       void InitializePlaylistL( const CMPXCollectionPlaylist& aPlaylist, TBool aPlay );
+
+        /*
+         *  Provides the static function for the callback to
+         *  finish the standalone application construction
+         *  Called by CPeriodic iConstructTimer
+         *  @param aPtr Pointer to callback class
+         *  @return KErrNone
+         */
+        static TInt LateConstructCallback( TAny* aPtr );
+
+        /*
+         *  Called to finalize the standalone
+         *  application initialization.
+         */
+        virtual void DoLateConstructL();
+        
+        /**
+         * Handles error codes coming from MMPXPlaybackUtility
+         * method calls  
+         * @since 9.2
+         * @param aError error code
+         */
+        void HandleUtilityErrorL( TInt aError );
+
+
+        /**
+         * Checks for updates via IAD.
+         */
+        void DoCheckForUpdatesL();
+
+    private:       // data
+
+        CMpxVideoPlayerAppUi*         iAppUi;
+
+        //
+        //  Owned Utilities
+        //
+        MMPXPlaybackUtility*     iPlaybackUtility;
+        MMPXViewUtility*         iViewUtility;
+        MMPXCollectionUtility*   iCollectionUtility;
+        MMPXCollectionUiHelper*  iCollectionUiHelper;  // own
+
+        CPeriodic*                    iConstructTimer;
+        CIdle*                        iExitAo;
+        CMediaRecognizer*             iRecognizer;       // own
+        CMpxVideoEmbeddedPdlHandler*  iPdlHandler;       // own
+        CMpxVideoPlayerIadUpdate*     iIadUpdate;        // own
+
+        TInt                     iAccessPointId;
+        TBool                    iMultilinkPlaylist;
+        TBool                    iSeekable;
+        TBool                    iUpdateSeekInfo;
+    };
+
+#endif             // CMPXVIDEOPLAYERAPPUIENGINE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/inc/mpxvideoplayerconstants.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,52 @@
+/*
+* 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: 
+*
+*/
+
+// Version : %version: da1mmcf#9 %
+
+
+#ifndef __MPXVIDEOPLAYERCONSTANTS_H__
+#define __MPXVIDEOPLAYERCONSTANTS_H__
+
+/**
+* Constants for Media Player application
+*/
+
+_LIT8( KDATATYPEVIDEOHELIX, "video/videohelix" );
+
+//
+// UIDs of application views
+//
+const TUid KUidMpxVideoPlayerApplication = { 0x200159B2 };
+
+const TUid KUidMyVideosViewType = { 0x2000B43C };
+
+const TInt KUidMyVideosViewTypeId = 0x2000B43C;
+
+const TInt KMpxVideoPlayerVodViewPluginTypeId = 0x20016B95;
+
+const TUid KSettingsModelForROPUid = { 0x101F857D };
+
+const TUid KVideoHelixPlaybackPluginUid = { 0x10282551 };
+
+const TUid KVideoPlaybackViewUid = { 0x200159AD };
+
+const TUid KVideoPdlPlaybackViewUid = { 0x2001E5A8 };
+
+
+#endif // __MPXVIDEOPLAYERCONSTANTS_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/inc/mpxvideoplayerdocument.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,103 @@
+/*
+* 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:  Document class
+*
+*/
+
+// Version : %version: da1mmcf#5 %
+
+#ifndef CMPXVideoPlayerDOCUMENT_H
+#define CMPXVideoPlayerDOCUMENT_H
+
+#include <GenericParamConsumer.h>
+
+class CEikAppUi;
+class MMPXViewUtility;
+
+/**
+*  Document class of MpxVideoPlayer application.
+*
+*  @lib mpxvideoplayer.exe
+*  @since MpxVideoPlayer 0.1
+*/
+class CMpxVideoPlayerDocument : public CAiwGenericParamConsumer
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        * @param aApp Handle to Eikon's application class
+        * @return A new instance of CMacFwDocument
+        */
+        static CMpxVideoPlayerDocument* NewL( CEikApplication& aApp );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CMpxVideoPlayerDocument();
+
+    private:    // Functions from base classes   
+        /**
+        * From CEikDocument
+        * @return A new instance of application's AppUi class
+        */
+        CEikAppUi* CreateAppUiL();
+
+        /**
+        * Default constructor.
+        * @param aApp Handle to Eikon's application class
+        */
+        CMpxVideoPlayerDocument( CEikApplication& aApp );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        /**
+         * From CEikDocument.
+         * Called by the framework to open a file.
+         *
+         * @param aDoOpen ETrue to open an existing file, 
+                          EFalse to create a new default file.
+         * @param aFileName THe path and name of the file to open or create.
+         * @param aFs FIle server session to use.
+         * @return Pointer to newly created object.
+         */
+        CFileStore* OpenFileL( 
+            TBool aDoOpen,
+            const TDesC& aFilename,
+            RFs& aFs );
+
+        /**
+         * From CEikDocument.
+         * Called by the framework to open a file.
+         *
+         * @param aFileStore This is set by the function to the file 
+                             store that stores the main document, 
+                             if the file is a "native" Symbian OS file, 
+                             otherwise it is set to NULL.
+         * @param aFile The path and name of the file to read from
+         */
+        void OpenFileL(
+            CFileStore*& aFileStore, 
+            RFile& aFile );
+
+    private:    // data
+    
+        MMPXViewUtility* iViewUtility;
+    };
+
+#endif         // CMPXVideoPlayerDOCUMENT_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/inc/mpxvideoplayeriadupdate.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,148 @@
+/*
+* 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 <e32std.h>
+#include <iaupdateobserver.h>
+
+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
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/inc/mpxvideoplayerlogger.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,306 @@
+/*
+* Copyright (c) 2004-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:  Helper class for serial or file tracing
+ *
+*/
+
+// Version : %version: da1mmcf#3 %
+
+#ifndef MPXVPDEBUG_H
+#define MPXVPDEBUG_H
+
+#include <flogger.h>
+
+// Define logging level here
+
+// Minimum log output
+#define MPXVP_HIGH_LEVEL_TRACES
+
+// Medium log output
+#define MPXVP_MIDDLE_LEVEL_TRACES
+
+// Maximum log output
+#define MPXVP_LOW_LEVEL_TRACES
+
+
+/*
+-----------------------------------------------------------------------------
+
+	LOGGING MACROs
+
+	USE THESE MACROS IN YOUR CODE
+
+	Usage:
+	
+	Example: MPXVPLOGSTRING_HIGH_LEVEL ("Test");
+	Example: MPXVPLOGSTRING2_HIGH_LEVEL ("Test %d", aValue);
+	Example: MPXVPLOGSTRING3_HIGH_LEVEL ("Test %d %d", aValue1, aValue2);
+	Example: MPXVPLOGSTRING4_HIGH_LEVEL ("Test %d %d %d", aValue1, aValue2, aValue3);
+
+	Example: MPXVP_LOG_STR_DESC_HIGH_LEVEL (own_desc);
+	Example: MPXVP_LOG_STR_DESC2_HIGH_LEVEL (own_desc, aValue));
+	Example: MPXVP_LOG_STR_DESC3_HIGH_LEVEL (own_desc, aValue, aValue2);
+	Example: MPXVP_LOG_STR_DESC4_HIGH_LEVEL (own_desc, aValue, aValue2, aValue3);
+
+-----------------------------------------------------------------------------
+*/
+
+
+#ifdef MPXVP_HIGH_LEVEL_TRACES
+
+#define MPXVPLOGTEXT_HIGH_LEVEL(AAAA)   MPXVP_LOGTEXT(AAAA)
+#define MPXVPLOGSTRING_HIGH_LEVEL(AAAA) 	MPXVP_LOGSTRING(AAAA) 
+#define MPXVPLOGSTRING2_HIGH_LEVEL(AAAA,BBBB) 	MPXVP_LOGSTRING2(AAAA,BBBB) 
+#define MPXVPLOGSTRING3_HIGH_LEVEL(AAAA,BBBB,CCCC)   MPXVP_LOGSTRING3(AAAA,BBBB,CCCC) 
+#define MPXVPLOGSTRING4_HIGH_LEVEL(AAAA,BBBB,CCCC,DDDD)   MPXVP_LOGSTRING4(AAAA,BBBB,CCCC,DDDD) 
+
+#define MPXVP_LOG_STR_DESC_HIGH_LEVEL(AAAA) 	MPXVP_LOG_STR_DESC(AAAA) 
+#define MPXVP_LOG_STR_DESC2_HIGH_LEVEL(AAAA,BBBB) 	MPXVP_LOG_STR_DESC2(AAAA,BBBB) 
+#define MPXVP_LOG_STR_DESC3_HIGH_LEVEL(AAAA,BBBB,CCCC)   MPXVP_LOG_STR_DESC3(AAAA,BBBB,CCCC) 
+#define MPXVP_LOG_STR_DESC4_HIGH_LEVEL(AAAA,BBBB,CCCC,DDDD)   MPXVP_LOG_STR_DESC4(AAAA,BBBB,CCCC,DDDD) 
+
+#else
+
+#define MPXVPLOGTEXT_HIGH_LEVEL(AAAA)
+#define MPXVPLOGSTRING_HIGH_LEVEL(AAAA)
+#define MPXVPLOGSTRING2_HIGH_LEVEL(AAAA,BBBB)
+#define MPXVPLOGSTRING3_HIGH_LEVEL(AAAA,BBBB,CCCC)
+#define MPXVPLOGSTRING4_HIGH_LEVEL(AAAA,BBBB,CCCC,DDDD)
+
+#define MPXVP_LOG_STR_DESC_HIGH_LEVEL(AAAA)
+#define MPXVP_LOG_STR_DESC2_HIGH_LEVEL(AAAA,BBBB)
+#define MPXVP_LOG_STR_DESC3_HIGH_LEVEL(AAAA,BBBB,CCCC)
+#define MPXVP_LOG_STR_DESC4_HIGH_LEVEL(AAAA,BBBB,CCCC,DDDD)
+
+#endif
+
+
+#ifdef MPXVP_MIDDLE_LEVEL_TRACES
+#define TFLOGTEXT_MIDDLE_LEVEL(AAAA) MPXVP_LOGTEXT(AAAA)
+#define MPXVPLOGSTRING_MIDDLE_LEVEL(AAAA) MPXVP_LOGSTRING(AAAA)
+#define MPXVPLOGSTRING2_MIDDLE_LEVEL(AAAA,BBBB) MPXVP_LOGSTRING2(AAAA,BBBB)
+#define MPXVPLOGSTRING3_MIDDLE_LEVEL(AAAA,BBBB,CCCC) MPXVP_LOGSTRING3(AAAA,BBBB,CCCC)
+#define MPXVPLOGSTRING4_MIDDLE_LEVEL(AAAA,BBBB,CCCC,DDDD) MPXVP_LOGSTRING4(AAAA,BBBB,CCCC,DDDD)
+
+#define MPXVP_LOG_STR_DESC_MIDDLE_LEVEL(AAAA) 	MPXVP_LOG_STR_DESC(AAAA) 
+#define MPXVP_LOG_STR_DESC2_MIDDLE_LEVEL(AAAA,BBBB) 	MPXVP_LOG_STR_DESC2(AAAA,BBBB) 
+#define MPXVP_LOG_STR_DESC3_MIDDLE_LEVEL(AAAA,BBBB,CCCC)   MPXVP_LOG_STR_DESC3(AAAA,BBBB,CCCC) 
+#define MPXVP_LOG_STR_DESC4_MIDDLE_LEVEL(AAAA,BBBB,CCCC,DDDD)   MPXVP_LOG_STR_DESC4(AAAA,BBBB,CCCC,DDDD) 
+
+#else
+
+#define TFLOGTEXT_MIDDLE_LEVEL(AAAA)
+#define MPXVPLOGSTRING_MIDDLE_LEVEL(AAAA)
+#define MPXVPLOGSTRING2_MIDDLE_LEVEL(AAAA,BBBB)
+#define MPXVPLOGSTRING3_MIDDLE_LEVEL(AAAA,BBBB,CCCC)
+#define MPXVPLOGSTRING4_MIDDLE_LEVEL(AAAA,BBBB,CCCC,DDDD)
+
+#define MPXVP_LOG_STR_DESC_MIDDLE_LEVEL(AAAA)
+#define MPXVP_LOG_STR_DESC2_MIDDLE_LEVEL(AAAA,BBBB)
+#define MPXVP_LOG_STR_DESC3_MIDDLE_LEVEL(AAAA,BBBB,CCCC)
+#define MPXVP_LOG_STR_DESC4_MIDDLE_LEVEL(AAAA,BBBB,CCCC,DDDD)
+
+#endif
+	    
+
+#ifdef MPXVP_LOW_LEVEL_TRACES
+
+#define MPXVPLOGTEXT_LOW_LEVEL(AAAA)    MPXVP_LOGTEXT(AAAA)
+#define MPXVPLOGSTRING_LOW_LEVEL(AAAA)    MPXVP_LOGSTRING(AAAA)
+#define MPXVPLOGSTRING2_LOW_LEVEL(AAAA,BBBB)    MPXVP_LOGSTRING2(AAAA,BBBB)
+#define MPXVPLOGSTRING3_LOW_LEVEL(AAAA,BBBB,CCCC)    MPXVP_LOGSTRING3(AAAA,BBBB,CCCC)
+#define MPXVPLOGSTRING4_LOW_LEVEL(AAAA,BBBB,CCCC,DDDD)    MPXVP_LOGSTRING4(AAAA,BBBB,CCCC,DDDD)
+
+#define MPXVP_LOG_STR_DESC_LOW_LEVEL(AAAA) 	MPXVP_LOG_STR_DESC(AAAA) 
+#define MPXVP_LOG_STR_DESC2_LOW_LEVEL(AAAA,BBBB) 	MPXVP_LOG_STR_DESC2(AAAA,BBBB) 
+#define MPXVP_LOG_STR_DESC3_LOW_LEVEL(AAAA,BBBB,CCCC)   MPXVP_LOG_STR_DESC3(AAAA,BBBB,CCCC) 
+#define MPXVP_LOG_STR_DESC4_LOW_LEVEL(AAAA,BBBB,CCCC,DDDD)   MPXVP_LOG_STR_DESC4(AAAA,BBBB,CCCC,DDDD) 
+
+#else
+
+#define MPXVPLOGTEXT_LOW_LEVEL(AAAA)
+#define MPXVPLOGSTRING_LOW_LEVEL(AAAA)
+#define MPXVPLOGSTRING2_LOW_LEVEL(AAAA,BBBB)
+#define MPXVPLOGSTRING3_LOW_LEVEL(AAAA,BBBB,CCCC)
+#define MPXVPLOGSTRING4_LOW_LEVEL(AAAA,BBBB,CCCC,DDDD)
+
+#define MPXVP_LOG_STR_DESC_LOW_LEVEL(AAAA)
+#define MPXVP_LOG_STR_DESC2_LOW_LEVEL(AAAA,BBBB)
+#define MPXVP_LOG_STR_DESC3_LOW_LEVEL(AAAA,BBBB,CCCC)
+#define MPXVP_LOG_STR_DESC4_LOW_LEVEL(AAAA,BBBB,CCCC,DDDD)
+
+#endif
+
+
+/* 
+-----------------------------------------------------------------------------
+
+	LOG SELECTION
+
+-----------------------------------------------------------------------------
+*/
+
+
+// 0 = No logging, 
+// 1 = Flogger, 
+// 2 = RDebug
+
+
+#ifndef _DEBUG
+
+// UREL BUILD:
+#define MPXVP_LOGGING_METHOD  2   // No logging in UREL builds
+
+#else // urel
+
+
+#ifdef __WINSCW__
+
+// WINSCW BUILD:
+#define MPXVP_LOGGING_METHOD  2  // RDebug is default with emulator
+
+#else
+
+// ARMV5 BUILD:
+#define MPXVP_LOGGING_METHOD  2  // Flogger is default with target device
+
+#endif
+
+
+#endif // _DEBUG
+
+
+/* 
+-----------------------------------------------------------------------------
+
+	LOG SETTINGS
+
+-----------------------------------------------------------------------------
+*/
+
+#if MPXVP_LOGGING_METHOD == 1      // Flogger
+
+#include <flogger.h>
+_LIT(KMPXVPLogFolder,"MPXVP");
+_LIT(KMPXVPLogFile,"MPXVPLOG.TXT");
+
+#elif MPXVP_LOGGING_METHOD == 2    // RDebug
+
+#include <e32svr.h>
+
+#endif
+
+
+
+
+
+#if MPXVP_LOGGING_METHOD == 1      // Flogger
+
+
+#define MPXVP_LOGTEXT(AAA)                RFileLogger::Write(KMPXVPLogFolder(),KMPXVPLogFile(),EFileLoggingModeAppend, AAA)
+
+#define MPXVP_LOG_STR_DESC(AAA)                RFileLogger::Write(KMPXVPLogFolder(),KMPXVPLogFile(),EFileLoggingModeAppend, AAA)
+#define MPXVP_LOG_STR_DESC2(AAA,BBB)         /*lint -e{717}*/ do { RFileLogger::WriteFormat(KMPXVPLogFolder(),KMPXVPLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(AAA()),BBB); } while ( EFalse )
+#define MPXVP_LOG_STR_DESC3(AAA,BBB,CCC)     /*lint -e{717}*/ do { RFileLogger::WriteFormat(KMPXVPLogFolder(),KMPXVPLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(AAA()),BBB,CCC); } while ( EFalse )
+#define MPXVP_LOG_STR_DESC4(AAA,BBB,CCC,DDD) /*lint -e{717}*/ do { RFileLogger::WriteFormat(KMPXVPLogFolder(),KMPXVPLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(AAA()),BBB,CCC,DDD); } while ( EFalse )
+
+#define MPXVP_LOGSTRING(AAA)                 /*lint -e{717}*/ do { _LIT(tempMPXVPLogDes,AAA); RFileLogger::Write(KMPXVPLogFolder(),KMPXVPLogFile(),EFileLoggingModeAppend,tempMPXVPLogDes()); } while ( EFalse )
+#define MPXVP_LOGSTRING2(AAA,BBB)            /*lint -e{717}*/ do { _LIT(tempMPXVPLogDes,AAA); RFileLogger::WriteFormat(KMPXVPLogFolder(),KMPXVPLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempMPXVPLogDes()),BBB); } while ( EFalse )
+#define MPXVP_LOGSTRING3(AAA,BBB,CCC)        /*lint -e{717}*/ do { _LIT(tempMPXVPLogDes,AAA); RFileLogger::WriteFormat(KMPXVPLogFolder(),KMPXVPLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempMPXVPLogDes()),BBB,CCC); } while ( EFalse )
+#define MPXVP_LOGSTRING4(AAA,BBB,CCC,DDD)    /*lint -e{717}*/ do { _LIT(tempMPXVPLogDes,AAA); RFileLogger::WriteFormat(KMPXVPLogFolder(),KMPXVPLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempMPXVPLogDes()),BBB,CCC,DDD); } while ( EFalse )
+
+// Time stamp
+_LIT(KMpxvpLogTimeFormatString, "MPXVP TIMESTAMP: %H:%T:%S:%*C3");
+#define MPXVP_LOGSTRING_TIMESTAMP { \
+                                 TTime logTime; \
+                                 logTime.HomeTime(); \
+                                 TBuf<256> logBuffer; \
+                                 logTime.FormatL(logBuffer, KMpxvpLogTimeFormatString); \
+                                 RFileLogger::Write(KMPXVPLogFolder(), KMPXVPLogFile(), EFileLoggingModeAppend, logBuffer); \
+                                 }
+
+// Memory stamp
+_LIT(KMpxvpLogMemoryStampString, "MPXVP MEMORYSTAMP: %d KB");
+#define MPXVP_LOGSTRING_MEMORYSTAMP { \
+                                   User::CompressAllHeaps(); \
+                                   TMemoryInfoV1Buf logMemory; \
+                                   UserHal::MemoryInfo(logMemory); \
+                                   TInt logMemoryInt = (TInt)(logMemory().iFreeRamInBytes); \
+                                   TBuf<256> logMemoryStr; \
+                                   logMemoryStr.Format(KMpxvpLogMemoryStampString, (logMemoryInt / 1024) ); \
+                                   RFileLogger::Write(KMPXVPLogFolder(), KMPXVPLogFile(), EFileLoggingModeAppend, logMemoryStr); \
+                                   }
+
+
+#elif MPXVP_LOGGING_METHOD == 2    // RDebug
+
+
+#define MPXVP_LOGTEXT(AAA)                    RDebug::Print(AAA)
+
+#define MPXVP_LOG_STR_DESC(AAA)               RDebug::Print(AAA)
+#define MPXVP_LOG_STR_DESC2(AAA,BBB)       	 /*lint -e{717}*/ do {  RDebug::Print(AAA, BBB); } while ( EFalse )
+#define MPXVP_LOG_STR_DESC3(AAA,BBB,CCC)      /*lint -e{717}*/ do {  RDebug::Print(AAA, BBB, CCC); } while ( EFalse )
+#define MPXVP_LOG_STR_DESC4(AAA,BBB,CCC,DDD)  /*lint -e{717}*/ do {  RDebug::Print(AAA, BBB, CCC, DDD); } while ( EFalse )
+
+#define MPXVP_LOGSTRING(AAA)                  /*lint -e{717}*/ do { _LIT(tempMPXVPLogDes,AAA); RDebug::Print(tempMPXVPLogDes); } while ( EFalse )
+#define MPXVP_LOGSTRING2(AAA,BBB)             /*lint -e{717}*/ do { _LIT(tempMPXVPLogDes,AAA); RDebug::Print(tempMPXVPLogDes, BBB); } while ( EFalse )
+#define MPXVP_LOGSTRING3(AAA,BBB,CCC)         /*lint -e{717}*/ do { _LIT(tempMPXVPLogDes,AAA); RDebug::Print(tempMPXVPLogDes, BBB, CCC); } while ( EFalse )
+#define MPXVP_LOGSTRING4(AAA,BBB,CCC,DDD)     /*lint -e{717}*/ do { _LIT(tempMPXVPLogDes,AAA); RDebug::Print(tempMPXVPLogDes, BBB, CCC, DDD); } while ( EFalse )
+
+// Time stamp
+_LIT(KMpxvpLogTimeFormatString, "MPXVP TIMESTAMP: %H:%T:%S:%*C3");
+#define MPXVP_LOGSTRING_TIMESTAMP { \
+                                 TTime logTime; \
+                                 logTime.HomeTime(); \
+                                 TBuf<256> logBuffer; \
+                                 logTime.FormatL(logBuffer, KMpxvpLogTimeFormatString); \
+                                 RDebug::Print(logBuffer); \
+                                 }
+
+// Memory stamp
+_LIT(KMpxvpLogMemoryStampString, "MPXVP MEMORYSTAMP: %d KB");
+#define MPXVP_LOGSTRING_MEMORYSTAMP { \
+                                   User::CompressAllHeaps(); \
+                                   TMemoryInfoV1Buf logMemory; \
+                                   UserHal::MemoryInfo(logMemory); \
+                                   TInt logMemoryInt = (TInt)(logMemory().iFreeRamInBytes); \
+                                   TBuf<256> logMemoryStr; \
+                                   logMemoryStr.Format(KMpxvpLogMemoryStampString, (logMemoryInt / 1024) ); \
+                                   RDebug::Print(logMemoryStr); \
+                                   }
+
+
+#else	// TF_LOGGING_METHOD == 0 or invalid
+
+
+#define MPXVP_LOGSTRING(AAA)              
+#define MPXVP_LOGSTRING2(AAA,BBB)         
+#define MPXVP_LOGSTRING3(AAA,BBB,CCC)     
+#define MPXVP_LOGSTRING4(AAA,BBB,CCC,DDD) 
+
+#define MPXVP_LOGTEXT(AAA)                
+
+#define MPXVP_LOG_STR_DESC(AAA)              
+#define MPXVP_LOG_STR_DESC2(AAA,BBB)         
+#define MPXVP_LOG_STR_DESC3(AAA,BBB,CCC)     
+#define MPXVP_LOG_STR_DESC4(AAA,BBB,CCC,DDD) 
+
+#define MPXVP_LOGSTRING_TIMESTAMP
+#define MPXVP_LOGSTRING_MEMORYSTAMP
+
+
+#endif // TF_LOGGING_METHOD
+
+
+#endif // MPXVPDEBUG_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/loc/mpxvideoplayer.loc	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,39 @@
+/*
+* 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:  MpxVideoPlayer App localisation strings.
+*
+*/
+
+// Version : %version: 9 %
+
+// APPLICATION TITLES
+//
+
+//d:Application title for the grid view
+//d: Title of the icon in grid view for the user to start the application
+//d: This string will be shown in the task switcher when Videos is running.
+//d: Translation should be identical with qtn_vcx_title_suite
+//l:cell_app_pane_t1
+//r:5.2
+#define qtn_mpxvideoplayer_short_caption        "Videos"
+
+//d:Application title for the list view
+//d: Title of the icon in list view for the user to start the application.
+//d: The icon will usually be hidden from the applications grid.
+//d: The translation for this string should be equal to qtn_vcx_title_suite
+//l:list_single_large_graphic_pane_t1
+//r:5.2
+#define qtn_mpxvideoplayer_caption              "Videos"
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/rom/mpxvideoplayer.iby	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,29 @@
+/*
+* 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: mpx videoplayer iby*
+*
+*/
+
+#ifndef __MPXVIDEOPLAYER_IBY__
+#define __MPXVIDEOPLAYER_IBY__
+
+#include <data_caging_paths_for_iby.hrh>
+
+// VideoPlayer
+S60_APP_EXE(MpxVideoPlayer)
+S60_UPGRADABLE_APP_REG_RSC(mpxvideoplayer)
+// Stub sis file
+data=ZSYSTEM\install\videoplayer_stub.sis    						system\install\videoplayer_stub.sis
+
+#endif // __MPXVIDEOPLAYER_IBY__
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/rom/mpxvideoplayerresources.iby	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,26 @@
+/*
+* 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: mpx videoplayer resource iby*
+*
+*/
+
+#ifndef __MPXVIDEOPLAYERRESOURCES_IBY__
+#define __MPXVIDEOPLAYERRESOURCES_IBY__
+
+#include <data_caging_paths_for_iby.hrh>
+
+S60_APP_RESOURCE(mpxvideoplayer)
+data=DATAZ_\APP_BITMAP_DIR\mpxvideoplayer_aif.mif        APP_BITMAP_DIR\mpxvideoplayer_aif.mif
+
+#endif // __MPXVIDEOPLAYERRESOURCES_IBY__
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/rom/mpxvideoplayervariant.iby	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,26 @@
+/*
+* 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:
+*
+*/
+
+// Version : %version: da1mmcf#5 %
+
+#ifndef __MPXVIDEOPLAYERVARIANT_IBY__
+#define __MPXVIDEOPLAYERVARIANT_IBY__
+
+#include <data_caging_paths_for_iby.hrh>
+
+
+#endif // __MPXVIDEOPLAYERVARIANT_IBY__
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/sis/VideoPlayer.pkg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,186 @@
+;
+; 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: Contains all needed component for the MPX Video Player application
+;
+; Version : %version: %
+;
+
+; Languages
+&EN
+
+; Header
+#{"Video Player"},(0x200159B2),9,22,43, TYPE=SA, RU
+
+; Supports S60 v5.2
+[0x20022E6D], 0, 0, 0, {"Series60ProductID"}
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Non-localised vendor name
+:"Nokia"
+
+@"cenrep.sisx",(0x10202be9)
+;
+; MPX Video Player
+;
+"/epoc32/release/armv5/urel/mpxvideoplayer.exe"                         - "!:/sys/bin/mpxvideoplayer.exe"
+"/epoc32/data/z/resource/apps/mpxvideoplayer.rsc"                       - "!:/resource/apps/mpxvideoplayer.rsc"
+"/epoc32/data/z/private/10003a3f/apps/mpxvideoplayer_reg.rsc"           - "!:/private/10003a3f/import/apps/mpxvideoplayer_reg.rsc"
+"/epoc32/data/Z/resource/apps/mpxvideoplayer_aif.mif"                   - "!:/resource/apps/mpxvideoplayer_aif.mif"
+
+;
+; Playback Plugin
+;
+"/epoc32/release/armv5/urel/mpxvideohelixplayback.dll"                  - "!:/sys/bin/mpxvideohelixplayback.dll"
+"/epoc32/data/z/resource/plugins/mpxvideohelixplayback.rsc"             - "!:/resource/plugins/mpxvideohelixplayback.rsc"
+
+;
+; View Plugin
+;
+"/epoc32/release/armv5/urel/mpxvideoplaybackviewplugin.dll"             - "!:/sys/bin/mpxvideoplaybackviewplugin.dll"
+"/epoc32/data/z/resource/plugins/mpxvideoplaybackviewplugin.rsc"        - "!:/resource/plugins/mpxvideoplaybackviewplugin.rsc"
+
+"/epoc32/release/armv5/urel/mpxvideopdlplaybackviewplugin.dll"          - "!:/sys/bin/mpxvideopdlplaybackviewplugin.dll"
+"/epoc32/data/z/resource/plugins/mpxvideopdlplaybackviewplugin.rsc"     - "!:/resource/plugins/mpxvideopdlplaybackviewplugin.rsc"
+
+;
+; Controls
+;
+"/epoc32/release/armv5/urel/mpxvideoplaybackcontrols.dll"               - "!:/sys/bin/mpxvideoplaybackcontrols.dll"
+"/epoc32/data/z/resource/apps/mpxvideoplaybackcontrols.rsc"             - "!:/resource/apps/mpxvideoplaybackcontrols.rsc" 
+"/epoc32/data/z/resource/apps/mpxvideoplaybackcontrols.mif"             - "!:/resource/apps/mpxvideoplaybackcontrols.mif"
+
+;
+; View
+;
+"/epoc32/release/armv5/urel/mpxvideoplaybackviews.dll"                  - "!:/sys/bin/mpxvideoplaybackviews.dll"
+"/epoc32/data/z/resource/apps/mpxvideoplaybackviews.rsc"                - "!:/resource/apps/mpxvideoplaybackviews.rsc"
+
+;
+; Video Playback Helpers
+;
+"/epoc32/release/armv5/urel/playbackhelper.dll"                         - "!:/sys/bin/playbackhelper.dll"
+
+;
+; LW player
+;
+"/epoc32/release/armv5/urel/lwplayer.exe"                               - "!:/sys/bin/lwplayer.exe" 
+"/epoc32/data/z/resource/apps/lwplayer.rsc"                             - "!:/resource/apps/lwplayer.rsc" 
+"/epoc32/data/z/private/10003a3f/apps/lwplayer_reg.rsc"                 - "!:/private/10003a3f/import/apps/lwplayer_reg.rsc" 
+
+;
+; File details dialog
+;
+"/epoc32/release/armv5/urel/MPFileDetailsDialog.dll"                    - "!:/sys/bin/MPFileDetailsDialog.dll"
+"/epoc32/data/z/resource/apps/MPFileDetails.rsc"                        - "!:/resource/apps/MPFileDetails.rsc"
+
+;
+; File details plugin
+;
+"/epoc32/release/armv5/urel/filedetailsplugin.dll"                      - "!:/sys/bin/filedetailsplugin.dll"
+"/epoc32/data/z/resource/plugins/filedetailsplugin.rsc"                 - "!:/resource/plugins/filedetailsplugin.rsc"
+
+;
+; MyVideos Collection Plugin
+;
+"/epoc32/release/armv5/urel/vcxmyvideoscollectionplugin.dll"            - "!:/sys/bin/vcxmyvideoscollectionplugin.dll"
+"/epoc32/data/z/resource/plugins/vcxmyvideoscollectionplugin.rsc"       - "!:/resource/plugins/vcxmyvideoscollectionplugin.rsc"
+
+;
+; Connection Utility
+;
+"/epoc32/release/armv5/urel/vcxconnectionutility.dll"                   - "!:/sys/bin/vcxconnectionutility.dll"
+"/epoc32/release/armv5/urel/vcxconnutilpsworker.exe"                    - "!:/sys/bin/vcxconnutilpsworker.exe"
+
+;
+; Video Scheduler
+;
+"/epoc32/release/armv5/urel/cseschedulerserver.exe"                     - "!:/sys/bin/cseschedulerserver.exe"
+"/epoc32/release/armv5/urel/cseschedulerclient.dll"                     - "!:/sys/bin/cseschedulerclient.dll"
+
+;
+; MediaSettings
+;
+"/epoc32/release/armv5/urel/mediasettings.exe"                          - "!:/sys/bin/mediasettings.exe" 
+"/epoc32/data/z/resource/mediasettings.rsc"                             - "!:/resource/mediasettings.rsc" 
+"/epoc32/data/z/resource/apps/mediasettings.rsc"                        - "!:/resource/apps/mediasettings.rsc" 
+"/epoc32/data/z/resource/apps/mediasettings.mif"                        - "!:/resource/apps/mediasettings.mif"
+"/epoc32/data/z/private/10003a3f/apps/mediasettings_reg.rsc"            - "!:/private/10003a3f/import/apps/mediasettings_reg.rsc" 
+
+;
+; MPSettBase
+;
+"/epoc32/release/armv5/urel/mpsettbase.dll"                             - "!:/sys/bin/mpsettbase.dll"
+
+;
+; MPSettROPModel
+;
+"/epoc32/release/armv5/urel/mpsettropmodel.dll"                         - "!:/sys/bin/mpsettropmodel.dll"
+"/epoc32/data/z/resource/mpsettingsropmodel.rsc"                        - "!:/resource/plugins/mpsettingsropmodel.rsc"
+"/epoc32/data/z/resource/plugins/mpsettropmodel.rsc"                    - "!:/resource/plugins/mpsettropmodel.rsc"
+"/epoc32/data/z/resource/mpsettingsropmodel.rsc"                        - "!:/resource/mpsettingsropmodel.rsc"
+
+;
+; GSVideoPlugin
+;
+"/epoc32/release/armv5/urel/gsvideoplugin.dll"                          - "!:/sys/bin/gsvideoplugin.dll"
+"/epoc32/data/z/resource/plugins/gsvideoplugin.rsc"                     - "!:/resource/plugins/gsvideoplugin.rsc"
+
+;
+; Video Player Specific Settings Engine
+;
+"/epoc32/release/armv5/urel/vcxnssettingsengine.dll"                    - "!:/sys/bin/vcxnssettingsengine.dll"
+
+;
+; View Plugins
+;
+"/epoc32/release/armv5/urel/vcxhgmyvideosplugin.dll"                    - "!:/sys/bin/vcxhgmyvideosplugin.dll"
+"/epoc32/data/z/resource/plugins/vcxhgmyvideosplugin.rsc"               - "!:/resource/plugins/vcxhgmyvideosplugin.rsc"
+
+;
+; Views
+;
+"/epoc32/release/armv5/urel/vcxhgmyvideos.dll"                          - "!:/sys/bin/vcxhgmyvideos.dll"
+"/epoc32/data/z/resource/apps/vcxhgmyvideos.rsc"                        - "!:/resource/apps/vcxhgmyvideos.rsc"
+"/epoc32/data/z/resource/apps/vcxhgmyvideos.mif"                        - "!:/resource/apps/vcxhgmyvideos.mif"
+"/epoc32/data/z/resource/apps/vcxhgmyvideosicons.mif"                   - "!:/resource/apps/vcxhgmyvideosicons.mif"
+
+;
+; My Videos indicator plugin
+;
+"/epoc32/release/armv5/urel/myvideosindicatorplugin.dll"                - "!:/sys/bin/myvideosindicatorplugin.dll"
+"/epoc32/data/z/resource/plugins/myvideosindicatorplugin.rsc"           - "!:/resource/plugins/myvideosindicatorplugin.rsc"
+
+;
+; Help files
+;
+"/epoc32/data/z/resource/xhtml/01/0x102750E2/contents.zip"              - "!:/resource/xhtml/01/0x102750E2/contents.zip"
+"/epoc32/data/z/resource/xhtml/01/0x102750E2/index.xml"                 - "!:/resource/xhtml/01/0x102750E2/index.xml"
+"/epoc32/data/z/resource/xhtml/01/0x102750E2/keywords.xml"              - "!:/resource/xhtml/01/0x102750E2/keywords.xml"
+"/epoc32/data/z/resource/xhtml/01/0x102750E2/meta.xml"                  - "!:/resource/xhtml/01/0x102750E2/meta.xml"
+
+;
+; Language specific files for Video Player application
+; If user want to create sis files for a specific variant then add supported languages here 
+;
+"/epoc32/data/z/resource/mediasettings.r01"                             - "!:/resource/mediasettings.r01"
+"/epoc32/data/z/resource/apps/MPFileDetails.r01"                        - "!:/resource/apps/MPFileDetails.r01"
+"/epoc32/data/z/resource/apps/mediasettings.r01"                        - "!:/resource/apps/mediasettings.r01" 
+"/epoc32/data/z/resource/apps/vcxhgmyvideos.r01"                        - "!:/resource/apps/vcxhgmyvideos.r01"
+"/epoc32/data/z/resource/apps/mpxvideoplaybackcontrols.r01"             - "!:/resource/apps/mpxvideoplaybackcontrols.r01"
+"/epoc32/data/z/resource/apps/mpxvideoplaybackviews.r01"                - "!:/resource/apps/mpxvideoplaybackviews.r01"
+"/epoc32/data/z/resource/apps/lwplayer.r01"                             - "!:/resource/apps/lwplayer.r01"
+"/epoc32/data/z/resource/apps/mpxvideoplayer.r01"                       - "!:/resource/apps/mpxvideoplayer.r01"
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/sis/VideoPlayer_stub.pkg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,32 @@
+;
+; Copyright (c) 2002-2007 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:  Stub file for Video Player Application.
+;
+; Version : %version: %
+;
+
+;Languages
+&EN
+
+;Header
+#{"Video Player"},(0x200159B2),9,22,43, TYPE=SA
+
+;Localised Vendor name
+%{"Nokia"}
+
+; Non-localised vendor name
+:"Nokia"
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/sis/cenrep.pkg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,42 @@
+;
+; Copyright (c) 2002-2007 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 Player Cenrep files
+;
+;  Version     : %version: %
+;
+
+; Languages
+&EN 
+
+; Localised Vendor Name 
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+#{"Video Player CenRep files"}, (0x10202be9), 1,00,0, TYPE=PU 
+
+; Supports Series 60 v3.0
+[0x101F7961], 0, 0, 0, {"Series60ProductID"}
+
+; Settings
+"/epoc32/data/z/private/10202be9/102750E2.txt" - "c:/private/10202be9/102750E2.txt" 
+"/epoc32/data/z/private/10202be9/2000B438.txt" - "c:/private/10202be9/2000B438.txt"
+"/epoc32/data/z/private/10202be9/101F880B.txt" - "c:/private/10202be9/101F880B.txt"
+
+; Video Helix
+"/epoc32/data/z/private/10202be9/101F880A.txt" - "c:/private/10202be9/101F880A.txt"
+
+; MyVideos Collection
+"/epoc32/data/z/private/10202be9/2001B2A9.txt" - "c:/private/10202be9/2001B2A9.txt"
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/sis/depends.xml	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ad:metadata xmlns="http://nokia.com/arrow/repository/ia_component"
+  xmlns:ad="http://nokia.com/arrow/application_metadata">
+  <appResources>
+    <appResource>
+      <language>1</language>
+      <iacName>Videos</iacName>
+      <iacDescription>Update package for Videos</iacDescription>
+    </appResource>
+  </appResources>
+  <swPlatformDep>
+    <platform>S60</platform>
+    <versionFrom>
+      <major>5</major>
+      <minor>2</minor>
+      <date>
+        <year>2010</year>
+        <week>1</week>
+      </date>
+    </versionFrom>
+    <versionTo>
+      <major>5</major>
+      <minor>2</minor>
+      <date>
+        <year>2020</year>
+        <week>1</week>
+      </date>
+    </versionTo>
+  </swPlatformDep>
+  <interDeps>
+  </interDeps>
+</ad:metadata>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/sis/make_videoplayer_sisx.bat	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,25 @@
+@rem
+@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+@rem All rights reserved.
+@rem This component and the accompanying materials are made available
+@rem under the terms of "Eclipse Public License v1.0"
+@rem which accompanies this distribution, and is available
+@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+@rem
+@rem Initial Contributors:
+@rem Nokia Corporation - initial contribution.
+@rem
+@rem Contributors:
+@rem
+@rem Description: Script file for VideoPlayer
+@rem
+
+
+call makesis.exe cenrep.pkg cenrep.sis 
+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 del VideoPlayer.sis
+call del cenrep.sisx
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/src/mpxvideoembeddedpdlhandler.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,208 @@
+/*
+* 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:  Handles PDL commands passed in by other appilcations
+*
+*/
+
+
+// Version : %version:  ou1cpsw#17 %
+
+
+#include <mpxcommand.h>
+#include <mpxcommandgeneraldefs.h>
+#include <mpxmessagegeneraldefs.h>
+#include <mpxplaybackmessage.h>
+#include <mpxplaybackutility.h>
+#include <mpxmediageneraldefs.h>
+
+#include <mpxviewutility.h>
+#include <mpxviewpluginmanager.h>
+#include <mpxviewplugin.h>
+
+#include "mpxvideoembeddedpdlhandler.h"
+#include "mpxvideoplayerappuiengine.h"
+#include "mpxvideoplayerconstants.h"
+#include "mpxvideoplayercustomviewmsgconsts.h"
+#include <mpxvideoplaybackdefs.h>
+#include "mpxvideo_debug.h"
+
+CMpxVideoEmbeddedPdlHandler*
+CMpxVideoEmbeddedPdlHandler::NewL( CMpxVideoPlayerAppUiEngine* aAppUiEngine )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoEmbeddedPdlHandler::NewL()"));
+
+    CMpxVideoEmbeddedPdlHandler* self = new ( ELeave ) CMpxVideoEmbeddedPdlHandler( aAppUiEngine );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   C++ constructor can NOT contain any code that might leave.
+// -------------------------------------------------------------------------------------------------
+//
+CMpxVideoEmbeddedPdlHandler::CMpxVideoEmbeddedPdlHandler( CMpxVideoPlayerAppUiEngine* aAppUiEngine )
+    : iAppUiEngine( aAppUiEngine )
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+//   Destructor.
+// -------------------------------------------------------------------------------------------------
+//
+CMpxVideoEmbeddedPdlHandler::~CMpxVideoEmbeddedPdlHandler()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoEmbeddedPdlHandler::~CMpxVideoEmbeddedPdlHandler()"));
+
+    if ( iDownloadFileName )
+    {
+        delete iDownloadFileName;
+        iDownloadFileName = NULL;
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   Symbian 2nd phase constructor can leave.
+// -------------------------------------------------------------------------------------------------
+//
+void CMpxVideoEmbeddedPdlHandler::ConstructL()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoEmbeddedPdlHandler::ConnectToEmbeddedDownloadL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMpxVideoEmbeddedPdlHandler::ConnectToEmbeddedDownloadL( TInt aDlId, TDesC& aFileName )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoEmbeddedPdlHandler::ConnectToEmbeddedDownloadL()"),
+                   _L("aDlId = %d, aFileName = %S"), aDlId, &aFileName );
+
+    iEmbeddedPdlCase = ETrue;
+
+    if ( iDownloadFileName )
+    {
+        //
+        //  Check if this is the same download that is loaded
+        //  If it is, issue a play command to resume playback
+
+        if ( ( aDlId == iDownloadId ) && ( ! aFileName.Compare( *iDownloadFileName ) ) )
+        {        
+            iAppUiEngine->SendMpxPlaybackCmdL( EPbCmdPlay );            
+            iAppUiEngine->SendMessageToPdlViewL( KMpxVideoPlaybackPdlReloadComplete );
+        }
+        else
+        {
+            //
+            //  New download received, close old playback plugin
+            //
+            iAppUiEngine->ClosePlaybackPluginL();
+            iAppUiEngine->SendMessageToPdlViewL( KMpxVideoPlaybackPdlReloading );
+            StartNewDownloadL( aDlId, aFileName );
+        }
+    }
+    else
+    {
+        StartNewDownloadL( aDlId, aFileName );
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoEmbeddedPdlHandler::ConnectToCollectionDownloadL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMpxVideoEmbeddedPdlHandler::ConnectToCollectionDownloadL( TInt aDlId, TDesC& aFileName )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoEmbeddedPdlHandler::ConnectToCollectionDownloadL()"),
+                   _L("aDlId = %d, aFileName = %S"), aDlId, &aFileName );
+
+    iEmbeddedPdlCase = EFalse;
+
+    //
+    //  The playback plugin will not be loaded for collection downloads
+    //
+    StartNewDownloadL( aDlId, aFileName );
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoEmbeddedPdlHandler::StartNewDownloadL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMpxVideoEmbeddedPdlHandler::StartNewDownloadL( TInt aDlId, TDesC& aFileName )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoEmbeddedPdlHandler::StartNewDownloadL()"),
+                   _L("aDlId = %d, aFileName = %S"), aDlId, &aFileName );
+
+    //
+    //  Save the download parameters
+    //
+    iDownloadId = aDlId;
+    delete iDownloadFileName;
+    iDownloadFileName = NULL;
+    iDownloadFileName = aFileName.AllocL();
+
+    //
+    //  Load the correct playback view
+    //
+    iAppUiEngine->PreLoadPdlPlaybackViewL();
+
+    SendPdlCustomCommandL( EPbCmdStartPd, iDownloadId );
+
+    iAppUiEngine->InitializeFileL( *iDownloadFileName );
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoEmbeddedPdlHandler::SendPdlCustomCommandL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMpxVideoEmbeddedPdlHandler::SendPdlCustomCommandL( TMPXPlaybackPdCommand aCustomCmd,
+                                                         TInt aData )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoEmbeddedPdlHandler::SendPdlCustomCommandL"),
+                   _L("aCustomCmd = %d, aData = %d"), aCustomCmd, aData );
+
+    CMPXCommand* cmd = CMPXCommand::NewL();
+    CleanupStack::PushL( cmd );
+
+    cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
+    cmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId, KMPXCommandIdPlaybackPD );
+    cmd->SetTObjectValueL<TMPXPlaybackPdCommand>( KMPXCommandPlaybackGeneralType, aCustomCmd );
+    cmd->SetTObjectValueL<TInt>( KMPXCommandPlaybackPDTransactionID, aData );
+    cmd->SetTextValueL( KMPXMediaVideoPlaybackFileName, *iDownloadFileName );
+    cmd->SetTObjectValueL<TInt>( KMPXMediaVideoMovePdlFile, iEmbeddedPdlCase );
+    
+    TRAPD( err, iAppUiEngine->SendCustomMpxPlaybackUtilityCmdL( *cmd ) );
+
+    CleanupStack::PopAndDestroy( cmd );
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoEmbeddedPdlHandler::ClearPdlInformation()
+// -------------------------------------------------------------------------------------------------
+//
+void CMpxVideoEmbeddedPdlHandler::ClearPdlInformation()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoEmbeddedPdlHandler::ClearPdlInformation"));
+
+    if ( iDownloadFileName )
+    {
+        delete iDownloadFileName;
+        iDownloadFileName = NULL;
+    }
+
+    iDownloadId = KErrNotFound;
+}
+
+// EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/src/mpxvideoplayerapplication.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,58 @@
+/*
+* 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 "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:  Application class
+*
+*/
+
+// Version : %version: da1mmcf#4 %
+
+
+#include "mpxvideoplayerapplication.h"                 // header for this class
+#include "mpxvideoplayerdocument.h"                    // application document class
+#include "mpxvideoplayerconstants.h"
+#include <eikstart.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CMpxVideoPlayerApplication::AppDllUid
+// Returns application UID
+// -----------------------------------------------------------------------------
+//
+TUid CMpxVideoPlayerApplication::AppDllUid() const
+    {
+    return KUidMpxVideoPlayerApplication;
+    }
+
+// -----------------------------------------------------------------------------
+// CMpxVideoPlayerApplication::CreateDocumentL
+// Creates CMpxVideoPlayerDocument object
+// -----------------------------------------------------------------------------
+//
+CApaDocument* CMpxVideoPlayerApplication::CreateDocumentL()
+    {
+    return CMpxVideoPlayerDocument::NewL( *this );
+    }
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+LOCAL_C CApaApplication* NewApplication()
+    {
+    return new CMpxVideoPlayerApplication;
+    }
+
+GLDEF_C TInt E32Main()
+    {
+    return EikStart::RunApplication( NewApplication );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/src/mpxvideoplayerappui.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,324 @@
+/*
+* 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:  AppUI implementation
+*
+*/
+
+// Version : %version: e92_40 %
+
+
+#include <hlplch.h>                     // Help launcher
+#include <sysutil.h>                    // disk space check
+#include <f32file.h>                    // TDriveNumber::EDriveC
+#include <s32mem.h>
+#include <StringLoader.h>
+#include <AknQueryDialog.h>
+#include <aknview.h>
+#include <aknconsts.h>
+#include <AknDef.h>
+#include <AiwGenericParam.h>
+#include <coeutils.h>
+
+#include <mpxplaybackutility.h>
+#include <mpxplaybackmessage.h>
+#include <mpxviewutility.h>
+#include <vcxmyvideosdefs.h>
+#include <mpxvideoplayer.rsg>
+
+#include "mpxvideoplayerappui.h"
+#include "mpxvideoplayerconstants.h"
+#include "mpxvideoplayerlogger.h"
+#include "mpxvideoplayerappuiengine.h"
+#include "mpxvideoplayeraiwparamextractor.h"
+#include "mpxvideo_debug.h"
+#include "videoplayerpskeys.h"
+
+// ======== MEMBER FUNCTIONS ========
+// -----------------------------------------------------------------------------
+// CMpxVideoPlayerAppUi::CMpxVideoPlayerAppUi
+// -----------------------------------------------------------------------------
+//
+CMpxVideoPlayerAppUi::CMpxVideoPlayerAppUi()
+{
+    MPX_DEBUG(_L("CMpxVideoPlayerAppUi::CMpxVideoPlayerAppUi()"));
+}
+
+// -----------------------------------------------------------------------------
+// CMpxVideoPlayerAppUi::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CMpxVideoPlayerAppUi::ConstructL()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUi::ConstructL()"));
+
+    BaseConstructL( EAknEnableSkin | EAknSingleClickCompatible );
+
+    if ( IsEmbedded() )
+    {
+        //
+        //  Set the orientation to landscape for Embedded instances
+        //
+        SetOrientationL( CAknAppUiBase::EAppUiOrientationLandscape );
+
+        //
+        //  Hide status pane for embedded use cases
+        //
+        MPX_DEBUG(_L("CMpxVideoPlayerAppUi::ConstructL() Hide Status Pane"));
+        StatusPane()->MakeVisible( EFalse );
+    }
+
+    iAppUiEngine = CMpxVideoPlayerAppUiEngine::NewL( this );
+}
+
+// -----------------------------------------------------------------------------
+// CMpxVideoPlayerAppUi::~CMpxVideoPlayerAppUi
+// Destructor. Frees reserved resources
+// -----------------------------------------------------------------------------
+//
+CMpxVideoPlayerAppUi::~CMpxVideoPlayerAppUi()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUi::~CMpxVideoPlayerAppUi()"));
+
+    delete iAppUiEngine;
+}
+
+// -----------------------------------------------------------------------------
+// CMpxVideoPlayerAppUi::HandleExit
+// Handles exit command
+// -----------------------------------------------------------------------------
+//
+void CMpxVideoPlayerAppUi::HandleExit()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUi::HandleExit()"));
+    
+    Exit();
+}
+
+// -----------------------------------------------------------------------------
+// CMpxVideoPlayerAppUi::ProcessCommandParametersL
+// From CEikAppUi, called from plugin when remind occurs and MpxVideoPlayer is not
+// exist
+// -----------------------------------------------------------------------------
+//
+TBool CMpxVideoPlayerAppUi::ProcessCommandParametersL( TApaCommand aCommand,
+                                                       TFileName& aDocumentName,
+                                                       const TDesC8& aTail )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUi::ProcessCommandParametersL()"),
+                   _L("aCommand = %d"), aCommand );
+
+
+    return iAppUiEngine->ProcessCommandParametersL( aCommand, aDocumentName, aTail );
+}
+
+// ---------------------------------------------------------------------------
+// From CEikAppUi.
+// Handle window server events.
+// ---------------------------------------------------------------------------
+//
+void CMpxVideoPlayerAppUi::HandleWsEventL( const TWsEvent& aEvent, CCoeControl* aDestination )
+{
+    TInt eventType = aEvent.Type();
+
+    //
+    //  Close from the End Call Key or the Exit Cmd from the Task Switcher
+    //
+    if ( eventType == KAknUidValueEndKeyCloseEvent || eventType == KAknShutOrHideApp )
+    {
+        MPX_DEBUG(_L("CMpxVideoPlayerAppUi::HandleWsEventL() Closed by framework"));
+
+        iAppUiEngine->ClosePlaybackPluginL();
+    }
+
+    CAknAppUi::HandleWsEventL( aEvent, aDestination );
+}
+
+// -----------------------------------------------------------------------------
+// CMpxVideoPlayerAppUi::HandleCommandL
+// -----------------------------------------------------------------------------
+//
+void CMpxVideoPlayerAppUi::HandleCommandL( TInt aCommand )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUi::HandleCommandL()"),
+                   _L("aCommand = %d"), aCommand );
+
+    switch ( aCommand )
+    {
+        case EEikCmdExit: // fall through
+        case EAknCmdExit:
+        {
+            MPX_DEBUG(_L("CMpxVideoPlayerAppUi::HandleCommandL() - Exit"));
+
+            // Ignore leave, we are about close anyways
+            TRAP_IGNORE( iAppUiEngine->ClosePlaybackPluginL() );            
+            
+            HandleExit();
+            break;
+        }
+        case EAknSoftkeyBack:
+        {
+            iAppUiEngine->HandleSoftKeyBackL();
+            break;
+        }
+        case EAknCmdHelp:
+        {
+            MPX_DEBUG(_L("CMpxVideoPlayerAppUi::HandleCommandL() - Help"));
+            HlpLauncher::LaunchHelpApplicationL( iEikonEnv->WsSession(), AppHelpContextL() );
+            break;
+        }
+        case EAknCmdHideInBackground:
+        {
+            iAppUiEngine->ClearPdlInformation();
+            break;
+        }
+        case KVcxMyVideosCmdDoLateConstruct:
+        {
+             MPX_DEBUG(_L("CMpxVideoPlayerAppUi::HandleCommandL( DoLateConstruct )"));
+             iAppUiEngine->ActivateLateConstructTimerL();
+             break;
+        }
+    }
+}
+
+// ---------------------------------------------------------------------------
+// Querying whether the application is launched in embedded mode or not.
+// ---------------------------------------------------------------------------
+//
+TBool CMpxVideoPlayerAppUi::IsEmbedded() const
+{
+    TBool embedded = iEikonEnv->StartedAsServerApp();
+
+    MPX_DEBUG(_L("CMpxVideoPlayerAppUi::IsEmbedded(%d)"), embedded );
+
+    return embedded;
+}
+
+// ---------------------------------------------------------------------------
+// Opens the specified file in response to a corresponding message.
+// ---------------------------------------------------------------------------
+//
+void CMpxVideoPlayerAppUi::OpenFileL( RFile& aFile, const CAiwGenericParamList* aParams )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUi::OpenFileL(RFile)"));
+
+    MPX_TRAPD( err, iAppUiEngine->OpenFileL( aFile, aParams ) );
+
+    //
+    //  Cancel comes from a Cancel on the Select AP dialog
+    //  Perform a softkey back
+    //
+    if ( err )
+    {
+        if ( err == KErrCancel )
+        {
+            // if the app is launched in embedded mode (view history depth would be zero)
+            // we close the app using the softkey back, if it was launched by a active view
+            // we stay in that view.
+            if ( iAppUiEngine->ViewHistoryDepth() <= 0 )
+            {
+                MPX_TRAPD( error, HandleCommandL( EAknSoftkeyBack ) );
+            }
+        }
+        else
+        {
+            User::Leave( err );
+        }
+    }
+
+    aFile.Close();
+}
+
+// ---------------------------------------------------------------------------
+// From CEikAppUi.
+// Opens the specified file
+// ---------------------------------------------------------------------------
+//
+void CMpxVideoPlayerAppUi::OpenFileL( const TDesC& aFileName )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUi::OpenFileL()"),
+                   _L("aFileName = %S"), &aFileName );
+
+    MPX_TRAPD( err, iAppUiEngine->OpenFileL( aFileName ) );
+
+    //
+    //  Cancel comes from a Cancel on the Select AP dialog
+    //  Perform a softkey back
+    //
+    if ( err )
+    {
+        if ( err == KErrCancel )
+        {
+            // if the app is launched in embedded mode (view history depth would be zero)
+            // we close the app using the softkey back, if it was launched by a active view
+            // we stay in that view.
+            if ( iAppUiEngine->ViewHistoryDepth() <= 0 )
+            {
+                MPX_TRAPD( error, HandleCommandL( EAknSoftkeyBack ) );
+            }
+        }
+        else
+        {
+            User::Leave( err );
+        }
+    }
+}
+
+// -----------------------------------------------------------------------------
+// From CEikAppUi
+// -----------------------------------------------------------------------------
+//
+MCoeMessageObserver::TMessageResponse
+CMpxVideoPlayerAppUi::HandleMessageL( TUint32 aClientHandleOfTargetWindowGroup,
+                                      TUid aMessageUid,
+                                      const TDesC8& aMessageParameters )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUi::HandleMessageL()"));
+
+    MCoeMessageObserver::TMessageResponse ret( EMessageNotHandled );
+
+    if ( iAppUiEngine->HandleMessageL( aMessageUid, aMessageParameters ) )
+    {
+        ret = EMessageHandled;
+    }
+    else
+    {
+        ret = CAknViewAppUi::HandleMessageL( aClientHandleOfTargetWindowGroup,
+                                             aMessageUid,
+                                             aMessageParameters );
+    }
+
+    return  ret;
+}
+
+// ---------------------------------------------------------------------------
+// From CCoeAppUi.
+// Handle foreground event.
+// ---------------------------------------------------------------------------
+//
+void CMpxVideoPlayerAppUi::HandleForegroundEventL( TBool aForeground )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUi::HandleForegroundEventL()"),
+                   _L("aForeground = %d"), aForeground );
+
+    CAknViewAppUi::HandleForegroundEventL( aForeground );
+}
+
+// ---------------------------------------------------------------------------
+// Return active view.
+// ---------------------------------------------------------------------------
+CAknView* CMpxVideoPlayerAppUi::View()
+{
+    return iView;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/src/mpxvideoplayerappuiengine.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,1322 @@
+/*
+* 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:  AppUI engine implementation
+*
+*/
+
+
+// Version : %version: 73.1.2 %
+
+
+#include <eikon.hrh>
+#include <avkon.hrh>
+#include <aknview.h>
+#include <mpxviewutility.h>
+#include <mpxcommand.h>
+#include <mpxcommandgeneraldefs.h>
+#include <mpxmessagegeneraldefs.h>
+#include <mpxplaybackmessage.h>
+#include <mpxplaybackutility.h>
+#include <mpxcollectionmessage.h>
+#include <mpxmediageneraldefs.h>
+#include <mpxcollectionmessagedefs.h>
+#include <vcxmyvideosdefs.h>
+#include <vcxmyvideosuids.h>
+#include <mpxcollectionpath.h>
+#include <videoplayeractivationmessage.h>
+#include <AiwGenericParam.h>
+#include <mpxcollectionuihelper.h>
+#include <mpxcollectionhelperfactory.h>
+#include <mpxcollectionplugin.hrh>
+#include <mpxmediageneralextdefs.h>
+#include <streaminglinkmodel.h>
+#include <coeutils.h>
+#include <videoplaylistutility.h>
+#include <mmf/common/mmfcontrollerframeworkbase.h>
+
+#include "mpxvideoplayerappuiengine.h"
+#include "mpxvideoplayerlogger.h"
+#include "mpxvideoplayerconstants.h"
+#include "mpxvideoembeddedpdlhandler.h"
+#include <mpxvideoplaybackdefs.h>
+#include "mpxvideo_debug.h"
+#include "mpxvideoplayercustomviewmsgconsts.h"
+#include "mpxvideoplayeriadupdate.h"
+
+const TInt KMpxPlaybackPluginTypeUid = 0x101FFCA0;
+
+// -----------------------------------------------------------------------------
+//   CMpxVideoPlayerAppUiEngine::CMpxVideoPlayerAppUiEngine
+// -----------------------------------------------------------------------------
+//
+CMpxVideoPlayerAppUiEngine::CMpxVideoPlayerAppUiEngine( CMpxVideoPlayerAppUi* aAppUi )
+    : iAppUi( aAppUi ),
+      iPlaybackUtility( NULL ),
+      iViewUtility( NULL ),
+      iCollectionUtility( NULL ),
+      iExitAo( NULL ),
+      iRecognizer( NULL ),
+      iAccessPointId( KUseDefaultIap ),
+      iMultilinkPlaylist(EFalse),
+      iSeekable(ETrue),
+      iUpdateSeekInfo(EFalse)
+{
+}
+
+// -----------------------------------------------------------------------------
+//   CMpxVideoPlayerAppUiEngine::NewL
+// -----------------------------------------------------------------------------
+//
+CMpxVideoPlayerAppUiEngine* CMpxVideoPlayerAppUiEngine::NewL( CMpxVideoPlayerAppUi* aAppUi )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::NewL()"));
+
+    CMpxVideoPlayerAppUiEngine* self = new( ELeave) CMpxVideoPlayerAppUiEngine( aAppUi );
+
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+}
+
+// -----------------------------------------------------------------------------
+//   CMpxVideoPlayerAppUiEngine::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CMpxVideoPlayerAppUiEngine::ConstructL()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::ConstructL()"));
+
+    iRecognizer = CMediaRecognizer::NewL();
+
+    //
+    //  Create the View Utility
+    //
+    iViewUtility = MMPXViewUtility::UtilityL();
+    iViewUtility->AddObserverL( this );
+    iViewUtility->ConstructDefaultViewHistoryL();
+
+    //
+    //  Create the Collection Utility
+    //
+    if ( ! iAppUi->IsEmbedded() )
+    {
+        TUid collectionMode( KUidMpxVideoPlayerApplication );
+
+        iCollectionUtility = MMPXCollectionUtility::NewL( this, collectionMode );
+    }
+    //
+    //  Create the playback utility to reduce startup time for embedded cases
+    //
+    else
+    {
+        PlaybackUtilityL();
+    }
+
+    //
+    //  Create Active Object for exiting the application
+    //
+    iExitAo = CIdle::NewL( CActive::EPriorityStandard );
+}
+
+// -----------------------------------------------------------------------------
+//   CMpxVideoPlayerAppUiEngine::PlaybackUtilityL
+// -----------------------------------------------------------------------------
+//
+MMPXPlaybackUtility& CMpxVideoPlayerAppUiEngine::PlaybackUtilityL()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::PlaybackUtilityL()"));
+
+    if ( ! iPlaybackUtility )
+    {
+        MPX_DEBUG(_L("CMpxVideoPlayerAppUiEngine::PlaybackUtilityL() - Create new"));
+        //
+        //  Create VideoHelix playback plugin
+        //
+        MMPXPlaybackUtility* playbackUtility =
+            MMPXPlaybackUtility::UtilityL( EMPXCategoryVideo, KPbModeNewPlayer );
+        MMPXPlayerManager& manager = playbackUtility->PlayerManager();
+        TRAPD( err,
+        {
+            manager.SelectPlayerL( KVideoHelixPlaybackPluginUid );
+            playbackUtility->CommandL( EPbCmdSetAutoResume, EFalse );
+        } );
+        if ( err == KErrNone )
+        {
+            iPlaybackUtility = playbackUtility;
+        }
+        else
+        {
+            TRAP_IGNORE( manager.ClearSelectPlayersL() );
+            playbackUtility->Close();
+            User::Leave( err );
+        }
+    }
+
+    return *iPlaybackUtility;
+}
+
+// -----------------------------------------------------------------------------
+//   CMpxVideoPlayerAppUiEngine::CreateCollectionUtilityMemberVariablesL
+// -----------------------------------------------------------------------------
+//
+void CMpxVideoPlayerAppUiEngine::CreateCollectionUtilityMemberVariablesL()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::CreateCollectionUtilityMemberVariablesL()"));
+
+    if ( ! iCollectionUtility )
+    {
+        //  PLAYLIST default mode
+        iCollectionUtility = MMPXCollectionUtility::NewL( this );
+    }
+
+    if ( ! iCollectionUiHelper )
+    {
+        iCollectionUiHelper = CMPXCollectionHelperFactory::NewCollectionUiHelperL();
+    }
+}
+
+// -----------------------------------------------------------------------------
+//   CMpxVideoPlayerAppUiEngine::PreLoadPdlPlaybackViewL
+// -----------------------------------------------------------------------------
+//
+void CMpxVideoPlayerAppUiEngine::PreLoadPdlPlaybackViewL()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::PreLoadPdlPlaybackViewL()"));
+
+    iViewUtility->PreLoadViewL( KVideoPdlPlaybackViewUid );
+}
+
+// -----------------------------------------------------------------------------
+//   CMpxVideoPlayerAppUiEngine::~CMpxVideoPlayerAppUiEngine
+// -----------------------------------------------------------------------------
+//
+CMpxVideoPlayerAppUiEngine::~CMpxVideoPlayerAppUiEngine()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::~CMpxVideoPlayerAppUiEngine()"));
+
+    if ( iIadUpdate )
+    {
+        delete iIadUpdate;
+        iIadUpdate = NULL;
+    }
+
+    if ( iConstructTimer )
+    {
+        delete iConstructTimer;
+        iConstructTimer = NULL;
+    }
+
+    if ( iExitAo )
+    {
+        delete iExitAo;
+        iExitAo = NULL;
+    }
+
+    if ( iRecognizer )
+    {
+        delete iRecognizer;
+        iRecognizer = NULL;
+    }
+
+    if ( iPdlHandler )
+    {
+        delete iPdlHandler;
+        iPdlHandler = NULL;
+    }
+
+    if ( iCollectionUtility )
+    {
+        iCollectionUtility->Close();
+    }
+
+    if ( iCollectionUiHelper )
+    {
+        iCollectionUiHelper->Close();
+    }
+
+    if ( iViewUtility )
+    {
+        iViewUtility->RemoveObserver( this );
+        iViewUtility->Close();
+    }
+
+    if ( iPlaybackUtility )
+    {
+        MMPXPlayerManager& manager = iPlaybackUtility->PlayerManager();
+        TRAP_IGNORE( manager.ClearSelectPlayersL() );
+        iPlaybackUtility->Close();
+    }
+}
+
+// ---------------------------------------------------------------------------
+// From MMPXViewActivationObserver.
+// Handle view activation.
+// ---------------------------------------------------------------------------
+//
+void CMpxVideoPlayerAppUiEngine::HandleViewActivation( const TUid& /*aCurrentViewType*/,
+                                                       const TUid& /*aPreviousViewType*/ )
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayerAppUiEngine::HandleAiwGenericParamListL()
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMpxVideoPlayerAppUiEngine::HandleAiwGenericParamListL( const CAiwGenericParamList* aParams )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::HandleAiwGenericParamListL()"));
+
+    TInt retVal = KErrNone;
+
+    TInt index = 0;
+
+    //
+    //  Check if there is a terminate message.  If it exists, exit the application.
+    //
+    TInt32 terminateID = 0;
+
+    const TAiwGenericParam* paramTerminate =
+        aParams->FindFirst( index, EGenericParamTerminate, EVariantTypeTInt32 );
+
+    if ( paramTerminate )
+    {
+        paramTerminate->Value().Get( terminateID );
+    }
+
+    if ( terminateID )
+    {
+        MPX_DEBUG(_L("CMpxVideoPlayerAppUiEngine::HandleAiwGenericParamListL()  Terminate message received"));
+
+        //
+        //  Embedded app is being closed
+        //
+        iAppUi->HandleCommandL( EEikCmdExit );
+
+        retVal = KErrCancel;
+    }
+    else
+    {
+        //
+        //  Determine if these parameters are for PDL
+        //
+        index = 0;
+        TInt32 dlId = KErrNotFound;
+
+        const TAiwGenericParam* genParamDlId =
+            aParams->FindFirst( index, EGenericParamDownloadId, EVariantTypeTInt32 );
+
+        if ( genParamDlId )
+        {
+            genParamDlId->Value().Get( dlId );
+
+            index = 0;
+
+            const TAiwGenericParam* paramFileName =
+                aParams->FindFirst( index, EGenericParamFile, EVariantTypeDesC );
+
+            TPtrC fileName;
+
+            //
+            //  Set the filename.  The LWPlayerAppUi checks for the
+            //  filename and exits if it doesn't exist
+            //
+            fileName.Set( paramFileName->Value().AsDes() );
+
+            if ( ! iPdlHandler )
+            {
+                iPdlHandler = CMpxVideoEmbeddedPdlHandler::NewL( this );
+            }
+
+            iPdlHandler->ConnectToEmbeddedDownloadL( dlId, fileName );
+        }
+        else
+        {
+            //
+            //  Check Access Point
+            //
+            index = 0;
+
+            const TAiwGenericParam* genParamAccessPoint =
+                aParams->FindFirst( index, EGenericParamAccessPoint, EVariantTypeTInt32 );
+
+            if ( index >= 0 && genParamAccessPoint )
+            {
+                TInt32 apId = KErrUnknown;
+                genParamAccessPoint->Value().Get( apId );
+                iAccessPointId = apId;
+            }
+        }
+    }
+
+    return retVal;
+}
+
+// -----------------------------------------------------------------------------
+//   CMpxVideoPlayerAppUiEngine::OpenFileL
+// -----------------------------------------------------------------------------
+//
+void CMpxVideoPlayerAppUiEngine::OpenFileL( RFile& aFile, const CAiwGenericParamList* aParams )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::OpenFileL(RFile)"));
+
+    TInt err = KErrNone;
+
+    if ( aParams )
+    {
+        err = HandleAiwGenericParamListL( aParams );
+    }
+
+    if ( KErrNone == err && ! iPdlHandler )
+    {
+        TFileName filename;
+        aFile.FullName(filename);
+
+        CMediaRecognizer::TMediaType mediaType = iRecognizer->IdentifyMediaTypeL( filename, aFile );
+
+        if ( mediaType == CMediaRecognizer::ELocalRamFile ||
+             mediaType == CMediaRecognizer::ELocalAsxFile )
+        {
+            HandleMultiLinksFileL( aFile, mediaType );
+        }
+        else if ( mediaType == CMediaRecognizer::ELocalSdpFile )
+        {
+            TRAP( err, PlaybackUtilityL().InitStreamingL( aFile, iAccessPointId ) );
+            
+            if( err )
+                {
+                HandleUtilityErrorL( err );
+                PlaybackUtilityL().InitStreamingL( aFile, iAccessPointId );
+                }
+            
+            ActivatePlaybackViewL();
+        }
+        else
+        {
+            iViewUtility->PreLoadViewL( KVideoPlaybackViewUid );
+            
+            TRAP( err, PlaybackUtilityL().InitL( aFile ) );
+            
+            if( err )
+                {
+                HandleUtilityErrorL( err );
+                PlaybackUtilityL().InitL( aFile );
+                }
+            
+            ActivatePlaybackViewL();
+        }
+    }
+
+    iRecognizer->FreeFilehandle();
+
+    aFile.Close();
+}
+
+// -----------------------------------------------------------------------------
+//   CMpxVideoPlayerAppUiEngine::OpenFileL
+// -----------------------------------------------------------------------------
+//
+void CMpxVideoPlayerAppUiEngine::OpenFileL( const TDesC& aFileName )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::OpenFileL()"),
+                   _L("aFileName = %S"), &aFileName);
+
+    //
+    //  pre load the view and initialize the playback framework
+    //
+    iViewUtility->PreLoadViewL( KVideoPlaybackViewUid );
+
+    CMediaRecognizer::TMediaType mediaType = iRecognizer->IdentifyMediaTypeL(aFileName);
+
+    if ( mediaType == CMediaRecognizer::ELocalVideoFile )
+    {
+        InitializeFileL( aFileName );
+    }
+    //  check if aFileName is a path to a ram or asx file
+    //          eg. c:\\data\\videos\\ramfile.ram
+    else if ( mediaType == CMediaRecognizer::ELocalRamFile ||
+              mediaType == CMediaRecognizer::ELocalAsxFile )
+    {
+        HandleMultiLinksFileL( aFileName, mediaType );
+    }
+    // check if this is a url eg. rtsp://someaddress/file.3gp
+    //
+    else if ( iRecognizer->IsValidStreamingPrefix( aFileName ) ||
+              mediaType == CMediaRecognizer::ELocalSdpFile )
+    {
+        InitializeStreamingLinkL( aFileName );
+    }
+    else
+    {
+        InitializeFileL( aFileName );
+    }
+
+    iRecognizer->FreeFilehandle();
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayerAppUiEngine::OpenMediaL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMpxVideoPlayerAppUiEngine::OpenMediaL( const CMPXMedia& aMedia )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::OpenMediaL()"));
+
+    // Assume MPX medias are always local clips
+    CMPXCollectionPath* mediaPath = CMPXCollectionPath::NewL();
+    CleanupStack::PushL( mediaPath );
+
+    mediaPath->AppendL( KVcxUidMyVideosMpxCollection );
+    mediaPath->AppendL( KVcxMvcCategoryIdAll );
+
+    mediaPath->AppendL( aMedia.ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId ) );
+    mediaPath->SelectL( aMedia.ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId ) );
+
+    CMPXCollectionPlaylist* playList = CMPXCollectionPlaylist::NewL( *mediaPath );
+    CleanupStack::PushL( playList );
+    playList->SetSingleItemPlaylist();
+    playList->SetToFirst();
+
+    iViewUtility->PreLoadViewL( KVideoPlaybackViewUid );
+
+    InitializePlaylistL( *playList, ETrue );
+
+    CleanupStack::PopAndDestroy( playList );
+    CleanupStack::PopAndDestroy( mediaPath );
+}
+
+// ---------------------------------------------------------------------------
+//   Activate the proper playback view
+// ---------------------------------------------------------------------------
+//
+void CMpxVideoPlayerAppUiEngine::ActivatePlaybackViewL()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::ActivatePlaybackViewL()"));
+
+    if ( iUpdateSeekInfo )
+    {
+        //
+        //  The plugin has been instantiated, update the media
+        //
+        UpdatePbPluginMediaL();
+        iUpdateSeekInfo = EFalse;
+    }
+    
+    MMPXPlayer* player = NULL;
+    TRAPD( err, player = PlaybackUtilityL().PlayerManager().CurrentPlayer() );
+    
+    if( err )
+        {
+        HandleUtilityErrorL( err );
+        player = PlaybackUtilityL().PlayerManager().CurrentPlayer();
+        }
+    
+    TUid pluginUid( KNullUid );
+    RArray<TUid> array;
+
+    CleanupClosePushL( array );
+
+    if ( iPdlHandler )
+    {
+        array.AppendL( KVideoPdlPlaybackViewUid );
+    }
+    else
+    {
+        if ( player )
+        {
+            pluginUid = player->UidL();
+            array.AppendL( pluginUid );
+        }
+    }
+
+    iViewUtility->ActivateViewL( array );
+
+    CleanupStack::PopAndDestroy( &array );
+}
+
+// ---------------------------------------------------------------------------
+// Sets AppUiEngine in stand alone "mode"
+// ---------------------------------------------------------------------------
+//
+void CMpxVideoPlayerAppUiEngine::StartStandAloneL()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::StartStandAloneL()"));
+
+    iViewUtility->SetAsDefaultViewL( KUidMyVideosViewType );
+}
+
+// -----------------------------------------------------------------------------
+// Handle collection message
+// -----------------------------------------------------------------------------
+//
+void CMpxVideoPlayerAppUiEngine::DoHandleCollectionMessageL( CMPXMessage* aMessage )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::DoHandleCollectionMessageL()"));
+
+    TMPXMessageId id = *(aMessage->Value<TMPXMessageId>( KMPXMessageGeneralId ));
+
+    MPX_DEBUG(_L("CMpxVideoPlayerAppUiEngine::DoHandleCollectionMessageL() TMPXMessageId = 0x%08x"), id );
+
+    if ( id == KMPXMessageGeneral )
+    {
+        TInt event( *( aMessage->Value<TInt> ( KMPXMessageGeneralEvent )) );
+        TInt type( *( aMessage->Value<TInt> ( KMPXMessageGeneralType )) );
+        TInt data( *( aMessage->Value<TInt> ( KMPXMessageGeneralData )) );
+
+        MPX_DEBUG(_L("CMpxVideoPlayerAppUiEngine::DoHandleCollectionMessageL event %d, type %d, data %d"), event, type, data );
+
+        if ( event == TMPXCollectionMessage::EPathChanged && type == EMcPathChangedByOpen )
+        {
+            if ( data == EMcItemOpened )
+            {
+                // An item was opened on the collection. Get the media attributes
+                // on the item so we can initiatiate playback
+                MPX_DEBUG(_L("CMpxVideoPlayerAppUiEngine::DoHandleCollectionMessageL: EMcItemOpened received. Can open video"));
+
+                CMPXCollectionPath* cPath = iCollectionUtility->Collection().PathL();
+
+                CleanupStack::PushL( cPath );
+
+                if ( cPath->Count() > 0 )
+                {
+                    MPX_DEBUG(_L("CMpxVideoPlayerAppUiEngine::DoHandleCollectionMessageL: Call MediaL() on collection."));
+
+                    RArray<TMPXAttribute> attribs;
+                    CleanupClosePushL( attribs );
+
+                    attribs.Append( KMPXMediaGeneralUri );
+                    attribs.Append( KVcxMediaMyVideosDownloadId );
+                    iCollectionUtility->Collection().MediaL( *cPath, attribs.Array() );
+
+                    CleanupStack::PopAndDestroy( &attribs );
+                }
+
+                CleanupStack::PopAndDestroy( cPath );
+            }
+            else if ( data == EMcContainerOpened && iMultilinkPlaylist )
+            {
+                // start the playback for streaming playlists
+                // once the playlist is opened
+                iMultilinkPlaylist = EFalse;
+
+                // The playlist was opened, initiatiate playback
+                MPX_DEBUG(_L("CMpxVideoPlayerAppUiEngine::DoHandleCollectionMessageL: EMcContainerOpened received. initiatiate playback"));
+
+                CMPXCollectionPath* cPath = iCollectionUtility->Collection().PathL();
+                CleanupStack::PushL( cPath );
+
+                if ( cPath->Count() > 0 )
+                {
+                    MPX_DEBUG(_L("CMpxVideoPlayerAppUiEngine::DoHandleCollectionMessageL: Call Playback utility with the playlist."));
+
+                    CMPXCollectionPlaylist* playlist = CMPXCollectionPlaylist::NewL( *cPath );
+                    CleanupStack::PushL( playlist );
+
+                    // Set the AutoPlay mode to false
+                    playlist->SetAutoPlay(EFalse);
+                    // set pre init plugin to false
+                    playlist->SetPreInitPlugin(EFalse);
+
+                    InitializePlaylistL( *playlist, ETrue );
+                    CleanupStack::PopAndDestroy( playlist );
+                }
+                CleanupStack::PopAndDestroy( cPath );
+            }
+        }
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayerAppUiEngine::DoHandleCollectionMediaL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMpxVideoPlayerAppUiEngine::DoHandleCollectionMediaL( const CMPXMedia& aMedia )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::DoHandleCollectionMediaL()"));
+
+    const TDesC& fileUri = aMedia.ValueText(KMPXMediaGeneralUri);
+
+    MPX_DEBUG(_L("Video URI: %S"), &fileUri );
+
+    if ( aMedia.IsSupported( KVcxMediaMyVideosDownloadId ) &&
+         aMedia.ValueTObjectL<TUint32>( KVcxMediaMyVideosDownloadId ) != 0 )
+    {
+        TUint32 dlId = aMedia.ValueTObjectL<TUint32>( KVcxMediaMyVideosDownloadId );
+
+        if ( ! iPdlHandler )
+        {
+            iPdlHandler = CMpxVideoEmbeddedPdlHandler::NewL( this );
+        }
+
+        iPdlHandler->ConnectToCollectionDownloadL( dlId, const_cast<TDesC&>( fileUri ) );
+    }
+    else
+    {
+        // We use file name to initialize playback instead of mpxmedia object.
+        iViewUtility->PreLoadViewL( KVideoPlaybackViewUid );
+        InitializeFileL( fileUri );
+    }
+}
+
+// ---------------------------------------------------------------------------
+// Steps back one level back in collection path. Will activate previous view if level exists
+// ---------------------------------------------------------------------------
+//
+void CMpxVideoPlayerAppUiEngine::StepBackCollectionPathL()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::StepBackCollectionPathL()"));
+
+    // Back the collection path one level...
+
+    CMPXCollectionPath* cPath = iCollectionUtility->Collection().PathL();
+    CleanupStack::PushL( cPath );
+
+    // Don't back up if there are no more levels or will panic
+    if ( cPath->Levels() > 1 )
+    {
+        cPath->Back();
+        iCollectionUtility->Collection().OpenL( *cPath );
+        // ... and then activate the previous view.
+        iViewUtility->ActivatePreviousViewL();
+    }
+
+    CleanupStack::PopAndDestroy( cPath );
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayerAppUiEngine::HandleMultiLinksFileL
+// -------------------------------------------------------------------------------------------------
+//
+void CMpxVideoPlayerAppUiEngine::HandleMultiLinksFileL( const TDesC& aFileName,
+                                                        CMediaRecognizer::TMediaType aMediaType )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::HandleMultiLinksFileL()"),
+                   _L("aFileName = %S, type = %d"), &aFileName, aMediaType );
+
+    TBool singleLink;
+    TBool localFile;
+
+    CVideoPlaylistUtility* playlistUtil = CVideoPlaylistUtility::NewL();
+    CleanupStack::PushL(playlistUtil);
+
+    playlistUtil->GetFileInfoL( aFileName, aMediaType, singleLink, localFile );
+
+    DoHandleMultiLinksFileL( playlistUtil, singleLink, localFile );
+
+    CleanupStack::PopAndDestroy( playlistUtil );
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayerAppUiEngine::HandleMultiLinksFileL
+// -------------------------------------------------------------------------------------------------
+//
+void CMpxVideoPlayerAppUiEngine::HandleMultiLinksFileL( RFile& aFile,
+                                                        CMediaRecognizer::TMediaType aMediaType )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::HandleMultiLinksFileL(RFile)"));
+
+    // playlist
+    TBool singleLink;
+    TBool localFile;
+
+    CVideoPlaylistUtility* playlistUtil = CVideoPlaylistUtility::NewL();
+    CleanupStack::PushL(playlistUtil);
+
+    playlistUtil->GetFileInfoL( aFile, aMediaType, singleLink, localFile );
+
+    DoHandleMultiLinksFileL( playlistUtil, singleLink, localFile );
+
+    CleanupStack::PopAndDestroy( playlistUtil );
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayerAppUiEngine::DoHandleMultiLinksFileL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMpxVideoPlayerAppUiEngine::DoHandleMultiLinksFileL( CVideoPlaylistUtility* aPlaylistUtil,
+                                                          TBool aSingleLink,
+                                                          TBool aLocalFile )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::DoHandleMultiLinksFileL()"),
+                   _L("aSingleLink = %d aLocalFile %d "), aSingleLink, aLocalFile);
+
+    if ( aSingleLink )
+    {
+        TPtrC link;
+        link.Set( aPlaylistUtil->GetLinkLC() );
+        iUpdateSeekInfo = ETrue;
+        iSeekable = aPlaylistUtil->IsSeekable();
+
+        if ( aLocalFile )
+        {
+            CMediaRecognizer::TMediaType mediaType = iRecognizer->IdentifyMediaTypeL( link );
+
+            if ( mediaType == CMediaRecognizer::EUnidentified )
+            {
+                User::Leave( KErrNotSupported );
+            }
+            else
+            {
+                InitializeFileL( link );
+            }
+        }
+        else
+        {
+            InitializeStreamingLinkL( link );
+        }
+        CleanupStack::PopAndDestroy();  // link
+    }
+    else
+    {
+        CMPXMedia* playlist = aPlaylistUtil->GetPlayListL( iAccessPointId );
+        CleanupStack::PushL( playlist );
+
+        //  Create FW utility member variables for playlist embedded use case
+        CreateCollectionUtilityMemberVariablesL();
+
+        // Set the flag to true
+        iMultilinkPlaylist = ETrue;
+
+        // load the in memory plugin
+        iCollectionUiHelper->OpenL( KUidMpxVideoPlayerApplication,
+                                    *playlist,
+                                    this,
+                                    EMPXCollectionPluginGallery );
+
+        CleanupStack::PopAndDestroy( playlist );
+    }
+}
+
+
+// -----------------------------------------------------------------------------
+//   CMpxVideoPlayerAppUiEngine::HandleMessageL()
+// -----------------------------------------------------------------------------
+//
+TBool CMpxVideoPlayerAppUiEngine::HandleMessageL( TUid aMessageUid,
+                                                  const TDesC8& aMessageParameters )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::HandleMessageL()"));
+
+    TBool msgHandled = EFalse;
+
+    switch ( aMessageUid.iUid )
+    {
+        // TVideoPlayerActivationMessage received.
+        case KVideoPlayerVodStartPlayer:
+        {
+            //  Do nothing
+            break;
+        }
+        case KVideoPlayerStartPDlPlayer:
+        {
+            // Start the PDl
+            if ( iPdlHandler )
+            {
+                CBufFlat* paramBuf = CBufFlat::NewL( 1 );
+                CleanupStack::PushL( paramBuf );
+                paramBuf->InsertL( 0, aMessageParameters );
+                RBufReadStream readStream( *paramBuf );
+
+                CAiwGenericParamList* genParamList = CAiwGenericParamList::NewLC( readStream );
+
+                HandleAiwGenericParamListL( genParamList );
+
+                CleanupStack::PopAndDestroy( genParamList );
+                CleanupStack::PopAndDestroy( paramBuf );
+
+                msgHandled = ETrue;
+            }
+
+            break;
+        }
+    }
+
+    return msgHandled;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayerAppUiEngine::HandleCollectionMessage()
+// -------------------------------------------------------------------------------------------------
+//
+void CMpxVideoPlayerAppUiEngine::HandleCollectionMessage( CMPXMessage* aMessage, TInt aError )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::HandleCollectionMessage()"));
+
+    if ( aError == KErrNone && aMessage )
+    {
+        TRAP_IGNORE( DoHandleCollectionMessageL( aMessage ) )
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayerAppUiEngine::HandleCollectionMediaL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMpxVideoPlayerAppUiEngine::HandleCollectionMediaL( const CMPXMedia& aMedia, TInt aError )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::HandleCollectionMediaL()"));
+
+    if ( aError == KErrNone )
+    {
+        DoHandleCollectionMediaL( aMedia );        
+    }
+}
+
+// ---------------------------------------------------------------------------
+// From MMPXCollectionObserver.
+// Handles the collection entries being opened.
+// ---------------------------------------------------------------------------
+//
+void CMpxVideoPlayerAppUiEngine::HandleOpenL( const CMPXMedia& /* aEntries */,
+                                              TInt /* aIndex */,
+                                              TBool /* aComplete */,
+                                              TInt aError )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::HandleOpenL(CMPXMedia)"));
+
+    if ( aError != KErrNone )
+    {
+        //
+        //  Clip the collection path to root level and reopen
+        //  This could happen after a USB refresh event where the
+        //  item no longer exists
+        //
+        CMPXCollectionPath* path = iCollectionUtility->Collection().PathL();
+
+        CleanupStack::PushL( path );
+
+        while( path->Levels() > 1 )
+        {
+            path->Back();
+        }
+
+        iCollectionUtility->Collection().OpenL( *path );
+        CleanupStack::PopAndDestroy( path );
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayerAppUiEngine::HandleOpenL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMpxVideoPlayerAppUiEngine::HandleOpenL( const CMPXCollectionPlaylist& aPlaylist, TInt aError )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::HandleOpenL(CMPXCollectionPlaylist)"));
+
+    if ( aError == KErrNone )
+    {
+        InitializePlaylistL( aPlaylist, EFalse );
+    }
+}
+
+
+// ---------------------------------------------------------------------------
+// From MMPXCHelperEmbeddedOpenObserver
+// Handles OpenL from that occured in embedded mode
+// ---------------------------------------------------------------------------
+//
+void CMpxVideoPlayerAppUiEngine::HandleEmbeddedOpenL( TInt aErr, TMPXGeneralCategory /*aCategory*/ )
+{
+    MPX_DEBUG(_L("CMPXVideoAppUi::HandleEmbeddedOpenL()"));
+
+    if ( aErr == KErrNone )
+        {   
+        SendMpxPlaybackCmdL( EPbCmdDisableEffect );
+        }
+}
+
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CMpxVideoPlayerAppUiEngine::HandleSoftKeyBackL()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::HandleSoftKeyBackL()"));
+
+    //
+    //  if we're in top level of our local view stack,
+    //  back command exits the app.  otherwise activate
+    //  the previous view in our local view stack
+    //
+    if ( iViewUtility->ViewHistoryDepth() <= 1 )
+    {
+        ActivateExitActiveObject();
+    }
+    else
+    {
+        StepBackCollectionPathL();
+    }
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+TBool CMpxVideoPlayerAppUiEngine::ProcessCommandParametersL( TApaCommand aCommand,
+                                                             TFileName& aDocumentName,
+                                                             const TDesC8& /*aTail*/ )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::ProcessCommandParametersL()"));
+
+    TBool retVal = EFalse;
+
+    //
+    //  If we are embedded or the command is to open a document
+    //
+    if ( iAppUi->IsEmbedded() || ( aCommand != EApaCommandRun && aDocumentName.Length() > 0 ) )
+    {
+        if ( iRecognizer->IsValidStreamingPrefix( aDocumentName ) )
+        {
+            retVal = ETrue;
+        }
+        else
+        {
+            retVal = ConeUtils::FileExists( aDocumentName );
+        }
+    }
+    else
+    {
+        StartStandAloneL();
+    }
+
+    return retVal;
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CMpxVideoPlayerAppUiEngine::ActivateExitActiveObject()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::ActivateExitActiveObject()"));
+
+    if ( ! iExitAo->IsActive() )
+    {
+        iExitAo->Start( TCallBack( CMpxVideoPlayerAppUiEngine::ExitApplicationL, this ) );
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayerAppUiEngine::ExitApplicationL
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMpxVideoPlayerAppUiEngine::ExitApplicationL( TAny* aPtr )
+{
+    MPX_DEBUG(_L("CMpxVideoPlayerAppUiEngine::ExitApplicationL()"));
+
+    static_cast<CMpxVideoPlayerAppUiEngine*>(aPtr)->DoExitApplicationL();
+    return KErrNone;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayerAppUiEngine::DoExitApplicationL
+// -------------------------------------------------------------------------------------------------
+//
+void CMpxVideoPlayerAppUiEngine::DoExitApplicationL()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::DoExitApplicationL()"));
+
+    iAppUi->HandleCommandL( EEikCmdExit );
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoBasePlaybackView::UpdatePbPluginMedia()
+// -------------------------------------------------------------------------------------------------
+//
+void CMpxVideoPlayerAppUiEngine::UpdatePbPluginMediaL()
+{
+    MPX_DEBUG(_L("CMpxVideoPlayerAppUiEngine::UpdatePbPluginMediaL()iSeekable %d"), iSeekable);
+
+    CMPXCommand* cmd = CMPXCommand::NewL();
+    CleanupStack::PushL( cmd );
+
+    cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
+
+    cmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId, KMPXMediaIdVideoPlayback );
+
+    cmd->SetTObjectValueL<TMPXVideoPlaybackCommand>( KMPXMediaVideoPlaybackCommand,
+                                                     EPbCmdUpdateSeekable );
+
+    cmd->SetTObjectValueL<TBool>( KMPXMediaGeneralExtVideoSeekable, iSeekable );
+    
+    SendCustomMpxPlaybackUtilityCmdL( *cmd ) ;
+
+    CleanupStack::PopAndDestroy( cmd );
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoBasePlaybackView::ViewHistoryDepth()
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMpxVideoPlayerAppUiEngine::ViewHistoryDepth()
+{
+    MPX_DEBUG(_L("CMpxVideoPlayerAppUiEngine::ViewHistoryDepth()"));
+
+    return ( iViewUtility->ViewHistoryDepth() );
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayerAppUiEngine::ClearPdlInformation()
+// -------------------------------------------------------------------------------------------------
+//
+void CMpxVideoPlayerAppUiEngine::ClearPdlInformation()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::ClearPdlInformation()"));
+
+    if ( iPdlHandler )
+    {
+        iPdlHandler->ClearPdlInformation();
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayerAppUiEngine::InitializeStreamingLinkL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMpxVideoPlayerAppUiEngine::InitializeStreamingLinkL( const TDesC& aUri )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::InitializeStreamingLinkL()"),
+                   _L("aUri = %S"), &aUri );
+    
+    TRAPD( err, PlaybackUtilityL().InitStreamingL( aUri,
+                                                  (TDesC8*)(&KDATATYPEVIDEOHELIX),
+                                                   iAccessPointId ) );
+    
+    if( err )
+        {
+        HandleUtilityErrorL( err );
+        PlaybackUtilityL().InitStreamingL( aUri,
+                                           (TDesC8*)(&KDATATYPEVIDEOHELIX),
+                                           iAccessPointId ) ;
+        }
+    
+    ActivatePlaybackViewL();
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayerAppUiEngine::InitializeFileL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMpxVideoPlayerAppUiEngine::InitializeFileL( const TDesC& aFileName )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::InitializeFileL()"),
+                   _L("aFileName = %S"), &aFileName );
+    
+    TRAPD( err, PlaybackUtilityL().InitL( aFileName ) );
+    
+    if( err )
+        {
+        HandleUtilityErrorL( err );
+        PlaybackUtilityL().InitL( aFileName );
+        }
+
+    ActivatePlaybackViewL();
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayerAppUiEngine::InitializePlaylistL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMpxVideoPlayerAppUiEngine::InitializePlaylistL( const CMPXCollectionPlaylist& aPlaylist,
+                                                      TBool aPlay )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::InitializePlaylistL()"));
+
+    TRAPD( err, PlaybackUtilityL().InitL( aPlaylist, aPlay ) );
+    
+    if( err )
+        {
+        HandleUtilityErrorL( err );
+        PlaybackUtilityL().InitL( aPlaylist, aPlay  );
+        }
+    
+    ActivatePlaybackViewL();
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayerAppUiEngine::ClosePlaybackPluginL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMpxVideoPlayerAppUiEngine::ClosePlaybackPluginL()
+    {
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::ClosePlaybackPluginL"));
+
+    if ( iViewUtility->ActiveViewType() == TUid::Uid( KMpxPlaybackPluginTypeUid ) )
+        {
+        //
+        //  The display window must be removed before closing the playback plugin
+        //
+        iAppUi->View()->HandleCommandL( EAknSoftkeyClose );
+        }
+    else
+        {
+        if ( iPlaybackUtility )
+            {            
+            SendMpxPlaybackCmdL( EPbCmdClose );
+            }
+        }
+    }
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayerAppUiEngine::SendMessageToPdlViewL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMpxVideoPlayerAppUiEngine::SendMessageToPdlViewL( TInt aMsg )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::SendMessageToPdlViewL"));
+
+    if ( iViewUtility->ActiveViewType() == TUid::Uid( KMpxPlaybackPluginTypeUid ) )
+    {
+        //
+        //  The display window must be removed before closing the playback plugin
+        //
+        iAppUi->View()->HandleCommandL( aMsg );
+    }
+}
+
+// -----------------------------------------------------------------------------
+// CMpxVideoPlayerAppUiEngine::ActivateLateConstructTimerL
+// -----------------------------------------------------------------------------
+//
+void CMpxVideoPlayerAppUiEngine::ActivateLateConstructTimerL()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::ActivateLateConstructTimerL()"));
+
+    if ( !iConstructTimer )
+    {
+        const TTimeIntervalMicroSeconds32 timeout  = 250000; // 250 ms                                                     
+
+        TCallBack callback ( CMpxVideoPlayerAppUiEngine::LateConstructCallback, this );
+
+        iConstructTimer = CPeriodic::NewL( CActive::EPriorityIdle );
+
+        iConstructTimer->Start( timeout, 0, callback );
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayerAppUiEngine::LateConstructCallback
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMpxVideoPlayerAppUiEngine::LateConstructCallback( TAny* aPtr )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::LateConstructCallback()"));
+
+    TRAP_IGNORE( static_cast<CMpxVideoPlayerAppUiEngine*>(aPtr)->DoLateConstructL() );
+
+    return KErrNone;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayerAppUiEngine::DoLateConstructL
+// -------------------------------------------------------------------------------------------------
+//
+void CMpxVideoPlayerAppUiEngine::DoLateConstructL()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::DoLateConstructL()"));
+
+    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();
+    }
+
+// ---------------------------------------------------------------------------
+//   Clears playbackutility
+// ---------------------------------------------------------------------------
+// 
+void CMpxVideoPlayerAppUiEngine::ClearPlaybackUtility()
+    {
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::ClearPlaybackUtility()"));
+    if( iPlaybackUtility )
+        {
+        MMPXPlayerManager& manager = iPlaybackUtility->PlayerManager();
+        TRAP_IGNORE( manager.ClearSelectPlayersL() );
+        iPlaybackUtility->Close();        
+        iPlaybackUtility = NULL;        
+        }    
+    }
+
+// ---------------------------------------------------------------------------
+//   Sends command to playback utility
+// ---------------------------------------------------------------------------
+// 
+void CMpxVideoPlayerAppUiEngine::SendCustomMpxPlaybackUtilityCmdL( CMPXCommand& aCmd )
+    {
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::SendCustomMpxCmdL( CMPXCommand )"));
+    
+    TRAPD( err, PlaybackUtilityL().CommandL( aCmd ) ); 
+    
+    if( err )
+        {
+        // Handle error and call again
+        HandleUtilityErrorL( err );    
+        PlaybackUtilityL().CommandL( aCmd );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//   Sends command to playback utility
+// ---------------------------------------------------------------------------
+// 
+void CMpxVideoPlayerAppUiEngine::SendMpxPlaybackCmdL( TMPXPlaybackCommand aCmd )
+    {
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::SendPlaybackCmdL( TMPXPlaybackCommand )"));
+            
+    TRAPD( err, PlaybackUtilityL().CommandL( aCmd ) );
+    
+    if( err )
+        {
+        // Playback message sending failed. Exit application.
+        ActivateExitActiveObject();
+        }
+    }
+
+//---------------------------------------------------------------------------
+// Handles leaves coming from playback utility 
+//---------------------------------------------------------------------------
+// 
+void CMpxVideoPlayerAppUiEngine::HandleUtilityErrorL( TInt aError )
+    {
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::HandleSendingError( )"));
+    
+    if( aError == KErrNotReady ||
+        aError == KErrDied ||
+        aError == KErrServerTerminated )
+        {
+        ClearPlaybackUtility();            
+        }
+    else
+        {
+        User::LeaveIfError( aError );
+        }    
+    }
+// EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/src/mpxvideoplayerdocument.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,129 @@
+/*
+* 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:  Document class
+*
+*/
+
+// Version : %version: da1mmcf#9 %
+
+
+#include <AiwGenericParam.h>
+#include <mpxviewutility.h>
+
+#include "mpxvideoplayerdocument.h"                    // header for this class
+#include "mpxvideoplayerappui.h"                       // application UI class
+#include "mpxvideoplayerlogger.h"
+#include "mpxvideo_debug.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CMpxVideoPlayerDocument::CMpxVideoPlayerDocument
+// -----------------------------------------------------------------------------
+//
+CMpxVideoPlayerDocument::CMpxVideoPlayerDocument( CEikApplication& aApp )
+    : CAiwGenericParamConsumer( aApp )
+{
+}
+
+// -----------------------------------------------------------------------------
+// CMpxVideoPlayerDocument::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CMpxVideoPlayerDocument::ConstructL()
+{
+    // Get view utility. View utility must be created before AppUi.
+    iViewUtility = MMPXViewUtility::UtilityL();
+}
+
+// -----------------------------------------------------------------------------
+// CMpxVideoPlayerDocument::NewL
+// -----------------------------------------------------------------------------
+//
+CMpxVideoPlayerDocument* CMpxVideoPlayerDocument::NewL( CEikApplication& aApp )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerDocument::NewL()"));
+
+    CMpxVideoPlayerDocument* self = new ( ELeave ) CMpxVideoPlayerDocument( aApp );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+}
+
+// -----------------------------------------------------------------------------
+// CMpxVideoPlayerDocument::~CMpxVideoPlayerDocument
+// -----------------------------------------------------------------------------
+//
+CMpxVideoPlayerDocument::~CMpxVideoPlayerDocument()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerDocument::~CMpxVideoPlayerDocument()"));
+
+    if ( iViewUtility )
+    {
+        iViewUtility->Close();
+    }
+}
+
+// -----------------------------------------------------------------------------
+// CMpxVideoPlayerDocument::CreateAppUiL
+// -----------------------------------------------------------------------------
+//
+CEikAppUi* CMpxVideoPlayerDocument::CreateAppUiL()
+{
+    return new ( ELeave ) CMpxVideoPlayerAppUi();
+}
+
+// ---------------------------------------------------------------------------
+// From class CAknDocument.
+// Called by the framework to open a file.
+// ---------------------------------------------------------------------------
+//
+CFileStore* CMpxVideoPlayerDocument::OpenFileL( TBool aDoOpen,
+                                                const TDesC& aFilename,
+                                                RFs& aFs )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerDocument::OpenFileL()"),
+                   _L("aDoOpen = %d, aFileanme = %S"), aDoOpen, &aFilename );
+
+    if ( aDoOpen )
+    {
+        //
+        //  Parse input parameters here
+        //
+
+        iAppUi->OpenFileL( aFilename );
+    }
+
+    return CAknDocument::OpenFileL( aDoOpen, aFilename, aFs );
+}
+
+
+// ---------------------------------------------------------------------------
+// From class CAknDocument.
+// Called by the framework to open a file.
+// ---------------------------------------------------------------------------
+//
+void CMpxVideoPlayerDocument::OpenFileL( CFileStore*& aFileStore, RFile& aFile )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerDocument::OpenFileL(RFile)"));
+
+    const CAiwGenericParamList* params = GetInputParameters();
+
+    static_cast<CMpxVideoPlayerAppUi*>( iAppUi )->OpenFileL( aFile, params );
+
+    return CAknDocument::OpenFileL( aFileStore, aFile );
+}
+
+// EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/src/mpxvideoplayeriadupdate.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,186 @@
+/*
+* 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 <iaupdate.h>
+#include <iaupdateparameters.h>
+#include <iaupdateresult.h>
+#include <featmgr.h>
+#include <mpxviewutility.h>
+
+#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;
+        }
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/bwins/mpxvideoplayertestu.def	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,8 @@
+EXPORTS
+	?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * LibEntryL(class CTestModuleIf &)
+	?NewL@MMPXCollectionUtility@@SAPAV1@PAVMMPXCollectionObserver@@ABVTUid@@@Z @ 2 NONAME ; class MMPXCollectionUtility * MMPXCollectionUtility::NewL(class MMPXCollectionObserver *, class TUid const &)
+	?UtilityL@MMPXViewUtility@@SAPAV1@XZ @ 3 NONAME ; class MMPXViewUtility * MMPXViewUtility::UtilityL(void)
+	?UtilityL@MMPXPlaybackUtility@@SAPAV1@W4TMPXCategory@@ABVTUid@@@Z @ 4 NONAME ; class MMPXPlaybackUtility * MMPXPlaybackUtility::UtilityL(enum TMPXCategory, class TUid const &)
+	?FileExists@ConeUtils@@SAHABVTDesC16@@@Z @ 5 NONAME ; int ConeUtils::FileExists(class TDesC16 const &)
+	?SetAutoPlay@CMPXCollectionPlaylist@@QAEXH@Z @ 6 NONAME ; void CMPXCollectionPlaylist::SetAutoPlay(int)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/conf/mpxvideoplayertest.cfg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,485 @@
+[Define]
+
+EFalse 0
+ETrue  1
+
+ENoPath 0
+EAddPath 1
+
+ELocalFile     0
+ESdpFile       1
+ERamFile       2
+EUrl           3
+EAsxFile       4          
+EMultiLinkFile 5 
+
+StandAlone 0
+Embedded 1
+
+DownloadId_1 3
+DownloadId_2 5
+
+SameFile 0
+NewFile 1
+NewFileAfterError 2
+
+AP_USEDEFAULT -1
+
+AP_GPRS_2 4
+AP_WLAN_1 5
+
+LocalLinks     0
+StreamingLinks 1
+
+EPlayerChanged 10
+
+UseName 0
+UseHandle 1
+
+EPathChanged 4
+EMcPathChangedByOpen 0
+
+EMcItemOpened 0
+EMcContainerOpened 1
+
+ViewDepth_1 1
+ViewDepth_2 2
+
+ENoMsg -5
+ENotification 1
+EMatrix 4
+
+ELaunchVideo 1
+EOpenVideoStorage 2
+EOpenInternetVideos 3
+
+EApaCommandTail 0
+EApaCommandOpen 1
+EApaCommandRun  2
+
+KErrNotFound -1
+KErrCancel -3
+
+EMulti  0
+ESingle 1
+
+EUndefined 0
+EDefined   1
+
+[Enddefine]
+
+[Test]
+//
+//  Test the terminate message from the Generic Param List
+//
+title 1) AppUiEngine Generic Parameters - Terminate
+create mpxvideoplayertest enginetest
+enginetest CreateEngine Embedded
+enginetest CreateGenericParametersTerminate
+enginetest OpenFile UseHandle local.3gp EAddPath ELocalFile
+delete enginetest
+pause 1000
+[Endtest]
+
+[Test]
+//
+//  Test the embedded PDL test cases
+//  - Launch an embedded PDL playback
+//  - Handle a message from the Browser for the same clip
+//  - Handle a message from the Browser to play a new download
+//  - Handle a message to clear the PDL information
+//  - Handle a message from the Browser to play a new download
+//
+title 2) AppUiEngine Embedded PDL
+create mpxvideoplayertest enginetest
+enginetest CreateEngine Embedded
+enginetest OpenFileEmbeddedPdl DownloadId_1 local.3gp EAddPath
+enginetest HandleMessageEmbeddedPdl SameFile
+enginetest HandleMessageEmbeddedPdl NewFile DownloadId_2 local.3gp EAddPath
+enginetest ClearPdlInformation
+enginetest HandleMessageEmbeddedPdl NewFileAfterError DownloadId_2 local.3gp EAddPath
+delete enginetest
+pause 1000
+[Endtest]
+
+[Test]
+//
+//  Test the OpenFile with a file handle API
+//  - No GenericParameters
+//  - Launch an embedded SDP file
+//
+title 3) AppUiEngine OpenFile w/ File Handle - SDP
+create mpxvideoplayertest enginetest
+enginetest CreateEngine Embedded
+enginetest OpenFile UseHandle sdp_test.sdp EAddPath ESdpFile AP_USEDEFAULT
+delete enginetest
+pause 1000
+[Endtest]
+
+[Test]
+//
+//  Test the OpenFile with a file handle API
+//  - No GenericParameters
+//  - Launch an embedded RAM file with streaming links 
+//
+title 4) AppUiEngine OpenFile w/ File Handle - RAM file
+create mpxvideoplayertest enginetest
+enginetest CreateEngine Embedded
+enginetest OpenFile UseHandle test_streaming.ram EAddPath ERamFile AP_USEDEFAULT StreamingLinks
+delete enginetest
+pause 1000
+[Endtest]
+
+[Test]
+//
+//  Test the OpenFile with a file handle API
+//  - No GenericParameters
+//  - Launch an embedded RAM file with local links 
+//
+title 5) AppUiEngine OpenFile w/ File Handle - RAM file
+create mpxvideoplayertest enginetest
+enginetest CreateEngine Embedded
+enginetest OpenFile UseHandle test_local.ram EAddPath ERamFile AP_USEDEFAULT LocalLinks
+delete enginetest
+pause 1000
+[Endtest]
+
+[Test]
+//
+//  Test the Access Point Selection with OpenFile file handle API
+//  - GenericParameters with WLAN Access Point
+//  - Launch an embedded SDP file
+//  - WLAN access point should be used
+//
+title 6) AppUiEngine Access Point Selection 
+create mpxvideoplayertest enginetest
+enginetest CreateEngine Embedded
+enginetest SetGenericParamAccessPoint AP_WLAN_1
+enginetest OpenFile UseHandle sdp_test.sdp EAddPath ESdpFile AP_WLAN_1
+delete enginetest
+pause 1000
+[Endtest]
+
+[Test]
+//
+//  Test the Access Point Selection with OpenFile file handle API
+//  - GenericParameters with GPRS Access Point
+//  - Launch an embedded SDP file
+//  - GPRS access point should be used
+//
+title 7) AppUiEngine Access Point Selection
+create mpxvideoplayertest enginetest
+enginetest CreateEngine Embedded
+enginetest SetGenericParamAccessPoint AP_GPRS_2
+enginetest OpenFile UseHandle sdp_test.sdp EAddPath ESdpFile AP_GPRS_2
+delete enginetest
+pause 1000
+[Endtest]
+
+[Test]
+//
+//  Test the OpenFile with a file name API
+//  - Launch a local clip
+//
+title 8) AppUiEngine OpenFile w/ File Name - Local
+create mpxvideoplayertest enginetest
+enginetest CreateEngine Embedded
+enginetest OpenFile UseName local.3gp EAddPath ELocalFile
+delete enginetest
+pause 1000
+[Endtest]
+
+[Test]
+//
+//  Test the OpenFile with a file name API
+//  - No GenericParameters
+//  - Launch an SDP file
+//
+title 9) AppUiEngine OpenFile w/ File Name - SDP
+create mpxvideoplayertest enginetest
+enginetest CreateEngine Embedded
+enginetest OpenFile UseName sdp_test.sdp EAddPath ESdpFile AP_USEDEFAULT
+delete enginetest
+pause 1000
+[Endtest]
+
+[Test]
+//
+//  Test the OpenFile with a file name API
+//  - No GenericParameters
+//  - Launch an RAM file with streaming links 
+//
+title 10) AppUiEngine OpenFile w/ File Name - RAM file
+create mpxvideoplayertest enginetest
+enginetest CreateEngine Embedded
+enginetest OpenFile UseName test_streaming.ram EAddPath ERamFile AP_USEDEFAULT StreamingLinks
+delete enginetest
+pause 1000
+[Endtest]
+
+[Test]
+//
+//  Test the StartStandAloneL method
+//
+title 11) AppUiEngine StartStandAloneL
+create mpxvideoplayertest enginetest
+enginetest CreateEngine StandAlone
+enginetest StartStandAlone
+delete enginetest
+pause 1000
+[Endtest]
+
+[Test]
+//
+//  Test the HandleCollectionMessage method
+//
+title 12) AppUiEngine HandleCollectionMessage
+create mpxvideoplayertest enginetest
+enginetest CreateEngine StandAlone
+enginetest HandleCollectionMessage EPathChanged EMcPathChangedByOpen EMcItemOpened 
+delete enginetest
+pause 1000
+[Endtest]
+
+[Test]
+//
+//  Test the HandleCollectionMedia method
+//
+title 13) AppUiEngine HandleCollectionMedia
+create mpxvideoplayertest enginetest
+enginetest CreateEngine StandAlone
+enginetest HandleCollectionMedia local.3gp EAddPath
+delete enginetest
+pause 1000
+[Endtest]
+
+[Test]
+//
+//  Test the HandleSoftKeyBackL Method
+//  - Set the view depth to 1
+//  - Call HandleSoftKeyL
+//  - AppUi should receive and exit
+//
+//  - Set the view depth to 2
+//  - Call HandleSoftKeyL
+//  - AppUi should StepBackCollectionPathL
+//
+title 14) AppUiEngine HandleSoftkeyBackL
+create mpxvideoplayertest enginetest
+enginetest CreateEngine StandAlone
+enginetest HandleSoftkeyBack ViewDepth_1
+waittestclass enginetest
+enginetest HandleSoftkeyBack ViewDepth_2
+delete enginetest
+pause 1000
+[Endtest]
+
+[Test]
+//
+//  Test HandleOpenL Method with Playlist
+//  - Create a Playlist
+//  - Call HandleOpenL
+//  - PlaybackUtility should receive InitL with Playlist
+//
+title 15) AppUiEngine HandleOpenPlaylist
+create mpxvideoplayertest enginetest
+enginetest CreateEngine StandAlone
+enginetest StartStandAlone
+enginetest HandleOpenPlaylist
+delete enginetest
+pause 1000
+[Endtest]
+
+[Test]
+//
+//  Test HandleOpenL Method with CMPXMedia
+//  - Create CMPXMedia
+//  - Call HandleOpenL
+//  - CollectionUtility should receive OpenL with new collection path
+//
+title 16) AppUiEngine HandleOpenMedia
+create mpxvideoplayertest enginetest
+enginetest CreateEngine StandAlone
+enginetest StartStandAlone
+enginetest HandleOpenMedia
+delete enginetest
+pause 1000
+[Endtest]
+
+[Test]
+//
+//  Test HandleViewActivation
+//  - No callback is received
+//
+title 17) AppUiEngine HandleViewActivation
+create mpxvideoplayertest enginetest
+enginetest CreateEngine StandAlone
+enginetest StartStandAlone
+enginetest HandleViewActivation
+delete enginetest
+pause 1000
+[Endtest]
+
+[Test]
+//
+//  Test ProcessCommandParametersL
+//  - Call ProcessCommandParameters with a tail
+//      - View Utility receives view activation
+//      - file exists is false
+//  - Call ProcessCommandParameters without a tail
+//      - Open with run command
+//          - stand alone player is started
+//          - file exists is false
+//      - Open with document name and streaming link
+//          - file exists is true
+//      - Open with document name and local file
+//          - file exists is true
+//      - Open with document name and file that doesn't exist
+//          - file exists is false
+//
+title 18) AppUiEngine ProcessCommandParameters
+create mpxvideoplayertest enginetest
+enginetest CreateEngine StandAlone
+enginetest ProcessCommandParameters EApaCommandRun
+enginetest ProcessCommandParameters EApaCommandOpen rtsp:\/\/stream.3gp ENoPath ETrue
+enginetest ProcessCommandParameters EApaCommandOpen local.3gp EAddPath ETrue
+enginetest ProcessCommandParameters EApaCommandOpen badname.3gp EAddPath EFalse
+delete enginetest
+pause 1000
+[Endtest]
+
+[Test]
+//
+//  Test Playlist functionality
+//  Open Multilink ram file 
+//  HandleCollectionMessage for playlist 
+//
+title 19) AppUiEngine HandleCollectionMessage RAM Playlist 
+create mpxvideoplayertest enginetest
+enginetest CreateEngine StandAlone
+enginetest OpenFile UseHandle test_multilocal.ram EAddPath EMultiLinkFile AP_USEDEFAULT LocalLinks 
+enginetest HandleCollectionMessage EPathChanged EMcPathChangedByOpen EMcContainerOpened
+delete enginetest
+pause 1000
+[Endtest]
+
+[Test]
+//
+//  Test Playlist functionality
+//  Open Multilink ASX file 
+//  HandleCollectionMessage for playlist 
+//
+title 20) AppUiEngine HandleCollectionMessage ASX Playlist 
+create mpxvideoplayertest enginetest
+enginetest CreateEngine StandAlone
+enginetest OpenFile UseHandle test_multilink_v2.asx EAddPath EMultiLinkFile AP_USEDEFAULT StreamingLinks 
+enginetest HandleCollectionMessage EPathChanged EMcPathChangedByOpen EMcContainerOpened
+delete enginetest
+pause 1000
+[Endtest]
+
+[Test]
+//
+//  Test Playlist functionality
+//  Open Multilink ASX file 
+//  HandleCollectionMessage for playlist 
+//
+title 21) AppUiEngine UpdatePbPluginMediaL ASX V3 
+create mpxvideoplayertest enginetest
+enginetest CreateEngine StandAlone
+enginetest OpenFile UseHandle test_seekSingle_v3.asx EAddPath EAsxFile AP_USEDEFAULT StreamingLinks 
+delete enginetest
+pause 1000
+[Endtest]
+
+[Test]
+//
+//  Test OpenMediaL functionality
+//  Open valid Media  
+//
+title 22) AppUiEngine OpenMediaL 
+create mpxvideoplayertest enginetest
+enginetest CreateEngine StandAlone
+enginetest OpenMedia local.3gp EAddPath
+delete enginetest
+pause 1000
+[Endtest]
+
+[Test]
+//
+//  Test OpenMediaL functionality
+//  Open bad Media  
+//
+title 23) AppUiEngine OpenMediaL bad file path
+create mpxvideoplayertest enginetest
+enginetest CreateEngine StandAlone
+enginetest OpenMedia no_existing_file.ram EAddPath
+delete enginetest
+pause 1000
+[Endtest]
+
+[Test]
+//
+//  Test View Depth functionality
+//
+title 24) AppUiEngine GetView Depth
+create mpxvideoplayertest enginetest
+enginetest CreateEngine StandAlone
+enginetest GetViewDepth ViewDepth_2
+delete enginetest
+pause 1000
+[Endtest]
+
+[Test]
+//
+//  Test the Video Center PDL test cases
+//  - Launch a stand alone instance of engine
+//  - Handle a message to start feeds PDL playback
+//
+title 25) AppUiEngine Feeds PDL
+create mpxvideoplayertest enginetest
+enginetest CreateEngine StandAlone
+enginetest HandleCollectionMedia local.3gp EAddPath DownloadId_1 
+delete enginetest
+pause 1000
+[Endtest]
+
+[Test]
+//
+//  Tests clearing of playbackutility.
+//  - Launch a stand alone instance of engine
+//  - Clear playback utility
+//
+title 26) AppUiEngine ClearPlaybackUtility
+create mpxvideoplayertest enginetest
+enginetest CreateEngine StandAlone
+enginetest ClearPlaybackUtility 
+delete enginetest
+pause 1000
+[Endtest]
+
+[Test]
+//
+//  Tests late constructing
+//
+title 27) AppUiEngine ActivateLateConstructTimer
+create mpxvideoplayertest enginetest
+enginetest CreateEngine StandAlone
+enginetest ActivateLateConstructTimer
+pause 500
+delete enginetest
+pause 1000
+[Endtest]
+
+[Test]
+//
+//  Tests embedded open
+//
+title 28) AppUiEngine HandleEmbeddedOpen
+create mpxvideoplayertest enginetest
+enginetest CreateEngine StandAlone
+enginetest HandleEmbeddedOpen
+pause 500
+delete enginetest
+pause 1000
+[Endtest]
\ No newline at end of file
Binary file videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/data/mmc/local.3gp has changed
Binary file videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/data/mmc/local1.3gp has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/data/mmc/sdp_test.sdp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,51 @@
+v=0
+o=- 1125527826 1125527826 IN IP4 10.48.2.51
+s=SDP: h263_aaclc.3gp
+i=<No author> <No copyright>
+c=IN IP4 0.0.0.0
+t=0 0
+a=SdpplinVersion:1610641560
+a=StreamCount:integer;2
+a=control:rtsp://10.48.2.51/TestContent/MediaContent/WCDMA/SDP/VideoAudio/h263_aaclc.3gp
+a=DefaultLicenseValue:integer;0
+a=FileType:string;"3GPPRel6FileFormat"
+a=LicenseKey:string;"license.Summary.Datatypes.3GPPRel6FileFormat.Enabled"
+a=range:npt=0-148.700000
+m=video 0 RTP/AVP 96
+b=AS:40
+b=RR:795
+b=RS:397
+a=control:rtsp://10.48.2.51/TestContent/MediaContent/WCDMA/SDP/VideoAudio/h263_aaclc.3gp/streamid=65335
+a=range:npt=0-136.400000
+a=length:npt=136.400000
+a=rtpmap:96 H263-2000/90000
+a=fmtp:96 profile=0; level=10
+a=mimetype:string;"video/H263-2000"
+a=Helix-Adaptation-Support:1
+a=AvgBitRate:integer;39780
+a=Width:integer;176
+a=Height:integer;144
+a=HasOutOfOrderTS:integer;1
+a=Preroll:integer;1000
+a=ASMRuleBook:string;"Marker=0,AverageBandwidth=39780,TimeStampDelivery=TRUE;Marker=1,AverageBandwidth=0,TimeStampDelivery=TRUE;"
+a=framesize:96 176-144
+a=cliprect:0,0,144,176
+a=mpeg4-esid:201
+a=x-envivio-verid:00035A23
+m=audio 0 RTP/AVP 97
+b=AS:8
+b=RR:161
+b=RS:80
+a=control:rtsp://10.48.2.51/TestContent/MediaContent/WCDMA/SDP/VideoAudio/h263_aaclc.3gp/streamid=65435
+a=range:npt=0-136.400000
+a=length:npt=136.400000
+a=rtpmap:97 MP4A-LATM/12000/1
+a=fmtp:97 profile-level-id=15; object=2; cpresent=0; config=400029103FC0
+a=mimetype:string;"audio/MP4A-LATM"
+a=Helix-Adaptation-Support:1
+a=AvgBitRate:integer;8094
+a=HasOutOfOrderTS:integer;1
+a=Preroll:integer;1000
+a=ASMRuleBook:string;"Marker=0,AverageBandwidth=8094,TimeStampDelivery=TRUE;Marker=1,AverageBandwidth=0,TimeStampDelivery=TRUE;"
+a=mpeg4-esid:101
+a=x-envivio-verid:00035A23
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/data/mmc/test_local.ram	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,1 @@
+file://c:\data\videos\local.3gp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/data/mmc/test_local_hw.ram	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,1 @@
+file://f:\testing\data\local.3gp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/data/mmc/test_multilink_v2.asx	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,3 @@
+[Reference]
+Ref1=http://10.48.2.56:443/stream.wmv?MSWMExt=.wmv
+Ref2=http://10.48.2.56:443/stream.wma?MSWMExt=.asf
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/data/mmc/test_multilocal.ram	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,2 @@
+file://c:\data\videos\local.3gp
+file://c:\data\videos\local1.3gp
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/data/mmc/test_multilocal_hw.ram	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,2 @@
+file://f:\testing\data\local.3gp
+file://f:\testing\data\local1.3gp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/data/mmc/test_seekSingle_v3.asx	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,25 @@
+<ASX version = "3.0">
+    <TITLE>Advanced Playlist Demo</TITLE>
+    <ABSTRACT>More Information at this Web site</ABSTRACT>
+    <MOREINFO HREF="http://www.microsoft.com/windows/windowsmedia" />
+    <BANNER HREF = "http://10.48.2.51/users/gaby/banner.bmp">
+        <ABSTRACT>MSN Web site</ABSTRACT>
+        <MOREINFO HREF = "http://www.msn.com" />
+    </BANNER>
+    <PARAM name="track" value="1"/>
+    <ENTRY ClientSkip="no">
+        <BANNER HREF = "http://10.48.2.51/users/gaby/banner.bmp">
+            <ABSTRACT>Visit Our Web site</ABSTRACT>
+            <MOREINFO HREF = "http://www.msn.com" />
+        </BANNER>
+        <MOREINFO HREF = "http://www.msn.com" />
+        <!-- This is the ToolTip text for Title/Author/Copyright text -->
+        <ABSTRACT>Visit the YourImage Web site</ABSTRACT>
+        <TITLE>The first entry in an advanced playlist</TITLE>
+        <AUTHOR>YourImage</AUTHOR>
+        <COPYRIGHT>(c)2000 YourImage</COPYRIGHT>
+        <!-- This is a comment.  Change the following path to point to 
+            your Windows Media file -->
+         <REF HREF = "http://10.48.2.56:443/stream.wmv" />
+    </ENTRY>
+</ASX>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/data/mmc/test_streaming.ram	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,1 @@
+rtsp://stream.3gp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/eabi/mpxvideoplayertestu.def	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,12 @@
+EXPORTS
+	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
+	_ZN22CMPXCollectionPlaylist11SetAutoPlayEi @ 2 NONAME
+	_ZTI14CSimpleTimeout @ 3 NONAME
+	_ZTI26CMpxVideoPlayerAppUiEngine @ 4 NONAME
+	_ZTI27CMpxVideoEmbeddedPdlHandler @ 5 NONAME
+	_ZTI33CMpxVideoPlayer_AppUiEngineTester @ 6 NONAME
+	_ZTV14CSimpleTimeout @ 7 NONAME
+	_ZTV26CMpxVideoPlayerAppUiEngine @ 8 NONAME
+	_ZTV27CMpxVideoEmbeddedPdlHandler @ 9 NONAME
+	_ZTV33CMpxVideoPlayer_AppUiEngineTester @ 10 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/group/bld.inf	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,43 @@
+/*
+* 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 mpxvideoplayer unit tests
+*
+*/
+
+// Version : %version: ou1cpsw#4 %
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_TESTEXPORTS
+
+../conf/mpxvideoplayertest.cfg                  /epoc32/winscw/c/testframework/mpxvideoplayertest.cfg
+../init/testframework.ini                       /epoc32/winscw/c/testframework/testframework.ini
+../data/mmc/local.3gp                           /epoc32/winscw/c/data/videos/local.3gp
+../data/mmc/sdp_test.sdp                        /epoc32/winscw/c/data/videos/sdp_test.sdp
+../data/mmc/test_streaming.ram                  /epoc32/winscw/c/data/videos/test_streaming.ram
+../data/mmc/test_local.ram                      /epoc32/winscw/c/data/videos/test_local.ram
+../data/mmc/test_multilocal.ram                 /epoc32/winscw/c/data/videos/test_multilocal.ram
+../data/mmc/test_multilink_v2.asx               /epoc32/winscw/c/data/videos/test_multilink_v2.asx
+../data/mmc/test_seekSingle_v3.asx              /epoc32/winscw/c/data/videos/test_seekSingle_v3.asx
+
+PRJ_EXPORTS
+
+PRJ_TESTMMPFILES
+mpxvideoplayertest.mmp
+
+PRJ_MMPFILES
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/group/mpxvideoplayertest.mmp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,89 @@
+/*
+* 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:  mmp file for mpxvideoplayer unit test
+*
+*/
+
+// Version : %version: ou1cpsw#13 %
+
+
+#include <platform_paths.hrh>
+
+EPOCALLOWDLLDATA
+
+TARGET          mpxvideoplayertest.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E3
+
+CAPABILITY      ALL -TCB
+
+DEFFILE         mpxvideoplayertest.def
+
+USERINCLUDE     ../inc
+USERINCLUDE     ../../../inc
+USERINCLUDE     ../../../../../inc
+
+SOURCEPATH      ../src
+
+SOURCE          mpxvideoplayertest.cpp
+SOURCE          mpxvideoplayertestBlocks.cpp
+SOURCE          mpxvideoplayer_appuienginetester.cpp
+SOURCE          mpxplaybackutilityimp_stub.cpp
+SOURCE          mpxviewutilityimp_stub.cpp
+SOURCE          mpxvideoplayerappui_stub.cpp
+SOURCE          mpxcollectionutility_stub.cpp
+SOURCE          mpxcollectionutilityimp_stub.cpp
+SOURCE          mpxcollectionuihelper_stub.cpp
+SOURCE          stifutilities.cpp
+SOURCE          coneutils_stub.cpp
+SOURCE          timeoutcontroller.cpp
+SOURCE          mpxvideoplayeriadupdate_stub.cpp
+
+SOURCEPATH      ../../../src
+SOURCE          mpxvideoplayerappuiengine.cpp
+SOURCE          mpxvideoembeddedpdlhandler.cpp
+
+APP_LAYER_SYSTEMINCLUDE
+
+OS_LAYER_LIBC_SYSTEMINCLUDE
+OS_LAYER_STDCPP_SYSTEMINCLUDE
+OS_LAYER_BOOST_SYSTEMINCLUDE
+
+SYSTEMINCLUDE   /epoc32/include/ecom
+
+USERINCLUDE     ../../../../../videofeeds/utils/inc
+
+LIBRARY         euser.lib
+LIBRARY         stiftestinterface.lib
+LIBRARY         stiftestengine.lib
+LIBRARY         mpxcommon.lib
+LIBRARY         libstdcpp.lib
+LIBRARY         libc.lib
+LIBRARY         libglib.lib
+LIBRARY         libpthread.lib
+LIBRARY         efsrv.lib
+LIBRARY         playbackhelper.lib
+LIBRARY         flogger.lib
+LIBRARY         servicehandler.lib
+LIBRARY         ecom.lib
+LIBRARY         estor.lib
+LIBRARY         videoplaylistutility.lib
+LIBRARY         mpxcollectionutility.lib
+LIBRARY	        bafl.lib
+
+LANG            SC
+
+MACRO           __APPUIENGINESTIF__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/group/mpxvideoplayertest.pkg	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,46 @@
+;
+; 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 mpxvideoplayer STIF test
+;
+; Version : %version: ou1cpsw#5 %
+;
+
+; Languages
+&EN
+
+; Provide value for uid
+#{"MPX Video Player STIF"}, (0x101FB3E3), 1, 0, 1, TYPE=SA, RU
+
+
+; Series60 product id for S60 3.0
+[0x101F7961], 0, 0, 0, {"Series60ProductID"}
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+; Install files
+"\epoc32\release\armv5\udeb\mpxvideoplayertest.dll" - "!:\sys\bin\mpxvideoplayertest.dll"
+"..\conf\mpxvideoplayertest.cfg" - "c:\testframework\mpxvideoplayertest.cfg"
+"..\init\testframework.ini" - "c:\testframework\testframework.ini"
+
+"..\data\mmc\local.3gp" - "f:\testing\data\local.3gp"
+"..\data\mmc\sdp_test.sdp" - "f:\testing\data\sdp_test.sdp"
+"..\data\mmc\test_local_hw.ram" - "f:\testing\data\test_local.ram"
+"..\data\mmc\test_multilocal_hw.ram" - "f:\testing\data\test_multilocal.ram"
+"..\data\mmc\test_streaming.ram" - "f:\testing\data\test_streaming.ram"
+"..\data\mmc\test_multilink_v2.asx" - "f:\testing\data\test_multilink_v2.asx"
+"..\data\mmc\test_seekSingle_v3.asx" - "f:\testing\data\test_seekSingle_v3.asx"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/group/mpxvideoplayertest_stif_readme.txt	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,49 @@
+This document lists test scenarios you can run STIF tests and STIF with CTC++ (code coverage)
+
+This project, mpxvideoplayertest.mmp, is built as part of PRJ_TESTMMP
+so that it can be run as part of the MultiTest runner. The STIF .cfg and .ini
+files are exported as part of the build for this. 
+
+-------------------------------------
+I. STIF Test on Emulator - No coverage
+--------------------------------------
+1) From Carbide, choose Carbide > MultiTest Runner
+2) Choose the static analysis tests you want to run (or none)
+3) Enable the "EUnit or STIF" check box and click Next
+4) Make sure the build target platform is set to the emulator
+5) Under "Select Tests" choose the mpxvideoplayer_test.mmp and check "STIF"
+6) Select the .cfg and .ini files:
+    \VideoApp_Domain\VideoApp_Domain\video\mpxvideoplayer\tsrc\ut_mpxvideoplayertest\conf\mpxvideoplayer_test.cfg
+    \VideoApp_Domain\VideoApp_Domain\video\mpxvideoplayer\tsrc\ut_mpxvideoplayertest\init\TestFramework.ini
+7) Click Finish
+
+The test will run. If there are any errors check the log and enable "Debug" when running the tests from the
+MultiTestrunner menu.
+
+
+---------------------------------------------
+II. CTC++ Code Coverage with STIF On Device
+----------------------------------------------
+CTC++ won't work with STIF so you need to run this on device.
+
+Follow these steps:
+
+1)  Create a CTC++ instrumented build with the following commands:
+        abld test reallyclean armv5 udeb
+        ctcwrap -i f abld test build armv5 udeb
+
+2)  Create a sis for with the mpxvideoplayer.pkg and sign it with the R&D keys
+        call makesis.exe mpxvideoplayertest.pkg mpxvideoplayertest.sis
+        signsis.exe mpxvideoplayertest.sis mpxvideoplayertest.sisx rd.cer rd-key.pem
+
+3)  Install mpxvideoplayertest.sisx on the device
+
+4)  Launch STIF and execute test
+
+5)  Launch CTC++ and write data to ctcdata.txt file (C:\data\ctc\)
+
+5)  Copy ctcdata.txt to your PC and process the file with the following commands and 
+    results will be written and function coverage displayed:
+        ctcrecvr -i ctcdata.txt
+        ctcpost -p profile.txt
+        ctc2html -i profile.txt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/inc/mpxcollectionuihelperimp_stub.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,856 @@
+/*
+* Copyright (c) 2006 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:  Collection Ui helper implementation
+*
+*/
+
+
+#ifndef CMPX_COLLECTION_UI_HELPER_H
+#define CMPX_COLLECTION_UI_HELPER_H
+
+#include <mpxcollectionobserver.h>
+#include <mpxcollectionpath.h>
+#include <mpxtaskqueueobserver.h>
+#include <mpxcollectionuihelperobserver.h>
+#include "mpxcollectionuihelper.h"
+#include "mpxmediatorobserver.h"
+#include "mpxmoveobserver.h"
+#include "mpxharvesterutilityobserver.h"
+
+// FOWARD DECLARATION
+class MMPXCollectionUtility;
+class CMPXCollectionMediator;
+class MMPXHarvesterUtility;
+class CMPXMedia;
+class TMPXCollectionMessage;
+class CMPXActiveTaskQueue;
+class CMPXDeleteHelper;
+
+/**
+ *  CMPXCollectionUiHelper
+ *
+ *  Implementation of the collection ui helper interface
+ *  for system specific changes
+ *
+ *  @lib collectionhelper.lib
+ *  @since S60 3.0
+ */
+NONSHARABLE_CLASS( CMPXCollectionUiHelperImp ): public CBase,
+                                          public MMPXCollectionUiHelper,
+                                          public MMPXMediatorObserver,
+                                          public MMPXHarvesterUtilityObserver,
+                                          public MMPXCollectionObserver,
+                                          public MMPXTaskQueueObserver,
+                                          public MMPXMoveItemObserver,
+                                          public MMPXCHelperObserver
+
+    {
+public:
+
+    /**
+    * Standard 2-phased constructor
+    * @param aModeId collection mode id. see mpxcollectionutility.h
+    *        for details.
+    * @return new instance of the collection ui helper
+    */
+    static CMPXCollectionUiHelperImp* NewL(const TUid& aModeId);
+
+    /**
+    * Virtual Destructor
+    */
+    virtual ~CMPXCollectionUiHelperImp();
+
+protected:
+
+    /**
+    * From MMPXCollectionUiHelper
+    *
+    * This is an async call to create a playlist or add songs to
+    * a saved playlist. In the case of creating a new playlist,
+    * no physical playlist files will be created. This type of
+    * playlists is referred to as virtual playlists. In the case
+    * of adding songs to a saved playlist, if the playlist
+    * corresponds to a playlist file, the playlist file is NOT
+    * updated.
+    *
+    * Upon completion of this request, HandleAddCompletedL is called.
+    *
+    * To add a playlist to the collection, the media provided MUST
+    * contain the following attributes:
+    *    KMPXMediaGeneralType:
+    *       must be EMPXItem
+    *
+    *    KMPXMediaGeneralCategory:
+    *       must be EMPXPlaylist
+    *
+    *    KMPXMediaGeneralUri:
+    *       This is the path where the playlist should be located.
+    *       e.g. c:\data\playlists\ or e:\playlists\. When the playlist
+    *       is successfully added to the collection, its URI will be
+    *       generated. If client is interested its URI, client can
+    *       perform a search based on the returned Id of the playlist.
+    *       Currently only supporting local path, i.e. the path provided
+    *       must contain starts with a drive letter.
+    *
+    *    KMPXMediaGeneralTitle:
+    *       Title of the playlist is NOT enforced be unique within the
+    *       music collection.
+    *
+    *    KMPXMediaArrayCount:
+    *    KMPXMediaArrayContents:
+    *       This playlist can be an empty playlist. If this is the case,
+    *       KMPXMediaArrayContents will be a CMPXMediaArray that doesn't
+    *       contain any media and KMPXMediaArrayCount will be 0.
+    *
+    *       Each CMPXMedia contained in the media array represents
+    *       a song. Each song must contain the following attributes:
+    *           KMPXMediaGeneralType:
+    *               must be EMPXItem
+    *
+    *           KMPXMediaGeneralCategory:
+    *               must be EMPXSong
+    *
+    *       For songs that already exist in the collection, client
+    *       must provide either KMPXMediaGeneralId or KMPXMediaGeneralUri.
+    *
+    *       For songs that do not exist in the collection, client must
+    *       provide KMPXMediaGeneralUri and its metadata. These songs
+    *       will be added to the music collection when the playlist is
+    *       added. These songs added to the collection are NOT registered
+    *       with Harvester; hence, during next scan/refresh, these songs
+    *       will be scanned and updated in the collection unnecessarily
+    *       and cause scan/refresh performance degradation. If any
+    *       metadata of these songs is changed in the collection before
+    *       next scan/refresh, it will be lost after scan/refresh.
+    *
+    *       WARNING:
+    *       Client must add the songs to the collection prior to adding
+    *       the playlist.
+    *
+    *    WARNING:
+    *    This playlist is NOT registered with Harvester. If client
+    *    creates a physical playlist file, Harvester will re-parse
+    *    and update the playlist in the collection during the next
+    *    scan/refresh unnecessarily and cause scan/refresh performance
+    *    degradation. If this playlist is edited, the physical
+    *    playlist file is NOT updated to reflect the changes.
+    *
+    *    If the playlist is successfully added to the collection,
+    *    the media returned in the callback will contain the Id
+    *    of the playlist.
+    *
+    * To add songs to a saved playlist, the media provided MUST
+    * contain the following attributes:
+    *    KMPXMediaGeneralType:
+    *       must be EMPXItem
+    *
+    *    KMPXMediaGeneralCategory:
+    *       must be EMPXPlaylist
+    *
+    *    This playlist must already exist in the collection, client
+    *    must provide either KMPXMediaGeneralId or KMPXMediaGeneralUri
+    *    for locating which playlist to add the songs to.
+    *
+    *    KMPXMediaArrayCount:
+    *       indicates the number of songs to be added to the playlist
+    *
+    *    KMPXMediaArrayContents:
+    *       This contains an array of songs to be added/appended
+    *       to the playlist. Each media in the array represents
+    *       a song. Each song must contain the following attributes:
+    *           KMPXMediaGeneralType:
+    *               must be EMPXItem
+    *
+    *           KMPXMediaGeneralCategory:
+    *               must be EMPXSong
+    *
+    *       These songs must already exist in the collection. Client
+    *       must provide either KMPXMediaGeneralId or KMPXMediaGeneralUri.
+    *
+    * This method will leave with KErrArgument if any mandatory
+    * is missing.
+    *
+    * @param aMedia, a media to be added to the system
+    * @param aObserver, an observer for callback when
+    *        operation is compelte. Leaves with KErrArgument if
+    *        observer provided is NULL. The Id of playlist will
+    *        be accessible via the KMPXMediaGeneralId of the media
+    *        returned in the callback.
+    *
+    */
+    void AddL( const CMPXMedia& ,
+               MMPXCHelperObserver*  ){};
+   
+    
+    /**
+    * From MMPXCollectionUiHelper    
+    *
+    * This is exactly the same as AddL except that songs in aMedia
+    * is added incrementally (in chunks).
+    * It should accept the same input and the same output as if AddL
+    * is used.
+    * @param aMedia, a media to be added to the system
+    * @param aObserver, an observer for callback when
+    *        operation is compelte. Leaves with KErrArgument if
+    *        observer provided is NULL. The Id of playlist will
+    *        be accessible via the KMPXMediaGeneralId of the media
+    *        returned in the callback.
+    * @param aSize, the number of songs to be added in each chunk
+    */
+    void IncAddL( const CMPXMedia& ,
+                  MMPXCHelperObserver* ,
+                  const TInt  ){};
+
+    /**
+    * From MMPXCollectionUiHelper
+    *
+    * Asynchronously updates a media in the collection. For performance
+    * consideration, it is recommended that client only sets the attribute
+    * that needs to be updated.
+    *
+    * @param aMedia, media to be updated.
+    *
+    *        To update a song in the collection, the media provided MUST
+    *        contain the following attributes:
+    *           KMPXMediaGeneralType:
+    *               must be EMPXItem
+    *
+    *           KMPXMediaGeneralCategory:
+    *               must be EMPXSong
+    *
+    *           KMPXMediaGeneralId or KMPXMediaGeneralUri:
+    *               for identifying which song to update
+    *
+    *        Additionally, this media should provide one or more of the
+    *        following attributes for update:
+    *               KMPXMediaGeneralTitle
+    *               KMPXMediaGeneralComment
+    *               KMPXMediaGeneralSynchronized
+    *               KMPXMediaGeneralDeleted
+    *               KMPXMediaGeneralModified
+    *               KMPXMediaGeneralCopyright
+    *               KMPXMediaGeneralDuration
+    *               KMPXMediaGeneralFlags
+    *               KMPXMediaGeneralPlayCount
+    *               KMPXMediaGeneralLastPlaybackTime
+    *           KMPXMediaIdMusic:
+    *               KMPXMediaMusicArtist
+    *               KMPXMediaMusicAlbum
+    *               KMPXMediaMusicAlbumTrack
+    *               KMPXMediaMusicGenre
+    *               KMPXMediaMusicComposer
+    *               KMPXMediaMusicYear
+    *               KMPXMediaMusicRating
+    *               KMPXMediaMusicAlbumArtFileName
+    *               KMPXMediaMusicURL
+    *           KMPXMediaIdAudio:
+    *               KMPXMediaAudioSamplerate
+    *               KMPXMediaAudioBitrate
+    *               KMPXMediaAudioNumberOfChannels
+    *           KMPXMediaIdDrm:
+    *               KMPXMediaDrmType
+    *           KMPXMediaIdMTP:
+    *               KMPXMediaMTPDrmStatus
+    *
+    *        To update a playlist in the collection, the media provided MUST
+    *        contain the following attributes:
+    *           KMPXMediaGeneralType:
+    *               must be EMPXItem
+    *
+    *           KMPXMediaGeneralCategory:
+    *               must be EMPXPlaylist
+    *
+    *           KMPXMediaGeneralId or KMPXMediaGeneralUri:
+    *               for identifying which playlist to update
+    *
+    *        If the media contains KMPXMediaArrayContents attribute, the
+    *        content of the playlist will be overwritten with the new media
+    *        array. If this attribute contains a CMPXMediaArray of 0 element,
+    *        all songs in this playlist will be removed from the playlist
+    *        (songs will remain in the collection and file system).
+    *        e.g.
+    *        1) "Playlist" originally contains "Song1", "Song2", and "Song3".
+    *           If KMPXMediaArrayContents contains a CMPXMediaArray that
+    *           contains "Song3" and "Song4", "Playlist" will be updated to
+    *           contain "Song3" and "Song4".
+    *        2) "Playlist" originally contains "Song1", "Song2", and "Song3".
+    *           If KMPXMediaArrayContents contains a CMPXMediaArray that
+    *           contains 0 element, "Playlist" will be updated so that it
+    *           doesn't contain any songs. "Song1", "Song2", and "Song3"
+    *           will remain in the collection.
+    *
+    *       If the media contains any of the following attributes, the
+    *       playlist will be updated accordingly:
+    *               KMPXMediaGeneralTitle
+    *               KMPXMediaGeneralSynchronized
+    *               KMPXMediaGeneralDeleted (DEPRECATED)
+    *               KMPXMediaGeneralModified (DEPRECATED)
+    *
+    *       NOTE: If a client wishes to change the playlist title and modify
+    *             its contents (i.e. the songs it includes), client needs to
+    *             perform two separate SetL operations; one to update the
+    *             playlist title providing KMPXMediaGeneralTitle attribute
+    *             and the other to update its contents by providing
+    *             KMPXMediaArrayContents.
+    *
+    * @param aObserver, an observer for callback when operation is complete.
+    *        KErrArgument if NULL.
+    */
+    void SetL( CMPXMedia*& ,
+               MMPXCHelperObserver*  ){};
+
+    /**
+    * From MMPXCollectionUiHelper
+    *
+    * Asynchronously updates a list of medias in the collection. This is
+    * NOT currently implemented.
+    *
+    * @param aMediaArray, list of medias
+    * @param aPath, collection path
+    * @param aIndices, array of indicies to collection path
+    */
+    void SetL( TArray<CMPXMedia*>& ,
+               CMPXCollectionPath& ,
+               RArray<TInt>& ){};
+
+    /**
+    * From MMPXCollectionUiHelper
+    *
+    * Asynchronously renames a media. This method will be DEPRECATED as client
+    * can use SetL to update the title of a song or a playlist.
+    *
+    * @param aMedia media to be renamed
+    *
+    *        Currently only supporting renaming of a playlist. This media
+    *        MUST contain the following attributes:
+    *           KMPXMediaGeneralType:
+    *               must be EMPXItem
+    *
+    *           KMPXMediaGeneralCategory:
+    *               must be EMPXPlaylist
+    *
+    *           KMPXMediaGeneralId:
+    *               for identifying which playlist to rename
+    *
+    *           KMPXMediaGeneralTitle:
+    *               new title of the playlist
+    *
+    *        This method will leave with KErrArgument if any mandatory is
+    *        missing. URI of the playlist remains unchanged when its title
+    *        is changed.
+    *
+    * @param aObserver an observer for callback when operation is complete.
+    *        KErrArgument if NULL.
+    */
+    void RenameL( const CMPXMedia& ,
+                  MMPXCHelperObserver*  ){};
+
+    /**
+    * From MMPXCollectionUiHelper
+    *
+    * Asynchronously deletes a media or medias based on the collection path.
+    * If this collection path refers to multiple medias, the referred medias
+    * are deleted one by one. If the media correlates to a file in the file
+    * system, the correlating file is deleted from the file system. If the
+    * file is in use, operation will proceed to the next media and upon
+    * operation completion, KErrInUse is returned via callback.
+    * If the file has already been deleted from the file system, operation
+    * will also proceed to the next media as normal.
+    *
+    * This operation is cancelable via Cancel(),
+    *
+    * @param aPath collection path to the media to be removed
+    * @param aObserver an observer for callback when operation is complete.
+    *        KErrArgument if NULL.
+    */
+    void DeleteL( CMPXCollectionPath& ,
+                  MMPXCHelperObserver*  ){};
+
+    /**
+    * From MMPXCollectionUiHelper
+    *
+    * Move an item from one collection to another
+    *
+    * @param aMedia media to be moved.
+    * @param aNewCollection uid of the collection defined in collectionplugins.hrh
+    * @param aObserver observer for the event. if aObs is NULL, sync, not NULL async.
+    */
+    void MoveL( CMPXMedia*& ,
+                TUid ,
+                MMPXCHelperObserver* = NULL ){};  //lint !e1735
+
+    /**
+    * From MMPXCollectionUiHelper
+    * Open the collection in embedded mode with a Media Object
+    * @param aHostId Host Process UID to identify this embedded instance
+    * @param aMedia Media Object to open
+    * @param aObserver observer to handle errors
+    * @param aPluginInfo additional argument to pass to the plugin resolver
+    */
+    void OpenL( const TUid& aHostId, CMPXMedia& aMedia,
+                MMPXCHelperEmbeddedOpenObserver* aObserver,
+                TInt aPluginInfo = 0 );  //lint !e1735
+
+    /**
+    * From MMPXCollectionUiHelper
+    * Open the collection in embedded mode with a File Handle
+    * @param aHostId Host Process UID to identify this embedded instance
+    * @param aFile File handle that we have to process
+    * @param aObserver observer to handle errors
+
+    */
+    void OpenL( const TUid& , const TDesC& ,
+                MMPXCHelperEmbeddedOpenObserver* ,
+                TInt  = 0 ){};  //lint !e1735
+
+    /**
+    * From MMPXCollectionUiHelper
+    * Open the collection in embedded mode with a File Handle
+    * @param aFile File handle that we have to process
+    * @param aObserver, observer to the open operation
+    */
+    void OpenL( RFile& , MMPXCHelperEmbeddedOpenObserver*  ){};
+
+    /**
+    * From MMPXCollectionUiHelper
+    * Queries about the playlist file extension of the currently selected playlist
+    * plugin
+    * @return file extension of the playlist type which includes the period
+    */
+    HBufC* PlaylistFileExtensionLC(){return (HBufC*)NULL;};
+
+    /**
+    * From MMPXCollectionUiHelper
+    * Export the specified playlist to a file
+    * @param aPlaylistId, id of the playlist to be exported
+    * @param aDestinationDriveAndPath, specifies where the playlist file should
+    *        be created. If the file already exists, it will be overwritten.
+    * @param aObs observer for the callback. URI of the exported playlist
+    *        will be returned as a HBufC* which client takes over the
+    *        ownership
+    */
+    void ExportPlaylistL(TMPXItemId ,
+                         const TDesC& ,
+                         MMPXCHelperObserver* ){};
+
+    /**
+    * From MMPXCollectionUiHelper
+    * Reorder a song in the playlist
+    * @param aPlaylistId id of the playlist which contains the song to be reordered
+    * @param aSongId id of the song to be reordered
+    * @param aOriginalOrdinal the original ordinal of the song within the playlist.
+    *        Ordinal starts from 0.
+    * @param aNewOrdinal the new ordinal of the song within the playlist. Ordinal
+    *        starts from 0.
+    * @param aObs observer for the callback
+    */
+    void ReorderPlaylistL(const TMPXItemId& ,
+                          const TMPXItemId& ,
+                          TUint ,
+                          TUint ,
+                          MMPXCHelperObserver* ){};
+
+    /**
+    * From MMPXCollectionUiHelper
+    * Gets the collection path to the main music menu
+    * Call OpenL() with this path to open music menu
+    * @return CMPXCollectionPath*, ownership transferred
+    */
+    CMPXCollectionPath* MusicMenuPathL(){return (CMPXCollectionPath* )NULL;};
+
+    /**
+    * From MMPXCollectionUiHelper
+    * Gets the collection path to the podcast menu
+    * Call OpenL() with this path to open podcast menu
+    * @return CMPXCollectionPath*, ownership transferred
+    */
+    CMPXCollectionPath* PodCastMenuPathL(){return (CMPXCollectionPath* )NULL;};
+
+    /**
+    * From MMPXCollectionUiHelper
+    * Gets the collection path to the main all songs view
+    * Call OpenL() with this path to open music all songs view
+    * @return CMPXCollectionPath*, ownership transferred
+    */
+    CMPXCollectionPath* MusicAllSongsPathL(){return (CMPXCollectionPath* )NULL;};
+
+    /**
+    * From MMPXCollectionUiHelper
+    * Gets the collection path to the music playlist
+    * Call OpenL() with this path to open music playlist menu
+    * @return CMPXCollectionPath*, ownership transferred
+    */
+    CMPXCollectionPath* MusicPlaylistPathL(){return (CMPXCollectionPath* )NULL;};
+
+    /**
+    * From MMPXCollectionUiHelper
+    * Gets the collection path to the music playlist
+    * Call OpenL() with this path to open music playlist menu
+    * @param aPlaylistType type of auto playlist
+    * @return CMPXCollectionPath*, ownership transferred
+    */
+    CMPXCollectionPath* MusicPlaylistPathL(TMPXAutoPlaylistType ){return (CMPXCollectionPath* )NULL;};
+
+    /**
+    * From MMPXCollectionUiHelper
+    * Creates a default playlist path to open. Hardcoded to Music Collection / All songs
+    * @return CollectionPath*, ownership transferred.
+    */
+    CMPXCollectionPath* CreateDefaultPlaylistPathLC(){return (CMPXCollectionPath* )NULL;};
+
+    /**
+    * From MMPXCollectionUiHelper
+    * Cancels current async request
+    * NOTE: Currently only Cancelling DeleteL() is supported
+    */
+    void Cancel(){};
+
+    /**
+    * From MMPXCollectionUiHelper
+    * Frees this object
+    */
+    void Close();
+
+    /**
+    * From MMPXCollectionUiHelper
+    * Test if the specified title exists in the specified category
+    * @param aCategory specifies the category for testing
+    * @param aTitle specifies the title for testing
+    * @return ETrue if the specified title exists in the specified
+    *         category; otherwise, EFalse
+    */
+    TBool TitleExistsL( TMPXGeneralCategory , 
+                        const TDesC& , TMPXGeneralType aType = EMPXItem ){return EFalse;};
+
+    /**
+    * From MMPXCollectionUiHelper
+    * Returns the file name used for virtual playlist handling
+    * @return the file name to be used to externalize collection path for the playlist
+    *         that needs to be handled. ownership transfered
+    */
+    HBufC* ExternalCollectionPathHandlingFileNameLC(){return (HBufC*) NULL;};
+
+private: // from base class
+
+    /**
+    * From MMPXMediatorObserver
+    * @param aMedia, properties of the object
+    * @param aOldPath, old collection path
+    */
+    void HandleMediatorPathUpdatedL( CMPXMedia*& ,
+                                     TUid    ){};
+
+    /**
+    * From MMPXHarvesterUtilityObserver
+    * Handles completion of playlist export
+    * @param aMedia, media that has been exported to a playlist file
+    * @param aErr, error encountered during playlist export
+    */
+    void HandlePlaylistExportCompletedL( CMPXMedia* , TInt  ){};
+
+    /**
+    * From MMPXHarvesterUtilityObserver
+    * Handles completion of playlist import
+    * @param aMedia, media imported from a playlist file.
+    * @param aErr, error encountered during playlist import
+    */
+    void HandlePlaylistImportCompletedL( CMPXMedia* , TInt  ){};
+
+    /**
+    * From MMPXHarvesterUtilityObserver
+    * Handle asynchronous file addition by file name
+    * @param aMedia, media added to the system
+    * @param aErr, error encountered during AddL operation
+    */
+    void HandleFileAddCompletedL( CMPXMedia* , TInt  ){};
+
+    /**
+    * From MMPXHarvesterUtilityObserver
+    * Handle asynchronous file addition by file name
+    * @param aMedia, media imported from file
+    * @param aErr, error encountered during the operation
+    */
+    void HandleFileImportCompletedL( CMPXMedia* , TInt   ){};
+
+    /**
+    * From MMPXHarvesterUtilityObserver
+    * Handle file delete completion
+    * @param aErr, error encountered during delete operation
+    */
+    void HandleDeleteCompletedL( TInt  ){};
+
+    /**
+    * From MMPXHarvesterUtilityObserver
+    * Handle media retrieving completion
+    * @param aErr, error encountered during delete operation
+    */
+    void HandleFileGetMediaCompletedL( CMPXMedia* , TInt   ){};
+
+    /**
+    * From MMPXCollectionMediaObserver
+    *  Handle extended media properties
+    *
+    *  @param aMedia media
+    *  @param aError error code
+    */
+    void HandleCollectionMediaL(const CMPXMedia& ,
+                                TInt ){};
+
+    /**
+    * From MMPXCollectionObserver
+    *  Handle collection message
+    *  @param aMessage collection message
+    *  @param aErr error
+    */
+    void HandleCollectionMessage(CMPXMessage* , TInt ){};
+
+    /**
+    * From MMPXCollectionObserver
+    *  Handles the collection entries being opened. Typically called
+    *  when client has Open()'d a folder
+    *
+    *  @param aEntries collection entries opened
+    *  @param aIndex focused entry
+    *  @param aComplete ETrue no more entries. EFalse more entries
+    *                   expected
+    *  @param aError error code
+    */
+    void HandleOpenL(const CMPXMedia& ,
+                     TInt ,TBool ,TInt ){};
+
+    /**
+    * From MMPXCollectionObserver
+    *  Handles the item being opened. Typically called
+    *  when client has Open()'d an item. Client typically responds by
+    *  'playing' the item via the playlist
+    *
+    *  @param aPlaylist collection playlist
+    *  @param aError error code
+    */
+    void HandleOpenL(const CMPXCollectionPlaylist& ,TInt ){};
+
+    /**
+    * From MMPXCollectionObserver
+    *  Handles completion of a asynchronous command.
+    *
+    *  @param aCommandResult result of the command, NULL if error
+    *  @param aError error code    
+    */
+    virtual void HandleCommandComplete(CMPXCommand* , 
+                                       TInt ){};
+
+    /**
+    * From MMPXMoveItemObserver
+    * @param aErr, error for the operation
+    */
+    void HandleMoveCompleteL( TInt  ){};
+
+    /**
+    * From MMPXCHelperObserver
+    *  Handle callback for delete operation
+    *  @param aOperation operation type that is completed
+    *  @param aErr error code for the operation
+    *  @param aArgument a pointer to any data to retun
+    */
+    void HandleOperationCompleteL( TCHelperOperation ,
+                                   TInt ,
+                                   void*  ){};
+
+    /**
+    * From MMPXTaskQueueObserver
+    * Execute a task
+    * @param aTask task number
+    * @param aParamData, parameter
+    * @param aPtrData, any object
+    * @param aBuf, buffer containing externalized parameters for the task.
+    * @param aCallback call back function pointer
+    * @param aCObject1 object 1 owned by task queue
+    * @param aCObject2 object 2 owned by task queue
+    */
+    void ExecuteTask(TInt ,
+                     TInt ,
+                     TAny* ,
+                     const CBufBase& ,
+                     TAny* ,
+                     CBase* ,
+                     CBase* ){};
+
+    /**
+    * @see MMPXTaskQueueObserver
+    */
+    void HandleTaskError(
+        TInt ,
+        TAny* ,
+        TAny* ,
+        TInt ){};
+
+private:
+
+    /**
+    * Constructor
+    */
+    CMPXCollectionUiHelperImp();
+
+    /**
+    * 2nd-phase constructor
+    *  @param aModeId collection mode id
+    */
+    void ConstructL(const TUid& ){};
+
+   /**
+    * Execute a task
+    * @param aTask task number
+    * @param aBuf, externalized parameters for the task
+    * @param aCallback, callback for the task
+    */
+    void ExecuteTaskL(TInt , const CBufBase& , TAny* ){};
+
+    /**
+    * Completes the current task
+    *
+    * @param aTask task number
+    * @param aError error code
+    */
+    void CompleteTask(TInt , TInt ){};
+
+    /**
+    * Notify client of the task results
+    *
+    * @param aTask task number
+    * @param aError error code
+    */
+    void NotifyClientL(TInt , TInt ){};
+
+    /**
+    * Cleanup before processing the next task
+    */
+    void Cleanup(){};
+
+    /**
+    * Performs AddL task from the task queue
+    */
+    void DoAddL(){};
+             
+    /**
+    * Performs IncAddMedialL task from the task queue
+    */
+    void DoIncAddMediaL(){};
+    
+    /**
+    * Performs IncAppendMedialL task from the task queue
+    */
+    void DoIncAppendMediaL(){};
+    
+    /**
+    * Performs SetL task from the task queue
+    */
+    void DoSetL(){};
+
+    /**
+    * Performs RenameL task from the task queue
+    */
+    void DoRenameL(){};
+
+    /**
+    * Export the specified playlist to a file
+    * @param aPlaylistId, id of the playlist to be exported
+    * @param aDestinationDriveAndPath, specifies where the playlist file should
+    *        be created. If the file already exists, it will be overwritten.
+    */
+    void DoExportPlaylistL(TMPXItemId ,
+                           const TDesC& ){};
+
+    /**
+    * Reorder a song in the playlist
+    * @param aCommand command to reorder a song in the playlist
+    */
+    void DoReorderPlaylistL(CMPXCommand& ){};
+
+    /**
+    * Fill in details for the playlist itself for playlist export
+    * @param aMedia, a playlist media whose information is to be
+    *        filled.
+    */
+    void FillInPlaylistDetailsL(CMPXMedia& ){};
+
+    /**
+    * Handles completion of playlist export
+    * @param aMedia, media that has been exported to a playlist file
+    * @param aErr, error encountered during playlist export
+    */
+    void DoHandlePlaylistExportCompletedL( CMPXMedia* , TInt  ){};
+
+    /**
+    *  Looks for collection Id from the given URI through its extension.
+    *  This method is able to determine the collection Id without the media
+    *  being in the harvester's database.
+    *  @param aUri URI of a media
+    *  @return collection Id. KErrNotFound if unable to find a collection
+    *          that supports the type of extension
+    */
+    TInt FindCollectionIdL(const TDesC& ){return 0;};
+
+
+private:
+
+    // tasks
+    enum TMPXCollectionUiHelperTask
+        {
+        ETaskNone,
+        ETaskAddMedia,
+        ETaskAppendMedia,
+        ETaskSetMedia,
+        ETaskRemoveMedia,
+        ETaskRenameMedia,
+        ETaskExportPlaylist,
+        ETaskReorderPlaylist,
+        ETaskIncAddMedia,
+        ETaskIncAppendMedia,
+        ETaskIncFinish
+        };
+
+private: // data
+
+    MMPXCollectionUtility*              iCollection;
+    CMPXCollectionMediator*             iMediator;
+    MMPXHarvesterUtility*               iHarvester;
+    CMPXActiveTaskQueue*                iTaskQueue;
+    TInt                                iTask;
+
+    CMPXDeleteHelper*                   iDeleteHelper;
+
+    // parameters for async commands
+    CMPXMedia*                          iMedia;
+    
+    // parameters used for incremental adding of songs
+    CMPXMedia*                          iInputMedia;
+    TInt                                iRemainder;
+    TInt                                iTotalChunkNumber;
+    TInt                                iChunkNumber;  // used as ID of current chunk
+    TInt                                iChunkSize;
+    TInt                                iArrayIndex;
+
+    
+    MMPXCHelperEmbeddedOpenObserver*    iOpenObserver; // not owned, transient
+
+    MMPXCHelperObserver*                iHelperObserver;  // not owned, transient
+    // Embedded Mode handling
+    TUid                                iEmbeddedModeID;
+    TInt                                iEmbeddedPluginInfo;
+    TBool                               iInitialized;  // collection db merging
+    TBool                               iIncAdding;  // Incremental adding guard
+    TInt 								iRefCount;
+    };
+
+#endif // CMPX_COLLECTION_UI_HELPER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/inc/mpxcollectionutilityimp_stub.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,134 @@
+/*
+* 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:  mpx collection utility stub for STIF testing
+*
+*/
+
+// Version : %version: ou1cpsw#2 %
+
+#ifndef MPXCOLLECTIONUTILITYIMP_STUB_H_
+#define MPXCOLLECTIONUTILITYIMP_STUB_H_
+
+#include <mpxcollectionutility.h>
+#include <mpxcollectionobserver.h>
+#include <mpxmessageobserver.h>
+
+#include "mpxvideoplayer_appuienginetester.h"
+
+
+NONSHARABLE_CLASS( CMPXCollectionUtility ) : public MMPXCollectionUtility,
+                                             public MMPXMessageObserver,
+                                             public MMPXCollection
+
+{
+    public:
+        /**
+        * Two-phased constructor
+        *
+        * @param aObs observer
+        * @param aModeId collection mode id
+        * @return object of constructed
+        */
+        static CMPXCollectionUtility* NewL( const TUid& aModeId, MMPXCollectionObserver* aObs );
+
+        /**
+        * Destructor
+        */
+        ~CMPXCollectionUtility();
+
+        void AddRefCount();
+
+        void AddStifObserverL( MAppUiEngineStifTestObserver* aObserver );
+        void RemoveStifObserverL();
+
+    private:
+        /**
+        * C++ constructor
+        */
+        CMPXCollectionUtility( MMPXCollectionObserver* aObs );
+
+        /**
+        * Second phase constructor
+        *
+        * @param aModeId collection mode id
+        */
+        void ConstructL( const TUid& aModeId );
+
+    public:
+
+        //------------------------------------------------------------------------------------------
+        //  MMPXCollectionUtility Implementation
+        //------------------------------------------------------------------------------------------
+        MMPXCollection& Collection();
+        TUid CollectionIDL( const TArray<TUid>& aUids );
+        void Close();
+
+        //------------------------------------------------------------------------------------------
+        //  MMPXCollection Implementation
+        //------------------------------------------------------------------------------------------
+        void OpenL( TMPXOpenMode aMode = EMPXOpenDefault );
+        void OpenL( TInt aIndex, TMPXOpenMode aMode = EMPXOpenDefault );
+        void OpenL( const CMPXCollectionPath& aPath, TMPXOpenMode aMode = EMPXOpenDefault );
+        void OpenL( TInt aIndex,
+                    const TArray<TMPXAttribute>& aAttrs,
+                    TMPXOpenMode aMode = EMPXOpenDefault );
+        void OpenL( const CMPXCollectionPath& aPath,
+                    const TArray<TMPXAttribute>& aAttrs,
+                    TMPXOpenMode aMode = EMPXOpenDefault );
+        void OpenL( const TArray<TUid>& aUids, TMPXOpenMode aMode = EMPXOpenDefault );
+        void OpenL( const TUid& aUid, TMPXOpenMode aMode = EMPXOpenDefault );
+        void SetFilterL( CMPXFilter* aFilter );
+        CMPXFilter* FilterL();
+        TUid UidL() const;
+        CMPXCollectionPath* PathL();
+        void BackL();
+        TBool IsRemote( const CMPXCollectionPath& aPath );
+        void CancelRequest();
+        void AddL( const CMPXMedia& aNewProperties );
+        void RemoveL( const CMPXCollectionPath& aPath, MMPXCollectionRemoveObserver* aObs = NULL );
+        void RemoveL( const CMPXMedia& aProperties );
+        void SetSyncL( const CMPXMedia& aMedia );
+        void SetL( const CMPXMedia& aMedia );
+        void FindAllL( const CMPXMedia& aMedia,
+                       const TArray<TMPXAttribute>& aAttrs,
+                       MMPXCollectionFindObserver& aObs );
+        CMPXMedia* FindAllL( const CMPXMedia& aMedia, const TArray<TMPXAttribute>& aAttrs );
+        void MediaL( const CMPXCollectionPath& aPath,
+                     const TArray<TMPXAttribute>& aAttrs,
+                     CMPXAttributeSpecs* aSpecs = NULL,
+                     CMPXFilter* aFilter = NULL );
+        void NotifyL( TMPXCollectionBroadCastMsg aMsg, TInt aData );
+        void CommandL( TMPXCollectionCommand aCmd, TInt aData = 0 );
+        void CommandL( CMPXCommand& aCmd );
+        void GetSupportedTypesL( RPointerArray<CMPXCollectionType>& aArray );
+        void GetSupportedCapabilitiesL( TCollectionCapability& aCapability );
+        TUid CollectionIDL( TUid& aCollection );
+        void AddSubscriptionL( const CMPXSubscription& aSubscription );
+        void RemoveSubscriptionL( const CMPXSubscription& aSubscription );
+        void ClearSubscriptionsL();
+
+        //------------------------------------------------------------------------------------------
+        //  MMPXMessageObserver Implementation
+        //------------------------------------------------------------------------------------------
+        void MessageReceived( TInt aMsgData, TInt aError );
+
+    private:
+        MMPXCollectionObserver*         iObserver;
+        CMPXCollectionPath*             iCollectionPath;
+        MAppUiEngineStifTestObserver*   iStifObserver;
+
+        TInt                            iRefCount;
+};
+
+#endif /*MPXCOLLECTIONUTILITYIMP_STUB_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/inc/mpxplaybackutilityimp_stub.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,128 @@
+/*
+* 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:  mpx playback utility stub for STIF testing
+*
+*/
+
+// Version : %version: ou1cpsw#3.1.1 %
+
+#ifndef MPXPLAYBACKUTILITYIMP_STUB_H_
+#define MPXPLAYBACKUTILITYIMP_STUB_H_
+
+#include "mpxvideoplayer_appuienginetester.h"
+
+#include <mpxplaybackutility.h>
+
+
+NONSHARABLE_CLASS( CMPXPlaybackUtility ) : public CBase,
+                                           public MMPXPlaybackUtility,
+                                           public MMPXPlayer,
+                                           public MMPXPlayerManager,
+                                           public MMPXSource
+{
+    public:
+
+        static MMPXPlaybackUtility* UtilityL();
+
+        CMPXPlaybackUtility();
+
+        void AddRefCount();
+
+    public:
+
+        ~CMPXPlaybackUtility();
+
+        void AddStifObserverL( MAppUiEngineStifTestObserver* aObserver );
+        void RemoveStifObserverL();
+        void StartPdlPlaybackUtility();
+
+        //
+        //  MMPXPlaybackUtility Implementation
+        //
+        void AddObserverL( MMPXPlaybackObserver& aObs );
+        void RemoveObserverL( MMPXPlaybackObserver& aObs );
+        void GetClientsL( RArray<TProcessId>& aClients );
+        void UpdatePlaylistL(const CMPXCollectionPlaylist& aPlaylist);
+        void InitL( const CMPXCollectionPlaylist& aPlaylist, TBool aPlay=ETrue );
+        void InitL( const TDesC& aUri, const TDesC8* aType = NULL );
+        void InitL( RFile& aShareableFile );
+        void Close();
+        void CancelRequest();
+        void CommandL( TMPXPlaybackCommand aCmd, TInt aData = 0 );
+        void CommandL( CMPXCommand& aCmd, MMPXPlaybackCallback* aCallback = NULL );
+        TMPXPlaybackState StateL() const;
+        MMPXSource* Source();
+        MMPXPlayerManager& PlayerManager();
+        void SetL( TMPXPlaybackProperty aProperty, TInt aValue );
+        void ValueL( MMPXPlaybackCallback& aCallback, TMPXPlaybackProperty aProperty );
+        void PropertyL( MMPXPlaybackCallback& aCallback, TMPXPlaybackProperty aProperty );
+        CDesCArray* SupportedMimeTypes();
+        CDesCArray* SupportedExtensions();
+        CDesCArray* SupportedSchemas();
+        void SetPriority( TInt aPriority );
+        void AddSubscriptionL( const CMPXSubscription& aSubscription );
+        void RemoveSubscriptionL( const CMPXSubscription& aSubscription );
+        void ClearSubscriptionsL();
+        void InitStreamingL( const TDesC& aUri, const TDesC8* aType, const TInt aAccessPoint );
+        void InitStreamingL( RFile& aShareableFile, const TInt aAccessPoint );
+
+
+        //
+        //  MMPXPlayerManager Implementation
+        //
+        void GetPlayerTypesL( RArray<TMPXPlaybackPlayerType>& aTypes );
+        HBufC* PlayerTypeDisplayNameL( TMPXPlaybackPlayerType aType );
+        void GetPlayerListL( RArray<TUid>& aPlayers );
+        void GetPlayerListL( RArray<TUid>& aPlayers, TMPXPlaybackPlayerType aType );
+        void SubPlayerNamesL( MMPXPlaybackCallback& aCallback, TUid aPlayer );
+        void SelectPlayersL( TMPXPlaybackPlayerType aType );
+        void SelectSubPlayerL( TUid aPlayer, TInt aSubPlayerIndex );
+        void SelectPlayerL( TUid aPlayer );
+        void ClearSelectPlayersL();
+        void GetSelectionL( TMPXPlaybackPlayerType& aType,
+                            TUid& aPlayer,
+                            TInt& aSubPlayerIndex,
+                            HBufC*& aSubPlayerName );
+        MMPXPlayer* CurrentPlayer();
+
+        //
+        //  MMPXPlayer Implementation
+        //
+        TMPXPlaybackPlayerType TypeL();
+        HBufC* TypeNameL();
+        void SubPlayerNamesL( MMPXPlaybackCallback& aCallback );
+        TInt SubPlayerL() const;
+        TUid UidL() const;
+
+        //
+        //  MPXSource Implementation
+        //
+        CMPXCollectionPlaylist* PlaylistL();
+        RFile* FileL();
+        HBufC* UriL();
+        void MediaL( const TArray<TMPXAttribute>& aAttrs, MMPXPlaybackCallback& aCallback );
+        void MediaL( const TArray<TMPXAttribute>& aAttrs,
+                     MMPXPlaybackCallback& aCallback,
+                     CMPXAttributeSpecs* aSpecs );
+
+    private:
+
+        RArray<MMPXPlaybackObserver*>   iObservers;
+        MAppUiEngineStifTestObserver*   iStifObserver;
+        TInt                            iRefCount;
+    public:
+        TInt                            iDisableEffectCallCount;
+};
+
+#endif /*MPXPLAYBACKUTILITYIMP_STUB_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/inc/mpxvideoplayer_appuienginetester.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,188 @@
+/*
+* 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:  mpxvideoplayerappuiengine test class for STIF testing
+*
+*/
+
+// Version : %version: ou1cpsw#14.1.1 %
+
+#ifndef MPXVIDEOPLAYER_APPUIENGINETESTER_H_
+#define MPXVIDEOPLAYER_APPUIENGINETESTER_H_
+
+#include <e32base.h>
+#include <e32def.h>
+#include <StifItemParser.h>
+#include <mpxplaybackutility.h>
+#include <mpxviewutility.h>
+#include <AiwGenericParam.h>
+#include <mpxmessage2.h>
+#include <TestScripterInternal.h>
+
+#include "timeoutcontroller.h"
+
+enum TActivationCommands
+{
+    EProcessTail,
+    EProcessFile,
+    EProcessStandAlone
+};
+
+enum TStifFileTypes
+{
+    ELocalFile,
+    ESdpFile,
+    ERamFile,
+    EUrl,
+    EAsxFile,
+    EMultiLinkFile
+};
+
+enum TMpxUtilityEvents
+{
+    EViewUtilityPreLoadView,
+    EViewUtilityActivateView,
+    EViewUtilityActivateViewUid,
+    EViewUtilityActivatePdlView,
+    EViewUtilitySetAsDefaultView,
+    EViewUtilityActivatePreviousView,
+    EPlaybackUtilityInitFileHandle,
+    EPlaybackUtilityInitFileName,
+    EPlaybackUtilityInitStreamingUrl,
+    EPlaybackUtilityInitStreamingFileHandle,
+    EPlaybackUtilityInitPlaylist,
+    EPlaybackUtilityStartPdl,
+    EPlaybackUtilityPlayCmd,
+    EPlaybackUtilityPdlInstance,
+    EPlaybackUtilityClose,
+    EPlaybackUtilityDisableEffects,
+    ECollectionUtilityMedia,
+    ECollectionUtilityOpen,
+    EAppUiCmdExit,
+    EPlaybackUtilityOpenPlaylist,
+    EAsxAttributeSeekUpdate,
+    EFunctionLeave
+};
+
+typedef struct
+{
+    TMpxUtilityEvents  iEvent;
+    TUid               iUid;
+    TFileName          iFileName;
+    TInt               iDownloadId;
+    TInt               iApId;
+    TInt               iExtra;
+} TCallbackEvent;
+
+typedef CArrayPtrFlat<TCallbackEvent> CCallbackEventArray;
+
+
+
+NONSHARABLE_CLASS( MAppUiEngineStifTestObserver )
+{
+    public:
+        virtual void HandleUtilityEvent( TCallbackEvent* aEvent ) = 0;
+};
+
+class CMpxVideoPlayerAppUi;
+class CMpxVideoPlayerAppUiEngine;
+class CMPXCollectionUtility;
+class CActiveSchedulerWait;
+
+class CMpxVideoPlayer_AppUiEngineTester : public CBase,
+                                          public MAppUiEngineStifTestObserver,
+                                          public MTimeoutObserver
+{
+    public: // constructors and destructors
+        static CMpxVideoPlayer_AppUiEngineTester* NewL( CScriptBase* aScriptBase );
+
+        virtual ~CMpxVideoPlayer_AppUiEngineTester();
+
+        TInt CreateEngineL( CStifItemParser& aItem );
+        TInt CreateGenericParametersTerminateL();
+        TInt OpenFileL( CStifItemParser& aItem );
+        TInt OpenMediaL( CStifItemParser& aItem );
+        TInt SetGenericParamAccessPointL( CStifItemParser& aItem );
+        TInt OpenFileEmbeddedPdlL( CStifItemParser& aItem );
+        TInt HandleMessageEmbeddedPdlL( CStifItemParser& aItem );
+        TInt HandleMessageActivationMessageL( CStifItemParser& aItem );
+        TInt StartStandAloneL( CStifItemParser& aItem );
+        TInt HandleCollectionMessageL( CStifItemParser& aItem );
+        TInt HandleCollectionMediaL( CStifItemParser& aItem );
+        TInt HandleSoftkeyBackL( CStifItemParser& aItem );
+        TInt HandleOpenPlaylistL( CStifItemParser& aItem );
+        TInt HandleOpenMediaL( CStifItemParser& aItem );
+        TInt HandleViewActivation( CStifItemParser& aItem );
+        TInt ProcessCommandParametersL( CStifItemParser& aItem );
+        TInt GetViewDepthL( CStifItemParser& aItem );
+        TInt ClearPlaybackUtilityL( CStifItemParser& aItem );
+        TInt ActivateLateConstructTimerL( CStifItemParser& aItem );
+        TInt HandleEmbeddedOpenL( CStifItemParser& aItem );
+        void ClearPdlInformation();
+
+        //
+        //  MAppUiEngineStifTestObserver Implementation
+        //
+        void HandleUtilityEvent( TCallbackEvent* aEvent );
+
+    private:
+
+        void ConstructL();
+
+        CMpxVideoPlayer_AppUiEngineTester( CScriptBase* aScriptBase );
+
+        void AddExpectedEvent( TCallbackEvent* aEvent );
+
+        void CreateEmbeddedPdlGenericParametersL( TInt aDownloadId, TDesC& aFileName );
+
+        void AddEmbeddedPdlCallbacksL( TInt aDownloadId, TDesC& aFileName );
+        void AddMessagePdlCallbacksL( TInt aNewFile, TInt aDownloadId, TDesC& aFileName );
+
+        CMPXMessage* CreateMpxMessageLC( TInt aEvent, TInt aType, TInt aData );
+
+        void AddLocalFileCallbacksL( TDesC& aFileName,  TBool aUseFileHandle );
+        void AddCollectionMediaCallbacksL( TDesC& aFileName );
+        void AddSdpFileCallbacksL( TDesC& aFileName, TBool aUseFileHandle, CStifItemParser& aItem );
+        void AddRamFileCallbacksL( TDesC& aFileName, TBool aUseFileHandle, CStifItemParser& aItem );
+        void AddAsxFileCallbacksL( TDesC& aFileName, TBool aUseFileHandle, CStifItemParser& aItem );
+        void AddUrlCallbacksL( TDesC& aFileName, CStifItemParser& aItem );
+
+        void EndTest();
+
+        void HandleTimeout( TInt error );
+
+        TFileName GetFileNameAndPathL( CStifItemParser& aItem );
+
+        void AddCollectionMediaPdlCallbacksL( TInt aDownloadId, TDesC& aFileName );
+
+    private:
+
+        CScriptBase*                iScriptBase;
+        CMpxVideoPlayerAppUi*       iAppUi;
+        CMpxVideoPlayerAppUiEngine* iAppUiEngine;
+
+        MMPXPlaybackUtility*        iPlaybackUtility;
+        MMPXViewUtility*            iViewUtility;
+        CMPXCollectionUtility*      iCollectionUtility;
+
+        CAiwGenericParamList*       iGenericParamList;
+
+        CCallbackEventArray*        iExpectedEventArray;
+        TInt                        iError;
+        CSimpleTimeout*             iTimeoutController;
+        
+        CActiveSchedulerWait*       iActiveWait;
+
+};
+
+#endif /* MPXVIDEOPLAYER_APPUIENGINETESTER_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/inc/mpxvideoplayerappui_stub.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,49 @@
+/*
+* 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:  mpxvideoplayerappui stub for STIF testing
+*
+*/
+
+// Version : %version: ou1cpsw#3 %
+
+#ifndef CMPXVIDEOPLAYERAPPUI_H
+#define CMPXVIDEOPLAYERAPPUI_H
+
+class MAppUiEngineStifTestObserver;
+class CAknView;
+
+// FORWARD DECLARATIONS
+
+class CMpxVideoPlayerAppUi
+{
+    public:        // Constructors and destructor
+
+        CMpxVideoPlayerAppUi( TBool aEmbedded, MAppUiEngineStifTestObserver* aObserver );
+
+        ~CMpxVideoPlayerAppUi();
+
+    public:       // New functions
+
+        void HandleCommandL( TInt aCommand );
+
+        TBool IsEmbedded() const;
+
+        CAknView* View();
+    private:
+
+        TBool                           iEmbedded;
+        MAppUiEngineStifTestObserver*   iStifObserver;
+};
+
+#endif             // CMPXVIDEOPLAYERAPPUI_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/inc/mpxvideoplayeriadupdate_stub.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,79 @@
+/*
+* 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 <e32std.h>
+
+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
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/inc/mpxvideoplayertest.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,149 @@
+/*
+* 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:  mpxvideoplayerappuiengine test class for STIF testing
+*
+*/
+
+// Version : %version: ou1cpsw#10.1.1 %
+
+#ifndef MPXVIDEOPLAYER_TEST_H
+#define MPXVIDEOPLAYER_TEST_H
+
+//  INCLUDES
+#include <StifLogger.h>
+#include <TestScripterInternal.h>
+#include <StifTestModule.h>
+#include <TestclassAssert.h>
+#include <mpxplaybackcommanddefs.h>
+#include <remconcoreapi.h>
+#include <mpxplaybackframeworkdefs.h>
+
+// CONSTANTS
+
+
+// MACROS
+#define TEST_CLASS_VERSION_MAJOR 0
+#define TEST_CLASS_VERSION_MINOR 0
+#define TEST_CLASS_VERSION_BUILD 0
+
+// Logging path
+_LIT( Kmpxvideoplayer_testLogPath, "\\logs\\testframework\\mpxvideoplayer_test\\" );
+
+// Log file
+_LIT( Kmpxvideoplayer_testLogFile, "mpxvideoplayer_test.txt" );
+_LIT( Kmpxvideoplayer_testLogFileWithTitle, "mpxvideoplayer_test_[%S].txt" );
+
+// FUNCTION PROTOTYPES
+
+
+// FORWARD DECLARATIONS
+class Cmpxvideoplayer_test;
+class CMpxVideoPlayer_TestPlaybackUtility;
+class CMpxVideoPlayerRemConListener;
+class CMpxVideoPlayerMediaKeyHandler;
+class CMpxVideoPlayer_AppUiEngineTester;
+
+// DATA TYPES
+
+// CLASS DECLARATION
+
+/**
+*  Cmpxvideoplayer_test test class for STIF Test Framework TestScripter.
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+NONSHARABLE_CLASS(Cmpxvideoplayer_test) : public CScriptBase
+{
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static Cmpxvideoplayer_test* NewL( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * Destructor.
+        */
+        virtual ~Cmpxvideoplayer_test();
+
+    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.
+        */
+        Cmpxvideoplayer_test( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        /**
+        * Frees all resources allocated from test methods.
+        * @since ?Series60_version
+        */
+        void Delete();
+
+        /**
+        * Test methods are listed below.
+        */
+
+        virtual TInt CreateEngineL( CStifItemParser& aItem );
+        virtual TInt CreateGenericParametersTerminateL();
+        virtual TInt OpenFileL( CStifItemParser& aItem );
+        virtual TInt OpenMediaL( CStifItemParser& aItem );
+        virtual TInt SetGenericParamAccessPointL( CStifItemParser& aItem );
+        virtual TInt OpenFileEmbeddedPdlL( CStifItemParser& aItem );
+        virtual TInt HandleMessageEmbeddedPdlL( CStifItemParser& aItem );
+        virtual TInt StartStandAloneL( CStifItemParser& aItem );
+        virtual TInt HandleCollectionMessageL( CStifItemParser& aItem );
+        virtual TInt HandleCollectionMediaL( CStifItemParser& aItem );
+        virtual TInt HandleSoftkeyBackL( CStifItemParser& aItem );
+        virtual TInt HandleOpenPlaylistL( CStifItemParser& aItem );
+        virtual TInt HandleOpenMediaL( CStifItemParser& aItem );
+        virtual TInt HandleViewActivation( CStifItemParser& aItem );
+        virtual TInt ProcessCommandParametersL( CStifItemParser& aItem );
+        virtual TInt HandleMessageActivationMessageL( CStifItemParser& aItem );
+        virtual TInt GetViewDepthL( CStifItemParser& aItem );
+        virtual TInt ClearPdlInformation();
+        virtual TInt ClearPlaybackUtilityL( CStifItemParser& aItem );
+        virtual TInt HandleEmbeddedOpenL( CStifItemParser& aItem );
+        virtual TInt ActivateLateConstructTimerL( CStifItemParser& aItem );        
+
+        /**
+         * Method used to log version of test class
+         */
+        void SendTestClassVersion();
+
+
+    private:    // Friend classes
+
+        CMpxVideoPlayer_AppUiEngineTester* iAppUiEngineTester;
+};
+
+#endif      // MPXVIDEOPLAYER_TEST_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/inc/mpxviewutilityimp_stub.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,88 @@
+/*
+* 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:  mpx video utility stub for STIF testing
+*
+*/
+
+// Version : %version: ou1cpsw#4 %
+
+#ifndef MPXVIEWUTILITY_STUB_H_
+#define MPXVIEWUTILITY_STUB_H_
+
+// INCLUDES
+
+#include "mpxvideoplayer_appuienginetester.h"
+#include <mpxviewutility.h>
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+NONSHARABLE_CLASS( CMPXViewUtility ) : public CBase,
+                                       public MMPXViewUtility
+{
+    public:
+        static MMPXViewUtility* UtilityL();
+
+    public:
+
+        CMPXViewUtility();
+
+        virtual ~CMPXViewUtility();
+
+        void ConstructL();
+
+        static CMPXViewUtility* NewL();
+
+        static void StoreViewUtility( MMPXViewUtility* aUtility );
+
+        //
+        //  MMPXViewUtility Implementation
+        //
+        void Close();
+        void ActivateViewL( const TUid& aUid, const TDesC* aParam = NULL );
+        void ActivateViewL( const RArray<TUid>& aUids, const TDesC* aParam = NULL );
+        void SetAsDefaultViewL( const TUid& aUid );
+        void SetAsDefaultViewL( const RArray<TUid>& aUids );
+        void ActivatePreviousViewL();
+        void PreLoadViewsL();
+        void PreLoadViewL( const TUid& aUid );
+        MMPXViewPluginManager& ViewPluginManager();
+        TUid ConstructDefaultViewHistoryL();
+        void PushDefaultHistoryL();
+        TUid DefaultViewUid();
+        TInt ViewHistoryDepth();
+        TUid PreviousViewType();
+        TUid ActiveViewType();
+        TUid ActiveViewImplementationUid();
+        void AddObserverL( MMPXViewActivationObserver* aObserver );
+        void RemoveObserver( MMPXViewActivationObserver* aObserver );
+        void PreLoadViewsL( const TUid& aUid );
+
+        void AddStifObserverL( MAppUiEngineStifTestObserver* aObserver );
+        void RemoveStifObserver();
+        void SetViewHistoryDepth( TInt aDepth );
+
+    private:
+
+        RPointerArray<MMPXViewActivationObserver>    iObservers;
+        MAppUiEngineStifTestObserver*                iStifObserver;
+
+        TInt iRefCount;
+        TInt iViewHistoryDepth;
+
+        TUid iViewTypeUid;
+};
+
+#endif /*MPXVIEWUTILITY_STUB_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/inc/stifutilities.h	Thu Nov 04 11:16:56 2010 +0200
@@ -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:  mpx utilities class stub for STIF testing
+*
+*/
+
+// Version : %version: ou1cpsw#2 %
+
+#ifndef STIFUTILITIES_H_
+#define STIFUTILITIES_H_
+
+#include "mpxcollectionutilityimp_stub.h"
+#include "mpxcollectionutilityimp_stub.h"
+#include "mpxplaybackutilityimp_stub.h"
+#include "mpxviewutilityimp_stub.h"
+
+class StifUtilities : public CBase
+{
+    public:
+
+        void DeleteCollectionUtility();
+        void DeleteViewUtility();
+        void DeletePlaybackUtility();
+
+        void CloseUtility();
+
+        CMPXCollectionUtility* iCollectionUtility;
+        CMPXPlaybackUtility*   iPlaybackUtility;
+        CMPXViewUtility*       iViewUtility;
+};
+#endif /*STIFUTILITIES_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/inc/timeoutcontroller.h	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,71 @@
+/*
+* 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:  Simple player for preemption purposes
+*
+*/
+
+// Version : %version: ou1cpsw#2 %
+
+
+
+#include <e32svr.h>
+#include <StifParser.h>
+#include <Stiftestinterface.h>
+
+
+class MTimeoutObserver
+{
+    public: // New functions
+
+        virtual void HandleTimeout(TInt error) = 0;
+};
+
+
+_LIT(KFormatTimeStamp, "%:0%J%:1%T%:2%S%.%*C4%:3%+B");
+
+
+class CSimpleTimeout : public CActive
+{
+    public:     // Constructors and destructor
+
+        static CSimpleTimeout* NewL( MTimeoutObserver* aObserver );
+
+        ~CSimpleTimeout();
+
+    public:     // New functions
+
+        void Start( TTimeIntervalMicroSeconds aTimeout );
+
+        void Stop();
+
+
+    public:     // Functions from base classes
+
+        void RunL();
+
+        void DoCancel();
+
+        TInt RunError( TInt aError );
+
+    private:
+
+        void ConstructL( MTimeoutObserver* aObserver );
+        CSimpleTimeout();
+
+
+    private:    // Data
+        MTimeoutObserver*   iObserver;
+        RTimer              iTimer;
+        TTime               iTestCaseTimeout;
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/init/testframework.ini	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,169 @@
+#
+# This is STIFTestFramework initialization file 123
+# 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': Sret of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases' 
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.sd
+#
+# 	- 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.
+
+[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_mpxvideoplayertest
+
+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= stifmeasurementplugin04 
+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\mpxvideoplayertest.cfg
+[End_Module]
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework 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.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+#CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+#HardwareBasePath=  C:\
+#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
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/src/coneutils_stub.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,49 @@
+/*
+* 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:  cone utilities stub for STIF testing
+*
+*/
+
+// Version : %version: ou1cpsw#2 %
+
+#include <f32file.h>
+#include <coeutils.h>
+
+TBool ConeUtils::FileExists(const TDesC& aFileName)
+{
+    TBool retVal = EFalse;
+
+    RFs fs;
+    RFile file;
+
+    TInt error = fs.Connect();
+
+    if ( error == KErrNone )
+    {
+        fs.ShareProtected();
+
+        error = file.Open( fs, aFileName, EFileRead );
+
+        if ( error == KErrNone )
+        {
+            retVal = ETrue;
+
+            file.Close();
+        }
+
+        fs.Close();
+    }
+
+    return retVal;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/src/mpxcollectionuihelper_stub.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,100 @@
+/*
+* 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: Test stub class
+*
+*/
+
+#include <e32base.h>
+#include <s32file.h>
+#include <mpxmedia.h>
+#include <mpxcollectionplaylist.h>
+#include <mpxmediaarray.h>
+#include <mpxmediageneraldefs.h>
+#include <mpxmediacontainerdefs.h>
+#include <mpxuser.h>
+#include <mpxcmn.h>
+#include <mpxcollectionutility.h>
+#include <mpxcollectiontype.h>
+#include <mpxcollectionmediator.h>
+#include <mpxplaylistenginedefs.h>
+#include <mpxlog.h>
+#include <mpxcollectionmessage.h>
+#include <mpxtaskqueue.h>
+#include <mpxcollectionplugin.hrh>
+#include <mpxharvesterutility.h>
+#include <mpxcommandgeneraldefs.h>
+#include <mpxcollectioncommanddefs.h>
+#include <UsbWatcherInternalPSKeys.h>
+#include <usbpersonalityids.h>
+#include <mpxcollectionhelperfactory.h>
+
+#include "mpxcollectionuihelperimp_stub.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Factory method to create the collection ui helper
+// ---------------------------------------------------------------------------
+// 
+MMPXCollectionUiHelper* CMPXCollectionHelperFactory::NewCollectionUiHelperL(const TUid& aModeId)
+    {
+    return CMPXCollectionUiHelperImp::NewL(aModeId);
+    }
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Private Constructor
+// ---------------------------------------------------------------------------
+//
+CMPXCollectionUiHelperImp::CMPXCollectionUiHelperImp()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Two-Phased Constructor
+// ---------------------------------------------------------------------------
+//
+CMPXCollectionUiHelperImp* CMPXCollectionUiHelperImp::NewL( const TUid& )
+    {
+    return new( ELeave ) CMPXCollectionUiHelperImp();
+    }
+
+// ---------------------------------------------------------------------------
+// Virtual Destructor
+// ---------------------------------------------------------------------------
+//
+CMPXCollectionUiHelperImp::~CMPXCollectionUiHelperImp()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Open the collection in embedded mode for a media
+// Cannot cleanup aObs because UPnP is using this.
+// ---------------------------------------------------------------------------
+//
+void CMPXCollectionUiHelperImp::OpenL( const TUid& , CMPXMedia& ,
+                                       MMPXCHelperEmbeddedOpenObserver* ,
+                                       TInt )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Frees this object
+// ---------------------------------------------------------------------------
+//
+void CMPXCollectionUiHelperImp::Close()
+    {
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/src/mpxcollectionutility_stub.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,26 @@
+/*
+* 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:  mpx collection utility stub for STIF testing
+*
+*/
+
+// Version : %version: ou1cpsw#2 %
+
+#include "mpxcollectionutilityimp_stub.h"
+
+MMPXCollectionUtility*
+MMPXCollectionUtility::NewL( MMPXCollectionObserver* aObs, const TUid& aModeId )
+{
+    return CMPXCollectionUtility::NewL( aModeId, aObs );
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/src/mpxcollectionutilityimp_stub.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,301 @@
+/*
+* 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:  mpx collection utility stub for STIF testing
+*
+*/
+
+// Version : %version: ou1cpsw#5 %
+
+
+#include <mpxcollectionplaylist.h>
+#include <mpxcollectionpath.h>
+#include <mpxcollectionplaylistobserver.h>
+
+#include "stifutilities.h"
+#include "mpxcollectionutilityimp_stub.h"
+#include "mpxvideo_debug.h"
+
+
+CMPXCollectionUtility*
+CMPXCollectionUtility::NewL( const TUid& /*aModeId*/, MMPXCollectionObserver* aObs )
+{
+    MPX_ENTER_EXIT(_L("CMPXCollectionUtility::NewL()"));
+
+    StifUtilities* utility = reinterpret_cast<StifUtilities*>( Dll::Tls() );
+
+    if ( ! utility )
+    {
+        utility = new (ELeave) StifUtilities;
+
+        Dll::SetTls( utility );
+    }
+
+    if ( ! utility->iCollectionUtility )
+    {
+        utility->iCollectionUtility = new (ELeave) CMPXCollectionUtility( aObs );
+    }
+
+    utility->iCollectionUtility->AddRefCount();
+
+    return utility->iCollectionUtility;
+}
+
+CMPXCollectionUtility::~CMPXCollectionUtility()
+{
+    MPX_ENTER_EXIT(_L("CMPXCollectionUtility::~CMPXCollectionUtility()"));
+
+    if ( iCollectionPath )
+    {
+        delete iCollectionPath;
+    }
+}
+
+CMPXCollectionUtility::CMPXCollectionUtility( MMPXCollectionObserver* aObs )
+    : iObserver( aObs ),
+      iCollectionPath( NULL ),
+      iRefCount(0)
+{
+}
+
+void CMPXCollectionUtility::ConstructL( const TUid& /*aModeId*/ )
+{
+}
+
+void CMPXCollectionUtility::AddStifObserverL( MAppUiEngineStifTestObserver* aObserver )
+{
+    MPX_ENTER_EXIT(_L("CMPXCollectionUtility::AddStifObserverL()"));
+
+    iStifObserver = aObserver;
+}
+
+void CMPXCollectionUtility::RemoveStifObserverL()
+{
+    MPX_ENTER_EXIT(_L("CMPXCollectionUtility::RemoveStifObserverL()"));
+
+    iStifObserver = NULL;
+}
+
+MMPXCollection&
+CMPXCollectionUtility::Collection()
+{
+    MPX_ENTER_EXIT(_L("CMPXCollectionUtility::Collection()"));
+    return *this;
+}
+
+TUid
+CMPXCollectionUtility::CollectionIDL( const TArray<TUid>& /*aUids*/ )
+{
+    return KNullUid;
+}
+
+void CMPXCollectionUtility::AddSubscriptionL( const CMPXSubscription& /*aSubscription*/ )
+{
+}
+
+void CMPXCollectionUtility::RemoveSubscriptionL( const CMPXSubscription& /*aSubscription*/ )
+{
+}
+
+void CMPXCollectionUtility::ClearSubscriptionsL()
+{
+}
+
+void CMPXCollectionUtility::AddRefCount()
+{
+    iRefCount++;
+}
+
+void CMPXCollectionUtility::Close()
+{
+    MPX_ENTER_EXIT(_L("CMPXCollectionUtility::Close()"),
+                   _L("iRefCount = %d"), iRefCount );
+
+    if ( --iRefCount == 0 )
+    {
+        StifUtilities* utility = reinterpret_cast<StifUtilities*>( Dll::Tls() );
+
+        utility->DeleteCollectionUtility();
+    }
+}
+
+void CMPXCollectionUtility::OpenL( TMPXOpenMode /*aMode*/ )
+{
+}
+
+void CMPXCollectionUtility::OpenL( TInt /*aIndex*/, TMPXOpenMode /*aMode*/ )
+{
+}
+
+void CMPXCollectionUtility::OpenL( const CMPXCollectionPath& /*aPath*/, TMPXOpenMode /*aMode*/ )
+{
+    MPX_ENTER_EXIT(_L("CMPXCollectionUtility::OpenL()"));
+
+    if ( iStifObserver )
+    {
+        TCallbackEvent* event = new TCallbackEvent;
+        event->iEvent = ECollectionUtilityOpen;
+        iStifObserver->HandleUtilityEvent( event );
+    }
+}
+
+void CMPXCollectionUtility::OpenL( TInt /*aIndex*/,
+                                   const TArray<TMPXAttribute>& /*aAttrs*/,
+                                   TMPXOpenMode /*aMode*/ )
+{
+}
+
+void CMPXCollectionUtility::OpenL( const CMPXCollectionPath& /*aPath*/,
+                                   const TArray<TMPXAttribute>& /*aAttrs*/,
+                                   TMPXOpenMode /*aMode*/ )
+{
+}
+
+void CMPXCollectionUtility::OpenL( const TArray<TUid>& /*aUids*/, TMPXOpenMode /*aMode*/ )
+{
+}
+
+void CMPXCollectionUtility::OpenL( const TUid& /*aUid*/, TMPXOpenMode /*aMode*/ )
+{
+}
+
+void CMPXCollectionUtility::SetFilterL( CMPXFilter* /*aFilter*/ )
+{
+}
+
+CMPXFilter* CMPXCollectionUtility::FilterL()
+{
+    return NULL;
+}
+
+TUid
+CMPXCollectionUtility::UidL() const
+{
+    return KNullUid;
+}
+
+CMPXCollectionPath* CMPXCollectionUtility::PathL()
+{
+    MPX_ENTER_EXIT(_L("CMPXCollectionUtility::PathL()"));
+
+    CMPXCollectionPath* cp = CMPXCollectionPath::NewL();
+
+    TMPXItemId item1;
+    TMPXItemId item2;
+
+    cp->AppendL( item1 );
+    cp->AppendL( item2 );
+
+    return cp;
+}
+
+void CMPXCollectionUtility::BackL()
+{
+}
+
+TBool CMPXCollectionUtility::IsRemote( const CMPXCollectionPath& /*aPath*/ )
+{
+    return EFalse;
+}
+
+void CMPXCollectionUtility::CancelRequest()
+{
+}
+
+void CMPXCollectionUtility::AddL( const CMPXMedia& /*aNewProperties*/ )
+{
+}
+
+void CMPXCollectionUtility::RemoveL( const CMPXCollectionPath& /*aPath*/,
+                                     MMPXCollectionRemoveObserver* /*aObs*/ )
+{
+}
+
+void CMPXCollectionUtility::RemoveL( const CMPXMedia& /*aProperties*/ )
+{
+}
+
+void CMPXCollectionUtility::SetSyncL( const CMPXMedia& /*aMedia*/ )
+{
+}
+
+void CMPXCollectionUtility::SetL( const CMPXMedia& /*aMedia*/ )
+{
+}
+
+void CMPXCollectionUtility::FindAllL( const CMPXMedia& /*aMedia*/,
+                                      const TArray<TMPXAttribute>& /*aAttrs*/,
+                                      MMPXCollectionFindObserver& /*aObs*/ )
+{
+}
+
+// ----------------------------------------------------------------------------
+// Find media sync
+// ----------------------------------------------------------------------------
+//
+CMPXMedia*
+CMPXCollectionUtility::FindAllL( const CMPXMedia& /*aMedia*/,
+                                 const TArray<TMPXAttribute>& /*aAttrs*/ )
+{
+    return NULL;
+}
+
+void CMPXCollectionUtility::MediaL( const CMPXCollectionPath& /*aPath*/,
+                                    const TArray<TMPXAttribute>& /*aAttrs*/,
+                                    CMPXAttributeSpecs* /*aSpecs*/,
+                                    CMPXFilter* /*aFilter*/ )
+{
+    MPX_ENTER_EXIT(_L("CMPXCollectionUtility::MediaL()"));
+
+    if ( iStifObserver )
+    {
+        TCallbackEvent* event = new TCallbackEvent;
+        event->iEvent = ECollectionUtilityMedia;
+        iStifObserver->HandleUtilityEvent( event );
+    }
+}
+
+void CMPXCollectionUtility::NotifyL( TMPXCollectionBroadCastMsg /*aMsg*/, TInt /*aData*/ )
+{
+}
+
+void CMPXCollectionUtility::CommandL( TMPXCollectionCommand /*aCmd*/, TInt /*aData*/ )
+{
+}
+
+void CMPXCollectionUtility::CommandL( CMPXCommand& /*aCmd*/ )
+{
+}
+
+void CMPXCollectionUtility::GetSupportedTypesL( RPointerArray<CMPXCollectionType>& /*aArray*/ )
+{
+}
+
+void CMPXCollectionUtility::GetSupportedCapabilitiesL( TCollectionCapability& /*aCapability*/ )
+{
+}
+
+TUid CMPXCollectionUtility::CollectionIDL( TUid& /*aCollection*/ )
+{
+    return KNullUid;
+}
+
+void CMPXCollectionUtility::MessageReceived( TInt /*aMsgData*/, TInt /*aError*/ )
+{
+}
+
+EXPORT_C void CMPXCollectionPlaylist::SetAutoPlay( TBool /*aAutoPlay*/ )
+{
+}
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/src/mpxplaybackutilityimp_stub.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,530 @@
+/*
+* 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:  mpx playback utility stub for STIF testing
+*
+*/
+
+// Version : %version: ou1cpsw#9.1.1 %
+
+
+#include <mpxcommandgeneraldefs.h>
+#include <mpxplaybackcommanddefs.h>
+#include <mpxmediageneralextdefs.h>
+
+#include "mpxplaybackutilityimp_stub.h"
+#include "mpxvideoplayerconstants.h"
+#include "stifutilities.h"
+#include <mpxvideoplaybackdefs.h>
+#include "mpxvideo_debug.h"
+
+
+MMPXPlaybackUtility* MMPXPlaybackUtility::UtilityL( const TMPXCategory aCategory, const TUid& aModeId )
+{
+    MPX_ENTER_EXIT(_L("CMPXPlaybackUtility::UtilityL()"));
+
+    StifUtilities* utility = reinterpret_cast<StifUtilities*>( Dll::Tls() );
+
+    if ( ! utility )
+    {
+        utility = new (ELeave) StifUtilities;
+
+        Dll::SetTls( utility );
+    }
+
+    if ( ! utility->iPlaybackUtility )
+    {
+        utility->iPlaybackUtility = new (ELeave) CMPXPlaybackUtility();
+    }
+
+    utility->iPlaybackUtility->AddRefCount();
+
+    //
+    //  Send notification to observer
+    //
+    utility->iPlaybackUtility->StartPdlPlaybackUtility();
+
+    return utility->iPlaybackUtility;
+}
+
+CMPXPlaybackUtility::~CMPXPlaybackUtility()
+{
+    MPX_ENTER_EXIT(_L("CMPXPlaybackUtility::~CMPXPlaybackUtility()"));
+
+    iObservers.Close();
+}
+
+CMPXPlaybackUtility::CMPXPlaybackUtility()
+{
+}
+
+void CMPXPlaybackUtility::AddRefCount()
+{
+    iRefCount++;
+}
+
+void CMPXPlaybackUtility::StartPdlPlaybackUtility()
+{
+    MPX_ENTER_EXIT(_L("CMPXPlaybackUtility::StartPdlPlaybackUtility()"));
+
+    if ( iStifObserver )
+    {
+        TCallbackEvent* event = new TCallbackEvent;
+        event->iEvent    = EPlaybackUtilityPdlInstance;
+        iStifObserver->HandleUtilityEvent( event );
+    }
+}
+
+void CMPXPlaybackUtility::AddStifObserverL( MAppUiEngineStifTestObserver* aObserver )
+{
+    MPX_ENTER_EXIT(_L("CMPXPlaybackUtility::AddStifObserverL()"));
+
+    iStifObserver= aObserver;
+}
+
+void CMPXPlaybackUtility::RemoveStifObserverL()
+{
+    MPX_ENTER_EXIT(_L("CMPXPlaybackUtility::RemoveStifObserverL()"));
+
+    iStifObserver = NULL;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   MMPXPlaybackUtility Implementation
+// -------------------------------------------------------------------------------------------------
+
+void CMPXPlaybackUtility::AddObserverL( MMPXPlaybackObserver& aObs )
+{
+    MPX_ENTER_EXIT(_L("CMPXPlaybackUtility::AddObserverL()"));
+    iObservers.AppendL(&aObs);
+}
+
+void CMPXPlaybackUtility::RemoveObserverL( MMPXPlaybackObserver& aObs )
+{
+    MPX_ENTER_EXIT(_L("CMPXPlaybackUtility::RemoveObserverL()"));
+
+    TInt i = iObservers.FindL(&aObs);
+    iObservers.Remove(i);
+}
+
+
+void CMPXPlaybackUtility::GetClientsL( RArray<TProcessId>& /*aClients*/ )
+{
+}
+
+void CMPXPlaybackUtility::UpdatePlaylistL( const CMPXCollectionPlaylist& /*aPlaylist*/ )
+{
+}
+
+void CMPXPlaybackUtility::InitL( const CMPXCollectionPlaylist& /*aPlaylist*/, TBool /*aPlay*/ )
+{
+    MPX_ENTER_EXIT(_L("CMPXPlaybackUtility::InitL(CMPXCollectionPlaylist)"));
+
+    if ( iStifObserver )
+    {
+        TCallbackEvent* event = new TCallbackEvent;
+        event->iEvent = EPlaybackUtilityInitPlaylist;
+        iStifObserver->HandleUtilityEvent( event );
+    }
+}
+
+void CMPXPlaybackUtility::InitL( const TDesC& aUri, const TDesC8* /*aType*/ )
+{
+    MPX_ENTER_EXIT(_L("CMPXPlaybackUtility::InitL()"),
+                   _L("aUri = %S"), &aUri );
+
+    if ( iStifObserver )
+    {
+        TCallbackEvent* event = new TCallbackEvent;
+        event->iEvent    = EPlaybackUtilityInitFileName;
+        event->iFileName = aUri;
+        iStifObserver->HandleUtilityEvent( event );
+    }
+}
+
+void CMPXPlaybackUtility::InitL( RFile& aShareableFile )
+{
+    MPX_ENTER_EXIT(_L("CMPXPlaybackUtility::InitL( RFile )"));
+
+    if ( iStifObserver )
+    {
+        TCallbackEvent* event = new TCallbackEvent;
+        event->iEvent = EPlaybackUtilityInitFileHandle;
+        aShareableFile.FullName( event->iFileName );
+        iStifObserver->HandleUtilityEvent( event );
+    }
+}
+
+void CMPXPlaybackUtility::Close()
+{
+    MPX_ENTER_EXIT(_L("CMPXPlaybackUtility::Close()"),
+                   _L("iRefCount = %d"), iRefCount );
+
+    //
+    //  When the ref count is 2, it should be the app ui engine closing the utility
+    //
+    if ( iRefCount == 2 )
+    {
+        if ( iStifObserver )
+        {
+            TCallbackEvent* event = new TCallbackEvent;
+            event->iEvent = EPlaybackUtilityClose;
+            iStifObserver->HandleUtilityEvent( event );
+        }
+    }
+
+    if ( --iRefCount == 0 )
+    {
+        StifUtilities* utility = reinterpret_cast<StifUtilities*>( Dll::Tls() );
+
+        utility->DeletePlaybackUtility();
+    }
+}
+
+void CMPXPlaybackUtility::CancelRequest()
+{
+}
+
+void CMPXPlaybackUtility::CommandL( TMPXPlaybackCommand aCmd, TInt /*aData*/ )
+{
+    MPX_ENTER_EXIT(_L("CMPXPlaybackUtility::CommandL()"),
+                   _L("aCmd = %d"), aCmd );
+
+    switch ( aCmd )
+    {
+        case EPbCmdPlay:
+        {
+            if ( iStifObserver )
+            {
+                TCallbackEvent* event = new TCallbackEvent;
+                event->iEvent = EPlaybackUtilityPlayCmd;
+                iStifObserver->HandleUtilityEvent( event );
+            }
+
+            break;
+        }
+        case EPbCmdClose:
+        {
+            if ( iStifObserver )
+            {
+                TCallbackEvent* event = new TCallbackEvent;
+                event->iEvent = EPlaybackUtilityClose;
+                iStifObserver->HandleUtilityEvent( event );
+            }
+
+            break;
+        case EPbCmdDisableEffect:
+            {
+            iDisableEffectCallCount++;
+            if( iDisableEffectCallCount == 1  )
+                {
+                if ( iStifObserver )
+                    {
+                    TCallbackEvent* event = new TCallbackEvent;
+                    event->iEvent = EPlaybackUtilityDisableEffects;
+                    iStifObserver->HandleUtilityEvent( event );
+                    }                
+                }            
+            if( iDisableEffectCallCount >= 2 )
+                {
+                User::Leave( KErrNotFound );
+                }                        
+            }
+            break;
+        }
+    }
+}
+
+void CMPXPlaybackUtility::CommandL( CMPXCommand& aCmd, MMPXPlaybackCallback* /*aCallback*/ )
+{
+    MPX_ENTER_EXIT(_L("CMPXPlaybackUtility::CommandL( CMPXCommand )"));
+
+    if ( aCmd.IsSupported( KMPXCommandGeneralId ) )
+    {
+        TInt cmdId = *aCmd.Value<TInt>(KMPXCommandGeneralId);
+
+        MPX_DEBUG(_L("CMPXPlaybackUtility::CommandL() id = 0x%08x"), cmdId );
+
+        switch ( cmdId )
+        {
+            case KMPXCommandIdPlaybackGeneral:
+            {
+                break;
+            }
+            case KMPXCommandIdPlaybackPD:
+            {
+                TMPXPlaybackPdCommand pdCmd =
+                    static_cast<TMPXPlaybackPdCommand>(
+                        *aCmd.Value<TInt>(KMPXCommandPlaybackGeneralType) );
+
+                switch ( pdCmd )
+                {
+                    case EPbCmdStartPd:
+                    {
+                        TInt downloadId = *aCmd.Value<TInt>( KMPXCommandPlaybackPDTransactionID );
+                        TPtrC fileName( aCmd.ValueText( KMPXMediaVideoPlaybackFileName ) );
+                        TInt movePdlFile = *aCmd.Value<TInt>( KMPXMediaVideoMovePdlFile );
+
+                        if ( iStifObserver )
+                        {
+                            TCallbackEvent* event = new TCallbackEvent;
+                            event->iEvent      = EPlaybackUtilityStartPdl;
+                            event->iDownloadId = downloadId;
+                            event->iFileName   = fileName;
+                            event->iExtra      = movePdlFile;
+                            iStifObserver->HandleUtilityEvent( event );
+                        }
+
+                        break;
+                    }
+                }
+                break;
+            }
+            case KMPXMediaIdVideoPlayback:
+            {
+                TMPXVideoPlaybackCommand videoCmd =
+                        static_cast<TMPXVideoPlaybackCommand>(
+                            *aCmd.Value<TInt>(KMPXMediaVideoPlaybackCommand) );
+
+                switch ( videoCmd )
+                {
+                    case EPbCmdUpdateSeekable:
+                    {
+                        TBool seekable = *aCmd.Value<TBool>( KMPXMediaGeneralExtVideoSeekable );
+
+                        if ( iStifObserver )
+                        {
+                            TCallbackEvent* event = new TCallbackEvent;
+                            event->iEvent      = EAsxAttributeSeekUpdate;
+                            event->iExtra      = seekable;
+                            iStifObserver->HandleUtilityEvent( event );
+                        }
+                        break;
+                    }
+                }
+
+                break;
+            }
+
+        }
+    }
+}
+
+TMPXPlaybackState CMPXPlaybackUtility::StateL() const
+{
+    return EPbStateNotInitialised;
+}
+
+MMPXSource* CMPXPlaybackUtility::Source()
+{
+    return this;
+}
+
+MMPXPlayerManager& CMPXPlaybackUtility::PlayerManager()
+{
+    return *this;
+}
+
+void CMPXPlaybackUtility::SetL( TMPXPlaybackProperty /*aProperty*/, TInt /*aValue*/ )
+{
+}
+
+void CMPXPlaybackUtility::ValueL( MMPXPlaybackCallback& /*aCallback*/,
+                                  TMPXPlaybackProperty /*aProperty*/ )
+{
+}
+
+void CMPXPlaybackUtility::PropertyL( MMPXPlaybackCallback& /*aCallback*/,
+                                   TMPXPlaybackProperty /*aProperty*/ )
+{
+}
+
+CDesCArray* CMPXPlaybackUtility::SupportedMimeTypes()
+{
+    return NULL;
+}
+
+CDesCArray* CMPXPlaybackUtility::SupportedExtensions()
+{
+    return NULL;
+}
+
+CDesCArray* CMPXPlaybackUtility::SupportedSchemas()
+{
+    return NULL;
+}
+
+void CMPXPlaybackUtility::SetPriority( TInt /*aPriority*/ )
+{
+}
+
+void CMPXPlaybackUtility::AddSubscriptionL( const CMPXSubscription& /*aSubscription*/ )
+{
+}
+
+void CMPXPlaybackUtility::RemoveSubscriptionL( const CMPXSubscription& /*aSubscription*/ )
+{
+}
+
+void CMPXPlaybackUtility::ClearSubscriptionsL()
+{
+}
+
+void CMPXPlaybackUtility::InitStreamingL( const TDesC& aUri,
+                                          const TDesC8* /*aType*/,
+                                          const TInt aAccessPoint )
+{
+    MPX_ENTER_EXIT(_L("CMPXPlaybackUtility::InitStreamingL()"),
+                   _L("aUri = %S, aAccessPoint = %d"), &aUri, aAccessPoint );
+
+    if ( iStifObserver )
+    {
+        TCallbackEvent* event = new TCallbackEvent;
+        event->iEvent    = EPlaybackUtilityInitStreamingUrl;
+        event->iFileName = aUri;
+        event->iApId     = aAccessPoint;
+        iStifObserver->HandleUtilityEvent( event );
+    }
+}
+
+void CMPXPlaybackUtility::InitStreamingL( RFile& aShareableFile, const TInt aAccessPoint )
+{
+    MPX_ENTER_EXIT(_L("CMPXPlaybackUtility::InitStreamingL( RFile )"),
+                   _L("aAccessPoint = %d"), aAccessPoint );
+
+    if ( iStifObserver )
+    {
+        TCallbackEvent* event = new TCallbackEvent;
+        event->iEvent    = EPlaybackUtilityInitStreamingFileHandle;
+        aShareableFile.FullName( event->iFileName );
+        event->iApId     = aAccessPoint;
+        iStifObserver->HandleUtilityEvent( event );
+    }
+}
+
+
+// -------------------------------------------------------------------------------------------------
+//   MMPXPlayerManager Implementation
+// -------------------------------------------------------------------------------------------------
+
+void CMPXPlaybackUtility::GetPlayerTypesL( RArray<TMPXPlaybackPlayerType>& /*aTypes*/ )
+{
+}
+
+HBufC* CMPXPlaybackUtility::PlayerTypeDisplayNameL( TMPXPlaybackPlayerType /*aType*/ )
+{
+    return NULL;
+}
+
+void CMPXPlaybackUtility::GetPlayerListL( RArray<TUid>& /*aPlayers*/ )
+{
+}
+
+void CMPXPlaybackUtility::GetPlayerListL( RArray<TUid>& /*aPlayers*/,
+                                          TMPXPlaybackPlayerType /*aType*/ )
+{
+}
+
+void CMPXPlaybackUtility::SubPlayerNamesL( MMPXPlaybackCallback& /*aCallback*/, TUid /*aPlayer*/ )
+{
+}
+
+void CMPXPlaybackUtility::SelectPlayersL( TMPXPlaybackPlayerType /*aType*/ )
+{
+}
+
+void CMPXPlaybackUtility::SelectSubPlayerL( TUid /*aPlayer*/, TInt /*aSubPlayerIndex*/ )
+{
+}
+
+void CMPXPlaybackUtility::SelectPlayerL( TUid /*aPlayer*/ )
+{
+}
+
+void CMPXPlaybackUtility::ClearSelectPlayersL()
+{
+}
+
+void CMPXPlaybackUtility::GetSelectionL( TMPXPlaybackPlayerType& /*aType*/,
+                                         TUid& /*aPlayer*/,
+                                         TInt& /*aSubPlayerIndex*/,
+                                         HBufC*& /*aSubPlayerName*/ )
+{
+}
+
+MMPXPlayer* CMPXPlaybackUtility::CurrentPlayer()
+{
+    return this;
+}
+
+
+// -------------------------------------------------------------------------------------------------
+//   MMPXPlayer Implementation
+// -------------------------------------------------------------------------------------------------
+
+TMPXPlaybackPlayerType CMPXPlaybackUtility::TypeL()
+{
+    return EPbUnknown;
+}
+
+HBufC* CMPXPlaybackUtility::TypeNameL()
+{
+    return NULL;
+}
+
+void CMPXPlaybackUtility::SubPlayerNamesL( MMPXPlaybackCallback& /*aCallback*/ )
+{
+}
+
+TInt CMPXPlaybackUtility::SubPlayerL() const
+{
+    return 0;
+}
+
+TUid CMPXPlaybackUtility::UidL() const
+{
+    return KNullUid;
+}
+
+
+// -------------------------------------------------------------------------------------------------
+//   MPXSource Implementation
+// -------------------------------------------------------------------------------------------------
+
+CMPXCollectionPlaylist* CMPXPlaybackUtility::PlaylistL()
+{
+    return NULL;
+}
+
+RFile* CMPXPlaybackUtility::FileL()
+{
+    return NULL;
+}
+
+HBufC* CMPXPlaybackUtility::UriL()
+{
+    return NULL;
+}
+
+void CMPXPlaybackUtility::MediaL( const TArray<TMPXAttribute>& /*aAttrs*/,
+                                  MMPXPlaybackCallback& /*aCallback*/ )
+{
+}
+
+void CMPXPlaybackUtility::MediaL( const TArray<TMPXAttribute>& /*aAttrs*/,
+                                  MMPXPlaybackCallback& /*aCallback*/,
+                                  CMPXAttributeSpecs* /*aSpecs*/ )
+{
+}
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/src/mpxvideoplayer_appuienginetester.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,1436 @@
+/*
+* 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:  mpxvideoplayerappuiengine test class for STIF testing
+*
+*/
+
+// Version : %version: ou1cpsw#e92_23.1.1 %
+
+
+#include "mpxvideoplayer_appuienginetester.h"
+#include "mpxviewutilityimp_stub.h"
+#include "mpxplaybackutilityimp_stub.h"
+#include "mpxvideoplayerappui_stub.h"
+#include "mpxvideoplayerappuiengine.h"
+#include "mpxvideoplayerconstants.h"
+#include "mpxcollectionutilityimp_stub.h"
+
+#include <mpxplaybackmessage.h>
+#include <mpxmessagegeneraldefs.h>
+#include <mpxmediageneraldefs.h>
+#include <mpxcollectionmessage.h>
+#include <f32file.h>
+#include <videoplayeractivationmessage.h>
+#include <bautils.h>
+#include <vcxmyvideosdefs.h>
+
+#include "mpxvideo_debug.h"
+
+
+#define KMPXPLAYBACKPLUGINTYPEUID 0x101FFCA0
+#define EMatrix 4
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayer_AppUiEngineTester::NewL
+// -------------------------------------------------------------------------------------------------
+//
+CMpxVideoPlayer_AppUiEngineTester*
+CMpxVideoPlayer_AppUiEngineTester::NewL( CScriptBase* aScriptBase )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayer_AppUiEngineTester::NewL()"));
+
+    CMpxVideoPlayer_AppUiEngineTester* self =
+        new (ELeave) CMpxVideoPlayer_AppUiEngineTester( aScriptBase );
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+}
+
+// -----------------------------------------------------------------------------
+// CMpxVideoPlayer_AppUiEngineTester::~CMpxVideoPlayer_AppUiEngineTester
+//
+// -----------------------------------------------------------------------------
+//
+CMpxVideoPlayer_AppUiEngineTester::~CMpxVideoPlayer_AppUiEngineTester()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayer_AppUiEngineTester::~CMpxVideoPlayer_AppUiEngineTester()"));
+
+    delete iAppUiEngine;
+    iAppUiEngine = NULL;
+
+    delete iAppUi;
+    iAppUi = NULL;
+
+    if ( iViewUtility )
+    {
+        static_cast<CMPXViewUtility*>(iViewUtility)->RemoveStifObserver();
+        iViewUtility->Close();
+    }
+
+    if ( iPlaybackUtility )
+    {
+        static_cast<CMPXPlaybackUtility*>(iPlaybackUtility)->RemoveStifObserverL();
+        iPlaybackUtility->Close();
+    }
+
+    if ( iCollectionUtility )
+    {
+        iCollectionUtility->RemoveStifObserverL();
+        iCollectionUtility->Close();
+    }
+
+    if ( iGenericParamList )
+    {
+        iGenericParamList->Reset();
+        delete iGenericParamList;
+    }
+
+    iExpectedEventArray->ResetAndDestroy();
+
+    delete iTimeoutController;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayer_AppUiEngineTester::ConstructL
+// -------------------------------------------------------------------------------------------------
+//
+void CMpxVideoPlayer_AppUiEngineTester::ConstructL()
+{
+    iExpectedEventArray = new (ELeave) CArrayPtrFlat<TCallbackEvent>( 1 );
+
+    iViewUtility = MMPXViewUtility::UtilityL();
+    static_cast<CMPXViewUtility*>(iViewUtility)->AddStifObserverL( this );
+
+    iPlaybackUtility = MMPXPlaybackUtility::UtilityL( EMPXCategoryVideo, KPbModeNewPlayer );
+    static_cast<CMPXPlaybackUtility*>(iPlaybackUtility)->AddStifObserverL( this );
+    iPlaybackUtility->CommandL( EPbCmdSetAutoResume, EFalse );
+
+    iCollectionUtility = CMPXCollectionUtility::NewL( KNullUid, NULL );
+    iCollectionUtility->AddStifObserverL( this );
+}
+
+// -----------------------------------------------------------------------------
+// CMpxVideoPlayer_AppUiEngineTester::CMpxVideoPlayer_AppUiEngineTester
+//
+// -----------------------------------------------------------------------------
+//
+CMpxVideoPlayer_AppUiEngineTester::CMpxVideoPlayer_AppUiEngineTester( CScriptBase* aScriptBase )
+    : iScriptBase( aScriptBase )
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayer_AppUiEngineTester::CreateEngineL
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMpxVideoPlayer_AppUiEngineTester::CreateEngineL( CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayer_AppUiEngineTester::CreateEngineL()"));
+
+    TBool embedded;
+
+    User::LeaveIfError( aItem.GetNextInt( embedded ) );
+
+    iAppUi = new (ELeave) CMpxVideoPlayerAppUi( embedded, this );
+
+    iAppUiEngine = CMpxVideoPlayerAppUiEngine::NewL( iAppUi );
+
+    return KErrNone;
+}
+
+TInt CMpxVideoPlayer_AppUiEngineTester::CreateGenericParametersTerminateL()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayer_AppUiEngineTester::CreateGenericParametersTerminateL()"));
+
+    if ( iGenericParamList )
+    {
+        iGenericParamList->Reset();
+        delete iGenericParamList;
+    }
+
+    iGenericParamList = CAiwGenericParamList::NewL();
+
+    TAiwVariant paramTerminate( ETrue );
+    TAiwGenericParam genericParam( EGenericParamTerminate, paramTerminate );
+    iGenericParamList->AppendL( genericParam );
+
+    TCallbackEvent* event = new (ELeave) TCallbackEvent;
+    event->iEvent = EAppUiCmdExit;
+    AddExpectedEvent( event );
+
+    return KErrNone;
+}
+
+void CMpxVideoPlayer_AppUiEngineTester::AddLocalFileCallbacksL( TDesC& aFileName,
+                                                                TBool aUseFileHandle )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayer_AppUiEngineTester::AddLocalFileCallbacksL()"));
+
+    TCallbackEvent* event = new (ELeave) TCallbackEvent;
+    event->iEvent = EViewUtilityPreLoadView;
+    event->iUid   = KVideoPlaybackViewUid;
+    AddExpectedEvent( event );
+
+    event = new (ELeave) TCallbackEvent;
+    event->iFileName = aFileName;
+
+    if ( aUseFileHandle )
+    {
+        event->iEvent = EPlaybackUtilityInitFileHandle;
+    }
+    else
+    {
+        event->iEvent = EPlaybackUtilityInitFileName;
+        event->iFileName = aFileName;
+    }
+
+    AddExpectedEvent( event );
+}
+
+void CMpxVideoPlayer_AppUiEngineTester::AddCollectionMediaCallbacksL( TDesC& aFileName )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayer_AppUiEngineTester::AddCollectionMediaCallbacksL()"));
+
+    TCallbackEvent* event = new (ELeave) TCallbackEvent;
+    event->iEvent = EViewUtilityPreLoadView;
+    event->iUid   = KVideoPlaybackViewUid;
+    AddExpectedEvent( event );
+
+    event = new (ELeave) TCallbackEvent;
+    event->iEvent = EPlaybackUtilityInitFileName;
+    event->iFileName = aFileName;
+
+    AddExpectedEvent( event );
+}
+
+void CMpxVideoPlayer_AppUiEngineTester::AddSdpFileCallbacksL( TDesC& aFileName,
+                                                              TBool aUseFileHandle,
+                                                              CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayer_AppUiEngineTester::AddSdpFileCallbacksL()"));
+
+    TInt expectedApId;
+
+    User::LeaveIfError( aItem.GetNextInt( expectedApId ) );
+
+    //
+    //  We should get 1 callback
+    //  iPlaybackUtility->InitStreamingL( iFile / aUri )
+    //
+    TCallbackEvent* event = new (ELeave) TCallbackEvent;
+
+        event->iFileName = aFileName;
+        event->iApId     = expectedApId;
+
+    if ( aUseFileHandle )
+    {
+        event->iEvent = EPlaybackUtilityInitStreamingFileHandle;
+    }
+    else
+    {
+        event->iEvent = EPlaybackUtilityInitStreamingUrl;
+    }
+
+    AddExpectedEvent( event );
+}
+
+void CMpxVideoPlayer_AppUiEngineTester::AddRamFileCallbacksL( TDesC& /*aFileName*/,
+                                                              TBool /*aUseFileHandle*/,
+                                                              CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayer_AppUiEngineTester::AddRamFileCallbacksL()"));
+
+    _LIT( KRamStreamingLink, "rtsp://stream.3gp" );
+
+#ifdef __WINSCW__
+    _LIT( KRamLocalLink, "c:\\data\\videos\\local.3gp" );
+#else
+    _LIT( KRamLocalLink, "f:\\testing\\data\\local.3gp" );
+#endif
+
+    TInt  expectedApId;
+    TBool streamLinksExist;
+
+    User::LeaveIfError( aItem.GetNextInt( expectedApId ) );
+    User::LeaveIfError( aItem.GetNextInt( streamLinksExist ) );
+
+    //
+    //  We should get 1 callback
+    //  iPlaybackUtility->InitStreamingL( iFile );
+    //
+    TCallbackEvent* event = new (ELeave) TCallbackEvent;
+
+    if ( streamLinksExist )
+    {
+        event->iEvent    = EPlaybackUtilityInitStreamingUrl;
+        event->iFileName = KRamStreamingLink;
+        event->iApId     = expectedApId;
+    }
+    else
+    {
+        event->iEvent    = EPlaybackUtilityInitFileName;
+        event->iFileName = KRamLocalLink;
+    }
+
+    event->iApId     = expectedApId;
+
+    AddExpectedEvent( event );
+}
+
+void CMpxVideoPlayer_AppUiEngineTester::AddAsxFileCallbacksL( TDesC& /*aFileName*/,
+                                                              TBool /*aUseFileHandle*/,
+                                                              CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayer_AppUiEngineTester::AddRamFileCallbacksL()"));
+
+    _LIT( KAsxStreamingLink, "http://10.48.2.56:443/stream.wmv" );
+
+#ifdef __WINSCW__
+    _LIT( KAsxLocalLink, "c:\\data\\videos\\local.3gp" );
+#else
+    _LIT( KAsxLocalLink, "f:\\testing\\data\\local.3gp" );
+#endif
+
+    TInt  expectedApId;
+    TBool streamLinksExist;
+
+    User::LeaveIfError( aItem.GetNextInt( expectedApId ) );
+    User::LeaveIfError( aItem.GetNextInt( streamLinksExist ) );
+
+    //
+    //  We should get 1 callback
+    //  iPlaybackUtility->InitStreamingL( iFile );
+    //
+    TCallbackEvent* event = new (ELeave) TCallbackEvent;
+
+    if ( streamLinksExist )
+    {
+        event->iEvent    = EPlaybackUtilityInitStreamingUrl;
+        event->iFileName = KAsxStreamingLink;
+        event->iApId     = expectedApId;
+    }
+    else
+    {
+        event->iEvent    = EPlaybackUtilityInitFileName;
+        event->iFileName = KAsxLocalLink;
+    }
+
+    event->iApId     = expectedApId;
+
+    AddExpectedEvent( event );
+}
+
+void CMpxVideoPlayer_AppUiEngineTester::AddUrlCallbacksL( TDesC& aFileName,
+                                                          CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayer_AppUiEngineTester::AddUrlCallbacksL()"));
+
+
+    TInt expectedApId;
+
+    User::LeaveIfError( aItem.GetNextInt( expectedApId ) );
+
+    //
+    //  We should get 1 callback
+    //  iPlaybackUtility->InitStreamingL( aUri )
+    //
+    TCallbackEvent* event = new (ELeave) TCallbackEvent;
+
+    event->iEvent    = EPlaybackUtilityInitStreamingUrl;
+    event->iFileName = aFileName;
+    event->iApId     = expectedApId;
+
+    AddExpectedEvent( event );
+}
+
+TInt CMpxVideoPlayer_AppUiEngineTester::OpenFileL( CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayer_AppUiEngineTester::OpenFileL()"));
+
+    iError = KErrNone;
+
+    TBool useFileHandle;
+    TInt fileType;
+
+    User::LeaveIfError( aItem.GetNextInt( useFileHandle ) );
+
+    TFileName filename = GetFileNameAndPathL( aItem );
+
+    User::LeaveIfError( aItem.GetNextInt( fileType ) );
+
+    //
+    //  Add Callbacks
+    //
+    switch ( fileType )
+    {
+        case ELocalFile:
+        {
+            AddLocalFileCallbacksL( filename, useFileHandle );
+            break;
+        }
+        case ESdpFile:
+        {
+            AddSdpFileCallbacksL( filename, useFileHandle, aItem );
+            break;
+        }
+        case ERamFile:
+        {
+            AddRamFileCallbacksL( filename, useFileHandle, aItem );
+            break;
+        }
+        case EUrl:
+        {
+            AddUrlCallbacksL( filename, aItem );
+            break;
+        }
+        case EAsxFile:
+        {
+            AddAsxFileCallbacksL( filename, useFileHandle, aItem );
+            break;
+        }
+        case EMultiLinkFile:
+        default:
+            break;
+    }
+
+    if ( useFileHandle )
+    {
+        RFs fs;
+        RFile file;
+
+        User::LeaveIfError( fs.Connect() );
+
+        fs.ShareProtected();
+
+        User::LeaveIfError( file.Open( fs, filename, EFileRead ) );
+
+        MPX_TRAPD( trapErr, iAppUiEngine->OpenFileL( file, iGenericParamList ) );
+
+        if ( trapErr != KErrNone )
+        {
+            TCallbackEvent* event = new (ELeave) TCallbackEvent;
+
+            //
+            //  When the apId is negative, an error code will be return with a Leave
+            //
+            event->iEvent = EFunctionLeave;
+            event->iExtra = trapErr;
+
+            HandleUtilityEvent( event );
+        }
+
+        file.Close();
+        fs.Close();
+    }
+    else
+    {
+        iAppUiEngine->OpenFileL( filename );
+    }
+
+    EndTest();
+
+    return iError;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayer_AppUiEngineTester::OpenMediaL
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMpxVideoPlayer_AppUiEngineTester::OpenMediaL( CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayer_AppUiEngineTester::OpenMediaL()"));
+
+    iError = KErrNone;
+
+    CMPXMedia* media = CMPXMedia::NewL();
+    CleanupStack::PushL( media );
+    TFileName filename = GetFileNameAndPathL( aItem );
+
+    media->SetTextValueL( KMPXMediaGeneralUri, filename );
+
+    media->SetTObjectValueL( KMPXMediaGeneralId, TMPXItemId( 1, 2 ) );
+
+    RFs fs;
+    User::LeaveIfError( fs.Connect() );
+
+    CleanupClosePushL( fs );
+
+    if ( BaflUtils::FileExists( fs, filename ) )
+        {
+        TCallbackEvent* event1 = new (ELeave) TCallbackEvent;
+        event1->iEvent = EViewUtilityPreLoadView;
+        event1->iUid   = KVideoPlaybackViewUid;
+        AddExpectedEvent( event1 );
+
+        TCallbackEvent* event2 = new (ELeave) TCallbackEvent;
+        event2->iEvent = EPlaybackUtilityInitPlaylist;
+        AddExpectedEvent( event2 );
+        }
+
+    CleanupStack::PopAndDestroy( &fs );
+
+    iAppUiEngine->OpenMediaL( *media );
+
+    CleanupStack::PopAndDestroy( media );
+
+    EndTest();
+
+    return iError;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayer_AppUiEngineTester::SetGenericParamAccessPointL
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMpxVideoPlayer_AppUiEngineTester::SetGenericParamAccessPointL( CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayer_AppUiEngineTester::SetGenericParamAccessPointL()"));
+
+    TInt apId;
+
+    //
+    //  Read in the filename from the config file
+    //
+    User::LeaveIfError( aItem.GetNextInt( apId ) );
+
+    if ( iGenericParamList )
+    {
+        iGenericParamList->Reset();
+        delete iGenericParamList;
+    }
+
+    iGenericParamList = CAiwGenericParamList::NewL();
+
+    TAiwVariant apVariant( apId );
+    TAiwGenericParam genericParam( EGenericParamAccessPoint, apVariant );
+    iGenericParamList->AppendL( genericParam );
+
+    return KErrNone;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayer_AppUiEngineTester::OpenFileEmbeddedPdlL
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMpxVideoPlayer_AppUiEngineTester::OpenFileEmbeddedPdlL( CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayer_AppUiEngineTester::OpenFileEmbeddedPdlL()"));
+
+    iError = KErrNone;
+
+    TInt downloadID;
+
+    User::LeaveIfError( aItem.GetNextInt( downloadID ) );
+
+    TFileName filename = GetFileNameAndPathL( aItem );
+
+    CreateEmbeddedPdlGenericParametersL( downloadID, filename );
+
+    if ( KErrNone == iError )
+    {
+        RFs fs;
+        RFile file;
+
+        User::LeaveIfError( fs.Connect() );
+
+        fs.ShareProtected();
+
+        User::LeaveIfError( file.Open( fs, filename, EFileRead ) );
+
+        AddEmbeddedPdlCallbacksL( downloadID, filename );
+
+        iAppUiEngine->OpenFileL( file, iGenericParamList );
+
+        file.Close();
+        fs.Close();
+    }
+
+    EndTest();
+
+    return iError;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayer_AppUiEngineTester::CreateEmbeddedPdlGenericParametersL
+// -------------------------------------------------------------------------------------------------
+//
+void
+CMpxVideoPlayer_AppUiEngineTester::CreateEmbeddedPdlGenericParametersL( TInt aDownloadId,
+                                                                        TDesC& aFileName )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayer_AppUiEngineTester::CreateEmbeddedPdlGenericParametersL()"));
+
+    if ( iGenericParamList )
+    {
+        iGenericParamList->Reset();
+        delete iGenericParamList;
+    }
+
+    iGenericParamList = CAiwGenericParamList::NewL();
+
+    TAiwVariant downloadIdVariant( aDownloadId );
+    TAiwGenericParam genericParam( EGenericParamDownloadId, downloadIdVariant );
+    iGenericParamList->AppendL( genericParam );
+
+
+    TAiwVariant fileNameVariant( aFileName );
+    TAiwGenericParam genericParam2( EGenericParamFile, fileNameVariant );
+    iGenericParamList->AppendL( genericParam2 );
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayer_AppUiEngineTester::AddEmbeddedPdlCallbacksL
+// -------------------------------------------------------------------------------------------------
+//
+void CMpxVideoPlayer_AppUiEngineTester::AddEmbeddedPdlCallbacksL( TInt aDownloadId,
+                                                                  TDesC& aFileName )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayer_AppUiEngineTester::AddEmbeddedPdlCallbacksL()"));
+
+    //
+    //  We should get 4 callbacks
+    //  iViewUtility->PreLoadViewL( PDL View Uid )
+    //  iPlaybackUtility->CommandL( EPbCmdStartPd );
+    //  iPlaybackUtility->InitL( iFileName );
+    //
+    TCallbackEvent* event = new (ELeave) TCallbackEvent;
+    event->iEvent = EViewUtilityPreLoadView;
+    event->iUid   = KVideoPdlPlaybackViewUid;
+    AddExpectedEvent( event );
+
+    event = new (ELeave) TCallbackEvent;
+    event->iEvent      = EPlaybackUtilityStartPdl;
+    event->iDownloadId = aDownloadId;
+    event->iFileName   = aFileName;
+    event->iExtra      = ETrue;
+    AddExpectedEvent( event );
+
+    event = new (ELeave) TCallbackEvent;
+    event->iEvent    = EPlaybackUtilityInitFileName;
+    event->iFileName = aFileName;
+    AddExpectedEvent( event );
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayer_AppUiEngineTester::AddMessagePdlCallbacksL
+// -------------------------------------------------------------------------------------------------
+//
+void CMpxVideoPlayer_AppUiEngineTester::AddMessagePdlCallbacksL( TInt aNewFile,
+                                                                 TInt aDownloadId,
+                                                                 TDesC& aFileName )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayer_AppUiEngineTester::AddMessagePdlCallbacksL()"));
+
+    //
+    //  We should the following callbacks
+    //  iPlaybackUtility->CommandL( EPdCmdClose )
+    //  iViewUtility->PreLoadViewL( PDL View Uid )
+    //  iPlaybackUtility->CommandL( EPbCmdStartPd );
+    //  iPlaybackUtility->InitL( iFileName );
+    //
+
+    TCallbackEvent* event;
+
+    if ( aNewFile == 1 )
+    {
+        event = new (ELeave) TCallbackEvent;
+        event->iEvent = EPlaybackUtilityClose;
+        AddExpectedEvent( event );
+    }
+
+    event = new (ELeave) TCallbackEvent;
+    event->iEvent = EViewUtilityPreLoadView;
+    event->iUid   = KVideoPdlPlaybackViewUid;
+    AddExpectedEvent( event );
+
+    event = new (ELeave) TCallbackEvent;
+    event->iEvent      = EPlaybackUtilityStartPdl;
+    event->iDownloadId = aDownloadId;
+    event->iFileName   = aFileName;
+    event->iExtra      = ETrue;
+    AddExpectedEvent( event );
+
+    event = new (ELeave) TCallbackEvent;
+    event->iEvent    = EPlaybackUtilityInitFileName;
+    event->iFileName = aFileName;
+    AddExpectedEvent( event );
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayer_AppUiEngineTester::HandleMessageEmbeddedPdlL
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMpxVideoPlayer_AppUiEngineTester::HandleMessageEmbeddedPdlL( CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayer_AppUiEngineTester::HandleMessageEmbeddedPdlL()"));
+
+    TInt newFile;
+    User::LeaveIfError( aItem.GetNextInt( newFile ) );
+
+    if ( newFile )
+    {
+        TInt downloadID;
+
+        User::LeaveIfError( aItem.GetNextInt( downloadID ) );
+        TFileName filename = GetFileNameAndPathL( aItem );
+
+        CreateEmbeddedPdlGenericParametersL( downloadID, filename );
+
+        AddMessagePdlCallbacksL( newFile, downloadID, filename );
+    }
+    else
+    {
+        TCallbackEvent* event = new (ELeave) TCallbackEvent;
+        event->iEvent      = EPlaybackUtilityPlayCmd;
+        AddExpectedEvent( event );
+    }
+
+    HBufC8* param8 = HBufC8::NewLC( 1024 );
+    TPtr8 paramPtr8 = param8->Des();
+    RDesWriteStream writeStream( paramPtr8 );
+
+    iGenericParamList->ExternalizeL( writeStream );
+
+    writeStream.CommitL();
+    writeStream.Close();
+
+    iAppUiEngine->HandleMessageL( TUid::Uid(KVideoPlayerStartPDlPlayer), paramPtr8 );
+
+    CleanupStack::PopAndDestroy();
+
+    EndTest();
+
+    return iError;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayer_AppUiEngineTester::HandleMessageActivationMessageL
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMpxVideoPlayer_AppUiEngineTester::HandleMessageActivationMessageL( CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayer_AppUiEngineTester::HandleMessageActivationMessageL()"));
+
+    TInt msgSender;
+    TInt msgType;
+    TBool playbackView;
+
+    User::LeaveIfError( aItem.GetNextInt( msgSender ) );
+    User::LeaveIfError( aItem.GetNextInt( msgType ) );
+    User::LeaveIfError( aItem.GetNextInt( playbackView ) );
+
+    TVideoPlayerActivationMessage params;
+    params.iMsgType   = (TVideoPlayerActivationMessage::TMessageType)msgType;
+    params.iMsgSender = (TVideoPlayerActivationMessage::TMessageSender)msgSender;
+
+    TPckg<TVideoPlayerActivationMessage> paramsPckg( params );
+
+    if ( msgSender == EMatrix )
+    {
+        if ( playbackView )
+  	  	{
+  	  	    static_cast<CMPXViewUtility*>
+  	  	  	    (iViewUtility)->PreLoadViewL( TUid::Uid(KMPXPLAYBACKPLUGINTYPEUID) );
+        }
+  	  	else
+  	  	{
+            TCallbackEvent* event = new TCallbackEvent;
+            event->iEvent = EViewUtilityActivateViewUid;
+            event->iUid   = TUid::Uid( KUidMyVideosViewTypeId );
+
+            AddExpectedEvent( event );
+        }
+
+        if ( ! iAppUiEngine->HandleMessageL( TUid::Uid( KVideoPlayerVodStartPlayer ), paramsPckg ) )
+        {
+            iError = -1;
+        }
+    }
+    else
+    {
+        if ( iAppUiEngine->HandleMessageL( TUid::Uid( 0xBADCAFE ), paramsPckg ) )
+        {
+            iError = -1;
+        }
+    }
+
+    EndTest();
+
+    return iError;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayer_AppUiEngineTester::ClearPdlInformation
+// -------------------------------------------------------------------------------------------------
+//
+void CMpxVideoPlayer_AppUiEngineTester::ClearPdlInformation()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayer_AppUiEngineTester::ClearPdlInformation()"));
+
+    iAppUiEngine->ClearPdlInformation();
+    EndTest();
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayer_AppUiEngineTester::CreateMpxMessageLC
+// -------------------------------------------------------------------------------------------------
+//
+CMPXMessage*
+CMpxVideoPlayer_AppUiEngineTester::CreateMpxMessageLC( TInt aEvent, TInt aType, TInt aData )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayer_AppUiEngineTester::CreateMpxMessageLC()"),
+                   _L("aEvent = %d, aType = %d, aData = %d"), aEvent, aType, aData );
+
+    CMPXMessage* pbMessage = CMPXMessage::NewL();
+    CleanupStack::PushL( pbMessage );
+
+    pbMessage->SetTObjectValueL<TMPXMessageId>( KMPXMessageGeneralId, KMPXMessageGeneral );
+    pbMessage->SetTObjectValueL<TInt>( KMPXMessageGeneralEvent, aEvent );
+    pbMessage->SetTObjectValueL<TInt>( KMPXMessageGeneralType, aType );
+    pbMessage->SetTObjectValueL<TInt>( KMPXMessageGeneralData, aData );
+
+    return pbMessage;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayer_AppUiEngineTester::StartStandAloneL
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMpxVideoPlayer_AppUiEngineTester::StartStandAloneL( CStifItemParser& /*aItem*/ )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayer_AppUiEngineTester::StartStandAloneL()"));
+
+    TCallbackEvent* event = new (ELeave) TCallbackEvent;
+    event->iEvent = EViewUtilitySetAsDefaultView;
+    event->iUid   = KUidMyVideosViewType;
+    AddExpectedEvent( event );
+
+    iAppUiEngine->StartStandAloneL();
+
+    EndTest();
+
+    return iError;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayer_AppUiEngineTester::HandleCollectionMessageL
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMpxVideoPlayer_AppUiEngineTester::HandleCollectionMessageL( CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayer_AppUiEngineTester::HandleCollectionMessageL()"));
+
+    TInt event;
+    TInt type;
+    TInt data;
+
+    User::LeaveIfError( aItem.GetNextInt( event ) );
+    User::LeaveIfError( aItem.GetNextInt( type ) );
+    User::LeaveIfError( aItem.GetNextInt( data ) );
+
+    //
+    //  Add callback event
+    //
+    TCallbackEvent* callback = new (ELeave) TCallbackEvent;
+
+    if (data)
+    {
+        callback->iEvent = EPlaybackUtilityInitPlaylist;
+    }
+    else
+    {
+        callback->iEvent = ECollectionUtilityMedia;
+    }
+
+    AddExpectedEvent( callback );
+
+    CMPXMessage* collectionMessage = CreateMpxMessageLC( event, type, data );
+
+    iAppUiEngine->HandleCollectionMessage( collectionMessage, KErrNone );
+
+    CleanupStack::PopAndDestroy( collectionMessage );
+
+    EndTest();
+
+    return iError;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayer_AppUiEngineTester::AddCollectionMediaPdlCallbacksL
+// -------------------------------------------------------------------------------------------------
+//
+void CMpxVideoPlayer_AppUiEngineTester::AddCollectionMediaPdlCallbacksL( TInt aDownloadId,
+                                                                         TDesC& aFileName )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayer_AppUiEngineTester::AddCollectionMediaPdlCallbacksL()"));
+
+    //
+    //  We should the following callbacks
+    //  iViewUtility->PreLoadViewL( PDL View Uid )
+    //  iPlaybackUtility->CommandL( EPbCmdStartPd );
+    //  iPlaybackUtility->InitL( iFileName );
+    //
+
+    TCallbackEvent* event;
+
+    event = new (ELeave) TCallbackEvent;
+    event->iEvent = EViewUtilityPreLoadView;
+    event->iUid   = KVideoPdlPlaybackViewUid;
+    AddExpectedEvent( event );
+
+    event = new (ELeave) TCallbackEvent;
+    event->iEvent      = EPlaybackUtilityStartPdl;
+    event->iDownloadId = aDownloadId;
+    event->iFileName   = aFileName;
+    event->iExtra      = EFalse;
+    AddExpectedEvent( event );
+
+    event = new (ELeave) TCallbackEvent;
+    event->iEvent    = EPlaybackUtilityInitFileName;
+    event->iFileName = aFileName;
+    AddExpectedEvent( event );
+}
+
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayer_AppUiEngineTester::HandleCollectionMediaL
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMpxVideoPlayer_AppUiEngineTester::HandleCollectionMediaL( CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayer_AppUiEngineTester::HandleCollectionMediaL()"));
+
+    TFileName filename = GetFileNameAndPathL( aItem );
+
+    TInt downloadId;
+
+    TInt pdlTestCase = aItem.GetNextInt( downloadId );
+
+    CMPXMedia* media = CMPXMedia::NewL();
+    CleanupStack::PushL( media );
+
+    media->SetTObjectValueL<TMPXMessageId>( KMPXMessageGeneralId, KMPXMessageGeneral );
+    media->SetTextValueL( KMPXMediaGeneralUri, filename );
+
+    if ( pdlTestCase == KErrNone )
+    {
+        AddCollectionMediaPdlCallbacksL( downloadId, filename );
+
+        media->SetTObjectValueL<TUint32>( KVcxMediaMyVideosDownloadId, downloadId );
+    }
+    else
+    {
+        //
+        //  Add callback event
+        //
+        AddCollectionMediaCallbacksL( filename );
+    }
+
+
+    iAppUiEngine->HandleCollectionMediaL( *media, KErrNone );
+
+    CleanupStack::PopAndDestroy( media );
+
+    EndTest();
+
+    return iError;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayer_AppUiEngineTester::HandleSoftkeyBackL
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMpxVideoPlayer_AppUiEngineTester::HandleSoftkeyBackL( CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayer_AppUiEngineTester::HandleSoftkeyBackL()"));
+
+    TInt viewDepth;
+
+    User::LeaveIfError( aItem.GetNextInt( viewDepth ) );
+
+    static_cast<CMPXViewUtility*>(iViewUtility)->SetViewHistoryDepth( viewDepth );
+
+    if ( viewDepth > 1 )
+    {
+        TCallbackEvent* event = new (ELeave) TCallbackEvent;
+        event->iEvent = ECollectionUtilityOpen;
+        AddExpectedEvent( event );
+
+        event = new TCallbackEvent;
+        event->iEvent = EViewUtilityActivatePreviousView;
+        AddExpectedEvent( event );
+    }
+    else
+    {
+        TCallbackEvent* event = new (ELeave) TCallbackEvent;
+        event->iEvent = EAppUiCmdExit;
+        AddExpectedEvent( event );
+
+        iTimeoutController = CSimpleTimeout::NewL( this );
+
+        iTimeoutController->Start( TTimeIntervalMicroSeconds(1000000) );
+    }
+
+    iAppUiEngine->HandleSoftKeyBackL();
+
+    EndTest();
+
+    return iError;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayer_AppUiEngineTester::HandleOpenPlaylistL
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMpxVideoPlayer_AppUiEngineTester::HandleOpenPlaylistL( CStifItemParser& /*aItem*/ )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayer_AppUiEngineTester::HandleOpenPlaylistL()"));
+
+    TCallbackEvent* event = new TCallbackEvent;
+    event->iEvent = EPlaybackUtilityInitPlaylist;
+    AddExpectedEvent( event );
+
+    CMPXCollectionPath* path = iCollectionUtility->Collection().PathL();
+    CMPXCollectionPlaylist* playlist = CMPXCollectionPlaylist::NewL( *path );
+    CleanupStack::PushL( playlist );
+
+    iAppUiEngine->HandleOpenL( *playlist, KErrNone );
+
+    CleanupStack::PopAndDestroy( playlist );
+
+    EndTest();
+
+    return iError;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayer_AppUiEngineTester::HandleOpenMediaL
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMpxVideoPlayer_AppUiEngineTester::HandleOpenMediaL( CStifItemParser& /*aItem*/ )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayer_AppUiEngineTester::HandleOpenPlaylistL()"));
+
+    TCallbackEvent* event = new TCallbackEvent;
+    event->iEvent = ECollectionUtilityOpen;
+    AddExpectedEvent( event );
+
+    CMPXMedia* media = CMPXMedia::NewL();
+    CleanupStack::PushL( media );
+
+    iAppUiEngine->HandleOpenL( *media, 0, ETrue, KErrGeneral );
+
+    CleanupStack::PopAndDestroy( media );
+
+    EndTest();
+
+    return iError;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayer_AppUiEngineTester::HandleViewActivation
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMpxVideoPlayer_AppUiEngineTester::HandleViewActivation( CStifItemParser& /*aItem*/ )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayer_AppUiEngineTester::HandleViewActivation()"));
+
+    iAppUiEngine->HandleViewActivation( KNullUid, KNullUid );
+
+    return KErrNone;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayer_AppUiEngineTester::GetViewDepthL
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMpxVideoPlayer_AppUiEngineTester::GetViewDepthL( CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayer_AppUiEngineTester::GetViewDepthL()"));
+
+    TInt viewDepth;
+    TInt error = KErrNone;
+
+    User::LeaveIfError( aItem.GetNextInt( viewDepth ) );
+
+    static_cast<CMPXViewUtility*>(iViewUtility)->SetViewHistoryDepth( viewDepth );
+
+    if ( viewDepth != iAppUiEngine->ViewHistoryDepth() )
+    {
+        error = KErrGeneral;
+    }
+
+    return error;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayer_AppUiEngineTester::ProcessCommandParametersL
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMpxVideoPlayer_AppUiEngineTester::ProcessCommandParametersL( CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayer_AppUiEngineTester::ProcessCommandParametersL()"));
+
+    TInt fileExists = EFalse;
+
+    TInt cmdId;
+    TFileName filename;
+    TPtrC8 tail;
+
+    User::LeaveIfError( aItem.GetNextInt( cmdId ) );
+
+    switch ( cmdId )
+    {
+        case EProcessStandAlone:
+        {
+            TCallbackEvent* event = new (ELeave) TCallbackEvent;
+            event->iEvent = EViewUtilitySetAsDefaultView;
+            event->iUid   = KUidMyVideosViewType;
+            AddExpectedEvent( event );
+
+            break;
+        }
+        case EProcessFile:
+        {
+            TFileName file = GetFileNameAndPathL( aItem );
+            User::LeaveIfError( aItem.GetNextInt( fileExists ) );
+
+            filename = file;
+            break;
+        }
+    }
+
+    TBool retVal = iAppUiEngine->ProcessCommandParametersL( (TApaCommand)cmdId, filename, tail );
+
+    if ( iError == KErrNone && retVal != fileExists )
+    {
+        iError = KErrArgument;
+    }
+
+    EndTest();
+
+    return iError;
+}
+
+void
+CMpxVideoPlayer_AppUiEngineTester::AddExpectedEvent( TCallbackEvent* aEvent )
+{
+    MPX_DEBUG(_L("CMpxVideoPlayer_AppUiEngineTester::AddExpectedEvent()"));
+
+    iExpectedEventArray->AppendL( aEvent );
+}
+
+void
+CMpxVideoPlayer_AppUiEngineTester::HandleUtilityEvent( TCallbackEvent* aEvent )
+{
+    MPX_DEBUG(_L("CMpxVideoPlayer_AppUiEngineTester::HandleUtilityEvent()"));
+
+    if ( iExpectedEventArray->Count() > 0 )
+    {
+        TCallbackEvent* expectedCallback = (*iExpectedEventArray)[0];
+
+        MPX_DEBUG(_L("CMpxVideoPlayer_AppUiEngineTester::ProcessEvent(%d) Expected(%d)"),
+            aEvent->iEvent, expectedCallback->iEvent);
+
+        if ( expectedCallback->iEvent == aEvent->iEvent )
+        {
+            //
+            //  Pop the event from the array
+            //
+            iExpectedEventArray->Delete( 0 );
+
+            switch ( aEvent->iEvent )
+            {
+                case EViewUtilityPreLoadView:
+                case EViewUtilityActivateViewUid:
+                {
+                    if ( expectedCallback->iUid == aEvent->iUid )
+                    {
+                        MPX_DEBUG(_L("Proper callback received"));
+                    }
+                    else
+                    {
+                        MPX_DEBUG(_L("Proper callback not received"));
+                        iError = KErrArgument;
+                    }
+
+                    break;
+                }
+                case EPlaybackUtilityInitFileHandle:
+                case EPlaybackUtilityInitFileName:
+                {
+                    if ( ! expectedCallback->iFileName.CompareF( aEvent->iFileName ) )
+                    {
+                        MPX_DEBUG(_L("Proper callback received"));
+                    }
+                    else
+                    {
+                        MPX_DEBUG(_L("Proper callback not received"));
+                        iError = KErrArgument;
+                    }
+
+                    break;
+                }
+                case EPlaybackUtilityInitStreamingFileHandle:
+                case EPlaybackUtilityInitStreamingUrl:
+                {
+                    if ( ! expectedCallback->iFileName.CompareF( aEvent->iFileName ) &&
+                         ( expectedCallback->iApId == aEvent->iApId ) )
+                    {
+                        MPX_DEBUG(_L("Proper callback received"));
+                    }
+                    else
+                    {
+                        MPX_DEBUG(_L("Proper callback not received"));
+                        iError = KErrArgument;
+                    }
+
+                    break;
+                }
+                case EAppUiCmdExit:
+                {
+                    MPX_DEBUG(_L("Proper callback received"));
+
+                    //
+                    //  Clear other events since terminate message was received
+                    //
+                    iExpectedEventArray->ResetAndDestroy();
+                    
+                    if( iActiveWait && iActiveWait->IsStarted() )
+                        {
+                        iActiveWait->AsyncStop();
+                        }
+
+                    break;
+                }
+                case EPlaybackUtilityStartPdl:
+                {
+                    if ( ( expectedCallback->iDownloadId == aEvent->iDownloadId ) &&
+                         ( ! expectedCallback->iFileName.CompareF( aEvent->iFileName ) ) &&
+                         ( expectedCallback->iExtra == aEvent->iExtra ) )
+                    {
+                        MPX_DEBUG(_L("Proper callback received"));
+                    }
+                    else
+                    {
+                        MPX_DEBUG(_L("Proper callback not received"));
+                        iError = KErrArgument;
+                    }
+
+                    break;
+                }
+                case EAsxAttributeSeekUpdate:
+                {
+                    if ( expectedCallback->iExtra == aEvent->iExtra )
+                    {
+                        MPX_DEBUG(_L("Proper callback received"));
+                    }
+                    else
+                    {
+                        MPX_DEBUG(_L("Proper callback not received"));
+                        iError = KErrArgument;
+                    }
+
+                    break;
+                }
+                case EFunctionLeave:
+                {
+                    MPX_DEBUG(_L("expected->iExtra %d, aEvent->iExtra %d"),
+                        expectedCallback->iExtra, aEvent->iExtra );
+
+                    if ( expectedCallback->iExtra == aEvent->iExtra )
+                    {
+                        MPX_DEBUG(_L("Proper callback received"));
+                    }
+                    else
+                    {
+                        MPX_DEBUG(_L("Proper callback not received"));
+                        iError = KErrArgument;
+                    }
+                    break;
+                }
+                case EPlaybackUtilityPdlInstance:
+                    {
+                    MPX_DEBUG(_L("CMpxVideoPlayer_AppUiEngineTester::HandleUtilityEvent() - EPlaybackUtilityPdlInstance"));
+                    if( iActiveWait && iActiveWait->IsStarted() )
+                        {
+                        iActiveWait->AsyncStop();
+                        }
+                    }
+                    break;
+                case EPlaybackUtilityDisableEffects:
+                    {
+                    iError = KErrNone;
+                    }
+                    break;
+            }
+
+            if ( iTimeoutController && iExpectedEventArray->Count() == 0 )
+            {
+                iTimeoutController->Cancel();
+                iScriptBase->Signal();
+            }
+        }
+    }
+
+    delete aEvent;
+}
+
+void
+CMpxVideoPlayer_AppUiEngineTester::EndTest()
+{
+    if ( ! iTimeoutController )
+    {
+        if ( iExpectedEventArray->Count() > 0 )
+        {
+            iError = KErrTimedOut;
+        }
+    }
+}
+
+void
+CMpxVideoPlayer_AppUiEngineTester::HandleTimeout( TInt aError )
+{
+    MPX_DEBUG(_L("CMpxVideoPlayer_AppUiEngineTester::HandleTimeout(%d)"), aError);
+
+    if ( aError == KErrNone )
+    {
+        iScriptBase->Signal( KErrTimedOut );
+    }
+    else
+    {
+        iScriptBase->Signal( aError );
+    }
+}
+
+TFileName
+CMpxVideoPlayer_AppUiEngineTester::GetFileNameAndPathL( CStifItemParser& aItem )
+{
+    MPX_DEBUG(_L("CMpxVideoPlayer_AppUiEngineTester::GetFileNameAndPathL()"));
+
+    TPtrC filename;
+    TBool addPath;
+
+#ifdef __WINSCW__
+    _LIT( KVideoTestPath, "c:\\data\\Videos\\" );
+#else
+    _LIT( KVideoTestPath, "f:\\testing\\data\\" );
+#endif
+
+    User::LeaveIfError( aItem.GetNextString( filename ) );
+    User::LeaveIfError( aItem.GetNextInt( addPath ) );
+
+    TFileName fullPath;
+
+    if ( addPath )
+    {
+        fullPath.Append( KVideoTestPath );
+    }
+
+    fullPath.Append( filename );
+
+    return fullPath;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayer_AppUiEngineTester::ClearPlaybackUtilityL
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMpxVideoPlayer_AppUiEngineTester::ClearPlaybackUtilityL( CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayer_AppUiEngineTester::ClearPlaybackUtilityL()"));
+
+    MMPXPlaybackUtility& utility = iAppUiEngine->PlaybackUtilityL();
+    
+    iAppUiEngine->ClearPlaybackUtility();
+    iAppUiEngine->ClearPlaybackUtility();
+    
+    return KErrNone;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayer_AppUiEngineTester::ActivateLateConstructTimerL
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMpxVideoPlayer_AppUiEngineTester::ActivateLateConstructTimerL( CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayer_AppUiEngineTester::ActivateLateConstructTimerL()"));
+    
+    TCallbackEvent* event = new (ELeave) TCallbackEvent;
+    event->iEvent = EPlaybackUtilityPdlInstance;    
+    AddExpectedEvent( event );
+    
+    if( !iActiveWait )
+        {
+        iActiveWait = new(ELeave)CActiveSchedulerWait();
+        }
+    
+    // What happens here:
+    // -Following call start 250ms timer
+    // -After time runs out it will create playback utility
+    // -In the end of playback utility we send message through
+    //  observers to HandleUtilityEvent where we release
+    //  CActiveSchedulerWait and complete this test with KErrNone
+    iAppUiEngine->ActivateLateConstructTimerL();
+    iAppUiEngine->ActivateLateConstructTimerL();
+
+    iActiveWait->Start();
+        
+    return KErrNone;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CMpxVideoPlayer_AppUiEngineTester::HandleEmbeddedOpenL
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMpxVideoPlayer_AppUiEngineTester::HandleEmbeddedOpenL( CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayer_AppUiEngineTester::HandleEmbeddedOpenL()"));
+    
+    // At beginning we call with error code (just for the coverage)
+    iAppUiEngine->HandleEmbeddedOpenL( KErrGeneral, EMPXVideo );
+    
+    // First call with KErrNone, this should end up in
+    // HandleUtilityEvent where we clear iError
+    iError = KErrGeneral;
+    TCallbackEvent* event = new (ELeave) TCallbackEvent;
+    event->iEvent = EPlaybackUtilityDisableEffects;    
+    AddExpectedEvent( event );
+    iAppUiEngine->HandleEmbeddedOpenL( KErrNone, EMPXVideo );
+    User::LeaveIfError( iError );
+    
+    // Second call will leave
+    if( !iActiveWait )
+        {
+        iActiveWait = new(ELeave)CActiveSchedulerWait();
+        }
+    iError = KErrGeneral;
+    event = new (ELeave) TCallbackEvent;
+    event->iEvent = EAppUiCmdExit;
+    AddExpectedEvent( event );
+    iAppUiEngine->HandleEmbeddedOpenL( KErrNone, EMPXVideo ) ;
+    
+    iActiveWait->Start();
+    
+    // Check if expected even was cleared
+    if( iExpectedEventArray->Count() == 0 )
+        {
+        iError = KErrNone;
+        }
+    
+    return iError;
+}
+
+// EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/src/mpxvideoplayerappui_stub.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,105 @@
+/*
+* 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:  mpxvideoplayerappui stub for STIF testing
+*
+*/
+
+// Version : %version: ou1cpsw#4 %
+
+
+#include <avkon.hrh>
+
+#include "mpxvideoplayer_appuienginetester.h"
+#include "mpxvideoplayerappui_stub.h"
+#include "mpxvideo_debug.h"
+
+
+// ======== MEMBER FUNCTIONS ========
+// -----------------------------------------------------------------------------
+// CMpxVideoPlayerAppUi::CMpxVideoPlayerAppUi
+// -----------------------------------------------------------------------------
+//
+CMpxVideoPlayerAppUi::CMpxVideoPlayerAppUi( TBool aEmbedded,
+                                            MAppUiEngineStifTestObserver* aObserver )
+    : iEmbedded( aEmbedded ),
+      iStifObserver( aObserver )
+{
+    MPX_DEBUG(_L("CMpxVideoPlayerAppUi::CMpxVideoPlayerAppUi(%d)"), aEmbedded);
+}
+
+// -----------------------------------------------------------------------------
+// CMpxVideoPlayerAppUi::~CMpxVideoPlayerAppUi
+// Destructor. Frees reserved resources
+// -----------------------------------------------------------------------------
+//
+CMpxVideoPlayerAppUi::~CMpxVideoPlayerAppUi()
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUi::~CMpxVideoPlayerAppUi()"));
+}
+
+// -----------------------------------------------------------------------------
+// CMpxVideoPlayerAppUi::HandleCommandL
+// -----------------------------------------------------------------------------
+//
+void CMpxVideoPlayerAppUi::HandleCommandL( TInt aCommand )
+{
+    MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUi::HandleCommandL()"),
+                   _L("aCommand = %d"), aCommand );
+
+    switch ( aCommand )
+    {
+        case EEikCmdExit: // fall through
+        case EAknCmdExit:
+        {
+            TCallbackEvent* event = new TCallbackEvent;
+
+            event->iEvent = EAppUiCmdExit;
+
+            iStifObserver->HandleUtilityEvent( event );
+
+            break;
+        }
+        case EAknSoftkeyBack:
+        {
+            break;
+        }
+        case EAknCmdHelp:
+        {
+            break;
+        }
+        default:
+        {
+            break;
+        }
+    }
+}
+
+// ---------------------------------------------------------------------------
+// Querying whether the application is launched in embedded mode or not.
+// ---------------------------------------------------------------------------
+//
+TBool CMpxVideoPlayerAppUi::IsEmbedded() const
+{
+    MPX_DEBUG(_L("CMpxVideoPlayerAppUi::IsEmbedded(%d)"), iEmbedded );
+
+    return iEmbedded;
+}
+
+// ---------------------------------------------------------------------------
+// Return active view.
+// ---------------------------------------------------------------------------
+CAknView* CMpxVideoPlayerAppUi::View()
+{
+    return NULL;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/src/mpxvideoplayeriadupdate_stub.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,72 @@
+/*
+* 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 <mpxviewutility.h>
+
+#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()
+    {
+    }
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/src/mpxvideoplayertest.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,153 @@
+/*
+* 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:  mpxvideoplayerappuiengine test class for STIF testing
+*
+*/
+
+// Version : %version: ou1cpsw#2 %
+
+
+// INCLUDE FILES
+#include <Stiftestinterface.h>
+#include <ecom.h>
+#include "mpxvideoplayertest.h"
+#include <SettingServerClient.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// Cmpxvideoplayertest::Cmpxvideoplayertest
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+Cmpxvideoplayer_test::Cmpxvideoplayer_test( CTestModuleIf& aTestModuleIf )
+    : CScriptBase( aTestModuleIf )
+{
+}
+
+// -----------------------------------------------------------------------------
+// Cmpxvideoplayer_test::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void Cmpxvideoplayer_test::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(Kmpxvideoplayer_testLogFileWithTitle, &title);
+    }
+    else
+    {
+        logFileName.Copy(Kmpxvideoplayer_testLogFile);
+    }
+
+    iLog = CStifLogger::NewL( Kmpxvideoplayer_testLogPath,
+                              logFileName,
+                              CStifLogger::ETxt,
+                              CStifLogger::EFile,
+                              EFalse );
+
+    SendTestClassVersion();
+}
+
+// -----------------------------------------------------------------------------
+// Cmpxvideoplayer_test::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+Cmpxvideoplayer_test* Cmpxvideoplayer_test::NewL( CTestModuleIf& aTestModuleIf )
+{
+    Cmpxvideoplayer_test* self = new (ELeave) Cmpxvideoplayer_test( aTestModuleIf );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+}
+
+// Destructor
+Cmpxvideoplayer_test::~Cmpxvideoplayer_test()
+{
+    // Delete resources allocated from test methods
+    Delete();
+
+    // Delete logger
+    delete iLog;
+
+    REComSession::FinalClose();
+}
+
+//-----------------------------------------------------------------------------
+// Cmpxvideoplayer_test::SendTestClassVersion
+// Method used to send version of test class
+//-----------------------------------------------------------------------------
+//
+void Cmpxvideoplayer_test::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("mpxvideoplayer_test.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* ) Cmpxvideoplayer_test::NewL( aTestModuleIf );
+}
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/src/mpxvideoplayertestblocks.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,277 @@
+/*
+* 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:  mpxvideoplayerappuiengine test class for STIF testing
+*
+*/
+
+// Version : %version: ou1cpsw#10.1.1 %
+
+// [INCLUDE FILES] - do not remove
+#include <e32svr.h>
+#include <StifParser.h>
+#include <Stiftestinterface.h>
+#include "mpxvideoplayertest.h"
+#include "mpxvideoplayer_appuienginetester.h"
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// Cmpxvideoplayer_test::Delete
+// Delete here all resources allocated and opened from test methods.
+// Called from destructor.
+// -----------------------------------------------------------------------------
+//
+void Cmpxvideoplayer_test::Delete()
+{
+    if ( iAppUiEngineTester )
+    {
+        delete iAppUiEngineTester;
+        iAppUiEngineTester = NULL;
+    }
+}
+
+// -----------------------------------------------------------------------------
+// Cmpxvideoplayer_test::RunMethodL
+// Run specified method. Contains also table of test mothods and their names.
+// -----------------------------------------------------------------------------
+//
+TInt Cmpxvideoplayer_test::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( "CreateEngine", Cmpxvideoplayer_test::CreateEngineL ),
+        ENTRY( "CreateGenericParametersTerminate", Cmpxvideoplayer_test::CreateGenericParametersTerminateL ),
+        ENTRY( "OpenFile", Cmpxvideoplayer_test::OpenFileL ),
+        ENTRY( "OpenMedia", Cmpxvideoplayer_test::OpenMediaL ),
+        ENTRY( "SetGenericParamAccessPoint", Cmpxvideoplayer_test::SetGenericParamAccessPointL ),
+        ENTRY( "OpenFileEmbeddedPdl", Cmpxvideoplayer_test::OpenFileEmbeddedPdlL ),
+        ENTRY( "HandleMessageEmbeddedPdl", Cmpxvideoplayer_test::HandleMessageEmbeddedPdlL ),
+        ENTRY( "StartStandAlone", Cmpxvideoplayer_test::StartStandAloneL ),
+        ENTRY( "HandleCollectionMessage", Cmpxvideoplayer_test::HandleCollectionMessageL ),
+        ENTRY( "HandleCollectionMedia", Cmpxvideoplayer_test::HandleCollectionMediaL ),
+        ENTRY( "HandleSoftkeyBack", Cmpxvideoplayer_test::HandleSoftkeyBackL ),
+        ENTRY( "HandleOpenPlaylist", Cmpxvideoplayer_test::HandleOpenPlaylistL ),
+        ENTRY( "HandleOpenMedia", Cmpxvideoplayer_test::HandleOpenMediaL ),
+        ENTRY( "HandleViewActivation", Cmpxvideoplayer_test::HandleViewActivation ),
+        ENTRY( "ProcessCommandParameters", Cmpxvideoplayer_test::ProcessCommandParametersL ),
+        ENTRY( "HandleMessageActivationMessageL", Cmpxvideoplayer_test::HandleMessageActivationMessageL ),
+        ENTRY( "GetViewDepth", Cmpxvideoplayer_test::GetViewDepthL ),
+        ENTRY( "ClearPdlInformation", Cmpxvideoplayer_test::ClearPdlInformation ),
+        ENTRY( "ClearPlaybackUtility", Cmpxvideoplayer_test::ClearPlaybackUtilityL ),
+        ENTRY( "ActivateLateConstructTimer", Cmpxvideoplayer_test::ActivateLateConstructTimerL ),        
+        ENTRY( "HandleEmbeddedOpen", Cmpxvideoplayer_test::HandleEmbeddedOpenL ),
+    };
+
+    const TInt count = sizeof( KFunctions ) / sizeof( TStifFunctionInfo );
+
+    return RunInternalL( KFunctions, count, aItem );
+}
+
+// -----------------------------------------------------------------------------
+//   Cmpxvideoplayer_test::CreateEngineL
+// -----------------------------------------------------------------------------
+//
+TInt Cmpxvideoplayer_test::CreateEngineL( CStifItemParser& aItem )
+{
+    iAppUiEngineTester = CMpxVideoPlayer_AppUiEngineTester::NewL( this );
+
+    return iAppUiEngineTester->CreateEngineL( aItem );
+}
+
+// -----------------------------------------------------------------------------
+//   Cmpxvideoplayer_test::CreateGenericParametersL
+// -----------------------------------------------------------------------------
+//
+TInt Cmpxvideoplayer_test::CreateGenericParametersTerminateL()
+{
+    return iAppUiEngineTester->CreateGenericParametersTerminateL();
+}
+
+// -----------------------------------------------------------------------------
+//   Cmpxvideoplayer_test::OpenFileL
+// -----------------------------------------------------------------------------
+//
+TInt Cmpxvideoplayer_test::OpenFileL( CStifItemParser& aItem )
+{
+    return iAppUiEngineTester->OpenFileL( aItem );
+}
+
+// -----------------------------------------------------------------------------
+//   Cmpxvideoplayer_test::OpenMediaL
+// -----------------------------------------------------------------------------
+//
+TInt Cmpxvideoplayer_test::OpenMediaL( CStifItemParser& aItem )
+{
+    return iAppUiEngineTester->OpenMediaL( aItem );
+}
+
+// -----------------------------------------------------------------------------
+//   Cmpxvideoplayer_test::SetGenericParamAccessPointL
+// -----------------------------------------------------------------------------
+//
+TInt Cmpxvideoplayer_test::SetGenericParamAccessPointL( CStifItemParser& aItem )
+{
+    return iAppUiEngineTester->SetGenericParamAccessPointL( aItem );
+}
+
+// -----------------------------------------------------------------------------
+//   Cmpxvideoplayer_test::OpenFileEmbeddedPdlL
+// -----------------------------------------------------------------------------
+//
+TInt Cmpxvideoplayer_test::OpenFileEmbeddedPdlL( CStifItemParser& aItem )
+{
+    return iAppUiEngineTester->OpenFileEmbeddedPdlL( aItem );
+}
+
+// -----------------------------------------------------------------------------
+//   Cmpxvideoplayer_test::HandleMessageEmbeddedPdlL
+// -----------------------------------------------------------------------------
+//
+TInt Cmpxvideoplayer_test::HandleMessageEmbeddedPdlL( CStifItemParser& aItem )
+{
+    return iAppUiEngineTester->HandleMessageEmbeddedPdlL( aItem );
+}
+
+// -----------------------------------------------------------------------------
+//   Cmpxvideoplayer_test::StartStandAloneL
+// -----------------------------------------------------------------------------
+//
+TInt Cmpxvideoplayer_test::StartStandAloneL( CStifItemParser& aItem )
+{
+    return iAppUiEngineTester->StartStandAloneL( aItem );
+}
+
+// -----------------------------------------------------------------------------
+//   Cmpxvideoplayer_test::HandleCollectionMessageL
+// -----------------------------------------------------------------------------
+//
+TInt Cmpxvideoplayer_test::HandleCollectionMessageL( CStifItemParser& aItem )
+{
+    return iAppUiEngineTester->HandleCollectionMessageL( aItem );
+}
+
+// -----------------------------------------------------------------------------
+//   Cmpxvideoplayer_test::HandleCollectionMediaL
+// -----------------------------------------------------------------------------
+//
+TInt Cmpxvideoplayer_test::HandleCollectionMediaL( CStifItemParser& aItem )
+{
+    return iAppUiEngineTester->HandleCollectionMediaL( aItem );
+}
+
+// -----------------------------------------------------------------------------
+//   Cmpxvideoplayer_test::HandleSoftkeyBackL
+// -----------------------------------------------------------------------------
+//
+TInt Cmpxvideoplayer_test::HandleSoftkeyBackL( CStifItemParser& aItem )
+{
+    return iAppUiEngineTester->HandleSoftkeyBackL( aItem );
+}
+
+// -----------------------------------------------------------------------------
+//   Cmpxvideoplayer_test::HandleOpenPlaylistL
+// -----------------------------------------------------------------------------
+//
+TInt Cmpxvideoplayer_test::HandleOpenPlaylistL( CStifItemParser& aItem )
+{
+    return iAppUiEngineTester->HandleOpenPlaylistL( aItem );
+}
+
+// -----------------------------------------------------------------------------
+//   Cmpxvideoplayer_test::HandleOpenMediaL
+// -----------------------------------------------------------------------------
+//
+TInt Cmpxvideoplayer_test::HandleOpenMediaL( CStifItemParser& aItem )
+{
+    return iAppUiEngineTester->HandleOpenMediaL( aItem );
+}
+
+// -----------------------------------------------------------------------------
+//   Cmpxvideoplayer_test::HandleViewActivation
+// -----------------------------------------------------------------------------
+//
+TInt Cmpxvideoplayer_test::HandleViewActivation( CStifItemParser& aItem )
+{
+    return iAppUiEngineTester->HandleViewActivation( aItem );
+}
+
+// -----------------------------------------------------------------------------
+//   Cmpxvideoplayer_test::ProcessCommandParametersL
+// -----------------------------------------------------------------------------
+//
+TInt Cmpxvideoplayer_test::ProcessCommandParametersL( CStifItemParser& aItem )
+{
+    return iAppUiEngineTester->ProcessCommandParametersL( aItem );
+}
+
+// -----------------------------------------------------------------------------
+//   Cmpxvideoplayer_test::HandleMessageActivationMessageL
+// -----------------------------------------------------------------------------
+//
+TInt Cmpxvideoplayer_test::HandleMessageActivationMessageL( CStifItemParser& aItem )
+{
+    return iAppUiEngineTester->HandleMessageActivationMessageL( aItem );
+}
+
+// -----------------------------------------------------------------------------
+//   Cmpxvideoplayer_test::GetViewDepthL
+// -----------------------------------------------------------------------------
+//
+TInt Cmpxvideoplayer_test::GetViewDepthL( CStifItemParser& aItem )
+{
+    return iAppUiEngineTester->GetViewDepthL( aItem );
+}
+
+// -----------------------------------------------------------------------------
+//   Cmpxvideoplayer_test::ClearPdlInformation
+// -----------------------------------------------------------------------------
+//
+TInt Cmpxvideoplayer_test::ClearPdlInformation()
+{
+    iAppUiEngineTester->ClearPdlInformation();
+    return KErrNone;
+}
+
+// -----------------------------------------------------------------------------
+//   Cmpxvideoplayer_test::ClearPlaybackUtilityL
+// -----------------------------------------------------------------------------
+//
+TInt Cmpxvideoplayer_test::ClearPlaybackUtilityL( CStifItemParser& aItem )
+{
+    return iAppUiEngineTester->ClearPlaybackUtilityL( aItem );    
+}
+
+// -----------------------------------------------------------------------------
+//   Cmpxvideoplayer_test::HandleEmbeddedOpenL
+// -----------------------------------------------------------------------------
+//
+TInt Cmpxvideoplayer_test::HandleEmbeddedOpenL( CStifItemParser& aItem )
+{
+    return iAppUiEngineTester->HandleEmbeddedOpenL( aItem );    
+}
+
+// -----------------------------------------------------------------------------
+//   Cmpxvideoplayer_test::ActivateLateConstructTimerL
+// -----------------------------------------------------------------------------
+//
+TInt Cmpxvideoplayer_test::ActivateLateConstructTimerL( CStifItemParser& aItem )
+{
+    return iAppUiEngineTester->ActivateLateConstructTimerL( aItem );    
+}
+//  [End of File] - Do not remove
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/src/mpxviewutilityimp_stub.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,285 @@
+/*
+* 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:  mpx video utility stub for STIF testing
+*
+*/
+
+// Version : %version: ou1cpsw#5 %
+
+
+#include "mpxviewutilityimp_stub.h"
+#include "mpxvideoplayerconstants.h"
+#include "stifutilities.h"
+#include "mpxvideo_debug.h"
+
+
+MMPXViewUtility* MMPXViewUtility::UtilityL()
+{
+    return CMPXViewUtility::UtilityL();
+}
+
+// ---------------------------------------------------------------------------
+// Retrieves view utility from TLS. Creates if it's not there.
+// ---------------------------------------------------------------------------
+//
+MMPXViewUtility* CMPXViewUtility::UtilityL()
+{
+    MPX_ENTER_EXIT(_L("CMPXViewUtility::UtilityL()"));
+
+    StifUtilities* utility = reinterpret_cast<StifUtilities*>( Dll::Tls() );
+
+    if ( ! utility )
+    {
+        utility = new (ELeave) StifUtilities;
+
+        Dll::SetTls( utility );
+    }
+
+    if ( ! utility->iViewUtility )
+    {
+        utility->iViewUtility = CMPXViewUtility::NewL();
+    }
+
+    utility->iViewUtility->iRefCount++;
+
+    return utility->iViewUtility;
+}
+
+CMPXViewUtility::CMPXViewUtility()
+    : iViewHistoryDepth( 0 )
+    , iViewTypeUid(KNullUid)
+{
+}
+
+CMPXViewUtility::~CMPXViewUtility()
+{
+    MPX_ENTER_EXIT(_L("CMPXViewUtility::~CMPXViewUtility()"));
+    iObservers.Reset();
+}
+
+void CMPXViewUtility::ConstructL()
+{
+}
+
+
+CMPXViewUtility* CMPXViewUtility::NewL()
+{
+    MPX_ENTER_EXIT(_L("CMPXViewUtility::NewL()"));
+
+    CMPXViewUtility* self = new ( ELeave ) CMPXViewUtility();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+}
+
+void CMPXViewUtility::AddObserverL( MMPXViewActivationObserver* aObserver )
+{
+    MPX_ENTER_EXIT(_L("CMPXViewUtility::AddObserverL()"));
+
+    if ( aObserver )
+    {
+        iObservers.AppendL( aObserver );
+    }
+}
+
+void CMPXViewUtility::RemoveObserver( MMPXViewActivationObserver* aObserver )
+{
+    MPX_ENTER_EXIT(_L("CMPXViewUtility::RemoveObserver()"));
+
+    TInt index = iObservers.Find( aObserver );
+
+    if ( index >= 0 )
+    {
+        iObservers.Remove( index );
+    }
+}
+
+TUid CMPXViewUtility::ConstructDefaultViewHistoryL()
+{
+    MPX_ENTER_EXIT(_L("CMPXViewUtility::ConstructDefaultViewHistoryL()"));
+
+    return KNullUid;
+}
+
+void CMPXViewUtility::Close()
+{
+    MPX_ENTER_EXIT(_L("CMPXViewUtility::Close()"),
+                   _L("iRefCount = %d"), iRefCount );
+
+    if ( --iRefCount == 0 )
+    {
+        StifUtilities* utility = reinterpret_cast<StifUtilities*>( Dll::Tls() );
+
+        utility->DeleteViewUtility();
+    }
+}
+
+void CMPXViewUtility::PreLoadViewL( const TUid& aUid )
+{
+    MPX_ENTER_EXIT(_L("CMPXViewUtility::PreLoadViewL()"));
+
+    iViewTypeUid = aUid;
+
+    if ( iStifObserver )
+    {
+        TCallbackEvent* event = new TCallbackEvent;
+        event->iEvent = EViewUtilityPreLoadView;
+        event->iUid   = aUid;
+        iStifObserver->HandleUtilityEvent( event );
+    }
+}
+
+void CMPXViewUtility::ActivateViewL( const RArray<TUid>& aUids, const TDesC* /*aParam*/ )
+{
+    MPX_ENTER_EXIT(_L("CMPXViewUtility::ActivateViewL(RArray<TUid>)"));
+
+    TBool pdlView = EFalse;
+
+    //
+    //  Check if the PDL view is in the array
+    //
+    for ( TInt i = 0 ; i < aUids.Count() ; i++ )
+    {
+        if ( aUids[i] == KVideoPdlPlaybackViewUid )
+        {
+            pdlView = ETrue;
+            break;
+        }
+    }
+
+    if ( iStifObserver )
+    {
+        TCallbackEvent* event = new TCallbackEvent;
+
+        if ( pdlView )
+        {
+            event->iEvent = EViewUtilityActivatePdlView;
+        }
+        else
+        {
+            event->iEvent = EViewUtilityActivateView;
+        }
+
+        iStifObserver->HandleUtilityEvent( event );
+    }
+}
+
+void CMPXViewUtility::ActivateViewL( const TUid& aUid, const TDesC* /*aParam*/ )
+{
+    MPX_ENTER_EXIT(_L("CMPXViewUtility::ActivateViewL( TUid )"));
+
+    if ( iStifObserver )
+    {
+        TCallbackEvent* event = new TCallbackEvent;
+        event->iEvent = EViewUtilityActivateViewUid;
+        event->iUid   = aUid;
+        iStifObserver->HandleUtilityEvent( event );
+    }
+}
+
+void CMPXViewUtility::SetAsDefaultViewL( const TUid& aUid )
+{
+    MPX_ENTER_EXIT(_L("CMPXViewUtility::SetAsDefaultViewL()"));
+
+    if ( iStifObserver )
+    {
+        TCallbackEvent* event = new TCallbackEvent;
+        event->iEvent = EViewUtilitySetAsDefaultView;
+        event->iUid   = aUid;
+        iStifObserver->HandleUtilityEvent( event );
+    }
+}
+
+void CMPXViewUtility::ActivatePreviousViewL()
+{
+    MPX_ENTER_EXIT(_L("CMPXViewUtility::ActivatePreviousViewL()"));
+
+    if ( iStifObserver )
+    {
+        TCallbackEvent* event = new TCallbackEvent;
+        event->iEvent = EViewUtilityActivatePreviousView;
+        iStifObserver->HandleUtilityEvent( event );
+    }
+
+}
+
+TInt CMPXViewUtility::ViewHistoryDepth()
+{
+    return iViewHistoryDepth;
+}
+
+TUid CMPXViewUtility::ActiveViewImplementationUid()
+{
+    return KNullUid;
+}
+
+TUid CMPXViewUtility::ActiveViewType()
+{
+    MPX_DEBUG(_L("CMPXViewUtility::ActiveViewType(0x%x)"), iViewTypeUid.iUid );
+    return iViewTypeUid;
+}
+
+TUid CMPXViewUtility::PreviousViewType()
+{
+    return KNullUid;
+}
+
+TUid CMPXViewUtility::DefaultViewUid()
+{
+    return KNullUid;
+}
+
+void CMPXViewUtility::PushDefaultHistoryL()
+{
+}
+
+MMPXViewPluginManager& CMPXViewUtility::ViewPluginManager()
+{
+}
+
+void CMPXViewUtility::PreLoadViewsL()
+{
+}
+
+void CMPXViewUtility::SetAsDefaultViewL( const RArray<TUid>& /*aUids*/ )
+{
+}
+
+void CMPXViewUtility::AddStifObserverL( MAppUiEngineStifTestObserver* aObserver )
+{
+    MPX_ENTER_EXIT(_L("CMPXViewUtility::AddStifObserverL()"));
+
+    iStifObserver = aObserver;
+}
+
+void CMPXViewUtility::RemoveStifObserver()
+{
+    MPX_ENTER_EXIT(_L("CMPXViewUtility::RemoveStifObserver()"));
+
+    iStifObserver = NULL;
+}
+
+void CMPXViewUtility::SetViewHistoryDepth( TInt aDepth )
+{
+    MPX_DEBUG(_L("CMPXViewUtility::CMPXViewUtility::SetViewHistoryDepth(%d)"), aDepth);
+
+    iViewHistoryDepth = aDepth;
+}
+
+void CMPXViewUtility::PreLoadViewsL( const TUid& /* aUid */ )
+{
+    MPX_ENTER_EXIT(_L("CMPXViewUtility::PreLoadViewsL( aUid )"));
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/src/stifutilities.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,54 @@
+/*
+* 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:  mpx utilities class stub for STIF testing
+*
+*/
+
+// Version : %version: ou1cpsw#2 %
+
+#include "stifutilities.h"
+
+void StifUtilities::DeleteCollectionUtility()
+{
+    delete iCollectionUtility;
+    iCollectionUtility = NULL;
+
+    CloseUtility();
+}
+
+void StifUtilities::DeleteViewUtility()
+{
+    delete iViewUtility;
+    iViewUtility = NULL;
+
+    CloseUtility();
+}
+
+void StifUtilities::DeletePlaybackUtility()
+{
+    delete iPlaybackUtility;
+    iPlaybackUtility = NULL;
+
+    CloseUtility();
+}
+
+void StifUtilities::CloseUtility()
+{
+    if ( iCollectionUtility == NULL && iPlaybackUtility == NULL && iViewUtility == NULL )
+    {
+        delete this;
+
+        Dll::SetTls( NULL );
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/src/timeoutcontroller.cpp	Thu Nov 04 11:16:56 2010 +0200
@@ -0,0 +1,215 @@
+/*
+* 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:  Timeout controller
+*
+*/
+
+// Version : %version: ou1cpsw#3 %
+
+
+#include "timeoutcontroller.h"
+#include "mpxvideo_debug.h"
+
+
+/*
+-------------------------------------------------------------------------------
+Class: CSimpleTimeout
+Method: CSimpleTimeout
+Description: Default constructor
+C++ default constructor can NOT contain any code, that might leave.
+Parameters: None
+Return Values: None
+Errors/Exceptions: None
+Status: Approved
+-------------------------------------------------------------------------------
+*/
+CSimpleTimeout::CSimpleTimeout()
+    : CActive (CActive::EPriorityStandard)
+{
+    MPX_DEBUG(_L("CSimpleTimeout::CSimpleTimeout"));
+}
+
+// -----------------------------------------------------------------------------
+// CSimpleTimeout::ConstructL()
+// Symbian OS second phase constructor.
+// -----------------------------------------------------------------------------
+//
+void
+CSimpleTimeout::ConstructL( MTimeoutObserver* aObserver )
+{
+    MPX_DEBUG(_L("CSimpleTimeout::ConstructL"));
+
+    iObserver = aObserver;
+    iTimer.CreateLocal();
+    iTestCaseTimeout = 0;  // Initialize
+
+    // Add to active scheduler
+    CActiveScheduler::Add ( this );
+}
+
+// -----------------------------------------------------------------------------
+// CSimpleTimeout::NewL()
+// Two-phased constructor.
+// Returns: CSimpleTimeout* : pointer to created object
+// -----------------------------------------------------------------------------
+//
+CSimpleTimeout*
+CSimpleTimeout::NewL( MTimeoutObserver* aTestClass )
+{
+    MPX_DEBUG(_L("CSimpleTimeout::NewL"));
+
+    CSimpleTimeout* self = new ( ELeave ) CSimpleTimeout();
+    CleanupStack::PushL( self );
+    self->ConstructL( aTestClass );
+    CleanupStack::Pop( self );
+
+    return self;
+}
+
+// -----------------------------------------------------------------------------
+// CSimpleTimeout::~CSimpleTimeout()
+// Destructor.
+// -----------------------------------------------------------------------------
+//
+CSimpleTimeout::~CSimpleTimeout()
+{
+    MPX_DEBUG(_L("CSimpleTimeout::~CSimpleTimeout"));
+    Cancel();
+    iTimer.Close();
+}
+
+// -----------------------------------------------------------------------------
+// CSimpleTimeout::Start()
+// Start timeout counting.
+// -----------------------------------------------------------------------------
+//
+void
+CSimpleTimeout::Start( TTimeIntervalMicroSeconds aTimeout )
+{
+    MPX_DEBUG(_L("CSimpleTimeout::Start"));
+
+    if ( IsActive() )
+    {
+        Cancel();
+    }
+
+    // Request timer
+    TTime endTime;
+    endTime.HomeTime();
+    endTime = endTime + aTimeout;
+
+    TInt64 miliseconds = aTimeout.Int64();
+    miliseconds /= 1000;
+
+    TBuf<30> dateString;
+    TRAP_IGNORE(endTime.FormatL(dateString, KFormatTimeStamp));
+
+    // Store absolute timeout
+    iTestCaseTimeout = endTime;
+
+    // Taken from STIF engine
+    // Note: iTimer.After() method cannot use because there needed
+    // TTimeIntervalMicroSeconds32 and it is 32 bit. So then cannot create
+    // timeout time that is long enough. At() uses 64 bit value=>Long enough.
+    iTimer.At( iStatus, endTime );
+    SetActive();
+}
+
+// -----------------------------------------------------------------------------
+// CSimpleTimeout::Stop()
+// Start timeout counting.
+// -----------------------------------------------------------------------------
+//
+void
+CSimpleTimeout::Stop()
+{
+    MPX_DEBUG(_L("CSimpleTimeout::Stop"));
+
+    if ( IsActive() )
+    {
+        Cancel();
+    }
+}
+
+// -----------------------------------------------------------------------------
+// CSimpleTimeout::RunL()
+// RunL handles completed timeouts.
+// -----------------------------------------------------------------------------
+//
+void
+CSimpleTimeout::RunL()
+{
+    MPX_DEBUG(_L("CSimpleTimeout::RunL"));
+
+    TTime timeout;
+    timeout.HomeTime();
+
+    // Handle the abort case when system time gets changed, but timeout is
+    // still valid. All other cases should timeout since they invalidate the
+    // logic of the timers.
+    if ( iStatus == KErrAbort)
+    {
+        if ( iTestCaseTimeout > timeout )
+        {
+            MPX_DEBUG(_L(
+                "Absolute timer still valid. Restaring timer. iStatus: %d" ),
+                iStatus.Int() );
+
+            // Start new timer
+            iStatus = KErrNone; // reset value
+            iTimer.At ( iStatus, iTestCaseTimeout );  // restart timer
+            SetActive();
+        }
+        else
+        {
+            // Absolute timer no longer valid. Must timeout.
+            iObserver->HandleTimeout(KErrNone);
+        }
+
+    }
+    else
+    {
+        // Status was not KErrAbort. Timing out!
+        // iLog->Log(_L("CSimpleTimeout::RunL - Timeout !!"), iTimeout);
+        iObserver->HandleTimeout(KErrNone);
+    }
+}
+
+// -----------------------------------------------------------------------------
+// CSimpleTimeout::DoCancel()
+// Cancel active request.
+// -----------------------------------------------------------------------------
+//
+void
+CSimpleTimeout::DoCancel()
+{
+    MPX_DEBUG(_L("CSimpleTimeout::DoCancel"));
+    iTimer.Cancel();
+}
+
+// -----------------------------------------------------------------------------
+// CSimpleTimeout::RunError()
+// Handle errors. Just let framework handle errors because
+// RunL does not leave.
+// Returns: Symbian OS error code
+// -----------------------------------------------------------------------------
+//
+TInt CSimpleTimeout::RunError( TInt aError )
+{
+    MPX_DEBUG(_L("CSimpleTimeout::RunError"));
+    iObserver->HandleTimeout(aError);
+    return aError;
+}
+
+// EOF